Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <string.h> int main(void) { int a; int b = 0; int c = 0; scanf("%d",&a); /* 文字列入力 */ int e = a; while(a){ b = a % 10; c = c + b; a = a / 10; } int d = e % c; if(d == 0){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120747/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120747/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %c.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %1 = phi i32 [ %div, %while.body ], [ %0, %entry ] %rem = srem i32 %1, 10 %add = add nsw i32 %c.07, %rem %div = sdiv i32 %1, 10 %.off = add i32 %1, 9 %tobool.not = icmp ult i32 %.off, 19 br i1 %tobool.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %div, ptr %a, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %c.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ] %rem1 = srem i32 %0, %c.0.lcssa %cmp = icmp eq i32 %rem1, 0 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ // Your code here! int a = 0; char s[11]; scanf("%s",s); for(int i = 0; i < strlen(s); i++) { a += s[i]-48; } printf("%s\n",(atol(s)%a == 0)? "Yes":"No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120790/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120790/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #8 %cmp14.not = icmp eq i64 %call2, 0 br i1 %cmp14.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %call2, 8 br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %call2, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %0 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 1, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load20 = load <4 x i8>, ptr %1, align 1, !tbaa !5 %2 = sext <4 x i8> %wide.load to <4 x i32> %3 = sext <4 x i8> %wide.load20 to <4 x i32> %4 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %5 = add <4 x i32> %vec.phi19, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %4, %2 %7 = add <4 x i32> %5, %3 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %call2, %n.vec br i1 %cmp.n, label %for.cond.cleanup.loopexit, label %for.body.preheader21 for.body.preheader21: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %a.015.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.cond.cleanup.loopexit: ; preds = %for.body, %middle.block %add.lcssa = phi i32 [ %9, %middle.block ], [ %add, %for.body ] %10 = sext i32 %add.lcssa to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %a.0.lcssa = phi i64 [ 0, %entry ], [ %10, %for.cond.cleanup.loopexit ] %call.i = call i64 @strtol(ptr nocapture noundef nonnull %s, ptr noundef null, i32 noundef 10) #7 %rem = srem i64 %call.i, %a.0.lcssa %cmp8 = icmp eq i64 %rem, 0 %cond = select i1 %cmp8, ptr @.str.2, ptr @.str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #7 ret i32 0 for.body: ; preds = %for.body.preheader21, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader21 ] %a.015 = phi i32 [ %add, %for.body ], [ %a.015.ph, %for.body.preheader21 ] %arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv %11 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %11 to i32 %sub = add i32 %a.015, -48 %add = add i32 %sub, %conv4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call2 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include<stdio.h> int main(){ int N; scanf("%d", &N); int s=0; int m=N; for(int i=0; i<10; i++){ s+=m%10; m/=10; } if(N%s==0){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120848/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %rem = srem i32 %0, 10 %div = sdiv i32 %0, 10 %rem.1 = srem i32 %div, 10 %add.1 = add nsw i32 %rem.1, %rem %div.1 = sdiv i32 %0, 100 %rem.2 = srem i32 %div.1, 10 %add.2 = add nsw i32 %rem.2, %add.1 %div.2 = sdiv i32 %0, 1000 %rem.3 = srem i32 %div.2, 10 %add.3 = add nsw i32 %rem.3, %add.2 %div.3 = sdiv i32 %0, 10000 %rem.4 = srem i32 %div.3, 10 %add.4 = add nsw i32 %rem.4, %add.3 %div.4 = sdiv i32 %0, 100000 %rem.5.lhs.trunc = trunc i32 %div.4 to i16 %rem.512 = srem i16 %rem.5.lhs.trunc, 10 %rem.5.sext = sext i16 %rem.512 to i32 %add.5 = add nsw i32 %add.4, %rem.5.sext %div.5 = sdiv i32 %0, 1000000 %rem.6.lhs.trunc = trunc i32 %div.5 to i16 %rem.613 = srem i16 %rem.6.lhs.trunc, 10 %rem.6.sext = sext i16 %rem.613 to i32 %add.6 = add nsw i32 %add.5, %rem.6.sext %div.6 = sdiv i32 %0, 10000000 %rem.7.lhs.trunc = trunc i32 %div.6 to i16 %rem.714 = srem i16 %rem.7.lhs.trunc, 10 %rem.7.sext = sext i16 %rem.714 to i32 %add.7 = add nsw i32 %add.6, %rem.7.sext %div.7 = sdiv i32 %0, 100000000 %rem.8.lhs.trunc = trunc i32 %div.7 to i8 %rem.815 = srem i8 %rem.8.lhs.trunc, 10 %rem.8.sext = sext i8 %rem.815 to i32 %add.8 = add nsw i32 %add.7, %rem.8.sext %div.8 = sdiv i32 %0, 1000000000 %add.9 = add nsw i32 %div.8, %add.8 %rem1 = srem i32 %0, %add.9 %cmp2 = icmp eq i32 %rem1, 0 %str.3.str = select i1 %cmp2, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ // Your code here! int n,m; long int k; scanf("%d %d %ld",&n,&m,&k); long int a[200000]={}; long int as[200001]={}; for(int i=0;i<n;i++){ scanf("%ld",&a[i]); if(i==0){ as[i]=0; } as[i+1]=as[i]+a[i]; //printf("%d %d\n",a[i],as[i]); }//printf("\n"); long int b[200000]={}; long int bs[200001]={}; for(int i=0;i<m;i++){ scanf("%ld",&b[i]); if(i==0){ bs[i]=0; } bs[i+1]=bs[i]+b[i]; //printf("%d ",bs[i]); }//printf("\n"); int num=0; int mo=m; for(int i=0;i<=n;i++){ if(as[i]>k)break; for(int j=mo;j>=0;j--){ if(as[i]+bs[j]<=k){ if(i+j>num)num=i+j; mo=j; break; } } } printf("%d\n",num); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120905/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120905/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d %d %ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %k = alloca i64, align 8 %a = alloca [200000 x i64], align 16 %as = alloca [200001 x i64], align 16 %b = alloca [200000 x i64], align 16 %bs = alloca [200001 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k) call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600000) %a, i8 0, i64 1600000, i1 false) call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %as) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600008) %as, i8 0, i64 1600008, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp96 = icmp sgt i32 %0, 0 br i1 %cmp96, label %if.end.peel, label %for.cond.cleanup if.end.peel: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) store i64 0, ptr %as, align 16, !tbaa !9 %1 = load i64, ptr %a, align 16, !tbaa !9 %arrayidx11.peel = getelementptr inbounds [200001 x i64], ptr %as, i64 0, i64 1 store i64 %1, ptr %arrayidx11.peel, align 8, !tbaa !9 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %2, 1 br i1 %cmp.peel, label %if.end, label %for.cond.cleanup for.cond.cleanup: ; preds = %if.end, %if.end.peel, %entry %3 = phi i32 [ %0, %entry ], [ %2, %if.end.peel ], [ %9, %if.end ] call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600000) %b, i8 0, i64 1600000, i1 false) call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %bs) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600008) %bs, i8 0, i64 1600008, i1 false) %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp1498 = icmp sgt i32 %4, 0 br i1 %cmp1498, label %if.end24.peel, label %for.cond37.preheader if.end24.peel: ; preds = %for.cond.cleanup %call19.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) store i64 0, ptr %bs, align 16, !tbaa !9 %5 = load i64, ptr %b, align 16, !tbaa !9 %arrayidx32.peel = getelementptr inbounds [200001 x i64], ptr %bs, i64 0, i64 1 store i64 %5, ptr %arrayidx32.peel, align 8, !tbaa !9 %6 = load i32, ptr %m, align 4, !tbaa !5 %cmp14.peel = icmp sgt i32 %6, 1 br i1 %cmp14.peel, label %if.end24, label %for.cond37.preheader.loopexit if.end: ; preds = %if.end.peel, %if.end %7 = phi i64 [ %add, %if.end ], [ %1, %if.end.peel ] %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %arrayidx = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %8 = load i64, ptr %arrayidx, align 8, !tbaa !9 %add = add nsw i64 %8, %7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx11 = getelementptr inbounds [200001 x i64], ptr %as, i64 0, i64 %indvars.iv.next store i64 %add, ptr %arrayidx11, align 8, !tbaa !9 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp, label %if.end, label %for.cond.cleanup, !llvm.loop !11 for.cond37.preheader.loopexit: ; preds = %if.end24, %if.end24.peel %.lcssa110 = phi i32 [ %6, %if.end24.peel ], [ %16, %if.end24 ] %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond37.preheader for.cond37.preheader: ; preds = %for.cond37.preheader.loopexit, %for.cond.cleanup %11 = phi i32 [ %3, %for.cond.cleanup ], [ %.pre, %for.cond37.preheader.loopexit ] %.lcssa = phi i32 [ %4, %for.cond.cleanup ], [ %.lcssa110, %for.cond37.preheader.loopexit ] %cmp38.not102 = icmp slt i32 %11, 0 br i1 %cmp38.not102, label %cleanup67, label %for.body40.lr.ph for.body40.lr.ph: ; preds = %for.cond37.preheader %12 = load i64, ptr %k, align 8, !tbaa !9 %13 = add nuw i32 %11, 1 %wide.trip.count = zext i32 %13 to i64 br label %for.body40 if.end24: ; preds = %if.end24.peel, %if.end24 %14 = phi i64 [ %add29, %if.end24 ], [ %5, %if.end24.peel ] %indvars.iv113 = phi i64 [ %indvars.iv.next114, %if.end24 ], [ 1, %if.end24.peel ] %arrayidx18 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %indvars.iv113 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx18) %15 = load i64, ptr %arrayidx18, align 8, !tbaa !9 %add29 = add nsw i64 %15, %14 %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %arrayidx32 = getelementptr inbounds [200001 x i64], ptr %bs, i64 0, i64 %indvars.iv.next114 store i64 %add29, ptr %arrayidx32, align 8, !tbaa !9 %16 = load i32, ptr %m, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp14 = icmp slt i64 %indvars.iv.next114, %17 br i1 %cmp14, label %if.end24, label %for.cond37.preheader.loopexit, !llvm.loop !14 for.body40: ; preds = %for.body40.lr.ph, %cleanup %indvars.iv117 = phi i64 [ 0, %for.body40.lr.ph ], [ %indvars.iv.next118, %cleanup ] %mo.0104 = phi i32 [ %.lcssa, %for.body40.lr.ph ], [ %mo.1, %cleanup ] %num.0103 = phi i32 [ 0, %for.body40.lr.ph ], [ %num.2, %cleanup ] %arrayidx42 = getelementptr inbounds [200001 x i64], ptr %as, i64 0, i64 %indvars.iv117 %18 = load i64, ptr %arrayidx42, align 8, !tbaa !9 %cmp43 = icmp sgt i64 %18, %12 br i1 %cmp43, label %cleanup67, label %for.cond46.preheader for.cond46.preheader: ; preds = %for.body40 %cmp47100 = icmp sgt i32 %mo.0104, -1 br i1 %cmp47100, label %for.body49, label %cleanup for.body49: ; preds = %for.cond46.preheader, %for.inc63 %j.0101 = phi i32 [ %dec, %for.inc63 ], [ %mo.0104, %for.cond46.preheader ] %idxprom52 = zext i32 %j.0101 to i64 %arrayidx53 = getelementptr inbounds [200001 x i64], ptr %bs, i64 0, i64 %idxprom52 %19 = load i64, ptr %arrayidx53, align 8, !tbaa !9 %add54 = add nsw i64 %19, %18 %cmp55.not = icmp sgt i64 %add54, %12 br i1 %cmp55.not, label %for.inc63, label %if.then56 if.then56: ; preds = %for.body49 %20 = trunc i64 %indvars.iv117 to i32 %add57 = add nsw i32 %j.0101, %20 %spec.select = call i32 @llvm.smax.i32(i32 %add57, i32 %num.0103) br label %cleanup for.inc63: ; preds = %for.body49 %dec = add nsw i32 %j.0101, -1 %cmp47 = icmp sgt i32 %j.0101, 0 br i1 %cmp47, label %for.body49, label %cleanup, !llvm.loop !15 cleanup: ; preds = %for.inc63, %for.cond46.preheader, %if.then56 %num.2 = phi i32 [ %spec.select, %if.then56 ], [ %num.0103, %for.cond46.preheader ], [ %num.0103, %for.inc63 ] %mo.1 = phi i32 [ %j.0101, %if.then56 ], [ %mo.0104, %for.cond46.preheader ], [ %mo.0104, %for.inc63 ] %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %exitcond.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count br i1 %exitcond.not, label %cleanup67, label %for.body40, !llvm.loop !16 cleanup67: ; preds = %cleanup, %for.body40, %for.cond37.preheader %num.0.lcssa = phi i32 [ 0, %for.cond37.preheader ], [ %num.0103, %for.body40 ], [ %num.2, %cleanup ] %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %bs) #5 call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %as) #5 call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12, !13} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !12, !13} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12}
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef long long ll; int max(int a, int b){ if(a > b) return a; else return b; } int min(int a, int b){ if(a < b) return a; else return b; } int sort(const void *a ,const void *b){ return *(int*)a - *(int*)b; } int main(){ int n,m,k; ll a[200001],b[200001]; a[0] = 0; b[0] = 0; scanf("%d%d%d",&n,&m,&k); for(int i = 1; i <= n; ++i){ scanf("%lld",&a[i]); a[i] += a[i-1]; } for(int i = 1; i <= m; ++i){ scanf("%lld",&b[i]); b[i] += b[i-1]; } int j = m; int ans = 0; for(int i = 0; i < n+1; ++i){ if(a[i] > k) break; while(b[j] > k-a[i]) --j; ans = max(ans, i+j); } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120949/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120949/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [200001 x i64], align 16 %b = alloca [200001 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %b) #6 store i64 0, ptr %a, align 16, !tbaa !9 store i64 0, ptr %b, align 16, !tbaa !9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not71 = icmp slt i32 %0, 1 br i1 %cmp.not71, label %for.cond9.preheader, label %for.body for.cond9.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %6, %for.body ] %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp10.not73 = icmp slt i32 %2, 1 br i1 %cmp10.not73, label %for.cond26.preheader, label %for.body12 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx2 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2) %3 = add nsw i64 %indvars.iv, -1 %arrayidx5 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %3 %4 = load i64, ptr %arrayidx5, align 8, !tbaa !9 %5 = load i64, ptr %arrayidx2, align 8, !tbaa !9 %add = add nsw i64 %5, %4 store i64 %add, ptr %arrayidx2, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp.not.not, label %for.body, label %for.cond9.preheader, !llvm.loop !11 for.cond26.preheader.loopexit: ; preds = %for.body12 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond26.preheader for.cond26.preheader: ; preds = %for.cond26.preheader.loopexit, %for.cond9.preheader %8 = phi i32 [ %1, %for.cond9.preheader ], [ %.pre, %for.cond26.preheader.loopexit ] %.lcssa = phi i32 [ %2, %for.cond9.preheader ], [ %14, %for.cond26.preheader.loopexit ] %cmp28.not75 = icmp slt i32 %8, 0 br i1 %cmp28.not75, label %cleanup, label %for.body30.lr.ph for.body30.lr.ph: ; preds = %for.cond26.preheader %9 = load i32, ptr %k, align 4, !tbaa !5 %conv = sext i32 %9 to i64 %10 = add nuw i32 %8, 1 %wide.trip.count = zext i32 %10 to i64 br label %for.body30 for.body12: ; preds = %for.cond9.preheader, %for.body12 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body12 ], [ 1, %for.cond9.preheader ] %arrayidx14 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv84 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx14) %11 = add nsw i64 %indvars.iv84, -1 %arrayidx18 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %11 %12 = load i64, ptr %arrayidx18, align 8, !tbaa !9 %13 = load i64, ptr %arrayidx14, align 8, !tbaa !9 %add21 = add nsw i64 %13, %12 store i64 %add21, ptr %arrayidx14, align 8, !tbaa !9 %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %14 = load i32, ptr %m, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp10.not.not = icmp slt i64 %indvars.iv84, %15 br i1 %cmp10.not.not, label %for.body12, label %for.cond26.preheader.loopexit, !llvm.loop !13 for.body30: ; preds = %for.body30.lr.ph, %while.end %indvars.iv91 = phi i64 [ 0, %for.body30.lr.ph ], [ %indvars.iv.next92, %while.end ] %ans.077 = phi i32 [ 0, %for.body30.lr.ph ], [ %a.b.i, %while.end ] %j.076 = phi i32 [ %.lcssa, %for.body30.lr.ph ], [ %19, %while.end ] %arrayidx32 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %indvars.iv91 %16 = load i64, ptr %arrayidx32, align 8, !tbaa !9 %cmp33 = icmp sgt i64 %16, %conv br i1 %cmp33, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %for.body30 %sub40 = sub nsw i64 %conv, %16 %17 = sext i32 %j.076 to i64 br label %while.cond while.cond: ; preds = %while.cond, %while.cond.preheader %indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.cond ], [ %17, %while.cond.preheader ] %arrayidx36 = getelementptr inbounds [200001 x i64], ptr %b, i64 0, i64 %indvars.iv88 %18 = load i64, ptr %arrayidx36, align 8, !tbaa !9 %cmp41 = icmp sgt i64 %18, %sub40 %indvars.iv.next89 = add i64 %indvars.iv88, -1 br i1 %cmp41, label %while.cond, label %while.end, !llvm.loop !14 while.end: ; preds = %while.cond %19 = trunc i64 %indvars.iv88 to i32 %20 = trunc i64 %indvars.iv91 to i32 %add43 = add nsw i32 %19, %20 %a.b.i = call i32 @llvm.smax.i32(i32 %ans.077, i32 %add43) %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body30, !llvm.loop !15 cleanup: ; preds = %while.end, %for.body30, %for.cond26.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond26.preheader ], [ %ans.077, %for.body30 ], [ %a.b.i, %while.end ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include <stdio.h> #include <string.h> char a[205], b[205]; int main(){ int k, ans; char *p, *q, *wp, *wq; char *s[3] = { "IDENTICAL", "CLOSE", "DIFFERENT" }; while (scanf("%s", a) && a[0] != '.') { scanf("%s", b); p = a, q = b; ans = -1, k = 0; while (*p && *q) { if (*p != *q) { ans = 2; break; } if (*p == '"') { wp = ++p, wq = ++q; while (*p != '"'){ p++; }while (*q != '"'){ q++; } *p = *q = 0; k += 1 - (strcmp(wp, wq) == 0); if (k > 1) { ans = 2; break; } } p++, q++; } if (ans < 0){ if (*p == *q){ ans = k; }else{ ans = 2; } } puts(s[ans]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120992/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120992/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"IDENTICAL\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"CLOSE\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"DIFFERENT\00", align 1 @reltable.main = private unnamed_addr constant [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @a = dso_local global [205 x i8] zeroinitializer, align 16 @b = dso_local global [205 x i8] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call94 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @a) %tobool95 = icmp ne i32 %call94, 0 %0 = load i8, ptr @a, align 16 %cmp96 = icmp ne i8 %0, 46 %1 = select i1 %tobool95, i1 %cmp96, i1 false br i1 %1, label %while.body, label %while.end55 while.body: ; preds = %entry, %if.end53 %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @b) %2 = load i8, ptr @a, align 16, !tbaa !5 %tobool5.not85 = icmp eq i8 %2, 0 br i1 %tobool5.not85, label %if.then46, label %land.rhs6 land.rhs6: ; preds = %while.body, %if.end40 %3 = phi i8 [ %7, %if.end40 ], [ %2, %while.body ] %k.088 = phi i32 [ %k.1, %if.end40 ], [ 0, %while.body ] %q.087 = phi ptr [ %incdec.ptr42, %if.end40 ], [ @b, %while.body ] %p.086 = phi ptr [ %incdec.ptr41, %if.end40 ], [ @a, %while.body ] %4 = load i8, ptr %q.087, align 1, !tbaa !5 %tobool8.not = icmp eq i8 %4, 0 br i1 %tobool8.not, label %if.then46, label %while.body10 while.body10: ; preds = %land.rhs6 %cmp13.not = icmp eq i8 %3, %4 br i1 %cmp13.not, label %if.end, label %if.end53 if.end: ; preds = %while.body10 %cmp16 = icmp eq i8 %3, 34 br i1 %cmp16, label %if.then18, label %if.end40 if.then18: ; preds = %if.end %incdec.ptr = getelementptr inbounds i8, ptr %p.086, i64 1 br label %while.cond20 while.cond20: ; preds = %while.cond20, %if.then18 %p.1 = phi ptr [ %incdec.ptr, %if.then18 ], [ %incdec.ptr25, %while.cond20 ] %5 = load i8, ptr %p.1, align 1, !tbaa !5 %cmp22.not = icmp eq i8 %5, 34 %incdec.ptr25 = getelementptr inbounds i8, ptr %p.1, i64 1 br i1 %cmp22.not, label %while.cond26.preheader, label %while.cond20, !llvm.loop !8 while.cond26.preheader: ; preds = %while.cond20 %incdec.ptr19 = getelementptr inbounds i8, ptr %q.087, i64 1 br label %while.cond26 while.cond26: ; preds = %while.cond26, %while.cond26.preheader %q.1 = phi ptr [ %incdec.ptr31, %while.cond26 ], [ %incdec.ptr19, %while.cond26.preheader ] %6 = load i8, ptr %q.1, align 1, !tbaa !5 %cmp28.not = icmp eq i8 %6, 34 %incdec.ptr31 = getelementptr inbounds i8, ptr %q.1, i64 1 br i1 %cmp28.not, label %while.end32, label %while.cond26, !llvm.loop !10 while.end32: ; preds = %while.cond26 store i8 0, ptr %q.1, align 1, !tbaa !5 store i8 0, ptr %p.1, align 1, !tbaa !5 %call33 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %incdec.ptr, ptr noundef nonnull dereferenceable(1) %incdec.ptr19) #4 %cmp34 = icmp ne i32 %call33, 0 %sub = zext i1 %cmp34 to i32 %add = add nuw nsw i32 %k.088, %sub %cmp36 = icmp sgt i32 %add, 1 br i1 %cmp36, label %if.end53, label %if.end40 if.end40: ; preds = %while.end32, %if.end %p.2 = phi ptr [ %p.1, %while.end32 ], [ %p.086, %if.end ] %q.2 = phi ptr [ %q.1, %while.end32 ], [ %q.087, %if.end ] %k.1 = phi i32 [ %add, %while.end32 ], [ %k.088, %if.end ] %incdec.ptr41 = getelementptr inbounds i8, ptr %p.2, i64 1 %incdec.ptr42 = getelementptr inbounds i8, ptr %q.2, i64 1 %7 = load i8, ptr %incdec.ptr41, align 1, !tbaa !5 %tobool5.not = icmp eq i8 %7, 0 br i1 %tobool5.not, label %if.then46, label %land.rhs6, !llvm.loop !11 if.then46: ; preds = %if.end40, %land.rhs6, %while.body %8 = phi i8 [ 0, %while.body ], [ %3, %land.rhs6 ], [ 0, %if.end40 ] %q.0.lcssa = phi ptr [ @b, %while.body ], [ %q.087, %land.rhs6 ], [ %incdec.ptr42, %if.end40 ] %k.0.lcssa = phi i32 [ 0, %while.body ], [ %k.088, %land.rhs6 ], [ %k.1, %if.end40 ] %9 = load i8, ptr %q.0.lcssa, align 1, !tbaa !5 %cmp49 = icmp eq i8 %8, %9 %k.2. = select i1 %cmp49, i32 %k.0.lcssa, i32 2 br label %if.end53 if.end53: ; preds = %while.body10, %while.end32, %if.then46 %ans.1 = phi i32 [ %k.2., %if.then46 ], [ 2, %while.end32 ], [ 2, %while.body10 ] %idxprom = zext i32 %ans.1 to i64 %reltable.shift = shl i64 %idxprom, 2 %reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift) %call54 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %reltable.intrinsic) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @a) %tobool = icmp ne i32 %call, 0 %10 = load i8, ptr @a, align 16 %cmp = icmp ne i8 %10, 46 %11 = select i1 %tobool, i1 %cmp, i1 false br i1 %11, label %while.body, label %while.end55, !llvm.loop !12 while.end55: ; preds = %if.end53, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read) declare ptr @llvm.load.relative.i64(ptr, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } attributes #4 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9}
#include <stdio.h> int main(){ int n, i, j, cnt=0, min; char s[300001]; scanf("%d", &n); scanf("%s", s); for(i=1; i<n; i++){ if(s[i] == 'E') cnt++; } min = cnt; for(i=1; i<n; i++){ if(s[i] == 'E') cnt--; if(s[i-1] == 'W') cnt++; if(min > cnt) min = cnt; } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121034/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121034/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca [300001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 300001, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp45 = icmp sgt i32 %0, 1 br i1 %cmp45, label %for.body.preheader, label %for.end30 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %1 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %0, 9 br i1 %min.iters.check, label %for.body.preheader64, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %offset.idx = or i64 %index, 1 %2 = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %offset.idx %wide.load = load <4 x i8>, ptr %2, align 1, !tbaa !9 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load63 = load <4 x i8>, ptr %3, align 1, !tbaa !9 %4 = icmp eq <4 x i8> %wide.load, <i8 69, i8 69, i8 69, i8 69> %5 = icmp eq <4 x i8> %wide.load63, <i8 69, i8 69, i8 69, i8 69> %6 = zext <4 x i1> %4 to <4 x i32> %7 = zext <4 x i1> %5 to <4 x i32> %8 = add <4 x i32> %vec.phi, %6 %9 = add <4 x i32> %vec.phi62, %7 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.cond5.preheader, label %for.body.preheader64 for.body.preheader64: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %cnt.047.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ] br label %for.body for.cond5.preheader: ; preds = %for.body, %middle.block %spec.select.lcssa = phi i32 [ %11, %middle.block ], [ %spec.select, %for.body ] br i1 %cmp45, label %for.body8.preheader, label %for.end30 for.body8.preheader: ; preds = %for.cond5.preheader %.pre = load i8, ptr %s, align 16, !tbaa !9 %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %0, 2 br i1 %12, label %for.end30.loopexit.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %unroll_iter = and i64 %1, -2 br label %for.body8 for.body: ; preds = %for.body.preheader64, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader64 ] %cnt.047 = phi i32 [ %spec.select, %for.body ], [ %cnt.047.ph, %for.body.preheader64 ] %arrayidx = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %indvars.iv %13 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp2 = icmp eq i8 %13, 69 %inc = zext i1 %cmp2 to i32 %spec.select = add nuw nsw i32 %cnt.047, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond5.preheader, label %for.body, !llvm.loop !14 for.body8: ; preds = %for.body8, %for.body8.preheader.new %14 = phi i8 [ %.pre, %for.body8.preheader.new ], [ %16, %for.body8 ] %indvars.iv55 = phi i64 [ 1, %for.body8.preheader.new ], [ %indvars.iv.next56.1, %for.body8 ] %min.052 = phi i32 [ %spec.select.lcssa, %for.body8.preheader.new ], [ %min.1.1, %for.body8 ] %cnt.251 = phi i32 [ %spec.select.lcssa, %for.body8.preheader.new ], [ %cnt.4.1, %for.body8 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ] %arrayidx10 = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %indvars.iv55 %15 = load i8, ptr %arrayidx10, align 1, !tbaa !9 %cmp12 = icmp eq i8 %15, 69 %dec = sext i1 %cmp12 to i32 %spec.select44 = add nsw i32 %cnt.251, %dec %cmp19 = icmp eq i8 %14, 87 %inc22 = zext i1 %cmp19 to i32 %cnt.4 = add nsw i32 %spec.select44, %inc22 %min.1 = call i32 @llvm.smin.i32(i32 %min.052, i32 %cnt.4) %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %arrayidx10.1 = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %indvars.iv.next56 %16 = load i8, ptr %arrayidx10.1, align 1, !tbaa !9 %cmp12.1 = icmp eq i8 %16, 69 %dec.1 = sext i1 %cmp12.1 to i32 %spec.select44.1 = add nsw i32 %cnt.4, %dec.1 %cmp19.1 = icmp eq i8 %15, 87 %inc22.1 = zext i1 %cmp19.1 to i32 %cnt.4.1 = add nsw i32 %spec.select44.1, %inc22.1 %min.1.1 = call i32 @llvm.smin.i32(i32 %min.1, i32 %cnt.4.1) %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end30.loopexit.unr-lcssa, label %for.body8, !llvm.loop !15 for.end30.loopexit.unr-lcssa: ; preds = %for.body8, %for.body8.preheader %min.1.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %min.1.1, %for.body8 ] %.unr = phi i8 [ %.pre, %for.body8.preheader ], [ %16, %for.body8 ] %indvars.iv55.unr = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next56.1, %for.body8 ] %min.052.unr = phi i32 [ %spec.select.lcssa, %for.body8.preheader ], [ %min.1.1, %for.body8 ] %cnt.251.unr = phi i32 [ %spec.select.lcssa, %for.body8.preheader ], [ %cnt.4.1, %for.body8 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end30, label %for.body8.epil for.body8.epil: ; preds = %for.end30.loopexit.unr-lcssa %arrayidx10.epil = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %indvars.iv55.unr %17 = load i8, ptr %arrayidx10.epil, align 1, !tbaa !9 %cmp12.epil = icmp eq i8 %17, 69 %dec.epil = sext i1 %cmp12.epil to i32 %spec.select44.epil = add nsw i32 %cnt.251.unr, %dec.epil %cmp19.epil = icmp eq i8 %.unr, 87 %inc22.epil = zext i1 %cmp19.epil to i32 %cnt.4.epil = add nsw i32 %spec.select44.epil, %inc22.epil %min.1.epil = call i32 @llvm.smin.i32(i32 %min.052.unr, i32 %cnt.4.epil) br label %for.end30 for.end30: ; preds = %for.body8.epil, %for.end30.loopexit.unr-lcssa, %entry, %for.cond5.preheader %min.0.lcssa = phi i32 [ %spec.select.lcssa, %for.cond5.preheader ], [ 0, %entry ], [ %min.1.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %min.1.epil, %for.body8.epil ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 300001, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12} !15 = distinct !{!15, !11}
#include <stdio.h> int main(void) { int n, i, dep = 0, cnt = 0; char s; scanf("%d", &n); for (i = 0; i < n; i++) { scanf(" %c", &s); if (s == 'W') dep++; else if (dep > 0) dep--, cnt++; } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121078/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121078/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %cnt.018 = phi i32 [ %cnt.1, %for.inc ], [ 0, %entry ] %dep.017 = phi i32 [ %dep.1, %for.inc ], [ 0, %entry ] %i.016 = phi i32 [ %inc9, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %1 = load i8, ptr %s, align 1, !tbaa !9 %cmp2 = icmp eq i8 %1, 87 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add nsw i32 %dep.017, 1 br label %for.inc if.else: ; preds = %for.body %cmp4 = icmp sgt i32 %dep.017, 0 br i1 %cmp4, label %if.then6, label %for.inc if.then6: ; preds = %if.else %dec = add nsw i32 %dep.017, -1 %inc7 = add nsw i32 %cnt.018, 1 br label %for.inc for.inc: ; preds = %if.then, %if.then6, %if.else %dep.1 = phi i32 [ %inc, %if.then ], [ %dec, %if.then6 ], [ %dep.017, %if.else ] %cnt.1 = phi i32 [ %cnt.018, %if.then ], [ %inc7, %if.then6 ], [ %cnt.018, %if.else ] %inc9 = add nuw nsw i32 %i.016, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.inc, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %for.inc ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include <time.h> typedef long long llint; typedef long double ldouble; // 小大 int compare(const void *a, const void *b){return *(llint *)a - *(llint *)b;} typedef struct{ llint aa; llint bb; }frequent; // 小大 int cmp( const void *p, const void *q ) { return ((frequent*)p)->bb - ((frequent*)q)->bb; } int main(void){ llint n,i,num1=0,num2=0; scanf("%lld",&n); llint a[n]; for(i=0;i<n;i++){ scanf("%lld",&a[i]); } qsort(a,n,sizeof(llint),compare); for(i=0;i<n-1;i++){ if(a[n-1-i] == a[n-2-i]){ if(num1!=0){ num2=a[n-1-i]; break; }else{ num1=a[n-1-i]; } i++; } } printf("%lld\n",num1*num2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121120/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121120/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.frequent = type { i64, i64 } @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) local_unnamed_addr #0 { entry: %bb = getelementptr inbounds %struct.frequent, ptr %p, i64 0, i32 1 %0 = load i64, ptr %bb, align 8, !tbaa !9 %bb1 = getelementptr inbounds %struct.frequent, ptr %q, i64 0, i32 1 %1 = load i64, ptr %bb1, align 8, !tbaa !9 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp37 = icmp sgt i64 %2, 0 br i1 %cmp37, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.038 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.038 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.038, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i64 [ %2, %entry ], [ %3, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @compare) #6 %4 = load i64, ptr %n, align 8, !tbaa !5 %sub = add nsw i64 %4, -1 %cmp339 = icmp sgt i64 %4, 1 br i1 %cmp339, label %for.body4.preheader, label %for.end24 for.body4.preheader: ; preds = %for.end %invariant.gep = getelementptr i64, ptr %vla, i64 -2 br label %for.body4 for.body4: ; preds = %for.body4.preheader, %for.inc22 %i.141 = phi i64 [ %inc23, %for.inc22 ], [ 0, %for.body4.preheader ] %num1.040 = phi i64 [ %num1.1, %for.inc22 ], [ 0, %for.body4.preheader ] %sub6 = sub nsw i64 %sub, %i.141 %arrayidx7 = getelementptr inbounds i64, ptr %vla, i64 %sub6 %5 = load i64, ptr %arrayidx7, align 8, !tbaa !5 %reass.sub = sub i64 %4, %i.141 %gep = getelementptr i64, ptr %invariant.gep, i64 %reass.sub %6 = load i64, ptr %gep, align 8, !tbaa !5 %cmp11 = icmp eq i64 %5, %6 br i1 %cmp11, label %if.then, label %for.inc22 if.then: ; preds = %for.body4 %cmp12.not = icmp eq i64 %num1.040, 0 br i1 %cmp12.not, label %if.else, label %for.end24.loopexit if.else: ; preds = %if.then %inc20 = add nsw i64 %i.141, 1 br label %for.inc22 for.inc22: ; preds = %for.body4, %if.else %num1.1 = phi i64 [ %5, %if.else ], [ %num1.040, %for.body4 ] %i.2 = phi i64 [ %inc20, %if.else ], [ %i.141, %for.body4 ] %inc23 = add nsw i64 %i.2, 1 %cmp3 = icmp slt i64 %inc23, %sub br i1 %cmp3, label %for.body4, label %for.end24.loopexit, !llvm.loop !13 for.end24.loopexit: ; preds = %if.then, %for.inc22 %num1.0.lcssa.ph = phi i64 [ %num1.1, %for.inc22 ], [ %num1.040, %if.then ] %num2.0.ph = phi i64 [ 0, %for.inc22 ], [ %5, %if.then ] %7 = mul nsw i64 %num2.0.ph, %num1.0.lcssa.ph br label %for.end24 for.end24: ; preds = %for.end24.loopexit, %for.end %mul = phi i64 [ 0, %for.end ], [ %7, %for.end24.loopexit ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"", !6, i64 0, !6, i64 8} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
// AOJ 2792: SNS // 2017.11.24 bal4u@uu #include <stdio.h> int main() { long long a, b, jj, k, t, ans; int n, i, j; scanf("%lld%lld%d", &a, &b, &n); ans = 1LL << 60; for (i = 1; i <= n; i++) { if (b % i) continue; for (k = b/i, jj = k, j = 1; j <= n; j++, jj += k) { t = a - jj; if (t < 0) t = -t; if (t < ans) { ans = t; if (!ans) goto done; } } } done: printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [11 x i8] c"%lld%lld%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not40 = icmp slt i32 %0, 1 br i1 %cmp.not40, label %done, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = load i64, ptr %b, align 8, !tbaa !9 %2 = load i64, ptr %a, align 8 %3 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %3 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc18 %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc18 ] %ans.041 = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %ans.3, %for.inc18 ] %rem = srem i64 %1, %indvars.iv %div = sdiv i64 %1, %indvars.iv %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %for.body5, label %for.inc18 for.body5: ; preds = %for.body, %for.inc %j.039 = phi i32 [ %inc, %for.inc ], [ 1, %for.body ] %ans.138 = phi i64 [ %ans.2, %for.inc ], [ %ans.041, %for.body ] %jj.037 = phi i64 [ %add, %for.inc ], [ %div, %for.body ] %sub = sub nsw i64 %2, %jj.037 %spec.select = call i64 @llvm.abs.i64(i64 %sub, i1 true) %cmp11 = icmp slt i64 %spec.select, %ans.138 br i1 %cmp11, label %if.then13, label %for.inc if.then13: ; preds = %for.body5 %tobool14.not = icmp eq i64 %2, %jj.037 br i1 %tobool14.not, label %done, label %for.inc for.inc: ; preds = %for.body5, %if.then13 %ans.2 = phi i64 [ %spec.select, %if.then13 ], [ %ans.138, %for.body5 ] %inc = add nuw i32 %j.039, 1 %add = add nsw i64 %jj.037, %div %exitcond.not = icmp eq i32 %j.039, %0 br i1 %exitcond.not, label %for.inc18, label %for.body5, !llvm.loop !11 for.inc18: ; preds = %for.inc, %for.body %ans.3 = phi i64 [ %ans.041, %for.body ], [ %ans.2, %for.inc ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond47.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond47.not, label %done, label %for.body, !llvm.loop !13 done: ; preds = %for.inc18, %if.then13, %entry %ans.4 = phi i64 [ 1152921504606846976, %entry ], [ 0, %if.then13 ], [ %ans.3, %for.inc18 ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include <ctype.h> #include <stdint.h> #include <string.h> #include <wchar.h> #include <math.h> #define N_MAX (100) #define P_MAX (100) #define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define ABS(a) ((a) < 0 ? -(a) : (a)) #define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a)) #define SWAP(type, a, b) { const type tmp = a; a = b; b = tmp; } int compare_sz_asc(const void* a, const void* b) { return *((size_t*)a) < *((size_t*)b) ? -1 : 1; } int compare_sz_desc(const void* a, const void* b) { return *((size_t*)a) > * ((size_t*)b) ? -1 : 1; } int compare_i64_asc(const void* a, const void* b) { return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1; } int compare_i64_desc(const void* a, const void* b) { return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1; } int compare_u64_asc(const void* a, const void* b) { return *((uint64_t*)a) < *((uint64_t*)b) ? -1 : 1; } int compare_u64_desc(const void* a, const void* b) { return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1; } int compare_c_asc(const void* a, const void* b) { return *((char*)a) < *((char*)b) ? -1 : 1; } int compare_c_desc(const void* a, const void* b) { return *((char*)a) > * ((char*)b) ? -1 : 1; } int compare_dp_asc(const void* a, const void* b) { return *((double*)a) < *((double*)b) ? -1 : 1; } static uint64_t modinvU64(const uint64_t a, const uint64_t m) { int64_t aa = (int64_t)a; const int64_t mm = (int64_t)m; int64_t b = mm; int64_t u = 1; int64_t v = 0; while (b != 0) { const int64_t t = aa / b; aa -= t * b; SWAP(uint64_t, aa, b); u -= t * v; SWAP(uint64_t, u, v); } u %= mm; if (u < 0) { u += m; } return (uint64_t)u; } static size_t powSz(const size_t base, const size_t exp) { if (exp == 0) { return 1; } if (exp == 1) { return base; } if (exp % 2 == 0) { return powSz(base * base, exp / 2); } else { return base * powSz(base, exp - 1); } } static uint64_t powU64(const uint64_t base, const uint64_t exp) { if (exp == 0) { return 1; } if (exp == 1) { return base; } if (exp % 2 == 0) { return powU64(base * base, exp / 2); } else { return base * powU64(base, exp - 1); } } static uint64_t powU64WMod(const uint64_t base, const uint64_t exp, const uint64_t m) { if (exp == 0) { return 1; } if (exp == 1) { return base % m; } if (exp % 2 == 0) { return powU64WMod(base * base % m, exp / 2, m); } else { return base * powU64WMod(base, exp - 1, m) % m; } } static size_t comb(const size_t n, const size_t r) { size_t result = 1; for (size_t i = 0; i < r; i++) { result *= n - i; result /= i + 1; } return result; } static uint64_t combU64(const uint64_t n, const uint64_t r) { uint64_t result = 1; for (uint64_t i = 0; i < r; i++) { result *= n - i; result /= i + 1; } return result; } static uint64_t combU64WMod(const uint64_t n, const uint64_t r, const uint64_t m) { uint64_t result = 1; for (uint64_t i = 0; i < r; i++) { result = result * (n - i) % m; result = result * modinvU64(i + 1, m) % m; } return result; } static uint64_t permU64WMod(const uint64_t n, const uint64_t m) { uint64_t result = 1; for (uint64_t v = 2; v <= n; v++) { result *= v; result %= m; } return result; } static size_t gcdZu(size_t m, size_t n) { size_t temp; while (m % n != 0) { temp = n; n = m % n; m = temp; } return n; } static uint64_t gcdU64(uint64_t m, uint64_t n) { uint64_t temp; while (m % n != 0) { temp = n; n = m % n; m = temp; } return n; } typedef struct { uint64_t val; }BHeap_Val; #define BHEAP_VAL_TYPE BHeap_Val #define BHEAP_INVALID_NODE ((size_t)100000000) typedef struct { BHEAP_VAL_TYPE val; } BHeap_Node; struct _BHeap_Ctx { size_t size; int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node); void(*notifyNodeChange)(const struct _BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList); BHeap_Node* node; }; typedef struct _BHeap_Ctx BHeap_Ctx; static void bHeap_Init(BHeap_Ctx* const ctx, int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node), void(*notifyNodeChange)(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList), BHeap_Node* const nodes) { ctx->size = 0; ctx->compare = compare; ctx->notifyNodeChange = notifyNodeChange; ctx->node = nodes; } static void bHeap_Swap(BHeap_Ctx* const ctx, const size_t node0, const size_t node1) { const BHEAP_VAL_TYPE tmp = ctx->node[node0].val; ctx->node[node0].val = ctx->node[node1].val; ctx->node[node1].val = tmp; if (ctx->notifyNodeChange != NULL) { const size_t nodeList[2] = { node0,node1 }; ctx->notifyNodeChange(ctx, 2, nodeList); } } static void bHeap_UpHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) { if (nodeIdx == 0) { return; } const size_t parentIdx = (nodeIdx + 1) / 2 - 1; const int compareResult = ctx->compare(&(ctx->node[parentIdx].val), &(ctx->node[nodeIdx].val)); if (0 < compareResult) { bHeap_Swap(ctx, nodeIdx, parentIdx); if (parentIdx != 0) { bHeap_UpHeap(ctx, parentIdx); } } } static void bHeap_DownHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) { if (ctx->size - 1 <= nodeIdx) { return; } const size_t leftIdx = 2 * (nodeIdx + 1) - 1; if (leftIdx < ctx->size) { const int leftResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[leftIdx].val)); size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx; const size_t rightIdx = leftIdx + 1; if (rightIdx < ctx->size) { const int rightResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[rightIdx].val)); if (swapTarget == BHEAP_INVALID_NODE) { if (0 < rightResult) { swapTarget = rightIdx; } } else { if (0 < rightResult) { const int rightLeftResult = ctx->compare(&(ctx->node[leftIdx].val), &(ctx->node[rightIdx].val)); if (0 < rightLeftResult) { swapTarget = rightIdx; } } } } if (swapTarget != BHEAP_INVALID_NODE) { bHeap_Swap(ctx, nodeIdx, swapTarget); bHeap_DownHeap(ctx, swapTarget); } } } static void bHeap_Add(BHeap_Ctx* const ctx, const BHEAP_VAL_TYPE val) { ctx->node[ctx->size].val = val; ctx->size++; if (ctx->notifyNodeChange != NULL) { const size_t node = ctx->size - 1; ctx->notifyNodeChange(ctx, 1, &node); } bHeap_UpHeap(ctx, ctx->size - 1); } static void bHeap_RemoveTop(BHeap_Ctx* const ctx) { if (ctx->size == 0) { return; } if (ctx->size == 1) { ctx->size--; return; } ctx->node[0].val = ctx->node[ctx->size - 1].val; if (ctx->notifyNodeChange != NULL) { const size_t node = 0; ctx->notifyNodeChange(ctx, 1, &node); } ctx->size--; bHeap_DownHeap(ctx, 0); } static void bHeap_RemoveNode(BHeap_Ctx* const ctx, const size_t node) { if (node == ctx->size - 1) { ctx->size--; } else { ctx->node[node].val = ctx->node[ctx->size - 1].val; ctx->size--; if (ctx->notifyNodeChange != NULL) { ctx->notifyNodeChange(ctx, 1, &node); } bHeap_DownHeap(ctx, node); bHeap_UpHeap(ctx, node); } } static BHEAP_VAL_TYPE* bHeap_GetTopVal(const BHeap_Ctx* const ctx) { return ctx->size == 0 ? NULL : &(ctx->node[0].val); } typedef struct { uint64_t cnt; size_t* child; size_t numChild; size_t maxNumChild; } Tree_Node; #define TREE_INIT_ALLOC (128) static Tree_Node tree_Node[200000]; static void tree_Init(const uint64_t N) { for (uint64_t i = 0; i < N; i++) { tree_Node[i].cnt = 0; tree_Node[i].numChild = 0; tree_Node[i].child = malloc(sizeof(size_t) * TREE_INIT_ALLOC); tree_Node[i].maxNumChild = TREE_INIT_ALLOC; } } static void tree_AddChild(const size_t parent, const size_t child) { if (tree_Node[parent].maxNumChild <= tree_Node[parent].numChild) { tree_Node[parent].child = realloc(tree_Node[parent].child, sizeof(size_t) * tree_Node[parent].maxNumChild * 2); tree_Node[parent].maxNumChild *= 2; } tree_Node[parent].child[tree_Node[parent].numChild] = child; tree_Node[parent].numChild++; } static BHeap_Node BN_Asc[200000]; static BHeap_Node BN_Desc[200000]; static int _bHeap_Compare_Asc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) { return parent->val <= node->val ? -1 : 1; } static int _bHeap_Compare_Desc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) { return parent->val >= node->val ? -1 : 1; } static size_t PBHeap_Asc_Idx[200000]; static size_t PBHeap_Desc_Idx[200000]; static void _bHeap_NotifyNodeChange_Asc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) { for (size_t i = 0; i < nodeListSize; i++) { PBHeap_Asc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i]; } } static void _bHeap_NotifyNodeChange_Desc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) { for (size_t i = 0; i < nodeListSize; i++) { PBHeap_Desc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i]; } } #define MOD_VAL (UINT64_C(1000000007)) static uint64_t contLength[100]; static char contChar[100]; static size_t contList_Size = 0; int main(void) { char S[101]; uint64_t K; scanf("%s%"PRIu64, S, &K); const size_t len = strlen(S); uint64_t contLen = 1; for (uint64_t i = 1; i < len; i++) { if (S[i] == S[i - 1]) { contLen++; } else { contLength[contList_Size] = contLen; contChar[contList_Size] = S[i - 1]; contList_Size++; contLen = 1; } } contLength[contList_Size] = contLen; contChar[contList_Size] = S[len - 1]; contList_Size++; uint64_t sum = 0; if (1 < contList_Size) { if (contChar[0] == contChar[contList_Size - 1] && 2 <= contList_Size) { sum += (contLength[0] + contLength[contList_Size - 1]) / 2 * (K - 1); sum += contLength[0] / 2 + contLength[contList_Size - 1] / 2; for (uint64_t i = 1; i < contList_Size - 1; i++) { sum += contLength[i] / 2 * K; } } else { for (uint64_t i = 0; i < contList_Size; i++) { sum += contLength[i] / 2 * K; } } } else { sum += len * K / 2; } printf("%"PRIu64"\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121214/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121214/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s%lu\00", align 1 @contLength = internal unnamed_addr global [100 x i64] zeroinitializer, align 16 @contList_Size = internal unnamed_addr global i64 0, align 8 @contChar = internal unnamed_addr global [100 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_sz_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ult i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_sz_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ugt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_i64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_i64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_u64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ult i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_u64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ugt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %1 = load i8, ptr %b, align 1, !tbaa !9 %cmp = icmp slt i8 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %1 = load i8, ptr %b, align 1, !tbaa !9 %cmp = icmp sgt i8 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_dp_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load double, ptr %a, align 8, !tbaa !10 %1 = load double, ptr %b, align 8, !tbaa !10 %cmp = fcmp olt double %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %S = alloca [101 x i8], align 16 %K = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %S) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %K) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #7 %contList_Size.promoted = load i64, ptr @contList_Size, align 8, !tbaa !5 %cmp101 = icmp ugt i64 %call2, 1 br i1 %cmp101, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %.pre = load i8, ptr %S, align 16, !tbaa !9 %0 = add i64 %call2, -1 %xtraiter = and i64 %0, 1 %1 = icmp eq i64 %call2, 2 br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %0, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %inc1199.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %inc1199.1, %for.inc.1 ] %contLen.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %contLen.1.1, %for.inc.1 ] %.unr = phi i8 [ %.pre, %for.body.preheader ], [ %7, %for.inc.1 ] %i.0104.unr = phi i64 [ 1, %for.body.preheader ], [ %inc12.1, %for.inc.1 ] %contLen.0103.unr = phi i64 [ 1, %for.body.preheader ], [ %contLen.1.1, %for.inc.1 ] %inc11100102.unr = phi i64 [ %contList_Size.promoted, %for.body.preheader ], [ %inc1199.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %i.0104.unr %2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %cmp5.epil = icmp eq i8 %2, %.unr br i1 %cmp5.epil, label %if.then.epil, label %if.else.epil if.else.epil: ; preds = %for.body.epil %arrayidx7.epil = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %inc11100102.unr store i64 %contLen.0103.unr, ptr %arrayidx7.epil, align 8, !tbaa !5 %arrayidx10.epil = getelementptr inbounds [100 x i8], ptr @contChar, i64 0, i64 %inc11100102.unr store i8 %.unr, ptr %arrayidx10.epil, align 1, !tbaa !9 %inc11.epil = add i64 %inc11100102.unr, 1 br label %for.cond.cleanup if.then.epil: ; preds = %for.body.epil %inc.epil = add i64 %contLen.0103.unr, 1 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %if.else.epil, %entry %3 = phi i64 [ %contList_Size.promoted, %entry ], [ %inc1199.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %inc11100102.unr, %if.then.epil ], [ %inc11.epil, %if.else.epil ] %contLen.0.lcssa = phi i64 [ 1, %entry ], [ %contLen.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ 1, %if.else.epil ] %arrayidx13 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %3 store i64 %contLen.0.lcssa, ptr %arrayidx13, align 8, !tbaa !5 %sub14 = add i64 %call2, -1 %arrayidx15 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %sub14 %4 = load i8, ptr %arrayidx15, align 1, !tbaa !9 %arrayidx16 = getelementptr inbounds [100 x i8], ptr @contChar, i64 0, i64 %3 store i8 %4, ptr %arrayidx16, align 1, !tbaa !9 %inc17 = add i64 %3, 1 store i64 %inc17, ptr @contList_Size, align 8, !tbaa !5 %cmp18 = icmp ugt i64 %inc17, 1 br i1 %cmp18, label %if.then20, label %if.else69 for.body: ; preds = %for.inc.1, %for.body.preheader.new %5 = phi i8 [ %.pre, %for.body.preheader.new ], [ %7, %for.inc.1 ] %i.0104 = phi i64 [ 1, %for.body.preheader.new ], [ %inc12.1, %for.inc.1 ] %contLen.0103 = phi i64 [ 1, %for.body.preheader.new ], [ %contLen.1.1, %for.inc.1 ] %inc11100102 = phi i64 [ %contList_Size.promoted, %for.body.preheader.new ], [ %inc1199.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %i.0104 %6 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp5 = icmp eq i8 %6, %5 br i1 %cmp5, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add i64 %contLen.0103, 1 br label %for.inc if.else: ; preds = %for.body %arrayidx7 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %inc11100102 store i64 %contLen.0103, ptr %arrayidx7, align 8, !tbaa !5 %arrayidx10 = getelementptr inbounds [100 x i8], ptr @contChar, i64 0, i64 %inc11100102 store i8 %5, ptr %arrayidx10, align 1, !tbaa !9 %inc11 = add i64 %inc11100102, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else %inc1199 = phi i64 [ %inc11100102, %if.then ], [ %inc11, %if.else ] %contLen.1 = phi i64 [ %inc, %if.then ], [ 1, %if.else ] %inc12 = add nuw i64 %i.0104, 1 %arrayidx.1 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %inc12 %7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %cmp5.1 = icmp eq i8 %7, %6 br i1 %cmp5.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %arrayidx7.1 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %inc1199 store i64 %contLen.1, ptr %arrayidx7.1, align 8, !tbaa !5 %arrayidx10.1 = getelementptr inbounds [100 x i8], ptr @contChar, i64 0, i64 %inc1199 store i8 %6, ptr %arrayidx10.1, align 1, !tbaa !9 %inc11.1 = add i64 %inc1199, 1 br label %for.inc.1 if.then.1: ; preds = %for.inc %inc.1 = add i64 %contLen.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %inc1199.1 = phi i64 [ %inc1199, %if.then.1 ], [ %inc11.1, %if.else.1 ] %contLen.1.1 = phi i64 [ %inc.1, %if.then.1 ], [ 1, %if.else.1 ] %inc12.1 = add nuw i64 %i.0104, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !12 if.then20: ; preds = %for.cond.cleanup %8 = load i8, ptr @contChar, align 16, !tbaa !9 %cmp25 = icmp eq i8 %8, %4 br i1 %cmp25, label %if.then29, label %for.cond56.preheader for.cond56.preheader: ; preds = %if.then20 %9 = load i64, ptr %K, align 8, !tbaa !5 %min.iters.check = icmp ult i64 %inc17, 4 br i1 %min.iters.check, label %for.body60.preheader, label %vector.ph vector.ph: ; preds = %for.cond56.preheader %n.vec = and i64 %inc17, -4 %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %9, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.phi116 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %10 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %index %wide.load = load <2 x i64>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i64, ptr %10, i64 2 %wide.load117 = load <2 x i64>, ptr %11, align 16, !tbaa !5 %12 = lshr <2 x i64> %wide.load, <i64 1, i64 1> %13 = lshr <2 x i64> %wide.load117, <i64 1, i64 1> %14 = mul <2 x i64> %12, %broadcast.splat %15 = mul <2 x i64> %13, %broadcast.splat %16 = add <2 x i64> %14, %vec.phi %17 = add <2 x i64> %15, %vec.phi116 %index.next = add nuw i64 %index, 4 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %17, %16 %19 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %inc17, %n.vec br i1 %cmp.n, label %if.end73, label %for.body60.preheader for.body60.preheader: ; preds = %for.cond56.preheader, %middle.block %i55.0106.ph = phi i64 [ 0, %for.cond56.preheader ], [ %n.vec, %middle.block ] %sum.1105.ph = phi i64 [ 0, %for.cond56.preheader ], [ %19, %middle.block ] br label %for.body60 if.then29: ; preds = %if.then20 %20 = load i64, ptr @contLength, align 16, !tbaa !5 %add = add i64 %20, %contLen.0.lcssa %div94 = lshr i64 %add, 1 %21 = load i64, ptr %K, align 8, !tbaa !5 %sub32 = add i64 %21, -1 %mul = mul i64 %div94, %sub32 %div3495 = lshr i64 %20, 1 %div3796 = lshr i64 %contLen.0.lcssa, 1 %add38 = add nuw i64 %div3495, %div3796 %add39 = add i64 %add38, %mul %cmp43107 = icmp ugt i64 %3, 1 br i1 %cmp43107, label %for.body46.preheader, label %if.end73 for.body46.preheader: ; preds = %if.then29 %22 = add i64 %3, -1 %min.iters.check120 = icmp ult i64 %3, 5 br i1 %min.iters.check120, label %for.body46.preheader137, label %vector.ph121 vector.ph121: ; preds = %for.body46.preheader %n.vec123 = and i64 %22, -4 %ind.end = or i64 %n.vec123, 1 %23 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %add39, i64 0 %broadcast.splatinsert132 = insertelement <2 x i64> poison, i64 %21, i64 0 %broadcast.splat133 = shufflevector <2 x i64> %broadcast.splatinsert132, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body126 vector.body126: ; preds = %vector.body126, %vector.ph121 %index127 = phi i64 [ 0, %vector.ph121 ], [ %index.next134, %vector.body126 ] %vec.phi128 = phi <2 x i64> [ %23, %vector.ph121 ], [ %30, %vector.body126 ] %vec.phi129 = phi <2 x i64> [ zeroinitializer, %vector.ph121 ], [ %31, %vector.body126 ] %offset.idx = or i64 %index127, 1 %24 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %offset.idx %wide.load130 = load <2 x i64>, ptr %24, align 8, !tbaa !5 %25 = getelementptr inbounds i64, ptr %24, i64 2 %wide.load131 = load <2 x i64>, ptr %25, align 8, !tbaa !5 %26 = lshr <2 x i64> %wide.load130, <i64 1, i64 1> %27 = lshr <2 x i64> %wide.load131, <i64 1, i64 1> %28 = mul <2 x i64> %26, %broadcast.splat133 %29 = mul <2 x i64> %27, %broadcast.splat133 %30 = add <2 x i64> %28, %vec.phi128 %31 = add <2 x i64> %29, %vec.phi129 %index.next134 = add nuw i64 %index127, 4 %32 = icmp eq i64 %index.next134, %n.vec123 br i1 %32, label %middle.block118, label %vector.body126, !llvm.loop !17 middle.block118: ; preds = %vector.body126 %bin.rdx135 = add <2 x i64> %31, %30 %33 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx135) %cmp.n125 = icmp eq i64 %22, %n.vec123 br i1 %cmp.n125, label %if.end73, label %for.body46.preheader137 for.body46.preheader137: ; preds = %for.body46.preheader, %middle.block118 %i40.0109.ph = phi i64 [ 1, %for.body46.preheader ], [ %ind.end, %middle.block118 ] %sum.0108.ph = phi i64 [ %add39, %for.body46.preheader ], [ %33, %middle.block118 ] br label %for.body46 for.body46: ; preds = %for.body46.preheader137, %for.body46 %i40.0109 = phi i64 [ %inc52, %for.body46 ], [ %i40.0109.ph, %for.body46.preheader137 ] %sum.0108 = phi i64 [ %add50, %for.body46 ], [ %sum.0108.ph, %for.body46.preheader137 ] %arrayidx47 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %i40.0109 %34 = load i64, ptr %arrayidx47, align 8, !tbaa !5 %div4897 = lshr i64 %34, 1 %mul49 = mul i64 %div4897, %21 %add50 = add i64 %mul49, %sum.0108 %inc52 = add nuw i64 %i40.0109, 1 %exitcond113.not = icmp eq i64 %inc52, %3 br i1 %exitcond113.not, label %if.end73, label %for.body46, !llvm.loop !18 for.body60: ; preds = %for.body60.preheader, %for.body60 %i55.0106 = phi i64 [ %inc66, %for.body60 ], [ %i55.0106.ph, %for.body60.preheader ] %sum.1105 = phi i64 [ %add64, %for.body60 ], [ %sum.1105.ph, %for.body60.preheader ] %arrayidx61 = getelementptr inbounds [100 x i64], ptr @contLength, i64 0, i64 %i55.0106 %35 = load i64, ptr %arrayidx61, align 8, !tbaa !5 %div6293 = lshr i64 %35, 1 %mul63 = mul i64 %div6293, %9 %add64 = add i64 %mul63, %sum.1105 %inc66 = add nuw i64 %i55.0106, 1 %exitcond112.not = icmp eq i64 %i55.0106, %3 br i1 %exitcond112.not, label %if.end73, label %for.body60, !llvm.loop !19 if.else69: ; preds = %for.cond.cleanup %36 = load i64, ptr %K, align 8, !tbaa !5 %mul70 = mul i64 %36, %call2 %div7192 = lshr i64 %mul70, 1 br label %if.end73 if.end73: ; preds = %for.body60, %for.body46, %middle.block, %middle.block118, %if.then29, %if.else69 %sum.2 = phi i64 [ %div7192, %if.else69 ], [ %add39, %if.then29 ], [ %33, %middle.block118 ], [ %19, %middle.block ], [ %add50, %for.body46 ], [ %add64, %for.body60 ] %call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #6 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %S) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"double", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !13, !15, !16} !18 = distinct !{!18, !13, !16, !15} !19 = distinct !{!19, !13, !16, !15}
#include <stdio.h> int pow_(int a, int n){ if(n == 0) return 1; else{ return a * pow_(a, n - 1); } } int g(int n){ if(n > 3) return 3 * g(n - 1) + pow_(2, n - 1) * 3 - 6; if(n == 3) return 6; } int main(int argc, char *argv[]) { int n; scanf("%d", &n); int ans = 0, s, f, t, z, temp, x = 0; if(n <= 999){ for(int l = 1; l <= n; l++){ temp = l; s = 0; f = 0; t = 0; z = 0; while(temp > 0){ if(temp % 10 == 7) s++; else if(temp % 10 == 5) f++; else if(temp % 10 == 3) t++; else { z++; break;} temp /= 10; } if(s*t*f > 0 && z == 0) ans++; } printf("%d\n", ans); } else{ int d = 0; temp = n; int r; while(temp > 0){ r = temp % 10; temp /= 10; d++; } for(int i = 3; i < d; i++){ ans += g(i); } if(r == 3){ for(int i = 3 * pow_(10, d - 1); i <= n; i++){ s = 0; t = 0; f = 0; z = 0; temp = i; while(temp > 0){ if(temp % 10 == 3) t++; else if(temp % 10 == 5) f++; else if(temp % 10 == 7) s++; else {z++; break;} temp /= 10; } if(s*t*f > 0 && z == 0)ans++; } } else if(r == 4) ans += pow_(2, d - 1) - 2 + g(d - 1); else if(r == 5){ for(int i = 5 * pow_(10, d - 1); i <= n; i++){ s = 0; t = 0; f = 0; z = 0; temp = i; while(temp > 0){ if(temp % 10 == 3) t++; else if(temp % 10 == 5) f++; else if(temp % 10 == 7) s++; else {z++; break;} temp /= 10; } if(s*t*f > 0 && z == 0)ans++; } ans += g(d) / 3; } else if(r == 6) ans += 2*(pow_(2, d - 1) - 2 + g(d - 1)); else if(r == 7){ for(int i = 7 * pow_(10, d - 1); i <= n; i++){ s = 0; t = 0; f = 0; z = 0; temp = i; while(temp > 0){ if(temp % 10 == 3) t++; else if(temp % 10 == 5) f++; else if(temp % 10 == 7) s++; else {z++; break;} temp /= 10; } if(s*t*f > 0 && z == 0)ans++; } ans += 2 * g(d) / 3; } else if(r >= 8) ans += g(d); printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121258/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow_(i32 noundef %a, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp3 = icmp eq i32 %n, 0 br i1 %cmp3, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %if.else.preheader7, label %vector.ph vector.ph: ; preds = %if.else.preheader %n.vec = and i32 %n, -8 %ind.end = and i32 %n, 7 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !5 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %n br i1 %cmp.n, label %return, label %if.else.preheader7 if.else.preheader7: ; preds = %if.else.preheader, %middle.block %n.tr5.ph = phi i32 [ %n, %if.else.preheader ], [ %ind.end, %middle.block ] %accumulator.tr4.ph = phi i32 [ 1, %if.else.preheader ], [ %3, %middle.block ] br label %if.else if.else: ; preds = %if.else.preheader7, %if.else %n.tr5 = phi i32 [ %sub, %if.else ], [ %n.tr5.ph, %if.else.preheader7 ] %accumulator.tr4 = phi i32 [ %mul, %if.else ], [ %accumulator.tr4.ph, %if.else.preheader7 ] %sub = add nsw i32 %n.tr5, -1 %mul = mul nsw i32 %accumulator.tr4, %a %cmp = icmp eq i32 %sub, 0 br i1 %cmp, label %return, label %if.else, !llvm.loop !8 return: ; preds = %if.else, %middle.block, %entry %accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %if.else ] ret i32 %accumulator.tr.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @g(i32 noundef %n) local_unnamed_addr #1 { entry: %cmp = icmp sgt i32 %n, 3 br i1 %cmp, label %if.then, label %if.end7 if.then: ; preds = %entry %sub = add nsw i32 %n, -1 %call = tail call i32 @g(i32 noundef %sub) %0 = add i32 %n, -2 %xtraiter = and i32 %sub, 7 %1 = icmp ult i32 %0, 7 br i1 %1, label %pow_.exit.unr-lcssa, label %if.then.new if.then.new: ; preds = %if.then %unroll_iter = and i32 %sub, -8 br label %if.else.i if.else.i: ; preds = %if.else.i, %if.then.new %accumulator.tr4.i = phi i32 [ 1, %if.then.new ], [ %mul.i, %if.else.i ] %niter = phi i32 [ 0, %if.then.new ], [ %niter.next.7, %if.else.i ] %mul.i = shl i32 %accumulator.tr4.i, 8 %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %pow_.exit.unr-lcssa, label %if.else.i pow_.exit.unr-lcssa: ; preds = %if.else.i, %if.then %mul.i.lcssa.ph = phi i32 [ undef, %if.then ], [ %mul.i, %if.else.i ] %accumulator.tr4.i.unr = phi i32 [ 1, %if.then ], [ %mul.i, %if.else.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %pow_.exit, label %if.else.i.epil if.else.i.epil: ; preds = %pow_.exit.unr-lcssa, %if.else.i.epil %accumulator.tr4.i.epil = phi i32 [ %mul.i.epil, %if.else.i.epil ], [ %accumulator.tr4.i.unr, %pow_.exit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %if.else.i.epil ], [ 0, %pow_.exit.unr-lcssa ] %mul.i.epil = shl nsw i32 %accumulator.tr4.i.epil, 1 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %pow_.exit, label %if.else.i.epil, !llvm.loop !9 pow_.exit: ; preds = %if.else.i.epil, %pow_.exit.unr-lcssa %mul.i.lcssa = phi i32 [ %mul.i.lcssa.ph, %pow_.exit.unr-lcssa ], [ %mul.i.epil, %if.else.i.epil ] %mul11 = add i32 %mul.i.lcssa, %call %add = mul i32 %mul11, 3 %sub4 = add nsw i32 %add, -6 br label %if.end7 if.end7: ; preds = %entry, %pow_.exit %retval.0 = phi i32 [ %sub4, %pow_.exit ], [ 6, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp = icmp slt i32 %0, 1000 br i1 %cmp, label %for.cond.preheader, label %while.body29 for.cond.preheader: ; preds = %entry %cmp1.not412 = icmp slt i32 %0, 1 br i1 %cmp1.not412, label %if.end218, label %while.cond.preheader while.cond.preheader: ; preds = %for.cond.preheader, %while.end %l.0414 = phi i32 [ %inc24, %while.end ], [ 1, %for.cond.preheader ] %ans.0413 = phi i32 [ %spec.select, %while.end ], [ 0, %for.cond.preheader ] br label %while.body while.body: ; preds = %while.cond.preheader, %if.end17 %temp.0410 = phi i32 [ %l.0414, %while.cond.preheader ], [ %div, %if.end17 ] %t.0409 = phi i32 [ 0, %while.cond.preheader ], [ %t.1, %if.end17 ] %f.0408 = phi i32 [ 0, %while.cond.preheader ], [ %f.1, %if.end17 ] %s.0407 = phi i32 [ 0, %while.cond.preheader ], [ %s.1, %if.end17 ] %rem = urem i32 %temp.0410, 10 %div = udiv i32 %temp.0410, 10 switch i32 %rem, label %while.end [ i32 7, label %if.then4 i32 5, label %if.then7 i32 3, label %if.then12 ] if.then4: ; preds = %while.body %inc = add nsw i32 %s.0407, 1 br label %if.end17 if.then7: ; preds = %while.body %inc8 = add nsw i32 %f.0408, 1 br label %if.end17 if.then12: ; preds = %while.body %inc13 = add nsw i32 %t.0409, 1 br label %if.end17 if.end17: ; preds = %if.then7, %if.then12, %if.then4 %s.1 = phi i32 [ %inc, %if.then4 ], [ %s.0407, %if.then7 ], [ %s.0407, %if.then12 ] %f.1 = phi i32 [ %f.0408, %if.then4 ], [ %inc8, %if.then7 ], [ %f.0408, %if.then12 ] %t.1 = phi i32 [ %t.0409, %if.then4 ], [ %t.0409, %if.then7 ], [ %inc13, %if.then12 ] %cmp2.not = icmp ult i32 %temp.0410, 10 br i1 %cmp2.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %if.end17 %s.0.lcssa = phi i32 [ %s.0407, %while.body ], [ %s.1, %if.end17 ] %f.0.lcssa = phi i32 [ %f.0408, %while.body ], [ %f.1, %if.end17 ] %t.0.lcssa = phi i32 [ %t.0409, %while.body ], [ %t.1, %if.end17 ] %cmp2.not.lcssa = phi i1 [ false, %while.body ], [ true, %if.end17 ] %mul = mul i32 %f.0.lcssa, %s.0.lcssa %mul18 = mul i32 %mul, %t.0.lcssa %cmp19 = icmp sgt i32 %mul18, 0 %or.cond = and i1 %cmp2.not.lcssa, %cmp19 %inc22 = zext i1 %or.cond to i32 %spec.select = add nuw nsw i32 %ans.0413, %inc22 %inc24 = add nuw i32 %l.0414, 1 %exitcond419.not = icmp eq i32 %l.0414, %0 br i1 %exitcond419.not, label %if.end218, label %while.cond.preheader, !llvm.loop !17 for.cond34.preheader: ; preds = %while.body29 %cmp35350 = icmp ugt i32 %d.0349, 2 br i1 %cmp35350, label %for.body37, label %for.cond.cleanup36 while.body29: ; preds = %entry, %while.body29 %indvars.iv = phi i32 [ %indvars.iv.next, %while.body29 ], [ 1, %entry ] %d.0349 = phi i32 [ %inc32, %while.body29 ], [ 0, %entry ] %temp.1348 = phi i32 [ %div31, %while.body29 ], [ %0, %entry ] %div31 = udiv i32 %temp.1348, 10 %inc32 = add nuw nsw i32 %d.0349, 1 %cmp28.not = icmp ult i32 %temp.1348, 10 %indvars.iv.next = add nuw i32 %indvars.iv, 1 br i1 %cmp28.not, label %for.cond34.preheader, label %while.body29, !llvm.loop !18 for.cond.cleanup36: ; preds = %for.body37, %for.cond34.preheader %ans.2.lcssa = phi i32 [ 0, %for.cond34.preheader ], [ %add, %for.body37 ] switch i32 %temp.1348, label %if.else206 [ i32 3, label %if.then43 i32 4, label %if.then88 i32 5, label %if.then98 i32 6, label %if.then147 i32 7, label %if.then158 ] for.body37: ; preds = %for.cond34.preheader, %for.body37 %i.0352 = phi i32 [ %inc40, %for.body37 ], [ 3, %for.cond34.preheader ] %ans.2351 = phi i32 [ %add, %for.body37 ], [ 0, %for.cond34.preheader ] %call38 = call i32 @g(i32 noundef %i.0352) %add = add nsw i32 %call38, %ans.2351 %inc40 = add nuw i32 %i.0352, 1 %exitcond.not = icmp eq i32 %inc40, %indvars.iv br i1 %exitcond.not, label %for.cond.cleanup36, label %for.body37, !llvm.loop !19 if.then43: ; preds = %for.cond.cleanup36 %cmp3.i = icmp eq i32 %d.0349, 0 br i1 %cmp3.i, label %pow_.exit, label %if.else.i.preheader if.else.i.preheader: ; preds = %if.then43 %xtraiter441 = and i32 %d.0349, 7 %1 = icmp ult i32 %d.0349, 8 br i1 %1, label %pow_.exit.loopexit.unr-lcssa, label %if.else.i.preheader.new if.else.i.preheader.new: ; preds = %if.else.i.preheader %unroll_iter445 = and i32 %d.0349, 2147483640 br label %if.else.i if.else.i: ; preds = %if.else.i, %if.else.i.preheader.new %accumulator.tr4.i = phi i32 [ 1, %if.else.i.preheader.new ], [ %mul.i.7, %if.else.i ] %niter446 = phi i32 [ 0, %if.else.i.preheader.new ], [ %niter446.next.7, %if.else.i ] %mul.i.7 = mul i32 %accumulator.tr4.i, 100000000 %niter446.next.7 = add i32 %niter446, 8 %niter446.ncmp.7 = icmp eq i32 %niter446.next.7, %unroll_iter445 br i1 %niter446.ncmp.7, label %pow_.exit.loopexit.unr-lcssa.loopexit, label %if.else.i pow_.exit.loopexit.unr-lcssa.loopexit: ; preds = %if.else.i %mul.i.6 = mul i32 %accumulator.tr4.i, 10000000 br label %pow_.exit.loopexit.unr-lcssa pow_.exit.loopexit.unr-lcssa: ; preds = %pow_.exit.loopexit.unr-lcssa.loopexit, %if.else.i.preheader %accumulator.tr4.i.lcssa.ph = phi i32 [ undef, %if.else.i.preheader ], [ %mul.i.6, %pow_.exit.loopexit.unr-lcssa.loopexit ] %accumulator.tr4.i.unr = phi i32 [ 1, %if.else.i.preheader ], [ %mul.i.7, %pow_.exit.loopexit.unr-lcssa.loopexit ] %lcmp.mod443.not = icmp eq i32 %xtraiter441, 0 br i1 %lcmp.mod443.not, label %pow_.exit.loopexit, label %if.else.i.epil if.else.i.epil: ; preds = %pow_.exit.loopexit.unr-lcssa, %if.else.i.epil %accumulator.tr4.i.epil = phi i32 [ %mul.i.epil, %if.else.i.epil ], [ %accumulator.tr4.i.unr, %pow_.exit.loopexit.unr-lcssa ] %epil.iter442 = phi i32 [ %epil.iter442.next, %if.else.i.epil ], [ 0, %pow_.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i32 %accumulator.tr4.i.epil, 10 %epil.iter442.next = add i32 %epil.iter442, 1 %epil.iter442.cmp.not = icmp eq i32 %epil.iter442.next, %xtraiter441 br i1 %epil.iter442.cmp.not, label %pow_.exit.loopexit, label %if.else.i.epil, !llvm.loop !20 pow_.exit.loopexit: ; preds = %if.else.i.epil, %pow_.exit.loopexit.unr-lcssa %accumulator.tr4.i.lcssa = phi i32 [ %accumulator.tr4.i.lcssa.ph, %pow_.exit.loopexit.unr-lcssa ], [ %accumulator.tr4.i.epil, %if.else.i.epil ] %2 = mul i32 %accumulator.tr4.i.lcssa, 30 br label %pow_.exit pow_.exit: ; preds = %pow_.exit.loopexit, %if.then43 %accumulator.tr.lcssa.i = phi i32 [ 3, %if.then43 ], [ %2, %pow_.exit.loopexit ] %cmp48.not403 = icmp sgt i32 %accumulator.tr.lcssa.i, %0 br i1 %cmp48.not403, label %if.end218, label %while.cond51.preheader while.cond51.preheader: ; preds = %pow_.exit, %while.end74 %i44.0405 = phi i32 [ %inc84, %while.end74 ], [ %accumulator.tr.lcssa.i, %pow_.exit ] %ans.3404 = phi i32 [ %spec.select309, %while.end74 ], [ %ans.2.lcssa, %pow_.exit ] %cmp52389 = icmp slt i32 %i44.0405, 1 br i1 %cmp52389, label %while.end74, label %while.body53 while.body53: ; preds = %while.cond51.preheader, %if.end72 %temp.2393 = phi i32 [ %div73, %if.end72 ], [ %i44.0405, %while.cond51.preheader ] %t.2392 = phi i32 [ %t.3, %if.end72 ], [ 0, %while.cond51.preheader ] %f.2391 = phi i32 [ %f.3, %if.end72 ], [ 0, %while.cond51.preheader ] %s.2390 = phi i32 [ %s.3, %if.end72 ], [ 0, %while.cond51.preheader ] %rem54 = urem i32 %temp.2393, 10 %div73 = udiv i32 %temp.2393, 10 switch i32 %rem54, label %while.end74.loopexit [ i32 3, label %if.then56 i32 5, label %if.then61 i32 7, label %if.then66 ] if.then56: ; preds = %while.body53 %inc57 = add nsw i32 %t.2392, 1 br label %if.end72 if.then61: ; preds = %while.body53 %inc62 = add nsw i32 %f.2391, 1 br label %if.end72 if.then66: ; preds = %while.body53 %inc67 = add nsw i32 %s.2390, 1 br label %if.end72 if.end72: ; preds = %if.then61, %if.then66, %if.then56 %s.3 = phi i32 [ %s.2390, %if.then56 ], [ %s.2390, %if.then61 ], [ %inc67, %if.then66 ] %f.3 = phi i32 [ %f.2391, %if.then56 ], [ %inc62, %if.then61 ], [ %f.2391, %if.then66 ] %t.3 = phi i32 [ %inc57, %if.then56 ], [ %t.2392, %if.then61 ], [ %t.2392, %if.then66 ] %cmp52 = icmp ult i32 %temp.2393, 10 br i1 %cmp52, label %while.end74.loopexit, label %while.body53, !llvm.loop !21 while.end74.loopexit: ; preds = %while.body53, %if.end72 %s.2.lcssa.ph = phi i32 [ %s.3, %if.end72 ], [ %s.2390, %while.body53 ] %f.2.lcssa.ph = phi i32 [ %f.3, %if.end72 ], [ %f.2391, %while.body53 ] %t.2.lcssa.ph = phi i32 [ %t.3, %if.end72 ], [ %t.2392, %while.body53 ] %cmp52.lcssa.ph = phi i1 [ true, %if.end72 ], [ false, %while.body53 ] %3 = mul i32 %f.2.lcssa.ph, %s.2.lcssa.ph %4 = mul i32 %3, %t.2.lcssa.ph br label %while.end74 while.end74: ; preds = %while.end74.loopexit, %while.cond51.preheader %cmp52.lcssa = phi i1 [ true, %while.cond51.preheader ], [ %cmp52.lcssa.ph, %while.end74.loopexit ] %mul76 = phi i32 [ 0, %while.cond51.preheader ], [ %4, %while.end74.loopexit ] %cmp77 = icmp sgt i32 %mul76, 0 %or.cond219 = and i1 %cmp52.lcssa, %cmp77 %inc81 = zext i1 %or.cond219 to i32 %spec.select309 = add nsw i32 %ans.3404, %inc81 %inc84 = add i32 %i44.0405, 1 %exitcond418.not = icmp eq i32 %i44.0405, %0 br i1 %exitcond418.not, label %if.end218, label %while.cond51.preheader, !llvm.loop !22 if.then88: ; preds = %for.cond.cleanup36 %cmp3.i312 = icmp eq i32 %d.0349, 0 br i1 %cmp3.i312, label %pow_.exit320, label %if.else.i313.preheader if.else.i313.preheader: ; preds = %if.then88 %xtraiter435 = and i32 %d.0349, 7 %5 = icmp ult i32 %d.0349, 8 br i1 %5, label %pow_.exit320.loopexit.unr-lcssa, label %if.else.i313.preheader.new if.else.i313.preheader.new: ; preds = %if.else.i313.preheader %unroll_iter439 = and i32 %d.0349, 2147483640 br label %if.else.i313 if.else.i313: ; preds = %if.else.i313, %if.else.i313.preheader.new %accumulator.tr4.i315 = phi i32 [ 1, %if.else.i313.preheader.new ], [ %mul.i317, %if.else.i313 ] %niter440 = phi i32 [ 0, %if.else.i313.preheader.new ], [ %niter440.next.7, %if.else.i313 ] %mul.i317 = shl i32 %accumulator.tr4.i315, 8 %niter440.next.7 = add i32 %niter440, 8 %niter440.ncmp.7 = icmp eq i32 %niter440.next.7, %unroll_iter439 br i1 %niter440.ncmp.7, label %pow_.exit320.loopexit.unr-lcssa, label %if.else.i313 pow_.exit320.loopexit.unr-lcssa: ; preds = %if.else.i313, %if.else.i313.preheader %mul.i317.lcssa.ph = phi i32 [ undef, %if.else.i313.preheader ], [ %mul.i317, %if.else.i313 ] %accumulator.tr4.i315.unr = phi i32 [ 1, %if.else.i313.preheader ], [ %mul.i317, %if.else.i313 ] %lcmp.mod437.not = icmp eq i32 %xtraiter435, 0 br i1 %lcmp.mod437.not, label %pow_.exit320, label %if.else.i313.epil if.else.i313.epil: ; preds = %pow_.exit320.loopexit.unr-lcssa, %if.else.i313.epil %accumulator.tr4.i315.epil = phi i32 [ %mul.i317.epil, %if.else.i313.epil ], [ %accumulator.tr4.i315.unr, %pow_.exit320.loopexit.unr-lcssa ] %epil.iter436 = phi i32 [ %epil.iter436.next, %if.else.i313.epil ], [ 0, %pow_.exit320.loopexit.unr-lcssa ] %mul.i317.epil = shl nsw i32 %accumulator.tr4.i315.epil, 1 %epil.iter436.next = add i32 %epil.iter436, 1 %epil.iter436.cmp.not = icmp eq i32 %epil.iter436.next, %xtraiter435 br i1 %epil.iter436.cmp.not, label %pow_.exit320, label %if.else.i313.epil, !llvm.loop !23 pow_.exit320: ; preds = %pow_.exit320.loopexit.unr-lcssa, %if.else.i313.epil, %if.then88 %accumulator.tr.lcssa.i319 = phi i32 [ 1, %if.then88 ], [ %mul.i317.lcssa.ph, %pow_.exit320.loopexit.unr-lcssa ], [ %mul.i317.epil, %if.else.i313.epil ] %call93 = call i32 @g(i32 noundef %d.0349) %sub91 = add i32 %ans.2.lcssa, -2 %add94 = add i32 %sub91, %accumulator.tr.lcssa.i319 %add95 = add i32 %add94, %call93 br label %if.end218 if.then98: ; preds = %for.cond.cleanup36 %cmp3.i321 = icmp eq i32 %d.0349, 0 br i1 %cmp3.i321, label %pow_.exit329, label %if.else.i322.preheader if.else.i322.preheader: ; preds = %if.then98 %xtraiter429 = and i32 %d.0349, 7 %6 = icmp ult i32 %d.0349, 8 br i1 %6, label %pow_.exit329.loopexit.unr-lcssa, label %if.else.i322.preheader.new if.else.i322.preheader.new: ; preds = %if.else.i322.preheader %unroll_iter433 = and i32 %d.0349, 2147483640 br label %if.else.i322 if.else.i322: ; preds = %if.else.i322, %if.else.i322.preheader.new %accumulator.tr4.i324 = phi i32 [ 1, %if.else.i322.preheader.new ], [ %mul.i326.7, %if.else.i322 ] %niter434 = phi i32 [ 0, %if.else.i322.preheader.new ], [ %niter434.next.7, %if.else.i322 ] %mul.i326.7 = mul i32 %accumulator.tr4.i324, 100000000 %niter434.next.7 = add i32 %niter434, 8 %niter434.ncmp.7 = icmp eq i32 %niter434.next.7, %unroll_iter433 br i1 %niter434.ncmp.7, label %pow_.exit329.loopexit.unr-lcssa.loopexit, label %if.else.i322 pow_.exit329.loopexit.unr-lcssa.loopexit: ; preds = %if.else.i322 %mul.i326.6 = mul i32 %accumulator.tr4.i324, 10000000 br label %pow_.exit329.loopexit.unr-lcssa pow_.exit329.loopexit.unr-lcssa: ; preds = %pow_.exit329.loopexit.unr-lcssa.loopexit, %if.else.i322.preheader %accumulator.tr4.i324.lcssa.ph = phi i32 [ undef, %if.else.i322.preheader ], [ %mul.i326.6, %pow_.exit329.loopexit.unr-lcssa.loopexit ] %accumulator.tr4.i324.unr = phi i32 [ 1, %if.else.i322.preheader ], [ %mul.i326.7, %pow_.exit329.loopexit.unr-lcssa.loopexit ] %lcmp.mod431.not = icmp eq i32 %xtraiter429, 0 br i1 %lcmp.mod431.not, label %pow_.exit329.loopexit, label %if.else.i322.epil if.else.i322.epil: ; preds = %pow_.exit329.loopexit.unr-lcssa, %if.else.i322.epil %accumulator.tr4.i324.epil = phi i32 [ %mul.i326.epil, %if.else.i322.epil ], [ %accumulator.tr4.i324.unr, %pow_.exit329.loopexit.unr-lcssa ] %epil.iter430 = phi i32 [ %epil.iter430.next, %if.else.i322.epil ], [ 0, %pow_.exit329.loopexit.unr-lcssa ] %mul.i326.epil = mul nsw i32 %accumulator.tr4.i324.epil, 10 %epil.iter430.next = add i32 %epil.iter430, 1 %epil.iter430.cmp.not = icmp eq i32 %epil.iter430.next, %xtraiter429 br i1 %epil.iter430.cmp.not, label %pow_.exit329.loopexit, label %if.else.i322.epil, !llvm.loop !24 pow_.exit329.loopexit: ; preds = %if.else.i322.epil, %pow_.exit329.loopexit.unr-lcssa %accumulator.tr4.i324.lcssa = phi i32 [ %accumulator.tr4.i324.lcssa.ph, %pow_.exit329.loopexit.unr-lcssa ], [ %accumulator.tr4.i324.epil, %if.else.i322.epil ] %7 = mul i32 %accumulator.tr4.i324.lcssa, 50 br label %pow_.exit329 pow_.exit329: ; preds = %pow_.exit329.loopexit, %if.then98 %accumulator.tr.lcssa.i328 = phi i32 [ 5, %if.then98 ], [ %7, %pow_.exit329.loopexit ] %cmp104.not385 = icmp sgt i32 %accumulator.tr.lcssa.i328, %0 br i1 %cmp104.not385, label %for.cond.cleanup105, label %while.cond107.preheader while.cond107.preheader: ; preds = %pow_.exit329, %while.end130 %i99.0387 = phi i32 [ %inc140, %while.end130 ], [ %accumulator.tr.lcssa.i328, %pow_.exit329 ] %ans.5386 = phi i32 [ %spec.select310, %while.end130 ], [ %ans.2.lcssa, %pow_.exit329 ] %cmp108371 = icmp slt i32 %i99.0387, 1 br i1 %cmp108371, label %while.end130, label %while.body109 for.cond.cleanup105: ; preds = %while.end130, %pow_.exit329 %ans.5.lcssa = phi i32 [ %ans.2.lcssa, %pow_.exit329 ], [ %spec.select310, %while.end130 ] %call142 = call i32 @g(i32 noundef %inc32) %div143 = sdiv i32 %call142, 3 %add144 = add nsw i32 %div143, %ans.5.lcssa br label %if.end218 while.body109: ; preds = %while.cond107.preheader, %if.end128 %temp.3375 = phi i32 [ %div129, %if.end128 ], [ %i99.0387, %while.cond107.preheader ] %t.4374 = phi i32 [ %t.5, %if.end128 ], [ 0, %while.cond107.preheader ] %f.4373 = phi i32 [ %f.5, %if.end128 ], [ 0, %while.cond107.preheader ] %s.4372 = phi i32 [ %s.5, %if.end128 ], [ 0, %while.cond107.preheader ] %rem110 = urem i32 %temp.3375, 10 %div129 = udiv i32 %temp.3375, 10 switch i32 %rem110, label %while.end130.loopexit [ i32 3, label %if.then112 i32 5, label %if.then117 i32 7, label %if.then122 ] if.then112: ; preds = %while.body109 %inc113 = add nsw i32 %t.4374, 1 br label %if.end128 if.then117: ; preds = %while.body109 %inc118 = add nsw i32 %f.4373, 1 br label %if.end128 if.then122: ; preds = %while.body109 %inc123 = add nsw i32 %s.4372, 1 br label %if.end128 if.end128: ; preds = %if.then117, %if.then122, %if.then112 %s.5 = phi i32 [ %s.4372, %if.then112 ], [ %s.4372, %if.then117 ], [ %inc123, %if.then122 ] %f.5 = phi i32 [ %f.4373, %if.then112 ], [ %inc118, %if.then117 ], [ %f.4373, %if.then122 ] %t.5 = phi i32 [ %inc113, %if.then112 ], [ %t.4374, %if.then117 ], [ %t.4374, %if.then122 ] %cmp108 = icmp ult i32 %temp.3375, 10 br i1 %cmp108, label %while.end130.loopexit, label %while.body109, !llvm.loop !25 while.end130.loopexit: ; preds = %while.body109, %if.end128 %s.4.lcssa.ph = phi i32 [ %s.5, %if.end128 ], [ %s.4372, %while.body109 ] %f.4.lcssa.ph = phi i32 [ %f.5, %if.end128 ], [ %f.4373, %while.body109 ] %t.4.lcssa.ph = phi i32 [ %t.5, %if.end128 ], [ %t.4374, %while.body109 ] %cmp108.lcssa.ph = phi i1 [ true, %if.end128 ], [ false, %while.body109 ] %8 = mul i32 %f.4.lcssa.ph, %s.4.lcssa.ph %9 = mul i32 %8, %t.4.lcssa.ph br label %while.end130 while.end130: ; preds = %while.end130.loopexit, %while.cond107.preheader %cmp108.lcssa = phi i1 [ true, %while.cond107.preheader ], [ %cmp108.lcssa.ph, %while.end130.loopexit ] %mul132 = phi i32 [ 0, %while.cond107.preheader ], [ %9, %while.end130.loopexit ] %cmp133 = icmp sgt i32 %mul132, 0 %or.cond220 = and i1 %cmp108.lcssa, %cmp133 %inc137 = zext i1 %or.cond220 to i32 %spec.select310 = add nsw i32 %ans.5386, %inc137 %inc140 = add i32 %i99.0387, 1 %exitcond417.not = icmp eq i32 %i99.0387, %0 br i1 %exitcond417.not, label %for.cond.cleanup105, label %while.cond107.preheader, !llvm.loop !26 if.then147: ; preds = %for.cond.cleanup36 %cmp3.i330 = icmp eq i32 %d.0349, 0 br i1 %cmp3.i330, label %pow_.exit338, label %if.else.i331.preheader if.else.i331.preheader: ; preds = %if.then147 %xtraiter423 = and i32 %d.0349, 7 %10 = icmp ult i32 %d.0349, 8 br i1 %10, label %pow_.exit338.loopexit.unr-lcssa, label %if.else.i331.preheader.new if.else.i331.preheader.new: ; preds = %if.else.i331.preheader %unroll_iter427 = and i32 %d.0349, 2147483640 br label %if.else.i331 if.else.i331: ; preds = %if.else.i331, %if.else.i331.preheader.new %accumulator.tr4.i333 = phi i32 [ 1, %if.else.i331.preheader.new ], [ %mul.i335, %if.else.i331 ] %niter428 = phi i32 [ 0, %if.else.i331.preheader.new ], [ %niter428.next.7, %if.else.i331 ] %mul.i335 = shl i32 %accumulator.tr4.i333, 8 %niter428.next.7 = add i32 %niter428, 8 %niter428.ncmp.7 = icmp eq i32 %niter428.next.7, %unroll_iter427 br i1 %niter428.ncmp.7, label %pow_.exit338.loopexit.unr-lcssa, label %if.else.i331 pow_.exit338.loopexit.unr-lcssa: ; preds = %if.else.i331, %if.else.i331.preheader %mul.i335.lcssa.ph = phi i32 [ undef, %if.else.i331.preheader ], [ %mul.i335, %if.else.i331 ] %accumulator.tr4.i333.unr = phi i32 [ 1, %if.else.i331.preheader ], [ %mul.i335, %if.else.i331 ] %lcmp.mod425.not = icmp eq i32 %xtraiter423, 0 br i1 %lcmp.mod425.not, label %pow_.exit338.loopexit, label %if.else.i331.epil if.else.i331.epil: ; preds = %pow_.exit338.loopexit.unr-lcssa, %if.else.i331.epil %accumulator.tr4.i333.epil = phi i32 [ %mul.i335.epil, %if.else.i331.epil ], [ %accumulator.tr4.i333.unr, %pow_.exit338.loopexit.unr-lcssa ] %epil.iter424 = phi i32 [ %epil.iter424.next, %if.else.i331.epil ], [ 0, %pow_.exit338.loopexit.unr-lcssa ] %mul.i335.epil = shl nsw i32 %accumulator.tr4.i333.epil, 1 %epil.iter424.next = add i32 %epil.iter424, 1 %epil.iter424.cmp.not = icmp eq i32 %epil.iter424.next, %xtraiter423 br i1 %epil.iter424.cmp.not, label %pow_.exit338.loopexit, label %if.else.i331.epil, !llvm.loop !27 pow_.exit338.loopexit: ; preds = %if.else.i331.epil, %pow_.exit338.loopexit.unr-lcssa %mul.i335.lcssa = phi i32 [ %mul.i335.lcssa.ph, %pow_.exit338.loopexit.unr-lcssa ], [ %mul.i335.epil, %if.else.i331.epil ] %11 = add nsw i32 %mul.i335.lcssa, -2 br label %pow_.exit338 pow_.exit338: ; preds = %pow_.exit338.loopexit, %if.then147 %accumulator.tr.lcssa.i337 = phi i32 [ -1, %if.then147 ], [ %11, %pow_.exit338.loopexit ] %call152 = call i32 @g(i32 noundef %d.0349) %add153 = add nsw i32 %accumulator.tr.lcssa.i337, %call152 %mul154 = shl nsw i32 %add153, 1 %add155 = add nsw i32 %mul154, %ans.2.lcssa br label %if.end218 if.then158: ; preds = %for.cond.cleanup36 %cmp3.i339 = icmp eq i32 %d.0349, 0 br i1 %cmp3.i339, label %pow_.exit347, label %if.else.i340.preheader if.else.i340.preheader: ; preds = %if.then158 %xtraiter = and i32 %d.0349, 7 %12 = icmp ult i32 %d.0349, 8 br i1 %12, label %pow_.exit347.loopexit.unr-lcssa, label %if.else.i340.preheader.new if.else.i340.preheader.new: ; preds = %if.else.i340.preheader %unroll_iter = and i32 %d.0349, 2147483640 br label %if.else.i340 if.else.i340: ; preds = %if.else.i340, %if.else.i340.preheader.new %accumulator.tr4.i342 = phi i32 [ 1, %if.else.i340.preheader.new ], [ %mul.i344.7, %if.else.i340 ] %niter = phi i32 [ 0, %if.else.i340.preheader.new ], [ %niter.next.7, %if.else.i340 ] %mul.i344.7 = mul i32 %accumulator.tr4.i342, 100000000 %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %pow_.exit347.loopexit.unr-lcssa.loopexit, label %if.else.i340 pow_.exit347.loopexit.unr-lcssa.loopexit: ; preds = %if.else.i340 %mul.i344.6 = mul i32 %accumulator.tr4.i342, 10000000 br label %pow_.exit347.loopexit.unr-lcssa pow_.exit347.loopexit.unr-lcssa: ; preds = %pow_.exit347.loopexit.unr-lcssa.loopexit, %if.else.i340.preheader %accumulator.tr4.i342.lcssa.ph = phi i32 [ undef, %if.else.i340.preheader ], [ %mul.i344.6, %pow_.exit347.loopexit.unr-lcssa.loopexit ] %accumulator.tr4.i342.unr = phi i32 [ 1, %if.else.i340.preheader ], [ %mul.i344.7, %pow_.exit347.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %pow_.exit347.loopexit, label %if.else.i340.epil if.else.i340.epil: ; preds = %pow_.exit347.loopexit.unr-lcssa, %if.else.i340.epil %accumulator.tr4.i342.epil = phi i32 [ %mul.i344.epil, %if.else.i340.epil ], [ %accumulator.tr4.i342.unr, %pow_.exit347.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %if.else.i340.epil ], [ 0, %pow_.exit347.loopexit.unr-lcssa ] %mul.i344.epil = mul nsw i32 %accumulator.tr4.i342.epil, 10 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %pow_.exit347.loopexit, label %if.else.i340.epil, !llvm.loop !28 pow_.exit347.loopexit: ; preds = %if.else.i340.epil, %pow_.exit347.loopexit.unr-lcssa %accumulator.tr4.i342.lcssa = phi i32 [ %accumulator.tr4.i342.lcssa.ph, %pow_.exit347.loopexit.unr-lcssa ], [ %accumulator.tr4.i342.epil, %if.else.i340.epil ] %13 = mul i32 %accumulator.tr4.i342.lcssa, 70 br label %pow_.exit347 pow_.exit347: ; preds = %pow_.exit347.loopexit, %if.then158 %accumulator.tr.lcssa.i346 = phi i32 [ 7, %if.then158 ], [ %13, %pow_.exit347.loopexit ] %cmp164.not367 = icmp sgt i32 %accumulator.tr.lcssa.i346, %0 br i1 %cmp164.not367, label %for.cond.cleanup165, label %while.cond167.preheader while.cond167.preheader: ; preds = %pow_.exit347, %while.end190 %i159.0369 = phi i32 [ %inc200, %while.end190 ], [ %accumulator.tr.lcssa.i346, %pow_.exit347 ] %ans.7368 = phi i32 [ %spec.select311, %while.end190 ], [ %ans.2.lcssa, %pow_.exit347 ] %cmp168353 = icmp slt i32 %i159.0369, 1 br i1 %cmp168353, label %while.end190, label %while.body169 for.cond.cleanup165: ; preds = %while.end190, %pow_.exit347 %ans.7.lcssa = phi i32 [ %ans.2.lcssa, %pow_.exit347 ], [ %spec.select311, %while.end190 ] %call202 = call i32 @g(i32 noundef %inc32) %mul203 = shl nsw i32 %call202, 1 %div204 = sdiv i32 %mul203, 3 %add205 = add nsw i32 %div204, %ans.7.lcssa br label %if.end218 while.body169: ; preds = %while.cond167.preheader, %if.end188 %temp.4357 = phi i32 [ %div189, %if.end188 ], [ %i159.0369, %while.cond167.preheader ] %t.6356 = phi i32 [ %t.7, %if.end188 ], [ 0, %while.cond167.preheader ] %f.6355 = phi i32 [ %f.7, %if.end188 ], [ 0, %while.cond167.preheader ] %s.6354 = phi i32 [ %s.7, %if.end188 ], [ 0, %while.cond167.preheader ] %rem170 = urem i32 %temp.4357, 10 %div189 = udiv i32 %temp.4357, 10 switch i32 %rem170, label %while.end190.loopexit [ i32 3, label %if.then172 i32 5, label %if.then177 i32 7, label %if.then182 ] if.then172: ; preds = %while.body169 %inc173 = add nsw i32 %t.6356, 1 br label %if.end188 if.then177: ; preds = %while.body169 %inc178 = add nsw i32 %f.6355, 1 br label %if.end188 if.then182: ; preds = %while.body169 %inc183 = add nsw i32 %s.6354, 1 br label %if.end188 if.end188: ; preds = %if.then177, %if.then182, %if.then172 %s.7 = phi i32 [ %s.6354, %if.then172 ], [ %s.6354, %if.then177 ], [ %inc183, %if.then182 ] %f.7 = phi i32 [ %f.6355, %if.then172 ], [ %inc178, %if.then177 ], [ %f.6355, %if.then182 ] %t.7 = phi i32 [ %inc173, %if.then172 ], [ %t.6356, %if.then177 ], [ %t.6356, %if.then182 ] %cmp168 = icmp ult i32 %temp.4357, 10 br i1 %cmp168, label %while.end190.loopexit, label %while.body169, !llvm.loop !29 while.end190.loopexit: ; preds = %while.body169, %if.end188 %s.6.lcssa.ph = phi i32 [ %s.7, %if.end188 ], [ %s.6354, %while.body169 ] %f.6.lcssa.ph = phi i32 [ %f.7, %if.end188 ], [ %f.6355, %while.body169 ] %t.6.lcssa.ph = phi i32 [ %t.7, %if.end188 ], [ %t.6356, %while.body169 ] %cmp168.lcssa.ph = phi i1 [ true, %if.end188 ], [ false, %while.body169 ] %14 = mul i32 %f.6.lcssa.ph, %s.6.lcssa.ph %15 = mul i32 %14, %t.6.lcssa.ph br label %while.end190 while.end190: ; preds = %while.end190.loopexit, %while.cond167.preheader %cmp168.lcssa = phi i1 [ true, %while.cond167.preheader ], [ %cmp168.lcssa.ph, %while.end190.loopexit ] %mul192 = phi i32 [ 0, %while.cond167.preheader ], [ %15, %while.end190.loopexit ] %cmp193 = icmp sgt i32 %mul192, 0 %or.cond221 = and i1 %cmp168.lcssa, %cmp193 %inc197 = zext i1 %or.cond221 to i32 %spec.select311 = add nsw i32 %ans.7368, %inc197 %inc200 = add i32 %i159.0369, 1 %exitcond416.not = icmp eq i32 %i159.0369, %0 br i1 %exitcond416.not, label %for.cond.cleanup165, label %while.cond167.preheader, !llvm.loop !30 if.else206: ; preds = %for.cond.cleanup36 %cmp207 = icmp ugt i32 %temp.1348, 7 br i1 %cmp207, label %if.then208, label %if.end218 if.then208: ; preds = %if.else206 %call209 = call i32 @g(i32 noundef %inc32) %add210 = add nsw i32 %call209, %ans.2.lcssa br label %if.end218 if.end218: ; preds = %while.end74, %while.end, %for.cond.cleanup105, %for.cond.cleanup165, %if.then208, %if.else206, %pow_.exit338, %pow_.exit320, %pow_.exit, %for.cond.preheader %ans.9.sink = phi i32 [ 0, %for.cond.preheader ], [ %add95, %pow_.exit320 ], [ %add144, %for.cond.cleanup105 ], [ %add155, %pow_.exit338 ], [ %add205, %for.cond.cleanup165 ], [ %add210, %if.then208 ], [ %ans.2.lcssa, %if.else206 ], [ %ans.2.lcssa, %pow_.exit ], [ %spec.select, %while.end ], [ %spec.select309, %while.end74 ] %call217 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.9.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #5 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6, !7} !6 = !{!"llvm.loop.isvectorized", i32 1} !7 = !{!"llvm.loop.unroll.runtime.disable"} !8 = distinct !{!8, !7, !6} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.unroll.disable"} !11 = !{!12, !12, i64 0} !12 = !{!"int", !13, i64 0} !13 = !{!"omnipotent char", !14, i64 0} !14 = !{!"Simple C/C++ TBAA"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16} !18 = distinct !{!18, !16} !19 = distinct !{!19, !16} !20 = distinct !{!20, !10} !21 = distinct !{!21, !16} !22 = distinct !{!22, !16} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10} !25 = distinct !{!25, !16} !26 = distinct !{!26, !16} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !16} !30 = distinct !{!30, !16}
#include<stdio.h> int main(){ char s[10]; scanf("%s",s); if(s[0] ==s[1] &&s[1] !=s[2] &&s[2] ==s[3]) printf("Yes\n"); else if(s[0] ==s[2] &&s[2] !=s[1] &&s[1] ==s[3]) printf("Yes\n"); else if(s[0] ==s[3] &&s[3] !=s[1] &&s[1] ==s[2]) printf("Yes\n"); else printf("No\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121351/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121351/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %arrayidx6 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %cmp8.not = icmp ne i8 %0, %2 %arrayidx13 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1 %cmp15 = icmp eq i8 %2, %3 %or.cond = select i1 %cmp8.not, i1 %cmp15, i1 false br i1 %or.cond, label %if.end66, label %if.else if.else: ; preds = %entry, %land.lhs.true %cmp22 = icmp eq i8 %0, %2 br i1 %cmp22, label %land.lhs.true24, label %if.else.if.else40_crit_edge if.else.if.else40_crit_edge: ; preds = %if.else %arrayidx43.phi.trans.insert = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 3 %.pre72 = load i8, ptr %arrayidx43.phi.trans.insert, align 1, !tbaa !5 br label %if.else40 land.lhs.true24: ; preds = %if.else %cmp29.not = icmp ne i8 %0, %1 %arrayidx34 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 3 %4 = load i8, ptr %arrayidx34, align 1 %cmp36 = icmp eq i8 %1, %4 %or.cond70 = select i1 %cmp29.not, i1 %cmp36, i1 false br i1 %or.cond70, label %if.end66, label %if.else40 if.else40: ; preds = %if.else.if.else40_crit_edge, %land.lhs.true24 %5 = phi i8 [ %.pre72, %if.else.if.else40_crit_edge ], [ %4, %land.lhs.true24 ] %cmp45 = icmp eq i8 %0, %5 br i1 %cmp45, label %land.lhs.true47, label %if.else63 land.lhs.true47: ; preds = %if.else40 %cmp52.not = icmp ne i8 %0, %1 %cmp59 = icmp eq i8 %1, %2 %or.cond71 = and i1 %cmp59, %cmp52.not br i1 %or.cond71, label %if.end66, label %if.else63 if.else63: ; preds = %land.lhs.true47, %if.else40 br label %if.end66 if.end66: ; preds = %land.lhs.true47, %land.lhs.true24, %land.lhs.true, %if.else63 %str.4.sink = phi ptr [ @str, %if.else63 ], [ @str.5, %land.lhs.true ], [ @str.5, %land.lhs.true24 ], [ @str.5, %land.lhs.true47 ] %puts68 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char S[5]; int i,k; int num = 0; scanf("%s",S); for(i=0;i<=3;i++){ for(k=0;k<=3;k++){ if(S[i] == S[k]){ num = num+1; } } } if(num == 8)printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121401/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [5 x i8], align 4 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load <4 x i8>, ptr %S, align 4, !tbaa !5 %1 = extractelement <4 x i8> %0, i64 0 %2 = extractelement <4 x i8> %0, i64 1 %cmp7.1 = icmp eq i8 %1, %2 %add.1 = zext i1 %cmp7.1 to i32 %spec.select.1 = select i1 %cmp7.1, i32 2, i32 1 %3 = extractelement <4 x i8> %0, i64 2 %cmp7.2 = icmp eq i8 %1, %3 %add.2 = zext i1 %cmp7.2 to i32 %4 = shufflevector <4 x i8> %0, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 3, i32 1> %5 = icmp eq <4 x i8> %0, %4 %6 = select <4 x i1> %5, <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32> zeroinitializer %7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %6) %op.rdx = add i32 %7, 2 %op.rdx38 = add i32 %op.rdx, %add.2 %op.rdx39 = add nuw nsw i32 %add.2, %add.1 %op.rdx40 = add i32 %op.rdx38, %op.rdx39 %op.rdx41 = add i32 %op.rdx40, %spec.select.1 %cmp12 = icmp eq i32 %op.rdx41, 7 %.str.1..str.2 = select i1 %cmp12, ptr @.str.1, ptr @.str.2 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char s[4]; scanf("%s", &s); if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3])printf("Yes\n"); else if(s[0] == s[2] && s[2] != s[1] && s[1] == s[3])printf("Yes\n"); else if(s[0] == s[3] && s[3] != s[1] && s[1] == s[2])printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121445/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121445/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %arrayidx6 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %cmp8.not = icmp ne i8 %0, %2 %arrayidx13 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1 %cmp15 = icmp eq i8 %2, %3 %or.cond = select i1 %cmp8.not, i1 %cmp15, i1 false br i1 %or.cond, label %if.end66, label %if.else if.else: ; preds = %entry, %land.lhs.true %cmp22 = icmp eq i8 %0, %2 br i1 %cmp22, label %land.lhs.true24, label %if.else.if.else40_crit_edge if.else.if.else40_crit_edge: ; preds = %if.else %arrayidx43.phi.trans.insert = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %.pre72 = load i8, ptr %arrayidx43.phi.trans.insert, align 1, !tbaa !5 br label %if.else40 land.lhs.true24: ; preds = %if.else %cmp29.not = icmp ne i8 %0, %1 %arrayidx34 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %4 = load i8, ptr %arrayidx34, align 1 %cmp36 = icmp eq i8 %1, %4 %or.cond70 = select i1 %cmp29.not, i1 %cmp36, i1 false br i1 %or.cond70, label %if.end66, label %if.else40 if.else40: ; preds = %if.else.if.else40_crit_edge, %land.lhs.true24 %5 = phi i8 [ %.pre72, %if.else.if.else40_crit_edge ], [ %4, %land.lhs.true24 ] %cmp45 = icmp eq i8 %0, %5 br i1 %cmp45, label %land.lhs.true47, label %if.else63 land.lhs.true47: ; preds = %if.else40 %cmp52.not = icmp ne i8 %0, %1 %cmp59 = icmp eq i8 %1, %2 %or.cond71 = and i1 %cmp59, %cmp52.not br i1 %or.cond71, label %if.end66, label %if.else63 if.else63: ; preds = %land.lhs.true47, %if.else40 br label %if.end66 if.end66: ; preds = %land.lhs.true47, %land.lhs.true24, %land.lhs.true, %if.else63 %str.4.sink = phi ptr [ @str, %if.else63 ], [ @str.5, %land.lhs.true ], [ @str.5, %land.lhs.true24 ], [ @str.5, %land.lhs.true47 ] %puts68 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
/* 長さ4の英大文字からなる文字列Sが与えられます。 Sがちょうど2種類の文字からなり、かつ現れる各文字は ちょうど2回ずつ現れているかどうか判定してください。 <制約> ・Sの長さは4である。 ・Sは英大文字からなる。 例:ASSA -> YES STOP -> No EEEE -> No URL:https://atcoder.jp/contests/abc132/tasks/abc132_a */ #include <stdio.h> #include <string.h> #include <ctype.h> #include <stdbool.h> #define S_LEN (4) static bool is_upper(char* array, int n); static int appear_char_count(char* array, int n); static void swap(char* a, char* b); static void bubble_sort(char* array, int n); int main(void) { bool result = true; char buf[S_LEN]; scanf("%s", buf); if(strlen(buf) != 4) { printf("No"); return 0; } bubble_sort(buf, strlen(buf)); if(!is_upper(buf, strlen(buf))) { printf("No"); return 0; } if(appear_char_count(buf, strlen(buf)) != 2) { printf("No"); return 0; } printf("Yes"); return 0; } static bool is_upper(char* array, int n) { for(int i = 0; i < n/2; i += 2) { if(!isupper(array[i+0]) || !isupper(array[i+1])) { return false; } } return true; } static int appear_char_count(char* array, int n) { int cnt = 1; char ch = array[0]; for(int i = 1; i < n; i++) { if(ch != array[i]) { cnt++; } ch = array[i]; } return cnt; } static void swap(char* a, char* b) { char tmp = *a; *a = *b; *b = tmp; } static void bubble_sort(char* array, int n) { for(int sorted_i = 0; sorted_i < n-1; sorted_i++) { for(int j = n-1; j > sorted_i; j--) { if(array[j-1] > array[j]) { swap(&array[j-1], &array[j]); } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121502/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121502/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %buf = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %buf) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %buf) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buf) #7 %cmp.not = icmp eq i64 %call2, 4 br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry %arrayidx.i = getelementptr inbounds i8, ptr %buf, i64 2 %0 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %arrayidx8.i = getelementptr inbounds i8, ptr %buf, i64 3 %1 = load i8, ptr %arrayidx8.i, align 1, !tbaa !5 %cmp10.i = icmp sgt i8 %0, %1 br i1 %cmp10.i, label %if.then.i, label %for.inc.i for.body5.preheader.1.i: ; preds = %if.then.247.i, %for.inc.142.i %ch.0.pre.i = phi i8 [ %10, %if.then.247.i ], [ %11, %for.inc.142.i ] %2 = phi i8 [ %11, %if.then.247.i ], [ %10, %for.inc.142.i ] %cmp10.1.i = icmp sgt i8 %9, %6 br i1 %cmp10.1.i, label %if.then.1.i, label %for.inc.1.i if.then.1.i: ; preds = %for.body5.preheader.1.i store i8 %6, ptr %arrayidx.i, align 1, !tbaa !5 store i8 %9, ptr %arrayidx8.i, align 1, !tbaa !5 br label %for.inc.1.i for.inc.1.i: ; preds = %if.then.1.i, %for.body5.preheader.1.i %3 = phi i8 [ %9, %if.then.1.i ], [ %6, %for.body5.preheader.1.i ] %4 = phi i8 [ %6, %if.then.1.i ], [ %9, %for.body5.preheader.1.i ] %cmp10.1.1.i = icmp sgt i8 %2, %4 br i1 %cmp10.1.1.i, label %if.then.1.1.i, label %for.body5.preheader.2.i if.then.1.1.i: ; preds = %for.inc.1.i store i8 %4, ptr %arrayidx.137.i, align 1, !tbaa !5 store i8 %2, ptr %arrayidx.i, align 1, !tbaa !5 br label %for.body5.preheader.2.i for.body5.preheader.2.i: ; preds = %if.then.1.1.i, %for.inc.1.i %5 = phi i8 [ %2, %if.then.1.1.i ], [ %4, %for.inc.1.i ] %cmp10.2.i = icmp sgt i8 %5, %3 br i1 %cmp10.2.i, label %if.then.2.i, label %bubble_sort.exit if.then.2.i: ; preds = %for.body5.preheader.2.i store i8 %3, ptr %arrayidx.i, align 1, !tbaa !5 store i8 %5, ptr %arrayidx8.i, align 1, !tbaa !5 br label %bubble_sort.exit if.then.i: ; preds = %if.end store i8 %1, ptr %arrayidx.i, align 1, !tbaa !5 store i8 %0, ptr %arrayidx8.i, align 1, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %if.end %6 = phi i8 [ %1, %if.end ], [ %0, %if.then.i ] %7 = phi i8 [ %0, %if.end ], [ %1, %if.then.i ] %arrayidx.137.i = getelementptr inbounds i8, ptr %buf, i64 1 %8 = load i8, ptr %arrayidx.137.i, align 1, !tbaa !5 %cmp10.139.i = icmp sgt i8 %8, %7 br i1 %cmp10.139.i, label %if.then.141.i, label %for.inc.142.i if.then.141.i: ; preds = %for.inc.i store i8 %7, ptr %arrayidx.137.i, align 1, !tbaa !5 store i8 %8, ptr %arrayidx.i, align 1, !tbaa !5 br label %for.inc.142.i for.inc.142.i: ; preds = %if.then.141.i, %for.inc.i %9 = phi i8 [ %8, %if.then.141.i ], [ %7, %for.inc.i ] %10 = phi i8 [ %7, %if.then.141.i ], [ %8, %for.inc.i ] %11 = load i8, ptr %buf, align 1, !tbaa !5 %cmp10.245.i = icmp sgt i8 %11, %10 br i1 %cmp10.245.i, label %if.then.247.i, label %for.body5.preheader.1.i if.then.247.i: ; preds = %for.inc.142.i store i8 %10, ptr %buf, align 1, !tbaa !5 store i8 %11, ptr %arrayidx.137.i, align 1, !tbaa !5 br label %for.body5.preheader.1.i bubble_sort.exit: ; preds = %for.body5.preheader.2.i, %if.then.2.i %call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buf) #7 %conv10 = trunc i64 %call9 to i32 %cmp19.i = icmp slt i32 %conv10, 2 br i1 %cmp19.i, label %cleanup, label %for.body.lr.ph.i for.body.lr.ph.i: ; preds = %bubble_sort.exit %div2526.i = lshr i64 %call9, 1 %call.i = tail call ptr @__ctype_b_loc() #8 %12 = load ptr, ptr %call.i, align 8, !tbaa !8 %13 = and i64 %div2526.i, 2147483647 br label %for.body.i for.cond.i: ; preds = %lor.lhs.false.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 2 %cmp.not.i = icmp ult i64 %indvars.iv.next.i, %13 br i1 %cmp.not.i, label %for.body.i, label %for.body.preheader.i, !llvm.loop !10 for.body.i: ; preds = %for.cond.i, %for.body.lr.ph.i %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.cond.i ] %arrayidx.i27 = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv.i %14 = load i8, ptr %arrayidx.i27, align 1, !tbaa !5 %idxprom1.i = sext i8 %14 to i64 %arrayidx2.i = getelementptr inbounds i16, ptr %12, i64 %idxprom1.i %15 = load i16, ptr %arrayidx2.i, align 2, !tbaa !12 %16 = and i16 %15, 256 %tobool.not.i = icmp eq i16 %16, 0 br i1 %tobool.not.i, label %cleanup, label %lor.lhs.false.i lor.lhs.false.i: ; preds = %for.body.i %17 = or i64 %indvars.iv.i, 1 %arrayidx7.i = getelementptr inbounds i8, ptr %buf, i64 %17 %18 = load i8, ptr %arrayidx7.i, align 1, !tbaa !5 %idxprom9.i = sext i8 %18 to i64 %arrayidx10.i = getelementptr inbounds i16, ptr %12, i64 %idxprom9.i %19 = load i16, ptr %arrayidx10.i, align 2, !tbaa !12 %20 = and i16 %19, 256 %tobool13.not.i = icmp eq i16 %20, 0 br i1 %tobool13.not.i, label %cleanup, label %for.cond.i for.body.preheader.i: ; preds = %for.cond.i %wide.trip.count.i = and i64 %call9, 4294967295 %21 = add nsw i64 %wide.trip.count.i, -1 %min.iters.check = icmp ult i64 %21, 8 br i1 %min.iters.check, label %for.body.i28.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %21, -8 %ind.end = or i64 %n.vec, 1 %vector.recur.init = insertelement <4 x i8> poison, i8 %ch.0.pre.i, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load37, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 0, i32 0, i32 0>, %vector.ph ], [ %30, %vector.body ] %vec.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ] %offset.idx = or i64 %index, 1 %22 = getelementptr inbounds i8, ptr %buf, i64 %offset.idx %wide.load = load <4 x i8>, ptr %22, align 1, !tbaa !5 %23 = getelementptr inbounds i8, ptr %22, i64 4 %wide.load37 = load <4 x i8>, ptr %23, align 1, !tbaa !5 %24 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %25 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load37, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %26 = icmp ne <4 x i8> %24, %wide.load %27 = icmp ne <4 x i8> %25, %wide.load37 %28 = zext <4 x i1> %26 to <4 x i32> %29 = zext <4 x i1> %27 to <4 x i32> %30 = add <4 x i32> %vec.phi, %28 %31 = add <4 x i32> %vec.phi36, %29 %index.next = add nuw i64 %index, 8 %32 = icmp eq i64 %index.next, %n.vec br i1 %32, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %31, %30 %33 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %21, %n.vec %vector.recur.extract = extractelement <4 x i8> %wide.load37, i64 3 br i1 %cmp.n, label %appear_char_count.exit, label %for.body.i28.preheader for.body.i28.preheader: ; preds = %for.body.preheader.i, %middle.block %scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %ch.0.pre.i, %for.body.preheader.i ] %indvars.iv.i29.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.preheader.i ] %cnt.015.i.ph = phi i32 [ %33, %middle.block ], [ 1, %for.body.preheader.i ] br label %for.body.i28 for.body.i28: ; preds = %for.body.i28.preheader, %for.body.i28 %scalar.recur = phi i8 [ %34, %for.body.i28 ], [ %scalar.recur.ph, %for.body.i28.preheader ] %indvars.iv.i29 = phi i64 [ %indvars.iv.next.i30, %for.body.i28 ], [ %indvars.iv.i29.ph, %for.body.i28.preheader ] %cnt.015.i = phi i32 [ %spec.select.i, %for.body.i28 ], [ %cnt.015.i.ph, %for.body.i28.preheader ] %arrayidx1.i = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv.i29 %34 = load i8, ptr %arrayidx1.i, align 1, !tbaa !5 %cmp3.not.i = icmp ne i8 %scalar.recur, %34 %inc.i = zext i1 %cmp3.not.i to i32 %spec.select.i = add nuw nsw i32 %cnt.015.i, %inc.i %indvars.iv.next.i30 = add nuw nsw i64 %indvars.iv.i29, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i30, %wide.trip.count.i br i1 %exitcond.not.i, label %appear_char_count.exit, label %for.body.i28, !llvm.loop !17 appear_char_count.exit: ; preds = %for.body.i28, %middle.block %spec.select.i.lcssa = phi i32 [ %33, %middle.block ], [ %spec.select.i, %for.body.i28 ] %cmp20.not = icmp eq i32 %spec.select.i.lcssa, 2 %spec.select = select i1 %cmp20.not, ptr @.str.2, ptr @.str.1 br label %cleanup cleanup: ; preds = %for.body.i, %lor.lhs.false.i, %appear_char_count.exit, %bubble_sort.exit, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %bubble_sort.exit ], [ %spec.select, %appear_char_count.exit ], [ @.str.1, %lor.lhs.false.i ], [ @.str.1, %for.body.i ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %buf) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } attributes #8 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"any pointer", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!13, !13, i64 0} !13 = !{!"short", !6, i64 0} !14 = distinct !{!14, !11, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !11, !16, !15}
#include<stdio.h> int main(void){ char str[4]; scanf("%s",str); if(str[0]==str[1]&&str[2]==str[3]&&str[0]!=str[2]){printf("Yes");} else if(str[0]==str[2]&&str[1]==str[3]&&str[0]!=str[1]){printf("Yes");} else if(str[0]==str[3]&&str[1]==str[2]&&str[0]!=str[1]){printf("Yes");} else{printf("No");} }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121546/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121546/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %0 = load i8, ptr %str, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %arrayidx4 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 2 %2 = load i8, ptr %arrayidx4, align 1, !tbaa !5 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %arrayidx6 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 3 %3 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp ne i8 %2, %3 %cmp15.not = icmp eq i8 %0, %2 %or.cond = or i1 %cmp15.not, %cmp8 br i1 %or.cond, label %if.else, label %if.end66 if.else: ; preds = %entry, %land.lhs.true %cmp22 = icmp ne i8 %0, %2 %arrayidx27 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 3 %4 = load i8, ptr %arrayidx27, align 1, !tbaa !5 %cmp29 = icmp ne i8 %1, %4 %or.cond67 = or i1 %cmp, %cmp29 %or.cond71 = select i1 %cmp22, i1 true, i1 %or.cond67 br i1 %or.cond71, label %if.else40, label %if.end66 if.else40: ; preds = %if.else %cmp45 = icmp ne i8 %0, %4 %cmp52 = icmp ne i8 %1, %2 %5 = or i1 %cmp52, %cmp45 %or.cond69 = or i1 %cmp, %5 %.str.2..str.1 = select i1 %or.cond69, ptr @.str.2, ptr @.str.1 br label %if.end66 if.end66: ; preds = %if.else40, %if.else, %land.lhs.true %.str.1.sink = phi ptr [ @.str.1, %land.lhs.true ], [ @.str.1, %if.else ], [ %.str.2..str.1, %if.else40 ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %str) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() {int a,b,c,d,e,f,i,j,n,ar[101][2]; scanf("%d%d",&n,&a); for(i=0;i<n;i++) scanf("%d%d",&ar[i][0],&ar[i][1]); d=7-a; for(i=1;i<n;i++) { b=7-ar[i][0]; c=7-ar[i][1]; for(j=1;j<7;j++) {if(b!=j&&c!=j&&ar[i][0]!=j&&ar[i][1]!=j) f=j; } e=7-f; if(d!=f&&d!=e) {printf("NO\n"); return 0; } if(d==e) d=f; else d=e; } printf("YES\n"); return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12159/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12159/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %n = alloca i32, align 4 %ar = alloca [101 x [2 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 808, ptr nonnull %ar) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 br i1 %cmp82, label %for.body, label %cleanup for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x [2 x i32]], ptr %ar, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [101 x [2 x i32]], ptr %ar, i64 0, i64 %indvars.iv, i64 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp786 = icmp sgt i32 %1, 1 br i1 %cmp786, label %for.body8.preheader, label %cleanup for.body8.preheader: ; preds = %for.end %3 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 7, %3 %wide.trip.count = zext i32 %1 to i64 br label %for.body8 for.body8: ; preds = %for.body8.preheader, %if.end41 %indvars.iv92 = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next93, %if.end41 ] %f.088 = phi i32 [ undef, %for.body8.preheader ], [ %f.2.5, %if.end41 ] %d.087 = phi i32 [ %sub, %for.body8.preheader ], [ %f.1.sub35, %if.end41 ] %arrayidx10 = getelementptr inbounds [101 x [2 x i32]], ptr %ar, i64 0, i64 %indvars.iv92 %4 = load <2 x i32>, ptr %arrayidx10, align 8, !tbaa !5 %5 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1> %.fr = freeze <4 x i32> %5 %6 = extractelement <2 x i32> %4, i64 0 %7 = extractelement <2 x i32> %4, i64 1 %8 = icmp eq <4 x i32> %.fr, <i32 6, i32 6, i32 1, i32 1> %9 = bitcast <4 x i1> %8 to i4 %.not = icmp eq i4 %9, 0 %f.2 = select i1 %.not, i32 1, i32 %f.088 %10 = icmp eq <4 x i32> %.fr, <i32 5, i32 5, i32 2, i32 2> %11 = bitcast <4 x i1> %10 to i4 %.not97 = icmp eq i4 %11, 0 %f.2.1 = select i1 %.not97, i32 2, i32 %f.2 %cmp21.not.2 = icmp eq i32 %7, 4 %12 = add i32 %6, -3 %13 = icmp ult i32 %12, 2 %or.cond81.2 = select i1 %13, i1 true, i1 %cmp21.not.2 %cmp31.not.2 = icmp eq i32 %7, 3 %14 = select i1 %or.cond81.2, i1 true, i1 %cmp31.not.2 %f.2.2 = select i1 %14, i32 %f.2.1, i32 3 %cmp21.not.3 = icmp eq i32 %7, 3 %15 = add i32 %6, -3 %16 = icmp ult i32 %15, 2 %or.cond81.3 = select i1 %16, i1 true, i1 %cmp21.not.3 %cmp31.not.3 = icmp eq i32 %7, 4 %17 = select i1 %or.cond81.3, i1 true, i1 %cmp31.not.3 %f.2.3 = select i1 %17, i32 %f.2.2, i32 4 %18 = icmp eq <4 x i32> %.fr, <i32 2, i32 2, i32 5, i32 5> %19 = bitcast <4 x i1> %18 to i4 %.not98 = icmp eq i4 %19, 0 %f.2.4 = select i1 %.not98, i32 5, i32 %f.2.3 %20 = icmp eq <4 x i32> %.fr, <i32 1, i32 1, i32 6, i32 6> %21 = bitcast <4 x i1> %20 to i4 %.not99 = icmp eq i4 %21, 0 %f.2.5 = select i1 %.not99, i32 6, i32 %f.2.4 %sub35 = sub nsw i32 7, %f.2.5 %cmp36.not = icmp eq i32 %d.087, %f.2.5 %cmp38.not = icmp eq i32 %d.087, %sub35 %or.cond80 = select i1 %cmp36.not, i1 true, i1 %cmp38.not br i1 %or.cond80, label %if.end41, label %cleanup if.end41: ; preds = %for.body8 %f.1.sub35 = select i1 %cmp38.not, i32 %f.2.5, i32 %sub35 %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %exitcond.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body8, !llvm.loop !11 cleanup: ; preds = %if.end41, %for.body8, %for.end, %entry %str.sink = phi ptr [ @str, %entry ], [ @str, %for.end ], [ @str.3, %for.body8 ], [ @str, %if.end41 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 808, ptr nonnull %ar) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
/* Author: Abhay Problem: 225A (Codeforces) Language: C */ #include <stdio.h> int main () { int n, i, j, x, y, z, dice[7]; scanf ("%d", &n); scanf ("%d", &x); for (i=0; i<n; i++) { for (j=1; j<=6; j++) dice[j] = 0; scanf ("%d", &z); dice[z] = 1; dice[7-z] = 1; scanf ("%d", &z); dice[z] = 1; dice[7-z] = 1; if (dice[x]) break; } if (i == n) printf ("YES\n"); else printf ("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 %z = alloca i32, align 4 %dice = alloca [7 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #5 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.cond2.preheader.preheader, label %for.end20 for.cond2.preheader.preheader: ; preds = %entry %scevgep = getelementptr inbounds i8, ptr %dice, i64 4 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.inc18 %i.033 = phi i32 [ %inc19, %for.inc18 ], [ 0, %for.cond2.preheader.preheader ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %scevgep, i8 0, i64 24, i1 false), !tbaa !5 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z) %1 = load i32, ptr %z, align 4, !tbaa !5 %idxprom6 = sext i32 %1 to i64 %arrayidx7 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %sub = sub nsw i32 7, %1 %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom8 store i32 1, ptr %arrayidx9, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z) %2 = load i32, ptr %z, align 4, !tbaa !5 %idxprom11 = sext i32 %2 to i64 %arrayidx12 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom11 store i32 1, ptr %arrayidx12, align 4, !tbaa !5 %sub13 = sub nsw i32 7, %2 %idxprom14 = sext i32 %sub13 to i64 %arrayidx15 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom14 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 %3 = load i32, ptr %x, align 4, !tbaa !5 %idxprom16 = sext i32 %3 to i64 %arrayidx17 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom16 %4 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 %.pre.pre = load i32, ptr %n, align 4, !tbaa !5 br i1 %tobool.not, label %for.inc18, label %for.end20 for.inc18: ; preds = %for.cond2.preheader %inc19 = add nuw nsw i32 %i.033, 1 %cmp = icmp slt i32 %inc19, %.pre.pre br i1 %cmp, label %for.cond2.preheader, label %for.end20, !llvm.loop !9 for.end20: ; preds = %for.inc18, %for.cond2.preheader, %entry %5 = phi i32 [ %0, %entry ], [ %.pre.pre, %for.cond2.preheader ], [ %.pre.pre, %for.inc18 ] %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc19, %for.inc18 ], [ %i.033, %for.cond2.preheader ] %cmp21 = icmp eq i32 %i.0.lcssa, %5 %str.3.str = select i1 %cmp21, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char s[5]; scanf("%s",s); int flag = 0; for(int i = 0; i < 4; i++) { int count = 0; for(int j = i; j < 4; j++) { if(s[i] == s[j]) count++; } if(count == 2) flag++; } if(flag == 2) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121690/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121690/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx6.143 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx6.143, align 1, !tbaa !5 %cmp8.144 = icmp eq i8 %0, %1 %spec.select33.1 = select i1 %cmp8.144, i32 2, i32 1 %arrayidx6.247 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6.247, align 1, !tbaa !5 %cmp8.248 = icmp eq i8 %0, %2 %inc.249 = zext i1 %cmp8.248 to i32 %spec.select33.2 = add nuw nsw i32 %spec.select33.1, %inc.249 %arrayidx6.351 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx6.351, align 1, !tbaa !5 %cmp8.352 = icmp eq i8 %0, %3 %inc.353 = zext i1 %cmp8.352 to i32 %spec.select33.3 = add nuw nsw i32 %spec.select33.2, %inc.353 %cmp11 = icmp eq i32 %spec.select33.3, 2 %cmp8.1.1 = icmp eq i8 %1, %2 %spec.select33.1.1 = select i1 %cmp8.1.1, i32 2, i32 1 %cmp8.1.2 = icmp eq i8 %1, %3 %inc.1.2 = zext i1 %cmp8.1.2 to i32 %spec.select33.1.2 = add nuw nsw i32 %spec.select33.1.1, %inc.1.2 %inc14 = zext i1 %cmp11 to i32 %cmp11.1 = icmp eq i32 %spec.select33.1.2, 2 %inc14.1 = zext i1 %cmp11.1 to i32 %cmp8.2.1 = icmp eq i8 %2, %3 %spec.select.1 = add nuw nsw i32 %inc14, %inc14.1 %inc14.2 = zext i1 %cmp8.2.1 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc14.2 %cmp19 = icmp eq i32 %spec.select.2, 2 %str.3.str = select i1 %cmp19, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(){ int n,count=0,i,j,k,l,p,q; char name[26]; scanf("%d",&n); scanf("%s",name); p=strlen(name); for (i=0; i<n; i++) { char plate[101]; scanf("%s",plate); q=strlen(plate); for (j=0; j<q-p+1; j++) { for (k=1; j+k*p-k<q; k++) { l=0; while (name[l]==plate[j+k*l]&&l<p) { l++; if (l==p) { count++; break; } } if (l==p) { break; } } if (l==p) { break; } } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121733/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121733/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %name = alloca [26 x i8], align 16 %plate = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %name) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %name) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %name) #5 %conv = trunc i64 %call3 to i32 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp86 = icmp sgt i32 %0, 0 br i1 %cmp86, label %for.body.preheader, label %for.end47 for.body.preheader: ; preds = %entry %sext = shl i64 %call3, 32 %1 = ashr exact i64 %sext, 32 %2 = and i64 %call3, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.end44 %count.089 = phi i32 [ %count.5, %for.end44 ], [ 0, %for.body.preheader ] %i.088 = phi i32 [ %inc46, %for.end44 ], [ 0, %for.body.preheader ] %l.087 = phi i32 [ %l.6, %for.end44 ], [ undef, %for.body.preheader ] call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %plate) #4 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %plate) %call8 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %plate) #5 %conv9 = trunc i64 %call8 to i32 %sub = sub nsw i32 %conv9, %conv %cmp11.not78 = icmp slt i32 %sub, 0 br i1 %cmp11.not78, label %for.end44, label %for.cond14.preheader.preheader for.cond14.preheader.preheader: ; preds = %for.body %3 = zext i32 %sub to i64 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond14.preheader.preheader, %for.end %indvars.iv98 = phi i64 [ 0, %for.cond14.preheader.preheader ], [ %indvars.iv.next99, %for.end ] %count.181 = phi i32 [ %count.089, %for.cond14.preheader.preheader ], [ %count.4, %for.end ] %l.180 = phi i32 [ %l.087, %for.cond14.preheader.preheader ], [ %l.5, %for.end ] %indvars101 = trunc i64 %indvars.iv98 to i32 %add1570 = add nsw i32 %indvars101, -1 %sub1671 = add i32 %add1570, %conv %cmp1772 = icmp slt i32 %sub1671, %conv9 br i1 %cmp1772, label %while.cond.preheader, label %for.end for.cond14: ; preds = %while.end %indvars.iv.next96 = add nuw i64 %indvars.iv95, 1 %4 = trunc i64 %indvars.iv.next96 to i32 %mul = mul nsw i32 %4, %conv %5 = trunc i64 %indvars.iv95 to i32 %k.0.neg = xor i32 %5, -1 %add15 = add nsw i32 %indvars101, %k.0.neg %sub16 = add i32 %add15, %mul %cmp17 = icmp slt i32 %sub16, %conv9 br i1 %cmp17, label %while.cond.preheader, label %for.end, !llvm.loop !9 while.cond.preheader: ; preds = %for.cond14.preheader, %for.cond14 %indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.cond14 ], [ 1, %for.cond14.preheader ] %count.274 = phi i32 [ %count.3, %for.cond14 ], [ %count.181, %for.cond14.preheader ] br label %while.cond while.cond: ; preds = %while.cond.preheader, %while.body %indvars.iv = phi i64 [ 0, %while.cond.preheader ], [ %indvars.iv.next, %while.body ] %arrayidx = getelementptr inbounds [26 x i8], ptr %name, i64 0, i64 %indvars.iv %6 = load i8, ptr %arrayidx, align 1, !tbaa !11 %7 = mul nuw nsw i64 %indvars.iv, %indvars.iv95 %8 = add nuw nsw i64 %7, %indvars.iv98 %arrayidx24 = getelementptr inbounds [101 x i8], ptr %plate, i64 0, i64 %8 %9 = load i8, ptr %arrayidx24, align 1, !tbaa !11 %cmp26 = icmp eq i8 %6, %9 %cmp28 = icmp slt i64 %indvars.iv, %1 %10 = select i1 %cmp26, i1 %cmp28, i1 false br i1 %10, label %while.body, label %while.end while.body: ; preds = %while.cond %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp30 = icmp eq i64 %indvars.iv.next, %2 br i1 %cmp30, label %if.then, label %while.cond, !llvm.loop !12 if.then: ; preds = %while.body %inc32 = add nsw i32 %count.274, 1 br label %while.end while.end: ; preds = %while.cond, %if.then %l.4.in = phi i64 [ %call3, %if.then ], [ %indvars.iv, %while.cond ] %count.3 = phi i32 [ %inc32, %if.then ], [ %count.274, %while.cond ] %l.4 = trunc i64 %l.4.in to i32 %cmp33 = icmp eq i32 %l.4, %conv br i1 %cmp33, label %for.end44, label %for.cond14 for.end: ; preds = %for.cond14, %for.cond14.preheader %l.5 = phi i32 [ %l.180, %for.cond14.preheader ], [ %l.4, %for.cond14 ] %count.4 = phi i32 [ %count.181, %for.cond14.preheader ], [ %count.3, %for.cond14 ] %cmp38 = icmp eq i32 %l.5, %conv %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %cmp11.not = icmp uge i64 %indvars.iv98, %3 %or.cond = or i1 %cmp38, %cmp11.not br i1 %or.cond, label %for.end44, label %for.cond14.preheader, !llvm.loop !13 for.end44: ; preds = %for.end, %while.end, %for.body %l.6 = phi i32 [ %l.087, %for.body ], [ %conv, %while.end ], [ %l.5, %for.end ] %count.5 = phi i32 [ %count.089, %for.body ], [ %count.3, %while.end ], [ %count.4, %for.end ] call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %plate) #4 %inc46 = add nuw nsw i32 %i.088, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc46, %11 br i1 %cmp, label %for.body, label %for.end47, !llvm.loop !14 for.end47: ; preds = %for.end44, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.5, %for.end44 ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %name) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #include<string.h> #define NMAX 100 #define KMAX 25 int matrix[NMAX*2][NMAX], match[NMAX], visit[NMAX]; int Dfs(int, int); int main(void) { int i, x, y, e, s, t, maxflow = 0; scanf("%d %d %d", &x, &y, &e); for (i = 0; i < y; i++) match[i] = -1; for (i = 0; i < e; i++) { scanf("%d %d", &s, &t); matrix[s][t] = 1; } for (i = 0; i < x; i++) { memset(visit, 0, sizeof(int) * x); if (Dfs(i, y)) maxflow++; } printf("%d\n", maxflow); } int Dfs(int v, int ysize) { int i; visit[v] = 1; for (i = 0; i < ysize; i++) { int w = match[i]; if (!matrix[v][i]) continue; if (w < 0 || !visit[w] && Dfs(w, ysize)) { match[i] = v; return 1; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121784/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121784/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @match = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @matrix = dso_local local_unnamed_addr global [200 x [100 x i32]] zeroinitializer, align 16 @visit = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %e = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %e) %0 = load i32, ptr %y, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body.preheader, label %for.cond1.preheader for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @match, i8 -1, i64 %2, i1 false), !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.body.preheader, %entry %3 = load i32, ptr %e, align 4, !tbaa !5 %cmp231 = icmp sgt i32 %3, 0 br i1 %cmp231, label %for.body3, label %for.cond12.preheader for.cond12.preheader: ; preds = %for.body3, %for.cond1.preheader %4 = load i32, ptr %x, align 4, !tbaa !5 %cmp1333 = icmp sgt i32 %4, 0 br i1 %cmp1333, label %for.body14, label %for.end19 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.132 = phi i32 [ %inc10, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t) %5 = load i32, ptr %s, align 4, !tbaa !5 %idxprom5 = sext i32 %5 to i64 %6 = load i32, ptr %t, align 4, !tbaa !5 %idxprom7 = sext i32 %6 to i64 %arrayidx8 = getelementptr inbounds [200 x [100 x i32]], ptr @matrix, i64 0, i64 %idxprom5, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %inc10 = add nuw nsw i32 %i.132, 1 %7 = load i32, ptr %e, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc10, %7 br i1 %cmp2, label %for.body3, label %for.cond12.preheader, !llvm.loop !9 for.body14: ; preds = %for.cond12.preheader, %for.body14 %8 = phi i32 [ %10, %for.body14 ], [ %4, %for.cond12.preheader ] %maxflow.035 = phi i32 [ %spec.select, %for.body14 ], [ 0, %for.cond12.preheader ] %i.234 = phi i32 [ %inc18, %for.body14 ], [ 0, %for.cond12.preheader ] %conv = sext i32 %8 to i64 %mul = shl nsw i64 %conv, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @visit, i8 0, i64 %mul, i1 false) %9 = load i32, ptr %y, align 4, !tbaa !5 %call15 = call i32 @Dfs(i32 noundef %i.234, i32 noundef %9) %tobool.not = icmp ne i32 %call15, 0 %inc16 = zext i1 %tobool.not to i32 %spec.select = add nuw nsw i32 %maxflow.035, %inc16 %inc18 = add nuw nsw i32 %i.234, 1 %10 = load i32, ptr %x, align 4, !tbaa !5 %cmp13 = icmp slt i32 %inc18, %10 br i1 %cmp13, label %for.body14, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.body14, %for.cond12.preheader %maxflow.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ %spec.select, %for.body14 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %maxflow.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Dfs(i32 noundef %v, i32 noundef %ysize) local_unnamed_addr #4 { entry: %idxprom = sext i32 %v to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @visit, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %ysize, 0 br i1 %cmp27, label %for.body.preheader, label %cleanup16 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %ysize to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx2 = getelementptr inbounds [100 x i32], ptr @match, i64 0, i64 %indvars.iv %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [200 x [100 x i32]], ptr @matrix, i64 0, i64 %idxprom, i64 %indvars.iv %1 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %tobool.not = icmp eq i32 %1, 0 br i1 %tobool.not, label %for.inc, label %if.end if.end: ; preds = %for.body %cmp7 = icmp slt i32 %0, 0 br i1 %cmp7, label %cleanup, label %lor.lhs.false lor.lhs.false: ; preds = %if.end %idxprom8 = zext i32 %0 to i64 %arrayidx9 = getelementptr inbounds [100 x i32], ptr @visit, i64 0, i64 %idxprom8 %2 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %tobool10.not = icmp eq i32 %2, 0 br i1 %tobool10.not, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %lor.lhs.false %call = tail call i32 @Dfs(i32 noundef %0, i32 noundef %ysize) %tobool11.not = icmp eq i32 %call, 0 br i1 %tobool11.not, label %for.inc, label %cleanup cleanup: ; preds = %if.end, %land.lhs.true store i32 %v, ptr %arrayidx2, align 4, !tbaa !5 br label %cleanup16 for.inc: ; preds = %for.body, %land.lhs.true, %lor.lhs.false %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup16, label %for.body, !llvm.loop !12 cleanup16: ; preds = %for.inc, %entry, %cleanup %retval.2 = phi i32 [ 1, %cleanup ], [ 0, %entry ], [ 0, %for.inc ] ret i32 %retval.2 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int getGCD(int x, int y) { if (y == 0){ return (x); } getGCD(y, x % y); } int getLCM(int x, int y) { if ((x == 0) || (y == 0)){ return (0); } return ((x / getGCD(x, y)) * y); } int main(void) { long x, y; long gcd,lcm; while (scanf("%d %d", &x, &y) != EOF){ gcd = getGCD(x, y); lcm = getLCM(x, y); printf("%d %d\n", gcd, lcm); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121827/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121827/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @getGCD(i32 noundef returned %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp5.not = icmp eq i32 %y, 0 br i1 %cmp5.not, label %return, label %if.end if.end: ; preds = %entry, %if.end %y.tr7 = phi i32 [ %rem, %if.end ], [ %y, %entry ] %x.tr6 = phi i32 [ %y.tr7, %if.end ], [ %x, %entry ] %rem = srem i32 %x.tr6, %y.tr7 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret i32 %x } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @getLCM(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %x, 0 %cmp1 = icmp eq i32 %y, 0 %or.cond = or i1 %cmp, %cmp1 br i1 %or.cond, label %return, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %y.tr7.i = phi i32 [ %rem.i, %if.end.i ], [ %y, %entry ] %x.tr6.i = phi i32 [ %y.tr7.i, %if.end.i ], [ %x, %entry ] %rem.i = srem i32 %x.tr6.i, %y.tr7.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %return, label %if.end.i return: ; preds = %if.end.i, %entry %retval.0 = phi i32 [ 0, %entry ], [ %y, %if.end.i ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not16 = icmp eq i32 %call15, -1 br i1 %cmp.not16, label %while.end, label %while.body while.body: ; preds = %entry, %getLCM.exit %0 = load i64, ptr %x, align 8, !tbaa !5 %conv = trunc i64 %0 to i32 %1 = load i64, ptr %y, align 8, !tbaa !5 %conv1 = trunc i64 %1 to i32 %cmp5.not.i = icmp eq i32 %conv1, 0 br i1 %cmp5.not.i, label %getLCM.exit, label %if.end.i if.end.i: ; preds = %while.body, %if.end.i %y.tr7.i = phi i32 [ %rem.i, %if.end.i ], [ %conv1, %while.body ] %x.tr6.i = phi i32 [ %y.tr7.i, %if.end.i ], [ %conv, %while.body ] %rem.i = srem i32 %x.tr6.i, %y.tr7.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %getGCD.exit, label %if.end.i getGCD.exit: ; preds = %if.end.i %cmp.i9 = icmp eq i32 %conv, 0 br i1 %cmp.i9, label %getLCM.exit, label %if.end.i.i if.end.i.i: ; preds = %getGCD.exit, %if.end.i.i %y.tr7.i.i = phi i32 [ %rem.i.i, %if.end.i.i ], [ %conv1, %getGCD.exit ] %x.tr6.i.i = phi i32 [ %y.tr7.i.i, %if.end.i.i ], [ %conv, %getGCD.exit ] %rem.i.i = srem i32 %x.tr6.i.i, %y.tr7.i.i %cmp.i.i = icmp eq i32 %rem.i.i, 0 br i1 %cmp.i.i, label %getLCM.exit, label %if.end.i.i getLCM.exit: ; preds = %if.end.i.i, %while.body, %getGCD.exit %retval.0.i = phi i64 [ 0, %getGCD.exit ], [ 0, %while.body ], [ %1, %if.end.i.i ] %conv313.in = shl i64 %0, 32 %conv313 = ashr exact i64 %conv313.in, 32 %sext = shl i64 %retval.0.i, 32 %conv7 = ashr exact i64 %sext, 32 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv313, i64 noundef %conv7) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %getLCM.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_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 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> //#include <math.h> long Gcd(long m, long n) { long temp; while (m % n != 0) { temp = n; n = m % n; m = temp; } return n; } long Lcm(long m, long n) { return m * n / Gcd(m,n); } int main(){ long a,b; while(scanf("%ld %ld",&a,&b)!=EOF){ long ans1,ans2; ans1=Gcd(a,b); ans2=Lcm(a,b); printf("%ld %ld\n",ans1,ans2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121870/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121870/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @Gcd(i64 noundef %m, i64 noundef %n) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %n.addr.0 = phi i64 [ %n, %entry ], [ %rem, %while.cond ] %m.addr.0 = phi i64 [ %m, %entry ], [ %n.addr.0, %while.cond ] %rem = srem i64 %m.addr.0, %n.addr.0 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond ret i64 %n.addr.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @Lcm(i64 noundef %m, i64 noundef %n) local_unnamed_addr #0 { entry: br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %entry %n.addr.0.i = phi i64 [ %n, %entry ], [ %rem.i, %while.cond.i ] %m.addr.0.i = phi i64 [ %m, %entry ], [ %n.addr.0.i, %while.cond.i ] %rem.i = srem i64 %m.addr.0.i, %n.addr.0.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %Gcd.exit, label %while.cond.i, !llvm.loop !5 Gcd.exit: ; preds = %while.cond.i %mul = mul nsw i64 %n, %m %div = sdiv i64 %mul, %n.addr.0.i ret i64 %div } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not5 = icmp eq i32 %call4, -1 br i1 %cmp.not5, label %while.end, label %while.body while.body: ; preds = %entry, %Lcm.exit %0 = load i64, ptr %a, align 8, !tbaa !7 %1 = load i64, ptr %b, align 8, !tbaa !7 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %while.body %n.addr.0.i = phi i64 [ %1, %while.body ], [ %rem.i, %while.cond.i ] %m.addr.0.i = phi i64 [ %0, %while.body ], [ %n.addr.0.i, %while.cond.i ] %rem.i = srem i64 %m.addr.0.i, %n.addr.0.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %while.cond.i.i, label %while.cond.i, !llvm.loop !5 while.cond.i.i: ; preds = %while.cond.i, %while.cond.i.i %n.addr.0.i.i = phi i64 [ %rem.i.i, %while.cond.i.i ], [ %1, %while.cond.i ] %m.addr.0.i.i = phi i64 [ %n.addr.0.i.i, %while.cond.i.i ], [ %0, %while.cond.i ] %rem.i.i = srem i64 %m.addr.0.i.i, %n.addr.0.i.i %cmp.not.i.i = icmp eq i64 %rem.i.i, 0 br i1 %cmp.not.i.i, label %Lcm.exit, label %while.cond.i.i, !llvm.loop !5 Lcm.exit: ; preds = %while.cond.i.i %mul.i = mul nsw i64 %1, %0 %div.i = sdiv i64 %mul.i, %n.addr.0.i.i %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %n.addr.0.i, i64 noundef %div.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %Lcm.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int main() { while(1) { long a, b; long i = 2; long GCM = 1; long LCM = 1; if (scanf("%ld %ld", &a, &b) == EOF) break; while ((i<=a)&&(i<=b)) { if ((a%i==0)&&(b%i==0)) { GCM *= i; a /= i; b/= i; } else i++; } LCM = GCM * (a/LCM) * (b/LCM); printf("%ld %ld\n", GCM, LCM); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121913/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121913/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp49 = icmp eq i32 %call48, -1 br i1 %cmp49, label %while.end20, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %cleanup %a.promoted = load i64, ptr %a, align 8, !tbaa !5 %b.promoted = load i64, ptr %b, align 8 %cmp240 = icmp sgt i64 %a.promoted, 1 %cmp341 = icmp sgt i64 %b.promoted, 1 %0 = select i1 %cmp240, i1 %cmp341, i1 false br i1 %0, label %while.body4, label %cleanup while.body4: ; preds = %while.cond1.preheader, %if.end10 %GCM.045 = phi i64 [ %GCM.1, %if.end10 ], [ 1, %while.cond1.preheader ] %i.044 = phi i64 [ %i.1, %if.end10 ], [ 2, %while.cond1.preheader ] %div3743 = phi i64 [ %div36, %if.end10 ], [ %a.promoted, %while.cond1.preheader ] %div93942 = phi i64 [ %div938, %if.end10 ], [ %b.promoted, %while.cond1.preheader ] %rem = srem i64 %div3743, %i.044 %div = sdiv i64 %div3743, %i.044 %cmp5 = icmp eq i64 %rem, 0 br i1 %cmp5, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %while.body4 %rem6 = srem i64 %div93942, %i.044 %div9 = sdiv i64 %div93942, %i.044 %cmp7 = icmp eq i64 %rem6, 0 br i1 %cmp7, label %if.then8, label %if.else if.then8: ; preds = %land.lhs.true %mul = mul nsw i64 %GCM.045, %i.044 store i64 %div, ptr %a, align 8, !tbaa !5 store i64 %div9, ptr %b, align 8, !tbaa !5 br label %if.end10 if.else: ; preds = %land.lhs.true, %while.body4 %inc = add nsw i64 %i.044, 1 br label %if.end10 if.end10: ; preds = %if.else, %if.then8 %div938 = phi i64 [ %div9, %if.then8 ], [ %div93942, %if.else ] %div36 = phi i64 [ %div, %if.then8 ], [ %div3743, %if.else ] %i.1 = phi i64 [ %i.044, %if.then8 ], [ %inc, %if.else ] %GCM.1 = phi i64 [ %mul, %if.then8 ], [ %GCM.045, %if.else ] %cmp2 = icmp sle i64 %i.1, %div36 %cmp3 = icmp sle i64 %i.1, %div938 %1 = select i1 %cmp2, i1 %cmp3, i1 false br i1 %1, label %while.body4, label %cleanup, !llvm.loop !9 cleanup: ; preds = %if.end10, %while.cond1.preheader %GCM.0.lcssa = phi i64 [ 1, %while.cond1.preheader ], [ %GCM.1, %if.end10 ] %.lcssa35 = phi i64 [ %a.promoted, %while.cond1.preheader ], [ %div36, %if.end10 ] %.lcssa = phi i64 [ %b.promoted, %while.cond1.preheader ], [ %div938, %if.end10 ] %mul12 = mul nsw i64 %.lcssa35, %GCM.0.lcssa %mul14 = mul nsw i64 %mul12, %.lcssa %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %GCM.0.lcssa, i64 noundef %mul14) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, -1 br i1 %cmp, label %while.end20, label %while.cond1.preheader while.end20: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { long long a, b, x, y, t, gcd, lcm; while(scanf("%lld%lld", &x, &y)!=EOF){ a = x; b = y; while (b != 0) { t = b; b = a % b; a = t; gcd = a; lcm = (x*y)/gcd; } printf("%lld %lld\n",gcd,lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121957/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not15 = icmp eq i32 %call14, -1 br i1 %cmp.not15, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %lcm.017 = phi i64 [ %lcm.1.lcssa, %while.end ], [ undef, %entry ] %gcd.016 = phi i64 [ %gcd.1.lcssa, %while.end ], [ undef, %entry ] %0 = load i64, ptr %x, align 8, !tbaa !5 %1 = load i64, ptr %y, align 8, !tbaa !5 %cmp2.not10 = icmp eq i64 %1, 0 br i1 %cmp2.not10, label %while.end, label %while.body3 while.body3: ; preds = %while.body, %while.body3 %a.012 = phi i64 [ %b.011, %while.body3 ], [ %0, %while.body ] %b.011 = phi i64 [ %rem, %while.body3 ], [ %1, %while.body ] %rem = srem i64 %a.012, %b.011 %cmp2.not = icmp eq i64 %rem, 0 br i1 %cmp2.not, label %while.cond1.while.end_crit_edge, label %while.body3, !llvm.loop !9 while.cond1.while.end_crit_edge: ; preds = %while.body3 %mul.le = mul nsw i64 %1, %0 %div.le = sdiv i64 %mul.le, %b.011 br label %while.end while.end: ; preds = %while.cond1.while.end_crit_edge, %while.body %gcd.1.lcssa = phi i64 [ %b.011, %while.cond1.while.end_crit_edge ], [ %gcd.016, %while.body ] %lcm.1.lcssa = phi i64 [ %div.le, %while.cond1.while.end_crit_edge ], [ %lcm.017, %while.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %gcd.1.lcssa, i64 noundef %lcm.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(){ int t; scanf("%d",&t); int n,res[t]; for(int i=0; i<t; i++){ scanf("%d",&n); int a[n],b[n],one=0,m_one=0; for(int j=0; j<n; j++) scanf("%d",&a[j]); for(int j=0; j<n; j++) scanf("%d",&b[j]); for(int j=0; j<n; j++){ if(a[j]>b[j]){ if(m_one==0){ res[i]=0; break; } } else if(a[j]<b[j]){ if(one==0){ res[i]=0; break; } } if(a[j]==1) one++; else if(a[j]==-1) m_one++; res[i]=1; } } for(int i=0; i<t; i++){ if(res[i]) printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1220/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1220/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %t, align 4, !tbaa !5 %cmp119 = icmp sgt i32 %3, 0 br i1 %cmp119, label %for.body, label %for.cond.cleanup73 for.cond71.preheader: ; preds = %cleanup %4 = icmp sgt i32 %16, 0 br i1 %4, label %for.body74, label %for.cond.cleanup73 for.body: ; preds = %entry, %cleanup %indvars.iv132 = phi i64 [ %indvars.iv.next133, %cleanup ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = zext i32 %5 to i64 %7 = call ptr @llvm.stacksave.p0() %vla3 = alloca i32, i64 %6, align 16 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %vla4 = alloca i32, i64 %9, align 16 %cmp6111 = icmp sgt i32 %8, 0 br i1 %cmp6111, label %for.body8, label %cleanup for.cond11.preheader: ; preds = %for.body8 %cmp12113 = icmp sgt i32 %10, 0 br i1 %cmp12113, label %for.body14, label %cleanup for.body8: ; preds = %for.body, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp6 = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp6, label %for.body8, label %for.cond11.preheader, !llvm.loop !9 for.cond22.preheader: ; preds = %for.body14 %cmp23115 = icmp sgt i32 %12, 0 br i1 %cmp23115, label %for.body25.lr.ph, label %cleanup for.body25.lr.ph: ; preds = %for.cond22.preheader %arrayidx62 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv132 %wide.trip.count = zext i32 %12 to i64 br label %for.body25 for.body14: ; preds = %for.cond11.preheader, %for.body14 %indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body14 ], [ 0, %for.cond11.preheader ] %arrayidx16 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv126 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16) %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp12 = icmp slt i64 %indvars.iv.next127, %13 br i1 %cmp12, label %for.body14, label %for.cond22.preheader, !llvm.loop !11 for.body25: ; preds = %for.body25.lr.ph, %if.end60 %indvars.iv129 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next130, %if.end60 ] %m_one.0117 = phi i32 [ 0, %for.body25.lr.ph ], [ %m_one.1, %if.end60 ] %one.0116 = phi i32 [ 0, %for.body25.lr.ph ], [ %one.1, %if.end60 ] %arrayidx27 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv129 %14 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %arrayidx29 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv129 %15 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %14, %15 br i1 %cmp30, label %if.then, label %if.else if.then: ; preds = %for.body25 %cmp31 = icmp eq i32 %m_one.0117, 0 br i1 %cmp31, label %cleanup.sink.split, label %if.end47 if.else: ; preds = %for.body25 %cmp39 = icmp slt i32 %14, %15 %cmp41 = icmp eq i32 %one.0116, 0 %or.cond = select i1 %cmp39, i1 %cmp41, i1 false br i1 %or.cond, label %cleanup.sink.split, label %if.end47 if.end47: ; preds = %if.else, %if.then switch i32 %14, label %if.end60 [ i32 1, label %if.then51 i32 -1, label %if.then57 ] if.then51: ; preds = %if.end47 %inc52 = add nsw i32 %one.0116, 1 br label %if.end60 if.then57: ; preds = %if.end47 %inc58 = add nsw i32 %m_one.0117, 1 br label %if.end60 if.end60: ; preds = %if.end47, %if.then57, %if.then51 %one.1 = phi i32 [ %inc52, %if.then51 ], [ %one.0116, %if.then57 ], [ %one.0116, %if.end47 ] %m_one.1 = phi i32 [ %m_one.0117, %if.then51 ], [ %inc58, %if.then57 ], [ %m_one.0117, %if.end47 ] store i32 1, ptr %arrayidx62, align 4, !tbaa !5 %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 %exitcond.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body25, !llvm.loop !12 cleanup.sink.split: ; preds = %if.else, %if.then store i32 0, ptr %arrayidx62, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %if.end60, %cleanup.sink.split, %for.body, %for.cond11.preheader, %for.cond22.preheader call void @llvm.stackrestore.p0(ptr %7) %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1 %16 = load i32, ptr %t, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp = icmp slt i64 %indvars.iv.next133, %17 br i1 %cmp, label %for.body, label %for.cond71.preheader, !llvm.loop !13 for.cond.cleanup73: ; preds = %for.body74, %entry, %for.cond71.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 for.body74: ; preds = %for.cond71.preheader, %for.body74 %indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.body74 ], [ 0, %for.cond71.preheader ] %arrayidx76 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv135 %18 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %tobool.not = icmp eq i32 %18, 0 %str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3 %puts110 = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %19 = load i32, ptr %t, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp72 = icmp slt i64 %indvars.iv.next136, %20 br i1 %cmp72, label %for.body74, label %for.cond.cleanup73, !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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #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: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #define BIGNUM 1000000 int GCD (int a, int b){ int amari; int l, s; if (a < b){ s = a; l = b; } else { s = b; l = a; } amari = l % s; if (amari != 0) GCD(s, amari); else return s; } int main (void){ int a, b; int LCM; while (scanf ("%d %d", &a, &b) != EOF){ int ProcessingFlag = 0; if (a >= BIGNUM) { a = a / BIGNUM; ProcessingFlag = 1; } if (b >= BIGNUM) { b = b / BIGNUM; ProcessingFlag = 1; } LCM = (a * b) / GCD(a, b); if (ProcessingFlag == 1) { printf("%d %d\n", GCD(a, b) * BIGNUM, LCM * BIGNUM); } else { printf("%d %d\n", GCD(a, b), LCM); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122042/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122042/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @GCD(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %b.a15 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %a.b16 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %rem17 = srem i32 %b.a15, %a.b16 %cmp1.not18.not = icmp eq i32 %rem17, 0 br i1 %cmp1.not18.not, label %cleanup, label %if.then2 if.then2: ; preds = %entry, %if.then2 %rem22 = phi i32 [ %rem, %if.then2 ], [ %rem17, %entry ] %a.b21 = phi i32 [ %a.b, %if.then2 ], [ %a.b16, %entry ] %b.a = tail call i32 @llvm.smax.i32(i32 %a.b21, i32 %rem22) %a.b = tail call i32 @llvm.smin.i32(i32 %a.b21, i32 %rem22) %rem = srem i32 %b.a, %a.b %cmp1.not = icmp eq i32 %rem, 0 br i1 %cmp1.not, label %cleanup, label %if.then2 cleanup: ; preds = %if.then2, %entry ret i32 %a.b16 } ; 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not52 = icmp eq i32 %call51, -1 br i1 %cmp.not52, label %while.end, label %while.body while.body: ; preds = %entry, %if.end16 %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %0, 999999 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %while.body %div = udiv i32 %0, 1000000 store i32 %div, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %1 = phi i32 [ %div, %if.then ], [ %0, %while.body ] %ProcessingFlag.0 = phi i32 [ 1, %if.then ], [ 0, %while.body ] %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp2 = icmp sgt i32 %2, 999999 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %div4 = udiv i32 %2, 1000000 store i32 %div4, ptr %b, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then3, %if.end %3 = phi i32 [ %div4, %if.then3 ], [ %2, %if.end ] %ProcessingFlag.1 = phi i32 [ 1, %if.then3 ], [ %ProcessingFlag.0, %if.end ] %mul = mul nsw i32 %3, %1 %b.a15.i = call i32 @llvm.smax.i32(i32 %1, i32 %3) %a.b16.i = call i32 @llvm.smin.i32(i32 %1, i32 %3) %rem17.i = srem i32 %b.a15.i, %a.b16.i %cmp1.not18.not.i = icmp eq i32 %rem17.i, 0 br i1 %cmp1.not18.not.i, label %GCD.exit.thread, label %if.then2.i if.then2.i: ; preds = %if.end5, %if.then2.i %rem22.i = phi i32 [ %rem.i, %if.then2.i ], [ %rem17.i, %if.end5 ] %a.b21.i = phi i32 [ %a.b.i, %if.then2.i ], [ %a.b16.i, %if.end5 ] %b.a.i = call i32 @llvm.smax.i32(i32 %a.b21.i, i32 %rem22.i) %a.b.i = call i32 @llvm.smin.i32(i32 %a.b21.i, i32 %rem22.i) %rem.i = srem i32 %b.a.i, %a.b.i %cmp1.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not.i, label %GCD.exit, label %if.then2.i GCD.exit: ; preds = %if.then2.i %div7 = sdiv i32 %mul, %a.b16.i %cmp8 = icmp eq i32 %ProcessingFlag.1, 1 br i1 %cmp8, label %if.then2.i23, label %if.then2.i35 GCD.exit.thread: ; preds = %if.end5 %div743 = sdiv i32 %mul, %a.b16.i %cmp844 = icmp eq i32 %ProcessingFlag.1, 1 br i1 %cmp844, label %GCD.exit30, label %GCD.exit42 if.then2.i23: ; preds = %GCD.exit, %if.then2.i23 %rem22.i24 = phi i32 [ %rem.i28, %if.then2.i23 ], [ %rem17.i, %GCD.exit ] %a.b21.i25 = phi i32 [ %a.b.i27, %if.then2.i23 ], [ %a.b16.i, %GCD.exit ] %b.a.i26 = call i32 @llvm.smax.i32(i32 %a.b21.i25, i32 %rem22.i24) %a.b.i27 = call i32 @llvm.smin.i32(i32 %a.b21.i25, i32 %rem22.i24) %rem.i28 = srem i32 %b.a.i26, %a.b.i27 %cmp1.not.i29 = icmp eq i32 %rem.i28, 0 br i1 %cmp1.not.i29, label %GCD.exit30, label %if.then2.i23 GCD.exit30: ; preds = %if.then2.i23, %GCD.exit.thread %div74648 = phi i32 [ %div743, %GCD.exit.thread ], [ %div7, %if.then2.i23 ] %mul11 = mul nsw i32 %a.b16.i, 1000000 %mul12 = mul nsw i32 %div74648, 1000000 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul11, i32 noundef %mul12) br label %if.end16 if.then2.i35: ; preds = %GCD.exit, %if.then2.i35 %rem22.i36 = phi i32 [ %rem.i40, %if.then2.i35 ], [ %rem17.i, %GCD.exit ] %a.b21.i37 = phi i32 [ %a.b.i39, %if.then2.i35 ], [ %a.b16.i, %GCD.exit ] %b.a.i38 = call i32 @llvm.smax.i32(i32 %a.b21.i37, i32 %rem22.i36) %a.b.i39 = call i32 @llvm.smin.i32(i32 %a.b21.i37, i32 %rem22.i36) %rem.i40 = srem i32 %b.a.i38, %a.b.i39 %cmp1.not.i41 = icmp eq i32 %rem.i40, 0 br i1 %cmp1.not.i41, label %GCD.exit42, label %if.then2.i35 GCD.exit42: ; preds = %if.then2.i35, %GCD.exit.thread %div74550 = phi i32 [ %div743, %GCD.exit.thread ], [ %div7, %if.then2.i35 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.b16.i, i32 noundef %div74550) br label %if.end16 if.end16: ; preds = %GCD.exit42, %GCD.exit30 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end16, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a, b; int r; int x, y; int tmp; while (scanf("%d %d", &a, &b) != EOF){ x = a; y = b; if (a < b){ tmp = a; a = b; b = tmp; } r = a % b; while (r != 0){ a = b; b = r; r = a % b; } printf("%d %d\n", b, x / b * y); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122086/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122086/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not15 = icmp eq i32 %call14, -1 br i1 %cmp.not15, label %while.end7, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp slt i32 %0, %1 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %while.body store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i32 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i32 [ %1, %if.then ], [ %0, %while.body ] %rem = srem i32 %3, %2 %cmp3.not11 = icmp eq i32 %rem, 0 br i1 %cmp3.not11, label %while.end, label %while.body4 while.body4: ; preds = %if.end, %while.body4 %r.013 = phi i32 [ %rem5, %while.body4 ], [ %rem, %if.end ] %r.01012 = phi i32 [ %r.013, %while.body4 ], [ %2, %if.end ] %rem5 = srem i32 %r.01012, %r.013 %cmp3.not = icmp eq i32 %rem5, 0 br i1 %cmp3.not, label %while.cond2.while.end_crit_edge, label %while.body4, !llvm.loop !9 while.cond2.while.end_crit_edge: ; preds = %while.body4 store i32 %r.01012, ptr %a, align 4, !tbaa !5 store i32 %r.013, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end %4 = phi i32 [ %r.013, %while.cond2.while.end_crit_edge ], [ %2, %if.end ] %div = sdiv i32 %0, %4 %mul = mul nsw i32 %div, %1 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %mul) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end7, label %while.body, !llvm.loop !11 while.end7: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int Max(int, int); int main(void){ int a, b, c, d; while(scanf("%d %d", &a, &b) != EOF){ c = Max(a,b); d = a / c * b; printf("%d %d\n", c, d); } return 0; } int Max(int a,int b){ int rem; if(a == 0 || b == 0) return 0; while((rem = a % b) != 0){ a = b; b = rem; } return b; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122129/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122129/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not5 = icmp eq i32 %call4, -1 br i1 %cmp.not5, label %while.end, label %while.body while.body: ; preds = %entry, %Max.exit %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.i = icmp eq i32 %0, 0 %cmp1.i = icmp eq i32 %1, 0 %or.cond.i = or i1 %cmp.i, %cmp1.i br i1 %or.cond.i, label %Max.exit, label %while.cond.i while.cond.i: ; preds = %while.body, %while.cond.i %a.addr.0.i = phi i32 [ %b.addr.0.i, %while.cond.i ], [ %0, %while.body ] %b.addr.0.i = phi i32 [ %rem2.i, %while.cond.i ], [ %1, %while.body ] %rem2.i = srem i32 %a.addr.0.i, %b.addr.0.i %cmp3.not.i = icmp eq i32 %rem2.i, 0 br i1 %cmp3.not.i, label %Max.exit, label %while.cond.i, !llvm.loop !9 Max.exit: ; preds = %while.cond.i, %while.body %retval.0.i = phi i32 [ 0, %while.body ], [ %b.addr.0.i, %while.cond.i ] %div = sdiv i32 %0, %retval.0.i %mul = mul nsw i32 %div, %1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i, i32 noundef %mul) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %Max.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @Max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %cmp = icmp eq i32 %a, 0 %cmp1 = icmp eq i32 %b, 0 %or.cond = or i1 %cmp, %cmp1 br i1 %or.cond, label %cleanup, label %while.cond while.cond: ; preds = %entry, %while.cond %a.addr.0 = phi i32 [ %b.addr.0, %while.cond ], [ %a, %entry ] %b.addr.0 = phi i32 [ %rem2, %while.cond ], [ %b, %entry ] %rem2 = srem i32 %a.addr.0, %b.addr.0 %cmp3.not = icmp eq i32 %rem2, 0 br i1 %cmp3.not, label %cleanup, label %while.cond, !llvm.loop !9 cleanup: ; preds = %while.cond, %entry %retval.0 = phi i32 [ 0, %entry ], [ %b.addr.0, %while.cond ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <limits.h> int main(void) { int n,i,w; long long ans=0; int max_1=INT_MIN,max_2=INT_MIN; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d",&w); ans+=w; } for (i=0;i<n;i++) { scanf("%d",&w); if (w>max_1) {max_2=max_1;max_1=w;} else if (w>max_2) {max_2=w;} } if ((max_1+max_2)>=ans) {printf("YES");} else {printf("NO");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12218/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12218/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %if.end24 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %3, 0 br i1 %1, label %for.body5, label %for.end15 for.body: ; preds = %entry, %for.body %ans.034 = phi i64 [ %add, %for.body ], [ 0, %entry ] %i.033 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %2 = load i32, ptr %w, align 4, !tbaa !5 %conv = sext i32 %2 to i64 %add = add nsw i64 %ans.034, %conv %inc = add nuw nsw i32 %i.033, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond2.preheader, %for.body5 %max_2.038 = phi i32 [ %max_2.1, %for.body5 ], [ -2147483648, %for.cond2.preheader ] %max_1.037 = phi i32 [ %max_1.1, %for.body5 ], [ -2147483648, %for.cond2.preheader ] %i.136 = phi i32 [ %inc14, %for.body5 ], [ 0, %for.cond2.preheader ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %4, %max_1.037 %spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %max_2.038) %max_1.1 = call i32 @llvm.smax.i32(i32 %4, i32 %max_1.037) %max_2.1 = select i1 %cmp7, i32 %max_1.037, i32 %spec.select %inc14 = add nuw nsw i32 %i.136, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc14, %5 br i1 %cmp3, label %for.body5, label %for.end15.loopexit, !llvm.loop !11 for.end15.loopexit: ; preds = %for.body5 %6 = add nsw i32 %max_2.1, %max_1.1 %7 = sext i32 %6 to i64 br label %for.end15 for.end15: ; preds = %for.end15.loopexit, %for.cond2.preheader %add16 = phi i64 [ 0, %for.cond2.preheader ], [ %7, %for.end15.loopexit ] %cmp18.not = icmp sgt i64 %add, %add16 %spec.select47 = select i1 %cmp18.not, ptr @.str.2, ptr @.str.1 br label %if.end24 if.end24: ; preds = %for.end15, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select47, %for.end15 ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int a,b; int gcd,lcm; while(scanf("%d %d",&a,&b) != EOF) { int tmp[2] = {a,b}; while(1) { tmp[0] %= tmp[1]; if(tmp[0] == 0) { gcd = tmp[1]; break; } else { tmp[1] %= tmp[0]; if(tmp[1] == 0) { gcd = tmp[0]; break; } } } lcm = a / gcd * b; printf("%d %d\n",gcd,lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122222/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122222/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not25 = icmp eq i32 %call24, -1 br i1 %cmp.not25, label %while.end16, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 br label %while.cond1 while.cond1: ; preds = %if.else, %while.body %tmp.sroa.8.0 = phi i32 [ %1, %while.body ], [ %rem9, %if.else ] %tmp.sroa.0.0 = phi i32 [ %0, %while.body ], [ %rem, %if.else ] %rem = srem i32 %tmp.sroa.0.0, %tmp.sroa.8.0 %cmp5 = icmp eq i32 %rem, 0 br i1 %cmp5, label %while.end, label %if.else if.else: ; preds = %while.cond1 %rem9 = srem i32 %tmp.sroa.8.0, %rem %cmp11 = icmp eq i32 %rem9, 0 br i1 %cmp11, label %while.end, label %while.cond1 while.end: ; preds = %if.else, %while.cond1 %gcd.0 = phi i32 [ %tmp.sroa.8.0, %while.cond1 ], [ %rem, %if.else ] %div = sdiv i32 %0, %gcd.0 %mul = mul nsw i32 %div, %1 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %gcd.0, i32 noundef %mul) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end16, label %while.body, !llvm.loop !9 while.end16: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int gcd(int a, int b) { int r; while((r = a % b)!=0) a = b, b = r; return b; } int lcm(int a, int b, int t) { int u; a = a / t; b = b / t; u = a * b * t; return u; } int main(void) { int a, b, t; while(0<1){ if(scanf("%d", &a) == -1) break; scanf("%d", &b); if(a<b){ t = a; a = b; b = t; } t = gcd(a, b); printf("%d %d\n", t, lcm(a, b, t)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122266/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122266/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %b.addr.0 = phi i32 [ %b, %entry ], [ %rem, %while.cond ] %a.addr.0 = phi i32 [ %a, %entry ], [ %b.addr.0, %while.cond ] %rem = srem i32 %a.addr.0, %b.addr.0 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond ret i32 %b.addr.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b, i32 noundef %t) local_unnamed_addr #2 { entry: %div1 = sdiv i32 %b, %t %0 = srem i32 %a, %t %mul = sub nsw i32 %a, %0 %mul2 = mul i32 %mul, %div1 ret i32 %mul2 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp12 = icmp eq i32 %call11, -1 br i1 %cmp12, label %while.end, label %if.end if.end: ; preds = %entry, %gcd.exit %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !7 %1 = load i32, ptr %b, align 4, !tbaa !7 %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.end4 if.then3: ; preds = %if.end store i32 %1, ptr %a, align 4, !tbaa !7 store i32 %0, ptr %b, align 4, !tbaa !7 br label %if.end4 if.end4: ; preds = %if.then3, %if.end %2 = phi i32 [ %0, %if.then3 ], [ %1, %if.end ] %3 = phi i32 [ %1, %if.then3 ], [ %0, %if.end ] br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %if.end4 %b.addr.0.i = phi i32 [ %2, %if.end4 ], [ %rem.i, %while.cond.i ] %a.addr.0.i = phi i32 [ %3, %if.end4 ], [ %b.addr.0.i, %while.cond.i ] %rem.i = srem i32 %a.addr.0.i, %b.addr.0.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.cond.i, !llvm.loop !5 gcd.exit: ; preds = %while.cond.i %div1.i = sdiv i32 %2, %b.addr.0.i %4 = srem i32 %3, %b.addr.0.i %mul.i = sub nsw i32 %3, %4 %mul2.i = mul i32 %mul.i, %div1.i %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b.addr.0.i, i32 noundef %mul2.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp = icmp eq i32 %call, -1 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %gcd.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,t,i,j; while(scanf("%d %d",&a,&b) != EOF) { if(a < b){ t = a; a = b; b = t; } i = a; j = b; while(a != 0 && b != 0) { a = a % b; if(a == 0){ printf("%d %d\n",b,i/b*j); break ; } b = b % a; if(b == 0){ printf("%d %d\n",a,i/a*j); break ; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122316/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122316/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not29 = icmp eq i32 %call28, -1 br i1 %cmp.not29, label %while.end17, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %0, %1 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %while.body store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i32 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i32 [ %1, %if.then ], [ %0, %while.body ] br label %while.cond2 while.cond2: ; preds = %if.end9, %if.end %rem1027 = phi i32 [ %rem10, %if.end9 ], [ %2, %if.end ] %rem26 = phi i32 [ %rem, %if.end9 ], [ %3, %if.end ] %cmp3 = icmp ne i32 %rem26, 0 %cmp4 = icmp ne i32 %rem1027, 0 %4 = and i1 %cmp3, %cmp4 br i1 %4, label %while.body5, label %while.end while.body5: ; preds = %while.cond2 %rem = srem i32 %rem26, %rem1027 store i32 %rem, ptr %a, align 4, !tbaa !5 %cmp6 = icmp eq i32 %rem, 0 br i1 %cmp6, label %while.end.sink.split, label %if.end9 if.end9: ; preds = %while.body5 %rem10 = srem i32 %rem1027, %rem store i32 %rem10, ptr %b, align 4, !tbaa !5 %cmp11 = icmp eq i32 %rem10, 0 br i1 %cmp11, label %while.end.sink.split, label %while.cond2, !llvm.loop !9 while.end.sink.split: ; preds = %if.end9, %while.body5 %rem.lcssa35.sink36 = phi i32 [ %rem1027, %while.body5 ], [ %rem, %if.end9 ] %div13 = sdiv i32 %3, %rem.lcssa35.sink36 %mul14 = mul nsw i32 %div13, %2 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.lcssa35.sink36, i32 noundef %mul14) br label %while.end while.end: ; preds = %while.cond2, %while.end.sink.split %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end17, label %while.body, !llvm.loop !11 while.end17: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int DIR[4][2]={{0,1},{1,0},{0,-1},{-1,0}}; int R,C; char map[50][51]; int taken[50][50]; int MLX(int r, int c, int last) { int i,nr,nc; taken[r][c]=1; //printf("%d %d\n", r+1,c+1); for(i=0;i<4;i++) if(last==-1 || ((i-last+4)%4 != 2)) { nr=r+DIR[i][0]; nc=c+DIR[i][1]; //printf(" %d %d\n", nr+1,nc+1); if(nr>=0 && nr<R && nc>=0 && nc<C && map[nr][nc]==map[r][c]) { if(taken[nr][nc]) return 1; else if(MLX(nr,nc,i)) return 1; } } return 0; } int main() { int i,j; scanf("%d %d", &R,&C); for(i=0;i<R;i++) { scanf("%s", map[i]); } for(i=0;i<R;i++) for(j=0;j<C;j++) taken[i][j]=0; for(i=0;i<R;i++) for(j=0;j<C;j++) if(!taken[i][j] && MLX(i,j,-1)) { printf("Yes\n"); return 0; } printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12236/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12236/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @DIR = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 -1], [2 x i32] [i32 -1, i32 0]], align 16 @taken = dso_local local_unnamed_addr global [50 x [50 x i32]] zeroinitializer, align 16 @R = dso_local global i32 0, align 4 @C = dso_local global i32 0, align 4 @map = dso_local global [50 x [51 x i8]] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @MLX(i32 noundef %r, i32 noundef %c, i32 noundef %last) local_unnamed_addr #0 { entry: %idxprom = sext i32 %r to i64 %idxprom1 = sext i32 %c to i64 %arrayidx2 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom, i64 %idxprom1 store i32 1, ptr %arrayidx2, align 4, !tbaa !5 %cmp3 = icmp eq i32 %last, -1 %arrayidx27 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom, i64 %idxprom1 br i1 %cmp3, label %for.body.us.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %add = sub i32 4, %last %0 = and i32 %add, -2147483645 %cmp4.not = icmp eq i32 %0, 2 br i1 %cmp4.not, label %for.inc, label %if.then for.body.us.preheader: ; preds = %entry %1 = load i32, ptr @DIR, align 16, !tbaa !5 %add8.us = add nsw i32 %1, %r %2 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 0, i64 1), align 4, !tbaa !5 %add12.us = add nsw i32 %2, %c %cmp13.us = icmp sgt i32 %add8.us, -1 br i1 %cmp13.us, label %land.lhs.true.us, label %for.inc.us land.lhs.true.us: ; preds = %for.body.us.preheader %3 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.us = icmp slt i32 %add8.us, %3 %cmp16.us = icmp sgt i32 %add12.us, -1 %or.cond.us = select i1 %cmp14.us, i1 %cmp16.us, i1 false %4 = load i32, ptr @C, align 4 %cmp18.us = icmp slt i32 %add12.us, %4 %or.cond62.us = select i1 %or.cond.us, i1 %cmp18.us, i1 false br i1 %or.cond62.us, label %land.lhs.true19.us, label %for.inc.us land.lhs.true19.us: ; preds = %land.lhs.true.us %idxprom20.us = zext i32 %add8.us to i64 %idxprom22.us = zext i32 %add12.us to i64 %arrayidx23.us = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.us, i64 %idxprom22.us %5 = load i8, ptr %arrayidx23.us, align 1, !tbaa !9 %6 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.us = icmp eq i8 %5, %6 br i1 %cmp29.us, label %if.then31.us, label %for.inc.us if.then31.us: ; preds = %land.lhs.true19.us %arrayidx35.us = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.us, i64 %idxprom22.us %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %tobool.not.us = icmp eq i32 %7, 0 br i1 %tobool.not.us, label %if.else.us, label %cleanup if.else.us: ; preds = %if.then31.us %call.us = tail call i32 @MLX(i32 noundef %add8.us, i32 noundef %add12.us, i32 noundef 0), !range !10 %tobool37.not.us = icmp eq i32 %call.us, 0 br i1 %tobool37.not.us, label %for.inc.us, label %cleanup for.inc.us: ; preds = %if.else.us, %land.lhs.true19.us, %land.lhs.true.us, %for.body.us.preheader %8 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 1), align 8, !tbaa !5 %add8.us.1 = add nsw i32 %8, %r %9 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 1, i64 1), align 4, !tbaa !5 %add12.us.1 = add nsw i32 %9, %c %cmp13.us.1 = icmp sgt i32 %add8.us.1, -1 br i1 %cmp13.us.1, label %land.lhs.true.us.1, label %for.inc.us.1 land.lhs.true.us.1: ; preds = %for.inc.us %10 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.us.1 = icmp slt i32 %add8.us.1, %10 %cmp16.us.1 = icmp sgt i32 %add12.us.1, -1 %or.cond.us.1 = select i1 %cmp14.us.1, i1 %cmp16.us.1, i1 false %11 = load i32, ptr @C, align 4 %cmp18.us.1 = icmp slt i32 %add12.us.1, %11 %or.cond62.us.1 = select i1 %or.cond.us.1, i1 %cmp18.us.1, i1 false br i1 %or.cond62.us.1, label %land.lhs.true19.us.1, label %for.inc.us.1 land.lhs.true19.us.1: ; preds = %land.lhs.true.us.1 %idxprom20.us.1 = zext i32 %add8.us.1 to i64 %idxprom22.us.1 = zext i32 %add12.us.1 to i64 %arrayidx23.us.1 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.us.1, i64 %idxprom22.us.1 %12 = load i8, ptr %arrayidx23.us.1, align 1, !tbaa !9 %13 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.us.1 = icmp eq i8 %12, %13 br i1 %cmp29.us.1, label %if.then31.us.1, label %for.inc.us.1 if.then31.us.1: ; preds = %land.lhs.true19.us.1 %arrayidx35.us.1 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.us.1, i64 %idxprom22.us.1 %14 = load i32, ptr %arrayidx35.us.1, align 4, !tbaa !5 %tobool.not.us.1 = icmp eq i32 %14, 0 br i1 %tobool.not.us.1, label %if.else.us.1, label %cleanup if.else.us.1: ; preds = %if.then31.us.1 %call.us.1 = tail call i32 @MLX(i32 noundef %add8.us.1, i32 noundef %add12.us.1, i32 noundef 1), !range !10 %tobool37.not.us.1 = icmp eq i32 %call.us.1, 0 br i1 %tobool37.not.us.1, label %for.inc.us.1, label %cleanup for.inc.us.1: ; preds = %if.else.us.1, %land.lhs.true19.us.1, %land.lhs.true.us.1, %for.inc.us %15 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 2), align 16, !tbaa !5 %add8.us.2 = add nsw i32 %15, %r %16 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 2, i64 1), align 4, !tbaa !5 %add12.us.2 = add nsw i32 %16, %c %cmp13.us.2 = icmp sgt i32 %add8.us.2, -1 br i1 %cmp13.us.2, label %land.lhs.true.us.2, label %for.inc.us.2 land.lhs.true.us.2: ; preds = %for.inc.us.1 %17 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.us.2 = icmp slt i32 %add8.us.2, %17 %cmp16.us.2 = icmp sgt i32 %add12.us.2, -1 %or.cond.us.2 = select i1 %cmp14.us.2, i1 %cmp16.us.2, i1 false %18 = load i32, ptr @C, align 4 %cmp18.us.2 = icmp slt i32 %add12.us.2, %18 %or.cond62.us.2 = select i1 %or.cond.us.2, i1 %cmp18.us.2, i1 false br i1 %or.cond62.us.2, label %land.lhs.true19.us.2, label %for.inc.us.2 land.lhs.true19.us.2: ; preds = %land.lhs.true.us.2 %idxprom20.us.2 = zext i32 %add8.us.2 to i64 %idxprom22.us.2 = zext i32 %add12.us.2 to i64 %arrayidx23.us.2 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.us.2, i64 %idxprom22.us.2 %19 = load i8, ptr %arrayidx23.us.2, align 1, !tbaa !9 %20 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.us.2 = icmp eq i8 %19, %20 br i1 %cmp29.us.2, label %if.then31.us.2, label %for.inc.us.2 if.then31.us.2: ; preds = %land.lhs.true19.us.2 %arrayidx35.us.2 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.us.2, i64 %idxprom22.us.2 %21 = load i32, ptr %arrayidx35.us.2, align 4, !tbaa !5 %tobool.not.us.2 = icmp eq i32 %21, 0 br i1 %tobool.not.us.2, label %if.else.us.2, label %cleanup if.else.us.2: ; preds = %if.then31.us.2 %call.us.2 = tail call i32 @MLX(i32 noundef %add8.us.2, i32 noundef %add12.us.2, i32 noundef 2), !range !10 %tobool37.not.us.2 = icmp eq i32 %call.us.2, 0 br i1 %tobool37.not.us.2, label %for.inc.us.2, label %cleanup for.inc.us.2: ; preds = %if.else.us.2, %land.lhs.true19.us.2, %land.lhs.true.us.2, %for.inc.us.1 %22 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 3), align 8, !tbaa !5 %add8.us.3 = add nsw i32 %22, %r %23 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 3, i64 1), align 4, !tbaa !5 %add12.us.3 = add nsw i32 %23, %c %cmp13.us.3 = icmp sgt i32 %add8.us.3, -1 br i1 %cmp13.us.3, label %land.lhs.true.us.3, label %for.inc.us.3 land.lhs.true.us.3: ; preds = %for.inc.us.2 %24 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.us.3 = icmp slt i32 %add8.us.3, %24 %cmp16.us.3 = icmp sgt i32 %add12.us.3, -1 %or.cond.us.3 = select i1 %cmp14.us.3, i1 %cmp16.us.3, i1 false %25 = load i32, ptr @C, align 4 %cmp18.us.3 = icmp slt i32 %add12.us.3, %25 %or.cond62.us.3 = select i1 %or.cond.us.3, i1 %cmp18.us.3, i1 false br i1 %or.cond62.us.3, label %land.lhs.true19.us.3, label %for.inc.us.3 land.lhs.true19.us.3: ; preds = %land.lhs.true.us.3 %idxprom20.us.3 = zext i32 %add8.us.3 to i64 %idxprom22.us.3 = zext i32 %add12.us.3 to i64 %arrayidx23.us.3 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.us.3, i64 %idxprom22.us.3 %26 = load i8, ptr %arrayidx23.us.3, align 1, !tbaa !9 %27 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.us.3 = icmp eq i8 %26, %27 br i1 %cmp29.us.3, label %if.then31.us.3, label %for.inc.us.3 if.then31.us.3: ; preds = %land.lhs.true19.us.3 %arrayidx35.us.3 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.us.3, i64 %idxprom22.us.3 %28 = load i32, ptr %arrayidx35.us.3, align 4, !tbaa !5 %tobool.not.us.3 = icmp eq i32 %28, 0 br i1 %tobool.not.us.3, label %if.else.us.3, label %cleanup if.else.us.3: ; preds = %if.then31.us.3 %call.us.3 = tail call i32 @MLX(i32 noundef %add8.us.3, i32 noundef %add12.us.3, i32 noundef 3), !range !10 %tobool37.not.us.3 = icmp eq i32 %call.us.3, 0 br i1 %tobool37.not.us.3, label %for.inc.us.3, label %cleanup for.inc.us.3: ; preds = %if.else.us.3, %land.lhs.true19.us.3, %land.lhs.true.us.3, %for.inc.us.2 br label %cleanup if.then: ; preds = %for.body.preheader %29 = load i32, ptr @DIR, align 16, !tbaa !5 %add8 = add nsw i32 %29, %r %30 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 0, i64 1), align 4, !tbaa !5 %add12 = add nsw i32 %30, %c %cmp13 = icmp sgt i32 %add8, -1 br i1 %cmp13, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %if.then %31 = load i32, ptr @R, align 4, !tbaa !5 %cmp14 = icmp slt i32 %add8, %31 %cmp16 = icmp sgt i32 %add12, -1 %or.cond = select i1 %cmp14, i1 %cmp16, i1 false %32 = load i32, ptr @C, align 4 %cmp18 = icmp slt i32 %add12, %32 %or.cond62 = select i1 %or.cond, i1 %cmp18, i1 false br i1 %or.cond62, label %land.lhs.true19, label %for.inc land.lhs.true19: ; preds = %land.lhs.true %idxprom20 = zext i32 %add8 to i64 %idxprom22 = zext i32 %add12 to i64 %arrayidx23 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20, i64 %idxprom22 %33 = load i8, ptr %arrayidx23, align 1, !tbaa !9 %34 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29 = icmp eq i8 %33, %34 br i1 %cmp29, label %if.then31, label %for.inc if.then31: ; preds = %land.lhs.true19 %arrayidx35 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20, i64 %idxprom22 %35 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %tobool.not = icmp eq i32 %35, 0 br i1 %tobool.not, label %if.else, label %cleanup if.else: ; preds = %if.then31 %call = tail call i32 @MLX(i32 noundef %add8, i32 noundef %add12, i32 noundef 0), !range !10 %tobool37.not = icmp eq i32 %call, 0 br i1 %tobool37.not, label %for.inc, label %cleanup for.inc: ; preds = %for.body.preheader, %if.else, %land.lhs.true19, %land.lhs.true, %if.then %add.1 = sub i32 5, %last %36 = and i32 %add.1, -2147483645 %cmp4.not.1 = icmp eq i32 %36, 2 br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %37 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 1), align 8, !tbaa !5 %add8.1 = add nsw i32 %37, %r %38 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 1, i64 1), align 4, !tbaa !5 %add12.1 = add nsw i32 %38, %c %cmp13.1 = icmp sgt i32 %add8.1, -1 br i1 %cmp13.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %if.then.1 %39 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.1 = icmp slt i32 %add8.1, %39 %cmp16.1 = icmp sgt i32 %add12.1, -1 %or.cond.1 = select i1 %cmp14.1, i1 %cmp16.1, i1 false %40 = load i32, ptr @C, align 4 %cmp18.1 = icmp slt i32 %add12.1, %40 %or.cond62.1 = select i1 %or.cond.1, i1 %cmp18.1, i1 false br i1 %or.cond62.1, label %land.lhs.true19.1, label %for.inc.1 land.lhs.true19.1: ; preds = %land.lhs.true.1 %idxprom20.1 = zext i32 %add8.1 to i64 %idxprom22.1 = zext i32 %add12.1 to i64 %arrayidx23.1 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.1, i64 %idxprom22.1 %41 = load i8, ptr %arrayidx23.1, align 1, !tbaa !9 %42 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.1 = icmp eq i8 %41, %42 br i1 %cmp29.1, label %if.then31.1, label %for.inc.1 if.then31.1: ; preds = %land.lhs.true19.1 %arrayidx35.1 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.1, i64 %idxprom22.1 %43 = load i32, ptr %arrayidx35.1, align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %43, 0 br i1 %tobool.not.1, label %if.else.1, label %cleanup if.else.1: ; preds = %if.then31.1 %call.1 = tail call i32 @MLX(i32 noundef %add8.1, i32 noundef %add12.1, i32 noundef 1), !range !10 %tobool37.not.1 = icmp eq i32 %call.1, 0 br i1 %tobool37.not.1, label %for.inc.1, label %cleanup for.inc.1: ; preds = %if.else.1, %land.lhs.true19.1, %land.lhs.true.1, %if.then.1, %for.inc %add.2 = sub i32 6, %last %44 = and i32 %add.2, -2147483645 %cmp4.not.2 = icmp eq i32 %44, 2 br i1 %cmp4.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %45 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 2), align 16, !tbaa !5 %add8.2 = add nsw i32 %45, %r %46 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 2, i64 1), align 4, !tbaa !5 %add12.2 = add nsw i32 %46, %c %cmp13.2 = icmp sgt i32 %add8.2, -1 br i1 %cmp13.2, label %land.lhs.true.2, label %for.inc.2 land.lhs.true.2: ; preds = %if.then.2 %47 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.2 = icmp slt i32 %add8.2, %47 %cmp16.2 = icmp sgt i32 %add12.2, -1 %or.cond.2 = select i1 %cmp14.2, i1 %cmp16.2, i1 false %48 = load i32, ptr @C, align 4 %cmp18.2 = icmp slt i32 %add12.2, %48 %or.cond62.2 = select i1 %or.cond.2, i1 %cmp18.2, i1 false br i1 %or.cond62.2, label %land.lhs.true19.2, label %for.inc.2 land.lhs.true19.2: ; preds = %land.lhs.true.2 %idxprom20.2 = zext i32 %add8.2 to i64 %idxprom22.2 = zext i32 %add12.2 to i64 %arrayidx23.2 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.2, i64 %idxprom22.2 %49 = load i8, ptr %arrayidx23.2, align 1, !tbaa !9 %50 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.2 = icmp eq i8 %49, %50 br i1 %cmp29.2, label %if.then31.2, label %for.inc.2 if.then31.2: ; preds = %land.lhs.true19.2 %arrayidx35.2 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.2, i64 %idxprom22.2 %51 = load i32, ptr %arrayidx35.2, align 4, !tbaa !5 %tobool.not.2 = icmp eq i32 %51, 0 br i1 %tobool.not.2, label %if.else.2, label %cleanup if.else.2: ; preds = %if.then31.2 %call.2 = tail call i32 @MLX(i32 noundef %add8.2, i32 noundef %add12.2, i32 noundef 2), !range !10 %tobool37.not.2 = icmp eq i32 %call.2, 0 br i1 %tobool37.not.2, label %for.inc.2, label %cleanup for.inc.2: ; preds = %if.else.2, %land.lhs.true19.2, %land.lhs.true.2, %if.then.2, %for.inc.1 %add.3 = sub i32 7, %last %52 = and i32 %add.3, -2147483645 %cmp4.not.3 = icmp eq i32 %52, 2 br i1 %cmp4.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %53 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 3), align 8, !tbaa !5 %add8.3 = add nsw i32 %53, %r %54 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @DIR, i64 0, i64 3, i64 1), align 4, !tbaa !5 %add12.3 = add nsw i32 %54, %c %cmp13.3 = icmp sgt i32 %add8.3, -1 br i1 %cmp13.3, label %land.lhs.true.3, label %for.inc.3 land.lhs.true.3: ; preds = %if.then.3 %55 = load i32, ptr @R, align 4, !tbaa !5 %cmp14.3 = icmp slt i32 %add8.3, %55 %cmp16.3 = icmp sgt i32 %add12.3, -1 %or.cond.3 = select i1 %cmp14.3, i1 %cmp16.3, i1 false %56 = load i32, ptr @C, align 4 %cmp18.3 = icmp slt i32 %add12.3, %56 %or.cond62.3 = select i1 %or.cond.3, i1 %cmp18.3, i1 false br i1 %or.cond62.3, label %land.lhs.true19.3, label %for.inc.3 land.lhs.true19.3: ; preds = %land.lhs.true.3 %idxprom20.3 = zext i32 %add8.3 to i64 %idxprom22.3 = zext i32 %add12.3 to i64 %arrayidx23.3 = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %idxprom20.3, i64 %idxprom22.3 %57 = load i8, ptr %arrayidx23.3, align 1, !tbaa !9 %58 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.3 = icmp eq i8 %57, %58 br i1 %cmp29.3, label %if.then31.3, label %for.inc.3 if.then31.3: ; preds = %land.lhs.true19.3 %arrayidx35.3 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %idxprom20.3, i64 %idxprom22.3 %59 = load i32, ptr %arrayidx35.3, align 4, !tbaa !5 %tobool.not.3 = icmp eq i32 %59, 0 br i1 %tobool.not.3, label %if.else.3, label %cleanup if.else.3: ; preds = %if.then31.3 %call.3 = tail call i32 @MLX(i32 noundef %add8.3, i32 noundef %add12.3, i32 noundef 3), !range !10 %tobool37.not.3 = icmp eq i32 %call.3, 0 br i1 %tobool37.not.3, label %for.inc.3, label %cleanup for.inc.3: ; preds = %if.else.3, %land.lhs.true19.3, %land.lhs.true.3, %if.then.3, %for.inc.2 br label %cleanup cleanup: ; preds = %if.then31, %if.else, %if.then31.1, %if.else.1, %if.then31.2, %if.else.2, %if.then31.3, %if.else.3, %for.inc.3, %if.then31.us, %if.else.us, %if.then31.us.1, %if.else.us.1, %if.then31.us.2, %if.else.us.2, %if.then31.us.3, %if.else.us.3, %for.inc.us.3 %.us-phi = phi i32 [ 1, %if.else.us ], [ 1, %if.then31.us ], [ 1, %if.then31.us.1 ], [ 1, %if.else.us.1 ], [ 1, %if.then31.us.2 ], [ 1, %if.else.us.2 ], [ 1, %if.then31.us.3 ], [ 1, %if.else.us.3 ], [ 0, %for.inc.us.3 ], [ 1, %if.else ], [ 1, %if.then31 ], [ 1, %if.then31.1 ], [ 1, %if.else.1 ], [ 1, %if.then31.2 ], [ 1, %if.else.2 ], [ 1, %if.then31.3 ], [ 1, %if.else.3 ], [ 0, %for.inc.3 ] ret i32 %.us-phi } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @R, ptr noundef nonnull @C) %0 = load i32, ptr @R, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %cleanup for.cond2.preheader: ; preds = %for.body %cmp359 = icmp sgt i32 %13, 0 br i1 %cmp359, label %for.cond5.preheader.lr.ph, label %cleanup for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %1 = load i32, ptr @C, align 4, !tbaa !5 %cmp657 = icmp sgt i32 %1, 0 br i1 %cmp657, label %for.cond5.preheader.us.preheader, label %cleanup for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph %2 = zext i32 %1 to i64 %3 = shl nuw nsw i64 %2, 2 %wide.trip.count = zext i32 %13 to i64 %xtraiter = and i64 %wide.trip.count, 7 %4 = icmp ult i32 %13, 8 br i1 %4, label %for.cond18.preheader.unr-lcssa, label %for.cond5.preheader.us.preheader.new for.cond5.preheader.us.preheader.new: ; preds = %for.cond5.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us, %for.cond5.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond5.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond5.preheader.us ] %niter = phi i64 [ 0, %for.cond5.preheader.us.preheader.new ], [ %niter.next.7, %for.cond5.preheader.us ] %5 = mul nuw nsw i64 %indvar, 200 %scevgep = getelementptr i8, ptr @taken, i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %3, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 200 %gep = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 200), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %3, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 200 %gep91 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 400), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep91, i8 0, i64 %3, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 200 %gep92 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 8 %gep92, i8 0, i64 %3, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 200 %gep93 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 800), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %3, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 200 %gep94 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 1000), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 8 %gep94, i8 0, i64 %3, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 200 %gep95 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 1200), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep95, i8 0, i64 %3, i1 false), !tbaa !5 %12 = mul nuw i64 %indvar, 200 %gep96 = getelementptr i8, ptr getelementptr (i8, ptr @taken, i64 1400), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 8 %gep96, i8 0, i64 %3, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond18.preheader.unr-lcssa, label %for.cond5.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [50 x [51 x i8]], ptr @map, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr @R, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp = icmp slt i64 %indvars.iv.next, %14 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.cond18.preheader.unr-lcssa: ; preds = %for.cond5.preheader.us, %for.cond5.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvar.next.7, %for.cond5.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond18.preheader, label %for.cond5.preheader.us.epil for.cond5.preheader.us.epil: ; preds = %for.cond18.preheader.unr-lcssa, %for.cond5.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond5.preheader.us.epil ], [ %indvar.unr, %for.cond18.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond5.preheader.us.epil ], [ 0, %for.cond18.preheader.unr-lcssa ] %15 = mul nuw nsw i64 %indvar.epil, 200 %scevgep.epil = getelementptr i8, ptr @taken, i64 %15 tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %3, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond18.preheader, label %for.cond5.preheader.us.epil, !llvm.loop !14 for.cond18.preheader: ; preds = %for.cond5.preheader.us.epil, %for.cond18.preheader.unr-lcssa %.pr = load i32, ptr @C, align 4 %16 = icmp sgt i32 %.pr, 0 %or.cond = select i1 %cmp359, i1 %16, i1 false br i1 %or.cond, label %for.cond21.preheader, label %cleanup for.cond21.preheader: ; preds = %for.cond18.preheader, %for.inc34 %17 = phi i32 [ %26, %for.inc34 ], [ %13, %for.cond18.preheader ] %18 = phi i32 [ %27, %for.inc34 ], [ %.pr, %for.cond18.preheader ] %19 = phi i32 [ %28, %for.inc34 ], [ %.pr, %for.cond18.preheader ] %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.inc34 ], [ 0, %for.cond18.preheader ] %cmp2261 = icmp sgt i32 %19, 0 br i1 %cmp2261, label %for.body23.lr.ph, label %for.inc34 for.body23.lr.ph: ; preds = %for.cond21.preheader %20 = trunc i64 %indvars.iv76 to i32 br label %for.body23 for.body23: ; preds = %for.body23.lr.ph, %for.inc31 %21 = phi i32 [ %18, %for.body23.lr.ph ], [ %24, %for.inc31 ] %indvars.iv73 = phi i64 [ 0, %for.body23.lr.ph ], [ %indvars.iv.next74, %for.inc31 ] %arrayidx27 = getelementptr inbounds [50 x [50 x i32]], ptr @taken, i64 0, i64 %indvars.iv76, i64 %indvars.iv73 %22 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %tobool.not = icmp eq i32 %22, 0 br i1 %tobool.not, label %land.lhs.true, label %for.inc31 land.lhs.true: ; preds = %for.body23 %23 = trunc i64 %indvars.iv73 to i32 %call28 = tail call i32 @MLX(i32 noundef %20, i32 noundef %23, i32 noundef -1), !range !10 %tobool29.not = icmp eq i32 %call28, 0 br i1 %tobool29.not, label %land.lhs.true.for.inc31_crit_edge, label %cleanup land.lhs.true.for.inc31_crit_edge: ; preds = %land.lhs.true %.pre = load i32, ptr @C, align 4, !tbaa !5 br label %for.inc31 for.inc31: ; preds = %land.lhs.true.for.inc31_crit_edge, %for.body23 %24 = phi i32 [ %.pre, %land.lhs.true.for.inc31_crit_edge ], [ %21, %for.body23 ] %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %25 = sext i32 %24 to i64 %cmp22 = icmp slt i64 %indvars.iv.next74, %25 br i1 %cmp22, label %for.body23, label %for.inc34.loopexit, !llvm.loop !16 for.inc34.loopexit: ; preds = %for.inc31 %.pre79 = load i32, ptr @R, align 4, !tbaa !5 br label %for.inc34 for.inc34: ; preds = %for.inc34.loopexit, %for.cond21.preheader %26 = phi i32 [ %.pre79, %for.inc34.loopexit ], [ %17, %for.cond21.preheader ] %27 = phi i32 [ %24, %for.inc34.loopexit ], [ %18, %for.cond21.preheader ] %28 = phi i32 [ %24, %for.inc34.loopexit ], [ %19, %for.cond21.preheader ] %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %29 = sext i32 %26 to i64 %cmp19 = icmp slt i64 %indvars.iv.next77, %29 br i1 %cmp19, label %for.cond21.preheader, label %cleanup, !llvm.loop !17 cleanup: ; preds = %for.inc34, %land.lhs.true, %for.cond18.preheader, %for.cond5.preheader.lr.ph, %for.cond2.preheader, %entry %str.sink = phi ptr [ @str, %entry ], [ @str, %for.cond2.preheader ], [ @str, %for.cond5.preheader.lr.ph ], [ @str, %for.cond18.preheader ], [ @str.4, %land.lhs.true ], [ @str, %for.inc34 ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{i32 0, i32 2} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> long LCM(int a, int b) { long i = 2; long lcm; if(a > b) { lcm = a; while(lcm % b != 0) { lcm = a * i; ++i; } return lcm; } else { lcm = b; while(lcm % a != 0) { lcm = b * i; ++i; } return lcm; } } long GCD(int a, int b) { long gcd; if(a > b) { gcd = a % b; while(gcd != 0) { a = b; b = gcd; gcd = a % b; } return b; } else { gcd = b % a; while(gcd != 0) { b = a; a = gcd; gcd = b % a; } return a; } } int main(void) { long a, b; long gcd, lcm; while(scanf("%ld %ld", &a, &b) != EOF) { gcd = GCD(a, b); lcm = LCM(a, b); printf("%ld %ld\n", gcd, lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122402/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122402/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @LCM(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp = icmp sgt i32 %a, %b br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %conv = sext i32 %a to i64 %conv1 = sext i32 %b to i64 %rem3338 = srem i32 %a, %b %cmp2.not34 = icmp eq i32 %rem3338, 0 br i1 %cmp2.not34, label %cleanup, label %while.body while.body: ; preds = %if.then, %while.body %i.035 = phi i64 [ %inc, %while.body ], [ 2, %if.then ] %mul = mul nsw i64 %i.035, %conv %inc = add nuw nsw i64 %i.035, 1 %rem = srem i64 %mul, %conv1 %cmp2.not = icmp eq i64 %rem, 0 br i1 %cmp2.not, label %cleanup, label %while.body, !llvm.loop !5 if.else: ; preds = %entry %conv5 = sext i32 %b to i64 %conv7 = sext i32 %a to i64 %rem830 = srem i64 %conv5, %conv7 %cmp9.not31 = icmp eq i64 %rem830, 0 br i1 %cmp9.not31, label %cleanup, label %while.body11 while.body11: ; preds = %if.else, %while.body11 %i.132 = phi i64 [ %inc14, %while.body11 ], [ 2, %if.else ] %mul13 = mul nsw i64 %i.132, %conv5 %inc14 = add nuw nsw i64 %i.132, 1 %rem8 = srem i64 %mul13, %conv7 %cmp9.not = icmp eq i64 %rem8, 0 br i1 %cmp9.not, label %cleanup, label %while.body11, !llvm.loop !7 cleanup: ; preds = %while.body11, %while.body, %if.else, %if.then %retval.0 = phi i64 [ %conv, %if.then ], [ %conv5, %if.else ], [ %mul, %while.body ], [ %mul13, %while.body11 ] ret i64 %retval.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @GCD(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp = icmp sgt i32 %a, %b br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %rem = srem i32 %a, %b %cmp1.not37 = icmp eq i32 %rem, 0 br i1 %cmp1.not37, label %cleanup, label %while.body while.body: ; preds = %if.then, %while.body %gcd.0.in39 = phi i32 [ %rem4, %while.body ], [ %rem, %if.then ] %b.addr.038 = phi i32 [ %gcd.0.in39, %while.body ], [ %b, %if.then ] %rem4 = srem i32 %b.addr.038, %gcd.0.in39 %cmp1.not = icmp eq i32 %rem4, 0 br i1 %cmp1.not, label %cleanup, label %while.body, !llvm.loop !8 if.else: ; preds = %entry %rem7 = srem i32 %b, %a %cmp10.not34 = icmp eq i32 %rem7, 0 br i1 %cmp10.not34, label %cleanup, label %while.body12 while.body12: ; preds = %if.else, %while.body12 %gcd.1.in36 = phi i32 [ %rem14, %while.body12 ], [ %rem7, %if.else ] %a.addr.035 = phi i32 [ %gcd.1.in36, %while.body12 ], [ %a, %if.else ] %rem14 = srem i32 %a.addr.035, %gcd.1.in36 %cmp10.not = icmp eq i32 %rem14, 0 br i1 %cmp10.not, label %cleanup, label %while.body12, !llvm.loop !9 cleanup: ; preds = %while.body12, %while.body, %if.else, %if.then %retval.0.in = phi i32 [ %b, %if.then ], [ %a, %if.else ], [ %gcd.0.in39, %while.body ], [ %gcd.1.in36, %while.body12 ] %retval.0 = sext i32 %retval.0.in to i64 ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not29 = icmp eq i32 %call28, -1 br i1 %cmp.not29, label %while.end, label %while.body while.body: ; preds = %entry, %LCM.exit %0 = load i64, ptr %a, align 8, !tbaa !10 %conv = trunc i64 %0 to i32 %1 = load i64, ptr %b, align 8, !tbaa !10 %conv1 = trunc i64 %1 to i32 %cmp.i = icmp sgt i32 %conv, %conv1 br i1 %cmp.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body %rem.i = srem i32 %conv, %conv1 %cmp1.not37.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not37.i, label %if.then.i10.thread, label %while.body.i if.then.i10.thread: ; preds = %if.then.i %sext23 = shl i64 %1, 32 %retval.0.i14 = ashr exact i64 %sext23, 32 %sext2439 = shl i64 %0, 32 %conv.i40 = ashr exact i64 %sext2439, 32 br label %LCM.exit while.body.i: ; preds = %if.then.i, %while.body.i %gcd.0.in39.i = phi i32 [ %rem4.i, %while.body.i ], [ %rem.i, %if.then.i ] %b.addr.038.i = phi i32 [ %gcd.0.in39.i, %while.body.i ], [ %conv1, %if.then.i ] %rem4.i = srem i32 %b.addr.038.i, %gcd.0.in39.i %cmp1.not.i = icmp eq i32 %rem4.i, 0 br i1 %cmp1.not.i, label %GCD.exit, label %while.body.i, !llvm.loop !8 if.else.i: ; preds = %while.body %rem7.i = srem i32 %conv1, %conv %cmp10.not34.i = icmp eq i32 %rem7.i, 0 br i1 %cmp10.not34.i, label %GCD.exit.thread17, label %while.body12.i GCD.exit.thread17: ; preds = %if.else.i %sext = shl i64 %0, 32 %retval.0.i19 = ashr exact i64 %sext, 32 br label %if.else.i8 while.body12.i: ; preds = %if.else.i, %while.body12.i %gcd.1.in36.i = phi i32 [ %rem14.i, %while.body12.i ], [ %rem7.i, %if.else.i ] %a.addr.035.i = phi i32 [ %gcd.1.in36.i, %while.body12.i ], [ %conv, %if.else.i ] %rem14.i = srem i32 %a.addr.035.i, %gcd.1.in36.i %cmp10.not.i = icmp eq i32 %rem14.i, 0 br i1 %cmp10.not.i, label %GCD.exit, label %while.body12.i, !llvm.loop !9 GCD.exit: ; preds = %while.body12.i, %while.body.i %retval.0.in.i = phi i32 [ %gcd.0.in39.i, %while.body.i ], [ %gcd.1.in36.i, %while.body12.i ] %retval.0.i = sext i32 %retval.0.in.i to i64 br i1 %cmp.i, label %if.then.i10, label %GCD.exit.if.else.i8_crit_edge GCD.exit.if.else.i8_crit_edge: ; preds = %GCD.exit %.pre34 = shl i64 %0, 32 %.pre35 = ashr exact i64 %.pre34, 32 br label %if.else.i8 if.then.i10: ; preds = %GCD.exit %.pre = shl i64 %1, 32 %.pre32 = ashr exact i64 %.pre, 32 %.pre33 = srem i32 %conv, %conv1 %sext24 = shl i64 %0, 32 %conv.i = ashr exact i64 %sext24, 32 %cmp2.not34.i = icmp eq i32 %.pre33, 0 br i1 %cmp2.not34.i, label %LCM.exit, label %while.body.i11 while.body.i11: ; preds = %if.then.i10, %while.body.i11 %i.035.i = phi i64 [ %inc.i, %while.body.i11 ], [ 2, %if.then.i10 ] %mul.i = mul nsw i64 %i.035.i, %conv.i %inc.i = add nuw nsw i64 %i.035.i, 1 %rem.i12 = srem i64 %mul.i, %.pre32 %cmp2.not.i = icmp eq i64 %rem.i12, 0 br i1 %cmp2.not.i, label %LCM.exit, label %while.body.i11, !llvm.loop !5 if.else.i8: ; preds = %GCD.exit.if.else.i8_crit_edge, %GCD.exit.thread17 %conv7.i.pre-phi = phi i64 [ %.pre35, %GCD.exit.if.else.i8_crit_edge ], [ %retval.0.i19, %GCD.exit.thread17 ] %retval.0.i20 = phi i64 [ %retval.0.i, %GCD.exit.if.else.i8_crit_edge ], [ %retval.0.i19, %GCD.exit.thread17 ] %sext21 = shl i64 %1, 32 %conv5.i = ashr exact i64 %sext21, 32 %rem830.i = srem i64 %conv5.i, %conv7.i.pre-phi %cmp9.not31.i = icmp eq i64 %rem830.i, 0 br i1 %cmp9.not31.i, label %LCM.exit, label %while.body11.i while.body11.i: ; preds = %if.else.i8, %while.body11.i %i.132.i = phi i64 [ %inc14.i, %while.body11.i ], [ 2, %if.else.i8 ] %mul13.i = mul nsw i64 %i.132.i, %conv5.i %inc14.i = add nuw nsw i64 %i.132.i, 1 %rem8.i = srem i64 %mul13.i, %conv7.i.pre-phi %cmp9.not.i = icmp eq i64 %rem8.i, 0 br i1 %cmp9.not.i, label %LCM.exit, label %while.body11.i, !llvm.loop !7 LCM.exit: ; preds = %while.body11.i, %while.body.i11, %if.then.i10.thread, %if.then.i10, %if.else.i8 %retval.0.i15 = phi i64 [ %retval.0.i, %if.then.i10 ], [ %retval.0.i20, %if.else.i8 ], [ %retval.0.i14, %if.then.i10.thread ], [ %retval.0.i, %while.body.i11 ], [ %retval.0.i20, %while.body11.i ] %retval.0.i9 = phi i64 [ %conv.i, %if.then.i10 ], [ %conv5.i, %if.else.i8 ], [ %conv.i40, %if.then.i10.thread ], [ %mul.i, %while.body.i11 ], [ %mul13.i, %while.body11.i ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %retval.0.i15, i64 noundef %retval.0.i9) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %LCM.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6} !9 = distinct !{!9, !6} !10 = !{!11, !11, i64 0} !11 = !{!"long", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"} !14 = distinct !{!14, !6}
#include <stdio.h> int main() { int a, b, r, tmp; double c; while ( scanf("%d %d", &a, &b) != EOF) { c = (double)a * (double)b; if ( a < b ) { tmp = a; a = b; b = tmp; } r = a % b; while ( r != 0 ) { a = b; b = r; r = a % b; } printf("%d %.0f\n", b, c/(double)b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122453/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122453/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %.0f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not19 = icmp eq i32 %call18, -1 br i1 %cmp.not19, label %while.end11, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %b, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %mul = fmul double %conv, %conv1 %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then, label %if.end if.then: ; preds = %while.body store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i32 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i32 [ %1, %if.then ], [ %0, %while.body ] %rem = srem i32 %3, %2 %cmp5.not15 = icmp eq i32 %rem, 0 br i1 %cmp5.not15, label %while.end, label %while.body7 while.body7: ; preds = %if.end, %while.body7 %r.017 = phi i32 [ %rem8, %while.body7 ], [ %rem, %if.end ] %r.01416 = phi i32 [ %r.017, %while.body7 ], [ %2, %if.end ] %rem8 = srem i32 %r.01416, %r.017 %cmp5.not = icmp eq i32 %rem8, 0 br i1 %cmp5.not, label %while.cond4.while.end_crit_edge, label %while.body7, !llvm.loop !9 while.cond4.while.end_crit_edge: ; preds = %while.body7 store i32 %r.01416, ptr %a, align 4, !tbaa !5 store i32 %r.017, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond4.while.end_crit_edge, %if.end %4 = phi i32 [ %r.017, %while.cond4.while.end_crit_edge ], [ %2, %if.end ] %conv9 = sitofp i32 %4 to double %div = fdiv double %mul, %conv9 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, double noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end11, label %while.body, !llvm.loop !11 while.end11: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d %d %7f\n",a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122497/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122497/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%d %d %7f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int dp[55][55]; int exist[55][55]; int is_visited[55][55]; int dfs_visit(char a[][55], int i, int j, int x, int y, int n, int m, int *f, int prevx, int prevy) { if (i >= n || j >= m) { return 0; } if (i == x && j == y) { if ((*f) == 0) { *f = 1; } else { return 1; } } if (is_visited[i][j] == 1) { return 0; } int f1 = 0; is_visited[i][j] = 1; if (prevx != -1 && (i+1 != prevx && j != prevy) && i+1 == x && j == y) { return 1; } if (i+1 < n && !is_visited[i+1][j]) { if (i+1 < n && a[i+1][j] == a[i][j]) { f1 = dfs_visit(a, i+1, j, x, y, n, m, f, i, j); } } if (prevx != -1 && (i != prevx && j+1 != prevy) && i == x && j+1 == y) { return 1; } if (!f1) { if (j+1 < m && !is_visited[i][j+1]) { if (j+1 < m && a[i][j+1] == a[i][j]) { f1 = dfs_visit(a, i, j+1, x, y, n, m, f, i, j); } } } if (prevx != -1 && (i-1 != prevx && j != prevy) && i-1 == x && j == y) { return 1; } if (!f1) { if (i-1 >= 0 && !is_visited[i-1][j]) { if (i-1 >= 0 && a[i-1][j] == a[i][j]) { f1 = dfs_visit(a, i-1, j, x, y, n, m, f, i, j); } } } if (prevx != -1 && (i != prevx && j-1 != prevy) && i == x && j-1 == y) { return 1; } if (!f1) { if (j-1 >= 0 && !is_visited[i][j-1]) { if (j-1 >= 0 && a[i][j-1] == a[i][j]) { f1 = dfs_visit(a, i, j-1, x, y, n, m, f, i, j); } } } is_visited[i][j] = 0; return f1; } int main() { int n, m, i, j; char a[55][55]; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) { scanf("%s", a[i]); } int flag = 0; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { int f = 0; if (dfs_visit(a, i, j, i, j, n, m, &f, -1, -1)) { printf("Yes\n"); flag = 1; break; } memset(is_visited, 0, sizeof(is_visited)); } if (flag) { break; } } if (!flag) { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12254/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12254/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @is_visited = dso_local local_unnamed_addr global [55 x [55 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @dp = dso_local local_unnamed_addr global [55 x [55 x i32]] zeroinitializer, align 16 @exist = dso_local local_unnamed_addr global [55 x [55 x i32]] zeroinitializer, align 16 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @dfs_visit(ptr noundef %a, i32 noundef %i, i32 noundef %j, i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %m, ptr noundef %f, i32 noundef %prevx, i32 noundef %prevy) local_unnamed_addr #0 { entry: %cmp.not = icmp slt i32 %i, %n %cmp1.not = icmp slt i32 %j, %m %or.cond = and i1 %cmp.not, %cmp1.not br i1 %or.cond, label %if.end, label %return if.end: ; preds = %entry %cmp2 = icmp eq i32 %i, %x %cmp3 = icmp eq i32 %j, %y %or.cond352 = and i1 %cmp2, %cmp3 br i1 %or.cond352, label %if.then4, label %if.end8 if.then4: ; preds = %if.end %0 = load i32, ptr %f, align 4, !tbaa !5 %cmp5 = icmp eq i32 %0, 0 br i1 %cmp5, label %if.then6, label %return if.then6: ; preds = %if.then4 store i32 1, ptr %f, align 4, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.then6, %if.end %idxprom = sext i32 %i to i64 %idxprom9 = sext i32 %j to i64 %arrayidx10 = getelementptr inbounds [55 x [55 x i32]], ptr @is_visited, i64 0, i64 %idxprom, i64 %idxprom9 %1 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %1, 1 br i1 %cmp11, label %return, label %if.end13 if.end13: ; preds = %if.end8 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 %cmp18.not = icmp eq i32 %prevx, -1 %.pre = add nsw i32 %i, 1 br i1 %cmp18.not, label %if.end29, label %land.lhs.true19 land.lhs.true19: ; preds = %if.end13 %cmp20.not = icmp ne i32 %.pre, %prevx %cmp22.not = icmp ne i32 %j, %prevy %or.cond353.not365 = and i1 %cmp20.not, %cmp22.not %cmp25 = icmp eq i32 %.pre, %x %or.cond354 = and i1 %cmp25, %or.cond353.not365 %or.cond355 = and i1 %cmp3, %or.cond354 br i1 %or.cond355, label %return, label %if.end29 if.end29: ; preds = %if.end13, %land.lhs.true19 %cmp31 = icmp slt i32 %.pre, %n br i1 %cmp31, label %land.lhs.true32, label %if.end57 land.lhs.true32: ; preds = %if.end29 %idxprom34 = sext i32 %.pre to i64 %arrayidx37 = getelementptr inbounds [55 x [55 x i32]], ptr @is_visited, i64 0, i64 %idxprom34, i64 %idxprom9 %2 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %land.lhs.true41, label %if.end57 land.lhs.true41: ; preds = %land.lhs.true32 %arrayidx46 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom34, i64 %idxprom9 %3 = load i8, ptr %arrayidx46, align 1, !tbaa !9 %arrayidx50 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom9 %4 = load i8, ptr %arrayidx50, align 1, !tbaa !9 %cmp52 = icmp eq i8 %3, %4 br i1 %cmp52, label %if.then54, label %if.end57 if.then54: ; preds = %land.lhs.true41 %call = tail call i32 @dfs_visit(ptr noundef nonnull %a, i32 noundef %.pre, i32 noundef %j, i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %m, ptr noundef %f, i32 noundef %i, i32 noundef %j), !range !10 %5 = icmp eq i32 %call, 0 br label %if.end57 if.end57: ; preds = %land.lhs.true41, %if.then54, %land.lhs.true32, %if.end29 %f1.0 = phi i1 [ true, %land.lhs.true32 ], [ %5, %if.then54 ], [ true, %land.lhs.true41 ], [ true, %if.end29 ] %cmp61.not = icmp eq i32 %i, %prevx %or.cond356 = or i1 %cmp18.not, %cmp61.not br i1 %or.cond356, label %if.end75, label %land.lhs.true63 land.lhs.true63: ; preds = %if.end57 %add64 = add nsw i32 %j, 1 %cmp65.not = icmp ne i32 %add64, %prevy %cmp72 = icmp eq i32 %add64, %y %6 = and i1 %cmp72, %cmp65.not %or.cond357 = and i1 %cmp2, %6 br i1 %or.cond357, label %return, label %if.end75 if.end75: ; preds = %land.lhs.true63, %if.end57 br i1 %f1.0, label %if.then77, label %if.end111 if.then77: ; preds = %if.end75 %add78 = add nsw i32 %j, 1 %cmp79 = icmp slt i32 %add78, %m br i1 %cmp79, label %land.lhs.true81, label %if.end111 land.lhs.true81: ; preds = %if.then77 %idxprom85 = sext i32 %add78 to i64 %arrayidx86 = getelementptr inbounds [55 x [55 x i32]], ptr @is_visited, i64 0, i64 %idxprom, i64 %idxprom85 %7 = load i32, ptr %arrayidx86, align 4, !tbaa !5 %tobool87.not = icmp eq i32 %7, 0 br i1 %tobool87.not, label %land.lhs.true92, label %if.end111 land.lhs.true92: ; preds = %land.lhs.true81 %arrayidx97 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom85 %8 = load i8, ptr %arrayidx97, align 1, !tbaa !9 %arrayidx102 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom9 %9 = load i8, ptr %arrayidx102, align 1, !tbaa !9 %cmp104 = icmp eq i8 %8, %9 br i1 %cmp104, label %if.then106, label %if.end111 if.then106: ; preds = %land.lhs.true92 %call108 = tail call i32 @dfs_visit(ptr noundef nonnull %a, i32 noundef %i, i32 noundef %add78, i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %m, ptr noundef %f, i32 noundef %i, i32 noundef %j), !range !10 %10 = icmp eq i32 %call108, 0 br label %if.end111 if.end111: ; preds = %if.then77, %land.lhs.true81, %if.then106, %land.lhs.true92, %if.end75 %f1.1 = phi i1 [ false, %if.end75 ], [ true, %land.lhs.true81 ], [ %10, %if.then106 ], [ true, %land.lhs.true92 ], [ true, %if.then77 ] br i1 %cmp18.not, label %if.end128, label %land.lhs.true114 land.lhs.true114: ; preds = %if.end111 %sub = add nsw i32 %i, -1 %cmp115.not = icmp ne i32 %sub, %prevx %cmp118.not = icmp ne i32 %j, %prevy %or.cond358.not367 = and i1 %cmp115.not, %cmp118.not %cmp122 = icmp eq i32 %sub, %x %or.cond359 = and i1 %cmp122, %or.cond358.not367 %or.cond360 = and i1 %cmp3, %or.cond359 br i1 %or.cond360, label %return, label %if.end128 if.end128: ; preds = %land.lhs.true114, %if.end111 br i1 %f1.1, label %if.then130, label %if.end164 if.then130: ; preds = %if.end128 %sub131 = add nsw i32 %i, -1 %cmp132 = icmp sgt i32 %i, 0 br i1 %cmp132, label %land.lhs.true134, label %if.end164 land.lhs.true134: ; preds = %if.then130 %idxprom136 = zext i32 %sub131 to i64 %arrayidx139 = getelementptr inbounds [55 x [55 x i32]], ptr @is_visited, i64 0, i64 %idxprom136, i64 %idxprom9 %11 = load i32, ptr %arrayidx139, align 4, !tbaa !5 %tobool140.not = icmp eq i32 %11, 0 br i1 %tobool140.not, label %land.lhs.true145, label %if.end164 land.lhs.true145: ; preds = %land.lhs.true134 %arrayidx150 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom136, i64 %idxprom9 %12 = load i8, ptr %arrayidx150, align 1, !tbaa !9 %arrayidx155 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom9 %13 = load i8, ptr %arrayidx155, align 1, !tbaa !9 %cmp157 = icmp eq i8 %12, %13 br i1 %cmp157, label %if.then159, label %if.end164 if.then159: ; preds = %land.lhs.true145 %call161 = tail call i32 @dfs_visit(ptr noundef nonnull %a, i32 noundef %sub131, i32 noundef %j, i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %m, ptr noundef %f, i32 noundef %i, i32 noundef %j), !range !10 %14 = icmp eq i32 %call161, 0 br label %if.end164 if.end164: ; preds = %if.then130, %land.lhs.true134, %if.then159, %land.lhs.true145, %if.end128 %f1.2 = phi i1 [ false, %if.end128 ], [ true, %land.lhs.true134 ], [ %14, %if.then159 ], [ true, %land.lhs.true145 ], [ true, %if.then130 ] br i1 %or.cond356, label %if.end182, label %land.lhs.true170 land.lhs.true170: ; preds = %if.end164 %sub171 = add nsw i32 %j, -1 %cmp172.not = icmp ne i32 %sub171, %prevy %cmp179 = icmp eq i32 %sub171, %y %15 = and i1 %cmp179, %cmp172.not %or.cond364 = and i1 %cmp2, %15 br i1 %or.cond364, label %return, label %if.end182 if.end182: ; preds = %land.lhs.true170, %if.end164 br i1 %f1.2, label %if.then184, label %if.end218 if.then184: ; preds = %if.end182 %sub185 = add nsw i32 %j, -1 %cmp186 = icmp sgt i32 %j, 0 br i1 %cmp186, label %land.lhs.true188, label %if.end218 land.lhs.true188: ; preds = %if.then184 %idxprom192 = zext i32 %sub185 to i64 %arrayidx193 = getelementptr inbounds [55 x [55 x i32]], ptr @is_visited, i64 0, i64 %idxprom, i64 %idxprom192 %16 = load i32, ptr %arrayidx193, align 4, !tbaa !5 %tobool194.not = icmp eq i32 %16, 0 br i1 %tobool194.not, label %land.lhs.true199, label %if.end218 land.lhs.true199: ; preds = %land.lhs.true188 %arrayidx204 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom192 %17 = load i8, ptr %arrayidx204, align 1, !tbaa !9 %arrayidx209 = getelementptr inbounds [55 x i8], ptr %a, i64 %idxprom, i64 %idxprom9 %18 = load i8, ptr %arrayidx209, align 1, !tbaa !9 %cmp211 = icmp eq i8 %17, %18 br i1 %cmp211, label %if.then213, label %if.end218 if.then213: ; preds = %land.lhs.true199 %call215 = tail call i32 @dfs_visit(ptr noundef nonnull %a, i32 noundef %i, i32 noundef %sub185, i32 noundef %x, i32 noundef %y, i32 noundef %n, i32 noundef %m, ptr noundef %f, i32 noundef %i, i32 noundef %j), !range !10 br label %if.end218 if.end218: ; preds = %if.then184, %land.lhs.true188, %if.then213, %land.lhs.true199, %if.end182 %f1.3 = phi i32 [ 1, %if.end182 ], [ 0, %land.lhs.true188 ], [ %call215, %if.then213 ], [ 0, %land.lhs.true199 ], [ 0, %if.then184 ] store i32 0, ptr %arrayidx10, align 4, !tbaa !5 br label %return return: ; preds = %if.end218, %land.lhs.true19, %land.lhs.true63, %land.lhs.true114, %land.lhs.true170, %if.end8, %if.then4, %entry %retval.1 = phi i32 [ 0, %entry ], [ 1, %if.then4 ], [ 0, %if.end8 ], [ %f1.3, %if.end218 ], [ 1, %land.lhs.true19 ], [ 1, %land.lhs.true63 ], [ 1, %land.lhs.true114 ], [ 1, %land.lhs.true170 ] ret i32 %retval.1 } ; 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [55 x [55 x i8]], align 16 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 3025, ptr nonnull %a) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %for.body, label %if.then21 for.cond2.preheader: ; preds = %for.body %cmp3.not51 = icmp sgt i32 %3, 0 %1 = load i32, ptr %m, align 4 %2 = icmp sgt i32 %1, 0 %or.cond = select i1 %cmp3.not51, i1 %2, i1 false br i1 %or.cond, label %for.cond5.preheader, label %if.then21 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [55 x [55 x i8]], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11 for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc17 %5 = phi i32 [ %10, %for.inc17 ], [ %3, %for.cond2.preheader ] %6 = phi i32 [ %11, %for.inc17 ], [ %1, %for.cond2.preheader ] %i.152 = phi i32 [ %inc18, %for.inc17 ], [ 0, %for.cond2.preheader ] %cmp649 = icmp sgt i32 %6, 0 br i1 %cmp649, label %for.body7, label %for.inc17 for.body7: ; preds = %for.cond5.preheader, %for.inc11 %7 = phi i32 [ %9, %for.inc11 ], [ %6, %for.cond5.preheader ] %j.050 = phi i32 [ %inc12, %for.inc11 ], [ 0, %for.cond5.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #6 store i32 0, ptr %f, align 4, !tbaa !5 %8 = load i32, ptr %n, align 4, !tbaa !5 %call9 = call i32 @dfs_visit(ptr noundef nonnull %a, i32 noundef %i.152, i32 noundef %j.050, i32 noundef %i.152, i32 noundef %j.050, i32 noundef %8, i32 noundef %7, ptr noundef nonnull %f, i32 noundef -1, i32 noundef -1), !range !10 %tobool.not = icmp eq i32 %call9, 0 br i1 %tobool.not, label %for.inc11, label %for.end19 for.inc11: ; preds = %for.body7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12100) @is_visited, i8 0, i64 12100, i1 false) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #6 %inc12 = add nuw nsw i32 %j.050, 1 %9 = load i32, ptr %m, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc12, %9 br i1 %cmp6, label %for.body7, label %for.inc17.loopexit, !llvm.loop !13 for.inc17.loopexit: ; preds = %for.inc11 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc17 for.inc17: ; preds = %for.inc17.loopexit, %for.cond5.preheader %10 = phi i32 [ %.pre, %for.inc17.loopexit ], [ %5, %for.cond5.preheader ] %11 = phi i32 [ %9, %for.inc17.loopexit ], [ %6, %for.cond5.preheader ] %inc18 = add nuw nsw i32 %i.152, 1 %cmp3.not = icmp slt i32 %inc18, %10 br i1 %cmp3.not, label %for.cond5.preheader, label %if.then21, !llvm.loop !14 for.end19: ; preds = %for.body7 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #6 br label %if.end23 if.then21: ; preds = %for.inc17, %entry, %for.cond2.preheader %puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %if.end23 if.end23: ; preds = %for.end19, %if.then21 call void @llvm.lifetime.end.p0(i64 3025, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{i32 0, i32 2} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> int main(void) { int a,b; scanf("%d %d", &a, &b); printf("%d %d %f\n", a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122590/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122590/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d%d",&a,&b); printf("%d %d %7.5f",a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122633/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122633/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %7.5f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; int d, r; double f; scanf("%d %d", &a, &b); d = a/b; r = a%b; f = (double)a/b; printf("%d %d %f", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122677/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122677/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b; double f; scanf("%d %d",&a,&b); f = (double)(a) / (double)(b); printf("%d %d %f\n",a / b,a % b,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122763/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122763/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %b, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %div2 = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = ((double)a / (double)b); printf("%d %d %.5f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122806/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122806/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %.5f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a, b; scanf("%d%d", &a, &b); printf("%d %d", a/b, a%b); double c=a, d=b; printf(" %lf", c/d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122857/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122857/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c" %lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem) %2 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %2 to double %3 = load i32, ptr %b, align 4, !tbaa !5 %conv2 = sitofp i32 %3 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long // fact(n) int fact(int n){ if(n == 1) return 1; else return (n * fact(n - 1)); } // combination(n,r) int combination(int n, int r){ if(r == 0 || r == n) return 1; else if(r == 1) return n; return (combination(n - 1, r - 1) + combination(n - 1, r)); } // gcd(a,b) int gcd(int a,int b){ return (b == 0) ? a : gcd(b, a % b); } // lcm(a.b) int lcm(int a,int b){ return (a * b) / gcd(a,b); } // qsort(array, size, sizeof(int),comp); int comp(const int *a,const int *b){ return (*a - *b); } // append(array,*size,addNum) void append(int *array,int *size,int num){ realloc(array, sizeof(int) * (*size + 1)); array[(*size)] = num; ++(*size); } // pop(array,*size) & nongetpop(array,*size) int pop(int *array,int *size){ int temp = array[(*size - 1)]; realloc(array,sizeof(int) * (*size - 1)); --(*size); return temp; } void nongetpop(int *array,int *size){ realloc(array,sizeof(int) * (*size - 1)); --(*size); } int main(int argc, char const *argv[]) { char c_str[] = "CODEFESTIVAL2016" ; char input[17]; int cnt = 0; scanf("%s",input); for (int i = 0; i < 17; i++){ if (c_str[i] != input[i]) ++cnt; } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122914/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122914/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp3 = icmp eq i32 %n, 1 br i1 %cmp3, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %0 = add i32 %n, -1 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %if.else.preheader8, label %vector.ph vector.ph: ; preds = %if.else.preheader %n.vec = and i32 %0, -8 %ind.end = sub i32 %n, %n.vec %.splatinsert = insertelement <4 x i32> poison, i32 %n, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3> br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 -4, i32 -4, i32 -4, i32 -4> %1 = mul <4 x i32> %vec.ind, %vec.phi %2 = mul <4 x i32> %step.add, %vec.phi7 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8> %3 = icmp eq i32 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !5 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %2, %1 %4 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %0, %n.vec br i1 %cmp.n, label %return, label %if.else.preheader8 if.else.preheader8: ; preds = %if.else.preheader, %middle.block %n.tr5.ph = phi i32 [ %n, %if.else.preheader ], [ %ind.end, %middle.block ] %accumulator.tr4.ph = phi i32 [ 1, %if.else.preheader ], [ %4, %middle.block ] br label %if.else if.else: ; preds = %if.else.preheader8, %if.else %n.tr5 = phi i32 [ %sub, %if.else ], [ %n.tr5.ph, %if.else.preheader8 ] %accumulator.tr4 = phi i32 [ %mul, %if.else ], [ %accumulator.tr4.ph, %if.else.preheader8 ] %sub = add nsw i32 %n.tr5, -1 %mul = mul nsw i32 %n.tr5, %accumulator.tr4 %cmp = icmp eq i32 %sub, 1 br i1 %cmp, label %return, label %if.else, !llvm.loop !8 return: ; preds = %if.else, %middle.block, %entry %accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %4, %middle.block ], [ %mul, %if.else ] ret i32 %accumulator.tr.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @combination(i32 noundef %n, i32 noundef %r) local_unnamed_addr #1 { entry: %cmp = icmp eq i32 %r, 0 %cmp115 = icmp eq i32 %r, %n %or.cond16 = or i1 %cmp, %cmp115 br i1 %or.cond16, label %return, label %if.else.lr.ph if.else.lr.ph: ; preds = %entry %cmp2 = icmp eq i32 %r, 1 %sub5 = add nsw i32 %r, -1 br i1 %cmp2, label %return, label %if.else if.else: ; preds = %if.else.lr.ph, %if.else %n.tr18 = phi i32 [ %sub, %if.else ], [ %n, %if.else.lr.ph ] %accumulator.tr17 = phi i32 [ %add, %if.else ], [ 0, %if.else.lr.ph ] %sub = add nsw i32 %n.tr18, -1 %call = tail call i32 @combination(i32 noundef %sub, i32 noundef %sub5) %add = add nsw i32 %call, %accumulator.tr17 %cmp1 = icmp eq i32 %sub, %r br i1 %cmp1, label %return, label %if.else return: ; preds = %if.else, %if.else.lr.ph, %entry %accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ 0, %if.else.lr.ph ], [ %add, %if.else ] %retval.0 = phi i32 [ 1, %entry ], [ %n, %if.else.lr.ph ], [ 1, %if.else ] %accumulator.ret.tr = add nsw i32 %retval.0, %accumulator.tr.lcssa ret i32 %accumulator.ret.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %cond.end, label %cond.false cond.false: ; preds = %entry, %cond.false %b.tr6 = phi i32 [ %rem, %cond.false ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %cond.false ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %cond.end, label %cond.false cond.end: ; preds = %cond.false, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %cond.false ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4.i = icmp eq i32 %b, 0 br i1 %cmp4.i, label %gcd.exit, label %cond.false.i cond.false.i: ; preds = %entry, %cond.false.i %b.tr6.i = phi i32 [ %rem.i, %cond.false.i ], [ %b, %entry ] %a.tr5.i = phi i32 [ %b.tr6.i, %cond.false.i ], [ %a, %entry ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %gcd.exit, label %cond.false.i gcd.exit: ; preds = %cond.false.i, %entry %a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %cond.false.i ] %mul = mul nsw i32 %b, %a %div = sdiv i32 %mul, %a.tr.lcssa.i ret i32 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %a, align 4, !tbaa !9 %1 = load i32, ptr %b, align 4, !tbaa !9 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @append(ptr nocapture noundef %array, ptr nocapture noundef %size, i32 noundef %num) local_unnamed_addr #3 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %add = add nsw i32 %0, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %1 = load i32, ptr %size, align 4, !tbaa !9 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom store i32 %num, ptr %arrayidx, align 4, !tbaa !9 %2 = load i32, ptr %size, align 4, !tbaa !9 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %size, align 4, !tbaa !9 ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local i32 @pop(ptr nocapture noundef %array, ptr nocapture noundef %size) local_unnamed_addr #3 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %sub = add nsw i32 %0, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 %mul = shl nsw i64 %idxprom, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %2 = load i32, ptr %size, align 4, !tbaa !9 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %size, align 4, !tbaa !9 ret i32 %1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @nongetpop(ptr nocapture noundef %array, ptr nocapture noundef %size) local_unnamed_addr #3 { entry: %0 = load i32, ptr %size, align 4, !tbaa !9 %sub = add nsw i32 %0, -1 %conv = sext i32 %sub to i64 %mul = shl nsw i64 %conv, 2 %call = tail call ptr @realloc(ptr noundef %array, i64 noundef %mul) #9 %1 = load i32, ptr %size, align 4, !tbaa !9 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %size, align 4, !tbaa !9 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #6 { entry: %input = alloca [17 x i8], align 16 call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %input) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %0 = load <16 x i8>, ptr %input, align 16, !tbaa !13 %1 = icmp ne <16 x i8> %0, <i8 67, i8 79, i8 68, i8 69, i8 70, i8 69, i8 83, i8 84, i8 73, i8 86, i8 65, i8 76, i8 50, i8 48, i8 49, i8 54> %arrayidx2.16 = getelementptr inbounds [17 x i8], ptr %input, i64 0, i64 16 %2 = load i8, ptr %arrayidx2.16, align 16, !tbaa !13 %cmp4.not.16 = icmp ne i8 %2, 0 %inc.16 = zext i1 %cmp4.not.16 to i32 %3 = bitcast <16 x i1> %1 to i16 %4 = call i16 @llvm.ctpop.i16(i16 %3), !range !14 %5 = zext i16 %4 to i32 %op.rdx = add nuw nsw i32 %5, %inc.16 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %op.rdx) call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %input) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #8 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind allocsize(1) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6, !7} !6 = !{!"llvm.loop.isvectorized", i32 1} !7 = !{!"llvm.loop.unroll.runtime.disable"} !8 = distinct !{!8, !7, !6} !9 = !{!10, !10, i64 0} !10 = !{!"int", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"} !13 = !{!11, !11, i64 0} !14 = !{i16 0, i16 17}
#include<stdio.h> char S[17]; char code[17] = "CODEFESTIVAL2016"; int result = 0; int main(void) { scanf("%s", S); for(int i=0; i<17; i++) { if(S[i] != code[i]) result++; } printf("%d\n", result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122958/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122958/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @code = dso_local local_unnamed_addr global [17 x i8] c"CODEFESTIVAL2016\00", align 16 @result = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @S = dso_local global [17 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @S) %result.promoted = load i32, ptr @result, align 4, !tbaa !5 %0 = load i8, ptr @S, align 16, !tbaa !9 %1 = load i8, ptr @code, align 16, !tbaa !9 %cmp4.not = icmp eq i8 %0, %1 br i1 %cmp4.not, label %for.inc, label %if.then if.then: ; preds = %entry %inc = add nsw i32 %result.promoted, 1 store i32 %inc, ptr @result, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %inc11 = phi i32 [ %result.promoted, %entry ], [ %inc, %if.then ] %2 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 1), align 1, !tbaa !9 %3 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 1), align 1, !tbaa !9 %cmp4.not.1 = icmp eq i8 %2, %3 br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %inc.1 = add nsw i32 %inc11, 1 store i32 %inc.1, ptr @result, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %inc11.1 = phi i32 [ %inc11, %for.inc ], [ %inc.1, %if.then.1 ] %4 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 2), align 2, !tbaa !9 %5 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 2), align 2, !tbaa !9 %cmp4.not.2 = icmp eq i8 %4, %5 br i1 %cmp4.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %inc.2 = add nsw i32 %inc11.1, 1 store i32 %inc.2, ptr @result, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %inc11.2 = phi i32 [ %inc11.1, %for.inc.1 ], [ %inc.2, %if.then.2 ] %6 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 3), align 1, !tbaa !9 %7 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 3), align 1, !tbaa !9 %cmp4.not.3 = icmp eq i8 %6, %7 br i1 %cmp4.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %inc.3 = add nsw i32 %inc11.2, 1 store i32 %inc.3, ptr @result, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %inc11.3 = phi i32 [ %inc11.2, %for.inc.2 ], [ %inc.3, %if.then.3 ] %8 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 4), align 4, !tbaa !9 %9 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 4), align 4, !tbaa !9 %cmp4.not.4 = icmp eq i8 %8, %9 br i1 %cmp4.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 %inc.4 = add nsw i32 %inc11.3, 1 store i32 %inc.4, ptr @result, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %inc11.4 = phi i32 [ %inc11.3, %for.inc.3 ], [ %inc.4, %if.then.4 ] %10 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 5), align 1, !tbaa !9 %11 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 5), align 1, !tbaa !9 %cmp4.not.5 = icmp eq i8 %10, %11 br i1 %cmp4.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %inc.5 = add nsw i32 %inc11.4, 1 store i32 %inc.5, ptr @result, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %inc11.5 = phi i32 [ %inc11.4, %for.inc.4 ], [ %inc.5, %if.then.5 ] %12 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 6), align 2, !tbaa !9 %13 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 6), align 2, !tbaa !9 %cmp4.not.6 = icmp eq i8 %12, %13 br i1 %cmp4.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 %inc.6 = add nsw i32 %inc11.5, 1 store i32 %inc.6, ptr @result, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %inc11.6 = phi i32 [ %inc11.5, %for.inc.5 ], [ %inc.6, %if.then.6 ] %14 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 7), align 1, !tbaa !9 %15 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 7), align 1, !tbaa !9 %cmp4.not.7 = icmp eq i8 %14, %15 br i1 %cmp4.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 %inc.7 = add nsw i32 %inc11.6, 1 store i32 %inc.7, ptr @result, align 4, !tbaa !5 br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %inc11.7 = phi i32 [ %inc11.6, %for.inc.6 ], [ %inc.7, %if.then.7 ] %16 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 8), align 8, !tbaa !9 %17 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 8), align 8, !tbaa !9 %cmp4.not.8 = icmp eq i8 %16, %17 br i1 %cmp4.not.8, label %for.inc.8, label %if.then.8 if.then.8: ; preds = %for.inc.7 %inc.8 = add nsw i32 %inc11.7, 1 store i32 %inc.8, ptr @result, align 4, !tbaa !5 br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %inc11.8 = phi i32 [ %inc11.7, %for.inc.7 ], [ %inc.8, %if.then.8 ] %18 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 9), align 1, !tbaa !9 %19 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 9), align 1, !tbaa !9 %cmp4.not.9 = icmp eq i8 %18, %19 br i1 %cmp4.not.9, label %for.inc.9, label %if.then.9 if.then.9: ; preds = %for.inc.8 %inc.9 = add nsw i32 %inc11.8, 1 store i32 %inc.9, ptr @result, align 4, !tbaa !5 br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %inc11.9 = phi i32 [ %inc11.8, %for.inc.8 ], [ %inc.9, %if.then.9 ] %20 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 10), align 2, !tbaa !9 %21 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 10), align 2, !tbaa !9 %cmp4.not.10 = icmp eq i8 %20, %21 br i1 %cmp4.not.10, label %for.inc.10, label %if.then.10 if.then.10: ; preds = %for.inc.9 %inc.10 = add nsw i32 %inc11.9, 1 store i32 %inc.10, ptr @result, align 4, !tbaa !5 br label %for.inc.10 for.inc.10: ; preds = %if.then.10, %for.inc.9 %inc11.10 = phi i32 [ %inc11.9, %for.inc.9 ], [ %inc.10, %if.then.10 ] %22 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 11), align 1, !tbaa !9 %23 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 11), align 1, !tbaa !9 %cmp4.not.11 = icmp eq i8 %22, %23 br i1 %cmp4.not.11, label %for.inc.11, label %if.then.11 if.then.11: ; preds = %for.inc.10 %inc.11 = add nsw i32 %inc11.10, 1 store i32 %inc.11, ptr @result, align 4, !tbaa !5 br label %for.inc.11 for.inc.11: ; preds = %if.then.11, %for.inc.10 %inc11.11 = phi i32 [ %inc11.10, %for.inc.10 ], [ %inc.11, %if.then.11 ] %24 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 12), align 4, !tbaa !9 %25 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 12), align 4, !tbaa !9 %cmp4.not.12 = icmp eq i8 %24, %25 br i1 %cmp4.not.12, label %for.inc.12, label %if.then.12 if.then.12: ; preds = %for.inc.11 %inc.12 = add nsw i32 %inc11.11, 1 store i32 %inc.12, ptr @result, align 4, !tbaa !5 br label %for.inc.12 for.inc.12: ; preds = %if.then.12, %for.inc.11 %inc11.12 = phi i32 [ %inc11.11, %for.inc.11 ], [ %inc.12, %if.then.12 ] %26 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 13), align 1, !tbaa !9 %27 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 13), align 1, !tbaa !9 %cmp4.not.13 = icmp eq i8 %26, %27 br i1 %cmp4.not.13, label %for.inc.13, label %if.then.13 if.then.13: ; preds = %for.inc.12 %inc.13 = add nsw i32 %inc11.12, 1 store i32 %inc.13, ptr @result, align 4, !tbaa !5 br label %for.inc.13 for.inc.13: ; preds = %if.then.13, %for.inc.12 %inc11.13 = phi i32 [ %inc11.12, %for.inc.12 ], [ %inc.13, %if.then.13 ] %28 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 14), align 2, !tbaa !9 %29 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 14), align 2, !tbaa !9 %cmp4.not.14 = icmp eq i8 %28, %29 br i1 %cmp4.not.14, label %for.inc.14, label %if.then.14 if.then.14: ; preds = %for.inc.13 %inc.14 = add nsw i32 %inc11.13, 1 store i32 %inc.14, ptr @result, align 4, !tbaa !5 br label %for.inc.14 for.inc.14: ; preds = %if.then.14, %for.inc.13 %inc11.14 = phi i32 [ %inc11.13, %for.inc.13 ], [ %inc.14, %if.then.14 ] %30 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 15), align 1, !tbaa !9 %31 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 15), align 1, !tbaa !9 %cmp4.not.15 = icmp eq i8 %30, %31 br i1 %cmp4.not.15, label %for.inc.15, label %if.then.15 if.then.15: ; preds = %for.inc.14 %inc.15 = add nsw i32 %inc11.14, 1 store i32 %inc.15, ptr @result, align 4, !tbaa !5 br label %for.inc.15 for.inc.15: ; preds = %if.then.15, %for.inc.14 %inc11.15 = phi i32 [ %inc11.14, %for.inc.14 ], [ %inc.15, %if.then.15 ] %32 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @S, i64 0, i64 16), align 16, !tbaa !9 %33 = load i8, ptr getelementptr inbounds ([17 x i8], ptr @code, i64 0, i64 16), align 16, !tbaa !9 %cmp4.not.16 = icmp eq i8 %32, %33 br i1 %cmp4.not.16, label %for.inc.16, label %if.then.16 if.then.16: ; preds = %for.inc.15 %inc.16 = add nsw i32 %inc11.15, 1 store i32 %inc.16, ptr @result, align 4, !tbaa !5 br label %for.inc.16 for.inc.16: ; preds = %if.then.16, %for.inc.15 %34 = phi i32 [ %inc.16, %if.then.16 ], [ %inc11.15, %for.inc.15 ] %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %34) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> int main(){ int n1,n2,n3,n4; scanf("%d%d%d%d",&n1,&n2,&n3,&n4); int ans[4]; ans[0] = ans[1] = ans[2] = ans[3] = 0; if(n1 == 1 || n2 == 1 || n3 == 1 || n4 == 1){ ans[0] = 1; } if(n1 == 4 || n2 == 4 || n3 == 4 || n4 == 4){ ans[1] = 1; } if(n1 == 7 || n2 == 7 || n3 == 7 || n4 == 7){ ans[2] = 1; } if(n1 == 9 || n2 == 9 || n3 == 9 || n4 == 9){ ans[3] = 1; } if (ans[0] == 1 && ans[1] == 1 && ans[2] == 1 && ans[3] == 1){ puts("YES"); }else{ puts("NO"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123050/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123050/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n1 = alloca i32, align 4 %n2 = alloca i32, align 4 %n3 = alloca i32, align 4 %n4 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n3) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n4) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3, ptr noundef nonnull %n4) %0 = load i32, ptr %n1, align 4, !tbaa !5 %1 = load i32, ptr %n2, align 4 %2 = load i32, ptr %n3, align 4 %3 = load i32, ptr %n4, align 4 %4 = insertelement <4 x i32> poison, i32 %0, i64 0 %5 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> zeroinitializer %6 = icmp eq <4 x i32> %5, <i32 4, i32 1, i32 7, i32 9> %7 = insertelement <4 x i32> poison, i32 %1, i64 0 %8 = shufflevector <4 x i32> %7, <4 x i32> poison, <4 x i32> zeroinitializer %9 = icmp eq <4 x i32> %8, <i32 4, i32 1, i32 7, i32 9> %10 = select <4 x i1> %6, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %9 %11 = insertelement <4 x i32> poison, i32 %2, i64 0 %12 = shufflevector <4 x i32> %11, <4 x i32> poison, <4 x i32> zeroinitializer %13 = icmp eq <4 x i32> %12, <i32 4, i32 1, i32 7, i32 9> %14 = select <4 x i1> %10, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %13 %15 = insertelement <4 x i32> poison, i32 %3, i64 0 %16 = shufflevector <4 x i32> %15, <4 x i32> poison, <4 x i32> zeroinitializer %17 = icmp eq <4 x i32> %16, <i32 4, i32 1, i32 7, i32 9> %18 = select <4 x i1> %14, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %17 %19 = bitcast <4 x i1> %18 to i4 %20 = icmp eq i4 %19, -1 %.str.1..str.2 = select i1 %20, ptr @.str.1, ptr @.str.2 %call52 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n4) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n3) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #define MOD 998244353 long int SUM(long int a,long int b){return (a%MOD+b%MOD+MOD)%MOD;} long int PROD(long int a,long int b){return a%MOD*(b%MOD)%MOD;}//a*b int main(){ long int dp[3001][3001]; int n,s,a,i,j; scanf("%d%d",&n,&s); for(i=0;i<3001;i++)dp[i][0]=0;dp[0][0]=1; for(i=1;i<=n;i++){ scanf("%d",&a); for(j=0;j<3001;j++){dp[i][j]=PROD(dp[i-1][j],2);if(j-a>=0)dp[i][j]=SUM(dp[i][j],dp[i-1][j-a]);} } printf("%ld",dp[n][s]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123094/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123094/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @SUM(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %rem = srem i64 %a, 998244353 %rem1 = srem i64 %b, 998244353 %add = add nsw i64 %rem, 998244353 %add2 = add nsw i64 %add, %rem1 %rem3 = srem i64 %add2, 998244353 ret i64 %rem3 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @PROD(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %rem = srem i64 %a, 998244353 %rem1 = srem i64 %b, 998244353 %mul = mul nsw i64 %rem1, %rem %rem2 = srem i64 %mul, 998244353 ret i64 %rem2 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %dp = alloca [3001 x [3001 x i64]], align 16 %n = alloca i32, align 4 %s = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 72048008, ptr nonnull %dp) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) br label %for.body for.body: ; preds = %for.body.1, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.1 ] %arrayidx = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %indvars.iv store i64 0, ptr %arrayidx, align 16, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 3001 br i1 %exitcond.not, label %for.end, label %for.body.1, !llvm.loop !9 for.body.1: ; preds = %for.body %arrayidx.1 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next store i64 0, ptr %arrayidx.1, align 8, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next.1 store i64 0, ptr %arrayidx.2, align 16, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %indvars.iv.next.2 store i64 0, ptr %arrayidx.3, align 8, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body store i64 1, ptr %dp, align 16, !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp5.not67 = icmp slt i32 %0, 1 br i1 %cmp5.not67, label %for.end.for.end42_crit_edge, label %for.body6 for.end.for.end42_crit_edge: ; preds = %for.end %.pre = sext i32 %0 to i64 br label %for.end42 for.body6: ; preds = %for.end, %for.inc40 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.inc40 ], [ 1, %for.end ] %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %1 = add nsw i64 %indvars.iv75, -1 %2 = load i32, ptr %a, align 4, !tbaa !11 br label %for.body10 for.body10: ; preds = %for.body6, %for.inc37 %indvars.iv71 = phi i64 [ 0, %for.body6 ], [ %indvars.iv.next72, %for.inc37 ] %indvars73 = trunc i64 %indvars.iv71 to i32 %arrayidx14 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %1, i64 %indvars.iv71 %3 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %rem.i = srem i64 %3, 998244353 %rem.i.tr = trunc i64 %rem.i to i32 %rem2.i.lhs.trunc = shl nsw i32 %rem.i.tr, 1 %rem2.i64 = srem i32 %rem2.i.lhs.trunc, 998244353 %rem2.i.sext = sext i32 %rem2.i64 to i64 %arrayidx19 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %indvars.iv75, i64 %indvars.iv71 store i64 %rem2.i.sext, ptr %arrayidx19, align 8, !tbaa !5 %sub20 = sub nsw i32 %indvars73, %2 %cmp21 = icmp sgt i32 %sub20, -1 br i1 %cmp21, label %if.then, label %for.inc37 if.then: ; preds = %for.body10 %idxprom30 = zext i32 %sub20 to i64 %arrayidx31 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %1, i64 %idxprom30 %4 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %rem1.i = srem i64 %4, 998244353 %add.i = add nsw i64 %rem2.i.sext, 998244353 %add2.i = add nsw i64 %add.i, %rem1.i %rem3.i = srem i64 %add2.i, 998244353 store i64 %rem3.i, ptr %arrayidx19, align 8, !tbaa !5 br label %for.inc37 for.inc37: ; preds = %for.body10, %if.then %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond74.not = icmp eq i64 %indvars.iv.next72, 3001 br i1 %exitcond74.not, label %for.inc40, label %for.body10, !llvm.loop !13 for.inc40: ; preds = %for.inc37 %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %5 = load i32, ptr %n, align 4, !tbaa !11 %6 = sext i32 %5 to i64 %cmp5.not.not = icmp slt i64 %indvars.iv75, %6 br i1 %cmp5.not.not, label %for.body6, label %for.end42, !llvm.loop !14 for.end42: ; preds = %for.inc40, %for.end.for.end42_crit_edge %idxprom43.pre-phi = phi i64 [ %.pre, %for.end.for.end42_crit_edge ], [ %6, %for.inc40 ] %7 = load i32, ptr %s, align 4, !tbaa !11 %idxprom45 = sext i32 %7 to i64 %arrayidx46 = getelementptr inbounds [3001 x [3001 x i64]], ptr %dp, i64 0, i64 %idxprom43.pre-phi, i64 %idxprom45 %8 = load i64, ptr %arrayidx46, align 8, !tbaa !5 %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %8) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 72048008, ptr nonnull %dp) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_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 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"int", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main() { int H, W, N; int grid[10005]; int a[10005]; int i,j; int colors[10005]; int count=0; int temp; scanf("%d %d",&H,&W); scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&a[i]); for(j=0;j<a[i];j++) { colors[count]=i+1; count++; } } for(j=0;j<H;j++) { if(j%2 == 0) { for(i=0;i<W;i++) grid[i+j*W] = colors[i+j*W]; }else{ for(i=0;i<W;i++) grid[(j+1)*W-1-i] = colors[i+j*W]; } } for(j=0;j<H;j++) { for(i=0;i<W;i++) printf("%d ",grid[i+j*W]); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123137/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123137/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %N = alloca i32, align 4 %grid = alloca [10005 x i32], align 16 %a = alloca [10005 x i32], align 16 %colors = alloca [10005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 40020, ptr nonnull %grid) #5 call void @llvm.lifetime.start.p0(i64 40020, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 40020, ptr nonnull %colors) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp100 = icmp sgt i32 %0, 0 br i1 %cmp100, label %for.body, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.inc11, %entry %1 = load i32, ptr %H, align 4, !tbaa !5 %cmp15107 = icmp sgt i32 %1, 0 br i1 %cmp15107, label %for.body16.lr.ph, label %for.end66 for.body16.lr.ph: ; preds = %for.cond14.preheader %2 = load i32, ptr %W, align 4 %.fr = freeze i32 %2 %cmp32103 = icmp sgt i32 %.fr, 0 br i1 %cmp32103, label %for.body16.us.us.preheader, label %for.cond52.preheader.preheader for.body16.us.us.preheader: ; preds = %for.body16.lr.ph %3 = zext i32 %.fr to i64 %4 = shl nuw nsw i64 %3, 2 %5 = zext i32 %.fr to i64 %wide.trip.count186 = zext i32 %1 to i64 %6 = add nsw i64 %3, -1 %min.iters.check195 = icmp ult i32 %.fr, 12 %7 = trunc i64 %6 to i32 %8 = icmp ugt i64 %6, 4294967295 %n.vec198 = and i64 %3, 4294967288 %cmp.n200 = icmp eq i64 %n.vec198, %3 %xtraiter = and i64 %3, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %9 = sub nsw i64 0, %3 br label %for.body16.us.us for.body16.us.us: ; preds = %for.body16.us.us.preheader, %for.inc46.us.us %indvars.iv180 = phi i64 [ 0, %for.body16.us.us.preheader ], [ %indvars.iv.next181.pre-phi, %for.inc46.us.us ] %10 = trunc i64 %indvars.iv180 to i32 %rem.us.us = and i32 %10, 1 %cmp17.us.us = icmp eq i32 %rem.us.us, 0 br i1 %cmp17.us.us, label %for.cond18.preheader.us.us, label %for.cond31.preheader.us.us for.body33.us.us: ; preds = %for.body33.us.us.prol.loopexit, %for.body33.us.us %indvars.iv168 = phi i64 [ %indvars.iv.next169.1, %for.body33.us.us ], [ %indvars.iv168.unr, %for.body33.us.us.prol.loopexit ] %11 = add nsw i64 %22, %indvars.iv168 %arrayidx37.us.us = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %11 %12 = load i32, ptr %arrayidx37.us.us, align 4, !tbaa !5 %13 = trunc i64 %indvars.iv168 to i32 %14 = xor i32 %13, -1 %sub40.us.us = add i32 %25, %14 %idxprom41.us.us = sext i32 %sub40.us.us to i64 %arrayidx42.us.us = getelementptr inbounds [10005 x i32], ptr %grid, i64 0, i64 %idxprom41.us.us store i32 %12, ptr %arrayidx42.us.us, align 4, !tbaa !5 %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %15 = add nsw i64 %22, %indvars.iv.next169 %arrayidx37.us.us.1 = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %15 %16 = load i32, ptr %arrayidx37.us.us.1, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv.next169 to i32 %18 = xor i32 %17, -1 %sub40.us.us.1 = add i32 %25, %18 %idxprom41.us.us.1 = sext i32 %sub40.us.us.1 to i64 %arrayidx42.us.us.1 = getelementptr inbounds [10005 x i32], ptr %grid, i64 0, i64 %idxprom41.us.us.1 store i32 %16, ptr %arrayidx42.us.us.1, align 4, !tbaa !5 %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2 %exitcond173.not.1 = icmp eq i64 %indvars.iv.next169.1, %3 br i1 %exitcond173.not.1, label %for.inc46.us.us, label %for.body33.us.us, !llvm.loop !9 for.inc46.us.us: ; preds = %for.body33.us.us.prol.loopexit, %for.body33.us.us, %middle.block193, %for.cond18.preheader.us.us %indvars.iv.next181.pre-phi = phi i64 [ %.pre, %for.cond18.preheader.us.us ], [ %23, %middle.block193 ], [ %23, %for.body33.us.us ], [ %23, %for.body33.us.us.prol.loopexit ] %exitcond187.not = icmp eq i64 %indvars.iv.next181.pre-phi, %wide.trip.count186 br i1 %exitcond187.not, label %for.cond49.preheader, label %for.body16.us.us, !llvm.loop !12 for.cond18.preheader.us.us: ; preds = %for.body16.us.us %19 = mul i32 %.fr, %10 %20 = sext i32 %19 to i64 %21 = shl nsw i64 %20, 2 %scevgep175 = getelementptr i8, ptr %colors, i64 %21 %scevgep174 = getelementptr i8, ptr %grid, i64 %21 call void @llvm.memcpy.p0.p0.i64(ptr align 4 %scevgep174, ptr align 4 %scevgep175, i64 %4, i1 false), !tbaa !5 %.pre = add nuw nsw i64 %indvars.iv180, 1 br label %for.inc46.us.us for.cond31.preheader.us.us: ; preds = %for.body16.us.us %22 = mul nsw i64 %indvars.iv180, %5 %23 = add nuw nsw i64 %indvars.iv180, 1 %24 = trunc i64 %23 to i32 %25 = mul i32 %.fr, %24 br i1 %min.iters.check195, label %for.body33.us.us.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %for.cond31.preheader.us.us %26 = add i32 %25, -1 %27 = sub i32 %26, %7 %28 = icmp sgt i32 %27, %26 %29 = or i1 %28, %8 br i1 %29, label %for.body33.us.us.preheader, label %vector.body201 vector.body201: ; preds = %vector.scevcheck, %vector.body201 %offset.idx203 = phi i64 [ %index.next206, %vector.body201 ], [ 0, %vector.scevcheck ] %30 = trunc i64 %offset.idx203 to i32 %31 = add nsw i64 %22, %offset.idx203 %32 = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %31 %wide.load = load <4 x i32>, ptr %32, align 4, !tbaa !5 %33 = getelementptr inbounds i32, ptr %32, i64 4 %wide.load204 = load <4 x i32>, ptr %33, align 4, !tbaa !5 %34 = xor i32 %30, -1 %35 = add i32 %25, %34 %36 = sext i32 %35 to i64 %37 = getelementptr inbounds [10005 x i32], ptr %grid, i64 0, i64 %36 %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %38 = getelementptr inbounds i32, ptr %37, i64 -3 store <4 x i32> %reverse, ptr %38, align 4, !tbaa !5 %reverse205 = shufflevector <4 x i32> %wide.load204, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %39 = getelementptr inbounds i32, ptr %37, i64 -7 store <4 x i32> %reverse205, ptr %39, align 4, !tbaa !5 %index.next206 = add nuw i64 %offset.idx203, 8 %40 = icmp eq i64 %index.next206, %n.vec198 br i1 %40, label %middle.block193, label %vector.body201, !llvm.loop !13 middle.block193: ; preds = %vector.body201 br i1 %cmp.n200, label %for.inc46.us.us, label %for.body33.us.us.preheader for.body33.us.us.preheader: ; preds = %vector.scevcheck, %for.cond31.preheader.us.us, %middle.block193 %indvars.iv168.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.cond31.preheader.us.us ], [ %n.vec198, %middle.block193 ] br i1 %lcmp.mod.not, label %for.body33.us.us.prol.loopexit, label %for.body33.us.us.prol for.body33.us.us.prol: ; preds = %for.body33.us.us.preheader %41 = add nsw i64 %22, %indvars.iv168.ph %arrayidx37.us.us.prol = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %41 %42 = load i32, ptr %arrayidx37.us.us.prol, align 4, !tbaa !5 %43 = trunc i64 %indvars.iv168.ph to i32 %44 = xor i32 %43, -1 %sub40.us.us.prol = add i32 %25, %44 %idxprom41.us.us.prol = sext i32 %sub40.us.us.prol to i64 %arrayidx42.us.us.prol = getelementptr inbounds [10005 x i32], ptr %grid, i64 0, i64 %idxprom41.us.us.prol store i32 %42, ptr %arrayidx42.us.us.prol, align 4, !tbaa !5 %indvars.iv.next169.prol = or i64 %indvars.iv168.ph, 1 br label %for.body33.us.us.prol.loopexit for.body33.us.us.prol.loopexit: ; preds = %for.body33.us.us.prol, %for.body33.us.us.preheader %indvars.iv168.unr = phi i64 [ %indvars.iv168.ph, %for.body33.us.us.preheader ], [ %indvars.iv.next169.prol, %for.body33.us.us.prol ] %45 = xor i64 %indvars.iv168.ph, %9 %46 = icmp eq i64 %45, -1 br i1 %46, label %for.inc46.us.us, label %for.body33.us.us for.body: ; preds = %entry, %for.inc11 %indvars.iv141 = phi i64 [ %48, %for.inc11 ], [ 0, %entry ] %count.0101 = phi i32 [ %count.1.lcssa, %for.inc11 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10005 x i32], ptr %a, i64 0, i64 %indvars.iv141 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %47 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp697 = icmp sgt i32 %47, 0 %48 = add nuw nsw i64 %indvars.iv141, 1 br i1 %cmp697, label %for.body7.lr.ph, label %for.inc11 for.body7.lr.ph: ; preds = %for.body %49 = sext i32 %count.0101 to i64 %50 = trunc i64 %48 to i32 %51 = zext i32 %47 to i64 %min.iters.check = icmp ult i32 %47, 8 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.body7.lr.ph %n.vec = and i64 %51, 4294967288 %ind.end = add nsw i64 %n.vec, %49 %ind.end191 = trunc i64 %n.vec to i32 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %50, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %49 %52 = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %offset.idx store <4 x i32> %broadcast.splat, ptr %52, align 4, !tbaa !5 %53 = getelementptr inbounds i32, ptr %52, i64 4 store <4 x i32> %broadcast.splat, ptr %53, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %54 = icmp eq i64 %index.next, %n.vec br i1 %54, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %51 br i1 %cmp.n, label %for.inc11.loopexit, label %for.body7.preheader for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ %49, %for.body7.lr.ph ], [ %ind.end, %middle.block ] %j.098.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %ind.end191, %middle.block ] br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ %indvars.iv.ph, %for.body7.preheader ] %j.098 = phi i32 [ %inc10, %for.body7 ], [ %j.098.ph, %for.body7.preheader ] %arrayidx9 = getelementptr inbounds [10005 x i32], ptr %colors, i64 0, i64 %indvars.iv store i32 %50, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %inc10 = add nuw nsw i32 %j.098, 1 %exitcond.not = icmp eq i32 %inc10, %47 br i1 %exitcond.not, label %for.inc11.loopexit, label %for.body7, !llvm.loop !16 for.inc11.loopexit: ; preds = %for.body7, %middle.block %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %for.body7 ] %55 = trunc i64 %indvars.iv.next.lcssa to i32 br label %for.inc11 for.inc11: ; preds = %for.body, %for.inc11.loopexit %count.1.lcssa = phi i32 [ %55, %for.inc11.loopexit ], [ %count.0101, %for.body ] %56 = load i32, ptr %N, align 4, !tbaa !5 %57 = sext i32 %56 to i64 %cmp = icmp slt i64 %48, %57 br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !17 for.cond49.preheader: ; preds = %for.inc46.us.us br i1 %cmp15107, label %for.cond52.preheader.preheader, label %for.end66 for.cond52.preheader.preheader: ; preds = %for.body16.lr.ph, %for.cond49.preheader br label %for.cond52.preheader for.cond52.preheader: ; preds = %for.cond52.preheader.preheader, %for.end62 %j.2135 = phi i32 [ %inc65, %for.end62 ], [ 0, %for.cond52.preheader.preheader ] %58 = load i32, ptr %W, align 4, !tbaa !5 %cmp53132 = icmp sgt i32 %58, 0 br i1 %cmp53132, label %for.body54, label %for.end62 for.body54: ; preds = %for.cond52.preheader, %for.body54 %59 = phi i32 [ %61, %for.body54 ], [ %58, %for.cond52.preheader ] %i.3133 = phi i32 [ %inc61, %for.body54 ], [ 0, %for.cond52.preheader ] %mul55 = mul nsw i32 %59, %j.2135 %add56 = add nsw i32 %mul55, %i.3133 %idxprom57 = sext i32 %add56 to i64 %arrayidx58 = getelementptr inbounds [10005 x i32], ptr %grid, i64 0, i64 %idxprom57 %60 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60) %inc61 = add nuw nsw i32 %i.3133, 1 %61 = load i32, ptr %W, align 4, !tbaa !5 %cmp53 = icmp slt i32 %inc61, %61 br i1 %cmp53, label %for.body54, label %for.end62, !llvm.loop !18 for.end62: ; preds = %for.body54, %for.cond52.preheader %putchar = call i32 @putchar(i32 10) %inc65 = add nuw nsw i32 %j.2135, 1 %62 = load i32, ptr %H, align 4, !tbaa !5 %cmp50 = icmp slt i32 %inc65, %62 br i1 %cmp50, label %for.cond52.preheader, label %for.end66, !llvm.loop !19 for.end66: ; preds = %for.end62, %for.cond14.preheader, %for.cond49.preheader call void @llvm.lifetime.end.p0(i64 40020, ptr nonnull %colors) #5 call void @llvm.lifetime.end.p0(i64 40020, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 40020, ptr nonnull %grid) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !11, !14} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !11, !14} !16 = distinct !{!16, !10, !14, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> #include <string.h> int main(void) { char s[1000],t[1000]; int len_s,len_t; int cnt,change=1001; scanf("%s",s); scanf("%s",t); len_s = strlen(s); len_t = strlen(t); for(int i=0;i<len_s - len_t + 1;i++){ cnt = 0; for(int j=i;j<i+len_t;j++){ if(s[j] != t[j-i]){ cnt = cnt+1; } } if(cnt < change){ change = cnt; } } printf("%d\n",change); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123188/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123188/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1000 x i8], align 16 %t = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call4 to i32 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %conv7 = trunc i64 %call6 to i32 %cmp.not46 = icmp slt i32 %conv, %conv7 br i1 %cmp.not46, label %for.cond.cleanup, label %for.cond9.preheader.preheader for.cond9.preheader.preheader: ; preds = %entry %sext = shl i64 %call6, 32 %0 = ashr exact i64 %sext, 32 %1 = add i64 %call4, 1 %2 = sub i64 %1, %call6 %wide.trip.count = and i64 %2, 4294967295 %cmp1143 = icmp sgt i32 %conv7, 0 br label %for.cond9.preheader for.cond9.preheader: ; preds = %for.cond9.preheader.preheader, %for.cond.cleanup13 %indvars.iv = phi i64 [ 0, %for.cond9.preheader.preheader ], [ %indvars.iv.next, %for.cond.cleanup13 ] %change.047 = phi i32 [ 1001, %for.cond9.preheader.preheader ], [ %spec.select, %for.cond.cleanup13 ] %3 = add i64 %0, %indvars.iv %4 = add nuw i64 %indvars.iv, 1 %smax = call i64 @llvm.smax.i64(i64 %3, i64 %4) %5 = sub i64 %smax, %indvars.iv %6 = add nsw i64 %indvars.iv, %0 br i1 %cmp1143, label %for.body14.preheader, label %for.cond.cleanup13 for.body14.preheader: ; preds = %for.cond9.preheader %min.iters.check = icmp ult i64 %5, 8 br i1 %min.iters.check, label %for.body14.preheader60, label %vector.ph vector.ph: ; preds = %for.body14.preheader %n.vec = and i64 %5, -8 %ind.end = add i64 %indvars.iv, %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.phi56 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %offset.idx = add i64 %indvars.iv, %index %7 = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %offset.idx %wide.load = load <4 x i8>, ptr %7, align 1, !tbaa !5 %8 = getelementptr inbounds i8, ptr %7, i64 4 %wide.load57 = load <4 x i8>, ptr %8, align 1, !tbaa !5 %9 = getelementptr inbounds [1000 x i8], ptr %t, i64 0, i64 %index %wide.load58 = load <4 x i8>, ptr %9, align 8, !tbaa !5 %10 = getelementptr inbounds i8, ptr %9, i64 4 %wide.load59 = load <4 x i8>, ptr %10, align 4, !tbaa !5 %11 = icmp ne <4 x i8> %wide.load, %wide.load58 %12 = icmp ne <4 x i8> %wide.load57, %wide.load59 %13 = zext <4 x i1> %11 to <4 x i32> %14 = zext <4 x i1> %12 to <4 x i32> %15 = add <4 x i32> %vec.phi, %13 %16 = add <4 x i32> %vec.phi56, %14 %index.next = add nuw i64 %index, 8 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %16, %15 %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %5, %n.vec br i1 %cmp.n, label %for.cond.cleanup13, label %for.body14.preheader60 for.body14.preheader60: ; preds = %for.body14.preheader, %middle.block %indvars.iv50.ph = phi i64 [ %indvars.iv, %for.body14.preheader ], [ %ind.end, %middle.block ] %cnt.044.ph = phi i32 [ 0, %for.body14.preheader ], [ %18, %middle.block ] br label %for.body14 for.cond.cleanup: ; preds = %for.cond.cleanup13, %entry %change.0.lcssa = phi i32 [ 1001, %entry ], [ %spec.select, %for.cond.cleanup13 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %change.0.lcssa) call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %s) #5 ret i32 0 for.cond.cleanup13: ; preds = %for.body14, %middle.block, %for.cond9.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ %18, %middle.block ], [ %spec.select42, %for.body14 ] %spec.select = call i32 @llvm.smin.i32(i32 %cnt.0.lcssa, i32 %change.047) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond9.preheader, !llvm.loop !12 for.body14: ; preds = %for.body14.preheader60, %for.body14 %indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.body14 ], [ %indvars.iv50.ph, %for.body14.preheader60 ] %cnt.044 = phi i32 [ %spec.select42, %for.body14 ], [ %cnt.044.ph, %for.body14.preheader60 ] %arrayidx = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %indvars.iv50 %19 = load i8, ptr %arrayidx, align 1, !tbaa !5 %20 = sub nuw nsw i64 %indvars.iv50, %indvars.iv %arrayidx18 = getelementptr inbounds [1000 x i8], ptr %t, i64 0, i64 %20 %21 = load i8, ptr %arrayidx18, align 1, !tbaa !5 %cmp20.not = icmp ne i8 %19, %21 %add22 = zext i1 %cmp20.not to i32 %spec.select42 = add nuw nsw i32 %cnt.044, %add22 %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %cmp11 = icmp slt i64 %indvars.iv.next51, %6 br i1 %cmp11, label %for.body14, label %for.cond.cleanup13, !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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9, !11, !10}
#include<stdio.h> #include<string.h> int min(int a, int b){return a < b ? a : b;} int main(){ char s[1005], t[1005]; scanf("%s%s",s,t); int ans = 100000; // printf("%d\n",strlen(s)); for(int i = 0; i <= strlen(s) - strlen(t); i++){ int m = 0; for(int j = 0; j < strlen(t); j++){ if(t[j] != s[i + j]) m++; } // printf("%d\n",m); ans = min(ans, m); } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123230/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123230/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %s = alloca [1005 x i8], align 16 %t = alloca [1005 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %t) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t) %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #7 %cmp1134.not = icmp eq i64 %call5, 0 br i1 %cmp1134.not, label %for.cond.cleanup, label %for.cond7.preheader.us.preheader for.cond7.preheader.us.preheader: ; preds = %entry %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %0 = add i64 %call3, 1 %1 = sub i64 %0, %call5 %min.iters.check = icmp ult i64 %call5, 8 %n.vec = and i64 %call5, -8 %cmp.n = icmp eq i64 %call5, %n.vec br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup13_crit_edge.us %indvars.iv43 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next44, %for.cond7.for.cond.cleanup13_crit_edge.us ] %ans.038.us = phi i32 [ 100000, %for.cond7.preheader.us.preheader ], [ %cond.i.us, %for.cond7.for.cond.cleanup13_crit_edge.us ] br i1 %min.iters.check, label %for.body14.us.preheader, label %vector.body vector.body: ; preds = %for.cond7.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond7.preheader.us ] %vec.phi = phi <4 x i32> [ %11, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %vec.phi53 = phi <4 x i32> [ %12, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %2 = getelementptr inbounds [1005 x i8], ptr %t, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %2, align 8, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load54 = load <4 x i8>, ptr %3, align 4, !tbaa !5 %4 = add nuw nsw i64 %index, %indvars.iv43 %5 = getelementptr inbounds [1005 x i8], ptr %s, i64 0, i64 %4 %wide.load55 = load <4 x i8>, ptr %5, align 1, !tbaa !5 %6 = getelementptr inbounds i8, ptr %5, i64 4 %wide.load56 = load <4 x i8>, ptr %6, align 1, !tbaa !5 %7 = icmp ne <4 x i8> %wide.load, %wide.load55 %8 = icmp ne <4 x i8> %wide.load54, %wide.load56 %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi53, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond7.for.cond.cleanup13_crit_edge.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %for.cond7.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond7.preheader.us ], [ %n.vec, %middle.block ] %m.035.us.ph = phi i32 [ 0, %for.cond7.preheader.us ], [ %14, %middle.block ] br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14.us ], [ %indvars.iv.ph, %for.body14.us.preheader ] %m.035.us = phi i32 [ %spec.select.us, %for.body14.us ], [ %m.035.us.ph, %for.body14.us.preheader ] %arrayidx.us = getelementptr inbounds [1005 x i8], ptr %t, i64 0, i64 %indvars.iv %15 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %16 = add nuw nsw i64 %indvars.iv, %indvars.iv43 %arrayidx17.us = getelementptr inbounds [1005 x i8], ptr %s, i64 0, i64 %16 %17 = load i8, ptr %arrayidx17.us, align 1, !tbaa !5 %cmp19.not.us = icmp ne i8 %15, %17 %inc.us = zext i1 %cmp19.not.us to i32 %spec.select.us = add nuw nsw i32 %m.035.us, %inc.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call5 br i1 %exitcond.not, label %for.cond7.for.cond.cleanup13_crit_edge.us, label %for.body14.us, !llvm.loop !12 for.cond7.for.cond.cleanup13_crit_edge.us: ; preds = %for.body14.us, %middle.block %spec.select.us.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select.us, %for.body14.us ] %cond.i.us = call i32 @llvm.smin.i32(i32 %ans.038.us, i32 %spec.select.us.lcssa) %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %exitcond46 = icmp eq i64 %indvars.iv.next44, %1 br i1 %exitcond46, label %for.cond.cleanup, label %for.cond7.preheader.us, !llvm.loop !13 for.cond.cleanup: ; preds = %for.cond7.for.cond.cleanup13_crit_edge.us, %entry %.us-phi = phi i32 [ 0, %entry ], [ %cond.i.us, %for.cond7.for.cond.cleanup13_crit_edge.us ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi) call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %s) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10} !13 = distinct !{!13, !9}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void) { char s[1001]; char t[1001]; scanf("%s", s); scanf("%s", t); int i, j; int min = strlen(t); int lim = strlen(s) - strlen(t) + 1; for(i=0; i<lim; i++) { // 一致しなかった文字の数 int not_match = 0; for(j=0; j<strlen(t); j++) { not_match += (s[i+j] != t[j]); } //printf("i=%d, not_match=%d\n", i, not_match); if(not_match < min) { min = not_match; } } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123281/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123281/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %conv = trunc i64 %call4 to i32 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %sub = sub i64 %call6, %call4 %0 = trunc i64 %sub to i32 %conv9 = add i64 %sub, 1 %cmp44 = icmp ult i32 %0, 2147483647 br i1 %cmp44, label %for.cond11.preheader.lr.ph, label %for.end30 for.cond11.preheader.lr.ph: ; preds = %entry %cmp1540.not = icmp eq i64 %call4, 0 br i1 %cmp1540.not, label %for.end30, label %for.cond11.preheader.us.preheader for.cond11.preheader.us.preheader: ; preds = %for.cond11.preheader.lr.ph %wide.trip.count = and i64 %conv9, 4294967295 %min.iters.check = icmp ult i64 %call4, 8 %n.vec = and i64 %call4, -8 %cmp.n = icmp eq i64 %call4, %n.vec br label %for.cond11.preheader.us for.cond11.preheader.us: ; preds = %for.cond11.preheader.us.preheader, %for.cond11.for.end_crit_edge.us %indvars.iv51 = phi i64 [ 0, %for.cond11.preheader.us.preheader ], [ %indvars.iv.next52, %for.cond11.for.end_crit_edge.us ] %min.045.us = phi i32 [ %conv, %for.cond11.preheader.us.preheader ], [ %spec.select.us, %for.cond11.for.end_crit_edge.us ] br i1 %min.iters.check, label %for.body17.us.preheader, label %vector.body vector.body: ; preds = %for.cond11.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond11.preheader.us ] %vec.phi = phi <4 x i32> [ %10, %vector.body ], [ zeroinitializer, %for.cond11.preheader.us ] %vec.phi59 = phi <4 x i32> [ %11, %vector.body ], [ zeroinitializer, %for.cond11.preheader.us ] %1 = add nuw nsw i64 %index, %indvars.iv51 %2 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %1 %wide.load = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load60 = load <4 x i8>, ptr %3, align 1, !tbaa !5 %4 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %index %wide.load61 = load <4 x i8>, ptr %4, align 8, !tbaa !5 %5 = getelementptr inbounds i8, ptr %4, i64 4 %wide.load62 = load <4 x i8>, ptr %5, align 4, !tbaa !5 %6 = icmp ne <4 x i8> %wide.load, %wide.load61 %7 = icmp ne <4 x i8> %wide.load60, %wide.load62 %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi59, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond11.for.end_crit_edge.us, label %for.body17.us.preheader for.body17.us.preheader: ; preds = %for.cond11.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond11.preheader.us ], [ %n.vec, %middle.block ] %not_match.042.us.ph = phi i32 [ 0, %for.cond11.preheader.us ], [ %13, %middle.block ] br label %for.body17.us for.body17.us: ; preds = %for.body17.us.preheader, %for.body17.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body17.us ], [ %indvars.iv.ph, %for.body17.us.preheader ] %not_match.042.us = phi i32 [ %add25.us, %for.body17.us ], [ %not_match.042.us.ph, %for.body17.us.preheader ] %14 = add nuw nsw i64 %indvars.iv, %indvars.iv51 %arrayidx.us = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %14 %15 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %arrayidx21.us = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv %16 = load i8, ptr %arrayidx21.us, align 1, !tbaa !5 %cmp23.us = icmp ne i8 %15, %16 %conv24.us = zext i1 %cmp23.us to i32 %add25.us = add nuw nsw i32 %not_match.042.us, %conv24.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call4 br i1 %exitcond.not, label %for.cond11.for.end_crit_edge.us, label %for.body17.us, !llvm.loop !12 for.cond11.for.end_crit_edge.us: ; preds = %for.body17.us, %middle.block %add25.us.lcssa = phi i32 [ %13, %middle.block ], [ %add25.us, %for.body17.us ] %spec.select.us = call i32 @llvm.smin.i32(i32 %add25.us.lcssa, i32 %min.045.us) %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %exitcond54.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count br i1 %exitcond54.not, label %for.end30, label %for.cond11.preheader.us, !llvm.loop !13 for.end30: ; preds = %for.cond11.for.end_crit_edge.us, %for.cond11.preheader.lr.ph, %entry %min.0.lcssa = phi i32 [ %conv, %entry ], [ 0, %for.cond11.preheader.lr.ph ], [ %spec.select.us, %for.cond11.for.end_crit_edge.us ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10} !13 = distinct !{!13, !9}
#pragma region kyopuro_templates #pragma GCC optimize("Ofast") #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> #include<time.h> #include<ctype.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<62) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 20) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } ll digits(ll a, ll b){return a/b?1+digits(a/b,b):1;} ll base(ll n, ll a, ll i){return i==1?n%a:base(n/a,a,i-1);} ll is_inArr1(ll x, ll n){ return ( x<0 || x>=n ) ? 0 : 1 ; } ll is_inArr2(ll y, ll x, ll h, ll w){ return ( y<0 || y>=h || x<0 || x>=w ) ? 0 : 1 ; } void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } ll *factors[2] , fac_cnt=0 , is_factor_prepared=0; ll factor_pre(){ rep(i,0,1){ if(is_factor_prepared++) return 0; } ll tmp=(1e6)/2+1, fac_tmp[tmp]; rep(i,0,tmp){fac_tmp[i]=i?2*i+1:2;} rep(i,1,tmp){if(fac_tmp[i]){ repp(j,3,tmp/(2*i+1)+1,2 ){ if( j*(2*i+1)<tmp ) fac_tmp[ (j*(2*i+1)-1)/2 ]=0; } }else continue;} rep(i,0,tmp){if(fac_tmp[i]){ rep(j,0,2){ factors[j] = realloc( factors[j] , sizeof(ll)*( fac_cnt +1 ) ); factors[j][j?fac_cnt++:fac_cnt]=j?0:fac_tmp[i]; } } } return 0; } ll factor(ll n, ll new_common_plus){ factor_pre(); rep(i,0,fac_cnt){ ll cnt=0; rep(j,0,1){ while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue; } factors[1][i]= new_common_plus==1 ? cnt : new_common_plus==2 ? max2(factors[1][i],cnt) : factors[1][i]+cnt ; if( factors[0][i]> n ) break; } return n; } ll judge_prime(ll n){ factor_pre(); rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; } ll *mf_arr,*inv_arr,*finv_arr,is_minv_made=0,is_mf_made=0,num_of_inv=2*1e6+10; ll makeinv(ll n , ll mod){ rep(i,0,1){if(is_minv_made++) return 0;} inv_arr = realloc(inv_arr, sizeof(ll)*2 ); finv_arr = realloc(finv_arr, sizeof(ll)*2 ); inv_arr[1]=1;finv_arr[0]=finv_arr[1]=1; rep(i,2,n+1){ inv_arr = realloc(inv_arr, sizeof(ll)*(i+1) ); finv_arr = realloc(finv_arr, sizeof(ll)*(i+1) ); inv_arr[i]= mod - inv_arr[mod%i] * (mod / i) % mod; finv_arr[i] = finv_arr[i - 1] * inv_arr[i] % mod; } return 0; } ll make_mf(ll n, ll mod){ rep(i,0,1){ if(is_mf_made++) return 0; } mf_arr = realloc(mf_arr, sizeof(ll)*2 ); ll x=1; mf_arr[0]=mf_arr[1]=x; rep(i,2,n+1){ x=x*i%mod; mf_arr = realloc(mf_arr, sizeof(ll)*(i+1) ); mf_arr[i]=x; } return 0; } ll m_inv(ll x, ll mod, ll is_fac ){ makeinv(num_of_inv,mod); return is_fac?finv_arr[x]:inv_arr[x]; } ll m_f(ll x, ll mod){ make_mf(num_of_inv,mod); return mf_arr[x]; } ll mod_nck(ll n, ll k, ll mod){ return m_f(n,mod)*m_inv(k,mod,1)%mod*m_inv(n-k,mod,1)%mod; } ll m_p(ll r,ll n,ll mod){ ll t=1,s=r; while(n>0){ t = (n&1) ? t*s%mod : t; s=s*s%mod; n>>=1; } return r?t:0; } ll m_mul2(ll a, ll b, ll mod){ return a*b%mod; } ll m_mul3(ll a, ll b, ll c, ll mod){ return m_mul2(a*b%mod,c,mod); } ll m_mul4(ll a, ll b, ll c, ll d, ll mod){ return m_mul3(a*b%mod,c,d,mod); } ll m_mul5(ll a, ll b, ll c, ll d, ll e, ll mod){ return m_mul4(a*b%mod,c,d,e,mod); } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} void sort_partial(ll a[],int begin,int end,int is_increase){ ll *b; b = (ll *) malloc( sizeof(ll)*(end-begin) ); rep(i,begin,end) b[i-begin]=a[i]; if(is_increase) sortup(b,end-begin); else sortdown(b,end-begin); rep(i,begin,end) a[i]=b[i-begin]; } #pragma region AVL /*---------------------------AVL start--------------------------------*/ //https://qiita.com/mikecat_mixc/items/e9f8248de2ae7f7a0a29 typedef struct node_AVL_set{ ll val; int diff; int cnt; struct node_AVL_set *child[2]; }AVL_set; void AVL_set_inside_rotate(AVL_set **node, int is_right){ int l = is_right==false , r = is_right==true , sign = is_right ? 1 : -1; if((*node)->child[l] != NULL){ AVL_set* left = (*node)->child[l]; int a= (*node)->diff * sign , b= left->diff * sign ,na,nb; if(b+1){ na=a-1-b; nb= (a-b) ? b-1 : a-2; }else{ na=a-1; nb= a ? b-1 : a+b-2; } (*node)->diff = na * sign; left->diff = nb * sign; /* rotate-> */ (*node)->child[l] = (*node)->child[l]->child[r]; left->child[r] = *node; *node = left; } } int AVL_set_inside_update(AVL_set **node, ll data, int add){ if(*node == NULL){ if(add==2){ *node = malloc(sizeof(AVL_set)); (*node)->val = data; (*node)->cnt = 1; (*node)->diff = 0; (*node)->child[0] = NULL; (*node)->child[1] = NULL; } return add==2 ? *node != NULL : 0; }else{ int l, delta, delta_sign; AVL_set *next_node; if(data == (*node)->val){ if(add==2){ (*node)->cnt++; return 0; }else{ if( add && (*node)->cnt > 1 ){ (*node)->cnt--; return 0; }else{ if((*node)->child[1] == NULL){ next_node = (*node)->child[0]; free(*node); *node = next_node; return -1; }else if((*node)->child[0] == NULL){ next_node = (*node)->child[1]; free(*node); *node = next_node; return -1; }else{ for(next_node = (*node)->child[0]; next_node->child[1] != NULL; next_node = next_node->child[1]); (*node)->val = next_node->val; l=0; delta_sign=1; delta = AVL_set_inside_update(&(*node)->child[l], next_node->val, add); } } } }else{ l = data >= (*node)->val ? 1 : 0; delta_sign = data < (*node)->val ? 1 : -1; delta = AVL_set_inside_update(&(*node)->child[l], data, add); } if( delta ){ int orig_diff = (*node)->diff; int do_rotate = 0, rotate_l , diff_sign , rotate_right; (*node)->diff += delta * delta_sign; if((*node)->diff > 1){ do_rotate = 1; rotate_l = 0; diff_sign = 1; rotate_right = 1; }else if((*node)->diff < -1){ do_rotate = 1; rotate_l = 1; diff_sign = -1; rotate_right = 0; } if(do_rotate){ int child_diff = (*node)->child[rotate_l]->diff; if((*node)->child[rotate_l]->diff * diff_sign < 0){ AVL_set_inside_rotate(&(*node)->child[rotate_l], !rotate_right); } AVL_set_inside_rotate(node, rotate_right); return delta < 0 && child_diff != 0 ? -1 : 0; } if (delta > 0 && orig_diff == 0) return 1; else if(delta < 0 && orig_diff != 0) return -1; else return 0; }else{ return 0; } } } void AVL_set_inside_print(const AVL_set *node, int depth){ if(node == NULL) return; AVL_set_inside_print(node->child[1], depth + 1); printf("%lld %d\n", node->val,node->cnt); AVL_set_inside_print(node->child[0], depth + 1); } void AVL_set_inside_free(AVL_set *node){ if(node == NULL) return; AVL_set_inside_free(node->child[0]); AVL_set_inside_free(node->child[1]); free(node); } ll AVL_set_inside_count(AVL_set *root, ll val){ AVL_set *node; node = root; while(node){ if (val < node->val) node = node->child[0]; else if(val > node->val) node = node->child[1]; else return node->cnt; } return 0; } ll AVL_set_inside_minmax(AVL_set *root, int type){ while(root->child[type] !=NULL) root= root->child[type]; return root->val; } void AVL_set_inside_swap(AVL_set **node1, AVL_set **node2){ AVL_set *tmp; tmp=*node1; *node1=*node2; *node2=tmp; } #define set_MAX_SIZE 514511 ll set_main( int command , int set_num , ll val ){ static bool set_is_init=false; static AVL_set *set_pointer[set_MAX_SIZE]; static ll set_siz[set_MAX_SIZE]; if(!set_is_init){ set_is_init=true; rep(i,0,set_MAX_SIZE){ *(set_pointer+i) = NULL; set_siz[i]=0; } } if(command==-1){ AVL_set_inside_print( set_pointer[set_num] ,0); } if(command==1){ AVL_set_inside_count(set_pointer[set_num],val) ? 1 : set_siz[set_num]++; AVL_set_inside_update( &set_pointer[set_num] , val , 2 ); } if(command==2){ return AVL_set_inside_count(set_pointer[set_num],val); } if(command==3){ ( AVL_set_inside_count(set_pointer[set_num],val) > 1 ) ? 1 : set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val,1); } if(command==4){ set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val , 0 ); } if(command==5){ set_siz[set_num]=0; AVL_set_inside_free( set_pointer[set_num] ); set_pointer[set_num] = NULL; } if(command==6){ return set_siz[set_num]; } if(command==7){ return AVL_set_inside_minmax(set_pointer[set_num],1); } if(command==8){ return AVL_set_inside_minmax(set_pointer[set_num],0); } if(command==9){ AVL_set_inside_swap(&set_pointer[set_num],&set_pointer[val]); } return 0; } void set_print(int set_num){ set_main(-1,set_num,0); } void set_insert(int set_num, ll val){ set_main(1,set_num,val); } ll set_count(int set_num, ll val){ return set_main(2,set_num,val); } void set_erase(int set_num, ll val, int is_all){ if(is_all) set_main(4,set_num,val); else set_main(3,set_num,val); } void set_clear(int set_num){ set_main(5,set_num,0); } ll set_size(int set_num){ return set_main(6,set_num,0); } ll set_max(int set_num){ return set_main(7,set_num,0); } ll set_min(int set_num){ return set_main(8,set_num,0); } void set_swap(ll set_num1, ll set_num2){ set_main(9,set_num1,set_num2); } /* insert * size * clear * erase * count * max * min * swap * begin end merge source の要素のキーと等価なキーの要素がある場合、その要素は source から抽出されない lower_bound upper_bound */ // ll map_main() /*---------------------------AVL start--------------------------------*/ #pragma endregion AVL #pragma endregion kyopuro_templates char s[1151154]; char t[1151154]; void solve(){ // fgets(s,sizeof(s),stdin); ll ans=INF; // cin(&n); scanf("%s",s); scanf("%s",t); ll ns=strlen(s),nt=strlen(t); // ll [n]; rep(i,0,ns-nt+1){ ll tm=0; rep(j,i,nt+i){ if(s[j]!=t[j-i]) tm++; } ans=min2(ans,tm); } printf("%lld\n",ans); } int main(void){ ll T=1; // cin(&T); rep(i,0,T){ solve(); } return 0; } /* while (ng + 1 < ok) { ll p = ng + (ok - ng) / 2; ll cnt = 0; rep(i,0,n){ cnt += (a[i] + p - 1) / p - 1; } if (cnt <= k) ok = p; else ng = p; } */ // 10^18 2^60 3^38 5^26
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123339/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123339/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node_AVL_set = type { i64, i32, i32, [2 x ptr] } @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @fac_cnt = dso_local local_unnamed_addr global i64 0, align 8 @is_factor_prepared = dso_local local_unnamed_addr global i64 0, align 8 @factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16 @is_minv_made = dso_local local_unnamed_addr global i64 0, align 8 @is_mf_made = dso_local local_unnamed_addr global i64 0, align 8 @num_of_inv = dso_local local_unnamed_addr global i64 2000010, align 8 @inv_arr = dso_local local_unnamed_addr global ptr null, align 8 @finv_arr = dso_local local_unnamed_addr global ptr null, align 8 @mf_arr = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld %d\0A\00", align 1 @set_main.set_is_init = internal unnamed_addr global i1 false, align 1 @set_main.set_pointer = internal global [514511 x ptr] zeroinitializer, align 16 @set_main.set_siz = internal unnamed_addr global [514511 x i64] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [1151154 x i8] zeroinitializer, align 16 @t = dso_local global [1151154 x i8] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #3 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #3 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ 4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ -4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #5 { entry: %cmp4 = fcmp ogt double %b, 0.000000e+00 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ] ret double %c.0.lcssa for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ] %mul = fmul double %c.05, %a %inc = add nuw nsw i64 %i.06, 1 %conv = sitofp i64 %inc to double %cmp = fcmp olt double %conv, %b br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #6 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #6 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #7 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %POW.exit, label %for.body.i.epil, !llvm.loop !20 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !21 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @digits(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i64 [ 0, %entry ], [ %add, %tailrecurse ] %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse ] %div = sdiv i64 %a.tr, %b %tobool.not = icmp eq i64 %div, 0 %add = add nuw nsw i64 %accumulator.tr, 1 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i64 %add } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @base(i64 noundef %n, i64 noundef %a, i64 noundef %i) local_unnamed_addr #5 { entry: %cmp5 = icmp eq i64 %i, 1 br i1 %cmp5, label %cond.true, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %i, 3 %1 = add i64 %i, -2 %xtraiter = and i64 %0, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cond.false.prol.loopexit, label %cond.false.prol cond.false.prol: ; preds = %cond.false.preheader, %cond.false.prol %i.tr7.prol = phi i64 [ %sub.prol, %cond.false.prol ], [ %i, %cond.false.preheader ] %n.tr6.prol = phi i64 [ %div.prol, %cond.false.prol ], [ %n, %cond.false.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %cond.false.prol ], [ 0, %cond.false.preheader ] %div.prol = sdiv i64 %n.tr6.prol, %a %sub.prol = add nsw i64 %i.tr7.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %cond.false.prol.loopexit, label %cond.false.prol, !llvm.loop !22 cond.false.prol.loopexit: ; preds = %cond.false.prol, %cond.false.preheader %div.lcssa.unr = phi i64 [ undef, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %i.tr7.unr = phi i64 [ %i, %cond.false.preheader ], [ %sub.prol, %cond.false.prol ] %n.tr6.unr = phi i64 [ %n, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %2 = icmp ult i64 %1, 3 br i1 %2, label %cond.true, label %cond.false cond.true: ; preds = %cond.false.prol.loopexit, %cond.false, %entry %n.tr.lcssa = phi i64 [ %n, %entry ], [ %div.lcssa.unr, %cond.false.prol.loopexit ], [ %div.3, %cond.false ] %rem = srem i64 %n.tr.lcssa, %a ret i64 %rem cond.false: ; preds = %cond.false.prol.loopexit, %cond.false %i.tr7 = phi i64 [ %sub.3, %cond.false ], [ %i.tr7.unr, %cond.false.prol.loopexit ] %n.tr6 = phi i64 [ %div.3, %cond.false ], [ %n.tr6.unr, %cond.false.prol.loopexit ] %div = sdiv i64 %n.tr6, %a %div.1 = sdiv i64 %div, %a %div.2 = sdiv i64 %div.1, %a %div.3 = sdiv i64 %div.2, %a %sub.3 = add nsw i64 %i.tr7, -4 %cmp.3 = icmp eq i64 %sub.3, 1 br i1 %cmp.3, label %cond.true, label %cond.false } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr1(i64 noundef %x, i64 noundef %n) local_unnamed_addr #6 { entry: %cmp = icmp sgt i64 %x, -1 %cmp1 = icmp slt i64 %x, %n %.not = and i1 %cmp, %cmp1 %conv = zext i1 %.not to i64 ret i64 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr2(i64 noundef %y, i64 noundef %x, i64 noundef %h, i64 noundef %w) local_unnamed_addr #6 { entry: %cmp = icmp slt i64 %y, 0 br i1 %cmp, label %lor.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp1 = icmp sge i64 %y, %h %cmp3 = icmp slt i64 %x, 0 %or.cond = or i1 %cmp3, %cmp1 br i1 %or.cond, label %lor.end, label %lor.rhs lor.rhs: ; preds = %lor.lhs.false %cmp4 = icmp slt i64 %x, %w %0 = zext i1 %cmp4 to i64 br label %lor.end lor.end: ; preds = %lor.rhs, %lor.lhs.false, %entry %not. = phi i64 [ 0, %lor.lhs.false ], [ 0, %entry ], [ %0, %lor.rhs ] ret i64 %not. } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #6 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #6 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !25 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !26 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #7 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !25 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !26 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @factor_pre() local_unnamed_addr #9 { entry: %0 = load i64, ptr @is_factor_prepared, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_factor_prepared, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.body6.peel.next, label %return for.body6.peel.next: ; preds = %entry %1 = tail call ptr @llvm.stacksave.p0() %vla116 = alloca [500001 x i64], align 16 store i64 2, ptr %vla116, align 16, !tbaa !5 br label %vector.body vector.body: ; preds = %vector.body, %for.body6.peel.next %index = phi i64 [ 0, %for.body6.peel.next ], [ %index.next.1, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 1, i64 2>, %for.body6.peel.next ], [ %vec.ind.next.1, %vector.body ] %offset.idx = or i64 %index, 1 %2 = shl nuw nsw <2 x i64> %vec.ind, <i64 1, i64 1> %step.add = shl <2 x i64> %vec.ind, <i64 1, i64 1> %3 = or <2 x i64> %2, <i64 1, i64 1> %4 = add <2 x i64> %step.add, <i64 5, i64 5> %5 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx store <2 x i64> %3, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds i64, ptr %5, i64 2 store <2 x i64> %4, ptr %6, align 8, !tbaa !5 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %offset.idx.1 = or i64 %index, 5 %7 = shl nuw nsw <2 x i64> %vec.ind.next, <i64 1, i64 1> %step.add.1 = shl <2 x i64> %vec.ind.next, <i64 1, i64 1> %8 = or <2 x i64> %7, <i64 1, i64 1> %9 = add <2 x i64> %step.add.1, <i64 5, i64 5> %10 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx.1 store <2 x i64> %8, ptr %10, align 8, !tbaa !5 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> %9, ptr %11, align 8, !tbaa !5 %index.next.1 = add nuw nsw i64 %index, 8 %vec.ind.next.1 = add <2 x i64> %vec.ind, <i64 8, i64 8> %12 = icmp eq i64 %index.next.1, 500000 br i1 %12, label %for.body16, label %vector.body, !llvm.loop !27 for.body16: ; preds = %vector.body, %for.inc43 %i12.0124 = phi i64 [ %inc44, %for.inc43 ], [ 1, %vector.body ] %arrayidx17 = getelementptr inbounds i64, ptr %vla116, i64 %i12.0124 %13 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %tobool18.not = icmp eq i64 %13, 0 br i1 %tobool18.not, label %for.inc43, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body16 %mul21 = shl nuw nsw i64 %i12.0124, 1 %add22 = or i64 %mul21, 1 %div = udiv i64 500001, %add22 %cmp24.not122 = icmp ugt i64 %add22, 166667 br i1 %cmp24.not122, label %for.inc43, label %for.body26 for.body26: ; preds = %for.cond20.preheader, %for.inc38 %j.0123 = phi i64 [ %add39, %for.inc38 ], [ 3, %for.cond20.preheader ] %mul29 = mul nuw nsw i64 %j.0123, %add22 %cmp30 = icmp ult i64 %mul29, 500001 br i1 %cmp30, label %if.then31, label %for.inc38 if.then31: ; preds = %for.body26 %14 = trunc i64 %mul29 to i32 %div35.lhs.trunc = add nsw i32 %14, -1 %div35120 = sdiv i32 %div35.lhs.trunc, 2 %div35.sext = zext i32 %div35120 to i64 %arrayidx36 = getelementptr inbounds i64, ptr %vla116, i64 %div35.sext store i64 0, ptr %arrayidx36, align 8, !tbaa !5 br label %for.inc38 for.inc38: ; preds = %for.body26, %if.then31 %add39 = add nuw nsw i64 %j.0123, 2 %cmp24.not = icmp ugt i64 %add39, %div br i1 %cmp24.not, label %for.inc43, label %for.body26, !llvm.loop !29 for.inc43: ; preds = %for.inc38, %for.cond20.preheader, %for.body16 %inc44 = add nuw nsw i64 %i12.0124, 1 %exitcond128.not = icmp eq i64 %inc44, 500001 br i1 %exitcond128.not, label %for.body51, label %for.body16, !llvm.loop !30 for.cond.cleanup50: ; preds = %for.inc83 tail call void @llvm.stackrestore.p0(ptr %1) br label %return for.body51: ; preds = %for.inc43, %for.inc83 %i47.0126 = phi i64 [ %inc84, %for.inc83 ], [ 0, %for.inc43 ] %arrayidx52 = getelementptr inbounds i64, ptr %vla116, i64 %i47.0126 %15 = load i64, ptr %arrayidx52, align 8, !tbaa !5 %tobool53.not = icmp eq i64 %15, 0 br i1 %tobool53.not, label %for.inc83, label %cond.end75.1 cond.end75.1: ; preds = %for.body51 %16 = load ptr, ptr @factors, align 16, !tbaa !31 %17 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %add61 = shl i64 %17, 3 %mul62 = add i64 %add61, 8 %call = tail call ptr @realloc(ptr noundef %16, i64 noundef %mul62) #26 store ptr %call, ptr @factors, align 16, !tbaa !31 %18 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77 = getelementptr inbounds i64, ptr %call, i64 %18 store i64 %15, ptr %arrayidx77, align 8, !tbaa !5 %19 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %add61.1 = shl i64 %18, 3 %mul62.1 = add i64 %add61.1, 8 %call.1 = tail call ptr @realloc(ptr noundef %19, i64 noundef %mul62.1) #26 store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %20 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc73.1 = add nsw i64 %20, 1 store i64 %inc73.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77.1 = getelementptr inbounds i64, ptr %call.1, i64 %20 store i64 0, ptr %arrayidx77.1, align 8, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %cond.end75.1, %for.body51 %inc84 = add nuw nsw i64 %i47.0126, 1 %exitcond129.not = icmp eq i64 %inc84, 500001 br i1 %exitcond129.not, label %for.cond.cleanup50, label %for.body51, !llvm.loop !33 return: ; preds = %entry, %for.cond.cleanup50 ret i64 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #10 ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #11 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #10 ; Function Attrs: nounwind uwtable define dso_local i64 @factor(i64 noundef %n, i64 noundef %new_common_plus) local_unnamed_addr #9 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp52 = icmp sgt i64 %0, 0 br i1 %cmp52, label %for.cond1.preheader.lr.ph, label %cleanup30 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8 br label %for.cond1.preheader for.cond: ; preds = %cond.end22 %inc29 = add nuw nsw i64 %i.054, 1 %3 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp = icmp slt i64 %inc29, %3 br i1 %cmp, label %for.cond1.preheader, label %cleanup30, !llvm.loop !34 for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond %i.054 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %inc29, %for.cond ] %n.addr.053 = phi i64 [ %n, %for.cond1.preheader.lr.ph ], [ %n.addr.3, %for.cond ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.054 %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %for.cond1.preheader, %land.rhs %n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.053, %for.cond1.preheader ] %cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ] %rem = srem i64 %n.addr.2, %4 %div = sdiv i64 %n.addr.2, %4 %cmp5 = icmp eq i64 %rem, 0 %conv = zext i1 %cmp5 to i64 %add = add nuw nsw i64 %cnt.1, %conv %tobool.not = icmp eq i64 %add, 0 br i1 %tobool.not, label %for.inc, label %land.rhs land.rhs: ; preds = %while.cond %rem8 = srem i64 %div, %4 %cmp9 = icmp eq i64 %rem8, 0 br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !35 for.inc: ; preds = %land.rhs, %while.cond %n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ] switch i64 %new_common_plus, label %cond.false18 [ i64 1, label %cond.end22 i64 2, label %cond.true15 ] cond.true15: ; preds = %for.inc %arrayidx16 = getelementptr inbounds i64, ptr %2, i64 %i.054 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %5, i64 %add) br label %cond.end22 cond.false18: ; preds = %for.inc %arrayidx19 = getelementptr inbounds i64, ptr %2, i64 %i.054 %6 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add20 = add nsw i64 %6, %add br label %cond.end22 cond.end22: ; preds = %for.inc, %cond.true15, %cond.false18 %cond23 = phi i64 [ %cond.i, %cond.true15 ], [ %add20, %cond.false18 ], [ %add, %for.inc ] %arrayidx24 = getelementptr inbounds i64, ptr %2, i64 %i.054 store i64 %cond23, ptr %arrayidx24, align 8, !tbaa !5 %7 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp26.not = icmp sgt i64 %7, %n.addr.3 br i1 %cmp26.not, label %cleanup30, label %for.cond cleanup30: ; preds = %cond.end22, %for.cond, %entry %n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3, %for.cond ], [ %n.addr.3, %cond.end22 ] ret i64 %n.addr.4 } ; Function Attrs: nounwind uwtable define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #9 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %0, 0 br i1 %cmp20, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.else %i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ] %n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %2, %2 %cmp2 = icmp slt i64 %n.addr.021, %mul %cmp4 = icmp eq i64 %n.addr.021, %2 %or.cond = or i1 %cmp4, %cmp2 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %for.body %rem = srem i64 %n.addr.021, %2 %cmp6 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021 %inc = add nuw nsw i64 %i.022, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !36 cleanup: ; preds = %if.else, %for.body, %entry %n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ] %cmp9 = icmp ne i64 %n.addr.0.lcssa, 1 %conv = zext i1 %cmp9 to i64 ret i64 %conv } ; Function Attrs: nounwind uwtable define dso_local i64 @makeinv(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #9 { entry: %0 = load i64, ptr @is_minv_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_minv_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #26 store ptr %call, ptr @inv_arr, align 8, !tbaa !31 %2 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call2 = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %2, i64 noundef 16) #26 store ptr %call2, ptr @finv_arr, align 8, !tbaa !31 %3 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %3, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 %arrayidx3 = getelementptr inbounds i64, ptr %call2, i64 1 store i64 1, ptr %arrayidx3, align 8, !tbaa !5 store i64 1, ptr %call2, align 8, !tbaa !5 %cmp7.not43 = icmp slt i64 %n, 2 br i1 %cmp7.not43, label %return, label %for.body9 for.body9: ; preds = %for.end, %for.body9 %4 = phi ptr [ %6, %for.body9 ], [ %3, %for.end ] %i5.044 = phi i64 [ %add10, %for.body9 ], [ 2, %for.end ] %add10 = add nuw nsw i64 %i5.044, 1 %mul = shl i64 %add10, 3 %call11 = tail call ptr @realloc(ptr noundef nonnull %4, i64 noundef %mul) #26 store ptr %call11, ptr @inv_arr, align 8, !tbaa !31 %5 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call14 = tail call ptr @realloc(ptr noundef %5, i64 noundef %mul) #26 store ptr %call14, ptr @finv_arr, align 8, !tbaa !31 %6 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %rem = srem i64 %mod, %i5.044 %arrayidx15 = getelementptr inbounds i64, ptr %6, i64 %rem %7 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %div = sdiv i64 %mod, %i5.044 %mul16 = mul nsw i64 %div, %7 %rem17 = srem i64 %mul16, %mod %sub = sub nsw i64 %mod, %rem17 %arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %i5.044 store i64 %sub, ptr %arrayidx18, align 8, !tbaa !5 %8 = getelementptr i64, ptr %call14, i64 %i5.044 %arrayidx20 = getelementptr i64, ptr %8, i64 -1 %9 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %mul22 = mul nsw i64 %9, %sub %rem23 = srem i64 %mul22, %mod store i64 %rem23, ptr %8, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i5.044, %n br i1 %exitcond.not, label %return, label %for.body9, !llvm.loop !37 return: ; preds = %for.body9, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @make_mf(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #9 { entry: %0 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @mf_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #26 store ptr %call, ptr @mf_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %call, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 store i64 1, ptr %call, align 8, !tbaa !5 %cmp5.not24 = icmp slt i64 %n, 2 br i1 %cmp5.not24, label %return, label %for.body7 for.body7: ; preds = %for.end, %for.body7 %2 = phi ptr [ %call10, %for.body7 ], [ %call, %for.end ] %i3.026 = phi i64 [ %add8, %for.body7 ], [ 2, %for.end ] %x.025 = phi i64 [ %rem, %for.body7 ], [ 1, %for.end ] %mul = mul nsw i64 %i3.026, %x.025 %rem = srem i64 %mul, %mod %add8 = add nuw nsw i64 %i3.026, 1 %mul9 = shl i64 %add8, 3 %call10 = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9) #26 %arrayidx11 = getelementptr inbounds i64, ptr %call10, i64 %i3.026 store i64 %rem, ptr %arrayidx11, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i3.026, %n br i1 %exitcond.not, label %return.loopexit, label %for.body7, !llvm.loop !38 return.loopexit: ; preds = %for.body7 store ptr %call10, ptr @mf_arr, align 8, !tbaa !31 br label %return return: ; preds = %return.loopexit, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @m_inv(i64 noundef %x, i64 noundef %mod, i64 noundef %is_fac) local_unnamed_addr #9 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call = tail call i64 @makeinv(i64 noundef %0, i64 noundef %mod) %tobool.not = icmp eq i64 %is_fac, 0 %inv_arr.val = load ptr, ptr @inv_arr, align 8 %finv_arr.val = load ptr, ptr @finv_arr, align 8 %.pn = select i1 %tobool.not, ptr %inv_arr.val, ptr %finv_arr.val %cond.in = getelementptr inbounds i64, ptr %.pn, i64 %x %cond = load i64, ptr %cond.in, align 8, !tbaa !5 ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @m_f(i64 noundef %x, i64 noundef %mod) local_unnamed_addr #9 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i = add nsw i64 %1, 1 store i64 %inc.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %1, 0 %.pre = load ptr, ptr @mf_arr, align 8, !tbaa !31 br i1 %tobool.not.i, label %for.end.i, label %make_mf.exit for.end.i: ; preds = %entry %call.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre, i64 noundef 16) #26 store ptr %call.i, ptr @mf_arr, align 8, !tbaa !31 %arrayidx.i = getelementptr inbounds i64, ptr %call.i, i64 1 store i64 1, ptr %arrayidx.i, align 8, !tbaa !5 store i64 1, ptr %call.i, align 8, !tbaa !5 %cmp5.not24.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i, label %make_mf.exit, label %for.body7.i for.body7.i: ; preds = %for.end.i, %for.body7.i %2 = phi ptr [ %call10.i, %for.body7.i ], [ %call.i, %for.end.i ] %i3.026.i = phi i64 [ %add8.i, %for.body7.i ], [ 2, %for.end.i ] %x.025.i = phi i64 [ %rem.i, %for.body7.i ], [ 1, %for.end.i ] %mul.i = mul nsw i64 %x.025.i, %i3.026.i %rem.i = srem i64 %mul.i, %mod %add8.i = add nuw nsw i64 %i3.026.i, 1 %mul9.i = shl i64 %add8.i, 3 %call10.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i) #26 %arrayidx11.i = getelementptr inbounds i64, ptr %call10.i, i64 %i3.026.i store i64 %rem.i, ptr %arrayidx11.i, align 8, !tbaa !5 %exitcond.not.i = icmp eq i64 %i3.026.i, %0 br i1 %exitcond.not.i, label %return.loopexit.i, label %for.body7.i, !llvm.loop !38 return.loopexit.i: ; preds = %for.body7.i store ptr %call10.i, ptr @mf_arr, align 8, !tbaa !31 br label %make_mf.exit make_mf.exit: ; preds = %entry, %for.end.i, %return.loopexit.i %3 = phi ptr [ %.pre, %entry ], [ %call.i, %for.end.i ], [ %call10.i, %return.loopexit.i ] %arrayidx = getelementptr inbounds i64, ptr %3, i64 %x %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 ret i64 %4 } ; Function Attrs: nounwind uwtable define dso_local i64 @mod_nck(i64 noundef %n, i64 noundef %k, i64 noundef %mod) local_unnamed_addr #9 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i.i = add nsw i64 %1, 1 store i64 %inc.i.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i.i = icmp eq i64 %1, 0 %.pre.i = load ptr, ptr @mf_arr, align 8, !tbaa !31 br i1 %tobool.not.i.i, label %for.end.i.i, label %m_f.exit for.end.i.i: ; preds = %entry %call.i.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre.i, i64 noundef 16) #26 store ptr %call.i.i, ptr @mf_arr, align 8, !tbaa !31 %arrayidx.i.i = getelementptr inbounds i64, ptr %call.i.i, i64 1 store i64 1, ptr %arrayidx.i.i, align 8, !tbaa !5 store i64 1, ptr %call.i.i, align 8, !tbaa !5 %cmp5.not24.i.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i.i, label %m_f.exit, label %for.body7.i.i for.body7.i.i: ; preds = %for.end.i.i, %for.body7.i.i %2 = phi ptr [ %call10.i.i, %for.body7.i.i ], [ %call.i.i, %for.end.i.i ] %i3.026.i.i = phi i64 [ %add8.i.i, %for.body7.i.i ], [ 2, %for.end.i.i ] %x.025.i.i = phi i64 [ %rem.i.i, %for.body7.i.i ], [ 1, %for.end.i.i ] %mul.i.i = mul nsw i64 %x.025.i.i, %i3.026.i.i %rem.i.i = srem i64 %mul.i.i, %mod %add8.i.i = add nuw nsw i64 %i3.026.i.i, 1 %mul9.i.i = shl i64 %add8.i.i, 3 %call10.i.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i.i) #26 %arrayidx11.i.i = getelementptr inbounds i64, ptr %call10.i.i, i64 %i3.026.i.i store i64 %rem.i.i, ptr %arrayidx11.i.i, align 8, !tbaa !5 %exitcond.not.i.i = icmp eq i64 %i3.026.i.i, %0 br i1 %exitcond.not.i.i, label %return.loopexit.i.i, label %for.body7.i.i, !llvm.loop !38 return.loopexit.i.i: ; preds = %for.body7.i.i store ptr %call10.i.i, ptr @mf_arr, align 8, !tbaa !31 br label %m_f.exit m_f.exit: ; preds = %entry, %for.end.i.i, %return.loopexit.i.i %3 = phi ptr [ %.pre.i, %entry ], [ %call.i.i, %for.end.i.i ], [ %call10.i.i, %return.loopexit.i.i ] %arrayidx.i = getelementptr inbounds i64, ptr %3, i64 %n %4 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %5 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i = tail call i64 @makeinv(i64 noundef %5, i64 noundef %mod) %finv_arr.val.i = load ptr, ptr @finv_arr, align 8 %cond.in.i = getelementptr inbounds i64, ptr %finv_arr.val.i, i64 %k %cond.i = load i64, ptr %cond.in.i, align 8, !tbaa !5 %mul = mul nsw i64 %cond.i, %4 %rem = srem i64 %mul, %mod %sub = sub nsw i64 %n, %k %6 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i11 = tail call i64 @makeinv(i64 noundef %6, i64 noundef %mod) %finv_arr.val.i13 = load ptr, ptr @finv_arr, align 8 %cond.in.i14 = getelementptr inbounds i64, ptr %finv_arr.val.i13, i64 %sub %cond.i15 = load i64, ptr %cond.in.i14, align 8, !tbaa !5 %mul3 = mul nsw i64 %cond.i15, %rem %rem4 = srem i64 %mul3, %mod ret i64 %rem4 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @m_p(i64 noundef %r, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #5 { entry: %cmp16 = icmp sgt i64 %n, 0 br i1 %cmp16, label %while.body, label %while.end while.body: ; preds = %entry, %cond.end %s.019 = phi i64 [ %rem2, %cond.end ], [ %r, %entry ] %t.018 = phi i64 [ %cond, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %shr, %cond.end ], [ %n, %entry ] %and = and i64 %n.addr.017, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.true: ; preds = %while.body %mul = mul nsw i64 %s.019, %t.018 %rem = srem i64 %mul, %mod br label %cond.end cond.end: ; preds = %while.body, %cond.true %cond = phi i64 [ %rem, %cond.true ], [ %t.018, %while.body ] %mul1 = mul nsw i64 %s.019, %s.019 %rem2 = srem i64 %mul1, %mod %shr = lshr i64 %n.addr.017, 1 %cmp.not = icmp ult i64 %n.addr.017, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !39 while.end: ; preds = %cond.end, %entry %t.0.lcssa = phi i64 [ 1, %entry ], [ %cond, %cond.end ] %tobool3.not = icmp eq i64 %r, 0 %cond7 = select i1 %tobool3.not, i64 0, i64 %t.0.lcssa ret i64 %cond7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul2(i64 noundef %a, i64 noundef %b, i64 noundef %mod) local_unnamed_addr #6 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul3(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %mod) local_unnamed_addr #6 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod ret i64 %rem.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul4(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %mod) local_unnamed_addr #6 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod ret i64 %rem.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul5(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %e, i64 noundef %mod) local_unnamed_addr #6 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod %mul.i.i.i = mul nsw i64 %rem.i.i, %e %rem.i.i.i = srem i64 %mul.i.i.i, %mod ret i64 %rem.i.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #12 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #12 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #27 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #14 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #12 { entry: %0 = load i8, ptr %a, align 1, !tbaa !21 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !21 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #28 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #28 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #1 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #28 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #27 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #28 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #14 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #16 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #27 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !40 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #7 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !41 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !42 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #12 { entry: %0 = load i64, ptr %p, align 8, !tbaa !43 %1 = load i64, ptr %q, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #12 { entry: %0 = load i64, ptr %q, align 8, !tbaa !43 %1 = load i64, ptr %p, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #28 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #28 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_partial(ptr nocapture noundef %a, i32 noundef %begin, i32 noundef %end, i32 noundef %is_increase) local_unnamed_addr #1 { entry: %sub = sub nsw i32 %end, %begin %conv = sext i32 %sub to i64 %mul = shl nsw i64 %conv, 3 %call = tail call noalias ptr @malloc(i64 noundef %mul) #29 %cmp45 = icmp slt i32 %begin, %end br i1 %cmp45, label %for.body.preheader, label %for.cond.cleanup15.critedge for.body.preheader: ; preds = %entry %conv2 = sext i32 %end to i64 %conv1 = sext i32 %begin to i64 %0 = shl nsw i64 %conv1, 3 %scevgep = getelementptr i8, ptr %a, i64 %0 %1 = sub nsw i64 %conv2, %conv1 %2 = shl nsw i64 %1, 3 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %call, ptr align 8 %scevgep, i64 %2, i1 false), !tbaa !5 %tobool.not = icmp eq i32 %is_increase, 0 %downll.upll = select i1 %tobool.not, ptr @downll, ptr @upll tail call void @qsort(ptr noundef %call, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull %downll.upll) #28 %3 = shl nsw i64 %conv1, 3 %scevgep49 = getelementptr i8, ptr %a, i64 %3 %4 = sub nsw i64 %conv2, %conv1 %5 = shl nsw i64 %4, 3 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep49, ptr align 8 %call, i64 %5, i1 false), !tbaa !5 br label %for.cond.cleanup15 for.cond.cleanup15.critedge: ; preds = %entry %tobool.not.c = icmp eq i32 %is_increase, 0 %downll.upll.c = select i1 %tobool.not.c, ptr @downll, ptr @upll tail call void @qsort(ptr noundef %call, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull %downll.upll.c) #28 br label %for.cond.cleanup15 for.cond.cleanup15: ; preds = %for.cond.cleanup15.critedge, %for.body.preheader ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #17 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @AVL_set_inside_rotate(ptr nocapture noundef %node, i32 noundef %is_right) local_unnamed_addr #18 { entry: %cmp = icmp eq i32 %is_right, 0 %cmp1 = icmp eq i32 %is_right, 1 %cond = select i1 %cmp, i32 -1, i32 1 %0 = load ptr, ptr %node, align 8, !tbaa !31 %idxprom = zext i1 %cmp to i64 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom %1 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %cmp3.not = icmp eq ptr %1, null br i1 %cmp3.not, label %if.end43, label %if.then if.then: ; preds = %entry %diff = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 1 %2 = load i32, ptr %diff, align 8, !tbaa !45 %mul = mul nsw i32 %2, %cond %diff8 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 1 %3 = load i32, ptr %diff8, align 8, !tbaa !45 %mul9 = mul nsw i32 %3, %cond %tobool10.not = icmp eq i32 %mul9, -1 br i1 %tobool10.not, label %if.else, label %if.then11 if.then11: ; preds = %if.then %4 = xor i32 %mul9, -1 %tobool14.not = icmp eq i32 %2, %3 %sub15 = add nsw i32 %mul9, -1 %sub16 = add nsw i32 %mul, -2 %cond17 = select i1 %tobool14.not, i32 %sub16, i32 %sub15 br label %if.end if.else: ; preds = %if.then %tobool19.not = icmp eq i32 %2, 0 %cond26 = select i1 %tobool19.not, i32 -3, i32 -2 br label %if.end if.end: ; preds = %if.else, %if.then11 %.pn = phi i32 [ %4, %if.then11 ], [ -1, %if.else ] %nb.0 = phi i32 [ %cond17, %if.then11 ], [ %cond26, %if.else ] %na.0 = add i32 %.pn, %mul %mul27 = mul nsw i32 %na.0, %cond store i32 %mul27, ptr %diff, align 8, !tbaa !45 %mul29 = mul nsw i32 %nb.0, %cond store i32 %mul29, ptr %diff8, align 8, !tbaa !45 %idxprom35 = zext i1 %cmp1 to i64 %arrayidx36 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 3, i64 %idxprom35 %5 = load ptr, ptr %arrayidx36, align 8, !tbaa !31 store ptr %5, ptr %arrayidx, align 8, !tbaa !31 %6 = load ptr, ptr %node, align 8, !tbaa !31 store ptr %6, ptr %arrayidx36, align 8, !tbaa !31 store ptr %1, ptr %node, align 8, !tbaa !31 br label %if.end43 if.end43: ; preds = %if.end, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @AVL_set_inside_update(ptr nocapture noundef %node, i64 noundef %data, i32 noundef %add) local_unnamed_addr #9 { entry: %0 = load ptr, ptr %node, align 8, !tbaa !31 %cmp = icmp eq ptr %0, null br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %cmp1 = icmp eq i32 %add, 2 br i1 %cmp1, label %if.then2, label %return if.then2: ; preds = %if.then %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #29 store ptr %call, ptr %node, align 8, !tbaa !31 store i64 %data, ptr %call, align 8, !tbaa !47 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 2 store i32 1, ptr %cnt, align 4, !tbaa !48 %diff = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 1 store i32 0, ptr %diff, align 8, !tbaa !45 %child = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 3 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %child, i8 0, i64 16, i1 false) br label %return if.else: ; preds = %entry %1 = load i64, ptr %0, align 8, !tbaa !47 %cmp8 = icmp eq i64 %1, %data br i1 %cmp8, label %if.then10, label %if.else56 if.then10: ; preds = %if.else switch i32 %add, label %land.lhs.true [ i32 2, label %if.then13 i32 0, label %if.else21 ] if.then13: ; preds = %if.then10 %cnt14 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %2 = load i32, ptr %cnt14, align 4, !tbaa !48 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %cnt14, align 4, !tbaa !48 br label %return land.lhs.true: ; preds = %if.then10 %cnt16 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %3 = load i32, ptr %cnt16, align 4, !tbaa !48 %cmp17 = icmp sgt i32 %3, 1 br i1 %cmp17, label %if.then19, label %if.else21 if.then19: ; preds = %land.lhs.true %dec = add nsw i32 %3, -1 store i32 %dec, ptr %cnt16, align 4, !tbaa !48 br label %return if.else21: ; preds = %if.then10, %land.lhs.true %child22 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3 %arrayidx23 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 1 %4 = load ptr, ptr %arrayidx23, align 8, !tbaa !31 %cmp24 = icmp eq ptr %4, null %5 = load ptr, ptr %child22, align 8, !tbaa !31 br i1 %cmp24, label %if.then26, label %if.else29 if.then26: ; preds = %if.else21 tail call void @free(ptr noundef nonnull %0) #28 store ptr %5, ptr %node, align 8, !tbaa !31 br label %return if.else29: ; preds = %if.else21 %cmp32 = icmp eq ptr %5, null br i1 %cmp32, label %if.then34, label %for.cond if.then34: ; preds = %if.else29 tail call void @free(ptr noundef nonnull %0) #28 store ptr %4, ptr %node, align 8, !tbaa !31 br label %return for.cond: ; preds = %if.else29, %for.cond %next_node.0 = phi ptr [ %6, %for.cond ], [ %5, %if.else29 ] %arrayidx41 = getelementptr inbounds %struct.node_AVL_set, ptr %next_node.0, i64 0, i32 3, i64 1 %6 = load ptr, ptr %arrayidx41, align 8, !tbaa !31 %cmp42.not = icmp eq ptr %6, null br i1 %cmp42.not, label %for.end, label %for.cond, !llvm.loop !49 for.end: ; preds = %for.cond %7 = load i64, ptr %next_node.0, align 8, !tbaa !47 store i64 %7, ptr %0, align 8, !tbaa !47 %8 = load i64, ptr %next_node.0, align 8, !tbaa !47 %call51 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %child22, i64 noundef %8, i32 noundef %add), !range !50 br label %if.end69 if.else56: ; preds = %if.else %cmp58.not = icmp sle i64 %1, %data %cmp62 = icmp sgt i64 %1, %data %cond64 = select i1 %cmp62, i32 1, i32 -1 %idxprom66 = zext i1 %cmp58.not to i64 %arrayidx67 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom66 %call68 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx67, i64 noundef %data, i32 noundef %add), !range !50 br label %if.end69 if.end69: ; preds = %if.else56, %for.end %delta.0 = phi i32 [ %call51, %for.end ], [ %call68, %if.else56 ] %delta_sign.0 = phi i32 [ 1, %for.end ], [ %cond64, %if.else56 ] %tobool70.not = icmp eq i32 %delta.0, 0 br i1 %tobool70.not, label %return, label %if.then71 if.then71: ; preds = %if.end69 %9 = load ptr, ptr %node, align 8, !tbaa !31 %diff72 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 1 %10 = load i32, ptr %diff72, align 8, !tbaa !45 %mul = mul nsw i32 %delta_sign.0, %delta.0 %add74 = add nsw i32 %10, %mul store i32 %add74, ptr %diff72, align 8, !tbaa !45 %cmp76 = icmp sgt i32 %add74, 1 br i1 %cmp76, label %if.then87, label %if.else79 if.else79: ; preds = %if.then71 %cmp81 = icmp slt i32 %add74, -1 br i1 %cmp81, label %if.then87, label %if.end110 if.then87: ; preds = %if.else79, %if.then71 %rotate_l.0.ph = phi i64 [ 0, %if.then71 ], [ 1, %if.else79 ] %diff_sign.0.ph = phi i32 [ 1, %if.then71 ], [ -1, %if.else79 ] %cmp.i197 = xor i1 %cmp76, true %arrayidx90 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 3, i64 %rotate_l.0.ph %11 = load ptr, ptr %arrayidx90, align 8, !tbaa !31 %diff91 = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 1 %12 = load i32, ptr %diff91, align 8, !tbaa !45 %mul96 = mul nsw i32 %12, %diff_sign.0.ph %cmp97 = icmp slt i32 %mul96, 0 br i1 %cmp97, label %if.then99, label %if.end104 if.then99: ; preds = %if.then87 %cond.i = select i1 %cmp76, i32 -1, i32 1 %idxprom.i = zext i1 %cmp76 to i64 %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 3, i64 %idxprom.i %13 = load ptr, ptr %arrayidx.i, align 8, !tbaa !31 %cmp3.not.i = icmp eq ptr %13, null br i1 %cmp3.not.i, label %if.end104, label %if.then.i if.then.i: ; preds = %if.then99 %mul.i = mul nsw i32 %12, %cond.i %diff8.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 1 %14 = load i32, ptr %diff8.i, align 8, !tbaa !45 %mul9.i = mul nsw i32 %14, %cond.i %tobool10.not.i = icmp eq i32 %mul9.i, -1 br i1 %tobool10.not.i, label %if.else.i, label %if.then11.i if.then11.i: ; preds = %if.then.i %15 = xor i32 %mul9.i, -1 %tobool14.not.i = icmp eq i32 %12, %14 %sub15.i = add nsw i32 %mul9.i, -1 %sub16.i = add nsw i32 %mul.i, -2 %cond17.i = select i1 %tobool14.not.i, i32 %sub16.i, i32 %sub15.i br label %if.end.i if.else.i: ; preds = %if.then.i %tobool19.not.i = icmp eq i32 %12, 0 %cond26.i = select i1 %tobool19.not.i, i32 -3, i32 -2 br label %if.end.i if.end.i: ; preds = %if.else.i, %if.then11.i %.pn.i = phi i32 [ %15, %if.then11.i ], [ -1, %if.else.i ] %nb.0.i = phi i32 [ %cond17.i, %if.then11.i ], [ %cond26.i, %if.else.i ] %na.0.i = add i32 %.pn.i, %mul.i %mul27.i = mul nsw i32 %na.0.i, %cond.i store i32 %mul27.i, ptr %diff91, align 8, !tbaa !45 %mul29.i = mul nsw i32 %nb.0.i, %cond.i store i32 %mul29.i, ptr %diff8.i, align 8, !tbaa !45 %idxprom35.i = zext i1 %cmp.i197 to i64 %arrayidx36.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 3, i64 %idxprom35.i %16 = load ptr, ptr %arrayidx36.i, align 8, !tbaa !31 store ptr %16, ptr %arrayidx.i, align 8, !tbaa !31 %17 = load ptr, ptr %arrayidx90, align 8, !tbaa !31 store ptr %17, ptr %arrayidx36.i, align 8, !tbaa !31 store ptr %13, ptr %arrayidx90, align 8, !tbaa !31 %.pre = load ptr, ptr %node, align 8, !tbaa !31 br label %if.end104 if.end104: ; preds = %if.end.i, %if.then99, %if.then87 %18 = phi ptr [ %.pre, %if.end.i ], [ %9, %if.then99 ], [ %9, %if.then87 ] %cond.i199 = select i1 %cmp76, i32 1, i32 -1 %idxprom.i200 = zext i1 %cmp.i197 to i64 %arrayidx.i201 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 3, i64 %idxprom.i200 %19 = load ptr, ptr %arrayidx.i201, align 8, !tbaa !31 %cmp3.not.i202 = icmp eq ptr %19, null br i1 %cmp3.not.i202, label %AVL_set_inside_rotate.exit225, label %if.then.i203 if.then.i203: ; preds = %if.end104 %diff.i204 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 1 %20 = load i32, ptr %diff.i204, align 8, !tbaa !45 %mul.i205 = mul nsw i32 %20, %cond.i199 %diff8.i206 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 1 %21 = load i32, ptr %diff8.i206, align 8, !tbaa !45 %mul9.i207 = mul nsw i32 %21, %cond.i199 %tobool10.not.i208 = icmp eq i32 %mul9.i207, -1 br i1 %tobool10.not.i208, label %if.else.i222, label %if.then11.i209 if.then11.i209: ; preds = %if.then.i203 %22 = xor i32 %mul9.i207, -1 %tobool14.not.i210 = icmp eq i32 %20, %21 %sub15.i211 = add nsw i32 %mul9.i207, -1 %sub16.i212 = add nsw i32 %mul.i205, -2 %cond17.i213 = select i1 %tobool14.not.i210, i32 %sub16.i212, i32 %sub15.i211 br label %if.end.i214 if.else.i222: ; preds = %if.then.i203 %tobool19.not.i223 = icmp eq i32 %20, 0 %cond26.i224 = select i1 %tobool19.not.i223, i32 -3, i32 -2 br label %if.end.i214 if.end.i214: ; preds = %if.else.i222, %if.then11.i209 %.pn.i215 = phi i32 [ %22, %if.then11.i209 ], [ -1, %if.else.i222 ] %nb.0.i216 = phi i32 [ %cond17.i213, %if.then11.i209 ], [ %cond26.i224, %if.else.i222 ] %na.0.i217 = add i32 %.pn.i215, %mul.i205 %mul27.i218 = mul nsw i32 %na.0.i217, %cond.i199 store i32 %mul27.i218, ptr %diff.i204, align 8, !tbaa !45 %mul29.i219 = mul nsw i32 %nb.0.i216, %cond.i199 store i32 %mul29.i219, ptr %diff8.i206, align 8, !tbaa !45 %idxprom35.i220 = zext i1 %cmp76 to i64 %arrayidx36.i221 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 3, i64 %idxprom35.i220 %23 = load ptr, ptr %arrayidx36.i221, align 8, !tbaa !31 store ptr %23, ptr %arrayidx.i201, align 8, !tbaa !31 %24 = load ptr, ptr %node, align 8, !tbaa !31 store ptr %24, ptr %arrayidx36.i221, align 8, !tbaa !31 store ptr %19, ptr %node, align 8, !tbaa !31 br label %AVL_set_inside_rotate.exit225 AVL_set_inside_rotate.exit225: ; preds = %if.end104, %if.end.i214 %cmp105 = icmp slt i32 %delta.0, 0 %cmp107 = icmp ne i32 %12, 0 %25 = and i1 %cmp105, %cmp107 %cond109 = sext i1 %25 to i32 br label %return if.end110: ; preds = %if.else79 %cmp111 = icmp sgt i32 %delta.0, 0 %cmp114 = icmp eq i32 %10, 0 %or.cond = and i1 %cmp111, %cmp114 br i1 %or.cond, label %return, label %if.else117 if.else117: ; preds = %if.end110 %cmp118 = icmp slt i32 %delta.0, 0 %cmp121 = icmp ne i32 %10, 0 %or.cond134 = and i1 %cmp118, %cmp121 %. = sext i1 %or.cond134 to i32 br label %return return: ; preds = %if.then13, %if.then19, %if.then26, %if.then34, %if.else117, %if.end110, %AVL_set_inside_rotate.exit225, %if.end69, %if.then2, %if.then %retval.2 = phi i32 [ 1, %if.then2 ], [ 0, %if.then ], [ 0, %if.then13 ], [ 0, %if.then19 ], [ -1, %if.then26 ], [ -1, %if.then34 ], [ %cond109, %AVL_set_inside_rotate.exit225 ], [ 1, %if.end110 ], [ %., %if.else117 ], [ 0, %if.end69 ] ret i32 %retval.2 } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #19 ; Function Attrs: nofree nounwind uwtable define dso_local void @AVL_set_inside_print(ptr noundef readonly %node, i32 noundef %depth) local_unnamed_addr #1 { entry: %cmp9 = icmp eq ptr %node, null br i1 %cmp9, label %return, label %if.end if.end: ; preds = %entry, %if.end %depth.tr11 = phi i32 [ %add, %if.end ], [ %depth, %entry ] %node.tr10 = phi ptr [ %3, %if.end ], [ %node, %entry ] %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3, i64 1 %0 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %add = add nsw i32 %depth.tr11, 1 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef %add) %1 = load i64, ptr %node.tr10, align 8, !tbaa !47 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 2 %2 = load i32, ptr %cnt, align 4, !tbaa !48 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1, i32 noundef %2) %3 = load ptr, ptr %child, align 8, !tbaa !31 %cmp = icmp eq ptr %3, null br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nounwind uwtable define dso_local void @AVL_set_inside_free(ptr noundef %node) local_unnamed_addr #9 { entry: %cmp = icmp eq ptr %node, null br i1 %cmp, label %common.ret6, label %if.end common.ret6: ; preds = %entry, %if.end ret void if.end: ; preds = %entry %child = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3 %0 = load ptr, ptr %child, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %0) %arrayidx2 = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx2, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %1) tail call void @free(ptr noundef nonnull %node) #28 br label %common.ret6 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_count(ptr noundef readonly %root, i64 noundef %val) local_unnamed_addr #20 { entry: %tobool.not16 = icmp eq ptr %root, null br i1 %tobool.not16, label %cleanup, label %while.body while.body: ; preds = %entry, %if.end8 %node.017 = phi ptr [ %node.1, %if.end8 ], [ %root, %entry ] %0 = load i64, ptr %node.017, align 8, !tbaa !47 %cmp = icmp sgt i64 %0, %val br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3 br label %if.end8 if.else: ; preds = %while.body %cmp3 = icmp slt i64 %0, %val br i1 %cmp3, label %if.then4, label %if.else7 if.then4: ; preds = %if.else %arrayidx6 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3, i64 1 br label %if.end8 if.else7: ; preds = %if.else %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 2 %1 = load i32, ptr %cnt, align 4, !tbaa !48 %conv = sext i32 %1 to i64 br label %cleanup if.end8: ; preds = %if.then4, %if.then %node.1.in = phi ptr [ %child, %if.then ], [ %arrayidx6, %if.then4 ] %node.1 = load ptr, ptr %node.1.in, align 8, !tbaa !31 %tobool.not = icmp eq ptr %node.1, null br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !51 cleanup: ; preds = %if.end8, %entry, %if.else7 %retval.0 = phi i64 [ %conv, %if.else7 ], [ 0, %entry ], [ 0, %if.end8 ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_minmax(ptr nocapture noundef readonly %root, i32 noundef %type) local_unnamed_addr #20 { entry: %idxprom = sext i32 %type to i64 br label %while.cond while.cond: ; preds = %while.cond, %entry %root.addr.0 = phi ptr [ %root, %entry ], [ %0, %while.cond ] %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0, i64 0, i32 3, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %cmp.not = icmp eq ptr %0, null br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !52 while.end: ; preds = %while.cond %1 = load i64, ptr %root.addr.0, align 8, !tbaa !47 ret i64 %1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @AVL_set_inside_swap(ptr nocapture noundef %node1, ptr nocapture noundef %node2) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %node1, align 8, !tbaa !31 %1 = load ptr, ptr %node2, align 8, !tbaa !31 store ptr %1, ptr %node1, align 8, !tbaa !31 store ptr %0, ptr %node2, align 8, !tbaa !31 ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @set_main(i32 noundef %command, i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #9 { entry: %.b114 = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114, label %if.end, label %if.then if.then: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry switch i32 %command, label %return [ i32 -1, label %if.then2 i32 1, label %if.then6 i32 2, label %if.then18 i32 3, label %if.then24 i32 4, label %if.end.if.then40_crit_edge i32 5, label %if.end.if.then49_crit_edge i32 6, label %if.end.if.then58_crit_edge i32 7, label %if.end.if.then63_crit_edge i32 8, label %if.end.if.then69_crit_edge i32 9, label %if.end.if.then75_crit_edge ] if.end.if.then40_crit_edge: ; preds = %if.end %.pre170 = sext i32 %set_num to i64 br label %if.then40 if.end.if.then49_crit_edge: ; preds = %if.end %.pre171 = sext i32 %set_num to i64 br label %if.then49 if.end.if.then58_crit_edge: ; preds = %if.end %.pre172 = sext i32 %set_num to i64 br label %if.then58 if.end.if.then63_crit_edge: ; preds = %if.end %.pre173 = sext i32 %set_num to i64 br label %if.then63 if.end.if.then69_crit_edge: ; preds = %if.end %.pre174 = sext i32 %set_num to i64 br label %if.then69 if.end.if.then75_crit_edge: ; preds = %if.end %.pre175 = sext i32 %set_num to i64 br label %if.then75 if.then2: ; preds = %if.end %idxprom = sext i32 %set_num to i64 %arrayidx3 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx3, align 8, !tbaa !31 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) br label %return if.then6: ; preds = %if.end %idxprom7 = sext i32 %set_num to i64 %arrayidx8 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7 %1 = load ptr, ptr %arrayidx8, align 8, !tbaa !31 %tobool.not16.i = icmp eq ptr %1, null br i1 %tobool.not16.i, label %cond.false, label %while.body.i while.body.i: ; preds = %if.then6, %if.end8.i %node.017.i = phi ptr [ %node.1.i, %if.end8.i ], [ %1, %if.then6 ] %2 = load i64, ptr %node.017.i, align 8, !tbaa !47 %cmp.i = icmp sgt i64 %2, %val br i1 %cmp.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body.i %child.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3 br label %if.end8.i if.else.i: ; preds = %while.body.i %cmp3.i = icmp slt i64 %2, %val br i1 %cmp3.i, label %if.then4.i, label %AVL_set_inside_count.exit if.then4.i: ; preds = %if.else.i %arrayidx6.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3, i64 1 br label %if.end8.i if.end8.i: ; preds = %if.then4.i, %if.then.i %node.1.in.i = phi ptr [ %child.i, %if.then.i ], [ %arrayidx6.i, %if.then4.i ] %node.1.i = load ptr, ptr %node.1.in.i, align 8, !tbaa !31 %tobool.not.i = icmp eq ptr %node.1.i, null br i1 %tobool.not.i, label %cond.false, label %while.body.i, !llvm.loop !51 AVL_set_inside_count.exit: ; preds = %if.else.i %cnt.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i, align 4, !tbaa !48 %tobool9.not = icmp eq i32 %3, 0 br i1 %tobool9.not, label %cond.false, label %cond.end cond.false: ; preds = %if.end8.i, %if.then6, %AVL_set_inside_count.exit %arrayidx11 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7 %4 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %inc12 = add nsw i64 %4, 1 store i64 %inc12, ptr %arrayidx11, align 8, !tbaa !5 br label %cond.end cond.end: ; preds = %AVL_set_inside_count.exit, %cond.false %call15 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8, i64 noundef %val, i32 noundef 2), !range !50 br label %return if.then18: ; preds = %if.end %.pre = sext i32 %set_num to i64 %arrayidx20 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre %5 = load ptr, ptr %arrayidx20, align 8, !tbaa !31 %tobool.not16.i115 = icmp eq ptr %5, null br i1 %tobool.not16.i115, label %return, label %while.body.i116 while.body.i116: ; preds = %if.then18, %if.end8.i127 %node.017.i117 = phi ptr [ %node.1.i129, %if.end8.i127 ], [ %5, %if.then18 ] %6 = load i64, ptr %node.017.i117, align 8, !tbaa !47 %cmp.i118 = icmp sgt i64 %6, %val br i1 %cmp.i118, label %if.then.i131, label %if.else.i119 if.then.i131: ; preds = %while.body.i116 %child.i132 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 3 br label %if.end8.i127 if.else.i119: ; preds = %while.body.i116 %cmp3.i120 = icmp slt i64 %6, %val br i1 %cmp3.i120, label %if.then4.i125, label %if.else7.i121 if.then4.i125: ; preds = %if.else.i119 %arrayidx6.i126 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 3, i64 1 br label %if.end8.i127 if.else7.i121: ; preds = %if.else.i119 %cnt.i122 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 2 %7 = load i32, ptr %cnt.i122, align 4, !tbaa !48 %conv.i123 = sext i32 %7 to i64 br label %return if.end8.i127: ; preds = %if.then4.i125, %if.then.i131 %node.1.in.i128 = phi ptr [ %child.i132, %if.then.i131 ], [ %arrayidx6.i126, %if.then4.i125 ] %node.1.i129 = load ptr, ptr %node.1.in.i128, align 8, !tbaa !31 %tobool.not.i130 = icmp eq ptr %node.1.i129, null br i1 %tobool.not.i130, label %return, label %while.body.i116, !llvm.loop !51 if.then24: ; preds = %if.end %.pre169 = sext i32 %set_num to i64 %arrayidx26 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre169 %8 = load ptr, ptr %arrayidx26, align 8, !tbaa !31 %tobool.not16.i134 = icmp eq ptr %8, null br i1 %tobool.not16.i134, label %cond.false30, label %while.body.i135 while.body.i135: ; preds = %if.then24, %if.end8.i146 %node.017.i136 = phi ptr [ %node.1.i148, %if.end8.i146 ], [ %8, %if.then24 ] %9 = load i64, ptr %node.017.i136, align 8, !tbaa !47 %cmp.i137 = icmp sgt i64 %9, %val br i1 %cmp.i137, label %if.then.i150, label %if.else.i138 if.then.i150: ; preds = %while.body.i135 %child.i151 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 3 br label %if.end8.i146 if.else.i138: ; preds = %while.body.i135 %cmp3.i139 = icmp slt i64 %9, %val br i1 %cmp3.i139, label %if.then4.i144, label %AVL_set_inside_count.exit152 if.then4.i144: ; preds = %if.else.i138 %arrayidx6.i145 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 3, i64 1 br label %if.end8.i146 if.end8.i146: ; preds = %if.then4.i144, %if.then.i150 %node.1.in.i147 = phi ptr [ %child.i151, %if.then.i150 ], [ %arrayidx6.i145, %if.then4.i144 ] %node.1.i148 = load ptr, ptr %node.1.in.i147, align 8, !tbaa !31 %tobool.not.i149 = icmp eq ptr %node.1.i148, null br i1 %tobool.not.i149, label %cond.false30, label %while.body.i135, !llvm.loop !51 AVL_set_inside_count.exit152: ; preds = %if.else.i138 %cnt.i141 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 2 %10 = load i32, ptr %cnt.i141, align 4, !tbaa !48 %cmp28 = icmp sgt i32 %10, 1 br i1 %cmp28, label %cond.end33, label %cond.false30 cond.false30: ; preds = %if.end8.i146, %if.then24, %AVL_set_inside_count.exit152 %arrayidx32 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre169 %11 = load i64, ptr %arrayidx32, align 8, !tbaa !5 %dec = add nsw i64 %11, -1 store i64 %dec, ptr %arrayidx32, align 8, !tbaa !5 br label %cond.end33 cond.end33: ; preds = %AVL_set_inside_count.exit152, %cond.false30 %call37 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26, i64 noundef %val, i32 noundef 1), !range !50 switch i32 %command, label %return [ i32 4, label %if.then40 i32 5, label %if.then49 i32 6, label %if.then58 i32 7, label %if.then63 i32 8, label %if.then69 i32 9, label %if.then75 ] if.then40: ; preds = %if.end.if.then40_crit_edge, %cond.end33 %idxprom41.pre-phi = phi i64 [ %.pre170, %if.end.if.then40_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx42 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom41.pre-phi %12 = load i64, ptr %arrayidx42, align 8, !tbaa !5 %dec43 = add nsw i64 %12, -1 store i64 %dec43, ptr %arrayidx42, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom41.pre-phi %call46 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45, i64 noundef %val, i32 noundef 0), !range !50 br label %return if.then49: ; preds = %if.end.if.then49_crit_edge, %cond.end33 %idxprom50.pre-phi = phi i64 [ %.pre171, %if.end.if.then49_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx51 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom50.pre-phi store i64 0, ptr %arrayidx51, align 8, !tbaa !5 %arrayidx53 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom50.pre-phi %13 = load ptr, ptr %arrayidx53, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %13) store ptr null, ptr %arrayidx53, align 8, !tbaa !31 br label %return if.then58: ; preds = %if.end.if.then58_crit_edge, %cond.end33 %idxprom59.pre-phi = phi i64 [ %.pre172, %if.end.if.then58_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx60 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom59.pre-phi %14 = load i64, ptr %arrayidx60, align 8, !tbaa !5 br label %return if.then63: ; preds = %if.end.if.then63_crit_edge, %cond.end33 %idxprom64.pre-phi = phi i64 [ %.pre173, %if.end.if.then63_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx65 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom64.pre-phi %15 = load ptr, ptr %arrayidx65, align 8, !tbaa !31 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %if.then63 %root.addr.0.i = phi ptr [ %15, %if.then63 ], [ %16, %while.cond.i ] %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i, i64 0, i32 3, i64 1 %16 = load ptr, ptr %arrayidx.i, align 8, !tbaa !31 %cmp.not.i = icmp eq ptr %16, null br i1 %cmp.not.i, label %AVL_set_inside_minmax.exit, label %while.cond.i, !llvm.loop !52 AVL_set_inside_minmax.exit: ; preds = %while.cond.i %17 = load i64, ptr %root.addr.0.i, align 8, !tbaa !47 br label %return if.then69: ; preds = %if.end.if.then69_crit_edge, %cond.end33 %idxprom70.pre-phi = phi i64 [ %.pre174, %if.end.if.then69_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx71 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom70.pre-phi %18 = load ptr, ptr %arrayidx71, align 8, !tbaa !31 br label %while.cond.i153 while.cond.i153: ; preds = %while.cond.i153, %if.then69 %root.addr.0.i154 = phi ptr [ %18, %if.then69 ], [ %19, %while.cond.i153 ] %arrayidx.i155 = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i154, i64 0, i32 3, i64 0 %19 = load ptr, ptr %arrayidx.i155, align 8, !tbaa !31 %cmp.not.i156 = icmp eq ptr %19, null br i1 %cmp.not.i156, label %AVL_set_inside_minmax.exit157, label %while.cond.i153, !llvm.loop !52 AVL_set_inside_minmax.exit157: ; preds = %while.cond.i153 %20 = load i64, ptr %root.addr.0.i154, align 8, !tbaa !47 br label %return if.then75: ; preds = %if.end.if.then75_crit_edge, %cond.end33 %idxprom76.pre-phi = phi i64 [ %.pre175, %if.end.if.then75_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx77 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom76.pre-phi %arrayidx78 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %val %21 = load ptr, ptr %arrayidx77, align 8, !tbaa !31 %22 = load ptr, ptr %arrayidx78, align 8, !tbaa !31 store ptr %22, ptr %arrayidx77, align 8, !tbaa !31 store ptr %21, ptr %arrayidx78, align 8, !tbaa !31 br label %return return: ; preds = %if.end8.i127, %cond.end, %if.then49, %if.then40, %if.else7.i121, %if.then18, %if.then2, %if.then75, %cond.end33, %if.end, %AVL_set_inside_minmax.exit157, %AVL_set_inside_minmax.exit, %if.then58 %retval.0 = phi i64 [ %14, %if.then58 ], [ %17, %AVL_set_inside_minmax.exit ], [ %20, %AVL_set_inside_minmax.exit157 ], [ 0, %if.end ], [ 0, %if.then2 ], [ 0, %cond.end ], [ 0, %cond.end33 ], [ 0, %if.then40 ], [ 0, %if.then49 ], [ 0, %if.then75 ], [ %conv.i123, %if.else7.i121 ], [ 0, %if.then18 ], [ 0, %if.end8.i127 ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @set_print(i32 noundef %set_num) local_unnamed_addr #1 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %idxprom.i = sext i32 %set_num to i64 %arrayidx3.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom.i %0 = load ptr, ptr %arrayidx3.i, align 8, !tbaa !31 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_insert(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #9 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %idxprom7.i = sext i32 %set_num to i64 %arrayidx8.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7.i %0 = load ptr, ptr %arrayidx8.i, align 8, !tbaa !31 %tobool.not16.i.i = icmp eq ptr %0, null br i1 %tobool.not16.i.i, label %cond.false.i, label %while.body.i.i while.body.i.i: ; preds = %if.end.i, %if.end8.i.i %node.017.i.i = phi ptr [ %node.1.i.i, %if.end8.i.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i.i, align 8, !tbaa !47 %cmp.i.i = icmp sgt i64 %1, %val br i1 %cmp.i.i, label %if.then.i.i, label %if.else.i.i if.then.i.i: ; preds = %while.body.i.i %child.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3 br label %if.end8.i.i if.else.i.i: ; preds = %while.body.i.i %cmp3.i.i = icmp slt i64 %1, %val br i1 %cmp3.i.i, label %if.then4.i.i, label %AVL_set_inside_count.exit.i if.then4.i.i: ; preds = %if.else.i.i %arrayidx6.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3, i64 1 br label %if.end8.i.i if.end8.i.i: ; preds = %if.then4.i.i, %if.then.i.i %node.1.in.i.i = phi ptr [ %child.i.i, %if.then.i.i ], [ %arrayidx6.i.i, %if.then4.i.i ] %node.1.i.i = load ptr, ptr %node.1.in.i.i, align 8, !tbaa !31 %tobool.not.i.i = icmp eq ptr %node.1.i.i, null br i1 %tobool.not.i.i, label %cond.false.i, label %while.body.i.i, !llvm.loop !51 AVL_set_inside_count.exit.i: ; preds = %if.else.i.i %cnt.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i.i, align 4, !tbaa !48 %tobool9.not.i = icmp eq i32 %2, 0 br i1 %tobool9.not.i, label %cond.false.i, label %set_main.exit cond.false.i: ; preds = %if.end8.i.i, %AVL_set_inside_count.exit.i, %if.end.i %arrayidx11.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7.i %3 = load i64, ptr %arrayidx11.i, align 8, !tbaa !5 %inc12.i = add nsw i64 %3, 1 store i64 %inc12.i, ptr %arrayidx11.i, align 8, !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %AVL_set_inside_count.exit.i, %cond.false.i %call15.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8.i, i64 noundef %val, i32 noundef 2), !range !50 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_count(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #21 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre.i = sext i32 %set_num to i64 %arrayidx20.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre.i %0 = load ptr, ptr %arrayidx20.i, align 8, !tbaa !31 %tobool.not16.i115.i = icmp eq ptr %0, null br i1 %tobool.not16.i115.i, label %set_main.exit, label %while.body.i116.i while.body.i116.i: ; preds = %if.end.i, %if.end8.i127.i %node.017.i117.i = phi ptr [ %node.1.i129.i, %if.end8.i127.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i117.i, align 8, !tbaa !47 %cmp.i118.i = icmp sgt i64 %1, %val br i1 %cmp.i118.i, label %if.then.i131.i, label %if.else.i119.i if.then.i131.i: ; preds = %while.body.i116.i %child.i132.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 3 br label %if.end8.i127.i if.else.i119.i: ; preds = %while.body.i116.i %cmp3.i120.i = icmp slt i64 %1, %val br i1 %cmp3.i120.i, label %if.then4.i125.i, label %if.else7.i121.i if.then4.i125.i: ; preds = %if.else.i119.i %arrayidx6.i126.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 3, i64 1 br label %if.end8.i127.i if.else7.i121.i: ; preds = %if.else.i119.i %cnt.i122.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i122.i, align 4, !tbaa !48 %conv.i123.i = sext i32 %2 to i64 br label %set_main.exit if.end8.i127.i: ; preds = %if.then4.i125.i, %if.then.i131.i %node.1.in.i128.i = phi ptr [ %child.i132.i, %if.then.i131.i ], [ %arrayidx6.i126.i, %if.then4.i125.i ] %node.1.i129.i = load ptr, ptr %node.1.in.i128.i, align 8, !tbaa !31 %tobool.not.i130.i = icmp eq ptr %node.1.i129.i, null br i1 %tobool.not.i130.i, label %set_main.exit, label %while.body.i116.i, !llvm.loop !51 set_main.exit: ; preds = %if.end8.i127.i, %if.end.i, %if.else7.i121.i %retval.0.i = phi i64 [ %conv.i123.i, %if.else7.i121.i ], [ 0, %if.end.i ], [ 0, %if.end8.i127.i ] ret i64 %retval.0.i } ; Function Attrs: nounwind uwtable define dso_local void @set_erase(i32 noundef %set_num, i64 noundef %val, i32 noundef %is_all) local_unnamed_addr #9 { entry: %tobool.not = icmp eq i32 %is_all, 0 %.b114.i4 = load i1, ptr @set_main.set_is_init, align 1 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %entry br i1 %.b114.i4, label %set_main.exit, label %if.then.i if.then.i: ; preds = %if.then store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %if.then, %if.then.i %.pre170.i = sext i32 %set_num to i64 %arrayidx42.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre170.i %0 = load i64, ptr %arrayidx42.i, align 8, !tbaa !5 %dec43.i = add nsw i64 %0, -1 store i64 %dec43.i, ptr %arrayidx42.i, align 8, !tbaa !5 %arrayidx45.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre170.i %call46.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45.i, i64 noundef %val, i32 noundef 0), !range !50 br label %if.end if.else: ; preds = %entry br i1 %.b114.i4, label %if.end.i, label %if.then.i5 if.then.i5: ; preds = %if.else store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i5, %if.else %.pre169.i = sext i32 %set_num to i64 %arrayidx26.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre169.i %1 = load ptr, ptr %arrayidx26.i, align 8, !tbaa !31 %tobool.not16.i134.i = icmp eq ptr %1, null br i1 %tobool.not16.i134.i, label %cond.false30.i, label %while.body.i135.i while.body.i135.i: ; preds = %if.end.i, %if.end8.i146.i %node.017.i136.i = phi ptr [ %node.1.i148.i, %if.end8.i146.i ], [ %1, %if.end.i ] %2 = load i64, ptr %node.017.i136.i, align 8, !tbaa !47 %cmp.i137.i = icmp sgt i64 %2, %val br i1 %cmp.i137.i, label %if.then.i150.i, label %if.else.i138.i if.then.i150.i: ; preds = %while.body.i135.i %child.i151.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 3 br label %if.end8.i146.i if.else.i138.i: ; preds = %while.body.i135.i %cmp3.i139.i = icmp slt i64 %2, %val br i1 %cmp3.i139.i, label %if.then4.i144.i, label %AVL_set_inside_count.exit152.i if.then4.i144.i: ; preds = %if.else.i138.i %arrayidx6.i145.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 3, i64 1 br label %if.end8.i146.i if.end8.i146.i: ; preds = %if.then4.i144.i, %if.then.i150.i %node.1.in.i147.i = phi ptr [ %child.i151.i, %if.then.i150.i ], [ %arrayidx6.i145.i, %if.then4.i144.i ] %node.1.i148.i = load ptr, ptr %node.1.in.i147.i, align 8, !tbaa !31 %tobool.not.i149.i = icmp eq ptr %node.1.i148.i, null br i1 %tobool.not.i149.i, label %cond.false30.i, label %while.body.i135.i, !llvm.loop !51 AVL_set_inside_count.exit152.i: ; preds = %if.else.i138.i %cnt.i141.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i141.i, align 4, !tbaa !48 %cmp28.i = icmp sgt i32 %3, 1 br i1 %cmp28.i, label %set_main.exit6, label %cond.false30.i cond.false30.i: ; preds = %if.end8.i146.i, %AVL_set_inside_count.exit152.i, %if.end.i %arrayidx32.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre169.i %4 = load i64, ptr %arrayidx32.i, align 8, !tbaa !5 %dec.i = add nsw i64 %4, -1 store i64 %dec.i, ptr %arrayidx32.i, align 8, !tbaa !5 br label %set_main.exit6 set_main.exit6: ; preds = %AVL_set_inside_count.exit152.i, %cond.false30.i %call37.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26.i, i64 noundef %val, i32 noundef 1), !range !50 br label %if.end if.end: ; preds = %set_main.exit6, %set_main.exit ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_clear(i32 noundef %set_num) local_unnamed_addr #9 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre171.i = sext i32 %set_num to i64 %arrayidx51.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre171.i store i64 0, ptr %arrayidx51.i, align 8, !tbaa !5 %arrayidx53.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre171.i %0 = load ptr, ptr %arrayidx53.i, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %0) store ptr null, ptr %arrayidx53.i, align 8, !tbaa !31 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @set_size(i32 noundef %set_num) local_unnamed_addr #22 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre172.i = sext i32 %set_num to i64 %arrayidx60.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre172.i %0 = load i64, ptr %arrayidx60.i, align 8, !tbaa !5 ret i64 %0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_max(i32 noundef %set_num) local_unnamed_addr #21 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre173.i = sext i32 %set_num to i64 %arrayidx65.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre173.i %0 = load ptr, ptr %arrayidx65.i, align 8, !tbaa !31 br label %while.cond.i.i while.cond.i.i: ; preds = %while.cond.i.i, %if.end.i %root.addr.0.i.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i.i ] %arrayidx.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i.i, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx.i.i, align 8, !tbaa !31 %cmp.not.i.i = icmp eq ptr %1, null br i1 %cmp.not.i.i, label %set_main.exit, label %while.cond.i.i, !llvm.loop !52 set_main.exit: ; preds = %while.cond.i.i %2 = load i64, ptr %root.addr.0.i.i, align 8, !tbaa !47 ret i64 %2 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_min(i32 noundef %set_num) local_unnamed_addr #21 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre174.i = sext i32 %set_num to i64 %arrayidx71.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre174.i %0 = load ptr, ptr %arrayidx71.i, align 8, !tbaa !31 br label %while.cond.i153.i while.cond.i153.i: ; preds = %while.cond.i153.i, %if.end.i %root.addr.0.i154.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i153.i ] %arrayidx.i155.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i154.i, i64 0, i32 3, i64 0 %1 = load ptr, ptr %arrayidx.i155.i, align 8, !tbaa !31 %cmp.not.i156.i = icmp eq ptr %1, null br i1 %cmp.not.i156.i, label %set_main.exit, label %while.cond.i153.i, !llvm.loop !52 set_main.exit: ; preds = %while.cond.i153.i %2 = load i64, ptr %root.addr.0.i154.i, align 8, !tbaa !47 ret i64 %2 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @set_swap(i64 noundef %set_num1, i64 noundef %set_num2) local_unnamed_addr #22 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %sext = shl i64 %set_num1, 32 %.pre175.i = ashr exact i64 %sext, 32 %arrayidx77.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre175.i %arrayidx78.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %set_num2 %0 = load ptr, ptr %arrayidx77.i, align 8, !tbaa !31 %1 = load ptr, ptr %arrayidx78.i, align 8, !tbaa !31 store ptr %1, ptr %arrayidx77.i, align 8, !tbaa !31 store ptr %0, ptr %arrayidx78.i, align 8, !tbaa !31 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @s) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @t) %call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #27 %call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @t) #27 %cmp.not33 = icmp slt i64 %call2, %call3 br i1 %cmp.not33, label %for.cond.cleanup, label %for.cond4.preheader.preheader for.cond4.preheader.preheader: ; preds = %entry %0 = add i64 %call2, 1 %1 = sub i64 %0, %call3 %cmp630 = icmp sgt i64 %call3, 0 br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.cond.cleanup7 %i.035 = phi i64 [ %inc17, %for.cond.cleanup7 ], [ 0, %for.cond4.preheader.preheader ] %ans.034 = phi i64 [ %cond.i, %for.cond.cleanup7 ], [ 4611686018427387904, %for.cond4.preheader.preheader ] %2 = add i64 %call3, %i.035 %3 = add i64 %i.035, 1 %smax = tail call i64 @llvm.smax.i64(i64 %2, i64 %3) %4 = sub i64 %smax, %i.035 %add5 = add nsw i64 %i.035, %call3 br i1 %cmp630, label %for.body8.preheader, label %for.cond.cleanup7 for.body8.preheader: ; preds = %for.cond4.preheader %min.iters.check = icmp ult i64 %4, 4 br i1 %min.iters.check, label %for.body8.preheader41, label %vector.ph vector.ph: ; preds = %for.body8.preheader %n.vec = and i64 %4, -4 %ind.end = add i64 %i.035, %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %vec.phi37 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %offset.idx = add i64 %i.035, %index %5 = getelementptr inbounds [1151154 x i8], ptr @s, i64 0, i64 %offset.idx %wide.load = load <2 x i8>, ptr %5, align 1, !tbaa !21 %6 = getelementptr inbounds i8, ptr %5, i64 2 %wide.load38 = load <2 x i8>, ptr %6, align 1, !tbaa !21 %7 = getelementptr inbounds [1151154 x i8], ptr @t, i64 0, i64 %index %wide.load39 = load <2 x i8>, ptr %7, align 4, !tbaa !21 %8 = getelementptr inbounds i8, ptr %7, i64 2 %wide.load40 = load <2 x i8>, ptr %8, align 2, !tbaa !21 %9 = icmp ne <2 x i8> %wide.load, %wide.load39 %10 = icmp ne <2 x i8> %wide.load38, %wide.load40 %11 = zext <2 x i1> %9 to <2 x i64> %12 = zext <2 x i1> %10 to <2 x i64> %13 = add <2 x i64> %vec.phi, %11 %14 = add <2 x i64> %vec.phi37, %12 %index.next = add nuw i64 %index, 4 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !53 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %14, %13 %16 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader41 for.body8.preheader41: ; preds = %for.body8.preheader, %middle.block %j.032.ph = phi i64 [ %i.035, %for.body8.preheader ], [ %ind.end, %middle.block ] %tm.031.ph = phi i64 [ 0, %for.body8.preheader ], [ %16, %middle.block ] br label %for.body8 for.cond.cleanup: ; preds = %for.cond.cleanup7, %entry %ans.0.lcssa = phi i64 [ 4611686018427387904, %entry ], [ %cond.i, %for.cond.cleanup7 ] %call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa) ret void for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond4.preheader %tm.0.lcssa = phi i64 [ 0, %for.cond4.preheader ], [ %16, %middle.block ], [ %spec.select, %for.body8 ] %cond.i = tail call i64 @llvm.smin.i64(i64 %ans.034, i64 %tm.0.lcssa) %inc17 = add nuw i64 %i.035, 1 %exitcond.not = icmp eq i64 %inc17, %1 br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond4.preheader, !llvm.loop !54 for.body8: ; preds = %for.body8.preheader41, %for.body8 %j.032 = phi i64 [ %inc14, %for.body8 ], [ %j.032.ph, %for.body8.preheader41 ] %tm.031 = phi i64 [ %spec.select, %for.body8 ], [ %tm.031.ph, %for.body8.preheader41 ] %arrayidx = getelementptr inbounds [1151154 x i8], ptr @s, i64 0, i64 %j.032 %17 = load i8, ptr %arrayidx, align 1, !tbaa !21 %sub9 = sub nuw nsw i64 %j.032, %i.035 %arrayidx10 = getelementptr inbounds [1151154 x i8], ptr @t, i64 0, i64 %sub9 %18 = load i8, ptr %arrayidx10, align 1, !tbaa !21 %cmp12.not = icmp ne i8 %17, %18 %inc = zext i1 %cmp12.not to i64 %spec.select = add nuw nsw i64 %tm.031, %inc %inc14 = add nuw nsw i64 %j.032, 1 %cmp6 = icmp slt i64 %inc14, %add5 br i1 %cmp6, label %for.body8, label %for.cond.cleanup7, !llvm.loop !55 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: tail call void @solve() ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #23 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #24 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #23 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #11 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #19 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #20 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #22 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #23 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #24 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #25 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #26 = { nounwind allocsize(1) } attributes #27 = { nounwind willreturn memory(read) } attributes #28 = { nounwind } attributes #29 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !17} !21 = !{!7, !7, i64 0} !22 = distinct !{!22, !17} !23 = !{!24, !24, i64 0} !24 = !{!"int", !7, i64 0} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10, !28, !11, !12} !28 = !{!"llvm.loop.peeled.count", i32 1} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = !{!32, !32, i64 0} !32 = !{!"any pointer", !7, i64 0} !33 = distinct !{!33, !10} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !10} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10, !11, !12} !42 = distinct !{!42, !10, !12, !11} !43 = !{!44, !6, i64 0} !44 = !{!"", !6, i64 0, !6, i64 8} !45 = !{!46, !24, i64 8} !46 = !{!"node_AVL_set", !6, i64 0, !24, i64 8, !24, i64 12, !7, i64 16} !47 = !{!46, !6, i64 0} !48 = !{!46, !24, i64 12} !49 = distinct !{!49, !10} !50 = !{i32 -1, i32 2} !51 = distinct !{!51, !10} !52 = distinct !{!52, !10} !53 = distinct !{!53, !10, !11, !12} !54 = distinct !{!54, !10} !55 = distinct !{!55, !10, !12, !11}
#include <stdio.h> int main(void) { int n,m,i,j,count=0; scanf("%d%d",&n,&m); for(i=1;i<=n;i++) { for(j=1;j<=m;j++) { if(i%2==1) { printf("#"); } else if(i%2==0&&j<m&&count%2==0) printf("."); else if(i%2==0&&j==m&&count%2==0) printf("#"); else if(i%2==0&&j==1&&count%2==1) printf("#"); else printf("."); } if(i%2==0) count++; printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12339/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12339/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not70 = icmp slt i32 %0, 1 br i1 %cmp.not70, label %for.end47, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.end %count.072 = phi i32 [ %spec.select, %for.end ], [ 0, %entry ] %i.071 = phi i32 [ %inc46, %for.end ], [ 1, %entry ] %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not68 = icmp slt i32 %1, 1 %.pre79 = and i32 %i.071, 1 br i1 %cmp2.not68, label %for.end, label %for.body3.lr.ph for.body3.lr.ph: ; preds = %for.cond1.preheader %cmp4.not = icmp eq i32 %.pre79, 0 %2 = and i32 %count.072, -2147483647 %cmp31 = icmp eq i32 %2, 1 br i1 %cmp4.not, label %for.body3.lr.ph.split.us, label %for.body3 for.body3.lr.ph.split.us: ; preds = %for.body3.lr.ph %3 = and i32 %count.072, 1 %cmp11 = icmp eq i32 %3, 0 br i1 %cmp11, label %for.body3.us.preheader, label %for.body3.lr.ph.split.us.split.us for.body3.us.preheader: ; preds = %for.body3.lr.ph.split.us %cmp8.us.peel = icmp ugt i32 %1, 1 %. = select i1 %cmp8.us.peel, i32 46, i32 35 %putchar64.us.peel = call i32 @putchar(i32 %.) %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.us.not.peel = icmp sgt i32 %4, 1 br i1 %cmp2.not.us.not.peel, label %for.body3.us, label %for.end for.body3.lr.ph.split.us.split.us: ; preds = %for.body3.lr.ph.split.us br i1 %cmp31, label %for.inc.us.us.peel, label %for.body3.us.us.us for.inc.us.us.peel: ; preds = %for.body3.lr.ph.split.us.split.us %putchar62.us.us.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.us.us.not.peel = icmp sgt i32 %.pre, 1 br i1 %cmp2.not.us.us.not.peel, label %for.inc.us.us, label %for.end for.body3.us.us.us: ; preds = %for.body3.lr.ph.split.us.split.us, %for.body3.us.us.us %j.069.us.us.us = phi i32 [ %inc.us.us.us, %for.body3.us.us.us ], [ 1, %for.body3.lr.ph.split.us.split.us ] %putchar61.us.us.us = call i32 @putchar(i32 46) %inc.us.us.us = add nuw nsw i32 %j.069.us.us.us, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.us.us.us.not = icmp slt i32 %j.069.us.us.us, %5 br i1 %cmp2.not.us.us.us.not, label %for.body3.us.us.us, label %for.end, !llvm.loop !9 for.inc.us.us: ; preds = %for.inc.us.us.peel, %for.inc.us.us %j.069.us.us = phi i32 [ %inc.us.us, %for.inc.us.us ], [ 2, %for.inc.us.us.peel ] %putchar61.us.us = call i32 @putchar(i32 46) %.pre78 = load i32, ptr %m, align 4, !tbaa !5 %inc.us.us = add nuw nsw i32 %j.069.us.us, 1 %cmp2.not.us.us.not = icmp slt i32 %j.069.us.us, %.pre78 br i1 %cmp2.not.us.us.not, label %for.inc.us.us, label %for.end, !llvm.loop !11 for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us %6 = phi i32 [ %7, %for.body3.us ], [ %4, %for.body3.us.preheader ] %j.069.us = phi i32 [ %inc.us, %for.body3.us ], [ 2, %for.body3.us.preheader ] %cmp8.us = icmp slt i32 %j.069.us, %6 %cmp18.us = icmp eq i32 %j.069.us, %6 %.84 = select i1 %cmp18.us, i32 35, i32 46 %.sink83 = select i1 %cmp8.us, i32 46, i32 %.84 %putchar64.us = call i32 @putchar(i32 %.sink83) %inc.us = add nuw nsw i32 %j.069.us, 1 %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.us.not = icmp slt i32 %j.069.us, %7 br i1 %cmp2.not.us.not, label %for.body3.us, label %for.end, !llvm.loop !13 for.body3: ; preds = %for.body3.lr.ph, %for.body3 %j.069 = phi i32 [ %inc, %for.body3 ], [ 1, %for.body3.lr.ph ] %putchar65 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %j.069, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %j.069, %8 br i1 %cmp2.not.not, label %for.body3, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body3, %for.body3.us.us.us, %for.inc.us.us, %for.body3.us, %for.cond1.preheader, %for.inc.us.us.peel, %for.body3.us.preheader %rem39.pre-phi = phi i32 [ 0, %for.body3.us.preheader ], [ 0, %for.inc.us.us.peel ], [ %.pre79, %for.cond1.preheader ], [ 0, %for.body3.us ], [ 0, %for.inc.us.us ], [ 0, %for.body3.us.us.us ], [ %.pre79, %for.body3 ] %9 = xor i32 %rem39.pre-phi, 1 %spec.select = add i32 %9, %count.072 %putchar = call i32 @putchar(i32 10) %inc46 = add i32 %i.071, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %inc46, %10 br i1 %cmp.not, label %for.end47, label %for.cond1.preheader, !llvm.loop !14 for.end47: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10, !12} !14 = distinct !{!14, !10}
#include<stdio.h> #include<string.h> int main(void) { char s[101]; int i,j,k; scanf("%s",s); k=strlen(s); for(i=0;i<k;i++) s[i]='x'; printf("%s",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123432/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123432/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 120, i64 %0, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char s[101]; scanf("%s",s); int i; for(i=0;s[i]!='\0';i++){ s[i]='x'; } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123476/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123476/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not8 = icmp eq i8 %0, 0 br i1 %cmp.not8, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx10 = phi ptr [ %arrayidx, %for.body ], [ %s, %entry ] store i8 120, ptr %arrayidx10, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(){ char str[101]; scanf("%s", str); int len = strlen(str); for (int i = 0; i < len; i++){ printf("x"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123519/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123519/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call2 to i32 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str) #5 ret i32 0 for.body: ; preds = %entry, %for.body %i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar7 = call i32 @putchar(i32 120) %inc = add nuw nsw i32 %i.09, 1 %exitcond.not = icmp eq i32 %inc, %conv br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !5 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char s[101]; scanf("%s", s); int i = 0; while (s[i] != 0) { s[i] = 'x'; i++; } printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123562/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123562/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not8 = icmp eq i8 %0, 0 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx10 = phi ptr [ %arrayidx, %while.body ], [ %s, %entry ] store i8 120, ptr %arrayidx10, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { char s[200]; scanf("%s",&s); int i,n; n=strlen(s); for(i=0;i<n;i++) printf("x"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123605/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123605/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call1 to i32 %cmp5 = icmp sgt i32 %conv, 0 br i1 %cmp5, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %inc = add nuw nsw i32 %i.06, 1 %exitcond.not = icmp eq i32 %inc, %conv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %s) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ char s[100]; int i; scanf("%s",s); for(i = 0 ; i < strlen(s) ; i++){ printf("x"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123649/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123649/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp7.not = icmp eq i8 %char0, 0 br i1 %cmp7.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !5 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void){ char s[100]; int len; int k; scanf("%s", s); len = strlen(s); for (k = 0; k < len; k++) { s[k] = 'x'; } printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123706/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123706/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %conv = trunc i64 %call2 to i32 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 120, i64 %0, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> #define MAXLEN 100 int main(){ char s[MAXLEN+1]; int i, len; scanf("%s", s); len = strlen(s); for(i=0; i<len; i++){ printf("x"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123764/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123764/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp6 = icmp sgt i32 %conv, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %inc = add nuw nsw i32 %i.07, 1 %exitcond.not = icmp eq i32 %inc, %conv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int A,B; scanf("%d%d",&A,&B); if(A>B){ if(A-1>B) printf("%d\n",2*A-1); else printf("%d\n",A+B); } else if(A<B){ if(B-1>A) printf("%d\n",2*B-1); else printf("%d\n",A+B); } else printf("%d\n",A+B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123807/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123807/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else6 if.then: ; preds = %entry %sub = add nsw i32 %0, -1 %cmp1 = icmp sgt i32 %sub, %1 br i1 %cmp1, label %if.then2, label %if.else if.then2: ; preds = %if.then %mul = shl nsw i32 %0, 1 %sub3 = add nsw i32 %mul, -1 br label %if.end23 if.else: ; preds = %if.then %add = add nsw i32 %1, %0 br label %if.end23 if.else6: ; preds = %entry %cmp7 = icmp slt i32 %0, %1 br i1 %cmp7, label %if.then8, label %if.else19 if.then8: ; preds = %if.else6 %sub9 = add nsw i32 %1, -1 %cmp10 = icmp sgt i32 %sub9, %0 br i1 %cmp10, label %if.then11, label %if.else15 if.then11: ; preds = %if.then8 %mul12 = shl nsw i32 %1, 1 %sub13 = add nsw i32 %mul12, -1 br label %if.end23 if.else15: ; preds = %if.then8 %add16 = add nsw i32 %1, %0 br label %if.end23 if.else19: ; preds = %if.else6 %add20 = add nsw i32 %1, %0 br label %if.end23 if.end23: ; preds = %if.else19, %if.else15, %if.then11, %if.then2, %if.else %add20.sink = phi i32 [ %add20, %if.else19 ], [ %add16, %if.else15 ], [ %sub13, %if.then11 ], [ %sub3, %if.then2 ], [ %add, %if.else ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add20.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d",&a); scanf("%d",&b); if (a > b){ printf("%d",2*a-1); }else if (a < b){ printf("%d",2*b-1); }else{ printf("%d",2*a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123850/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123850/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 %sub = add nsw i32 %mul, -1 br label %if.end11 if.else: ; preds = %entry %cmp3 = icmp slt i32 %0, %1 br i1 %cmp3, label %if.then4, label %if.else8 if.then4: ; preds = %if.else %mul5 = shl nsw i32 %1, 1 %sub6 = add nsw i32 %mul5, -1 br label %if.end11 if.else8: ; preds = %if.else %mul9 = shl nsw i32 %0, 1 br label %if.end11 if.end11: ; preds = %if.then4, %if.else8, %if.then %sub6.sink = phi i32 [ %sub6, %if.then4 ], [ %mul9, %if.else8 ], [ %sub, %if.then ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub6.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main (void){ int s,b; scanf("%d%d",&s,&b); int sum=s+b; if(s+s-1>sum){ sum=s+s-1; } if(b+b-1>sum){ sum=b+b-1; } printf("%d",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123908/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123908/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %b) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %add1 = shl nsw i32 %0, 1 %sub = add nsw i32 %add1, -1 %spec.select = call i32 @llvm.smax.i32(i32 %sub, i32 %add) %add4 = shl nsw i32 %1, 1 %sub5 = add nsw i32 %add4, -1 %sum.1 = call i32 @llvm.smax.i32(i32 %sub5, i32 %spec.select) %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int a; int b; int coin; int main(void){ scanf("%d %d", &a, &b); if(a>b){ coin = a+a-1; printf("%d\n",coin); }else if(a<b){ coin = b+b-1; printf("%d\n",coin); }else{ coin = a+b; printf("%d\n",coin); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123951/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123951/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @coin = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b) %0 = load i32, ptr @a, align 4, !tbaa !5 %1 = load i32, ptr @b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 %sub = add nsw i32 %add, -1 br label %if.end10 if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else7 if.then3: ; preds = %if.else %add4 = shl nsw i32 %1, 1 %sub5 = add nsw i32 %add4, -1 br label %if.end10 if.else7: ; preds = %if.else %add8 = add nsw i32 %1, %0 br label %if.end10 if.end10: ; preds = %if.then3, %if.else7, %if.then %sub5.sink12 = phi i32 [ %sub5, %if.then3 ], [ %add8, %if.else7 ], [ %sub, %if.then ] store i32 %sub5.sink12, ptr @coin, align 4, !tbaa !5 %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub5.sink12) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int A,B,X,i; X=0; scanf("%d %d",&A,&B); for(i=1;i<=2;i++){ if(A>=B){ X=X+A,A=A-1;} else{ X=X+B,B=B-1;} } printf("%d",X); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123995/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123995/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %A.promoted = load i32, ptr %A, align 4, !tbaa !5 %B.promoted = load i32, ptr %B, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %A.promoted, %B.promoted br i1 %cmp1.not, label %if.else, label %if.then if.then: ; preds = %entry %sub = add nsw i32 %A.promoted, -1 store i32 %sub, ptr %A, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %sub3 = add nsw i32 %B.promoted, -1 store i32 %sub3, ptr %B, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %sub311 = phi i32 [ %B.promoted, %if.then ], [ %sub3, %if.else ] %sub9 = phi i32 [ %sub, %if.then ], [ %A.promoted, %if.else ] %.pn = phi i32 [ %A.promoted, %if.then ], [ %B.promoted, %if.else ] %cmp1.not.1 = icmp slt i32 %sub9, %sub311 br i1 %cmp1.not.1, label %if.else.1, label %if.then.1 if.then.1: ; preds = %for.inc %sub.1 = add nsw i32 %sub9, -1 store i32 %sub.1, ptr %A, align 4, !tbaa !5 br label %for.inc.1 if.else.1: ; preds = %for.inc %sub3.1 = add nsw i32 %sub311, -1 store i32 %sub3.1, ptr %B, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.else.1, %if.then.1 %.pn.1 = phi i32 [ %sub9, %if.then.1 ], [ %sub311, %if.else.1 ] %X.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %X.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; int sum=0; int i; scanf("%d %d",&a,&b); for(i=0;i<2;i++){ if(a>=b){ sum=sum+a; a=a-1; } else{ sum=sum+b; b=b-1; } } printf("%d",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124037/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124037/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %a.promoted, %b.promoted br i1 %cmp1.not, label %if.else, label %if.then if.then: ; preds = %entry %sub = add nsw i32 %a.promoted, -1 store i32 %sub, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %sub3 = add nsw i32 %b.promoted, -1 store i32 %sub3, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %sub311 = phi i32 [ %b.promoted, %if.then ], [ %sub3, %if.else ] %sub9 = phi i32 [ %sub, %if.then ], [ %a.promoted, %if.else ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ] %cmp1.not.1 = icmp slt i32 %sub9, %sub311 br i1 %cmp1.not.1, label %if.else.1, label %if.then.1 if.then.1: ; preds = %for.inc %sub.1 = add nsw i32 %sub9, -1 store i32 %sub.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 if.else.1: ; preds = %for.inc %sub3.1 = add nsw i32 %sub311, -1 store i32 %sub3.1, ptr %b, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.else.1, %if.then.1 %.pn.1 = phi i32 [ %sub9, %if.then.1 ], [ %sub311, %if.else.1 ] %sum.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
// Ver19.03 #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #define INF (1 << 29) * 2 #define LLINF 4545454545454545454 #define MOD 1000000007 #define ll long long #define ull unsigned long long #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; } int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; } void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); } void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); } int main() { ll a, b, ans = 0; scanf("%lld%lld", &a, &b); if (a >= b) { ans += a; a--; } else { ans += b; b--; } printf("%lld\n", ans + MAX(a, b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124080/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124080/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #6 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8 %1 = load i64, ptr %b, align 8 %cmp.not = icmp slt i64 %0, %1 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %dec = add nsw i64 %0, -1 store i64 %dec, ptr %a, align 8, !tbaa !5 br label %if.end if.else: ; preds = %entry %dec2 = add nsw i64 %1, -1 store i64 %dec2, ptr %b, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %2 = phi i64 [ %1, %if.then ], [ %dec2, %if.else ] %3 = phi i64 [ %dec, %if.then ], [ %0, %if.else ] %ans.0 = phi i64 [ %0, %if.then ], [ %1, %if.else ] %cond = call i64 @llvm.smax.i64(i64 %3, i64 %2) %add4 = add nsw i64 %cond, %ans.0 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add4) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <ctype.h> void print_int(int n) { printf("%d\n",n); } void swap(int * a, int * b) { int t = *a; *a = *b; *b = t; } void sort(int a[], int n) { for(int i = 1; i < n; i++) { int j = i-1; while(j >= 0 && a[j+1] > a[j]) { swap(&a[j+1],&a[j]); j--; } } } int main(int argc, char * argv[]) { int button[2]; int coin[3]; scanf("%d %d",&button[0], &button[1]); coin[0] = button[0] + button[1]; coin[1] = button[0] + button[0] - 1; coin[2] = button[1] + button[1] - 1; sort(coin, 3); print_int(coin[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124123/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124123/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print_int(i32 noundef %n) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #4 { entry: %cmp23 = icmp sgt i32 %n, 1 br i1 %cmp23, label %while.cond.preheader.preheader, label %for.cond.cleanup while.cond.preheader.preheader: ; preds = %entry %0 = add i32 %n, -1 %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %n, 2 br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %while.cond.preheader.preheader.new while.cond.preheader.preheader.new: ; preds = %while.cond.preheader.preheader %unroll_iter = and i32 %0, -2 br label %while.cond.preheader while.cond.preheader: ; preds = %while.end.1, %while.cond.preheader.preheader.new %i.024 = phi i32 [ 1, %while.cond.preheader.preheader.new ], [ %inc.1, %while.end.1 ] %niter = phi i32 [ 0, %while.cond.preheader.preheader.new ], [ %niter.next.1, %while.end.1 ] %idxprom.phi.trans.insert = zext i32 %i.024 to i64 %arrayidx.phi.trans.insert = getelementptr inbounds i32, ptr %a, i64 %idxprom.phi.trans.insert %.pre = load i32, ptr %arrayidx.phi.trans.insert, align 4, !tbaa !5 br label %land.rhs for.cond.cleanup.loopexit.unr-lcssa: ; preds = %while.end.1, %while.cond.preheader.preheader %i.024.unr = phi i32 [ 1, %while.cond.preheader.preheader ], [ %inc.1, %while.end.1 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %while.cond.preheader.epil while.cond.preheader.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %idxprom.phi.trans.insert.epil = zext i32 %i.024.unr to i64 %arrayidx.phi.trans.insert.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom.phi.trans.insert.epil %.pre.epil = load i32, ptr %arrayidx.phi.trans.insert.epil, align 4, !tbaa !5 br label %land.rhs.epil land.rhs.epil: ; preds = %while.body.epil, %while.cond.preheader.epil %j.0.in21.epil = phi i32 [ %i.024.unr, %while.cond.preheader.epil ], [ %j.022.epil, %while.body.epil ] %j.022.epil = add nsw i32 %j.0.in21.epil, -1 %idxprom2.epil = zext i32 %j.022.epil to i64 %arrayidx3.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom2.epil %2 = load i32, ptr %arrayidx3.epil, align 4, !tbaa !5 %cmp4.epil = icmp sgt i32 %.pre.epil, %2 br i1 %cmp4.epil, label %while.body.epil, label %for.cond.cleanup while.body.epil: ; preds = %land.rhs.epil %idxprom.epil = zext i32 %j.0.in21.epil to i64 %arrayidx.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom.epil store i32 %2, ptr %arrayidx.epil, align 4, !tbaa !5 store i32 %.pre.epil, ptr %arrayidx3.epil, align 4, !tbaa !5 %cmp1.epil = icmp sgt i32 %j.0.in21.epil, 1 br i1 %cmp1.epil, label %land.rhs.epil, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %while.body.epil, %land.rhs.epil, %entry ret void land.rhs: ; preds = %while.cond.preheader, %while.body %j.0.in21 = phi i32 [ %i.024, %while.cond.preheader ], [ %j.022, %while.body ] %j.022 = add nsw i32 %j.0.in21, -1 %idxprom2 = zext i32 %j.022 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2 %3 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %.pre, %3 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom = zext i32 %j.0.in21 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom store i32 %3, ptr %arrayidx, align 4, !tbaa !5 store i32 %.pre, ptr %arrayidx3, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %j.0.in21, 1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %land.rhs %inc = add nuw nsw i32 %i.024, 1 %idxprom.phi.trans.insert.1 = zext i32 %inc to i64 %arrayidx.phi.trans.insert.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom.phi.trans.insert.1 %.pre.1 = load i32, ptr %arrayidx.phi.trans.insert.1, align 4, !tbaa !5 br label %land.rhs.1 land.rhs.1: ; preds = %while.body.1, %while.end %j.0.in21.1 = phi i32 [ %inc, %while.end ], [ %j.022.1, %while.body.1 ] %j.022.1 = add nsw i32 %j.0.in21.1, -1 %idxprom2.1 = zext i32 %j.022.1 to i64 %arrayidx3.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom2.1 %4 = load i32, ptr %arrayidx3.1, align 4, !tbaa !5 %cmp4.1 = icmp sgt i32 %.pre.1, %4 br i1 %cmp4.1, label %while.body.1, label %while.end.1 while.body.1: ; preds = %land.rhs.1 %idxprom.1 = zext i32 %j.0.in21.1 to i64 %arrayidx.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom.1 store i32 %4, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %.pre.1, ptr %arrayidx3.1, align 4, !tbaa !5 %cmp1.1 = icmp sgt i32 %j.0.in21.1, 1 br i1 %cmp1.1, label %land.rhs.1, label %while.end.1, !llvm.loop !9 while.end.1: ; preds = %while.body.1, %land.rhs.1 %inc.1 = add nuw nsw i32 %i.024, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %while.cond.preheader, !llvm.loop !11 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %button = alloca [2 x i32], align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %button) #6 %arrayidx1 = getelementptr inbounds [2 x i32], ptr %button, i64 0, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %button, ptr noundef nonnull %arrayidx1) %0 = load i32, ptr %button, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %add7 = shl nsw i32 %0, 1 %sub = add nsw i32 %add7, -1 %add11 = shl nsw i32 %1, 1 %sub12 = add nsw i32 %add11, -1 %spec.select = call i32 @llvm.smin.i32(i32 %sub, i32 %add) %spec.select22 = call i32 @llvm.smax.i32(i32 %sub, i32 %add) %cmp4.i.1 = icmp sgt i32 %sub12, %spec.select %cmp4.i.1.1 = icmp sgt i32 %sub12, %spec.select22 %or.cond = and i1 %cmp4.i.1, %cmp4.i.1.1 %coin.sroa.0.1 = select i1 %or.cond, i32 %sub12, i32 %spec.select22 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %coin.sroa.0.1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %button) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int A,B,C; scanf("%d %d",&A,&B); if(A>=B){ C=A; A--; }else{ C=B; B--; } if(A>=B){ C+=A; }else{ C+=B; } printf("%d\n",C); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124174/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124174/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %dec = add nsw i32 %0, -1 store i32 %dec, ptr %A, align 4, !tbaa !5 br label %if.end if.else: ; preds = %entry %dec1 = add nsw i32 %1, -1 store i32 %dec1, ptr %B, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %2 = phi i32 [ %1, %if.then ], [ %dec1, %if.else ] %3 = phi i32 [ %dec, %if.then ], [ %0, %if.else ] %C.0 = phi i32 [ %0, %if.then ], [ %1, %if.else ] %. = call i32 @llvm.smax.i32(i32 %3, i32 %2) %C.1 = add nsw i32 %., %C.0 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a, b; scanf("%d %d", &a, &b); if (a == b) { printf("%d\n", (a + a)); } else if (a < b){ printf("%d\n", (b + b - 1)); } else { printf("%d\n", (a + a - 1)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124217/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124217/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 br label %if.end10 if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else6 if.then3: ; preds = %if.else %add4 = shl nsw i32 %1, 1 %sub = add nsw i32 %add4, -1 br label %if.end10 if.else6: ; preds = %if.else %add7 = shl nsw i32 %0, 1 %sub8 = add nsw i32 %add7, -1 br label %if.end10 if.end10: ; preds = %if.then3, %if.else6, %if.then %sub.sink = phi i32 [ %sub, %if.then3 ], [ %sub8, %if.else6 ], [ %add, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,c,y,z,x,n,m; x=0; scanf("%d%d",&a,&b); if(b>a){ c=a; a=b; b=c; } x=x+a; a=a-1; if(b>a){ c=a; a=b; b=c; } x=x+a; printf("%d\n",x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124260/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124260/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %sub = add nsw i32 %3, -1 store i32 %sub, ptr %a, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %2, %3 br i1 %cmp1.not, label %if.end3, label %if.then2 if.then2: ; preds = %if.end store i32 %2, ptr %a, align 4, !tbaa !5 store i32 %sub, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %4 = phi i32 [ %2, %if.then2 ], [ %sub, %if.end ] %add4 = add nsw i32 %4, %3 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int x,y; scanf("%d", &x); scanf("%d", &y); int ans; ans = 2*x -1; if(ans<2*y -1)ans = 2*y -1; if(ans<x+y)ans = x+y; printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124303/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %mul = shl nsw i32 %0, 1 %1 = load i32, ptr %y, align 4, !tbaa !5 %mul2 = shl nsw i32 %1, 1 %spec.select = call i32 @llvm.smax.i32(i32 %mul, i32 %mul2) %ans.0 = add nsw i32 %spec.select, -1 %add = add nsw i32 %1, %0 %cmp6.not = icmp sgt i32 %spec.select, %add %ans.1 = select i1 %cmp6.not, i32 %ans.0, i32 %add %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* * main.c * * Created on: 2019/04/13 * Author: family */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int A, B; int result = 0; scanf("%d %d", &A, &B); if(A > B) { result = A + (A - 1); } else if (A == B){ result = A + B; } else { result = B + (B - 1); } printf("%d\n", result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124347/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124347/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %reass.add10 = shl i32 %0, 1 %add = add i32 %reass.add10, -1 br label %if.end7 if.else: ; preds = %entry %cmp1 = icmp eq i32 %0, %1 br i1 %cmp1, label %if.then2, label %if.else4 if.then2: ; preds = %if.else %add3 = shl nsw i32 %0, 1 br label %if.end7 if.else4: ; preds = %if.else %reass.add = shl i32 %1, 1 %add6 = add i32 %reass.add, -1 br label %if.end7 if.end7: ; preds = %if.then2, %if.else4, %if.then %result.0 = phi i32 [ %add, %if.then ], [ %add3, %if.then2 ], [ %add6, %if.else4 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int A, B; scanf("%d %d", &A, &B); int sum; if(A > B) sum = A + A - 1; else if(A < B) sum = B + B - 1; else sum = A + B; printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124390/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124390/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 %sub = add nsw i32 %add, -1 br label %if.end7 if.else: ; preds = %entry %cmp1 = icmp slt i32 %0, %1 br i1 %cmp1, label %if.then2, label %if.else5 if.then2: ; preds = %if.else %add3 = shl nsw i32 %1, 1 %sub4 = add nsw i32 %add3, -1 br label %if.end7 if.else5: ; preds = %if.else %add6 = add nsw i32 %1, %0 br label %if.end7 if.end7: ; preds = %if.then2, %if.else5, %if.then %sum.0 = phi i32 [ %sub, %if.then ], [ %sub4, %if.then2 ], [ %add6, %if.else5 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdlib.h> #include <string.h> #include <stdio.h> typedef struct word{ char s[32]; int p[110],pn; }WORD; WORD a[110]; int comp_str(const void *a,const void *b){ WORD *p=(WORD *)a,*q=(WORD *)b; //return strcmp((char *)a,(char *)b); return strcmp((char *)p->s,(char *)q->s); } int comp_int(const void *a,const void *b){ return *(int *)a - *(int *)b; } int main(){ int i,j,wn=0,p; char s[32]; while(scanf("%s",s)!=EOF){ scanf("%d",&p); for(i=0;i<wn;i++)if(strcmp(s,a[i].s)==0)break; if(i==wn){ strcpy(a[wn].s,s); a[wn].p[0]=p; a[wn].pn=1; wn++; }else{ a[i].p[a[i].pn]=p; a[i].pn++; } } qsort(a,wn,sizeof(WORD),comp_str); for(i=0;i<wn;i++){ printf("%s\n",a[i].s); qsort(a[i].p,a[i].pn,sizeof(int),comp_int); for(j=0;j<a[i].pn;j++)printf("%s%d",(j==0)?"":" ",a[i].p[j]); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124448/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124448/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.word = type { [32 x i8], [110 x i32], i32 } @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @a = dso_local global [110 x %struct.word] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.4 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @.str.5 = private unnamed_addr constant [2 x i8] c" \00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; 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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #3 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %p = alloca i32, align 4 %s = alloca [32 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #10 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %s) #10 %call101 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not102 = icmp eq i32 %call101, -1 br i1 %cmp.not102, label %while.end.thread, label %while.body while.end.thread: ; preds = %entry call void @qsort(ptr noundef nonnull @a, i64 noundef 0, i64 noundef 476, ptr noundef nonnull @comp_str) #10 br label %for.end74 while.body: ; preds = %entry, %if.end35 %wn.0103 = phi i32 [ %wn.1, %if.end35 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p) %cmp298 = icmp sgt i32 %wn.0103, 0 br i1 %cmp298, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %while.body %wide.trip.count = zext i32 %wn.0103 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %indvars.iv %call6 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %arrayidx) #9 %cmp7 = icmp eq i32 %call6, 0 br i1 %cmp7, label %for.end.loopexit, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %if.then9, label %for.body, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %0 = trunc i64 %indvars.iv to i32 br label %for.end for.end: ; preds = %for.end.loopexit, %while.body %i.0.lcssa = phi i32 [ 0, %while.body ], [ %0, %for.end.loopexit ] %cmp8 = icmp eq i32 %i.0.lcssa, %wn.0103 br i1 %cmp8, label %if.then9, label %if.else if.then9: ; preds = %for.inc, %for.end %idxprom10 = sext i32 %wn.0103 to i64 %arrayidx11 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %idxprom10 %call15 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx11, ptr noundef nonnull dereferenceable(1) %s) #10 %1 = load i32, ptr %p, align 4, !tbaa !5 %p18 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %idxprom10, i32 1 store i32 %1, ptr %p18, align 4, !tbaa !5 %pn = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %idxprom10, i32 2 store i32 1, ptr %pn, align 4, !tbaa !11 %inc22 = add nsw i32 %wn.0103, 1 br label %if.end35 if.else: ; preds = %for.end %2 = load i32, ptr %p, align 4, !tbaa !5 %idxprom23 = zext i32 %i.0.lcssa to i64 %pn28 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %idxprom23, i32 2 %3 = load i32, ptr %pn28, align 4, !tbaa !11 %idxprom29 = sext i32 %3 to i64 %arrayidx30 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %idxprom23, i32 1, i64 %idxprom29 store i32 %2, ptr %arrayidx30, align 4, !tbaa !5 %4 = load i32, ptr %pn28, align 4, !tbaa !11 %inc34 = add nsw i32 %4, 1 store i32 %inc34, ptr %pn28, align 4, !tbaa !11 br label %if.end35 if.end35: ; preds = %if.else, %if.then9 %wn.1 = phi i32 [ %inc22, %if.then9 ], [ %wn.0103, %if.else ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end35 %conv = sext i32 %wn.1 to i64 call void @qsort(ptr noundef nonnull @a, i64 noundef %conv, i64 noundef 476, ptr noundef nonnull @comp_str) #10 %cmp37107 = icmp sgt i32 %wn.1, 0 br i1 %cmp37107, label %for.body39.preheader, label %for.end74 for.body39.preheader: ; preds = %while.end %wide.trip.count117 = zext i32 %wn.1 to i64 br label %for.body39 for.body39: ; preds = %for.body39.preheader, %for.end70 %indvars.iv114 = phi i64 [ 0, %for.body39.preheader ], [ %indvars.iv.next115, %for.end70 ] %arrayidx41 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %indvars.iv114 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx41) %p47 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %indvars.iv114, i32 1 %pn51 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %indvars.iv114, i32 2 %5 = load i32, ptr %pn51, align 4, !tbaa !11 %conv52 = sext i32 %5 to i64 call void @qsort(ptr noundef nonnull %p47, i64 noundef %conv52, i64 noundef 4, ptr noundef nonnull @comp_int) #10 %6 = load i32, ptr %pn51, align 4, !tbaa !11 %cmp57105 = icmp sgt i32 %6, 0 br i1 %cmp57105, label %for.body59.preheader, label %for.end70 for.body59.preheader: ; preds = %for.body39 %7 = load i32, ptr %p47, align 4, !tbaa !5 %call67.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str.4, i32 noundef %7) %8 = load i32, ptr %pn51, align 4, !tbaa !11 %cmp57.peel = icmp sgt i32 %8, 1 br i1 %cmp57.peel, label %for.body59, label %for.end70 for.body59: ; preds = %for.body59.preheader, %for.body59 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.body59 ], [ 1, %for.body59.preheader ] %arrayidx66 = getelementptr inbounds [110 x %struct.word], ptr @a, i64 0, i64 %indvars.iv114, i32 1, i64 %indvars.iv110 %9 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str.5, i32 noundef %9) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %10 = load i32, ptr %pn51, align 4, !tbaa !11 %11 = sext i32 %10 to i64 %cmp57 = icmp slt i64 %indvars.iv.next111, %11 br i1 %cmp57, label %for.body59, label %for.end70, !llvm.loop !14 for.end70: ; preds = %for.body59, %for.body59.preheader, %for.body39 %putchar = call i32 @putchar(i32 10) %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %exitcond118.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count117 br i1 %exitcond118.not, label %for.end74, label %for.body39, !llvm.loop !16 for.end74: ; preds = %for.end70, %while.end.thread, %while.end call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %s) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8 attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !6, i64 472} !12 = !{!"word", !7, i64 0, !7, i64 32, !6, i64 472} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15} !15 = !{!"llvm.loop.peeled.count", i32 1} !16 = distinct !{!16, !10}
// AOJ GRL_4_A Path/Cycle - Cycle Detection for a Directed Graph // 2018.4.26 bal4u #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_V 102 int V; // 頂点数 int to[MAX_V][MAX_V], hi[MAX_V]; int q[MAX_V], top, end; int count[MAX_V]; //#define getchar_unlocked() getchar() int in() { int n = 0; int c = getchar_unlocked(); do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } int topological_sort() { int i, j, k, f; // for (i = 0; i < V; i++) for (j = 0; j < hi[i]; j++) count[to[i][j]]++; top = end = 0; f = 0; for (i = 0; i < V; i++) if (!count[i]) q[end++] = i; while (top < end) { i = q[top++]; f++; for (j = 0; j < hi[i]; j++) { k = to[i][j]; if (--count[k] == 0) q[end++] = k; } } return f == V; } int main() { int E, s, t; V = in(), E = in(); while (E--) { s = in(), t = in(); to[s][hi[s]++] = t; count[t]++; } puts(topological_sort()? "0": "1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124499/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124499/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @end = dso_local local_unnamed_addr global i32 0, align 4 @top = dso_local local_unnamed_addr global i32 0, align 4 @V = dso_local local_unnamed_addr global i32 0, align 4 @count = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @q = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @hi = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @to = dso_local local_unnamed_addr global [102 x [102 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [2 x i8] c"0\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 %.pre17.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.preheader cond.false.i: ; preds = %entry %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %do.body.preheader do.body.preheader: ; preds = %cond.true.i, %cond.false.i %.ph = phi ptr [ %0, %cond.false.i ], [ %.pre17.pre, %cond.true.i ] %c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ] br label %do.body do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit16 %4 = phi ptr [ %8, %getchar_unlocked.exit16 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add2, %getchar_unlocked.exit16 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i12, %getchar_unlocked.exit16 ], [ %c.0.ph, %do.body.preheader ] %add = mul i32 %n.0, 10 %and = and i32 %c.0, 15 %add2 = add nsw i32 %and, %add %_IO_read_ptr.i7 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %_IO_read_end.i8 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8, align 8, !tbaa !14 %cmp.not.i9 = icmp ult ptr %5, %6 br i1 %cmp.not.i9, label %cond.false.i13, label %cond.true.i10, !prof !15 cond.true.i10: ; preds = %do.body %call.i11 = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16 cond.false.i13: ; preds = %do.body %incdec.ptr.i14 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15 = zext i8 %7 to i32 br label %getchar_unlocked.exit16 getchar_unlocked.exit16: ; preds = %cond.true.i10, %cond.false.i13 %8 = phi ptr [ %.pre, %cond.true.i10 ], [ %4, %cond.false.i13 ] %cond.i12 = phi i32 [ %call.i11, %cond.true.i10 ], [ %conv3.i15, %cond.false.i13 ] %cmp = icmp sgt i32 %cond.i12, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit16 ret i32 %add2 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @topological_sort() local_unnamed_addr #1 { entry: store i32 0, ptr @end, align 4, !tbaa !19 store i32 0, ptr @top, align 4, !tbaa !19 %0 = load i32, ptr @V, align 4, !tbaa !19 %cmp41 = icmp sgt i32 %0, 0 br i1 %cmp41, label %for.body.preheader, label %while.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %while.cond.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body while.cond.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %inc39.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %inc39.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %inc4042.unr = phi i32 [ 0, %for.body.preheader ], [ %inc39.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.preheader, label %for.body.epil for.body.epil: ; preds = %while.cond.preheader.unr-lcssa %arrayidx.epil = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv.unr %2 = load i32, ptr %arrayidx.epil, align 4, !tbaa !19 %tobool.not.epil = icmp eq i32 %2, 0 br i1 %tobool.not.epil, label %if.then.epil, label %while.cond.preheader if.then.epil: ; preds = %for.body.epil %inc.epil = add nsw i32 %inc4042.unr, 1 store i32 %inc.epil, ptr @end, align 4, !tbaa !19 %idxprom1.epil = sext i32 %inc4042.unr to i64 %arrayidx2.epil = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1.epil %3 = trunc i64 %indvars.iv.unr to i32 store i32 %3, ptr %arrayidx2.epil, align 4, !tbaa !19 br label %while.cond.preheader while.cond.preheader: ; preds = %for.body.epil, %if.then.epil, %while.cond.preheader.unr-lcssa %inc39.lcssa = phi i32 [ %inc39.lcssa.ph, %while.cond.preheader.unr-lcssa ], [ %inc4042.unr, %for.body.epil ], [ %inc.epil, %if.then.epil ] %cmp456 = icmp sgt i32 %inc39.lcssa, 0 br i1 %cmp456, label %while.body, label %while.end for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %inc4042 = phi i32 [ 0, %for.body.preheader.new ], [ %inc39.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx, align 8, !tbaa !19 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %if.then, label %for.inc if.then: ; preds = %for.body %inc = add nsw i32 %inc4042, 1 store i32 %inc, ptr @end, align 4, !tbaa !19 %idxprom1 = sext i32 %inc4042 to i64 %arrayidx2 = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1 %5 = trunc i64 %indvars.iv to i32 store i32 %5, ptr %arrayidx2, align 4, !tbaa !19 br label %for.inc for.inc: ; preds = %for.body, %if.then %inc39 = phi i32 [ %inc4042, %for.body ], [ %inc, %if.then ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv.next %6 = load i32, ptr %arrayidx.1, align 4, !tbaa !19 %tobool.not.1 = icmp eq i32 %6, 0 br i1 %tobool.not.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %inc.1 = add nsw i32 %inc39, 1 store i32 %inc.1, ptr @end, align 4, !tbaa !19 %idxprom1.1 = sext i32 %inc39 to i64 %arrayidx2.1 = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1.1 %7 = trunc i64 %indvars.iv.next to i32 store i32 %7, ptr %arrayidx2.1, align 4, !tbaa !19 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %inc39.1 = phi i32 [ %inc39, %for.inc ], [ %inc.1, %if.then.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.cond.preheader.unr-lcssa, label %for.body, !llvm.loop !20 while.cond.loopexit: ; preds = %for.inc26, %while.body %end.promoted4452 = phi i32 [ %end.promoted445557, %while.body ], [ %end.promoted4453, %for.inc26 ] %8 = sext i32 %end.promoted4452 to i64 %cmp4 = icmp slt i64 %indvars.iv.next68, %8 br i1 %cmp4, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !21 while.body: ; preds = %while.cond.preheader, %while.cond.loopexit %indvars.iv67 = phi i64 [ %indvars.iv.next68, %while.cond.loopexit ], [ 0, %while.cond.preheader ] %f.059 = phi i32 [ %inc8, %while.cond.loopexit ], [ 0, %while.cond.preheader ] %end.promoted445557 = phi i32 [ %end.promoted4452, %while.cond.loopexit ], [ %inc39.lcssa, %while.cond.preheader ] %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %arrayidx7 = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %indvars.iv67 %9 = load i32, ptr %arrayidx7, align 4, !tbaa !19 %inc8 = add nuw nsw i32 %f.059, 1 %idxprom10 = sext i32 %9 to i64 %arrayidx11 = getelementptr inbounds [102 x i32], ptr @hi, i64 0, i64 %idxprom10 %10 = load i32, ptr %arrayidx11, align 4, !tbaa !19 %cmp1247 = icmp sgt i32 %10, 0 br i1 %cmp1247, label %for.body13.preheader, label %while.cond.loopexit for.body13.preheader: ; preds = %while.body %wide.trip.count65 = zext i32 %10 to i64 br label %for.body13 for.body13: ; preds = %for.body13.preheader, %for.inc26 %indvars.iv62 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next63, %for.inc26 ] %end.promoted4454 = phi i32 [ %end.promoted445557, %for.body13.preheader ], [ %end.promoted4453, %for.inc26 ] %inc224648 = phi i32 [ %end.promoted445557, %for.body13.preheader ], [ %inc2245, %for.inc26 ] %arrayidx17 = getelementptr inbounds [102 x [102 x i32]], ptr @to, i64 0, i64 %idxprom10, i64 %indvars.iv62 %11 = load i32, ptr %arrayidx17, align 4, !tbaa !19 %idxprom18 = sext i32 %11 to i64 %arrayidx19 = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %idxprom18 %12 = load i32, ptr %arrayidx19, align 4, !tbaa !19 %dec = add nsw i32 %12, -1 store i32 %dec, ptr %arrayidx19, align 4, !tbaa !19 %cmp20 = icmp eq i32 %dec, 0 br i1 %cmp20, label %if.then21, label %for.inc26 if.then21: ; preds = %for.body13 %inc22 = add nsw i32 %inc224648, 1 store i32 %inc22, ptr @end, align 4, !tbaa !19 %idxprom23 = sext i32 %inc224648 to i64 %arrayidx24 = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom23 store i32 %11, ptr %arrayidx24, align 4, !tbaa !19 br label %for.inc26 for.inc26: ; preds = %for.body13, %if.then21 %end.promoted4453 = phi i32 [ %end.promoted4454, %for.body13 ], [ %inc22, %if.then21 ] %inc2245 = phi i32 [ %inc224648, %for.body13 ], [ %inc22, %if.then21 ] %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65 br i1 %exitcond66.not, label %while.cond.loopexit, label %for.body13, !llvm.loop !22 while.cond.while.end_crit_edge: ; preds = %while.cond.loopexit %13 = trunc i64 %indvars.iv.next68 to i32 store i32 %13, ptr @top, align 4, !tbaa !19 br label %while.end while.end: ; preds = %entry, %while.cond.while.end_crit_edge, %while.cond.preheader %f.0.lcssa = phi i32 [ %inc8, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ], [ 0, %entry ] %cmp29 = icmp eq i32 %f.0.lcssa, %0 %conv = zext i1 %cmp29 to i32 ret i32 %conv } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %entry %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 %.pre17.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %entry %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %do.body.i.preheader do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i %.ph127 = phi ptr [ %0, %cond.false.i.i ], [ %.pre17.pre.i, %cond.true.i.i ] %c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ] br label %do.body.i do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit16.i %4 = phi ptr [ %8, %getchar_unlocked.exit16.i ], [ %.ph127, %do.body.i.preheader ] %n.0.i = phi i32 [ %add2.i, %getchar_unlocked.exit16.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i12.i, %getchar_unlocked.exit16.i ], [ %c.0.i.ph, %do.body.i.preheader ] %add.i = mul i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add2.i = add nsw i32 %and.i, %add.i %_IO_read_ptr.i7.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %_IO_read_end.i8.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8.i, align 8, !tbaa !14 %cmp.not.i9.i = icmp ult ptr %5, %6 br i1 %cmp.not.i9.i, label %cond.false.i13.i, label %cond.true.i10.i, !prof !15 cond.true.i10.i: ; preds = %do.body.i %call.i11.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i cond.false.i13.i: ; preds = %do.body.i %incdec.ptr.i14.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14.i, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15.i = zext i8 %7 to i32 br label %getchar_unlocked.exit16.i getchar_unlocked.exit16.i: ; preds = %cond.false.i13.i, %cond.true.i10.i %8 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %4, %cond.false.i13.i ] %cond.i12.i = phi i32 [ %call.i11.i, %cond.true.i10.i ], [ %conv3.i15.i, %cond.false.i13.i ] %cmp.i = icmp sgt i32 %cond.i12.i, 47 br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17 in.exit: ; preds = %getchar_unlocked.exit16.i store i32 %add2.i, ptr @V, align 4, !tbaa !19 %_IO_read_ptr.i.i16 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i.i16, align 8, !tbaa !9 %_IO_read_end.i.i17 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i.i17, align 8, !tbaa !14 %cmp.not.i.i18 = icmp ult ptr %9, %10 br i1 %cmp.not.i.i18, label %cond.false.i.i43, label %cond.true.i.i19, !prof !15 cond.true.i.i19: ; preds = %in.exit %call.i.i20 = tail call i32 @__uflow(ptr noundef nonnull %8) #4 %.pre17.pre.i21 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i25.preheader cond.false.i.i43: ; preds = %in.exit %incdec.ptr.i.i44 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i.i44, ptr %_IO_read_ptr.i.i16, align 8, !tbaa !9 %11 = load i8, ptr %9, align 1, !tbaa !16 %conv3.i.i45 = zext i8 %11 to i32 br label %do.body.i25.preheader do.body.i25.preheader: ; preds = %cond.false.i.i43, %cond.true.i.i19 %.ph125 = phi ptr [ %8, %cond.false.i.i43 ], [ %.pre17.pre.i21, %cond.true.i.i19 ] %c.0.i27.ph = phi i32 [ %conv3.i.i45, %cond.false.i.i43 ], [ %call.i.i20, %cond.true.i.i19 ] br label %do.body.i25 do.body.i25: ; preds = %do.body.i25.preheader, %getchar_unlocked.exit16.i37 %12 = phi ptr [ %16, %getchar_unlocked.exit16.i37 ], [ %.ph125, %do.body.i25.preheader ] %n.0.i26 = phi i32 [ %add2.i30, %getchar_unlocked.exit16.i37 ], [ 0, %do.body.i25.preheader ] %c.0.i27 = phi i32 [ %cond.i12.i38, %getchar_unlocked.exit16.i37 ], [ %c.0.i27.ph, %do.body.i25.preheader ] %add.i28 = mul i32 %n.0.i26, 10 %and.i29 = and i32 %c.0.i27, 15 %add2.i30 = add nsw i32 %and.i29, %add.i28 %_IO_read_ptr.i7.i31 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i7.i31, align 8, !tbaa !9 %_IO_read_end.i8.i32 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i8.i32, align 8, !tbaa !14 %cmp.not.i9.i33 = icmp ult ptr %13, %14 br i1 %cmp.not.i9.i33, label %cond.false.i13.i40, label %cond.true.i10.i34, !prof !15 cond.true.i10.i34: ; preds = %do.body.i25 %call.i11.i35 = tail call i32 @__uflow(ptr noundef nonnull %12) #4 %.pre.i36 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i37 cond.false.i13.i40: ; preds = %do.body.i25 %incdec.ptr.i14.i41 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i14.i41, ptr %_IO_read_ptr.i7.i31, align 8, !tbaa !9 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i15.i42 = zext i8 %15 to i32 br label %getchar_unlocked.exit16.i37 getchar_unlocked.exit16.i37: ; preds = %cond.false.i13.i40, %cond.true.i10.i34 %16 = phi ptr [ %.pre.i36, %cond.true.i10.i34 ], [ %12, %cond.false.i13.i40 ] %cond.i12.i38 = phi i32 [ %call.i11.i35, %cond.true.i10.i34 ], [ %conv3.i15.i42, %cond.false.i13.i40 ] %cmp.i39 = icmp sgt i32 %cond.i12.i38, 47 br i1 %cmp.i39, label %do.body.i25, label %while.cond.preheader, !llvm.loop !17 while.cond.preheader: ; preds = %getchar_unlocked.exit16.i37 %tobool.not109 = icmp eq i32 %add2.i30, 0 br i1 %tobool.not109, label %while.end, label %while.body while.body: ; preds = %while.cond.preheader, %in.exit108 %17 = phi ptr [ %37, %in.exit108 ], [ %16, %while.cond.preheader ] %18 = phi ptr [ %38, %in.exit108 ], [ %16, %while.cond.preheader ] %E.0110 = phi i32 [ %dec, %in.exit108 ], [ %add2.i30, %while.cond.preheader ] %dec = add nsw i32 %E.0110, -1 %_IO_read_ptr.i.i47 = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 1 %19 = load ptr, ptr %_IO_read_ptr.i.i47, align 8, !tbaa !9 %_IO_read_end.i.i48 = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 2 %20 = load ptr, ptr %_IO_read_end.i.i48, align 8, !tbaa !14 %cmp.not.i.i49 = icmp ult ptr %19, %20 br i1 %cmp.not.i.i49, label %cond.false.i.i74, label %cond.true.i.i50, !prof !15 cond.true.i.i50: ; preds = %while.body %call.i.i51 = tail call i32 @__uflow(ptr noundef nonnull %18) #4 %.pre17.pre.i52 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i56.preheader cond.false.i.i74: ; preds = %while.body %incdec.ptr.i.i75 = getelementptr inbounds i8, ptr %19, i64 1 store ptr %incdec.ptr.i.i75, ptr %_IO_read_ptr.i.i47, align 8, !tbaa !9 %21 = load i8, ptr %19, align 1, !tbaa !16 %conv3.i.i76 = zext i8 %21 to i32 br label %do.body.i56.preheader do.body.i56.preheader: ; preds = %cond.false.i.i74, %cond.true.i.i50 %.ph121 = phi ptr [ %17, %cond.false.i.i74 ], [ %.pre17.pre.i52, %cond.true.i.i50 ] %.ph122 = phi ptr [ %18, %cond.false.i.i74 ], [ %.pre17.pre.i52, %cond.true.i.i50 ] %c.0.i58.ph = phi i32 [ %conv3.i.i76, %cond.false.i.i74 ], [ %call.i.i51, %cond.true.i.i50 ] br label %do.body.i56 do.body.i56: ; preds = %do.body.i56.preheader, %getchar_unlocked.exit16.i68 %22 = phi ptr [ %27, %getchar_unlocked.exit16.i68 ], [ %.ph121, %do.body.i56.preheader ] %23 = phi ptr [ %28, %getchar_unlocked.exit16.i68 ], [ %.ph122, %do.body.i56.preheader ] %n.0.i57 = phi i32 [ %add2.i61, %getchar_unlocked.exit16.i68 ], [ 0, %do.body.i56.preheader ] %c.0.i58 = phi i32 [ %cond.i12.i69, %getchar_unlocked.exit16.i68 ], [ %c.0.i58.ph, %do.body.i56.preheader ] %add.i59 = mul i32 %n.0.i57, 10 %and.i60 = and i32 %c.0.i58, 15 %add2.i61 = add nsw i32 %and.i60, %add.i59 %_IO_read_ptr.i7.i62 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 1 %24 = load ptr, ptr %_IO_read_ptr.i7.i62, align 8, !tbaa !9 %_IO_read_end.i8.i63 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 2 %25 = load ptr, ptr %_IO_read_end.i8.i63, align 8, !tbaa !14 %cmp.not.i9.i64 = icmp ult ptr %24, %25 br i1 %cmp.not.i9.i64, label %cond.false.i13.i71, label %cond.true.i10.i65, !prof !15 cond.true.i10.i65: ; preds = %do.body.i56 %call.i11.i66 = tail call i32 @__uflow(ptr noundef nonnull %23) #4 %.pre.i67 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i68 cond.false.i13.i71: ; preds = %do.body.i56 %incdec.ptr.i14.i72 = getelementptr inbounds i8, ptr %24, i64 1 store ptr %incdec.ptr.i14.i72, ptr %_IO_read_ptr.i7.i62, align 8, !tbaa !9 %26 = load i8, ptr %24, align 1, !tbaa !16 %conv3.i15.i73 = zext i8 %26 to i32 br label %getchar_unlocked.exit16.i68 getchar_unlocked.exit16.i68: ; preds = %cond.false.i13.i71, %cond.true.i10.i65 %27 = phi ptr [ %.pre.i67, %cond.true.i10.i65 ], [ %22, %cond.false.i13.i71 ] %28 = phi ptr [ %.pre.i67, %cond.true.i10.i65 ], [ %23, %cond.false.i13.i71 ] %cond.i12.i69 = phi i32 [ %call.i11.i66, %cond.true.i10.i65 ], [ %conv3.i15.i73, %cond.false.i13.i71 ] %cmp.i70 = icmp sgt i32 %cond.i12.i69, 47 br i1 %cmp.i70, label %do.body.i56, label %in.exit77, !llvm.loop !17 in.exit77: ; preds = %getchar_unlocked.exit16.i68 %_IO_read_ptr.i.i78 = getelementptr inbounds %struct._IO_FILE, ptr %27, i64 0, i32 1 %29 = load ptr, ptr %_IO_read_ptr.i.i78, align 8, !tbaa !9 %_IO_read_end.i.i79 = getelementptr inbounds %struct._IO_FILE, ptr %27, i64 0, i32 2 %30 = load ptr, ptr %_IO_read_end.i.i79, align 8, !tbaa !14 %cmp.not.i.i80 = icmp ult ptr %29, %30 br i1 %cmp.not.i.i80, label %cond.false.i.i105, label %cond.true.i.i81, !prof !15 cond.true.i.i81: ; preds = %in.exit77 %call.i.i82 = tail call i32 @__uflow(ptr noundef nonnull %27) #4 %.pre17.pre.i83 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i87.preheader cond.false.i.i105: ; preds = %in.exit77 %incdec.ptr.i.i106 = getelementptr inbounds i8, ptr %29, i64 1 store ptr %incdec.ptr.i.i106, ptr %_IO_read_ptr.i.i78, align 8, !tbaa !9 %31 = load i8, ptr %29, align 1, !tbaa !16 %conv3.i.i107 = zext i8 %31 to i32 br label %do.body.i87.preheader do.body.i87.preheader: ; preds = %cond.false.i.i105, %cond.true.i.i81 %.ph120 = phi ptr [ %27, %cond.false.i.i105 ], [ %.pre17.pre.i83, %cond.true.i.i81 ] %c.0.i89.ph = phi i32 [ %conv3.i.i107, %cond.false.i.i105 ], [ %call.i.i82, %cond.true.i.i81 ] br label %do.body.i87 do.body.i87: ; preds = %do.body.i87.preheader, %getchar_unlocked.exit16.i99 %32 = phi ptr [ %37, %getchar_unlocked.exit16.i99 ], [ %.ph120, %do.body.i87.preheader ] %33 = phi ptr [ %38, %getchar_unlocked.exit16.i99 ], [ %.ph120, %do.body.i87.preheader ] %n.0.i88 = phi i32 [ %add2.i92, %getchar_unlocked.exit16.i99 ], [ 0, %do.body.i87.preheader ] %c.0.i89 = phi i32 [ %cond.i12.i100, %getchar_unlocked.exit16.i99 ], [ %c.0.i89.ph, %do.body.i87.preheader ] %add.i90 = mul i32 %n.0.i88, 10 %and.i91 = and i32 %c.0.i89, 15 %add2.i92 = add nsw i32 %and.i91, %add.i90 %_IO_read_ptr.i7.i93 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 1 %34 = load ptr, ptr %_IO_read_ptr.i7.i93, align 8, !tbaa !9 %_IO_read_end.i8.i94 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 2 %35 = load ptr, ptr %_IO_read_end.i8.i94, align 8, !tbaa !14 %cmp.not.i9.i95 = icmp ult ptr %34, %35 br i1 %cmp.not.i9.i95, label %cond.false.i13.i102, label %cond.true.i10.i96, !prof !15 cond.true.i10.i96: ; preds = %do.body.i87 %call.i11.i97 = tail call i32 @__uflow(ptr noundef nonnull %33) #4 %.pre.i98 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i99 cond.false.i13.i102: ; preds = %do.body.i87 %incdec.ptr.i14.i103 = getelementptr inbounds i8, ptr %34, i64 1 store ptr %incdec.ptr.i14.i103, ptr %_IO_read_ptr.i7.i93, align 8, !tbaa !9 %36 = load i8, ptr %34, align 1, !tbaa !16 %conv3.i15.i104 = zext i8 %36 to i32 br label %getchar_unlocked.exit16.i99 getchar_unlocked.exit16.i99: ; preds = %cond.false.i13.i102, %cond.true.i10.i96 %37 = phi ptr [ %.pre.i98, %cond.true.i10.i96 ], [ %32, %cond.false.i13.i102 ] %38 = phi ptr [ %.pre.i98, %cond.true.i10.i96 ], [ %33, %cond.false.i13.i102 ] %cond.i12.i100 = phi i32 [ %call.i11.i97, %cond.true.i10.i96 ], [ %conv3.i15.i104, %cond.false.i13.i102 ] %cmp.i101 = icmp sgt i32 %cond.i12.i100, 47 br i1 %cmp.i101, label %do.body.i87, label %in.exit108, !llvm.loop !17 in.exit108: ; preds = %getchar_unlocked.exit16.i99 %idxprom = sext i32 %add2.i61 to i64 %arrayidx5 = getelementptr inbounds [102 x i32], ptr @hi, i64 0, i64 %idxprom %39 = load i32, ptr %arrayidx5, align 4, !tbaa !19 %inc = add nsw i32 %39, 1 store i32 %inc, ptr %arrayidx5, align 4, !tbaa !19 %idxprom6 = sext i32 %39 to i64 %arrayidx7 = getelementptr inbounds [102 x [102 x i32]], ptr @to, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %add2.i92, ptr %arrayidx7, align 4, !tbaa !19 %idxprom8 = sext i32 %add2.i92 to i64 %arrayidx9 = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %idxprom8 %40 = load i32, ptr %arrayidx9, align 4, !tbaa !19 %inc10 = add nsw i32 %40, 1 store i32 %inc10, ptr %arrayidx9, align 4, !tbaa !19 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %in.exit108, %while.cond.preheader store i32 0, ptr @end, align 4, !tbaa !19 store i32 0, ptr @top, align 4, !tbaa !19 %41 = load i32, ptr @V, align 4, !tbaa !19 %cmp41.i = icmp sgt i32 %41, 0 br i1 %cmp41.i, label %for.body.preheader.i, label %topological_sort.exit for.body.preheader.i: ; preds = %while.end %wide.trip.count.i = zext i32 %41 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %42 = icmp eq i32 %41, 1 br i1 %42, label %while.cond.preheader.i.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i while.cond.preheader.i.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i %inc39.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %inc39.i.1, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %inc4042.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %inc39.i.1, %for.inc.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.preheader.i, label %for.body.i.epil for.body.i.epil: ; preds = %while.cond.preheader.i.unr-lcssa %arrayidx.i.epil = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv.i.unr %43 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !19 %tobool.not.i.epil = icmp eq i32 %43, 0 br i1 %tobool.not.i.epil, label %if.then.i.epil, label %while.cond.preheader.i if.then.i.epil: ; preds = %for.body.i.epil %inc.i.epil = add nsw i32 %inc4042.i.unr, 1 store i32 %inc.i.epil, ptr @end, align 4, !tbaa !19 %idxprom1.i.epil = sext i32 %inc4042.i.unr to i64 %arrayidx2.i.epil = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1.i.epil %44 = trunc i64 %indvars.iv.i.unr to i32 store i32 %44, ptr %arrayidx2.i.epil, align 4, !tbaa !19 br label %while.cond.preheader.i while.cond.preheader.i: ; preds = %for.body.i.epil, %if.then.i.epil, %while.cond.preheader.i.unr-lcssa %inc39.i.lcssa = phi i32 [ %inc39.i.lcssa.ph, %while.cond.preheader.i.unr-lcssa ], [ %inc4042.i.unr, %for.body.i.epil ], [ %inc.i.epil, %if.then.i.epil ] %cmp456.i = icmp sgt i32 %inc39.i.lcssa, 0 br i1 %cmp456.i, label %while.body.i, label %topological_sort.exit for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %inc4042.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %inc39.i.1, %for.inc.i.1 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ] %arrayidx.i = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv.i %45 = load i32, ptr %arrayidx.i, align 8, !tbaa !19 %tobool.not.i = icmp eq i32 %45, 0 br i1 %tobool.not.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i %inc.i = add nsw i32 %inc4042.i, 1 store i32 %inc.i, ptr @end, align 4, !tbaa !19 %idxprom1.i = sext i32 %inc4042.i to i64 %arrayidx2.i = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1.i %46 = trunc i64 %indvars.iv.i to i32 store i32 %46, ptr %arrayidx2.i, align 4, !tbaa !19 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %inc39.i = phi i32 [ %inc4042.i, %for.body.i ], [ %inc.i, %if.then.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %indvars.iv.next.i %47 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !19 %tobool.not.i.1 = icmp eq i32 %47, 0 br i1 %tobool.not.i.1, label %if.then.i.1, label %for.inc.i.1 if.then.i.1: ; preds = %for.inc.i %inc.i.1 = add nsw i32 %inc39.i, 1 store i32 %inc.i.1, ptr @end, align 4, !tbaa !19 %idxprom1.i.1 = sext i32 %inc39.i to i64 %arrayidx2.i.1 = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom1.i.1 %48 = trunc i64 %indvars.iv.next.i to i32 store i32 %48, ptr %arrayidx2.i.1, align 4, !tbaa !19 br label %for.inc.i.1 for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i %inc39.i.1 = phi i32 [ %inc39.i, %for.inc.i ], [ %inc.i.1, %if.then.i.1 ] %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.cond.preheader.i.unr-lcssa, label %for.body.i, !llvm.loop !20 while.cond.loopexit.i: ; preds = %for.inc26.i, %while.body.i %end.promoted4452.i = phi i32 [ %end.promoted445557.i, %while.body.i ], [ %end.promoted4453.i, %for.inc26.i ] %49 = sext i32 %end.promoted4452.i to i64 %cmp4.i = icmp slt i64 %indvars.iv.next68.i, %49 br i1 %cmp4.i, label %while.body.i, label %while.cond.while.end_crit_edge.i, !llvm.loop !21 while.body.i: ; preds = %while.cond.preheader.i, %while.cond.loopexit.i %indvars.iv67.i = phi i64 [ %indvars.iv.next68.i, %while.cond.loopexit.i ], [ 0, %while.cond.preheader.i ] %end.promoted445557.i = phi i32 [ %end.promoted4452.i, %while.cond.loopexit.i ], [ %inc39.i.lcssa, %while.cond.preheader.i ] %indvars.iv.next68.i = add nuw nsw i64 %indvars.iv67.i, 1 %arrayidx7.i = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %indvars.iv67.i %50 = load i32, ptr %arrayidx7.i, align 4, !tbaa !19 %idxprom10.i = sext i32 %50 to i64 %arrayidx11.i = getelementptr inbounds [102 x i32], ptr @hi, i64 0, i64 %idxprom10.i %51 = load i32, ptr %arrayidx11.i, align 4, !tbaa !19 %cmp1247.i = icmp sgt i32 %51, 0 br i1 %cmp1247.i, label %for.body13.preheader.i, label %while.cond.loopexit.i for.body13.preheader.i: ; preds = %while.body.i %wide.trip.count65.i = zext i32 %51 to i64 br label %for.body13.i for.body13.i: ; preds = %for.inc26.i, %for.body13.preheader.i %indvars.iv62.i = phi i64 [ 0, %for.body13.preheader.i ], [ %indvars.iv.next63.i, %for.inc26.i ] %end.promoted4454.i = phi i32 [ %end.promoted445557.i, %for.body13.preheader.i ], [ %end.promoted4453.i, %for.inc26.i ] %inc224648.i = phi i32 [ %end.promoted445557.i, %for.body13.preheader.i ], [ %inc2245.i, %for.inc26.i ] %arrayidx17.i = getelementptr inbounds [102 x [102 x i32]], ptr @to, i64 0, i64 %idxprom10.i, i64 %indvars.iv62.i %52 = load i32, ptr %arrayidx17.i, align 4, !tbaa !19 %idxprom18.i = sext i32 %52 to i64 %arrayidx19.i = getelementptr inbounds [102 x i32], ptr @count, i64 0, i64 %idxprom18.i %53 = load i32, ptr %arrayidx19.i, align 4, !tbaa !19 %dec.i = add nsw i32 %53, -1 store i32 %dec.i, ptr %arrayidx19.i, align 4, !tbaa !19 %cmp20.i = icmp eq i32 %dec.i, 0 br i1 %cmp20.i, label %if.then21.i, label %for.inc26.i if.then21.i: ; preds = %for.body13.i %inc22.i = add nsw i32 %inc224648.i, 1 store i32 %inc22.i, ptr @end, align 4, !tbaa !19 %idxprom23.i = sext i32 %inc224648.i to i64 %arrayidx24.i = getelementptr inbounds [102 x i32], ptr @q, i64 0, i64 %idxprom23.i store i32 %52, ptr %arrayidx24.i, align 4, !tbaa !19 br label %for.inc26.i for.inc26.i: ; preds = %if.then21.i, %for.body13.i %end.promoted4453.i = phi i32 [ %end.promoted4454.i, %for.body13.i ], [ %inc22.i, %if.then21.i ] %inc2245.i = phi i32 [ %inc224648.i, %for.body13.i ], [ %inc22.i, %if.then21.i ] %indvars.iv.next63.i = add nuw nsw i64 %indvars.iv62.i, 1 %exitcond66.not.i = icmp eq i64 %indvars.iv.next63.i, %wide.trip.count65.i br i1 %exitcond66.not.i, label %while.cond.loopexit.i, label %for.body13.i, !llvm.loop !22 while.cond.while.end_crit_edge.i: ; preds = %while.cond.loopexit.i %indvars.le = trunc i64 %indvars.iv.next68.i to i32 store i32 %indvars.le, ptr @top, align 4, !tbaa !19 br label %topological_sort.exit topological_sort.exit: ; preds = %while.end, %while.cond.preheader.i, %while.cond.while.end_crit_edge.i %f.0.lcssa.i = phi i32 [ %indvars.le, %while.cond.while.end_crit_edge.i ], [ 0, %while.cond.preheader.i ], [ 0, %while.end ] %cmp29.i.not = icmp eq i32 %f.0.lcssa.i, %41 %cond = select i1 %cmp29.i.not, ptr @.str, ptr @.str.1 %call13 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 declare i32 @__uflow(ptr noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!11, !11, i64 0} !20 = distinct !{!20, !18} !21 = distinct !{!21, !18} !22 = distinct !{!22, !18} !23 = distinct !{!23, !18}
#include <stdio.h> #include <string.h> int max(int a,int b){if(a>b)return a;return b;} int LCS(char a[],char b[],int m,int n) { int L[m+1][n+1]; for(int i=0;i<=m;i++) { for(int j=0;j<=n;j++) { if(i==0 || j==0) L[i][j] = 0; else if(a[i-1] == b[j-1]) L[i][j] = L[i-1][j-1]+1; else L[i][j] = max(L[i-1][j],L[i][j-1]); } } //printf("%d\n",L[m][n]); // Print All LCS int index = L[m][n]; int t = index; char lcs[index+1]; lcs[index] = '\0'; int i = m ,j = n; while(i>0 && j>0) { if(a[i-1]==b[j-1]) { lcs[index-1] = a[i-1]; i--;j--;index--; } else if (L[i-1][j] > L[i][j-1]) i--; else j--; } printf("%s",lcs); // End of function } int main() { char str1[3010],str2[3010]; scanf("%s %s",str1,str2); int m = strlen(str1); int n = strlen(str2); //printf("%d %d",len1,len2); LCS(str1,str2,m,n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124556/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124556/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @LCS(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, i32 noundef %m, i32 noundef %n) local_unnamed_addr #1 { entry: %add = add i32 %m, 1 %0 = zext i32 %add to i64 %add1 = add i32 %n, 1 %1 = zext i32 %add1 to i64 %2 = mul nuw i64 %1, %0 %vla = alloca i32, i64 %2, align 16 %3 = or i32 %m, %n %or.cond.not = icmp sgt i32 %3, -1 br i1 %or.cond.not, label %for.cond2.preheader.preheader, label %for.cond.cleanup for.cond2.preheader.preheader: ; preds = %entry %4 = shl nuw nsw i64 %1, 2 %smax = tail call i32 @llvm.smax.i32(i32 %add, i32 1) %wide.trip.count164 = zext i32 %smax to i64 %exitcond.peel.not = icmp eq i32 %n, 0 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.cond2.for.cond.cleanup4_crit_edge %indvar = phi i64 [ 0, %for.cond2.preheader.preheader ], [ %indvar.next, %for.cond2.for.cond.cleanup4_crit_edge ] %cmp6 = icmp eq i64 %indvar, 0 %5 = add nsw i64 %indvar, -1 %arrayidx11 = getelementptr inbounds i8, ptr %a, i64 %5 %6 = mul nsw i64 %5, %1 %arrayidx33 = getelementptr inbounds i32, ptr %vla, i64 %6 %7 = mul nuw nsw i64 %indvar, %1 %arrayidx37 = getelementptr inbounds i32, ptr %vla, i64 %7 br i1 %cmp6, label %for.body5.us.preheader, label %for.inc.peel for.inc.peel: ; preds = %for.cond2.preheader store i32 0, ptr %arrayidx37, align 4, !tbaa !5 br i1 %exitcond.peel.not, label %for.cond2.for.cond.cleanup4_crit_edge, label %for.body5.peel.next for.body5.peel.next: ; preds = %for.inc.peel %8 = load i8, ptr %arrayidx11, align 1, !tbaa !9 br label %if.else for.body5.us.preheader: ; preds = %for.cond2.preheader %9 = mul nuw nsw i64 %4, %indvar %scevgep = getelementptr i8, ptr %vla, i64 %9 call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %4, i1 false), !tbaa !5 br label %for.cond2.for.cond.cleanup4_crit_edge for.cond.cleanup: ; preds = %for.cond2.for.cond.cleanup4_crit_edge, %entry %idxprom49 = sext i32 %m to i64 %10 = mul nsw i64 %1, %idxprom49 %arrayidx50 = getelementptr inbounds i32, ptr %vla, i64 %10 %idxprom51 = sext i32 %n to i64 %arrayidx52 = getelementptr inbounds i32, ptr %arrayidx50, i64 %idxprom51 %11 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %add53 = add nsw i32 %11, 1 %12 = zext i32 %add53 to i64 %vla54 = alloca i8, i64 %12, align 16 %idxprom55 = sext i32 %11 to i64 %arrayidx56 = getelementptr inbounds i8, ptr %vla54, i64 %idxprom55 store i8 0, ptr %arrayidx56, align 1, !tbaa !9 %cmp59149 = icmp sgt i32 %m, 0 %cmp61150 = icmp sgt i32 %n, 0 %13 = and i1 %cmp59149, %cmp61150 br i1 %13, label %while.body, label %while.end for.cond2.for.cond.cleanup4_crit_edge: ; preds = %for.inc, %for.inc.peel, %for.body5.us.preheader %indvar.next = add nuw nsw i64 %indvar, 1 %exitcond165 = icmp eq i64 %indvar.next, %wide.trip.count164 br i1 %exitcond165, label %for.cond.cleanup, label %for.cond2.preheader, !llvm.loop !10 if.else: ; preds = %for.inc, %for.body5.peel.next %indvars.iv = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next, %for.inc ] %14 = add nsw i64 %indvars.iv, -1 %arrayidx14 = getelementptr inbounds i8, ptr %b, i64 %14 %15 = load i8, ptr %arrayidx14, align 1, !tbaa !9 %cmp16 = icmp eq i8 %8, %15 br i1 %cmp16, label %if.then18, label %if.else30 if.then18: ; preds = %if.else %arrayidx24 = getelementptr inbounds i32, ptr %arrayidx33, i64 %14 %16 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %add25 = add nsw i32 %16, 1 br label %for.inc if.else30: ; preds = %if.else %arrayidx35 = getelementptr inbounds i32, ptr %arrayidx33, i64 %indvars.iv %17 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %arrayidx40 = getelementptr inbounds i32, ptr %arrayidx37, i64 %14 %18 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %a.b.i = tail call i32 @llvm.smax.i32(i32 %17, i32 %18) br label %for.inc for.inc: ; preds = %if.else30, %if.then18 %a.b.i.sink = phi i32 [ %a.b.i, %if.else30 ], [ %add25, %if.then18 ] %arrayidx44 = getelementptr inbounds i32, ptr %arrayidx37, i64 %indvars.iv store i32 %a.b.i.sink, ptr %arrayidx44, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.cond2.for.cond.cleanup4_crit_edge, label %if.else, !llvm.loop !12 while.body: ; preds = %for.cond.cleanup, %if.end100 %j58.0153 = phi i32 [ %j58.1, %if.end100 ], [ %n, %for.cond.cleanup ] %i57.0152 = phi i32 [ %i57.1, %if.end100 ], [ %m, %for.cond.cleanup ] %index.0151 = phi i32 [ %index.1, %if.end100 ], [ %11, %for.cond.cleanup ] %sub63 = add nsw i32 %i57.0152, -1 %idxprom64 = zext i32 %sub63 to i64 %arrayidx65 = getelementptr inbounds i8, ptr %a, i64 %idxprom64 %19 = load i8, ptr %arrayidx65, align 1, !tbaa !9 %sub67 = add nsw i32 %j58.0153, -1 %idxprom68 = zext i32 %sub67 to i64 %arrayidx69 = getelementptr inbounds i8, ptr %b, i64 %idxprom68 %20 = load i8, ptr %arrayidx69, align 1, !tbaa !9 %cmp71 = icmp eq i8 %19, %20 br i1 %cmp71, label %if.then73, label %if.else82 if.then73: ; preds = %while.body %sub77 = add nsw i32 %index.0151, -1 %idxprom78 = sext i32 %sub77 to i64 %arrayidx79 = getelementptr inbounds i8, ptr %vla54, i64 %idxprom78 store i8 %19, ptr %arrayidx79, align 1, !tbaa !9 br label %if.end100 if.else82: ; preds = %while.body %21 = mul nuw nsw i64 %idxprom64, %1 %arrayidx85 = getelementptr inbounds i32, ptr %vla, i64 %21 %idxprom86 = zext i32 %j58.0153 to i64 %arrayidx87 = getelementptr inbounds i32, ptr %arrayidx85, i64 %idxprom86 %22 = load i32, ptr %arrayidx87, align 4, !tbaa !5 %idxprom88 = zext i32 %i57.0152 to i64 %23 = mul nuw nsw i64 %idxprom88, %1 %arrayidx89 = getelementptr inbounds i32, ptr %vla, i64 %23 %arrayidx92 = getelementptr inbounds i32, ptr %arrayidx89, i64 %idxprom68 %24 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %cmp93 = icmp sgt i32 %22, %24 %spec.select = select i1 %cmp93, i32 %sub63, i32 %i57.0152 %spec.select144 = select i1 %cmp93, i32 %j58.0153, i32 %sub67 br label %if.end100 if.end100: ; preds = %if.else82, %if.then73 %index.1 = phi i32 [ %sub77, %if.then73 ], [ %index.0151, %if.else82 ] %i57.1 = phi i32 [ %sub63, %if.then73 ], [ %spec.select, %if.else82 ] %j58.1 = phi i32 [ %sub67, %if.then73 ], [ %spec.select144, %if.else82 ] %cmp59 = icmp sgt i32 %i57.1, 0 %cmp61 = icmp sgt i32 %j58.1, 0 %25 = select i1 %cmp59, i1 %cmp61, i1 false br i1 %25, label %while.body, label %while.end, !llvm.loop !14 while.end: ; preds = %if.end100, %for.cond.cleanup %call101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %vla54) ret i32 undef } ; 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %str1 = alloca [3010 x i8], align 16 %str2 = alloca [3010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 3010, ptr nonnull %str1) #7 call void @llvm.lifetime.start.p0(i64 3010, ptr nonnull %str2) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str1, ptr noundef nonnull %str2) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str1) #8 %conv = trunc i64 %call3 to i32 %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str2) #8 %conv6 = trunc i64 %call5 to i32 %call9 = call i32 @LCS(ptr noundef nonnull %str1, ptr noundef nonnull %str2, i32 noundef %conv, i32 noundef %conv6) call void @llvm.lifetime.end.p0(i64 3010, ptr nonnull %str2) #7 call void @llvm.lifetime.end.p0(i64 3010, ptr nonnull %str1) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } attributes #8 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !11}
#include <stdio.h> int main(void) { // your code goes here int t=0,n=0,m=0,i,j,k; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d",&n); int a[n],b[n],f=0,p1=-1,p2=-1; for(j=0;j<n;j++) scanf("%d",&a[j]); for(j=0;j<n;j++) scanf("%d",&b[j]); for(j=0;j<n;j++) { if(j==0&&a[j]!=b[j]){ f=1; break; } if(p1==-1&&a[j]==1) p1=j; else if(p2==-1&&a[j]==-1) p2=j; if(a[j]!=b[j]) { if(a[j]<b[j]&&p1!=-1&&p1<j) continue; else if(a[j]>b[j]&&p2!=-1&&p2<j) continue; f=1; break; } } if(f==0) printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 store i32 0, ptr %t, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 store i32 0, ptr %n, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp121 = icmp sgt i32 %0, 0 br i1 %cmp121, label %for.body, label %for.end80 for.body: ; preds = %entry, %if.end77 %i.0122 = phi i32 [ %inc79, %if.end77 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = zext i32 %1 to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %2, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = zext i32 %4 to i64 %vla2 = alloca i32, i64 %5, align 16 %cmp4113 = icmp sgt i32 %4, 0 br i1 %cmp4113, label %for.body5, label %if.end77 for.cond7.preheader: ; preds = %for.body5 %cmp8115 = icmp sgt i32 %6, 0 br i1 %cmp8115, label %for.body9, label %if.end77 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp4, label %for.body5, label %for.cond7.preheader, !llvm.loop !9 for.cond16.preheader: ; preds = %for.body9 %cmp17.not117 = icmp sgt i32 %14, 0 br i1 %cmp17.not117, label %land.lhs.true.peel, label %if.end77 land.lhs.true.peel: ; preds = %for.cond16.preheader %wide.trip.count = zext i32 %14 to i64 %8 = load i32, ptr %vla, align 16, !tbaa !5 %9 = load i32, ptr %vla2, align 16, !tbaa !5 %cmp24.not.peel = icmp eq i32 %8, %9 br i1 %cmp24.not.peel, label %land.lhs.true26.peel, label %if.end77 land.lhs.true26.peel: ; preds = %land.lhs.true.peel %10 = load i32, ptr %vla, align 16, !tbaa !5 %cmp29.peel = icmp eq i32 %10, 1 br i1 %cmp29.peel, label %if.end38.peel, label %land.lhs.true32.peel land.lhs.true32.peel: ; preds = %land.lhs.true26.peel %11 = load i32, ptr %vla, align 16, !tbaa !5 %cmp35.peel = icmp ne i32 %11, -1 %spec.select.peel = sext i1 %cmp35.peel to i32 br label %if.end38.peel if.end38.peel: ; preds = %land.lhs.true32.peel, %land.lhs.true26.peel %12 = phi i32 [ 1, %land.lhs.true26.peel ], [ %11, %land.lhs.true32.peel ] %p1.1.peel = phi i32 [ 0, %land.lhs.true26.peel ], [ -1, %land.lhs.true32.peel ] %p2.1.peel = phi i32 [ -1, %land.lhs.true26.peel ], [ %spec.select.peel, %land.lhs.true32.peel ] %13 = load i32, ptr %vla2, align 16, !tbaa !5 %cmp43.not.peel = icmp eq i32 %12, %13 br i1 %cmp43.not.peel, label %for.inc69.peel, label %if.else55.peel if.else55.peel: ; preds = %if.end38.peel %cmp60.peel = icmp sgt i32 %12, %13 %cmp62.peel = icmp ne i32 %p2.1.peel, -1 %or.cond81.peel = select i1 %cmp60.peel, i1 %cmp62.peel, i1 false %cmp64.peel = icmp slt i32 %p2.1.peel, 0 %or.cond112.peel = select i1 %or.cond81.peel, i1 %cmp64.peel, i1 false br i1 %or.cond112.peel, label %for.inc69.peel, label %if.end77 for.inc69.peel: ; preds = %if.else55.peel, %if.end38.peel %exitcond.peel.not = icmp eq i32 %14, 1 br i1 %exitcond.peel.not, label %if.end77, label %if.end for.body9: ; preds = %for.cond7.preheader, %for.body9 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body9 ], [ 0, %for.cond7.preheader ] %arrayidx11 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv125 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx11) %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp8 = icmp slt i64 %indvars.iv.next126, %15 br i1 %cmp8, label %for.body9, label %for.cond16.preheader, !llvm.loop !11 if.end: ; preds = %for.inc69.peel, %for.inc69 %indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.inc69 ], [ 1, %for.inc69.peel ] %p2.0120 = phi i32 [ %p2.1, %for.inc69 ], [ %p2.1.peel, %for.inc69.peel ] %p1.0119 = phi i32 [ %p1.1, %for.inc69 ], [ %p1.1.peel, %for.inc69.peel ] %cmp25 = icmp eq i32 %p1.0119, -1 br i1 %cmp25, label %land.lhs.true26, label %if.else land.lhs.true26: ; preds = %if.end %arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv128 %16 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp eq i32 %16, 1 %17 = trunc i64 %indvars.iv128 to i32 br i1 %cmp29, label %if.end38, label %if.else if.else: ; preds = %land.lhs.true26, %if.end %cmp31 = icmp eq i32 %p2.0120, -1 %arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv128 %18 = load i32, ptr %arrayidx34, align 4, !tbaa !5 br i1 %cmp31, label %land.lhs.true32, label %if.end38 land.lhs.true32: ; preds = %if.else %cmp35 = icmp eq i32 %18, -1 %19 = trunc i64 %indvars.iv128 to i32 %spec.select = select i1 %cmp35, i32 %19, i32 -1 br label %if.end38 if.end38: ; preds = %if.else, %land.lhs.true32, %land.lhs.true26 %20 = phi i32 [ 1, %land.lhs.true26 ], [ %18, %land.lhs.true32 ], [ %18, %if.else ] %p1.1 = phi i32 [ %17, %land.lhs.true26 ], [ %p1.0119, %land.lhs.true32 ], [ %p1.0119, %if.else ] %p2.1 = phi i32 [ %p2.0120, %land.lhs.true26 ], [ %spec.select, %land.lhs.true32 ], [ %p2.0120, %if.else ] %arrayidx42 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv128 %21 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %cmp43.not = icmp eq i32 %20, %21 br i1 %cmp43.not, label %for.inc69, label %if.then44 if.then44: ; preds = %if.end38 %cmp49 = icmp slt i32 %20, %21 %cmp51 = icmp ne i32 %p1.1, -1 %or.cond = and i1 %cmp49, %cmp51 %22 = sext i32 %p1.1 to i64 %cmp53 = icmp sgt i64 %indvars.iv128, %22 %or.cond111 = and i1 %or.cond, %cmp53 br i1 %or.cond111, label %for.inc69, label %if.else55 if.else55: ; preds = %if.then44 %cmp60 = icmp sgt i32 %20, %21 %cmp62 = icmp ne i32 %p2.1, -1 %or.cond81 = select i1 %cmp60, i1 %cmp62, i1 false %23 = sext i32 %p2.1 to i64 %cmp64 = icmp sgt i64 %indvars.iv128, %23 %or.cond112 = select i1 %or.cond81, i1 %cmp64, i1 false br i1 %or.cond112, label %for.inc69, label %if.end77 for.inc69: ; preds = %if.else55, %if.then44, %if.end38 %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count br i1 %exitcond.not, label %if.end77, label %if.end, !llvm.loop !12 if.end77: ; preds = %if.else55, %for.inc69, %land.lhs.true.peel, %if.else55.peel, %for.cond16.preheader, %for.inc69.peel, %for.cond7.preheader, %for.body %str.sink = phi ptr [ @str.3, %for.body ], [ @str.3, %for.cond7.preheader ], [ @str.3, %for.inc69.peel ], [ @str.3, %for.cond16.preheader ], [ @str, %if.else55.peel ], [ @str, %land.lhs.true.peel ], [ @str.3, %for.inc69 ], [ @str, %if.else55 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.stackrestore.p0(ptr %3) %inc79 = add nuw nsw i32 %i.0122, 1 %24 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc79, %24 br i1 %cmp, label %for.body, label %for.end80, !llvm.loop !14 for.end80: ; preds = %if.end77, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #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: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !10}
#include <stdio.h> #include <stdlib.h> int compare(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main(void) { int i, j; int n, a[2][49], b[50]; int sum[50]; scanf("%d", &n); for (i = 0; i < 2; i++) for (j = 0; j < n - 1; j++) scanf("%d", a[i] + j); for (i = 0; i < n; i++) scanf("%d", b + i); for (i = 0; i < n; i++) { sum[i] = 0; for (j = 0; j < i; j++) sum[i] += a[0][j]; sum[i] += b[i]; for (j = i; j < n - 1; j++) sum[i] += a[1][j]; } qsort(sum, n, sizeof(int), &compare); printf("%d\n", sum[0] + sum[1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %a = alloca [2 x [49 x i32]], align 16 %b = alloca [50 x i32], align 16 %sum = alloca [50 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %b) #6 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %sum) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = icmp sgt i32 %0, 1 br i1 %1, label %for.body3, label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body3.1, %for.inc5, %entry %2 = phi i32 [ %0, %entry ], [ %3, %for.inc5 ], [ %5, %for.body3.1 ] %cmp986 = icmp sgt i32 %2, 0 br i1 %cmp986, label %for.body10, label %for.end54 for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %3, -1 %4 = sext i32 %sub to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc5, !llvm.loop !9 for.inc5: ; preds = %for.body3 %cmp283.1 = icmp sgt i32 %3, 1 br i1 %cmp283.1, label %for.body3.lr.ph.1, label %for.cond8.preheader for.body3.lr.ph.1: ; preds = %for.inc5 %arrayidx.1 = getelementptr inbounds [2 x [49 x i32]], ptr %a, i64 0, i64 1 br label %for.body3.1 for.body3.1: ; preds = %for.body3.1, %for.body3.lr.ph.1 %indvars.iv.1 = phi i64 [ 0, %for.body3.lr.ph.1 ], [ %indvars.iv.next.1, %for.body3.1 ] %add.ptr.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.1 %call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1) %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %sub.1 = add nsw i32 %5, -1 %6 = sext i32 %sub.1 to i64 %cmp2.1 = icmp slt i64 %indvars.iv.next.1, %6 br i1 %cmp2.1, label %for.body3.1, label %for.cond8.preheader, !llvm.loop !9 for.cond18.preheader: ; preds = %for.body10 %cmp1993 = icmp sgt i32 %8, 0 br i1 %cmp1993, label %for.body20.lr.ph, label %for.end54 for.body20.lr.ph: ; preds = %for.cond18.preheader %sub40 = add i32 %8, -1 %7 = zext i32 %sub40 to i64 %wide.trip.count115 = zext i32 %8 to i64 %wide.trip.count112 = zext i32 %sub40 to i64 br label %for.body20 for.body10: ; preds = %for.cond8.preheader, %for.body10 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body10 ], [ 0, %for.cond8.preheader ] %add.ptr13 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv101 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr13) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp9 = icmp slt i64 %indvars.iv.next102, %9 br i1 %cmp9, label %for.body10, label %for.cond18.preheader, !llvm.loop !11 for.body20: ; preds = %for.body20.lr.ph, %for.inc52 %indvars.iv107 = phi i64 [ 0, %for.body20.lr.ph ], [ %indvars.iv.next108, %for.inc52 ] %10 = sub nsw i64 %wide.trip.count112, %indvars.iv107 %arrayidx22 = getelementptr inbounds [50 x i32], ptr %sum, i64 0, i64 %indvars.iv107 %cmp2488.not = icmp eq i64 %indvars.iv107, 0 br i1 %cmp2488.not, label %for.end33, label %for.body25.preheader for.body25.preheader: ; preds = %for.body20 %min.iters.check128 = icmp ult i64 %indvars.iv107, 8 br i1 %min.iters.check128, label %for.body25.preheader144, label %vector.ph129 vector.ph129: ; preds = %for.body25.preheader %n.vec131 = and i64 %indvars.iv107, 9223372036854775800 br label %vector.body134 vector.body134: ; preds = %vector.body134, %vector.ph129 %index135 = phi i64 [ 0, %vector.ph129 ], [ %index.next140, %vector.body134 ] %vec.phi136 = phi <4 x i32> [ zeroinitializer, %vector.ph129 ], [ %13, %vector.body134 ] %vec.phi137 = phi <4 x i32> [ zeroinitializer, %vector.ph129 ], [ %14, %vector.body134 ] %11 = getelementptr inbounds [49 x i32], ptr %a, i64 0, i64 %index135 %wide.load138 = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load139 = load <4 x i32>, ptr %12, align 16, !tbaa !5 %13 = add <4 x i32> %vec.phi136, %wide.load138 %14 = add <4 x i32> %vec.phi137, %wide.load139 %index.next140 = add nuw i64 %index135, 8 %15 = icmp eq i64 %index.next140, %n.vec131 br i1 %15, label %middle.block126, label %vector.body134, !llvm.loop !12 middle.block126: ; preds = %vector.body134 %bin.rdx141 = add <4 x i32> %14, %13 %16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx141) %cmp.n133 = icmp eq i64 %indvars.iv107, %n.vec131 br i1 %cmp.n133, label %for.end33, label %for.body25.preheader144 for.body25.preheader144: ; preds = %for.body25.preheader, %middle.block126 %indvars.iv104.ph = phi i64 [ 0, %for.body25.preheader ], [ %n.vec131, %middle.block126 ] %.ph145 = phi i32 [ 0, %for.body25.preheader ], [ %16, %middle.block126 ] br label %for.body25 for.body25: ; preds = %for.body25.preheader144, %for.body25 %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body25 ], [ %indvars.iv104.ph, %for.body25.preheader144 ] %17 = phi i32 [ %add, %for.body25 ], [ %.ph145, %for.body25.preheader144 ] %arrayidx28 = getelementptr inbounds [49 x i32], ptr %a, i64 0, i64 %indvars.iv104 %18 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %add = add nsw i32 %17, %18 %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %exitcond.not = icmp eq i64 %indvars.iv.next105, %indvars.iv107 br i1 %exitcond.not, label %for.end33, label %for.body25, !llvm.loop !15 for.end33: ; preds = %for.body25, %middle.block126, %for.body20 %19 = phi i32 [ 0, %for.body20 ], [ %16, %middle.block126 ], [ %add, %for.body25 ] %arrayidx35 = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv107 %20 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %add38 = add nsw i32 %19, %20 store i32 %add38, ptr %arrayidx22, align 4, !tbaa !5 %cmp4190 = icmp ult i64 %indvars.iv107, %7 br i1 %cmp4190, label %for.body42.preheader, label %for.inc52 for.body42.preheader: ; preds = %for.end33 %min.iters.check = icmp ult i64 %10, 8 br i1 %min.iters.check, label %for.body42.preheader143, label %vector.ph vector.ph: ; preds = %for.body42.preheader %n.vec = and i64 %10, -8 %ind.end = add i64 %indvars.iv107, %n.vec %21 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add38, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %21, %vector.ph ], [ %24, %vector.body ] %vec.phi124 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ] %offset.idx = add i64 %indvars.iv107, %index %22 = getelementptr inbounds [2 x [49 x i32]], ptr %a, i64 0, i64 1, i64 %offset.idx %wide.load = load <4 x i32>, ptr %22, align 4, !tbaa !5 %23 = getelementptr inbounds i32, ptr %22, i64 4 %wide.load125 = load <4 x i32>, ptr %23, align 4, !tbaa !5 %24 = add <4 x i32> %vec.phi, %wide.load %25 = add <4 x i32> %vec.phi124, %wide.load125 %index.next = add nuw i64 %index, 8 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %25, %24 %27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %10, %n.vec br i1 %cmp.n, label %for.cond39.for.inc52_crit_edge, label %for.body42.preheader143 for.body42.preheader143: ; preds = %for.body42.preheader, %middle.block %indvars.iv109.ph = phi i64 [ %indvars.iv107, %for.body42.preheader ], [ %ind.end, %middle.block ] %.ph = phi i32 [ %add38, %for.body42.preheader ], [ %27, %middle.block ] br label %for.body42 for.body42: ; preds = %for.body42.preheader143, %for.body42 %indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body42 ], [ %indvars.iv109.ph, %for.body42.preheader143 ] %28 = phi i32 [ %add48, %for.body42 ], [ %.ph, %for.body42.preheader143 ] %arrayidx45 = getelementptr inbounds [2 x [49 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv109 %29 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %add48 = add nsw i32 %28, %29 %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %exitcond113.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count112 br i1 %exitcond113.not, label %for.cond39.for.inc52_crit_edge, label %for.body42, !llvm.loop !17 for.cond39.for.inc52_crit_edge: ; preds = %for.body42, %middle.block %add48.lcssa = phi i32 [ %27, %middle.block ], [ %add48, %for.body42 ] store i32 %add48.lcssa, ptr %arrayidx22, align 4, !tbaa !5 br label %for.inc52 for.inc52: ; preds = %for.cond39.for.inc52_crit_edge, %for.end33 %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %exitcond116.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count115 br i1 %exitcond116.not, label %for.end54, label %for.body20, !llvm.loop !18 for.end54: ; preds = %for.inc52, %for.cond8.preheader, %for.cond18.preheader %.lcssa119 = phi i32 [ %8, %for.cond18.preheader ], [ %2, %for.cond8.preheader ], [ %8, %for.inc52 ] %conv = sext i32 %.lcssa119 to i64 call void @qsort(ptr noundef nonnull %sum, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare) #6 %30 = load i32, ptr %sum, align 16, !tbaa !5 %arrayidx57 = getelementptr inbounds [50 x i32], ptr %sum, i64 0, i64 1 %31 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %add58 = add nsw i32 %31, %30 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add58) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %sum) #6 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10, !13, !14} !17 = distinct !{!17, !10, !14, !13} !18 = distinct !{!18, !10}
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<limits.h> #define rep(i,begin,end) for(int i=begin; i<end; i++) #define revrep(i,begin,end) for(int i=begin; i>end; i--) #define lld long long int int main(){ int n, m; scanf("%d %d", &n, &m); int wf[n+1][n+1]; rep(i, 0, n+1){ rep(j, 0, n+1){ wf[i][j] = 1000000; if(i==j){ wf[i][j] = 0; } } } int a[m], b[m], c[m]; rep(i, 0, m){ scanf("%d %d %d", &a[i], &b[i], &c[i]); wf[a[i]][b[i]] = c[i]; wf[b[i]][a[i]] = c[i]; } rep(k, 1, n+1){ rep(i, 1, n+1){ rep(j, 1, n+1){ if(wf[i][j] > wf[i][k] + wf[k][j]){ wf[i][j] = wf[i][k] + wf[k][j]; } } } } int ans = 0; rep(i, 0, m){ if(wf[a[i]][b[i]] < c[i]){ ans++; } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %3 = mul nuw i64 %1, %1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not175 = icmp slt i32 %4, 0 br i1 %cmp.not175, label %for.cond.cleanup, label %for.cond3.preheader.preheader for.cond3.preheader.preheader: ; preds = %entry %5 = add nuw i32 %4, 1 %wide.trip.count194 = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %4, 7 %n.vec = and i64 %wide.trip.count194, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count194 br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.cond3.for.cond.cleanup6_crit_edge %indvars.iv191 = phi i64 [ 0, %for.cond3.preheader.preheader ], [ %indvars.iv.next192, %for.cond3.for.cond.cleanup6_crit_edge ] %6 = mul nuw nsw i64 %indvars.iv191, %1 %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %6 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.cond3.preheader %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv191, i64 0 %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4> %7 = getelementptr inbounds i32, ptr %arrayidx, i64 %index %8 = icmp eq <4 x i64> %broadcast.splat, %vec.ind %9 = icmp eq <4 x i64> %broadcast.splat, %step.add %10 = select <4 x i1> %8, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000> %11 = select <4 x i1> %9, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000> store <4 x i32> %10, ptr %7, align 4, !tbaa !5 %12 = getelementptr inbounds i32, ptr %7, i64 4 store <4 x i32> %11, ptr %12, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond3.for.cond.cleanup6_crit_edge, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond3.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond3.preheader ], [ %n.vec, %middle.block ] br label %for.body7 for.cond.cleanup: ; preds = %for.cond3.for.cond.cleanup6_crit_edge, %entry %14 = load i32, ptr %m, align 4, !tbaa !5 %15 = zext i32 %14 to i64 %vla18 = alloca i32, i64 %15, align 16 %vla19 = alloca i32, i64 %15, align 16 %vla20 = alloca i32, i64 %15, align 16 %cmp23177 = icmp sgt i32 %14, 0 br i1 %cmp23177, label %for.body25, label %for.cond56.preheader for.cond3.for.cond.cleanup6_crit_edge: ; preds = %for.body7, %middle.block %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1 %exitcond195.not = icmp eq i64 %indvars.iv.next192, %wide.trip.count194 br i1 %exitcond195.not, label %for.cond.cleanup, label %for.cond3.preheader, !llvm.loop !13 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ %indvars.iv.ph, %for.body7.preheader ] %arrayidx9 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv %cmp10 = icmp eq i64 %indvars.iv191, %indvars.iv %spec.select = select i1 %cmp10, i32 0, i32 1000000 store i32 %spec.select, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count194 br i1 %exitcond.not, label %for.cond3.for.cond.cleanup6_crit_edge, label %for.body7, !llvm.loop !14 for.cond56.preheader.loopexit: ; preds = %for.body25 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond56.preheader for.cond56.preheader: ; preds = %for.cond56.preheader.loopexit, %for.cond.cleanup %16 = phi i32 [ %4, %for.cond.cleanup ], [ %.pre, %for.cond56.preheader.loopexit ] %.lcssa = phi i32 [ %14, %for.cond.cleanup ], [ %39, %for.cond56.preheader.loopexit ] %cmp58.not183 = icmp slt i32 %16, 1 br i1 %cmp58.not183, label %for.cond112.preheader, label %for.cond62.preheader.preheader for.cond62.preheader.preheader: ; preds = %for.cond56.preheader %17 = add i32 %16, 1 %wide.trip.count212 = zext i32 %17 to i64 %18 = shl nuw nsw i64 %1, 2 %19 = add nuw nsw i64 %18, 4 %20 = shl nuw nsw i64 %1, 2 %21 = add nuw nsw i64 %1, %wide.trip.count212 %22 = shl nuw nsw i64 %21, 2 %23 = shl nuw nsw i64 %1, 2 %24 = add nsw i64 %wide.trip.count212, -1 %25 = getelementptr i8, ptr %vla, i64 %19 %26 = getelementptr i8, ptr %vla, i64 %22 %min.iters.check234 = icmp ult i64 %24, 12 %27 = getelementptr i8, ptr %vla, i64 %18 %28 = getelementptr i8, ptr %27, i64 8 %29 = getelementptr i8, ptr %vla, i64 %19 %30 = getelementptr i8, ptr %vla, i64 %22 %31 = getelementptr i8, ptr %vla, i64 %19 %n.vec237 = and i64 %24, -8 %ind.end = or i64 %n.vec237, 1 %cmp.n239 = icmp eq i64 %24, %n.vec237 %32 = and i64 %wide.trip.count212, 1 %lcmp.mod.not.not = icmp eq i64 %32, 0 %33 = sub nsw i64 0, %wide.trip.count212 br label %for.cond62.preheader for.body25: ; preds = %for.cond.cleanup, %for.body25 %indvars.iv196 = phi i64 [ %indvars.iv.next197, %for.body25 ], [ 0, %for.cond.cleanup ] %arrayidx27 = getelementptr inbounds i32, ptr %vla18, i64 %indvars.iv196 %arrayidx29 = getelementptr inbounds i32, ptr %vla19, i64 %indvars.iv196 %arrayidx31 = getelementptr inbounds i32, ptr %vla20, i64 %indvars.iv196 %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx27, ptr noundef nonnull %arrayidx29, ptr noundef nonnull %arrayidx31) %34 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %35 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %idxprom37 = sext i32 %35 to i64 %36 = mul nsw i64 %idxprom37, %1 %arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %36 %37 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %idxprom41 = sext i32 %37 to i64 %arrayidx42 = getelementptr inbounds i32, ptr %arrayidx38, i64 %idxprom41 store i32 %34, ptr %arrayidx42, align 4, !tbaa !5 %38 = mul nsw i64 %idxprom41, %1 %arrayidx48 = getelementptr inbounds i32, ptr %vla, i64 %38 %arrayidx52 = getelementptr inbounds i32, ptr %arrayidx48, i64 %idxprom37 store i32 %34, ptr %arrayidx52, align 4, !tbaa !5 %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1 %39 = load i32, ptr %m, align 4, !tbaa !5 %40 = sext i32 %39 to i64 %cmp23 = icmp slt i64 %indvars.iv.next197, %40 br i1 %cmp23, label %for.body25, label %for.cond56.preheader.loopexit, !llvm.loop !15 for.cond62.preheader: ; preds = %for.cond62.preheader.preheader, %for.cond62.for.cond.cleanup65_crit_edge.split %indvar223 = phi i64 [ 0, %for.cond62.preheader.preheader ], [ %indvar.next224, %for.cond62.for.cond.cleanup65_crit_edge.split ] %indvars.iv209 = phi i64 [ 1, %for.cond62.preheader.preheader ], [ %indvars.iv.next210, %for.cond62.for.cond.cleanup65_crit_edge.split ] %41 = shl nuw nsw i64 %indvar223, 2 %42 = mul i64 %23, %indvar223 %scevgep227 = getelementptr i8, ptr %25, i64 %42 %scevgep228 = getelementptr i8, ptr %26, i64 %42 %43 = mul nuw nsw i64 %indvars.iv209, %1 %arrayidx82 = getelementptr inbounds i32, ptr %vla, i64 %43 %44 = getelementptr i8, ptr %28, i64 %41 %45 = getelementptr i8, ptr %29, i64 %41 %bound0 = icmp ult ptr %31, %44 %bound1 = icmp ult ptr %45, %30 %found.conflict = and i1 %bound0, %bound1 br label %for.cond68.preheader for.cond112.preheader: ; preds = %for.cond62.for.cond.cleanup65_crit_edge.split, %for.cond56.preheader %cmp113185 = icmp sgt i32 %.lcssa, 0 br i1 %cmp113185, label %for.body115.preheader, label %for.cond.cleanup114 for.body115.preheader: ; preds = %for.cond112.preheader %wide.trip.count217 = zext i32 %.lcssa to i64 %xtraiter251 = and i64 %wide.trip.count217, 1 %46 = icmp eq i32 %.lcssa, 1 br i1 %46, label %for.cond.cleanup114.loopexit.unr-lcssa, label %for.body115.preheader.new for.body115.preheader.new: ; preds = %for.body115.preheader %unroll_iter = and i64 %wide.trip.count217, 4294967294 br label %for.body115 for.cond68.preheader: ; preds = %for.cond62.preheader, %for.cond68.for.cond.cleanup71_crit_edge %indvar = phi i64 [ 0, %for.cond62.preheader ], [ %indvar.next, %for.cond68.for.cond.cleanup71_crit_edge ] %indvars.iv204 = phi i64 [ 1, %for.cond62.preheader ], [ %indvars.iv.next205, %for.cond68.for.cond.cleanup71_crit_edge ] %47 = mul nuw nsw i64 %indvars.iv204, %1 %arrayidx74 = getelementptr inbounds i32, ptr %vla, i64 %47 %arrayidx80 = getelementptr inbounds i32, ptr %arrayidx74, i64 %indvars.iv209 br i1 %min.iters.check234, label %for.body72.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond68.preheader %48 = mul i64 %20, %indvar %scevgep222 = getelementptr i8, ptr %30, i64 %48 %scevgep = getelementptr i8, ptr %31, i64 %48 %bound0229 = icmp ult ptr %scevgep, %scevgep228 %bound1230 = icmp ult ptr %scevgep227, %scevgep222 %found.conflict231 = and i1 %bound0229, %bound1230 %conflict.rdx = or i1 %found.conflict, %found.conflict231 br i1 %conflict.rdx, label %for.body72.preheader, label %vector.ph235 vector.ph235: ; preds = %vector.memcheck %49 = load i32, ptr %arrayidx80, align 4, !tbaa !5, !alias.scope !16 %broadcast.splatinsert247 = insertelement <4 x i32> poison, i32 %49, i64 0 %broadcast.splat248 = shufflevector <4 x i32> %broadcast.splatinsert247, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body240 vector.body240: ; preds = %vector.body240, %vector.ph235 %index241 = phi i64 [ 0, %vector.ph235 ], [ %index.next249, %vector.body240 ] %offset.idx = or i64 %index241, 1 %50 = getelementptr inbounds i32, ptr %arrayidx74, i64 %offset.idx %wide.load = load <4 x i32>, ptr %50, align 4, !tbaa !5, !alias.scope !19, !noalias !21 %51 = getelementptr inbounds i32, ptr %50, i64 4 %wide.load242 = load <4 x i32>, ptr %51, align 4, !tbaa !5, !alias.scope !19, !noalias !21 %52 = getelementptr inbounds i32, ptr %arrayidx82, i64 %offset.idx %wide.load243 = load <4 x i32>, ptr %52, align 4, !tbaa !5, !alias.scope !23 %53 = getelementptr inbounds i32, ptr %52, i64 4 %wide.load244 = load <4 x i32>, ptr %53, align 4, !tbaa !5, !alias.scope !23 %54 = add nsw <4 x i32> %wide.load243, %broadcast.splat248 %55 = add nsw <4 x i32> %wide.load244, %broadcast.splat248 %56 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %54) %57 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load242, <4 x i32> %55) store <4 x i32> %56, ptr %50, align 4, !alias.scope !19, !noalias !21 store <4 x i32> %57, ptr %51, align 4, !alias.scope !19, !noalias !21 %index.next249 = add nuw i64 %index241, 8 %58 = icmp eq i64 %index.next249, %n.vec237 br i1 %58, label %middle.block232, label %vector.body240, !llvm.loop !24 middle.block232: ; preds = %vector.body240 br i1 %cmp.n239, label %for.cond68.for.cond.cleanup71_crit_edge, label %for.body72.preheader for.body72.preheader: ; preds = %vector.memcheck, %for.cond68.preheader, %middle.block232 %indvars.iv199.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %for.cond68.preheader ], [ %ind.end, %middle.block232 ] br i1 %lcmp.mod.not.not, label %for.body72.prol, label %for.body72.prol.loopexit for.body72.prol: ; preds = %for.body72.preheader %arrayidx76.prol = getelementptr inbounds i32, ptr %arrayidx74, i64 %indvars.iv199.ph %59 = load i32, ptr %arrayidx76.prol, align 4, !tbaa !5 %60 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %arrayidx84.prol = getelementptr inbounds i32, ptr %arrayidx82, i64 %indvars.iv199.ph %61 = load i32, ptr %arrayidx84.prol, align 4, !tbaa !5 %add85.prol = add nsw i32 %61, %60 %spec.store.select.prol = call i32 @llvm.smin.i32(i32 %59, i32 %add85.prol) store i32 %spec.store.select.prol, ptr %arrayidx76.prol, align 4 %indvars.iv.next200.prol = add nuw nsw i64 %indvars.iv199.ph, 1 br label %for.body72.prol.loopexit for.body72.prol.loopexit: ; preds = %for.body72.prol, %for.body72.preheader %indvars.iv199.unr = phi i64 [ %indvars.iv199.ph, %for.body72.preheader ], [ %indvars.iv.next200.prol, %for.body72.prol ] %62 = xor i64 %indvars.iv199.ph, %33 %63 = icmp eq i64 %62, -1 br i1 %63, label %for.cond68.for.cond.cleanup71_crit_edge, label %for.body72 for.cond62.for.cond.cleanup65_crit_edge.split: ; preds = %for.cond68.for.cond.cleanup71_crit_edge %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1 %exitcond213.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count212 %indvar.next224 = add i64 %indvar223, 1 br i1 %exitcond213.not, label %for.cond112.preheader, label %for.cond62.preheader, !llvm.loop !25 for.cond68.for.cond.cleanup71_crit_edge: ; preds = %for.body72.prol.loopexit, %for.body72, %middle.block232 %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond208.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count212 %indvar.next = add i64 %indvar, 1 br i1 %exitcond208.not, label %for.cond62.for.cond.cleanup65_crit_edge.split, label %for.cond68.preheader, !llvm.loop !26 for.body72: ; preds = %for.body72.prol.loopexit, %for.body72 %indvars.iv199 = phi i64 [ %indvars.iv.next200.1, %for.body72 ], [ %indvars.iv199.unr, %for.body72.prol.loopexit ] %arrayidx76 = getelementptr inbounds i32, ptr %arrayidx74, i64 %indvars.iv199 %64 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %65 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %arrayidx84 = getelementptr inbounds i32, ptr %arrayidx82, i64 %indvars.iv199 %66 = load i32, ptr %arrayidx84, align 4, !tbaa !5 %add85 = add nsw i32 %66, %65 %spec.store.select = call i32 @llvm.smin.i32(i32 %64, i32 %add85) store i32 %spec.store.select, ptr %arrayidx76, align 4 %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1 %arrayidx76.1 = getelementptr inbounds i32, ptr %arrayidx74, i64 %indvars.iv.next200 %67 = load i32, ptr %arrayidx76.1, align 4, !tbaa !5 %68 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %arrayidx84.1 = getelementptr inbounds i32, ptr %arrayidx82, i64 %indvars.iv.next200 %69 = load i32, ptr %arrayidx84.1, align 4, !tbaa !5 %add85.1 = add nsw i32 %69, %68 %spec.store.select.1 = call i32 @llvm.smin.i32(i32 %67, i32 %add85.1) store i32 %spec.store.select.1, ptr %arrayidx76.1, align 4 %indvars.iv.next200.1 = add nuw nsw i64 %indvars.iv199, 2 %exitcond203.not.1 = icmp eq i64 %indvars.iv.next200.1, %wide.trip.count212 br i1 %exitcond203.not.1, label %for.cond68.for.cond.cleanup71_crit_edge, label %for.body72, !llvm.loop !27 for.cond.cleanup114.loopexit.unr-lcssa: ; preds = %for.body115, %for.body115.preheader %spec.select172.lcssa.ph = phi i32 [ undef, %for.body115.preheader ], [ %spec.select172.1, %for.body115 ] %indvars.iv214.unr = phi i64 [ 0, %for.body115.preheader ], [ %indvars.iv.next215.1, %for.body115 ] %ans.0186.unr = phi i32 [ 0, %for.body115.preheader ], [ %spec.select172.1, %for.body115 ] %lcmp.mod252.not = icmp eq i64 %xtraiter251, 0 br i1 %lcmp.mod252.not, label %for.cond.cleanup114, label %for.body115.epil for.body115.epil: ; preds = %for.cond.cleanup114.loopexit.unr-lcssa %arrayidx117.epil = getelementptr inbounds i32, ptr %vla18, i64 %indvars.iv214.unr %70 = load i32, ptr %arrayidx117.epil, align 4, !tbaa !5 %idxprom118.epil = sext i32 %70 to i64 %71 = mul nsw i64 %idxprom118.epil, %1 %arrayidx119.epil = getelementptr inbounds i32, ptr %vla, i64 %71 %arrayidx121.epil = getelementptr inbounds i32, ptr %vla19, i64 %indvars.iv214.unr %72 = load i32, ptr %arrayidx121.epil, align 4, !tbaa !5 %idxprom122.epil = sext i32 %72 to i64 %arrayidx123.epil = getelementptr inbounds i32, ptr %arrayidx119.epil, i64 %idxprom122.epil %73 = load i32, ptr %arrayidx123.epil, align 4, !tbaa !5 %arrayidx125.epil = getelementptr inbounds i32, ptr %vla20, i64 %indvars.iv214.unr %74 = load i32, ptr %arrayidx125.epil, align 4, !tbaa !5 %cmp126.epil = icmp slt i32 %73, %74 %inc128.epil = zext i1 %cmp126.epil to i32 %spec.select172.epil = add nuw nsw i32 %ans.0186.unr, %inc128.epil br label %for.cond.cleanup114 for.cond.cleanup114: ; preds = %for.body115.epil, %for.cond.cleanup114.loopexit.unr-lcssa, %for.cond112.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond112.preheader ], [ %spec.select172.lcssa.ph, %for.cond.cleanup114.loopexit.unr-lcssa ], [ %spec.select172.epil, %for.body115.epil ] %call133 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body115: ; preds = %for.body115, %for.body115.preheader.new %indvars.iv214 = phi i64 [ 0, %for.body115.preheader.new ], [ %indvars.iv.next215.1, %for.body115 ] %ans.0186 = phi i32 [ 0, %for.body115.preheader.new ], [ %spec.select172.1, %for.body115 ] %niter = phi i64 [ 0, %for.body115.preheader.new ], [ %niter.next.1, %for.body115 ] %arrayidx117 = getelementptr inbounds i32, ptr %vla18, i64 %indvars.iv214 %75 = load i32, ptr %arrayidx117, align 8, !tbaa !5 %idxprom118 = sext i32 %75 to i64 %76 = mul nsw i64 %idxprom118, %1 %arrayidx119 = getelementptr inbounds i32, ptr %vla, i64 %76 %arrayidx121 = getelementptr inbounds i32, ptr %vla19, i64 %indvars.iv214 %77 = load i32, ptr %arrayidx121, align 8, !tbaa !5 %idxprom122 = sext i32 %77 to i64 %arrayidx123 = getelementptr inbounds i32, ptr %arrayidx119, i64 %idxprom122 %78 = load i32, ptr %arrayidx123, align 4, !tbaa !5 %arrayidx125 = getelementptr inbounds i32, ptr %vla20, i64 %indvars.iv214 %79 = load i32, ptr %arrayidx125, align 8, !tbaa !5 %cmp126 = icmp slt i32 %78, %79 %inc128 = zext i1 %cmp126 to i32 %spec.select172 = add nuw nsw i32 %ans.0186, %inc128 %indvars.iv.next215 = or i64 %indvars.iv214, 1 %arrayidx117.1 = getelementptr inbounds i32, ptr %vla18, i64 %indvars.iv.next215 %80 = load i32, ptr %arrayidx117.1, align 4, !tbaa !5 %idxprom118.1 = sext i32 %80 to i64 %81 = mul nsw i64 %idxprom118.1, %1 %arrayidx119.1 = getelementptr inbounds i32, ptr %vla, i64 %81 %arrayidx121.1 = getelementptr inbounds i32, ptr %vla19, i64 %indvars.iv.next215 %82 = load i32, ptr %arrayidx121.1, align 4, !tbaa !5 %idxprom122.1 = sext i32 %82 to i64 %arrayidx123.1 = getelementptr inbounds i32, ptr %arrayidx119.1, i64 %idxprom122.1 %83 = load i32, ptr %arrayidx123.1, align 4, !tbaa !5 %arrayidx125.1 = getelementptr inbounds i32, ptr %vla20, i64 %indvars.iv.next215 %84 = load i32, ptr %arrayidx125.1, align 4, !tbaa !5 %cmp126.1 = icmp slt i32 %83, %84 %inc128.1 = zext i1 %cmp126.1 to i32 %spec.select172.1 = add nuw nsw i32 %spec.select172, %inc128.1 %indvars.iv.next215.1 = add nuw nsw i64 %indvars.iv214, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup114.loopexit.unr-lcssa, label %for.body115, !llvm.loop !28 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10} !16 = !{!17} !17 = distinct !{!17, !18} !18 = distinct !{!18, !"LVerDomain"} !19 = !{!20} !20 = distinct !{!20, !18} !21 = !{!17, !22} !22 = distinct !{!22, !18} !23 = !{!22} !24 = distinct !{!24, !10, !11, !12} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10, !11} !28 = distinct !{!28, !10}
#include <stdio.h> #include <string.h> #include <stdbool.h> #define N_MAX 100 #define M_MAX 1000 #define INF 10000000 #define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b)))) typedef unsigned long long ull; int d[M_MAX]; int n, m; int i, j, k; int e[M_MAX][2]; int edge[N_MAX][N_MAX]; int path[N_MAX][N_MAX]; void wf(){ for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { path[i][j] = edge[i][j]; } } for (k = 0; k < n; k++) { for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (path[i][j] > path[i][k] + path[k][j]) path[i][j] = path[i][k] + path[k][j]; } } } return; } void deb(){ for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { printf("%d %d %d\n", i, j, path[i][j]); } } return; } void solve(){ int result = 0; wf(); // deb(); // Saitanro ni fukumareru hen ha sono 2-chouten wo musubu saitanro for (i = 0; i < m; i++) { if (edge[e[i][0]][e[i][1]] == path[e[i][0]][e[i][1]]) result++; } printf("%d\n", m - result); return; } int main (void) { scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { edge[i][j] = ((i == j) ? 0 : INF); } } for (i = 0; i < m; i++) { int a, b, c; scanf("%d%d%d", &a, &b, &c); a--; b--; e[i][0] = a; e[i][1] = b; edge[a][b] = edge[b][a] = c; } solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124736/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124736/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @i = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @edge = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @path = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @k = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @m = dso_local global i32 0, align 4 @e = dso_local local_unnamed_addr global [1000 x [2 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @d = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @wf() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp64 = icmp sgt i32 %0, 0 br i1 %cmp64, label %for.cond1.preheader.us.preheader, label %for.end56.sink.split for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 3 %3 = icmp ult i32 %0, 4 br i1 %3, label %for.cond13.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader %unroll_iter = and i64 %1, 4294967292 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.3, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.3, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @path, i64 %4 %scevgep83 = getelementptr i8, ptr @edge, i64 %4 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep, ptr align 16 %scevgep83, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %6 = add nuw i64 %5, 400 %scevgep.1 = getelementptr i8, ptr @path, i64 %6 %scevgep83.1 = getelementptr i8, ptr @edge, i64 %6 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.1, ptr align 16 %scevgep83.1, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %8 = add nuw i64 %7, 800 %scevgep.2 = getelementptr i8, ptr @path, i64 %8 %scevgep83.2 = getelementptr i8, ptr @edge, i64 %8 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.2, ptr align 16 %scevgep83.2, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %10 = add nuw i64 %9, 1200 %scevgep.3 = getelementptr i8, ptr @path, i64 %10 %scevgep83.3 = getelementptr i8, ptr @edge, i64 %10 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.3, ptr align 16 %scevgep83.3, i64 %2, i1 false), !tbaa !5 %indvar.next.3 = add nuw nsw i64 %indvar, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond13.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9 for.cond13.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.3, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond13.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond13.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond13.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond13.preheader.unr-lcssa ] %11 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @path, i64 %11 %scevgep83.epil = getelementptr i8, ptr @edge, i64 %11 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.epil, ptr align 16 %scevgep83.epil, i64 %2, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond13.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond13.preheader.unr-lcssa store i32 %0, ptr @j, align 4, !tbaa !5 store i32 %0, ptr @i, align 4, !tbaa !5 br i1 %cmp64, label %for.cond16.preheader.us.preheader, label %for.end56 for.cond16.preheader.us.preheader: ; preds = %for.cond13.preheader %wide.trip.count98 = zext i32 %0 to i64 %12 = shl nuw nsw i64 %1, 2 %13 = getelementptr i8, ptr @path, i64 %12 %min.iters.check = icmp ult i32 %0, 12 %14 = getelementptr i8, ptr @path, i64 %12 %n.vec = and i64 %1, 4294967288 %cmp.n = icmp eq i64 %n.vec, %1 %xtraiter129 = and i64 %wide.trip.count98, 1 %lcmp.mod130.not = icmp eq i64 %xtraiter129, 0 %15 = sub nsw i64 0, %wide.trip.count98 br label %for.cond16.preheader.us for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.cond16.for.inc54_crit_edge.split.us.us %indvars.iv95 = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next96, %for.cond16.for.inc54_crit_edge.split.us.us ] %16 = shl nuw nsw i64 %indvars.iv95, 2 %17 = mul nuw nsw i64 %indvars.iv95, 400 %scevgep105 = getelementptr i8, ptr @path, i64 %17 %scevgep106 = getelementptr i8, ptr %13, i64 %17 %gep = getelementptr i8, ptr getelementptr (i8, ptr @path, i64 4), i64 %16 %18 = getelementptr i8, ptr @path, i64 %16 %bound0 = icmp ugt ptr %gep, @path %bound1 = icmp ult ptr %18, %14 %found.conflict = and i1 %bound0, %bound1 br label %for.cond19.preheader.us.us for.cond19.preheader.us.us: ; preds = %for.cond19.for.inc51_crit_edge.us.us, %for.cond16.preheader.us %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.cond19.for.inc51_crit_edge.us.us ], [ 0, %for.cond16.preheader.us ] %arrayidx29.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %indvars.iv95 br i1 %min.iters.check, label %for.body21.us.us.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond19.preheader.us.us %19 = mul nuw nsw i64 %indvars.iv90, 400 %scevgep102 = getelementptr i8, ptr %14, i64 %19 %scevgep101 = getelementptr i8, ptr @path, i64 %19 %bound0107 = icmp ult ptr %scevgep101, %scevgep106 %bound1108 = icmp ult ptr %scevgep105, %scevgep102 %found.conflict109 = and i1 %bound0107, %bound1108 %conflict.rdx = or i1 %found.conflict, %found.conflict109 br i1 %conflict.rdx, label %for.body21.us.us.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %20 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5, !alias.scope !13 %broadcast.splatinsert113 = insertelement <4 x i32> poison, i32 %20, i64 0 %broadcast.splat114 = shufflevector <4 x i32> %broadcast.splatinsert113, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %pred.store.continue128, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue128 ] %21 = or i64 %index, 4 %22 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %index %wide.load = load <4 x i32>, ptr %22, align 16, !tbaa !5, !alias.scope !16, !noalias !18 %23 = getelementptr inbounds i32, ptr %22, i64 4 %wide.load110 = load <4 x i32>, ptr %23, align 16, !tbaa !5, !alias.scope !16, !noalias !18 %24 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95, i64 %index %wide.load111 = load <4 x i32>, ptr %24, align 16, !tbaa !5, !alias.scope !20 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load112 = load <4 x i32>, ptr %25, align 16, !tbaa !5, !alias.scope !20 %26 = add nsw <4 x i32> %wide.load111, %broadcast.splat114 %27 = add nsw <4 x i32> %wide.load112, %broadcast.splat114 %28 = icmp sgt <4 x i32> %wide.load, %26 %29 = icmp sgt <4 x i32> %wide.load110, %27 %30 = extractelement <4 x i1> %28, i64 0 br i1 %30, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %31 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %index %32 = extractelement <4 x i32> %26, i64 0 store i32 %32, ptr %31, align 16, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %33 = extractelement <4 x i1> %28, i64 1 br i1 %33, label %pred.store.if115, label %pred.store.continue116 pred.store.if115: ; preds = %pred.store.continue %34 = or i64 %index, 1 %35 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %34 %36 = extractelement <4 x i32> %26, i64 1 store i32 %36, ptr %35, align 4, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue116 pred.store.continue116: ; preds = %pred.store.if115, %pred.store.continue %37 = extractelement <4 x i1> %28, i64 2 br i1 %37, label %pred.store.if117, label %pred.store.continue118 pred.store.if117: ; preds = %pred.store.continue116 %38 = or i64 %index, 2 %39 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %38 %40 = extractelement <4 x i32> %26, i64 2 store i32 %40, ptr %39, align 8, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue118 pred.store.continue118: ; preds = %pred.store.if117, %pred.store.continue116 %41 = extractelement <4 x i1> %28, i64 3 br i1 %41, label %pred.store.if119, label %pred.store.continue120 pred.store.if119: ; preds = %pred.store.continue118 %42 = or i64 %index, 3 %43 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %42 %44 = extractelement <4 x i32> %26, i64 3 store i32 %44, ptr %43, align 4, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue120 pred.store.continue120: ; preds = %pred.store.if119, %pred.store.continue118 %45 = extractelement <4 x i1> %29, i64 0 br i1 %45, label %pred.store.if121, label %pred.store.continue122 pred.store.if121: ; preds = %pred.store.continue120 %46 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %21 %47 = extractelement <4 x i32> %27, i64 0 store i32 %47, ptr %46, align 16, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue122 pred.store.continue122: ; preds = %pred.store.if121, %pred.store.continue120 %48 = extractelement <4 x i1> %29, i64 1 br i1 %48, label %pred.store.if123, label %pred.store.continue124 pred.store.if123: ; preds = %pred.store.continue122 %49 = or i64 %index, 5 %50 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %49 %51 = extractelement <4 x i32> %27, i64 1 store i32 %51, ptr %50, align 4, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue124 pred.store.continue124: ; preds = %pred.store.if123, %pred.store.continue122 %52 = extractelement <4 x i1> %29, i64 2 br i1 %52, label %pred.store.if125, label %pred.store.continue126 pred.store.if125: ; preds = %pred.store.continue124 %53 = or i64 %index, 6 %54 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %53 %55 = extractelement <4 x i32> %27, i64 2 store i32 %55, ptr %54, align 8, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue126 pred.store.continue126: ; preds = %pred.store.if125, %pred.store.continue124 %56 = extractelement <4 x i1> %29, i64 3 br i1 %56, label %pred.store.if127, label %pred.store.continue128 pred.store.if127: ; preds = %pred.store.continue126 %57 = or i64 %index, 7 %58 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %57 %59 = extractelement <4 x i32> %27, i64 3 store i32 %59, ptr %58, align 4, !tbaa !5, !alias.scope !16, !noalias !18 br label %pred.store.continue128 pred.store.continue128: ; preds = %pred.store.if127, %pred.store.continue126 %index.next = add nuw i64 %index, 8 %60 = icmp eq i64 %index.next, %n.vec br i1 %60, label %middle.block, label %vector.body, !llvm.loop !21 middle.block: ; preds = %pred.store.continue128 br i1 %cmp.n, label %for.cond19.for.inc51_crit_edge.us.us, label %for.body21.us.us.preheader for.body21.us.us.preheader: ; preds = %vector.memcheck, %for.cond19.preheader.us.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond19.preheader.us.us ], [ %n.vec, %middle.block ] br i1 %lcmp.mod130.not, label %for.body21.us.us.prol.loopexit, label %for.body21.us.us.prol for.body21.us.us.prol: ; preds = %for.body21.us.us.preheader %arrayidx25.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %indvars.iv.ph %61 = load i32, ptr %arrayidx25.us.us.prol, align 16, !tbaa !5 %62 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5 %arrayidx33.us.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95, i64 %indvars.iv.ph %63 = load i32, ptr %arrayidx33.us.us.prol, align 16, !tbaa !5 %add.us.us.prol = add nsw i32 %63, %62 %cmp34.us.us.prol = icmp sgt i32 %61, %add.us.us.prol br i1 %cmp34.us.us.prol, label %if.then.us.us.prol, label %for.inc48.us.us.prol if.then.us.us.prol: ; preds = %for.body21.us.us.prol store i32 %add.us.us.prol, ptr %arrayidx25.us.us.prol, align 16, !tbaa !5 br label %for.inc48.us.us.prol for.inc48.us.us.prol: ; preds = %if.then.us.us.prol, %for.body21.us.us.prol %indvars.iv.next.prol = or i64 %indvars.iv.ph, 1 br label %for.body21.us.us.prol.loopexit for.body21.us.us.prol.loopexit: ; preds = %for.inc48.us.us.prol, %for.body21.us.us.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body21.us.us.preheader ], [ %indvars.iv.next.prol, %for.inc48.us.us.prol ] %64 = xor i64 %indvars.iv.ph, %15 %65 = icmp eq i64 %64, -1 br i1 %65, label %for.cond19.for.inc51_crit_edge.us.us, label %for.body21.us.us for.body21.us.us: ; preds = %for.body21.us.us.prol.loopexit, %for.inc48.us.us.1 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc48.us.us.1 ], [ %indvars.iv.unr, %for.body21.us.us.prol.loopexit ] %arrayidx25.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %indvars.iv %66 = load i32, ptr %arrayidx25.us.us, align 4, !tbaa !5 %67 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5 %arrayidx33.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95, i64 %indvars.iv %68 = load i32, ptr %arrayidx33.us.us, align 4, !tbaa !5 %add.us.us = add nsw i32 %68, %67 %cmp34.us.us = icmp sgt i32 %66, %add.us.us br i1 %cmp34.us.us, label %if.then.us.us, label %for.inc48.us.us if.then.us.us: ; preds = %for.body21.us.us store i32 %add.us.us, ptr %arrayidx25.us.us, align 4, !tbaa !5 br label %for.inc48.us.us for.inc48.us.us: ; preds = %if.then.us.us, %for.body21.us.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx25.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90, i64 %indvars.iv.next %69 = load i32, ptr %arrayidx25.us.us.1, align 4, !tbaa !5 %70 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5 %arrayidx33.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95, i64 %indvars.iv.next %71 = load i32, ptr %arrayidx33.us.us.1, align 4, !tbaa !5 %add.us.us.1 = add nsw i32 %71, %70 %cmp34.us.us.1 = icmp sgt i32 %69, %add.us.us.1 br i1 %cmp34.us.us.1, label %if.then.us.us.1, label %for.inc48.us.us.1 if.then.us.us.1: ; preds = %for.inc48.us.us store i32 %add.us.us.1, ptr %arrayidx25.us.us.1, align 4, !tbaa !5 br label %for.inc48.us.us.1 for.inc48.us.us.1: ; preds = %if.then.us.us.1, %for.inc48.us.us %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond89.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count98 br i1 %exitcond89.not.1, label %for.cond19.for.inc51_crit_edge.us.us, label %for.body21.us.us, !llvm.loop !24 for.cond19.for.inc51_crit_edge.us.us: ; preds = %for.body21.us.us.prol.loopexit, %for.inc48.us.us.1, %middle.block %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %exitcond94.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count98 br i1 %exitcond94.not, label %for.cond16.for.inc54_crit_edge.split.us.us, label %for.cond19.preheader.us.us, !llvm.loop !25 for.cond16.for.inc54_crit_edge.split.us.us: ; preds = %for.cond19.for.inc51_crit_edge.us.us %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98 br i1 %exitcond99.not, label %for.cond13.for.end56_crit_edge.split.us, label %for.cond16.preheader.us, !llvm.loop !26 for.cond13.for.end56_crit_edge.split.us: ; preds = %for.cond16.for.inc54_crit_edge.split.us.us store i32 %0, ptr @j, align 4, !tbaa !5 br label %for.end56.sink.split for.end56.sink.split: ; preds = %entry, %for.cond13.for.end56_crit_edge.split.us %.sink = phi i32 [ %0, %for.cond13.for.end56_crit_edge.split.us ], [ 0, %entry ] store i32 %.sink, ptr @i, align 4, !tbaa !5 br label %for.end56 for.end56: ; preds = %for.end56.sink.split, %for.cond13.preheader %storemerge58.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ %.sink, %for.end56.sink.split ] store i32 %storemerge58.lcssa, ptr @k, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @deb() local_unnamed_addr #1 { entry: store i32 0, ptr @i, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %0, 0 br i1 %cmp12, label %for.cond1.preheader, label %for.end8 for.cond1.preheader: ; preds = %entry, %for.inc6 %1 = phi i32 [ %7, %for.inc6 ], [ %0, %entry ] %2 = phi i32 [ %inc7, %for.inc6 ], [ 0, %entry ] store i32 0, ptr @j, align 4, !tbaa !5 %cmp210 = icmp sgt i32 %1, 0 br i1 %cmp210, label %for.body3, label %for.inc6 for.body3: ; preds = %for.cond1.preheader, %for.body3 %storemerge911 = phi i32 [ %inc, %for.body3 ], [ 0, %for.cond1.preheader ] %3 = load i32, ptr @i, align 4, !tbaa !5 %idxprom = sext i32 %3 to i64 %idxprom4 = sext i32 %storemerge911 to i64 %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %idxprom, i64 %idxprom4 %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3, i32 noundef %storemerge911, i32 noundef %4) %5 = load i32, ptr @j, align 4, !tbaa !5 %inc = add nsw i32 %5, 1 store i32 %inc, ptr @j, align 4, !tbaa !5 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %6 br i1 %cmp2, label %for.body3, label %for.inc6.loopexit, !llvm.loop !27 for.inc6.loopexit: ; preds = %for.body3 %.pre = load i32, ptr @i, align 4, !tbaa !5 br label %for.inc6 for.inc6: ; preds = %for.inc6.loopexit, %for.cond1.preheader %7 = phi i32 [ %6, %for.inc6.loopexit ], [ %1, %for.cond1.preheader ] %8 = phi i32 [ %.pre, %for.inc6.loopexit ], [ %2, %for.cond1.preheader ] %inc7 = add nsw i32 %8, 1 store i32 %inc7, ptr @i, align 4, !tbaa !5 %cmp = icmp slt i32 %inc7, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end8, !llvm.loop !28 for.end8: ; preds = %for.inc6, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #1 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp64.i = icmp sgt i32 %0, 0 br i1 %cmp64.i, label %for.cond1.preheader.us.preheader.i, label %wf.exit for.cond1.preheader.us.preheader.i: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 3 %3 = icmp ult i32 %0, 4 br i1 %3, label %for.cond16.preheader.us.i.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.i.new for.cond1.preheader.us.preheader.i.new: ; preds = %for.cond1.preheader.us.preheader.i %unroll_iter = and i64 %1, 4294967292 br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %for.cond1.preheader.us.i, %for.cond1.preheader.us.preheader.i.new %indvar.i = phi i64 [ 0, %for.cond1.preheader.us.preheader.i.new ], [ %indvar.next.i.3, %for.cond1.preheader.us.i ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.i.new ], [ %niter.next.3, %for.cond1.preheader.us.i ] %4 = mul nuw nsw i64 %indvar.i, 400 %scevgep.i = getelementptr i8, ptr @path, i64 %4 %scevgep83.i = getelementptr i8, ptr @edge, i64 %4 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i, ptr align 16 %scevgep83.i, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar.i, 400 %6 = add nuw i64 %5, 400 %scevgep.i.1 = getelementptr i8, ptr @path, i64 %6 %scevgep83.i.1 = getelementptr i8, ptr @edge, i64 %6 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i.1, ptr align 16 %scevgep83.i.1, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar.i, 400 %8 = add nuw i64 %7, 800 %scevgep.i.2 = getelementptr i8, ptr @path, i64 %8 %scevgep83.i.2 = getelementptr i8, ptr @edge, i64 %8 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i.2, ptr align 16 %scevgep83.i.2, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar.i, 400 %10 = add nuw i64 %9, 1200 %scevgep.i.3 = getelementptr i8, ptr @path, i64 %10 %scevgep83.i.3 = getelementptr i8, ptr @edge, i64 %10 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i.3, ptr align 16 %scevgep83.i.3, i64 %2, i1 false), !tbaa !5 %indvar.next.i.3 = add nuw nsw i64 %indvar.i, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond16.preheader.us.i.preheader.unr-lcssa, label %for.cond1.preheader.us.i, !llvm.loop !9 for.cond16.preheader.us.i.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us.i, %for.cond1.preheader.us.preheader.i %indvar.i.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader.i ], [ %indvar.next.i.3, %for.cond1.preheader.us.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond16.preheader.us.i.preheader, label %for.cond1.preheader.us.i.epil for.cond1.preheader.us.i.epil: ; preds = %for.cond16.preheader.us.i.preheader.unr-lcssa, %for.cond1.preheader.us.i.epil %indvar.i.epil = phi i64 [ %indvar.next.i.epil, %for.cond1.preheader.us.i.epil ], [ %indvar.i.unr, %for.cond16.preheader.us.i.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.i.epil ], [ 0, %for.cond16.preheader.us.i.preheader.unr-lcssa ] %11 = mul nuw nsw i64 %indvar.i.epil, 400 %scevgep.i.epil = getelementptr i8, ptr @path, i64 %11 %scevgep83.i.epil = getelementptr i8, ptr @edge, i64 %11 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i.epil, ptr align 16 %scevgep83.i.epil, i64 %2, i1 false), !tbaa !5 %indvar.next.i.epil = add nuw nsw i64 %indvar.i.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond16.preheader.us.i.preheader, label %for.cond1.preheader.us.i.epil, !llvm.loop !30 for.cond16.preheader.us.i.preheader: ; preds = %for.cond1.preheader.us.i.epil, %for.cond16.preheader.us.i.preheader.unr-lcssa %12 = shl nuw nsw i64 %1, 2 %13 = getelementptr i8, ptr @path, i64 %12 %min.iters.check = icmp ult i32 %0, 12 %14 = getelementptr i8, ptr @path, i64 %12 %n.vec = and i64 %1, 4294967288 %cmp.n = icmp eq i64 %n.vec, %1 %xtraiter56 = and i64 %1, 1 %lcmp.mod57.not = icmp eq i64 %xtraiter56, 0 %15 = sub nsw i64 0, %1 br label %for.cond16.preheader.us.i for.cond16.preheader.us.i: ; preds = %for.cond16.preheader.us.i.preheader, %for.cond16.for.inc54_crit_edge.split.us.us.i %indvars.iv95.i = phi i64 [ %indvars.iv.next96.i, %for.cond16.for.inc54_crit_edge.split.us.us.i ], [ 0, %for.cond16.preheader.us.i.preheader ] %16 = shl nuw nsw i64 %indvars.iv95.i, 2 %17 = mul nuw nsw i64 %indvars.iv95.i, 400 %scevgep32 = getelementptr i8, ptr @path, i64 %17 %scevgep33 = getelementptr i8, ptr %13, i64 %17 %gep = getelementptr i8, ptr getelementptr (i8, ptr @path, i64 4), i64 %16 %18 = getelementptr i8, ptr @path, i64 %16 %bound0 = icmp ugt ptr %gep, @path %bound1 = icmp ult ptr %18, %14 %found.conflict = and i1 %bound0, %bound1 br label %for.cond19.preheader.us.us.i for.cond19.preheader.us.us.i: ; preds = %for.cond19.for.inc51_crit_edge.us.us.i, %for.cond16.preheader.us.i %indvars.iv90.i = phi i64 [ %indvars.iv.next91.i, %for.cond19.for.inc51_crit_edge.us.us.i ], [ 0, %for.cond16.preheader.us.i ] %arrayidx29.us.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %indvars.iv95.i br i1 %min.iters.check, label %for.body21.us.us.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond19.preheader.us.us.i %19 = mul nuw nsw i64 %indvars.iv90.i, 400 %scevgep29 = getelementptr i8, ptr %14, i64 %19 %scevgep = getelementptr i8, ptr @path, i64 %19 %bound034 = icmp ult ptr %scevgep, %scevgep33 %bound135 = icmp ult ptr %scevgep32, %scevgep29 %found.conflict36 = and i1 %bound034, %bound135 %conflict.rdx = or i1 %found.conflict, %found.conflict36 br i1 %conflict.rdx, label %for.body21.us.us.i.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %20 = load i32, ptr %arrayidx29.us.us.i, align 4, !tbaa !5, !alias.scope !31 %broadcast.splatinsert40 = insertelement <4 x i32> poison, i32 %20, i64 0 %broadcast.splat41 = shufflevector <4 x i32> %broadcast.splatinsert40, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %pred.store.continue55, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue55 ] %21 = or i64 %index, 4 %22 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %index %wide.load = load <4 x i32>, ptr %22, align 16, !tbaa !5, !alias.scope !34, !noalias !36 %23 = getelementptr inbounds i32, ptr %22, i64 4 %wide.load37 = load <4 x i32>, ptr %23, align 16, !tbaa !5, !alias.scope !34, !noalias !36 %24 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95.i, i64 %index %wide.load38 = load <4 x i32>, ptr %24, align 16, !tbaa !5, !alias.scope !38 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load39 = load <4 x i32>, ptr %25, align 16, !tbaa !5, !alias.scope !38 %26 = add nsw <4 x i32> %wide.load38, %broadcast.splat41 %27 = add nsw <4 x i32> %wide.load39, %broadcast.splat41 %28 = icmp sgt <4 x i32> %wide.load, %26 %29 = icmp sgt <4 x i32> %wide.load37, %27 %30 = extractelement <4 x i1> %28, i64 0 br i1 %30, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %31 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %index %32 = extractelement <4 x i32> %26, i64 0 store i32 %32, ptr %31, align 16, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %33 = extractelement <4 x i1> %28, i64 1 br i1 %33, label %pred.store.if42, label %pred.store.continue43 pred.store.if42: ; preds = %pred.store.continue %34 = or i64 %index, 1 %35 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %34 %36 = extractelement <4 x i32> %26, i64 1 store i32 %36, ptr %35, align 4, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue43 pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue %37 = extractelement <4 x i1> %28, i64 2 br i1 %37, label %pred.store.if44, label %pred.store.continue45 pred.store.if44: ; preds = %pred.store.continue43 %38 = or i64 %index, 2 %39 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %38 %40 = extractelement <4 x i32> %26, i64 2 store i32 %40, ptr %39, align 8, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue45 pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43 %41 = extractelement <4 x i1> %28, i64 3 br i1 %41, label %pred.store.if46, label %pred.store.continue47 pred.store.if46: ; preds = %pred.store.continue45 %42 = or i64 %index, 3 %43 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %42 %44 = extractelement <4 x i32> %26, i64 3 store i32 %44, ptr %43, align 4, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue47 pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45 %45 = extractelement <4 x i1> %29, i64 0 br i1 %45, label %pred.store.if48, label %pred.store.continue49 pred.store.if48: ; preds = %pred.store.continue47 %46 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %21 %47 = extractelement <4 x i32> %27, i64 0 store i32 %47, ptr %46, align 16, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue49 pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47 %48 = extractelement <4 x i1> %29, i64 1 br i1 %48, label %pred.store.if50, label %pred.store.continue51 pred.store.if50: ; preds = %pred.store.continue49 %49 = or i64 %index, 5 %50 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %49 %51 = extractelement <4 x i32> %27, i64 1 store i32 %51, ptr %50, align 4, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue51 pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49 %52 = extractelement <4 x i1> %29, i64 2 br i1 %52, label %pred.store.if52, label %pred.store.continue53 pred.store.if52: ; preds = %pred.store.continue51 %53 = or i64 %index, 6 %54 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %53 %55 = extractelement <4 x i32> %27, i64 2 store i32 %55, ptr %54, align 8, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue53 pred.store.continue53: ; preds = %pred.store.if52, %pred.store.continue51 %56 = extractelement <4 x i1> %29, i64 3 br i1 %56, label %pred.store.if54, label %pred.store.continue55 pred.store.if54: ; preds = %pred.store.continue53 %57 = or i64 %index, 7 %58 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %57 %59 = extractelement <4 x i32> %27, i64 3 store i32 %59, ptr %58, align 4, !tbaa !5, !alias.scope !34, !noalias !36 br label %pred.store.continue55 pred.store.continue55: ; preds = %pred.store.if54, %pred.store.continue53 %index.next = add nuw i64 %index, 8 %60 = icmp eq i64 %index.next, %n.vec br i1 %60, label %middle.block, label %vector.body, !llvm.loop !39 middle.block: ; preds = %pred.store.continue55 br i1 %cmp.n, label %for.cond19.for.inc51_crit_edge.us.us.i, label %for.body21.us.us.i.preheader for.body21.us.us.i.preheader: ; preds = %vector.memcheck, %for.cond19.preheader.us.us.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond19.preheader.us.us.i ], [ %n.vec, %middle.block ] br i1 %lcmp.mod57.not, label %for.body21.us.us.i.prol.loopexit, label %for.body21.us.us.i.prol for.body21.us.us.i.prol: ; preds = %for.body21.us.us.i.preheader %arrayidx25.us.us.i.prol = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %indvars.iv.i.ph %61 = load i32, ptr %arrayidx25.us.us.i.prol, align 16, !tbaa !5 %62 = load i32, ptr %arrayidx29.us.us.i, align 4, !tbaa !5 %arrayidx33.us.us.i.prol = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95.i, i64 %indvars.iv.i.ph %63 = load i32, ptr %arrayidx33.us.us.i.prol, align 16, !tbaa !5 %add.us.us.i.prol = add nsw i32 %63, %62 %cmp34.us.us.i.prol = icmp sgt i32 %61, %add.us.us.i.prol br i1 %cmp34.us.us.i.prol, label %if.then.us.us.i.prol, label %for.inc48.us.us.i.prol if.then.us.us.i.prol: ; preds = %for.body21.us.us.i.prol store i32 %add.us.us.i.prol, ptr %arrayidx25.us.us.i.prol, align 16, !tbaa !5 br label %for.inc48.us.us.i.prol for.inc48.us.us.i.prol: ; preds = %if.then.us.us.i.prol, %for.body21.us.us.i.prol %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body21.us.us.i.prol.loopexit for.body21.us.us.i.prol.loopexit: ; preds = %for.inc48.us.us.i.prol, %for.body21.us.us.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body21.us.us.i.preheader ], [ %indvars.iv.next.i.prol, %for.inc48.us.us.i.prol ] %64 = xor i64 %indvars.iv.i.ph, %15 %65 = icmp eq i64 %64, -1 br i1 %65, label %for.cond19.for.inc51_crit_edge.us.us.i, label %for.body21.us.us.i for.body21.us.us.i: ; preds = %for.body21.us.us.i.prol.loopexit, %for.inc48.us.us.i.1 %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc48.us.us.i.1 ], [ %indvars.iv.i.unr, %for.body21.us.us.i.prol.loopexit ] %arrayidx25.us.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %indvars.iv.i %66 = load i32, ptr %arrayidx25.us.us.i, align 4, !tbaa !5 %67 = load i32, ptr %arrayidx29.us.us.i, align 4, !tbaa !5 %arrayidx33.us.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95.i, i64 %indvars.iv.i %68 = load i32, ptr %arrayidx33.us.us.i, align 4, !tbaa !5 %add.us.us.i = add nsw i32 %68, %67 %cmp34.us.us.i = icmp sgt i32 %66, %add.us.us.i br i1 %cmp34.us.us.i, label %if.then.us.us.i, label %for.inc48.us.us.i if.then.us.us.i: ; preds = %for.body21.us.us.i store i32 %add.us.us.i, ptr %arrayidx25.us.us.i, align 4, !tbaa !5 br label %for.inc48.us.us.i for.inc48.us.us.i: ; preds = %if.then.us.us.i, %for.body21.us.us.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx25.us.us.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv90.i, i64 %indvars.iv.next.i %69 = load i32, ptr %arrayidx25.us.us.i.1, align 4, !tbaa !5 %70 = load i32, ptr %arrayidx29.us.us.i, align 4, !tbaa !5 %arrayidx33.us.us.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %indvars.iv95.i, i64 %indvars.iv.next.i %71 = load i32, ptr %arrayidx33.us.us.i.1, align 4, !tbaa !5 %add.us.us.i.1 = add nsw i32 %71, %70 %cmp34.us.us.i.1 = icmp sgt i32 %69, %add.us.us.i.1 br i1 %cmp34.us.us.i.1, label %if.then.us.us.i.1, label %for.inc48.us.us.i.1 if.then.us.us.i.1: ; preds = %for.inc48.us.us.i store i32 %add.us.us.i.1, ptr %arrayidx25.us.us.i.1, align 4, !tbaa !5 br label %for.inc48.us.us.i.1 for.inc48.us.us.i.1: ; preds = %if.then.us.us.i.1, %for.inc48.us.us.i %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %exitcond89.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %1 br i1 %exitcond89.not.i.1, label %for.cond19.for.inc51_crit_edge.us.us.i, label %for.body21.us.us.i, !llvm.loop !40 for.cond19.for.inc51_crit_edge.us.us.i: ; preds = %for.body21.us.us.i.prol.loopexit, %for.inc48.us.us.i.1, %middle.block %indvars.iv.next91.i = add nuw nsw i64 %indvars.iv90.i, 1 %exitcond94.not.i = icmp eq i64 %indvars.iv.next91.i, %1 br i1 %exitcond94.not.i, label %for.cond16.for.inc54_crit_edge.split.us.us.i, label %for.cond19.preheader.us.us.i, !llvm.loop !25 for.cond16.for.inc54_crit_edge.split.us.us.i: ; preds = %for.cond19.for.inc51_crit_edge.us.us.i %indvars.iv.next96.i = add nuw nsw i64 %indvars.iv95.i, 1 %exitcond99.not.i = icmp eq i64 %indvars.iv.next96.i, %1 br i1 %exitcond99.not.i, label %for.cond13.for.end56_crit_edge.split.us.i, label %for.cond16.preheader.us.i, !llvm.loop !26 for.cond13.for.end56_crit_edge.split.us.i: ; preds = %for.cond16.for.inc54_crit_edge.split.us.us.i store i32 %0, ptr @j, align 4, !tbaa !5 br label %wf.exit wf.exit: ; preds = %entry, %for.cond13.for.end56_crit_edge.split.us.i %.sink.i = phi i32 [ %0, %for.cond13.for.end56_crit_edge.split.us.i ], [ 0, %entry ] store i32 %.sink.i, ptr @k, align 4, !tbaa !5 %72 = load i32, ptr @m, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %72, 0 br i1 %cmp23, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %wf.exit %wide.trip.count = zext i32 %72 to i64 %xtraiter58 = and i64 %wide.trip.count, 1 %73 = icmp eq i32 %72, 1 br i1 %73, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter62 = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %result.025 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ] %niter63 = phi i64 [ 0, %for.body.preheader.new ], [ %niter63.next.1, %for.body ] %arrayidx = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv %74 = load i32, ptr %arrayidx, align 16, !tbaa !5 %idxprom2 = sext i32 %74 to i64 %arrayidx6 = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 1 %75 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %75 to i64 %arrayidx8 = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %idxprom2, i64 %idxprom7 %76 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %idxprom2, i64 %idxprom7 %77 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %76, %77 %inc = zext i1 %cmp19 to i32 %spec.select = add nuw nsw i32 %result.025, %inc %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv.next %78 = load i32, ptr %arrayidx.1, align 8, !tbaa !5 %idxprom2.1 = sext i32 %78 to i64 %arrayidx6.1 = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv.next, i64 1 %79 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %idxprom7.1 = sext i32 %79 to i64 %arrayidx8.1 = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %idxprom2.1, i64 %idxprom7.1 %80 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %arrayidx18.1 = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %idxprom2.1, i64 %idxprom7.1 %81 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %cmp19.1 = icmp eq i32 %80, %81 %inc.1 = zext i1 %cmp19.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %inc.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter63.next.1 = add i64 %niter63, 2 %niter63.ncmp.1 = icmp eq i64 %niter63.next.1, %unroll_iter62 br i1 %niter63.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !41 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %result.025.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ] %lcmp.mod60.not = icmp eq i64 %xtraiter58, 0 br i1 %lcmp.mod60.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv.unr %82 = load i32, ptr %arrayidx.epil, align 8, !tbaa !5 %idxprom2.epil = sext i32 %82 to i64 %arrayidx6.epil = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %indvars.iv.unr, i64 1 %83 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %idxprom7.epil = sext i32 %83 to i64 %arrayidx8.epil = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %idxprom2.epil, i64 %idxprom7.epil %84 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %arrayidx18.epil = getelementptr inbounds [100 x [100 x i32]], ptr @path, i64 0, i64 %idxprom2.epil, i64 %idxprom7.epil %85 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5 %cmp19.epil = icmp eq i32 %84, %85 %inc.epil = zext i1 %cmp19.epil to i32 %spec.select.epil = add nuw nsw i32 %result.025.unr, %inc.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %wf.exit %storemerge.lcssa = phi i32 [ 0, %wf.exit ], [ %72, %for.end.loopexit.unr-lcssa ], [ %72, %for.body.epil ] %result.0.lcssa = phi i32 [ 0, %wf.exit ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5 %sub = sub nsw i32 %72, %result.0.lcssa %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %0, 0 br i1 %cmp36, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader for.cond1.preheader.us.preheader: ; preds = %entry %wide.trip.count45 = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 %n.vec = and i64 %wide.trip.count45, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count45 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc7_crit_edge.us %indvars.iv42 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next43, %for.cond1.for.inc7_crit_edge.us ] br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond1.preheader.us %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv42, i64 0 %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4> %1 = icmp eq <4 x i64> %broadcast.splat, %vec.ind %2 = icmp eq <4 x i64> %broadcast.splat, %step.add %3 = select <4 x i1> %1, <4 x i32> zeroinitializer, <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000> %4 = select <4 x i1> %2, <4 x i32> zeroinitializer, <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000> %5 = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %indvars.iv42, i64 %index store <4 x i32> %3, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> %4, ptr %6, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !42 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond1.for.inc7_crit_edge.us, label %for.body3.us.preheader for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ] br label %for.body3.us for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.us ], [ %indvars.iv.ph, %for.body3.us.preheader ] %cmp4.us = icmp eq i64 %indvars.iv42, %indvars.iv %cond.us = select i1 %cmp4.us, i32 0, i32 10000000 %arrayidx6.us = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %indvars.iv42, i64 %indvars.iv store i32 %cond.us, ptr %arrayidx6.us, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count45 br i1 %exitcond.not, label %for.cond1.for.inc7_crit_edge.us, label %for.body3.us, !llvm.loop !43 for.cond1.for.inc7_crit_edge.us: ; preds = %for.body3.us, %middle.block %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond46.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count45 br i1 %exitcond46.not, label %for.cond.for.cond10.preheader_crit_edge, label %for.cond1.preheader.us, !llvm.loop !44 for.cond.for.cond10.preheader_crit_edge: ; preds = %for.cond1.for.inc7_crit_edge.us store i32 %0, ptr @j, align 4, !tbaa !5 br label %for.cond10.preheader for.cond10.preheader: ; preds = %for.cond.for.cond10.preheader_crit_edge, %entry store i32 0, ptr @i, align 4, !tbaa !5 %8 = load i32, ptr @m, align 4, !tbaa !5 %cmp1140 = icmp sgt i32 %8, 0 br i1 %cmp1140, label %for.body12, label %for.end31 for.body12: ; preds = %for.cond10.preheader, %for.body12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %9 = load i32, ptr %a, align 4, !tbaa !5 %dec = add nsw i32 %9, -1 %10 = load i32, ptr %b, align 4, !tbaa !5 %dec14 = add nsw i32 %10, -1 %11 = load i32, ptr @i, align 4, !tbaa !5 %idxprom15 = sext i32 %11 to i64 %arrayidx16 = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %idxprom15 store i32 %dec, ptr %arrayidx16, align 8, !tbaa !5 %arrayidx20 = getelementptr inbounds [1000 x [2 x i32]], ptr @e, i64 0, i64 %idxprom15, i64 1 store i32 %dec14, ptr %arrayidx20, align 4, !tbaa !5 %12 = load i32, ptr %c, align 4, !tbaa !5 %idxprom21 = sext i32 %dec14 to i64 %idxprom23 = sext i32 %dec to i64 %arrayidx24 = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %idxprom21, i64 %idxprom23 store i32 %12, ptr %arrayidx24, align 4, !tbaa !5 %arrayidx28 = getelementptr inbounds [100 x [100 x i32]], ptr @edge, i64 0, i64 %idxprom23, i64 %idxprom21 store i32 %12, ptr %arrayidx28, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 %inc30 = add nsw i32 %11, 1 store i32 %inc30, ptr @i, align 4, !tbaa !5 %13 = load i32, ptr @m, align 4, !tbaa !5 %cmp11 = icmp slt i32 %inc30, %13 br i1 %cmp11, label %for.body12, label %for.end31, !llvm.loop !45 for.end31: ; preds = %for.body12, %for.cond10.preheader call void @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = !{!14} !14 = distinct !{!14, !15} !15 = distinct !{!15, !"LVerDomain"} !16 = !{!17} !17 = distinct !{!17, !15} !18 = !{!14, !19} !19 = distinct !{!19, !15} !20 = !{!19} !21 = distinct !{!21, !10, !22, !23} !22 = !{!"llvm.loop.isvectorized", i32 1} !23 = !{!"llvm.loop.unroll.runtime.disable"} !24 = distinct !{!24, !10, !22} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10, !29} !29 = !{!"llvm.loop.unswitch.partial.disable"} !30 = distinct !{!30, !12} !31 = !{!32} !32 = distinct !{!32, !33} !33 = distinct !{!33, !"LVerDomain"} !34 = !{!35} !35 = distinct !{!35, !33} !36 = !{!32, !37} !37 = distinct !{!37, !33} !38 = !{!37} !39 = distinct !{!39, !10, !22, !23} !40 = distinct !{!40, !10, !22} !41 = distinct !{!41, !10} !42 = distinct !{!42, !10, !22, !23} !43 = distinct !{!43, !10, !23, !22} !44 = distinct !{!44, !10} !45 = distinct !{!45, !10}
#include<stdio.h> int dp[3][100]; int main() { int n,i,inter[100],pans=0; char di[3][101]; int secrow[100],firstrow[100]; scanf("%d",&n); for(i=0;i<(n-1);i++) scanf("%d",&secrow[i]); for(i=0;i<(n-1);i++) scanf("%d",&firstrow[i]); for(i=0;i<(n);i++) scanf("%d",&inter[i]); dp[0][0]=0; di[0][0]=' '; for(i=1;i<n;i++) {dp[0][i]+=dp[0][i-1]+secrow[i-1];di[0][i]='R';} dp[1][0]=inter[0]; di[1][0]='D'; for(i=1;i<n;i++) { if(dp[0][i]+inter[i] <= dp[1][i-1]+firstrow[i-1]) { dp[1][i]=dp[0][i]+inter[i]; di[1][i]='D'; } else { dp[1][i]=dp[1][i-1]+firstrow[i-1]; di[1][i]='R'; } } int cx=n-1,cy=1; for(i=0;i<n;i++) { if(di[cy][cx]=='R') { cx--; } else { inter[cx]=100000; break; } } pans=dp[1][n-1]; for(i=1;i<n;i++) { if(dp[0][i]+inter[i] <= dp[1][i-1]+firstrow[i-1]) { dp[1][i]=dp[0][i]+inter[i]; di[1][i]='D'; } else { dp[1][i]=dp[1][i-1]+firstrow[i-1]; di[1][i]='R'; } } pans+=dp[1][n-1]; printf("%d\n",pans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12478/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12478/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @dp = dso_local local_unnamed_addr global [3 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %inter = alloca [100 x i32], align 16 %di = alloca [3 x [101 x i8]], align 16 %secrow = alloca [100 x i32], align 16 %firstrow = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %inter) #5 call void @llvm.lifetime.start.p0(i64 303, ptr nonnull %di) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %secrow) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %firstrow) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp206 = icmp sgt i32 %0, 1 br i1 %cmp206, label %for.body, label %for.cond12.preheader for.cond2.preheader: ; preds = %for.body %cmp4209 = icmp sgt i32 %1, 1 br i1 %cmp4209, label %for.body5, label %for.cond12.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %secrow, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %2 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond12.preheader: ; preds = %for.body5, %entry, %for.cond2.preheader %3 = phi i32 [ %1, %for.cond2.preheader ], [ %0, %entry ], [ %4, %for.body5 ] %cmp13211 = icmp sgt i32 %3, 0 br i1 %cmp13211, label %for.body14, label %for.end20.thread for.end20.thread: ; preds = %for.cond12.preheader store i32 0, ptr @dp, align 16, !tbaa !5 store i8 32, ptr %di, align 16, !tbaa !11 br label %for.end40.thread for.body5: ; preds = %for.cond2.preheader, %for.body5 %indvars.iv226 = phi i64 [ %indvars.iv.next227, %for.body5 ], [ 0, %for.cond2.preheader ] %arrayidx7 = getelementptr inbounds [100 x i32], ptr %firstrow, i64 0, i64 %indvars.iv226 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %indvars.iv.next227 = add nuw nsw i64 %indvars.iv226, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %sub3 = add nsw i32 %4, -1 %5 = sext i32 %sub3 to i64 %cmp4 = icmp slt i64 %indvars.iv.next227, %5 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !12 for.body14: ; preds = %for.cond12.preheader, %for.body14 %indvars.iv229 = phi i64 [ %indvars.iv.next230, %for.body14 ], [ 0, %for.cond12.preheader ] %arrayidx16 = getelementptr inbounds [100 x i32], ptr %inter, i64 0, i64 %indvars.iv229 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16) %indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp13 = icmp slt i64 %indvars.iv.next230, %7 br i1 %cmp13, label %for.body14, label %for.end20, !llvm.loop !13 for.end20: ; preds = %for.body14 store i32 0, ptr @dp, align 16, !tbaa !5 store i8 32, ptr %di, align 16, !tbaa !11 %cmp24213 = icmp sgt i32 %6, 1 br i1 %cmp24213, label %for.body25.preheader, label %for.end40.thread for.body25.preheader: ; preds = %for.end20 %scevgep = getelementptr inbounds i8, ptr %di, i64 1 %8 = add nsw i32 %6, -1 %9 = zext i32 %8 to i64 call void @llvm.memset.p0.i64(ptr nonnull align 1 %scevgep, i8 82, i64 %9, i1 false), !tbaa !11 %wide.trip.count = zext i32 %6 to i64 %10 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %10, 1 %11 = icmp eq i32 %6, 2 br i1 %11, label %for.end40.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter = and i64 %10, -2 br label %for.body25 for.body25: ; preds = %for.body25, %for.body25.preheader.new %12 = phi i32 [ 0, %for.body25.preheader.new ], [ %add34.1, %for.body25 ] %indvars.iv232 = phi i64 [ 1, %for.body25.preheader.new ], [ %indvars.iv.next233.1, %for.body25 ] %niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.1, %for.body25 ] %13 = add nsw i64 %indvars.iv232, -1 %arrayidx31 = getelementptr inbounds [100 x i32], ptr %secrow, i64 0, i64 %13 %14 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %add = add nsw i32 %14, %12 %arrayidx33 = getelementptr inbounds [100 x i32], ptr @dp, i64 0, i64 %indvars.iv232 %15 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %add34 = add nsw i32 %add, %15 store i32 %add34, ptr %arrayidx33, align 4, !tbaa !5 %indvars.iv.next233 = add nuw nsw i64 %indvars.iv232, 1 %arrayidx31.1 = getelementptr inbounds [100 x i32], ptr %secrow, i64 0, i64 %indvars.iv232 %16 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %add34 %arrayidx33.1 = getelementptr inbounds [100 x i32], ptr @dp, i64 0, i64 %indvars.iv.next233 %17 = load i32, ptr %arrayidx33.1, align 4, !tbaa !5 %add34.1 = add nsw i32 %add.1, %17 store i32 %add34.1, ptr %arrayidx33.1, align 4, !tbaa !5 %indvars.iv.next233.1 = add nuw nsw i64 %indvars.iv232, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end40.unr-lcssa, label %for.body25, !llvm.loop !14 for.end40.thread: ; preds = %for.end20.thread, %for.end20 %.lcssa256.ph = phi i32 [ %6, %for.end20 ], [ %3, %for.end20.thread ] %18 = load i32, ptr %inter, align 16, !tbaa !5 store i32 %18, ptr getelementptr inbounds ([3 x [100 x i32]], ptr @dp, i64 0, i64 1), align 16, !tbaa !5 %arrayidx42260 = getelementptr inbounds [3 x [101 x i8]], ptr %di, i64 0, i64 1 store i8 68, ptr %arrayidx42260, align 1, !tbaa !11 br label %for.cond86.preheader for.end40.unr-lcssa: ; preds = %for.body25, %for.body25.preheader %.unr = phi i32 [ 0, %for.body25.preheader ], [ %add34.1, %for.body25 ] %indvars.iv232.unr = phi i64 [ 1, %for.body25.preheader ], [ %indvars.iv.next233.1, %for.body25 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end40, label %for.body25.epil for.body25.epil: ; preds = %for.end40.unr-lcssa %19 = add nsw i64 %indvars.iv232.unr, -1 %arrayidx31.epil = getelementptr inbounds [100 x i32], ptr %secrow, i64 0, i64 %19 %20 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %20, %.unr %arrayidx33.epil = getelementptr inbounds [100 x i32], ptr @dp, i64 0, i64 %indvars.iv232.unr %21 = load i32, ptr %arrayidx33.epil, align 4, !tbaa !5 %add34.epil = add nsw i32 %add.epil, %21 store i32 %add34.epil, ptr %arrayidx33.epil, align 4, !tbaa !5 br label %for.end40 for.end40: ; preds = %for.end40.unr-lcssa, %for.body25.epil %22 = load i32, ptr %inter, align 16, !tbaa !5 store i32 %22, ptr getelementptr inbounds ([3 x [100 x i32]], ptr @dp, i64 0, i64 1), align 16, !tbaa !5 %arrayidx42 = getelementptr inbounds [3 x [101 x i8]], ptr %di, i64 0, i64 1 store i8 68, ptr %arrayidx42, align 1, !tbaa !11 br i1 %cmp24213, label %for.body46.preheader, label %for.cond86.preheader for.body46.preheader: ; preds = %for.end40 %wide.trip.count240 = zext i32 %6 to i64 br label %for.body46 for.cond86.preheader: ; preds = %for.body46, %for.end40.thread, %for.end40 %23 = phi i32 [ %18, %for.end40.thread ], [ %22, %for.end40 ], [ %22, %for.body46 ] %.lcssa256262 = phi i32 [ %.lcssa256.ph, %for.end40.thread ], [ %6, %for.end40 ], [ %6, %for.body46 ] %cmp24213257261 = phi i1 [ false, %for.end40.thread ], [ false, %for.end40 ], [ %cmp24213, %for.body46 ] %cmp87218 = icmp sgt i32 %.lcssa256262, 0 br i1 %cmp87218, label %for.body88.preheader, label %for.end102 for.body88.preheader: ; preds = %for.cond86.preheader %24 = zext i32 %.lcssa256262 to i64 br label %for.body88 for.body46: ; preds = %for.body46.preheader, %for.body46 %25 = phi i32 [ %22, %for.body46.preheader ], [ %spec.select, %for.body46 ] %indvars.iv236 = phi i64 [ 1, %for.body46.preheader ], [ %indvars.iv.next237, %for.body46 ] %arrayidx48 = getelementptr inbounds [100 x i32], ptr @dp, i64 0, i64 %indvars.iv236 %26 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %arrayidx50 = getelementptr inbounds [100 x i32], ptr %inter, i64 0, i64 %indvars.iv236 %27 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %add51 = add nsw i32 %27, %26 %28 = add nsw i64 %indvars.iv236, -1 %arrayidx57 = getelementptr inbounds [100 x i32], ptr %firstrow, i64 0, i64 %28 %29 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %add58 = add nsw i32 %29, %25 %cmp59.not = icmp sgt i32 %add51, %add58 %spec.select = call i32 @llvm.smin.i32(i32 %add51, i32 %add58) %spec.select266 = select i1 %cmp59.not, i8 82, i8 68 %30 = getelementptr inbounds [3 x [100 x i32]], ptr @dp, i64 0, i64 1, i64 %indvars.iv236 store i32 %spec.select, ptr %30, align 4 %31 = getelementptr inbounds [3 x [101 x i8]], ptr %di, i64 0, i64 1, i64 %indvars.iv236 store i8 %spec.select266, ptr %31, align 1 %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1 %exitcond241.not = icmp eq i64 %indvars.iv.next237, %wide.trip.count240 br i1 %exitcond241.not, label %for.cond86.preheader, label %for.body46, !llvm.loop !15 for.cond86: ; preds = %for.body88 %inc101 = add nuw nsw i32 %i.5219, 1 %exitcond245.not = icmp eq i32 %inc101, %.lcssa256262 br i1 %exitcond245.not, label %for.end102, label %for.body88, !llvm.loop !16 for.body88: ; preds = %for.body88.preheader, %for.cond86 %indvars.iv242 = phi i64 [ %24, %for.body88.preheader ], [ %indvars.iv.next243, %for.cond86 ] %i.5219 = phi i32 [ 0, %for.body88.preheader ], [ %inc101, %for.cond86 ] %indvars.iv.next243 = add nsw i64 %indvars.iv242, -1 %arrayidx92 = getelementptr inbounds [3 x [101 x i8]], ptr %di, i64 0, i64 1, i64 %indvars.iv.next243 %32 = load i8, ptr %arrayidx92, align 1, !tbaa !11 %cmp93 = icmp eq i8 %32, 82 br i1 %cmp93, label %for.cond86, label %if.else96 if.else96: ; preds = %for.body88 %arrayidx98 = getelementptr inbounds [100 x i32], ptr %inter, i64 0, i64 %indvars.iv.next243 store i32 100000, ptr %arrayidx98, align 4, !tbaa !5 br label %for.end102 for.end102: ; preds = %for.cond86, %for.cond86.preheader, %if.else96 %sub103 = add nsw i32 %.lcssa256262, -1 %idxprom104 = sext i32 %sub103 to i64 %arrayidx105 = getelementptr inbounds [3 x [100 x i32]], ptr @dp, i64 0, i64 1, i64 %idxprom104 %33 = load i32, ptr %arrayidx105, align 4, !tbaa !5 br i1 %cmp24213257261, label %for.body109.preheader, label %for.end151 for.body109.preheader: ; preds = %for.end102 %wide.trip.count250 = zext i32 %.lcssa256262 to i64 br label %for.body109 for.body109: ; preds = %for.body109.preheader, %for.body109 %34 = phi i32 [ %23, %for.body109.preheader ], [ %spec.select267, %for.body109 ] %indvars.iv246 = phi i64 [ 1, %for.body109.preheader ], [ %indvars.iv.next247, %for.body109 ] %arrayidx111 = getelementptr inbounds [100 x i32], ptr @dp, i64 0, i64 %indvars.iv246 %35 = load i32, ptr %arrayidx111, align 4, !tbaa !5 %arrayidx113 = getelementptr inbounds [100 x i32], ptr %inter, i64 0, i64 %indvars.iv246 %36 = load i32, ptr %arrayidx113, align 4, !tbaa !5 %add114 = add nsw i32 %36, %35 %37 = add nsw i64 %indvars.iv246, -1 %arrayidx120 = getelementptr inbounds [100 x i32], ptr %firstrow, i64 0, i64 %37 %38 = load i32, ptr %arrayidx120, align 4, !tbaa !5 %add121 = add nsw i32 %38, %34 %cmp122.not = icmp sgt i32 %add114, %add121 %spec.select267 = call i32 @llvm.smin.i32(i32 %add114, i32 %add121) %spec.select268 = select i1 %cmp122.not, i8 82, i8 68 %39 = getelementptr inbounds [3 x [100 x i32]], ptr @dp, i64 0, i64 1, i64 %indvars.iv246 store i32 %spec.select267, ptr %39, align 4 %40 = getelementptr inbounds [3 x [101 x i8]], ptr %di, i64 0, i64 1, i64 %indvars.iv246 store i8 %spec.select268, ptr %40, align 1 %indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1 %exitcond251.not = icmp eq i64 %indvars.iv.next247, %wide.trip.count250 br i1 %exitcond251.not, label %for.end151.loopexit, label %for.body109, !llvm.loop !17 for.end151.loopexit: ; preds = %for.body109 %.pre = load i32, ptr %arrayidx105, align 4, !tbaa !5 br label %for.end151 for.end151: ; preds = %for.end151.loopexit, %for.end102 %41 = phi i32 [ %.pre, %for.end151.loopexit ], [ %33, %for.end102 ] %add155 = add nsw i32 %41, %33 %call156 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add155) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %firstrow) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %secrow) #5 call void @llvm.lifetime.end.p0(i64 303, ptr nonnull %di) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %inter) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main() { int i, j, n, k; scanf("%d", &n); int a[n + 1]; for (i = 1 ; i <= n; ++i) { scanf("%d", &a[i]); } int start = 1; while (0 == a[start]) { ++start; if (start > n) { break; } } int end = n; while (0 == a[end]) { --end; if (end < 1) { break; } } int ans = 0; for (i = start; i <= end ; ++i) { if (1 == a[i]) { ++ans; } else { if (i >= end) { break; } if (a[i + 1] == 1) { ++ans; } else { while (a[i] == 0) { ++i; if (i >= end) { break; } } --i; } } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12483/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not72 = icmp slt i32 %3, 1 br i1 %cmp.not72, label %while.cond.preheader, label %for.body while.cond.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %5, %for.body ] %smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 1) %4 = add nuw i32 %smax, 1 %wide.trip.count = zext i32 %4 to i64 br label %while.cond for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond: ; preds = %while.cond.preheader, %while.body %indvars.iv81 = phi i64 [ 1, %while.cond.preheader ], [ %indvars.iv.next82, %while.body ] %arrayidx3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv81 %7 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp eq i32 %7, 0 br i1 %cmp4, label %while.body, label %while.end.split.loop.exit92 while.body: ; preds = %while.cond %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count br i1 %exitcond.not, label %while.end, label %while.cond, !llvm.loop !11 while.end.split.loop.exit92: ; preds = %while.cond %8 = trunc i64 %indvars.iv81 to i32 br label %while.end while.end: ; preds = %while.body, %while.end.split.loop.exit92 %start.1 = phi i32 [ %8, %while.end.split.loop.exit92 ], [ %4, %while.body ] %9 = sext i32 %.lcssa to i64 %smin = call i32 @llvm.smin.i32(i32 %.lcssa, i32 1) %10 = add i32 %smin, -1 br label %while.cond7 while.cond7: ; preds = %while.body11, %while.end %indvars.iv84 = phi i64 [ %indvars.iv.next85, %while.body11 ], [ %9, %while.end ] %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv84 %11 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %11, 0 br i1 %cmp10, label %while.body11, label %while.end15.split.loop.exit94 while.body11: ; preds = %while.cond7 %indvars.iv.next85 = add nsw i64 %indvars.iv84, -1 %cmp12 = icmp slt i64 %indvars.iv84, 2 br i1 %cmp12, label %while.end15, label %while.cond7, !llvm.loop !12 while.end15.split.loop.exit94: ; preds = %while.cond7 %12 = trunc i64 %indvars.iv84 to i32 br label %while.end15 while.end15: ; preds = %while.body11, %while.end15.split.loop.exit94 %end.1 = phi i32 [ %12, %while.end15.split.loop.exit94 ], [ %10, %while.body11 ] %cmp17.not74 = icmp sgt i32 %start.1, %end.1 br i1 %cmp17.not74, label %for.end49, label %for.body18.preheader for.body18.preheader: ; preds = %while.end15 %13 = sext i32 %end.1 to i64 br label %for.body18 for.body18: ; preds = %for.body18.preheader, %for.inc47 %ans.076 = phi i32 [ %ans.1, %for.inc47 ], [ 0, %for.body18.preheader ] %i.175 = phi i32 [ %inc48, %for.inc47 ], [ %start.1, %for.body18.preheader ] %idxprom19 = sext i32 %i.175 to i64 %arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %idxprom19 %14 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %14, 1 br i1 %cmp21, label %if.then22, label %if.else if.then22: ; preds = %for.body18 %inc23 = add nsw i32 %ans.076, 1 br label %for.inc47 if.else: ; preds = %for.body18 %cmp24.not = icmp slt i32 %i.175, %end.1 br i1 %cmp24.not, label %if.end26, label %for.end49 if.end26: ; preds = %if.else %add27 = add nsw i32 %i.175, 1 %idxprom28 = sext i32 %add27 to i64 %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %idxprom28 %15 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp eq i32 %15, 1 br i1 %cmp30, label %if.then31, label %while.cond34 if.then31: ; preds = %if.end26 %inc32 = add nsw i32 %ans.076, 1 br label %for.inc47 while.cond34: ; preds = %if.end26, %while.body38 %indvars.iv87 = phi i64 [ %indvars.iv.next88, %while.body38 ], [ %idxprom19, %if.end26 ] %arrayidx36 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87 %16 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp37 = icmp eq i32 %16, 0 br i1 %cmp37, label %while.body38, label %while.end43.split.loop.exit96 while.body38: ; preds = %while.cond34 %indvars.iv.next88 = add nsw i64 %indvars.iv87, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next88, %13 br i1 %exitcond90.not, label %while.end43, label %while.cond34, !llvm.loop !13 while.end43.split.loop.exit96: ; preds = %while.cond34 %17 = trunc i64 %indvars.iv87 to i32 br label %while.end43 while.end43: ; preds = %while.body38, %while.end43.split.loop.exit96 %i.3 = phi i32 [ %17, %while.end43.split.loop.exit96 ], [ %end.1, %while.body38 ] %dec44 = add nsw i32 %i.3, -1 br label %for.inc47 for.inc47: ; preds = %if.then22, %while.end43, %if.then31 %i.4 = phi i32 [ %i.175, %if.then22 ], [ %i.175, %if.then31 ], [ %dec44, %while.end43 ] %ans.1 = phi i32 [ %inc23, %if.then22 ], [ %inc32, %if.then31 ], [ %ans.076, %while.end43 ] %inc48 = add nsw i32 %i.4, 1 %cmp17.not.not = icmp slt i32 %i.4, %end.1 br i1 %cmp17.not.not, label %for.body18, label %for.end49, !llvm.loop !14 for.end49: ; preds = %for.inc47, %if.else, %while.end15 %ans.0.lcssa = phi i32 [ 0, %while.end15 ], [ %ans.076, %if.else ], [ %ans.1, %for.inc47 ] %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> long long int min(long long int a, long long int b){return a < b ? a : b;} int max(int a, int b){return a > b ? a : b;} int main(void){ int n, k; scanf("%d%d", &n, &k); int a[15]; int i, j; for(i = 0; i < n; i++){ scanf("%d", &a[i]); } long long int ans = 999999999999999; int bit; int a_temp[15]; int can_see = 0; int maxh = 0; long long int cost; for(bit = 0; bit < (1 << n); ++bit){ cost = 0; can_see = 0; for(i = 0; i < n; i++){ a_temp[i] = a[i]; } for(i = 0; i < n; i++){ if(bit & (1 << i)){ can_see++; //0番目から(i-1)番目までの建物の高さの最大値を求める //ただしi = 0のときは0 maxh = 0; for(j = 0; j <= i - 1; j++){ maxh = max(maxh, a_temp[j]); } //i番目の高さをmaxh+1以上にする if(a_temp[i] < maxh + 1){ cost += maxh + 1 - a_temp[i]; a_temp[i] = maxh + 1; } } } if(can_see >= k){ ans = min(ans, cost); } } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124880/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124880/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [15 x i32], align 16 %a_temp = alloca [15 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %a) #6 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp78 = icmp sgt i32 %0, 0 br i1 %cmp78, label %for.body, label %for.cond5.preheader.lr.ph.thread for.cond5.preheader.lr.ph.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %a_temp) #6 %1 = load i32, ptr %k, align 4, !tbaa !5 %.fr151 = freeze i32 %1 br label %for.cond5.preheader.lr.ph.split for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [15 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %a_temp) #6 %shl = shl nuw i32 1, %2 %cmp392.not = icmp eq i32 %2, 31 br i1 %cmp392.not, label %for.end52, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %for.end %cmp680 = icmp sgt i32 %2, 0 %4 = load i32, ptr %k, align 4, !tbaa !5 %.fr = freeze i32 %4 br i1 %cmp680, label %for.cond5.preheader.us.preheader, label %for.cond5.preheader.lr.ph.split for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph %5 = zext i32 %2 to i64 %6 = shl nuw nsw i64 %5, 2 %smax141 = call i32 @llvm.smax.i32(i32 %shl, i32 1) br label %for.cond15.preheader.us for.body17.us: ; preds = %for.cond15.preheader.us, %for.inc42.us %indvars.iv136 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next137, %for.inc42.us ] %cost.089.us = phi i64 [ 0, %for.cond15.preheader.us ], [ %cost.1.us, %for.inc42.us ] %can_see.088.us = phi i32 [ 0, %for.cond15.preheader.us ], [ %can_see.1.us, %for.inc42.us ] %7 = trunc i64 %indvars.iv136 to i32 %shl18.us = shl nuw i32 1, %7 %and.us = and i32 %shl18.us, %bit.094.us %tobool.not.us = icmp eq i32 %and.us, 0 br i1 %tobool.not.us, label %for.inc42.us, label %if.then.us if.then.us: ; preds = %for.body17.us %inc19.us = add nsw i32 %can_see.088.us, 1 %cmp21.not.not82.us.not = icmp eq i64 %indvars.iv136, 0 br i1 %cmp21.not.not82.us.not, label %for.end28.us, label %for.body22.us.preheader for.body22.us.preheader: ; preds = %if.then.us %min.iters.check = icmp ult i64 %indvars.iv136, 8 br i1 %min.iters.check, label %for.body22.us.preheader158, label %vector.ph vector.ph: ; preds = %for.body22.us.preheader %n.vec = and i64 %indvars.iv136, 9223372036854775800 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi156 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %8 = getelementptr inbounds [15 x i32], ptr %a_temp, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load157 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi156, <4 x i32> %wide.load157) %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %10, <4 x i32> %11) %13 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %indvars.iv136, %n.vec br i1 %cmp.n, label %for.end28.us, label %for.body22.us.preheader158 for.body22.us.preheader158: ; preds = %for.body22.us.preheader, %middle.block %indvars.iv132.ph = phi i64 [ 0, %for.body22.us.preheader ], [ %n.vec, %middle.block ] %maxh.084.us.ph = phi i32 [ 0, %for.body22.us.preheader ], [ %13, %middle.block ] br label %for.body22.us for.end28.us: ; preds = %for.body22.us, %middle.block, %if.then.us %maxh.0.lcssa.us = phi i32 [ 0, %if.then.us ], [ %13, %middle.block ], [ %cond.i.us, %for.body22.us ] %arrayidx30.us = getelementptr inbounds [15 x i32], ptr %a_temp, i64 0, i64 %indvars.iv136 %14 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5 %cmp31.not.us = icmp sgt i32 %14, %maxh.0.lcssa.us br i1 %cmp31.not.us, label %for.inc42.us, label %if.then32.us if.then32.us: ; preds = %for.end28.us %add.us = add nuw nsw i32 %maxh.0.lcssa.us, 1 %sub36.us = sub nsw i32 %add.us, %14 %conv.us = sext i32 %sub36.us to i64 %add37.us = add nsw i64 %cost.089.us, %conv.us store i32 %add.us, ptr %arrayidx30.us, align 4, !tbaa !5 br label %for.inc42.us for.body22.us: ; preds = %for.body22.us.preheader158, %for.body22.us %indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.body22.us ], [ %indvars.iv132.ph, %for.body22.us.preheader158 ] %maxh.084.us = phi i32 [ %cond.i.us, %for.body22.us ], [ %maxh.084.us.ph, %for.body22.us.preheader158 ] %arrayidx24.us = getelementptr inbounds [15 x i32], ptr %a_temp, i64 0, i64 %indvars.iv132 %15 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5 %cond.i.us = call i32 @llvm.smax.i32(i32 %maxh.084.us, i32 %15) %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1 %exitcond135.not = icmp eq i64 %indvars.iv.next133, %indvars.iv136 br i1 %exitcond135.not, label %for.end28.us, label %for.body22.us, !llvm.loop !14 for.inc42.us: ; preds = %if.then32.us, %for.end28.us, %for.body17.us %can_see.1.us = phi i32 [ %inc19.us, %if.then32.us ], [ %inc19.us, %for.end28.us ], [ %can_see.088.us, %for.body17.us ] %cost.1.us = phi i64 [ %add37.us, %if.then32.us ], [ %cost.089.us, %for.end28.us ], [ %cost.089.us, %for.body17.us ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next137, %5 br i1 %exitcond140.not, label %for.cond15.for.end44_crit_edge.us, label %for.body17.us, !llvm.loop !15 for.cond15.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond15.for.end44_crit_edge.us %bit.094.us = phi i32 [ %inc51.us, %for.cond15.for.end44_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] %ans.093.us = phi i64 [ %ans.1.us, %for.cond15.for.end44_crit_edge.us ], [ 999999999999999, %for.cond5.preheader.us.preheader ] call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %a_temp, ptr nonnull align 16 %a, i64 %6, i1 false), !tbaa !5 br label %for.body17.us for.cond15.for.end44_crit_edge.us: ; preds = %for.inc42.us %cmp45.not.us = icmp slt i32 %can_see.1.us, %.fr %cond.i77.us = call i64 @llvm.smin.i64(i64 %ans.093.us, i64 %cost.1.us) %ans.1.us = select i1 %cmp45.not.us, i64 %ans.093.us, i64 %cond.i77.us %inc51.us = add nuw nsw i32 %bit.094.us, 1 %exitcond142.not = icmp eq i32 %inc51.us, %smax141 br i1 %exitcond142.not, label %for.end52, label %for.cond15.preheader.us, !llvm.loop !16 for.cond5.preheader.lr.ph.split: ; preds = %for.cond5.preheader.lr.ph.thread, %for.cond5.preheader.lr.ph %.fr153 = phi i32 [ %.fr151, %for.cond5.preheader.lr.ph.thread ], [ %.fr, %for.cond5.preheader.lr.ph ] %cmp45.not = icmp sgt i32 %.fr153, 0 %spec.select = select i1 %cmp45.not, i64 999999999999999, i64 0 br label %for.end52 for.end52: ; preds = %for.cond15.for.end44_crit_edge.us, %for.cond5.preheader.lr.ph.split, %for.end %ans.0.lcssa = phi i64 [ 999999999999999, %for.end ], [ %spec.select, %for.cond5.preheader.lr.ph.split ], [ %ans.1.us, %for.cond15.for.end44_crit_edge.us ] %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %a_temp) #6 call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> int N,G[2],M,i,j,k,t,c,R=0; int B[2][505][505]={0},p[1000005][2][2],C[2]={0},mx[4]={1,0,1,1},my[4]={0,1,1,-1}; int dfs(int P,int y,int x,int my,int mx) { if(y<0||y>=N||x<0||x>=N||!B[P][y][x])return 0; return dfs(P,y+my,x+mx,my,mx)+1; } int main() { memset(p,-1,sizeof(p)); scanf("%d%d%d%d",&N,&G[0],&G[1],&M); for(c=0;c<2;c++) for(i=0;i<N;i++) for(j=0;j<N;j++) { scanf("%d",&t); p[t][c][0]=i; p[t][c][1]=j; } for(i=0;i<M;i++) { scanf("%d",&t); for(c=0;c<2;c++) { if(p[t][c][0]!=-1) { B[c][p[t][c][0]][p[t][c][1]]=1; if(N==1)C[c]++; else for(k=0;k<4;k++) if(dfs(c,p[t][c][0],p[t][c][1],my[k],mx[k])+dfs(c,p[t][c][0],p[t][c][1],-my[k],-mx[k])>N) C[c]++; } if(G[c]<=C[c])R+=c+1; } if(R)break; } puts(R==1?"USAGI":R==2?"NEKO":"DRAW"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124923/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124923/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @R = dso_local local_unnamed_addr global i32 0, align 4 @B = dso_local local_unnamed_addr global [2 x [505 x [505 x i32]]] zeroinitializer, align 16 @C = dso_local local_unnamed_addr global [2 x i32] zeroinitializer, align 4 @mx = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 1, i32 1], align 16 @my = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 1, i32 -1], align 16 @N = dso_local global i32 0, align 4 @p = dso_local local_unnamed_addr global [1000005 x [2 x [2 x i32]]] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @G = dso_local global [2 x i32] zeroinitializer, align 4 @M = dso_local global i32 0, align 4 @c = dso_local local_unnamed_addr global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @t = dso_local global i32 0, align 4 @k = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [6 x i8] c"USAGI\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"NEKO\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"DRAW\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %P, i32 noundef %y, i32 noundef %x, i32 noundef %my, i32 noundef %mx) local_unnamed_addr #0 { entry: %idxprom = sext i32 %P to i64 %cmp24 = icmp slt i32 %y, 0 br i1 %cmp24, label %return, label %lor.lhs.false.lr.ph lor.lhs.false.lr.ph: ; preds = %entry %0 = load i32, ptr @N, align 4, !tbaa !5 br label %lor.lhs.false lor.lhs.false: ; preds = %lor.lhs.false.lr.ph, %if.end %x.tr27 = phi i32 [ %x, %lor.lhs.false.lr.ph ], [ %add11, %if.end ] %y.tr26 = phi i32 [ %y, %lor.lhs.false.lr.ph ], [ %add, %if.end ] %accumulator.tr25 = phi i32 [ 0, %lor.lhs.false.lr.ph ], [ %add12, %if.end ] %cmp1 = icmp sgt i32 %0, %y.tr26 %cmp3 = icmp sgt i32 %x.tr27, -1 %or.cond.not23 = and i1 %cmp3, %cmp1 %cmp5.not = icmp sgt i32 %0, %x.tr27 %or.cond22 = and i1 %cmp5.not, %or.cond.not23 br i1 %or.cond22, label %lor.lhs.false6, label %return lor.lhs.false6: ; preds = %lor.lhs.false %idxprom7 = zext i32 %y.tr26 to i64 %idxprom9 = zext i32 %x.tr27 to i64 %arrayidx10 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %idxprom, i64 %idxprom7, i64 %idxprom9 %1 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %tobool.not = icmp eq i32 %1, 0 br i1 %tobool.not, label %return, label %if.end if.end: ; preds = %lor.lhs.false6 %add = add nsw i32 %y.tr26, %my %add11 = add nsw i32 %x.tr27, %mx %add12 = add nuw nsw i32 %accumulator.tr25, 1 %cmp = icmp slt i32 %add, 0 br i1 %cmp, label %return, label %lor.lhs.false return: ; preds = %lor.lhs.false6, %lor.lhs.false, %if.end, %entry %accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ %add12, %if.end ], [ %accumulator.tr25, %lor.lhs.false ], [ %accumulator.tr25, %lor.lhs.false6 ] ret i32 %accumulator.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000080) @p, i8 -1, i64 16000080, i1 false) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @G, ptr noundef nonnull getelementptr inbounds ([2 x i32], ptr @G, i64 0, i64 1), ptr noundef nonnull @M) store i32 0, ptr @c, align 4, !tbaa !5 %0 = load i32, ptr @N, align 4, !tbaa !5 %1 = icmp sgt i32 %0, 0 br i1 %1, label %for.cond1.preheader, label %entry.split.us entry.split.us: ; preds = %entry store i32 2, ptr @c, align 4, !tbaa !5 br label %for.cond22.preheader for.cond1.preheader: ; preds = %entry, %for.inc19 %2 = phi i32 [ %inc20, %for.inc19 ], [ 0, %entry ] %3 = phi i32 [ %20, %for.inc19 ], [ %0, %entry ] %4 = phi i32 [ %21, %for.inc19 ], [ %0, %entry ] %5 = phi i32 [ %22, %for.inc19 ], [ %0, %entry ] store i32 0, ptr @i, align 4, !tbaa !5 %cmp2158 = icmp sgt i32 %5, 0 br i1 %cmp2158, label %for.cond4.preheader, label %for.inc19 for.cond22.preheader: ; preds = %for.inc19, %entry.split.us store i32 0, ptr @i, align 4, !tbaa !5 %6 = load i32, ptr @M, align 4, !tbaa !5 %cmp23169 = icmp sgt i32 %6, 0 br i1 %cmp23169, label %for.body24, label %for.cond22.preheader.for.end116_crit_edge for.cond22.preheader.for.end116_crit_edge: ; preds = %for.cond22.preheader %.pre181 = load i32, ptr @R, align 4, !tbaa !5 br label %for.end116 for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc16 %7 = phi i32 [ %16, %for.inc16 ], [ %2, %for.cond1.preheader ] %8 = phi i32 [ %17, %for.inc16 ], [ %3, %for.cond1.preheader ] %9 = phi i32 [ %inc17, %for.inc16 ], [ 0, %for.cond1.preheader ] %10 = phi i32 [ %17, %for.inc16 ], [ %4, %for.cond1.preheader ] store i32 0, ptr @j, align 4, !tbaa !5 %cmp5157 = icmp sgt i32 %10, 0 br i1 %cmp5157, label %for.body6, label %for.inc16 for.body6: ; preds = %for.cond4.preheader, %for.body6 %call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t) %11 = load i32, ptr @i, align 4, !tbaa !5 %12 = load i32, ptr @t, align 4, !tbaa !5 %idxprom = sext i32 %12 to i64 %13 = load i32, ptr @c, align 4, !tbaa !5 %idxprom8 = sext i32 %13 to i64 %arrayidx9 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom, i64 %idxprom8 store i32 %11, ptr %arrayidx9, align 8, !tbaa !5 %14 = load i32, ptr @j, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom, i64 %idxprom8, i64 1 store i32 %14, ptr %arrayidx15, align 4, !tbaa !5 %inc = add nsw i32 %14, 1 store i32 %inc, ptr @j, align 4, !tbaa !5 %15 = load i32, ptr @N, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %15 br i1 %cmp5, label %for.body6, label %for.inc16, !llvm.loop !9 for.inc16: ; preds = %for.body6, %for.cond4.preheader %16 = phi i32 [ %7, %for.cond4.preheader ], [ %13, %for.body6 ] %17 = phi i32 [ %8, %for.cond4.preheader ], [ %15, %for.body6 ] %18 = phi i32 [ %9, %for.cond4.preheader ], [ %11, %for.body6 ] %inc17 = add nsw i32 %18, 1 store i32 %inc17, ptr @i, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc17, %17 br i1 %cmp2, label %for.cond4.preheader, label %for.inc19, !llvm.loop !11 for.inc19: ; preds = %for.inc16, %for.cond1.preheader %19 = phi i32 [ %2, %for.cond1.preheader ], [ %16, %for.inc16 ] %20 = phi i32 [ %3, %for.cond1.preheader ], [ %17, %for.inc16 ] %21 = phi i32 [ %4, %for.cond1.preheader ], [ %17, %for.inc16 ] %22 = phi i32 [ %5, %for.cond1.preheader ], [ %17, %for.inc16 ] %inc20 = add nsw i32 %19, 1 store i32 %inc20, ptr @c, align 4, !tbaa !5 %cmp = icmp slt i32 %19, 1 br i1 %cmp, label %for.cond1.preheader, label %for.cond22.preheader, !llvm.loop !13 for.body24: ; preds = %for.cond22.preheader, %for.inc114 %call25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t) %23 = load i32, ptr @t, align 4, !tbaa !5 %idxprom29 = sext i32 %23 to i64 %R.promoted = load i32, ptr @R, align 4, !tbaa !5 %24 = load i32, ptr @N, align 4 %.fr = freeze i32 %24 %cmp51 = icmp eq i32 %.fr, 1 %cmp90.us = icmp slt i32 %.fr, 0 br i1 %cmp51, label %for.body28.us.preheader, label %for.body28.preheader for.body28.preheader: ; preds = %for.body24 %25 = load i32, ptr @my, align 16 %26 = load i32, ptr @mx, align 16 %27 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @my, i64 0, i64 1), align 4 %28 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @mx, i64 0, i64 1), align 4 %29 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @my, i64 0, i64 2), align 8 %30 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @mx, i64 0, i64 2), align 8 %31 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @my, i64 0, i64 3), align 4 %32 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @mx, i64 0, i64 3), align 4 br label %for.body28 for.body28.us.preheader: ; preds = %for.body24 %arrayidx32.us = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 0 %33 = load i32, ptr %arrayidx32.us, align 16, !tbaa !5 %cmp34.not.us = icmp eq i32 %33, -1 %.pre = load i32, ptr @C, align 4, !tbaa !5 br i1 %cmp34.not.us, label %if.end99.us, label %if.then.us if.then.us: ; preds = %for.body28.us.preheader %idxprom42.us = sext i32 %33 to i64 %arrayidx48.us = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 0, i64 1 %34 = load i32, ptr %arrayidx48.us, align 4, !tbaa !5 %idxprom49.us = sext i32 %34 to i64 %arrayidx50.us = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 0, i64 %idxprom42.us, i64 %idxprom49.us store i32 1, ptr %arrayidx50.us, align 4, !tbaa !5 %inc55.us = add nsw i32 %.pre, 1 store i32 %inc55.us, ptr @C, align 4, !tbaa !5 br label %if.end99.us if.end99.us: ; preds = %if.then.us, %for.body28.us.preheader %35 = phi i32 [ %inc55.us, %if.then.us ], [ %.pre, %for.body28.us.preheader ] %36 = load i32, ptr @G, align 4, !tbaa !5 %cmp104.not.us = icmp sgt i32 %36, %35 br i1 %cmp104.not.us, label %for.inc109.us, label %if.then105.us if.then105.us: ; preds = %if.end99.us %add107.us = add nsw i32 %R.promoted, 1 store i32 %add107.us, ptr @R, align 4, !tbaa !5 br label %for.inc109.us for.inc109.us: ; preds = %if.then105.us, %if.end99.us %add107164.us = phi i32 [ %R.promoted, %if.end99.us ], [ %add107.us, %if.then105.us ] %arrayidx32.us.1 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 1 %37 = load i32, ptr %arrayidx32.us.1, align 8, !tbaa !5 %cmp34.not.us.1 = icmp eq i32 %37, -1 %.pre180 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5 br i1 %cmp34.not.us.1, label %if.end99.us.1, label %if.then.us.1 if.then.us.1: ; preds = %for.inc109.us %idxprom42.us.1 = sext i32 %37 to i64 %arrayidx48.us.1 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 1, i64 1 %38 = load i32, ptr %arrayidx48.us.1, align 4, !tbaa !5 %idxprom49.us.1 = sext i32 %38 to i64 %arrayidx50.us.1 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 1, i64 %idxprom42.us.1, i64 %idxprom49.us.1 store i32 1, ptr %arrayidx50.us.1, align 4, !tbaa !5 %inc55.us.1 = add nsw i32 %.pre180, 1 store i32 %inc55.us.1, ptr getelementptr inbounds ([2 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5 br label %if.end99.us.1 if.end99.us.1: ; preds = %if.then.us.1, %for.inc109.us %39 = phi i32 [ %inc55.us.1, %if.then.us.1 ], [ %.pre180, %for.inc109.us ] %40 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @G, i64 0, i64 1), align 4, !tbaa !5 %cmp104.not.us.1 = icmp sgt i32 %40, %39 br i1 %cmp104.not.us.1, label %for.end111, label %if.then105.us.1 if.then105.us.1: ; preds = %if.end99.us.1 %add107.us.1 = add nsw i32 %add107164.us, 2 store i32 %add107.us.1, ptr @R, align 4, !tbaa !5 br label %for.end111 for.body28: ; preds = %for.body28.preheader, %for.inc109 %indvars.iv = phi i64 [ 0, %for.body28.preheader ], [ %.pre182, %for.inc109 ] %add107165166 = phi i32 [ %R.promoted, %for.body28.preheader ], [ %add107164, %for.inc109 ] %arrayidx32 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 %indvars.iv %41 = load i32, ptr %arrayidx32, align 8, !tbaa !5 %cmp34.not = icmp eq i32 %41, -1 br i1 %cmp34.not, label %if.end99, label %if.then if.then: ; preds = %for.body28 %idxprom42 = sext i32 %41 to i64 %arrayidx48 = getelementptr inbounds [1000005 x [2 x [2 x i32]]], ptr @p, i64 0, i64 %idxprom29, i64 %indvars.iv, i64 1 %42 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %idxprom49 = sext i32 %42 to i64 %arrayidx50 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom42, i64 %idxprom49 store i32 1, ptr %arrayidx50, align 4, !tbaa !5 %cmp24.i = icmp slt i32 %41, 0 %arrayidx93 = getelementptr inbounds [2 x i32], ptr @C, i64 0, i64 %indvars.iv br i1 %cmp24.i, label %for.cond56.preheader.split.us, label %lor.lhs.false.i for.cond56.preheader.split.us: ; preds = %if.then br i1 %cmp90.us, label %if.end99.loopexit.sink.split, label %if.end99.loopexit lor.lhs.false.i: ; preds = %if.then, %if.end.i %x.tr27.i = phi i32 [ %add11.i, %if.end.i ], [ %42, %if.then ] %y.tr26.i = phi i32 [ %add.i, %if.end.i ], [ %41, %if.then ] %accumulator.tr25.i = phi i32 [ %add12.i, %if.end.i ], [ 0, %if.then ] %cmp1.i = icmp sgt i32 %.fr, %y.tr26.i %cmp3.i = icmp sgt i32 %x.tr27.i, -1 %or.cond.not23.i = and i1 %cmp3.i, %cmp1.i %cmp5.not.i = icmp sgt i32 %.fr, %x.tr27.i %or.cond22.i = and i1 %cmp5.not.i, %or.cond.not23.i br i1 %or.cond22.i, label %lor.lhs.false6.i, label %dfs.exit lor.lhs.false6.i: ; preds = %lor.lhs.false.i %idxprom7.i = zext i32 %y.tr26.i to i64 %idxprom9.i = zext i32 %x.tr27.i to i64 %arrayidx10.i = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i, i64 %idxprom9.i %43 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %tobool.not.i = icmp eq i32 %43, 0 br i1 %tobool.not.i, label %dfs.exit, label %if.end.i if.end.i: ; preds = %lor.lhs.false6.i %add.i = add nsw i32 %y.tr26.i, %25 %add11.i = add nsw i32 %x.tr27.i, %26 %add12.i = add nuw nsw i32 %accumulator.tr25.i, 1 %cmp.i = icmp slt i32 %add.i, 0 br i1 %cmp.i, label %dfs.exit, label %lor.lhs.false.i dfs.exit: ; preds = %lor.lhs.false.i, %lor.lhs.false6.i, %if.end.i %accumulator.tr.lcssa.i = phi i32 [ %add12.i, %if.end.i ], [ %accumulator.tr25.i, %lor.lhs.false.i ], [ %accumulator.tr25.i, %lor.lhs.false6.i ] br label %lor.lhs.false.i132 lor.lhs.false.i132: ; preds = %dfs.exit, %if.end.i147 %x.tr27.i133 = phi i32 [ %add11.i149, %if.end.i147 ], [ %42, %dfs.exit ] %y.tr26.i134 = phi i32 [ %add.i148, %if.end.i147 ], [ %41, %dfs.exit ] %accumulator.tr25.i135 = phi i32 [ %add12.i150, %if.end.i147 ], [ 0, %dfs.exit ] %cmp1.i136 = icmp sgt i32 %.fr, %y.tr26.i134 %cmp3.i137 = icmp sgt i32 %x.tr27.i133, -1 %or.cond.not23.i138 = and i1 %cmp3.i137, %cmp1.i136 %cmp5.not.i139 = icmp sgt i32 %.fr, %x.tr27.i133 %or.cond22.i140 = and i1 %cmp5.not.i139, %or.cond.not23.i138 br i1 %or.cond22.i140, label %lor.lhs.false6.i142, label %dfs.exit152.loopexit lor.lhs.false6.i142: ; preds = %lor.lhs.false.i132 %idxprom7.i143 = zext i32 %y.tr26.i134 to i64 %idxprom9.i144 = zext i32 %x.tr27.i133 to i64 %arrayidx10.i145 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i143, i64 %idxprom9.i144 %44 = load i32, ptr %arrayidx10.i145, align 4, !tbaa !5 %tobool.not.i146 = icmp eq i32 %44, 0 br i1 %tobool.not.i146, label %dfs.exit152.loopexit, label %if.end.i147 if.end.i147: ; preds = %lor.lhs.false6.i142 %add.i148 = sub i32 %y.tr26.i134, %25 %add11.i149 = sub i32 %x.tr27.i133, %26 %add12.i150 = add nuw nsw i32 %accumulator.tr25.i135, 1 %cmp.i151 = icmp slt i32 %add.i148, 0 br i1 %cmp.i151, label %dfs.exit152.loopexit, label %lor.lhs.false.i132 dfs.exit152.loopexit: ; preds = %if.end.i147, %lor.lhs.false6.i142, %lor.lhs.false.i132 %accumulator.tr.lcssa.i141.ph = phi i32 [ %accumulator.tr25.i135, %lor.lhs.false6.i142 ], [ %accumulator.tr25.i135, %lor.lhs.false.i132 ], [ %add12.i150, %if.end.i147 ] %add = add nsw i32 %accumulator.tr.lcssa.i141.ph, %accumulator.tr.lcssa.i %cmp90 = icmp sgt i32 %add, %.fr br i1 %cmp90, label %if.then91, label %lor.lhs.false.i.1.preheader if.then91: ; preds = %dfs.exit152.loopexit %45 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %inc94 = add nsw i32 %45, 1 store i32 %inc94, ptr %arrayidx93, align 4, !tbaa !5 br label %lor.lhs.false.i.1.preheader lor.lhs.false.i.1.preheader: ; preds = %dfs.exit152.loopexit, %if.then91 br label %lor.lhs.false.i.1 lor.lhs.false.i.1: ; preds = %lor.lhs.false.i.1.preheader, %if.end.i.1 %x.tr27.i.1 = phi i32 [ %add11.i.1, %if.end.i.1 ], [ %42, %lor.lhs.false.i.1.preheader ] %y.tr26.i.1 = phi i32 [ %add.i.1, %if.end.i.1 ], [ %41, %lor.lhs.false.i.1.preheader ] %accumulator.tr25.i.1 = phi i32 [ %add12.i.1, %if.end.i.1 ], [ 0, %lor.lhs.false.i.1.preheader ] %cmp1.i.1 = icmp sgt i32 %.fr, %y.tr26.i.1 %cmp3.i.1 = icmp sgt i32 %x.tr27.i.1, -1 %or.cond.not23.i.1 = and i1 %cmp3.i.1, %cmp1.i.1 %cmp5.not.i.1 = icmp sgt i32 %.fr, %x.tr27.i.1 %or.cond22.i.1 = and i1 %cmp5.not.i.1, %or.cond.not23.i.1 br i1 %or.cond22.i.1, label %lor.lhs.false6.i.1, label %dfs.exit.1 lor.lhs.false6.i.1: ; preds = %lor.lhs.false.i.1 %idxprom7.i.1 = zext i32 %y.tr26.i.1 to i64 %idxprom9.i.1 = zext i32 %x.tr27.i.1 to i64 %arrayidx10.i.1 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i.1, i64 %idxprom9.i.1 %46 = load i32, ptr %arrayidx10.i.1, align 4, !tbaa !5 %tobool.not.i.1 = icmp eq i32 %46, 0 br i1 %tobool.not.i.1, label %dfs.exit.1, label %if.end.i.1 if.end.i.1: ; preds = %lor.lhs.false6.i.1 %add.i.1 = add nsw i32 %y.tr26.i.1, %27 %add11.i.1 = add nsw i32 %x.tr27.i.1, %28 %add12.i.1 = add nuw nsw i32 %accumulator.tr25.i.1, 1 %cmp.i.1 = icmp slt i32 %add.i.1, 0 br i1 %cmp.i.1, label %dfs.exit.1, label %lor.lhs.false.i.1 dfs.exit.1: ; preds = %if.end.i.1, %lor.lhs.false6.i.1, %lor.lhs.false.i.1 %accumulator.tr.lcssa.i.1 = phi i32 [ %add12.i.1, %if.end.i.1 ], [ %accumulator.tr25.i.1, %lor.lhs.false.i.1 ], [ %accumulator.tr25.i.1, %lor.lhs.false6.i.1 ] br label %lor.lhs.false.i132.1 lor.lhs.false.i132.1: ; preds = %if.end.i147.1, %dfs.exit.1 %x.tr27.i133.1 = phi i32 [ %add11.i149.1, %if.end.i147.1 ], [ %42, %dfs.exit.1 ] %y.tr26.i134.1 = phi i32 [ %add.i148.1, %if.end.i147.1 ], [ %41, %dfs.exit.1 ] %accumulator.tr25.i135.1 = phi i32 [ %add12.i150.1, %if.end.i147.1 ], [ 0, %dfs.exit.1 ] %cmp1.i136.1 = icmp sgt i32 %.fr, %y.tr26.i134.1 %cmp3.i137.1 = icmp sgt i32 %x.tr27.i133.1, -1 %or.cond.not23.i138.1 = and i1 %cmp3.i137.1, %cmp1.i136.1 %cmp5.not.i139.1 = icmp sgt i32 %.fr, %x.tr27.i133.1 %or.cond22.i140.1 = and i1 %cmp5.not.i139.1, %or.cond.not23.i138.1 br i1 %or.cond22.i140.1, label %lor.lhs.false6.i142.1, label %dfs.exit152.loopexit.1 lor.lhs.false6.i142.1: ; preds = %lor.lhs.false.i132.1 %idxprom7.i143.1 = zext i32 %y.tr26.i134.1 to i64 %idxprom9.i144.1 = zext i32 %x.tr27.i133.1 to i64 %arrayidx10.i145.1 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i143.1, i64 %idxprom9.i144.1 %47 = load i32, ptr %arrayidx10.i145.1, align 4, !tbaa !5 %tobool.not.i146.1 = icmp eq i32 %47, 0 br i1 %tobool.not.i146.1, label %dfs.exit152.loopexit.1, label %if.end.i147.1 if.end.i147.1: ; preds = %lor.lhs.false6.i142.1 %add.i148.1 = sub i32 %y.tr26.i134.1, %27 %add11.i149.1 = sub i32 %x.tr27.i133.1, %28 %add12.i150.1 = add nuw nsw i32 %accumulator.tr25.i135.1, 1 %cmp.i151.1 = icmp slt i32 %add.i148.1, 0 br i1 %cmp.i151.1, label %dfs.exit152.loopexit.1, label %lor.lhs.false.i132.1 dfs.exit152.loopexit.1: ; preds = %if.end.i147.1, %lor.lhs.false6.i142.1, %lor.lhs.false.i132.1 %accumulator.tr.lcssa.i141.ph.1 = phi i32 [ %accumulator.tr25.i135.1, %lor.lhs.false6.i142.1 ], [ %accumulator.tr25.i135.1, %lor.lhs.false.i132.1 ], [ %add12.i150.1, %if.end.i147.1 ] %add.1 = add nsw i32 %accumulator.tr.lcssa.i141.ph.1, %accumulator.tr.lcssa.i.1 %cmp90.1 = icmp sgt i32 %add.1, %.fr br i1 %cmp90.1, label %if.then91.1, label %lor.lhs.false.i.2.preheader if.then91.1: ; preds = %dfs.exit152.loopexit.1 %48 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %inc94.1 = add nsw i32 %48, 1 store i32 %inc94.1, ptr %arrayidx93, align 4, !tbaa !5 br label %lor.lhs.false.i.2.preheader lor.lhs.false.i.2.preheader: ; preds = %if.then91.1, %dfs.exit152.loopexit.1 br label %lor.lhs.false.i.2 lor.lhs.false.i.2: ; preds = %lor.lhs.false.i.2.preheader, %if.end.i.2 %x.tr27.i.2 = phi i32 [ %add11.i.2, %if.end.i.2 ], [ %42, %lor.lhs.false.i.2.preheader ] %y.tr26.i.2 = phi i32 [ %add.i.2, %if.end.i.2 ], [ %41, %lor.lhs.false.i.2.preheader ] %accumulator.tr25.i.2 = phi i32 [ %add12.i.2, %if.end.i.2 ], [ 0, %lor.lhs.false.i.2.preheader ] %cmp1.i.2 = icmp sgt i32 %.fr, %y.tr26.i.2 %cmp3.i.2 = icmp sgt i32 %x.tr27.i.2, -1 %or.cond.not23.i.2 = and i1 %cmp3.i.2, %cmp1.i.2 %cmp5.not.i.2 = icmp sgt i32 %.fr, %x.tr27.i.2 %or.cond22.i.2 = and i1 %cmp5.not.i.2, %or.cond.not23.i.2 br i1 %or.cond22.i.2, label %lor.lhs.false6.i.2, label %dfs.exit.2 lor.lhs.false6.i.2: ; preds = %lor.lhs.false.i.2 %idxprom7.i.2 = zext i32 %y.tr26.i.2 to i64 %idxprom9.i.2 = zext i32 %x.tr27.i.2 to i64 %arrayidx10.i.2 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i.2, i64 %idxprom9.i.2 %49 = load i32, ptr %arrayidx10.i.2, align 4, !tbaa !5 %tobool.not.i.2 = icmp eq i32 %49, 0 br i1 %tobool.not.i.2, label %dfs.exit.2, label %if.end.i.2 if.end.i.2: ; preds = %lor.lhs.false6.i.2 %add.i.2 = add nsw i32 %y.tr26.i.2, %29 %add11.i.2 = add nsw i32 %x.tr27.i.2, %30 %add12.i.2 = add nuw nsw i32 %accumulator.tr25.i.2, 1 %cmp.i.2 = icmp slt i32 %add.i.2, 0 br i1 %cmp.i.2, label %dfs.exit.2, label %lor.lhs.false.i.2 dfs.exit.2: ; preds = %if.end.i.2, %lor.lhs.false6.i.2, %lor.lhs.false.i.2 %accumulator.tr.lcssa.i.2 = phi i32 [ %add12.i.2, %if.end.i.2 ], [ %accumulator.tr25.i.2, %lor.lhs.false.i.2 ], [ %accumulator.tr25.i.2, %lor.lhs.false6.i.2 ] br label %lor.lhs.false.i132.2 lor.lhs.false.i132.2: ; preds = %if.end.i147.2, %dfs.exit.2 %x.tr27.i133.2 = phi i32 [ %add11.i149.2, %if.end.i147.2 ], [ %42, %dfs.exit.2 ] %y.tr26.i134.2 = phi i32 [ %add.i148.2, %if.end.i147.2 ], [ %41, %dfs.exit.2 ] %accumulator.tr25.i135.2 = phi i32 [ %add12.i150.2, %if.end.i147.2 ], [ 0, %dfs.exit.2 ] %cmp1.i136.2 = icmp sgt i32 %.fr, %y.tr26.i134.2 %cmp3.i137.2 = icmp sgt i32 %x.tr27.i133.2, -1 %or.cond.not23.i138.2 = and i1 %cmp3.i137.2, %cmp1.i136.2 %cmp5.not.i139.2 = icmp sgt i32 %.fr, %x.tr27.i133.2 %or.cond22.i140.2 = and i1 %cmp5.not.i139.2, %or.cond.not23.i138.2 br i1 %or.cond22.i140.2, label %lor.lhs.false6.i142.2, label %dfs.exit152.loopexit.2 lor.lhs.false6.i142.2: ; preds = %lor.lhs.false.i132.2 %idxprom7.i143.2 = zext i32 %y.tr26.i134.2 to i64 %idxprom9.i144.2 = zext i32 %x.tr27.i133.2 to i64 %arrayidx10.i145.2 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i143.2, i64 %idxprom9.i144.2 %50 = load i32, ptr %arrayidx10.i145.2, align 4, !tbaa !5 %tobool.not.i146.2 = icmp eq i32 %50, 0 br i1 %tobool.not.i146.2, label %dfs.exit152.loopexit.2, label %if.end.i147.2 if.end.i147.2: ; preds = %lor.lhs.false6.i142.2 %add.i148.2 = sub i32 %y.tr26.i134.2, %29 %add11.i149.2 = sub i32 %x.tr27.i133.2, %30 %add12.i150.2 = add nuw nsw i32 %accumulator.tr25.i135.2, 1 %cmp.i151.2 = icmp slt i32 %add.i148.2, 0 br i1 %cmp.i151.2, label %dfs.exit152.loopexit.2, label %lor.lhs.false.i132.2 dfs.exit152.loopexit.2: ; preds = %if.end.i147.2, %lor.lhs.false6.i142.2, %lor.lhs.false.i132.2 %accumulator.tr.lcssa.i141.ph.2 = phi i32 [ %accumulator.tr25.i135.2, %lor.lhs.false6.i142.2 ], [ %accumulator.tr25.i135.2, %lor.lhs.false.i132.2 ], [ %add12.i150.2, %if.end.i147.2 ] %add.2 = add nsw i32 %accumulator.tr.lcssa.i141.ph.2, %accumulator.tr.lcssa.i.2 %cmp90.2 = icmp sgt i32 %add.2, %.fr br i1 %cmp90.2, label %if.then91.2, label %lor.lhs.false.i.3.preheader if.then91.2: ; preds = %dfs.exit152.loopexit.2 %51 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %inc94.2 = add nsw i32 %51, 1 store i32 %inc94.2, ptr %arrayidx93, align 4, !tbaa !5 br label %lor.lhs.false.i.3.preheader lor.lhs.false.i.3.preheader: ; preds = %if.then91.2, %dfs.exit152.loopexit.2 br label %lor.lhs.false.i.3 lor.lhs.false.i.3: ; preds = %lor.lhs.false.i.3.preheader, %if.end.i.3 %x.tr27.i.3 = phi i32 [ %add11.i.3, %if.end.i.3 ], [ %42, %lor.lhs.false.i.3.preheader ] %y.tr26.i.3 = phi i32 [ %add.i.3, %if.end.i.3 ], [ %41, %lor.lhs.false.i.3.preheader ] %accumulator.tr25.i.3 = phi i32 [ %add12.i.3, %if.end.i.3 ], [ 0, %lor.lhs.false.i.3.preheader ] %cmp1.i.3 = icmp sgt i32 %.fr, %y.tr26.i.3 %cmp3.i.3 = icmp sgt i32 %x.tr27.i.3, -1 %or.cond.not23.i.3 = and i1 %cmp3.i.3, %cmp1.i.3 %cmp5.not.i.3 = icmp sgt i32 %.fr, %x.tr27.i.3 %or.cond22.i.3 = and i1 %cmp5.not.i.3, %or.cond.not23.i.3 br i1 %or.cond22.i.3, label %lor.lhs.false6.i.3, label %dfs.exit.3 lor.lhs.false6.i.3: ; preds = %lor.lhs.false.i.3 %idxprom7.i.3 = zext i32 %y.tr26.i.3 to i64 %idxprom9.i.3 = zext i32 %x.tr27.i.3 to i64 %arrayidx10.i.3 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i.3, i64 %idxprom9.i.3 %52 = load i32, ptr %arrayidx10.i.3, align 4, !tbaa !5 %tobool.not.i.3 = icmp eq i32 %52, 0 br i1 %tobool.not.i.3, label %dfs.exit.3, label %if.end.i.3 if.end.i.3: ; preds = %lor.lhs.false6.i.3 %add.i.3 = add nsw i32 %y.tr26.i.3, %31 %add11.i.3 = add nsw i32 %x.tr27.i.3, %32 %add12.i.3 = add nuw nsw i32 %accumulator.tr25.i.3, 1 %cmp.i.3 = icmp slt i32 %add.i.3, 0 br i1 %cmp.i.3, label %dfs.exit.3, label %lor.lhs.false.i.3 dfs.exit.3: ; preds = %if.end.i.3, %lor.lhs.false6.i.3, %lor.lhs.false.i.3 %accumulator.tr.lcssa.i.3 = phi i32 [ %add12.i.3, %if.end.i.3 ], [ %accumulator.tr25.i.3, %lor.lhs.false.i.3 ], [ %accumulator.tr25.i.3, %lor.lhs.false6.i.3 ] br label %lor.lhs.false.i132.3 lor.lhs.false.i132.3: ; preds = %if.end.i147.3, %dfs.exit.3 %x.tr27.i133.3 = phi i32 [ %add11.i149.3, %if.end.i147.3 ], [ %42, %dfs.exit.3 ] %y.tr26.i134.3 = phi i32 [ %add.i148.3, %if.end.i147.3 ], [ %41, %dfs.exit.3 ] %accumulator.tr25.i135.3 = phi i32 [ %add12.i150.3, %if.end.i147.3 ], [ 0, %dfs.exit.3 ] %cmp1.i136.3 = icmp sgt i32 %.fr, %y.tr26.i134.3 %cmp3.i137.3 = icmp sgt i32 %x.tr27.i133.3, -1 %or.cond.not23.i138.3 = and i1 %cmp3.i137.3, %cmp1.i136.3 %cmp5.not.i139.3 = icmp sgt i32 %.fr, %x.tr27.i133.3 %or.cond22.i140.3 = and i1 %cmp5.not.i139.3, %or.cond.not23.i138.3 br i1 %or.cond22.i140.3, label %lor.lhs.false6.i142.3, label %dfs.exit152.loopexit.3 lor.lhs.false6.i142.3: ; preds = %lor.lhs.false.i132.3 %idxprom7.i143.3 = zext i32 %y.tr26.i134.3 to i64 %idxprom9.i144.3 = zext i32 %x.tr27.i133.3 to i64 %arrayidx10.i145.3 = getelementptr inbounds [2 x [505 x [505 x i32]]], ptr @B, i64 0, i64 %indvars.iv, i64 %idxprom7.i143.3, i64 %idxprom9.i144.3 %53 = load i32, ptr %arrayidx10.i145.3, align 4, !tbaa !5 %tobool.not.i146.3 = icmp eq i32 %53, 0 br i1 %tobool.not.i146.3, label %dfs.exit152.loopexit.3, label %if.end.i147.3 if.end.i147.3: ; preds = %lor.lhs.false6.i142.3 %add.i148.3 = sub i32 %y.tr26.i134.3, %31 %add11.i149.3 = sub i32 %x.tr27.i133.3, %32 %add12.i150.3 = add nuw nsw i32 %accumulator.tr25.i135.3, 1 %cmp.i151.3 = icmp slt i32 %add.i148.3, 0 br i1 %cmp.i151.3, label %dfs.exit152.loopexit.3, label %lor.lhs.false.i132.3 dfs.exit152.loopexit.3: ; preds = %if.end.i147.3, %lor.lhs.false6.i142.3, %lor.lhs.false.i132.3 %accumulator.tr.lcssa.i141.ph.3 = phi i32 [ %accumulator.tr25.i135.3, %lor.lhs.false6.i142.3 ], [ %accumulator.tr25.i135.3, %lor.lhs.false.i132.3 ], [ %add12.i150.3, %if.end.i147.3 ] %add.3 = add nsw i32 %accumulator.tr.lcssa.i141.ph.3, %accumulator.tr.lcssa.i.3 %cmp90.3 = icmp sgt i32 %add.3, %.fr br i1 %cmp90.3, label %if.end99.loopexit.sink.split, label %if.end99.loopexit if.end99.loopexit.sink.split: ; preds = %dfs.exit152.loopexit.3, %for.cond56.preheader.split.us %.sink187 = phi i32 [ 4, %for.cond56.preheader.split.us ], [ 1, %dfs.exit152.loopexit.3 ] %54 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %inc94.3 = add i32 %54, %.sink187 store i32 %inc94.3, ptr %arrayidx93, align 4, !tbaa !5 br label %if.end99.loopexit if.end99.loopexit: ; preds = %if.end99.loopexit.sink.split, %dfs.exit152.loopexit.3, %for.cond56.preheader.split.us store i32 4, ptr @k, align 4, !tbaa !5 br label %if.end99 if.end99: ; preds = %if.end99.loopexit, %for.body28 %arrayidx101 = getelementptr inbounds [2 x i32], ptr @G, i64 0, i64 %indvars.iv %55 = load i32, ptr %arrayidx101, align 4, !tbaa !5 %arrayidx103 = getelementptr inbounds [2 x i32], ptr @C, i64 0, i64 %indvars.iv %56 = load i32, ptr %arrayidx103, align 4, !tbaa !5 %cmp104.not = icmp sgt i32 %55, %56 %.pre182 = add nuw nsw i64 %indvars.iv, 1 br i1 %cmp104.not, label %for.inc109, label %if.then105 if.then105: ; preds = %if.end99 %57 = trunc i64 %.pre182 to i32 %add107 = add nsw i32 %add107165166, %57 store i32 %add107, ptr @R, align 4, !tbaa !5 br label %for.inc109 for.inc109: ; preds = %if.end99, %if.then105 %add107164 = phi i32 [ %add107, %if.then105 ], [ %add107165166, %if.end99 ] %cmp27 = icmp eq i64 %indvars.iv, 0 br i1 %cmp27, label %for.body28, label %for.end111, !llvm.loop !14 for.end111: ; preds = %for.inc109, %if.end99.us.1, %if.then105.us.1 %58 = phi i32 [ %add107.us.1, %if.then105.us.1 ], [ %add107164.us, %if.end99.us.1 ], [ %add107164, %for.inc109 ] store i32 2, ptr @c, align 4, !tbaa !5 %tobool.not = icmp eq i32 %58, 0 br i1 %tobool.not, label %for.inc114, label %for.end116 for.inc114: ; preds = %for.end111 %59 = load i32, ptr @i, align 4, !tbaa !5 %inc115 = add nsw i32 %59, 1 store i32 %inc115, ptr @i, align 4, !tbaa !5 %60 = load i32, ptr @M, align 4, !tbaa !5 %cmp23 = icmp slt i32 %inc115, %60 br i1 %cmp23, label %for.body24, label %for.end116, !llvm.loop !15 for.end116: ; preds = %for.inc114, %for.end111, %for.cond22.preheader.for.end116_crit_edge %61 = phi i32 [ %.pre181, %for.cond22.preheader.for.end116_crit_edge ], [ 0, %for.inc114 ], [ %58, %for.end111 ] %cmp117 = icmp eq i32 %61, 1 %cmp118 = icmp eq i32 %61, 2 %cond = select i1 %cmp118, ptr @.str.3, ptr @.str.4 %cond119 = select i1 %cmp117, ptr @.str.2, ptr %cond %call120 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond119) ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !12} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int main() { int x; scanf("%d", &x); if (x >= 30) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124974/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124974/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int X; scanf("%d",&X); if(X>=-40&&X<=40) { if(X>=30) { printf("Yes"); } else printf("No") ; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125016/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125016/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4 %1 = add i32 %0, 40 %or.cond = icmp ult i32 %1, 81 br i1 %or.cond, label %if.then, label %if.end6 if.then: ; preds = %entry %cmp2 = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) br label %if.end6 if.end6: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include<stdio.h> int main() { int tc; scanf("%d",&tc); tc >= 30 ? printf("Yes\n") : printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125067/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125067/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %tc = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tc) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tc) %0 = load i32, ptr %tc, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tc) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int n; scanf("%d",&n); if(n>=30) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125117/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125117/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int X; scanf("%d",&X); if(X>=30){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125160/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main(void) { int X; scanf("%d", &X); if(X >= 30) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125210/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125210/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int x; scanf("%d",&x); if(x>=30){ printf("Yes"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125254/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125254/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int x; scanf("%d", &x); if(x < 30) printf("No"); else printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125298/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125298/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 30 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> void swap (int *x, int *y) { int temp; temp = *x; *x = *y; *y = temp; } int gcd(int a,int b){ if(a<b){ swap(&a,&b); } if(b==0){ return a; } int r=a%b; while(r!=0){ a = b; b = r; r = (a%b); } return b; } /* クイックソート */ int dn(const void*a,const void*b){return*(int*)b-*(int*)a;} int modpow(int a,int n,int mod){ int ans=1; while(n>0){ if(n & 1){ ans=ans*a%mod; } a=a*a%mod; n/=2; } return ans; } int max(int a,int b){ if(a<b){ return b; } else{ return a; } } int min(int a,int b){ if(a<b){ return a; } else{ return b; } } void chmax(int *a,int b){ if(*a < b){ *a = b; } return; } void chmin(int *a,int b){ if(*a > b){ *a =b; } return; } int main(void){ int x; scanf("%d",&x); if(x<30){ printf("No\n"); }else{ printf("Yes\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125348/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125348/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 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: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select14 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %cmp1 = icmp eq i32 %spec.select14, 0 br i1 %cmp1, label %return, label %if.end3 if.end3: ; preds = %entry %rem = srem i32 %spec.select, %spec.select14 %cmp4.not15 = icmp eq i32 %rem, 0 br i1 %cmp4.not15, label %return, label %while.body while.body: ; preds = %if.end3, %while.body %r.017 = phi i32 [ %rem5, %while.body ], [ %rem, %if.end3 ] %b.addr.116 = phi i32 [ %r.017, %while.body ], [ %spec.select14, %if.end3 ] %rem5 = srem i32 %b.addr.116, %r.017 %cmp4.not = icmp eq i32 %rem5, 0 br i1 %cmp4.not, label %return, label %while.body, !llvm.loop !9 return: ; preds = %while.body, %if.end3, %entry %retval.0.in.sroa.speculated = phi i32 [ %spec.select, %entry ], [ %spec.select14, %if.end3 ], [ %r.017, %while.body ] ret i32 %retval.0.in.sroa.speculated } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dn(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @modpow(i32 noundef %a, i32 noundef %n, i32 noundef %mod) local_unnamed_addr #4 { entry: %cmp10 = icmp sgt i32 %n, 0 br i1 %cmp10, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %ans.013 = phi i32 [ %ans.1, %if.end ], [ 1, %entry ] %a.addr.012 = phi i32 [ %rem2, %if.end ], [ %a, %entry ] %n.addr.011 = phi i32 [ %div9, %if.end ], [ %n, %entry ] %and = and i32 %n.addr.011, 1 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i32 %ans.013, %a.addr.012 %rem = srem i32 %mul, %mod br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i32 [ %rem, %if.then ], [ %ans.013, %while.body ] %mul1 = mul nsw i32 %a.addr.012, %a.addr.012 %rem2 = srem i32 %mul1, %mod %div9 = lshr i32 %n.addr.011, 1 %cmp.not = icmp ult i32 %n.addr.011, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1, %if.end ] ret i32 %ans.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: %b.a = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chmax(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %b br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %b, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chmin(ptr nocapture noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %b br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %b, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 30 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #9 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int x; scanf("%d", &x); if(x < 30) { printf("No\n"); } else { printf("Yes\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125391/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 30 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n, m; int i, j; int temp; int end; int answer[5][100]; int counter = 0; int array[1000][100]; int sum[100]; int ans[100]; int s[5]; while(1){ scanf("%d%d", &n, &m); if(n == 0 && m == 0){ break ; } s[counter] = m; for(j = 0; j < m; j++){ sum[j] = 0; } for(i = 0; i < n; i++){ for(j = 0; j < m; j++){ scanf("%d", &array[i][j]); } } for(j = 0; j < m; j++){ for(i = 0; i < n; i++){ sum[j] = sum[j] + array[i][j]; } } for(j = 0; j < m; j++){ ans[j] = j; } //sort while(1){ end = 0; for(j = 0; j < m - 1; j++){ if(sum[j] < sum[j + 1]){ temp = sum[j]; sum[j] = sum[j + 1]; sum[j + 1] = temp; temp = ans[j]; ans[j] = ans[j + 1]; ans[j + 1] = temp; end = 1; } } if(end == 0){ break ; } } for(j = 0; j < m; j++){ answer[counter][j] = ans[j]; } answer[counter][j] = 1000; counter++; } for(i = 0; i < counter; i++){ for(j = 0; j < s[i]; j++){ printf("%d", answer[i][j] + 1); if(j < s[i]-1){printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125441/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125441/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %answer = alloca [5 x [100 x i32]], align 16 %array = alloca [1000 x [100 x i32]], align 16 %sum = alloca [100 x i32], align 16 %ans = alloca [100 x i32], align 16 %s = alloca [5 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %answer) #7 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %array) #7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %sum) #7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %ans) #7 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #7 %call210 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp211 = icmp eq i32 %0, 0 %1 = load i32, ptr %m, align 4 %cmp1212 = icmp eq i32 %1, 0 %or.cond213 = select i1 %cmp211, i1 %cmp1212, i1 false br i1 %or.cond213, label %for.end134, label %if.end for.cond107.preheader: ; preds = %for.end100 %2 = and i64 %indvar.next, 4294967295 %cmp108218.not = icmp eq i64 %2, 0 br i1 %cmp108218.not, label %for.end134, label %for.cond110.preheader.preheader for.cond110.preheader.preheader: ; preds = %for.cond107.preheader %wide.trip.count260 = and i64 %indvar.next, 4294967295 br label %for.cond110.preheader if.end: ; preds = %entry, %for.end100 %3 = phi i32 [ %72, %for.end100 ], [ %0, %entry ] %indvar = phi i64 [ %indvar.next, %for.end100 ], [ 0, %entry ] %4 = phi i32 [ %73, %for.end100 ], [ %1, %entry ] %5 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr %answer, i64 %5 %arrayidx = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 %indvar store i32 %4, ptr %arrayidx, align 4, !tbaa !5 %cmp2188 = icmp sgt i32 %4, 0 br i1 %cmp2188, label %for.cond5.preheader, label %for.end100 for.cond5.preheader: ; preds = %if.end %6 = zext i32 %4 to i64 %7 = shl nuw nsw i64 %6, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %sum, i8 0, i64 %7, i1 false), !tbaa !5 %cmp6192 = icmp sgt i32 %3, 0 br i1 %cmp6192, label %for.cond8.preheader, label %for.cond22.preheader for.cond22.preheader: ; preds = %for.inc19, %for.cond5.preheader %8 = phi i32 [ %4, %for.cond5.preheader ], [ %51, %for.inc19 ] %.lcssa = phi i32 [ %3, %for.cond5.preheader ], [ %50, %for.inc19 ] %cmp23197 = icmp sgt i32 %8, 0 br i1 %cmp23197, label %for.cond25.preheader.lr.ph, label %for.end100 for.cond25.preheader.lr.ph: ; preds = %for.cond22.preheader %cmp26194 = icmp sgt i32 %.lcssa, 0 br i1 %cmp26194, label %for.cond25.preheader.us.preheader, label %for.body44.preheader for.cond25.preheader.us.preheader: ; preds = %for.cond25.preheader.lr.ph %wide.trip.count234 = zext i32 %8 to i64 %wide.trip.count = zext i32 %.lcssa to i64 %min.iters.check288 = icmp ult i32 %.lcssa, 8 %n.vec291 = and i64 %wide.trip.count, 4294967288 %cmp.n293 = icmp eq i64 %n.vec291, %wide.trip.count br label %for.cond25.preheader.us for.cond25.preheader.us: ; preds = %for.cond25.preheader.us.preheader, %for.cond25.for.inc39_crit_edge.us %indvars.iv231 = phi i64 [ 0, %for.cond25.preheader.us.preheader ], [ %indvars.iv.next232, %for.cond25.for.inc39_crit_edge.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv231 %arrayidx29.promoted.us = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 br i1 %min.iters.check288, label %for.body27.us.preheader, label %vector.ph289 vector.ph289: ; preds = %for.cond25.preheader.us %9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %arrayidx29.promoted.us, i64 0 br label %vector.body294 vector.body294: ; preds = %vector.body294, %vector.ph289 %index295 = phi i64 [ 0, %vector.ph289 ], [ %index.next297, %vector.body294 ] %vec.phi = phi <4 x i32> [ %9, %vector.ph289 ], [ %41, %vector.body294 ] %vec.phi296 = phi <4 x i32> [ zeroinitializer, %vector.ph289 ], [ %42, %vector.body294 ] %10 = or i64 %index295, 1 %11 = or i64 %index295, 2 %12 = or i64 %index295, 3 %13 = or i64 %index295, 4 %14 = or i64 %index295, 5 %15 = or i64 %index295, 6 %16 = or i64 %index295, 7 %17 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %index295, i64 %indvars.iv231 %18 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %10, i64 %indvars.iv231 %19 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %11, i64 %indvars.iv231 %20 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %12, i64 %indvars.iv231 %21 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %13, i64 %indvars.iv231 %22 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %14, i64 %indvars.iv231 %23 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %15, i64 %indvars.iv231 %24 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %16, i64 %indvars.iv231 %25 = load i32, ptr %17, align 4, !tbaa !5 %26 = load i32, ptr %18, align 4, !tbaa !5 %27 = load i32, ptr %19, align 4, !tbaa !5 %28 = load i32, ptr %20, align 4, !tbaa !5 %29 = insertelement <4 x i32> poison, i32 %25, i64 0 %30 = insertelement <4 x i32> %29, i32 %26, i64 1 %31 = insertelement <4 x i32> %30, i32 %27, i64 2 %32 = insertelement <4 x i32> %31, i32 %28, i64 3 %33 = load i32, ptr %21, align 4, !tbaa !5 %34 = load i32, ptr %22, align 4, !tbaa !5 %35 = load i32, ptr %23, align 4, !tbaa !5 %36 = load i32, ptr %24, align 4, !tbaa !5 %37 = insertelement <4 x i32> poison, i32 %33, i64 0 %38 = insertelement <4 x i32> %37, i32 %34, i64 1 %39 = insertelement <4 x i32> %38, i32 %35, i64 2 %40 = insertelement <4 x i32> %39, i32 %36, i64 3 %41 = add <4 x i32> %32, %vec.phi %42 = add <4 x i32> %40, %vec.phi296 %index.next297 = add nuw i64 %index295, 8 %43 = icmp eq i64 %index.next297, %n.vec291 br i1 %43, label %middle.block286, label %vector.body294, !llvm.loop !9 middle.block286: ; preds = %vector.body294 %bin.rdx = add <4 x i32> %42, %41 %44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n293, label %for.cond25.for.inc39_crit_edge.us, label %for.body27.us.preheader for.body27.us.preheader: ; preds = %for.cond25.preheader.us, %middle.block286 %indvars.iv228.ph = phi i64 [ 0, %for.cond25.preheader.us ], [ %n.vec291, %middle.block286 ] %add196.us.ph = phi i32 [ %arrayidx29.promoted.us, %for.cond25.preheader.us ], [ %44, %middle.block286 ] br label %for.body27.us for.body27.us: ; preds = %for.body27.us.preheader, %for.body27.us %indvars.iv228 = phi i64 [ %indvars.iv.next229, %for.body27.us ], [ %indvars.iv228.ph, %for.body27.us.preheader ] %add196.us = phi i32 [ %add.us, %for.body27.us ], [ %add196.us.ph, %for.body27.us.preheader ] %arrayidx33.us = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %indvars.iv228, i64 %indvars.iv231 %45 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5 %add.us = add nsw i32 %45, %add196.us %indvars.iv.next229 = add nuw nsw i64 %indvars.iv228, 1 %exitcond.not = icmp eq i64 %indvars.iv.next229, %wide.trip.count br i1 %exitcond.not, label %for.cond25.for.inc39_crit_edge.us, label %for.body27.us, !llvm.loop !13 for.cond25.for.inc39_crit_edge.us: ; preds = %for.body27.us, %middle.block286 %add.us.lcssa = phi i32 [ %44, %middle.block286 ], [ %add.us, %for.body27.us ] store i32 %add.us.lcssa, ptr %arrayidx29.us, align 4, !tbaa !5 %indvars.iv.next232 = add nuw nsw i64 %indvars.iv231, 1 %exitcond235.not = icmp eq i64 %indvars.iv.next232, %wide.trip.count234 br i1 %exitcond235.not, label %for.cond42.preheader, label %for.cond25.preheader.us, !llvm.loop !14 for.cond8.preheader: ; preds = %for.cond5.preheader, %for.inc19 %46 = phi i32 [ %50, %for.inc19 ], [ %3, %for.cond5.preheader ] %47 = phi i32 [ %51, %for.inc19 ], [ %4, %for.cond5.preheader ] %indvars.iv225 = phi i64 [ %indvars.iv.next226, %for.inc19 ], [ 0, %for.cond5.preheader ] %cmp9190 = icmp sgt i32 %47, 0 br i1 %cmp9190, label %for.body10, label %for.inc19 for.body10: ; preds = %for.cond8.preheader, %for.body10 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body10 ], [ 0, %for.cond8.preheader ] %arrayidx14 = getelementptr inbounds [1000 x [100 x i32]], ptr %array, i64 0, i64 %indvars.iv225, i64 %indvars.iv %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx14) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %48 = load i32, ptr %m, align 4, !tbaa !5 %49 = sext i32 %48 to i64 %cmp9 = icmp slt i64 %indvars.iv.next, %49 br i1 %cmp9, label %for.body10, label %for.inc19.loopexit, !llvm.loop !15 for.inc19.loopexit: ; preds = %for.body10 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc19 for.inc19: ; preds = %for.inc19.loopexit, %for.cond8.preheader %50 = phi i32 [ %.pre, %for.inc19.loopexit ], [ %46, %for.cond8.preheader ] %51 = phi i32 [ %48, %for.inc19.loopexit ], [ %47, %for.cond8.preheader ] %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1 %52 = sext i32 %50 to i64 %cmp6 = icmp slt i64 %indvars.iv.next226, %52 br i1 %cmp6, label %for.cond8.preheader, label %for.cond22.preheader, !llvm.loop !16 for.cond42.preheader: ; preds = %for.cond25.for.inc39_crit_edge.us br i1 %cmp23197, label %for.body44.preheader, label %while.cond50.preheader for.body44.preheader: ; preds = %for.cond25.preheader.lr.ph, %for.cond42.preheader %wide.trip.count239 = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body44.preheader298, label %vector.ph vector.ph: ; preds = %for.body44.preheader %n.vec = and i64 %wide.trip.count239, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %53 = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %53, align 16, !tbaa !5 %54 = getelementptr inbounds i32, ptr %53, i64 4 store <4 x i32> %step.add, ptr %54, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %55 = icmp eq i64 %index.next, %n.vec br i1 %55, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count239 br i1 %cmp.n, label %while.cond50.preheader, label %for.body44.preheader298 for.body44.preheader298: ; preds = %for.body44.preheader, %middle.block %indvars.iv236.ph = phi i64 [ 0, %for.body44.preheader ], [ %n.vec, %middle.block ] br label %for.body44 while.cond50.preheader: ; preds = %for.body44, %middle.block, %for.cond42.preheader %cmp23197268270 = phi i1 [ false, %for.cond42.preheader ], [ true, %middle.block ], [ true, %for.body44 ] %cmp53203 = icmp sgt i32 %8, 1 br i1 %cmp53203, label %while.cond50.us.preheader, label %for.cond89.preheader while.cond50.us.preheader: ; preds = %while.cond50.preheader %sub = add i32 %8, -1 %wide.trip.count244 = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count244, 1 %56 = icmp eq i32 %sub, 1 %unroll_iter = and i64 %wide.trip.count244, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %while.cond50.us while.cond50.us: ; preds = %while.cond50.us.preheader, %for.cond52.for.end85_crit_edge.us %.pre262 = load i32, ptr %sum, align 16, !tbaa !5 br i1 %56, label %for.cond52.for.end85_crit_edge.us.unr-lcssa, label %for.body54.us for.body54.us: ; preds = %while.cond50.us, %for.inc83.us.1 %57 = phi i32 [ %65, %for.inc83.us.1 ], [ %.pre262, %while.cond50.us ] %indvars.iv241 = phi i64 [ %indvars.iv.next242.1, %for.inc83.us.1 ], [ 0, %while.cond50.us ] %end.0205.us = phi i32 [ %end.1.us.1, %for.inc83.us.1 ], [ 0, %while.cond50.us ] %niter = phi i64 [ %niter.next.1, %for.inc83.us.1 ], [ 0, %while.cond50.us ] %indvars.iv.next242 = or i64 %indvars.iv241, 1 %arrayidx59.us = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv.next242 %58 = load i32, ptr %arrayidx59.us, align 4, !tbaa !5 %cmp60.us = icmp slt i32 %57, %58 br i1 %cmp60.us, label %if.then61.us, label %for.inc83.us if.then61.us: ; preds = %for.body54.us %arrayidx56.us = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv241 store i32 %58, ptr %arrayidx56.us, align 8, !tbaa !5 store i32 %57, ptr %arrayidx59.us, align 4, !tbaa !5 %arrayidx73.us = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %indvars.iv241 %59 = load <2 x i32>, ptr %arrayidx73.us, align 8, !tbaa !5 %60 = shufflevector <2 x i32> %59, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %60, ptr %arrayidx73.us, align 8, !tbaa !5 br label %for.inc83.us for.inc83.us: ; preds = %if.then61.us, %for.body54.us %61 = phi i32 [ %57, %if.then61.us ], [ %58, %for.body54.us ] %end.1.us = phi i32 [ 1, %if.then61.us ], [ %end.0205.us, %for.body54.us ] %indvars.iv.next242.1 = add nuw nsw i64 %indvars.iv241, 2 %arrayidx59.us.1 = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv.next242.1 %62 = load i32, ptr %arrayidx59.us.1, align 8, !tbaa !5 %cmp60.us.1 = icmp slt i32 %61, %62 br i1 %cmp60.us.1, label %if.then61.us.1, label %for.inc83.us.1 if.then61.us.1: ; preds = %for.inc83.us %arrayidx56.us.1 = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv.next242 store i32 %62, ptr %arrayidx56.us.1, align 4, !tbaa !5 store i32 %61, ptr %arrayidx59.us.1, align 8, !tbaa !5 %arrayidx73.us.1 = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %indvars.iv.next242 %63 = load <2 x i32>, ptr %arrayidx73.us.1, align 4, !tbaa !5 %64 = shufflevector <2 x i32> %63, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %64, ptr %arrayidx73.us.1, align 4, !tbaa !5 br label %for.inc83.us.1 for.inc83.us.1: ; preds = %if.then61.us.1, %for.inc83.us %65 = phi i32 [ %61, %if.then61.us.1 ], [ %62, %for.inc83.us ] %end.1.us.1 = phi i32 [ 1, %if.then61.us.1 ], [ %end.1.us, %for.inc83.us ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond52.for.end85_crit_edge.us.unr-lcssa, label %for.body54.us, !llvm.loop !19 for.cond52.for.end85_crit_edge.us.unr-lcssa: ; preds = %for.inc83.us.1, %while.cond50.us %end.1.us.lcssa.ph = phi i32 [ undef, %while.cond50.us ], [ %end.1.us.1, %for.inc83.us.1 ] %.unr = phi i32 [ %.pre262, %while.cond50.us ], [ %65, %for.inc83.us.1 ] %indvars.iv241.unr = phi i64 [ 0, %while.cond50.us ], [ %indvars.iv.next242.1, %for.inc83.us.1 ] %end.0205.us.unr = phi i32 [ 0, %while.cond50.us ], [ %end.1.us.1, %for.inc83.us.1 ] br i1 %lcmp.mod.not, label %for.cond52.for.end85_crit_edge.us, label %for.body54.us.epil for.body54.us.epil: ; preds = %for.cond52.for.end85_crit_edge.us.unr-lcssa %indvars.iv.next242.epil = add nuw nsw i64 %indvars.iv241.unr, 1 %arrayidx59.us.epil = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv.next242.epil %66 = load i32, ptr %arrayidx59.us.epil, align 4, !tbaa !5 %cmp60.us.epil = icmp slt i32 %.unr, %66 br i1 %cmp60.us.epil, label %if.then61.us.epil, label %for.cond52.for.end85_crit_edge.us if.then61.us.epil: ; preds = %for.body54.us.epil %arrayidx56.us.epil = getelementptr inbounds [100 x i32], ptr %sum, i64 0, i64 %indvars.iv241.unr store i32 %66, ptr %arrayidx56.us.epil, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx59.us.epil, align 4, !tbaa !5 %arrayidx73.us.epil = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %indvars.iv241.unr %67 = load <2 x i32>, ptr %arrayidx73.us.epil, align 4, !tbaa !5 %68 = shufflevector <2 x i32> %67, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %68, ptr %arrayidx73.us.epil, align 4, !tbaa !5 br label %for.cond52.for.end85_crit_edge.us for.cond52.for.end85_crit_edge.us: ; preds = %for.body54.us.epil, %if.then61.us.epil, %for.cond52.for.end85_crit_edge.us.unr-lcssa %end.1.us.lcssa = phi i32 [ %end.1.us.lcssa.ph, %for.cond52.for.end85_crit_edge.us.unr-lcssa ], [ 1, %if.then61.us.epil ], [ %end.0205.us.unr, %for.body54.us.epil ] %cmp86.us = icmp eq i32 %end.1.us.lcssa, 0 br i1 %cmp86.us, label %for.cond89.preheader, label %while.cond50.us for.body44: ; preds = %for.body44.preheader298, %for.body44 %indvars.iv236 = phi i64 [ %indvars.iv.next237, %for.body44 ], [ %indvars.iv236.ph, %for.body44.preheader298 ] %arrayidx46 = getelementptr inbounds [100 x i32], ptr %ans, i64 0, i64 %indvars.iv236 %69 = trunc i64 %indvars.iv236 to i32 store i32 %69, ptr %arrayidx46, align 4, !tbaa !5 %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1 %exitcond240.not = icmp eq i64 %indvars.iv.next237, %wide.trip.count239 br i1 %exitcond240.not, label %while.cond50.preheader, label %for.body44, !llvm.loop !20 for.cond89.preheader: ; preds = %for.cond52.for.end85_crit_edge.us, %while.cond50.preheader br i1 %cmp23197268270, label %for.body91.preheader, label %for.end100 for.body91.preheader: ; preds = %for.cond89.preheader %70 = zext i32 %8 to i64 %71 = shl nuw nsw i64 %70, 2 call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep, ptr nonnull align 16 %ans, i64 %71, i1 false), !tbaa !5 br label %for.end100 for.end100: ; preds = %if.end, %for.cond22.preheader, %for.body91.preheader, %for.cond89.preheader %j.5.lcssa = phi i32 [ 0, %for.cond89.preheader ], [ %8, %for.body91.preheader ], [ 0, %for.cond22.preheader ], [ 0, %if.end ] %idxprom103 = zext i32 %j.5.lcssa to i64 %arrayidx104 = getelementptr inbounds [5 x [100 x i32]], ptr %answer, i64 0, i64 %indvar, i64 %idxprom103 store i32 1000, ptr %arrayidx104, align 4, !tbaa !5 %indvar.next = add nuw i64 %indvar, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %72 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %72, 0 %73 = load i32, ptr %m, align 4 %cmp1 = icmp eq i32 %73, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %for.cond107.preheader, label %if.end for.cond110.preheader: ; preds = %for.cond110.preheader.preheader, %for.end130 %indvars.iv257 = phi i64 [ 0, %for.cond110.preheader.preheader ], [ %indvars.iv.next258, %for.end130 ] %arrayidx112 = getelementptr inbounds [5 x i32], ptr %s, i64 0, i64 %indvars.iv257 %74 = load i32, ptr %arrayidx112, align 4, !tbaa !5 %cmp113216 = icmp sgt i32 %74, 0 br i1 %cmp113216, label %for.body114.lr.ph, label %for.end130 for.body114.lr.ph: ; preds = %for.cond110.preheader %sub123 = add nsw i32 %74, -1 %75 = zext i32 %sub123 to i64 %wide.trip.count255 = zext i32 %74 to i64 br label %for.body114 for.body114: ; preds = %for.body114.lr.ph, %for.inc128 %indvars.iv252 = phi i64 [ 0, %for.body114.lr.ph ], [ %indvars.iv.next253, %for.inc128 ] %arrayidx118 = getelementptr inbounds [5 x [100 x i32]], ptr %answer, i64 0, i64 %indvars.iv257, i64 %indvars.iv252 %76 = load i32, ptr %arrayidx118, align 4, !tbaa !5 %add119 = add nsw i32 %76, 1 %call120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add119) %cmp124 = icmp ult i64 %indvars.iv252, %75 br i1 %cmp124, label %if.then125, label %for.inc128 if.then125: ; preds = %for.body114 %putchar186 = call i32 @putchar(i32 32) br label %for.inc128 for.inc128: ; preds = %for.body114, %if.then125 %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1 %exitcond256.not = icmp eq i64 %indvars.iv.next253, %wide.trip.count255 br i1 %exitcond256.not, label %for.end130, label %for.body114, !llvm.loop !21 for.end130: ; preds = %for.inc128, %for.cond110.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next258 = add nuw nsw i64 %indvars.iv257, 1 %exitcond261.not = icmp eq i64 %indvars.iv.next258, %wide.trip.count260 br i1 %exitcond261.not, label %for.end134, label %for.cond110.preheader, !llvm.loop !22 for.end134: ; preds = %for.end130, %entry, %for.cond107.preheader call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %ans) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %sum) #7 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %array) #7 call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %answer) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !17} !17 = !{!"llvm.loop.unswitch.partial.disable"} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10, !12, !11} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#pragma region kyopuro_templates #pragma GCC optimize("Ofast") #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> #include<time.h> #include<ctype.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<62) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 20) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } void PriAll1(ll a[], ll n){ rep(i,0,n){ printf("%lld",a[i]); if(i!=n-1) printf(" "); }PN; } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } ll digits(ll a, ll b){return a/b?1+digits(a/b,b):1;} ll base(ll n, ll a, ll i){return i==1?n%a:base(n/a,a,i-1);} ll is_inArr1(ll x, ll n){ return ( x<0 || x>=n ) ? 0 : 1 ; } ll is_inArr2(ll y, ll x, ll h, ll w){ return ( y<0 || y>=h || x<0 || x>=w ) ? 0 : 1 ; } void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } ll *factors[2] , fac_cnt=0 , is_factor_prepared=0; ll factor_pre(){ rep(i,0,1){ if(is_factor_prepared++) return 0; } ll tmp=(1e6)/2+1, fac_tmp[tmp]; rep(i,0,tmp){fac_tmp[i]=i?2*i+1:2;} rep(i,1,tmp){if(fac_tmp[i]){ repp(j,3,tmp/(2*i+1)+1,2 ){ if( j*(2*i+1)<tmp ) fac_tmp[ (j*(2*i+1)-1)/2 ]=0; } }else continue;} rep(i,0,tmp){if(fac_tmp[i]){ rep(j,0,2){ factors[j] = realloc( factors[j] , sizeof(ll)*( fac_cnt +1 ) ); factors[j][j?fac_cnt++:fac_cnt]=j?0:fac_tmp[i]; } } } return 0; } ll factor(ll n, ll new_common_plus){ factor_pre(); rep(i,0,fac_cnt){ ll cnt=0; rep(j,0,1){ while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue; } factors[1][i]= new_common_plus==1 ? cnt : new_common_plus==2 ? max2(factors[1][i],cnt) : factors[1][i]+cnt ; if( factors[0][i]> n ) break; } return n; } ll judge_prime(ll n){ factor_pre(); rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; } ll *mf_arr,*inv_arr,*finv_arr,is_minv_made=0,is_mf_made=0,num_of_inv=2*1e6+10; ll makeinv(ll n , ll mod){ rep(i,0,1){if(is_minv_made++) return 0;} inv_arr = realloc(inv_arr, sizeof(ll)*2 ); finv_arr = realloc(finv_arr, sizeof(ll)*2 ); inv_arr[1]=1;finv_arr[0]=finv_arr[1]=1; rep(i,2,n+1){ inv_arr = realloc(inv_arr, sizeof(ll)*(i+1) ); finv_arr = realloc(finv_arr, sizeof(ll)*(i+1) ); inv_arr[i]= mod - inv_arr[mod%i] * (mod / i) % mod; finv_arr[i] = finv_arr[i - 1] * inv_arr[i] % mod; } return 0; } ll make_mf(ll n, ll mod){ rep(i,0,1){ if(is_mf_made++) return 0; } mf_arr = realloc(mf_arr, sizeof(ll)*2 ); ll x=1; mf_arr[0]=mf_arr[1]=x; rep(i,2,n+1){ x=x*i%mod; mf_arr = realloc(mf_arr, sizeof(ll)*(i+1) ); mf_arr[i]=x; } return 0; } ll m_inv(ll x, ll mod, ll is_fac ){ makeinv(num_of_inv,mod); return is_fac?finv_arr[x]:inv_arr[x]; } ll m_f(ll x, ll mod){ make_mf(num_of_inv,mod); return mf_arr[x]; } ll mod_nck(ll n, ll k, ll mod){ return m_f(n,mod)*m_inv(k,mod,1)%mod*m_inv(n-k,mod,1)%mod; } ll m_p(ll r,ll n,ll mod){ ll t=1,s=r; while(n>0){ t = (n&1) ? t*s%mod : t; s=s*s%mod; n>>=1; } return r?t:0; } ll m_mul2(ll a, ll b, ll mod){ return a*b%mod; } ll m_mul3(ll a, ll b, ll c, ll mod){ return m_mul2(a*b%mod,c,mod); } ll m_mul4(ll a, ll b, ll c, ll d, ll mod){ return m_mul3(a*b%mod,c,d,mod); } ll m_mul5(ll a, ll b, ll c, ll d, ll e, ll mod){ return m_mul4(a*b%mod,c,d,e,mod); } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } ll compare(ll a, ll b){ return a<b?-1:a>b?1:0; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ){ ll pa=((fr*)p)->a; ll qa=((fr*)q)->a; return compare(pa,qa); } int cmp2( const void *p, const void *q ){ ll pa=((fr*)p)->a; ll qa=((fr*)q)->a; return compare(qa,pa); } void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} void sort_partial(ll a[],int begin,int end,int is_increase){ ll *b; b = (ll *) malloc( sizeof(ll)*(end-begin) ); rep(i,begin,end) b[i-begin]=a[i]; if(is_increase) sortup(b,end-begin); else sortdown(b,end-begin); rep(i,begin,end) a[i]=b[i-begin]; } #pragma region AVL /*---------------------------AVL start--------------------------------*/ //https://qiita.com/mikecat_mixc/items/e9f8248de2ae7f7a0a29 typedef struct node_AVL_set{ ll val; int diff; int cnt; struct node_AVL_set *child[2]; }AVL_set; void AVL_set_inside_rotate(AVL_set **node, int is_right){ int l = is_right==false , r = is_right==true , sign = is_right ? 1 : -1; if((*node)->child[l] != NULL){ AVL_set* left = (*node)->child[l]; int a= (*node)->diff * sign , b= left->diff * sign ,na,nb; if(b+1){ na=a-1-b; nb= (a-b) ? b-1 : a-2; }else{ na=a-1; nb= a ? b-1 : a+b-2; } (*node)->diff = na * sign; left->diff = nb * sign; /* rotate-> */ (*node)->child[l] = (*node)->child[l]->child[r]; left->child[r] = *node; *node = left; } } int AVL_set_inside_update(AVL_set **node, ll data, int add){ if(*node == NULL){ if(add==2){ *node = malloc(sizeof(AVL_set)); (*node)->val = data; (*node)->cnt = 1; (*node)->diff = 0; (*node)->child[0] = NULL; (*node)->child[1] = NULL; } return add==2 ? *node != NULL : 0; }else{ int l, delta, delta_sign; AVL_set *next_node; if(data == (*node)->val){ if(add==2){ (*node)->cnt++; return 0; }else{ if( add && (*node)->cnt > 1 ){ (*node)->cnt--; return 0; }else{ if((*node)->child[1] == NULL){ next_node = (*node)->child[0]; free(*node); *node = next_node; return -1; }else if((*node)->child[0] == NULL){ next_node = (*node)->child[1]; free(*node); *node = next_node; return -1; }else{ for(next_node = (*node)->child[0]; next_node->child[1] != NULL; next_node = next_node->child[1]); (*node)->val = next_node->val; l=0; delta_sign=1; delta = AVL_set_inside_update(&(*node)->child[l], next_node->val, add); } } } }else{ l = data >= (*node)->val ? 1 : 0; delta_sign = data < (*node)->val ? 1 : -1; delta = AVL_set_inside_update(&(*node)->child[l], data, add); } if( delta ){ int orig_diff = (*node)->diff; int do_rotate = 0, rotate_l , diff_sign , rotate_right; (*node)->diff += delta * delta_sign; if((*node)->diff > 1){ do_rotate = 1; rotate_l = 0; diff_sign = 1; rotate_right = 1; }else if((*node)->diff < -1){ do_rotate = 1; rotate_l = 1; diff_sign = -1; rotate_right = 0; } if(do_rotate){ int child_diff = (*node)->child[rotate_l]->diff; if((*node)->child[rotate_l]->diff * diff_sign < 0){ AVL_set_inside_rotate(&(*node)->child[rotate_l], !rotate_right); } AVL_set_inside_rotate(node, rotate_right); return delta < 0 && child_diff != 0 ? -1 : 0; } if (delta > 0 && orig_diff == 0) return 1; else if(delta < 0 && orig_diff != 0) return -1; else return 0; }else{ return 0; } } } void AVL_set_inside_print(const AVL_set *node, int depth){ if(node == NULL) return; AVL_set_inside_print(node->child[1], depth + 1); printf("%lld %d\n", node->val,node->cnt); AVL_set_inside_print(node->child[0], depth + 1); } void AVL_set_inside_free(AVL_set *node){ if(node == NULL) return; AVL_set_inside_free(node->child[0]); AVL_set_inside_free(node->child[1]); free(node); } ll AVL_set_inside_count(AVL_set *root, ll val){ AVL_set *node; node = root; while(node){ if (val < node->val) node = node->child[0]; else if(val > node->val) node = node->child[1]; else return node->cnt; } return 0; } int AVL_set_lowcomp(ll node, ll val, int type){ if(node==val){ if(type!=3) return 0; else return 1; } if(node<val) return 1; if(node>val) return -1; return 0; } // return smallest p which meets a[p]==val :1 >=:2 >:3 AVL_set* AVL_set_inside_lowerbound(AVL_set *root, ll val, int type){ AVL_set *node; node = root; while(node){ int com=AVL_set_lowcomp(node->val,val,type); if(com==0) return node; if(com==1) node = node->child[1]; if(com==-1){ AVL_set *small; small=AVL_set_inside_lowerbound(node->child[0],val,type); if(type==1){ return small; }else{ if(small!=NULL) return small; else return node; } } } return node; } int AVL_set_upcomp(ll node, ll val, int type){ if(node==val){ if(type!=3) return 0; else return -1; } if(node<val) return 1; if(node>val) return -1; return 0; } // return biggest p which meets a[p]==val :1 <=:2 <:3 AVL_set* AVL_set_inside_upperbound(AVL_set *root, ll val, int type){ AVL_set *node; node = root; while(node){ int com=AVL_set_upcomp(node->val,val,type); if(com==0) return node; if(com==-1) node = node->child[0]; if(com==1){ AVL_set *big; big=AVL_set_inside_upperbound(node->child[1],val,type); if(type==1){ return big; }else{ if(big!=NULL) return big; else return node; } } } return node; } ll AVL_set_inside_minmax(AVL_set *root, int type){ while(root->child[type] !=NULL) root= root->child[type]; return root->val; } void AVL_set_inside_swap(AVL_set **node1, AVL_set **node2){ AVL_set *tmp; tmp=*node1; *node1=*node2; *node2=tmp; } #define set_MAX_SIZE 514511 ll set_main( int command , int set_num , ll val ,ll option){ static bool set_is_init=false; static AVL_set *set_pointer[set_MAX_SIZE]; static ll set_siz[set_MAX_SIZE]; if(!set_is_init){ set_is_init=true; rep(i,0,set_MAX_SIZE){ *(set_pointer+i) = NULL; set_siz[i]=0; } } if(command==-1){ AVL_set_inside_print( set_pointer[set_num] ,0); } if(command==1){ AVL_set_inside_count(set_pointer[set_num],val) ? 1 : set_siz[set_num]++; AVL_set_inside_update( &set_pointer[set_num] , val , 2 ); } if(command==2){ return AVL_set_inside_count(set_pointer[set_num],val); } if(command==3){ ( AVL_set_inside_count(set_pointer[set_num],val) > 1 ) ? 1 : set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val,1); } if(command==4){ set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val , 0 ); } if(command==5){ set_siz[set_num]=0; AVL_set_inside_free( set_pointer[set_num] ); set_pointer[set_num] = NULL; } if(command==6){ return set_siz[set_num]; } if(command==7){ return AVL_set_inside_minmax(set_pointer[set_num],1); } if(command==8){ return AVL_set_inside_minmax(set_pointer[set_num],0); } if(command==9){ AVL_set_inside_swap(&set_pointer[set_num],&set_pointer[val]); } if(10<=command&&command<=12){ AVL_set *lowbound = AVL_set_inside_lowerbound(set_pointer[set_num],val,command-9); if(lowbound==NULL) return option; else return lowbound->val; } if(13<=command&&command<=15){ AVL_set *upbound = AVL_set_inside_upperbound(set_pointer[set_num],val,command-12); if(upbound==NULL) return option; else return upbound->val; } return 0; } void set_print(int set_num){ set_main(-1,set_num,0,0); } void set_insert(int set_num, ll val){ set_main(1,set_num,val,0); } ll set_count(int set_num, ll val){ return set_main(2,set_num,val,0); } void set_erase(int set_num, ll val, int is_all){ if(is_all) set_main(4,set_num,val,0); else set_main(3,set_num,val,0); } void set_clear(int set_num){ set_main(5,set_num,0,0); } ll set_size(int set_num){ return set_main(6,set_num,0,0); } ll set_max(int set_num){ return set_main(7,set_num,0,0); } ll set_min(int set_num){ return set_main(8,set_num,0,0); } void set_swap(int set_num1, int set_num2){ set_main(9,set_num1,set_num2,0); } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll set_lowerbound(int set_num, ll val, int type, ll error){ return set_main(9+type,set_num,val,error); } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll set_upperbound(int set_num, ll val, int type, ll error){ return set_main(12+type,set_num,val,error); } /* insert * size * clear * erase * count * max * min * swap * begin x end x merge source の要素のキーと等価なキーの要素がある場合、その要素は source から抽出されない lower_bound * upper_bound * */ // ll map_main() /*---------------------------AVL start--------------------------------*/ #pragma endregion AVL #pragma endregion kyopuro_templates /*-----------------------segment tree-----------------------------------------*/ /* ll t=1; while(t<n) t*=2; 木の最底辺の大きさを決める seg木のsize:2*t-1 */ ll (*seg_ope)(ll,ll); ll (*seg_def)(void); ll seg[1151151],seg_t=1; ll seg_def_max(){ return -INF; } ll seg_def_min(){ return INF; } ll seg_def_sum(){ return 0; } ll seg_def_gcd(){ return 0; } ll seg_ope_max(ll a, ll b){ return max2(a,b); } void segmake(ll n, ll a[]){ while(seg_t<n) seg_t*=2; ll t=seg_t; // rep(i,0,t) seg[t-1+i]=i<n?a[i]:-INF; rep(i,0,t){ if(i<n){ seg[t-1+i]=a[i]; }else{ seg[t-1+i]=seg_def(); } } // while(t/=2) rep(i,0,t) seg[t+i-1]=max2(seg[2*(t+i)],seg[2*(t+i)-1]); while(t/=2) rep(i,0,t) seg[t+i-1]= seg_ope(seg[2*(t+i)],seg[2*(t+i)-1]); } // void segmake(ll n, ll a[n]){ // while(seg_t<n) seg_t*=2; // ll t=seg_t; // rep(i,0,t) seg[t-1+i]=i<n?a[i]:-INF; // while(t/=2) rep(i,0,t) seg[t+i-1]=max2(seg[2*(t+i)],seg[2*(t+i)-1]); // } // 初期状態 segmin(x[i],y[i],0,0,t-1) ll segmin(ll from, ll to, ll a, ll l, ll r){ return (l>=from && r<=to) ? seg[a] : (l>to || r<from) ? -INF : max2(segmin(from,to,2*a+1,l,(l+r)/2),segmin(from,to,2*a+2,(l+r)/2+1,r)); } ll seggcd(ll from, ll to, ll a, ll l, ll r){ return (l>=from && r<=to) ? seg[a] : (to<(l+r)/2+1) ? seggcd(from,to,2*a+1,l,(l+r)/2) : (from>(l+r)/2) ? seggcd(from,to,2*a+2,(l+r)/2+1,r) : gcd( seggcd(from,to,2*a+2,(l+r)/2+1,r) , seggcd(from,to,2*a+1,l,(l+r)/2) ); } void segupdate(ll a, ll b){ ll c=seg_t-1+a; seg[c]=b; while(c>0){ c--; c/=2; seg[c]=max2(seg[2*(c+1)],seg[2*(c+1)-1]); } } /*-----------------------segment tree(end)-----------------------------------------*/ ll fl[225225]; void solve(){ // fgets(s,sizeof(s),stdin); ll n; ll ans=0; cin(&n); // scanf("%s",s); ll h[n]; ll a[n]; rep(i,0,n){ cin(&h[i]); } // seg_operate = seg_def=seg_def_max; seg_ope=seg_ope_max; segmake(n+1,fl); rep(i,0,n){ cin(&a[i]); ll v=segmin(0,h[i]-1,0,0,seg_t-1); segupdate(h[i],v+a[i]); } printf("%lld\n",segmin(0,n,0,0,seg_t-1)); } int main(void){ ll T=1; // cin(&T); rep(i,0,T){ solve(); } return 0; } /* while (ng + 1 < ok) { ll p = ng + (ok - ng) / 2; ll cnt = 0; rep(i,0,n){ cnt += (a[i] + p - 1) / p - 1; } if (cnt <= k) ok = p; else ng = p; } */ // 10^18 2^60 3^38 5^26
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125506/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.node_AVL_set = type { i64, i32, i32, [2 x ptr] } @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @fac_cnt = dso_local local_unnamed_addr global i64 0, align 8 @is_factor_prepared = dso_local local_unnamed_addr global i64 0, align 8 @factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16 @is_minv_made = dso_local local_unnamed_addr global i64 0, align 8 @is_mf_made = dso_local local_unnamed_addr global i64 0, align 8 @num_of_inv = dso_local local_unnamed_addr global i64 2000010, align 8 @inv_arr = dso_local local_unnamed_addr global ptr null, align 8 @finv_arr = dso_local local_unnamed_addr global ptr null, align 8 @mf_arr = dso_local local_unnamed_addr global ptr null, align 8 @.str.3 = private unnamed_addr constant [9 x i8] c"%lld %d\0A\00", align 1 @set_main.set_is_init = internal unnamed_addr global i1 false, align 1 @set_main.set_pointer = internal global [514511 x ptr] zeroinitializer, align 16 @set_main.set_siz = internal unnamed_addr global [514511 x i64] zeroinitializer, align 16 @seg_t = dso_local local_unnamed_addr global i64 1, align 8 @seg = dso_local local_unnamed_addr global [1151151 x i64] zeroinitializer, align 16 @seg_def = dso_local local_unnamed_addr global ptr null, align 8 @seg_ope = dso_local local_unnamed_addr global ptr null, align 8 @fl = dso_local local_unnamed_addr global [225225 x i64] zeroinitializer, align 16 @.str.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 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: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @PriAll1(ptr nocapture noundef readonly %a, i64 noundef %n) local_unnamed_addr #2 { entry: %cmp9 = icmp sgt i64 %n, 0 br i1 %cmp9, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %sub = add nsw i64 %n, -1 br label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %putchar = tail call i32 @putchar(i32 10) ret void for.body: ; preds = %for.body.lr.ph, %for.inc %i.010 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.010 %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %0) %cmp1.not = icmp eq i64 %i.010, %sub br i1 %cmp1.not, label %for.inc, label %if.then if.then: ; preds = %for.body %putchar8 = tail call i32 @putchar(i32 32) br label %for.inc for.inc: ; preds = %for.body, %if.then %inc = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ 4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ -4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !16 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !17 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !19 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #6 { entry: %cmp4 = fcmp ogt double %b, 0.000000e+00 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ] ret double %c.0.lcssa for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ] %mul = fmul double %c.05, %a %inc = add nuw nsw i64 %i.06, 1 %conv = sitofp i64 %inc to double %cmp = fcmp olt double %conv, %b br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !20 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !19 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %POW.exit, label %for.body.i.epil, !llvm.loop !21 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !22 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @digits(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i64 [ 0, %entry ], [ %add, %tailrecurse ] %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse ] %div = sdiv i64 %a.tr, %b %tobool.not = icmp eq i64 %div, 0 %add = add nuw nsw i64 %accumulator.tr, 1 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i64 %add } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @base(i64 noundef %n, i64 noundef %a, i64 noundef %i) local_unnamed_addr #6 { entry: %cmp5 = icmp eq i64 %i, 1 br i1 %cmp5, label %cond.true, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %i, 3 %1 = add i64 %i, -2 %xtraiter = and i64 %0, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cond.false.prol.loopexit, label %cond.false.prol cond.false.prol: ; preds = %cond.false.preheader, %cond.false.prol %i.tr7.prol = phi i64 [ %sub.prol, %cond.false.prol ], [ %i, %cond.false.preheader ] %n.tr6.prol = phi i64 [ %div.prol, %cond.false.prol ], [ %n, %cond.false.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %cond.false.prol ], [ 0, %cond.false.preheader ] %div.prol = sdiv i64 %n.tr6.prol, %a %sub.prol = add nsw i64 %i.tr7.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %cond.false.prol.loopexit, label %cond.false.prol, !llvm.loop !23 cond.false.prol.loopexit: ; preds = %cond.false.prol, %cond.false.preheader %div.lcssa.unr = phi i64 [ undef, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %i.tr7.unr = phi i64 [ %i, %cond.false.preheader ], [ %sub.prol, %cond.false.prol ] %n.tr6.unr = phi i64 [ %n, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %2 = icmp ult i64 %1, 3 br i1 %2, label %cond.true, label %cond.false cond.true: ; preds = %cond.false.prol.loopexit, %cond.false, %entry %n.tr.lcssa = phi i64 [ %n, %entry ], [ %div.lcssa.unr, %cond.false.prol.loopexit ], [ %div.3, %cond.false ] %rem = srem i64 %n.tr.lcssa, %a ret i64 %rem cond.false: ; preds = %cond.false.prol.loopexit, %cond.false %i.tr7 = phi i64 [ %sub.3, %cond.false ], [ %i.tr7.unr, %cond.false.prol.loopexit ] %n.tr6 = phi i64 [ %div.3, %cond.false ], [ %n.tr6.unr, %cond.false.prol.loopexit ] %div = sdiv i64 %n.tr6, %a %div.1 = sdiv i64 %div, %a %div.2 = sdiv i64 %div.1, %a %div.3 = sdiv i64 %div.2, %a %sub.3 = add nsw i64 %i.tr7, -4 %cmp.3 = icmp eq i64 %sub.3, 1 br i1 %cmp.3, label %cond.true, label %cond.false } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr1(i64 noundef %x, i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp sgt i64 %x, -1 %cmp1 = icmp slt i64 %x, %n %.not = and i1 %cmp, %cmp1 %conv = zext i1 %.not to i64 ret i64 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr2(i64 noundef %y, i64 noundef %x, i64 noundef %h, i64 noundef %w) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %y, 0 br i1 %cmp, label %lor.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp1 = icmp sge i64 %y, %h %cmp3 = icmp slt i64 %x, 0 %or.cond = or i1 %cmp3, %cmp1 br i1 %or.cond, label %lor.end, label %lor.rhs lor.rhs: ; preds = %lor.lhs.false %cmp4 = icmp slt i64 %x, %w %0 = zext i1 %cmp4 to i64 br label %lor.end lor.end: ; preds = %lor.rhs, %lor.lhs.false, %entry %not. = phi i64 [ 0, %lor.lhs.false ], [ 0, %entry ], [ %0, %lor.rhs ] ret i64 %not. } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !24 %1 = load i32, ptr %r, align 4, !tbaa !24 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !24 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !24 %1 = load i32, ptr %r, align 4, !tbaa !24 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !24 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !26 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !27 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !27 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !26 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !27 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @factor_pre() local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_factor_prepared, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_factor_prepared, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.body6.peel.next, label %return for.body6.peel.next: ; preds = %entry %1 = tail call ptr @llvm.stacksave.p0() %vla116 = alloca [500001 x i64], align 16 store i64 2, ptr %vla116, align 16, !tbaa !5 br label %vector.body vector.body: ; preds = %vector.body, %for.body6.peel.next %index = phi i64 [ 0, %for.body6.peel.next ], [ %index.next.1, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 1, i64 2>, %for.body6.peel.next ], [ %vec.ind.next.1, %vector.body ] %offset.idx = or i64 %index, 1 %2 = shl nuw nsw <2 x i64> %vec.ind, <i64 1, i64 1> %step.add = shl <2 x i64> %vec.ind, <i64 1, i64 1> %3 = or <2 x i64> %2, <i64 1, i64 1> %4 = add <2 x i64> %step.add, <i64 5, i64 5> %5 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx store <2 x i64> %3, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds i64, ptr %5, i64 2 store <2 x i64> %4, ptr %6, align 8, !tbaa !5 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %offset.idx.1 = or i64 %index, 5 %7 = shl nuw nsw <2 x i64> %vec.ind.next, <i64 1, i64 1> %step.add.1 = shl <2 x i64> %vec.ind.next, <i64 1, i64 1> %8 = or <2 x i64> %7, <i64 1, i64 1> %9 = add <2 x i64> %step.add.1, <i64 5, i64 5> %10 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx.1 store <2 x i64> %8, ptr %10, align 8, !tbaa !5 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> %9, ptr %11, align 8, !tbaa !5 %index.next.1 = add nuw nsw i64 %index, 8 %vec.ind.next.1 = add <2 x i64> %vec.ind, <i64 8, i64 8> %12 = icmp eq i64 %index.next.1, 500000 br i1 %12, label %for.body16, label %vector.body, !llvm.loop !28 for.body16: ; preds = %vector.body, %for.inc43 %i12.0124 = phi i64 [ %inc44, %for.inc43 ], [ 1, %vector.body ] %arrayidx17 = getelementptr inbounds i64, ptr %vla116, i64 %i12.0124 %13 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %tobool18.not = icmp eq i64 %13, 0 br i1 %tobool18.not, label %for.inc43, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body16 %mul21 = shl nuw nsw i64 %i12.0124, 1 %add22 = or i64 %mul21, 1 %div = udiv i64 500001, %add22 %cmp24.not122 = icmp ugt i64 %add22, 166667 br i1 %cmp24.not122, label %for.inc43, label %for.body26 for.body26: ; preds = %for.cond20.preheader, %for.inc38 %j.0123 = phi i64 [ %add39, %for.inc38 ], [ 3, %for.cond20.preheader ] %mul29 = mul nuw nsw i64 %j.0123, %add22 %cmp30 = icmp ult i64 %mul29, 500001 br i1 %cmp30, label %if.then31, label %for.inc38 if.then31: ; preds = %for.body26 %14 = trunc i64 %mul29 to i32 %div35.lhs.trunc = add nsw i32 %14, -1 %div35120 = sdiv i32 %div35.lhs.trunc, 2 %div35.sext = zext i32 %div35120 to i64 %arrayidx36 = getelementptr inbounds i64, ptr %vla116, i64 %div35.sext store i64 0, ptr %arrayidx36, align 8, !tbaa !5 br label %for.inc38 for.inc38: ; preds = %for.body26, %if.then31 %add39 = add nuw nsw i64 %j.0123, 2 %cmp24.not = icmp ugt i64 %add39, %div br i1 %cmp24.not, label %for.inc43, label %for.body26, !llvm.loop !30 for.inc43: ; preds = %for.inc38, %for.cond20.preheader, %for.body16 %inc44 = add nuw nsw i64 %i12.0124, 1 %exitcond128.not = icmp eq i64 %inc44, 500001 br i1 %exitcond128.not, label %for.body51, label %for.body16, !llvm.loop !31 for.cond.cleanup50: ; preds = %for.inc83 tail call void @llvm.stackrestore.p0(ptr %1) br label %return for.body51: ; preds = %for.inc43, %for.inc83 %i47.0126 = phi i64 [ %inc84, %for.inc83 ], [ 0, %for.inc43 ] %arrayidx52 = getelementptr inbounds i64, ptr %vla116, i64 %i47.0126 %15 = load i64, ptr %arrayidx52, align 8, !tbaa !5 %tobool53.not = icmp eq i64 %15, 0 br i1 %tobool53.not, label %for.inc83, label %cond.end75.1 cond.end75.1: ; preds = %for.body51 %16 = load ptr, ptr @factors, align 16, !tbaa !32 %17 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %add61 = shl i64 %17, 3 %mul62 = add i64 %add61, 8 %call = tail call ptr @realloc(ptr noundef %16, i64 noundef %mul62) #31 store ptr %call, ptr @factors, align 16, !tbaa !32 %18 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77 = getelementptr inbounds i64, ptr %call, i64 %18 store i64 %15, ptr %arrayidx77, align 8, !tbaa !5 %19 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !32 %add61.1 = shl i64 %18, 3 %mul62.1 = add i64 %add61.1, 8 %call.1 = tail call ptr @realloc(ptr noundef %19, i64 noundef %mul62.1) #31 store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !32 %20 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc73.1 = add nsw i64 %20, 1 store i64 %inc73.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77.1 = getelementptr inbounds i64, ptr %call.1, i64 %20 store i64 0, ptr %arrayidx77.1, align 8, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %cond.end75.1, %for.body51 %inc84 = add nuw nsw i64 %i47.0126, 1 %exitcond129.not = icmp eq i64 %inc84, 500001 br i1 %exitcond129.not, label %for.cond.cleanup50, label %for.body51, !llvm.loop !34 return: ; preds = %entry, %for.cond.cleanup50 ret i64 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #11 ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #12 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #11 ; Function Attrs: nounwind uwtable define dso_local i64 @factor(i64 noundef %n, i64 noundef %new_common_plus) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp52 = icmp sgt i64 %0, 0 br i1 %cmp52, label %for.cond1.preheader.lr.ph, label %cleanup30 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !32 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8 br label %for.cond1.preheader for.cond: ; preds = %cond.end22 %inc29 = add nuw nsw i64 %i.054, 1 %3 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp = icmp slt i64 %inc29, %3 br i1 %cmp, label %for.cond1.preheader, label %cleanup30, !llvm.loop !35 for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond %i.054 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %inc29, %for.cond ] %n.addr.053 = phi i64 [ %n, %for.cond1.preheader.lr.ph ], [ %n.addr.3, %for.cond ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.054 %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %for.cond1.preheader, %land.rhs %n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.053, %for.cond1.preheader ] %cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ] %rem = srem i64 %n.addr.2, %4 %div = sdiv i64 %n.addr.2, %4 %cmp5 = icmp eq i64 %rem, 0 %conv = zext i1 %cmp5 to i64 %add = add nuw nsw i64 %cnt.1, %conv %tobool.not = icmp eq i64 %add, 0 br i1 %tobool.not, label %for.inc, label %land.rhs land.rhs: ; preds = %while.cond %rem8 = srem i64 %div, %4 %cmp9 = icmp eq i64 %rem8, 0 br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !36 for.inc: ; preds = %land.rhs, %while.cond %n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ] switch i64 %new_common_plus, label %cond.false18 [ i64 1, label %cond.end22 i64 2, label %cond.true15 ] cond.true15: ; preds = %for.inc %arrayidx16 = getelementptr inbounds i64, ptr %2, i64 %i.054 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %5, i64 %add) br label %cond.end22 cond.false18: ; preds = %for.inc %arrayidx19 = getelementptr inbounds i64, ptr %2, i64 %i.054 %6 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add20 = add nsw i64 %6, %add br label %cond.end22 cond.end22: ; preds = %for.inc, %cond.true15, %cond.false18 %cond23 = phi i64 [ %cond.i, %cond.true15 ], [ %add20, %cond.false18 ], [ %add, %for.inc ] %arrayidx24 = getelementptr inbounds i64, ptr %2, i64 %i.054 store i64 %cond23, ptr %arrayidx24, align 8, !tbaa !5 %7 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp26.not = icmp sgt i64 %7, %n.addr.3 br i1 %cmp26.not, label %cleanup30, label %for.cond cleanup30: ; preds = %cond.end22, %for.cond, %entry %n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3, %for.cond ], [ %n.addr.3, %cond.end22 ] ret i64 %n.addr.4 } ; Function Attrs: nounwind uwtable define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %0, 0 br i1 %cmp20, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !32 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.else %i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ] %n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %2, %2 %cmp2 = icmp slt i64 %n.addr.021, %mul %cmp4 = icmp eq i64 %n.addr.021, %2 %or.cond = or i1 %cmp4, %cmp2 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %for.body %rem = srem i64 %n.addr.021, %2 %cmp6 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021 %inc = add nuw nsw i64 %i.022, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !37 cleanup: ; preds = %if.else, %for.body, %entry %n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ] %cmp9 = icmp ne i64 %n.addr.0.lcssa, 1 %conv = zext i1 %cmp9 to i64 ret i64 %conv } ; Function Attrs: nounwind uwtable define dso_local i64 @makeinv(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_minv_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_minv_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @inv_arr, align 8, !tbaa !32 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #31 store ptr %call, ptr @inv_arr, align 8, !tbaa !32 %2 = load ptr, ptr @finv_arr, align 8, !tbaa !32 %call2 = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %2, i64 noundef 16) #31 store ptr %call2, ptr @finv_arr, align 8, !tbaa !32 %3 = load ptr, ptr @inv_arr, align 8, !tbaa !32 %arrayidx = getelementptr inbounds i64, ptr %3, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 %arrayidx3 = getelementptr inbounds i64, ptr %call2, i64 1 store i64 1, ptr %arrayidx3, align 8, !tbaa !5 store i64 1, ptr %call2, align 8, !tbaa !5 %cmp7.not43 = icmp slt i64 %n, 2 br i1 %cmp7.not43, label %return, label %for.body9 for.body9: ; preds = %for.end, %for.body9 %4 = phi ptr [ %6, %for.body9 ], [ %3, %for.end ] %i5.044 = phi i64 [ %add10, %for.body9 ], [ 2, %for.end ] %add10 = add nuw nsw i64 %i5.044, 1 %mul = shl i64 %add10, 3 %call11 = tail call ptr @realloc(ptr noundef nonnull %4, i64 noundef %mul) #31 store ptr %call11, ptr @inv_arr, align 8, !tbaa !32 %5 = load ptr, ptr @finv_arr, align 8, !tbaa !32 %call14 = tail call ptr @realloc(ptr noundef %5, i64 noundef %mul) #31 store ptr %call14, ptr @finv_arr, align 8, !tbaa !32 %6 = load ptr, ptr @inv_arr, align 8, !tbaa !32 %rem = srem i64 %mod, %i5.044 %arrayidx15 = getelementptr inbounds i64, ptr %6, i64 %rem %7 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %div = sdiv i64 %mod, %i5.044 %mul16 = mul nsw i64 %div, %7 %rem17 = srem i64 %mul16, %mod %sub = sub nsw i64 %mod, %rem17 %arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %i5.044 store i64 %sub, ptr %arrayidx18, align 8, !tbaa !5 %8 = getelementptr i64, ptr %call14, i64 %i5.044 %arrayidx20 = getelementptr i64, ptr %8, i64 -1 %9 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %mul22 = mul nsw i64 %9, %sub %rem23 = srem i64 %mul22, %mod store i64 %rem23, ptr %8, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i5.044, %n br i1 %exitcond.not, label %return, label %for.body9, !llvm.loop !38 return: ; preds = %for.body9, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @make_mf(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @mf_arr, align 8, !tbaa !32 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #31 store ptr %call, ptr @mf_arr, align 8, !tbaa !32 %arrayidx = getelementptr inbounds i64, ptr %call, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 store i64 1, ptr %call, align 8, !tbaa !5 %cmp5.not24 = icmp slt i64 %n, 2 br i1 %cmp5.not24, label %return, label %for.body7 for.body7: ; preds = %for.end, %for.body7 %2 = phi ptr [ %call10, %for.body7 ], [ %call, %for.end ] %i3.026 = phi i64 [ %add8, %for.body7 ], [ 2, %for.end ] %x.025 = phi i64 [ %rem, %for.body7 ], [ 1, %for.end ] %mul = mul nsw i64 %i3.026, %x.025 %rem = srem i64 %mul, %mod %add8 = add nuw nsw i64 %i3.026, 1 %mul9 = shl i64 %add8, 3 %call10 = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9) #31 %arrayidx11 = getelementptr inbounds i64, ptr %call10, i64 %i3.026 store i64 %rem, ptr %arrayidx11, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i3.026, %n br i1 %exitcond.not, label %return.loopexit, label %for.body7, !llvm.loop !39 return.loopexit: ; preds = %for.body7 store ptr %call10, ptr @mf_arr, align 8, !tbaa !32 br label %return return: ; preds = %return.loopexit, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @m_inv(i64 noundef %x, i64 noundef %mod, i64 noundef %is_fac) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call = tail call i64 @makeinv(i64 noundef %0, i64 noundef %mod) %tobool.not = icmp eq i64 %is_fac, 0 %inv_arr.val = load ptr, ptr @inv_arr, align 8 %finv_arr.val = load ptr, ptr @finv_arr, align 8 %.pn = select i1 %tobool.not, ptr %inv_arr.val, ptr %finv_arr.val %cond.in = getelementptr inbounds i64, ptr %.pn, i64 %x %cond = load i64, ptr %cond.in, align 8, !tbaa !5 ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @m_f(i64 noundef %x, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i = add nsw i64 %1, 1 store i64 %inc.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %1, 0 %.pre = load ptr, ptr @mf_arr, align 8, !tbaa !32 br i1 %tobool.not.i, label %for.end.i, label %make_mf.exit for.end.i: ; preds = %entry %call.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre, i64 noundef 16) #31 store ptr %call.i, ptr @mf_arr, align 8, !tbaa !32 %arrayidx.i = getelementptr inbounds i64, ptr %call.i, i64 1 store i64 1, ptr %arrayidx.i, align 8, !tbaa !5 store i64 1, ptr %call.i, align 8, !tbaa !5 %cmp5.not24.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i, label %make_mf.exit, label %for.body7.i for.body7.i: ; preds = %for.end.i, %for.body7.i %2 = phi ptr [ %call10.i, %for.body7.i ], [ %call.i, %for.end.i ] %i3.026.i = phi i64 [ %add8.i, %for.body7.i ], [ 2, %for.end.i ] %x.025.i = phi i64 [ %rem.i, %for.body7.i ], [ 1, %for.end.i ] %mul.i = mul nsw i64 %x.025.i, %i3.026.i %rem.i = srem i64 %mul.i, %mod %add8.i = add nuw nsw i64 %i3.026.i, 1 %mul9.i = shl i64 %add8.i, 3 %call10.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i) #31 %arrayidx11.i = getelementptr inbounds i64, ptr %call10.i, i64 %i3.026.i store i64 %rem.i, ptr %arrayidx11.i, align 8, !tbaa !5 %exitcond.not.i = icmp eq i64 %i3.026.i, %0 br i1 %exitcond.not.i, label %return.loopexit.i, label %for.body7.i, !llvm.loop !39 return.loopexit.i: ; preds = %for.body7.i store ptr %call10.i, ptr @mf_arr, align 8, !tbaa !32 br label %make_mf.exit make_mf.exit: ; preds = %entry, %for.end.i, %return.loopexit.i %3 = phi ptr [ %.pre, %entry ], [ %call.i, %for.end.i ], [ %call10.i, %return.loopexit.i ] %arrayidx = getelementptr inbounds i64, ptr %3, i64 %x %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 ret i64 %4 } ; Function Attrs: nounwind uwtable define dso_local i64 @mod_nck(i64 noundef %n, i64 noundef %k, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i.i = add nsw i64 %1, 1 store i64 %inc.i.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i.i = icmp eq i64 %1, 0 %.pre.i = load ptr, ptr @mf_arr, align 8, !tbaa !32 br i1 %tobool.not.i.i, label %for.end.i.i, label %m_f.exit for.end.i.i: ; preds = %entry %call.i.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre.i, i64 noundef 16) #31 store ptr %call.i.i, ptr @mf_arr, align 8, !tbaa !32 %arrayidx.i.i = getelementptr inbounds i64, ptr %call.i.i, i64 1 store i64 1, ptr %arrayidx.i.i, align 8, !tbaa !5 store i64 1, ptr %call.i.i, align 8, !tbaa !5 %cmp5.not24.i.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i.i, label %m_f.exit, label %for.body7.i.i for.body7.i.i: ; preds = %for.end.i.i, %for.body7.i.i %2 = phi ptr [ %call10.i.i, %for.body7.i.i ], [ %call.i.i, %for.end.i.i ] %i3.026.i.i = phi i64 [ %add8.i.i, %for.body7.i.i ], [ 2, %for.end.i.i ] %x.025.i.i = phi i64 [ %rem.i.i, %for.body7.i.i ], [ 1, %for.end.i.i ] %mul.i.i = mul nsw i64 %x.025.i.i, %i3.026.i.i %rem.i.i = srem i64 %mul.i.i, %mod %add8.i.i = add nuw nsw i64 %i3.026.i.i, 1 %mul9.i.i = shl i64 %add8.i.i, 3 %call10.i.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i.i) #31 %arrayidx11.i.i = getelementptr inbounds i64, ptr %call10.i.i, i64 %i3.026.i.i store i64 %rem.i.i, ptr %arrayidx11.i.i, align 8, !tbaa !5 %exitcond.not.i.i = icmp eq i64 %i3.026.i.i, %0 br i1 %exitcond.not.i.i, label %return.loopexit.i.i, label %for.body7.i.i, !llvm.loop !39 return.loopexit.i.i: ; preds = %for.body7.i.i store ptr %call10.i.i, ptr @mf_arr, align 8, !tbaa !32 br label %m_f.exit m_f.exit: ; preds = %entry, %for.end.i.i, %return.loopexit.i.i %3 = phi ptr [ %.pre.i, %entry ], [ %call.i.i, %for.end.i.i ], [ %call10.i.i, %return.loopexit.i.i ] %arrayidx.i = getelementptr inbounds i64, ptr %3, i64 %n %4 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %5 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i = tail call i64 @makeinv(i64 noundef %5, i64 noundef %mod) %finv_arr.val.i = load ptr, ptr @finv_arr, align 8 %cond.in.i = getelementptr inbounds i64, ptr %finv_arr.val.i, i64 %k %cond.i = load i64, ptr %cond.in.i, align 8, !tbaa !5 %mul = mul nsw i64 %cond.i, %4 %rem = srem i64 %mul, %mod %sub = sub nsw i64 %n, %k %6 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i11 = tail call i64 @makeinv(i64 noundef %6, i64 noundef %mod) %finv_arr.val.i13 = load ptr, ptr @finv_arr, align 8 %cond.in.i14 = getelementptr inbounds i64, ptr %finv_arr.val.i13, i64 %sub %cond.i15 = load i64, ptr %cond.in.i14, align 8, !tbaa !5 %mul3 = mul nsw i64 %cond.i15, %rem %rem4 = srem i64 %mul3, %mod ret i64 %rem4 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @m_p(i64 noundef %r, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #6 { entry: %cmp16 = icmp sgt i64 %n, 0 br i1 %cmp16, label %while.body, label %while.end while.body: ; preds = %entry, %cond.end %s.019 = phi i64 [ %rem2, %cond.end ], [ %r, %entry ] %t.018 = phi i64 [ %cond, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %shr, %cond.end ], [ %n, %entry ] %and = and i64 %n.addr.017, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.true: ; preds = %while.body %mul = mul nsw i64 %s.019, %t.018 %rem = srem i64 %mul, %mod br label %cond.end cond.end: ; preds = %while.body, %cond.true %cond = phi i64 [ %rem, %cond.true ], [ %t.018, %while.body ] %mul1 = mul nsw i64 %s.019, %s.019 %rem2 = srem i64 %mul1, %mod %shr = lshr i64 %n.addr.017, 1 %cmp.not = icmp ult i64 %n.addr.017, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !40 while.end: ; preds = %cond.end, %entry %t.0.lcssa = phi i64 [ 1, %entry ], [ %cond, %cond.end ] %tobool3.not = icmp eq i64 %r, 0 %cond7 = select i1 %tobool3.not, i64 0, i64 %t.0.lcssa ret i64 %cond7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul2(i64 noundef %a, i64 noundef %b, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul3(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod ret i64 %rem.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul4(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod ret i64 %rem.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul5(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %e, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod %mul.i.i.i = mul nsw i64 %rem.i.i, %e %rem.i.i.i = srem i64 %mul.i.i.i, %mod ret i64 %rem.i.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #14 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #32 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i8, ptr %a, align 1, !tbaa !22 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !22 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #33 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #16 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #33 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #33 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #32 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #33 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #17 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #32 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !41 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !42 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !43 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @compare(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %a, %b %cmp1 = icmp sgt i64 %a, %b %0 = zext i1 %cmp1 to i64 %cond2 = select i1 %cmp, i64 -1, i64 %0 ret i64 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %p, align 8, !tbaa !44 %1 = load i64, ptr %q, align 8, !tbaa !44 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %2 = zext i1 %cmp1.i to i32 %conv = select i1 %cmp.i, i32 -1, i32 %2 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %p, align 8, !tbaa !44 %1 = load i64, ptr %q, align 8, !tbaa !44 %cmp.i = icmp slt i64 %1, %0 %cmp1.i = icmp sgt i64 %1, %0 %2 = zext i1 %cmp1.i to i32 %conv = select i1 %cmp.i, i32 -1, i32 %2 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #33 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #33 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_partial(ptr nocapture noundef %a, i32 noundef %begin, i32 noundef %end, i32 noundef %is_increase) local_unnamed_addr #2 { entry: %sub = sub nsw i32 %end, %begin %conv = sext i32 %sub to i64 %mul = shl nsw i64 %conv, 3 %call = tail call noalias ptr @malloc(i64 noundef %mul) #34 %cmp45 = icmp slt i32 %begin, %end br i1 %cmp45, label %for.body.preheader, label %for.cond.cleanup15.critedge for.body.preheader: ; preds = %entry %conv2 = sext i32 %end to i64 %conv1 = sext i32 %begin to i64 %0 = shl nsw i64 %conv1, 3 %scevgep = getelementptr i8, ptr %a, i64 %0 %1 = sub nsw i64 %conv2, %conv1 %2 = shl nsw i64 %1, 3 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %call, ptr align 8 %scevgep, i64 %2, i1 false), !tbaa !5 %tobool.not = icmp eq i32 %is_increase, 0 %downll.upll = select i1 %tobool.not, ptr @downll, ptr @upll tail call void @qsort(ptr noundef %call, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull %downll.upll) #33 %3 = shl nsw i64 %conv1, 3 %scevgep49 = getelementptr i8, ptr %a, i64 %3 %4 = sub nsw i64 %conv2, %conv1 %5 = shl nsw i64 %4, 3 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep49, ptr align 8 %call, i64 %5, i1 false), !tbaa !5 br label %for.cond.cleanup15 for.cond.cleanup15.critedge: ; preds = %entry %tobool.not.c = icmp eq i32 %is_increase, 0 %downll.upll.c = select i1 %tobool.not.c, ptr @downll, ptr @upll tail call void @qsort(ptr noundef %call, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull %downll.upll.c) #33 br label %for.cond.cleanup15 for.cond.cleanup15: ; preds = %for.cond.cleanup15.critedge, %for.body.preheader ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #18 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @AVL_set_inside_rotate(ptr nocapture noundef %node, i32 noundef %is_right) local_unnamed_addr #19 { entry: %cmp = icmp eq i32 %is_right, 0 %cmp1 = icmp eq i32 %is_right, 1 %cond = select i1 %cmp, i32 -1, i32 1 %0 = load ptr, ptr %node, align 8, !tbaa !32 %idxprom = zext i1 %cmp to i64 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom %1 = load ptr, ptr %arrayidx, align 8, !tbaa !32 %cmp3.not = icmp eq ptr %1, null br i1 %cmp3.not, label %if.end43, label %if.then if.then: ; preds = %entry %diff = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 1 %2 = load i32, ptr %diff, align 8, !tbaa !46 %mul = mul nsw i32 %2, %cond %diff8 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 1 %3 = load i32, ptr %diff8, align 8, !tbaa !46 %mul9 = mul nsw i32 %3, %cond %tobool10.not = icmp eq i32 %mul9, -1 br i1 %tobool10.not, label %if.else, label %if.then11 if.then11: ; preds = %if.then %4 = xor i32 %mul9, -1 %tobool14.not = icmp eq i32 %2, %3 %sub15 = add nsw i32 %mul9, -1 %sub16 = add nsw i32 %mul, -2 %cond17 = select i1 %tobool14.not, i32 %sub16, i32 %sub15 br label %if.end if.else: ; preds = %if.then %tobool19.not = icmp eq i32 %2, 0 %cond26 = select i1 %tobool19.not, i32 -3, i32 -2 br label %if.end if.end: ; preds = %if.else, %if.then11 %.pn = phi i32 [ %4, %if.then11 ], [ -1, %if.else ] %nb.0 = phi i32 [ %cond17, %if.then11 ], [ %cond26, %if.else ] %na.0 = add i32 %.pn, %mul %mul27 = mul nsw i32 %na.0, %cond store i32 %mul27, ptr %diff, align 8, !tbaa !46 %mul29 = mul nsw i32 %nb.0, %cond store i32 %mul29, ptr %diff8, align 8, !tbaa !46 %idxprom35 = zext i1 %cmp1 to i64 %arrayidx36 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 3, i64 %idxprom35 %5 = load ptr, ptr %arrayidx36, align 8, !tbaa !32 store ptr %5, ptr %arrayidx, align 8, !tbaa !32 %6 = load ptr, ptr %node, align 8, !tbaa !32 store ptr %6, ptr %arrayidx36, align 8, !tbaa !32 store ptr %1, ptr %node, align 8, !tbaa !32 br label %if.end43 if.end43: ; preds = %if.end, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @AVL_set_inside_update(ptr nocapture noundef %node, i64 noundef %data, i32 noundef %add) local_unnamed_addr #10 { entry: %0 = load ptr, ptr %node, align 8, !tbaa !32 %cmp = icmp eq ptr %0, null br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %cmp1 = icmp eq i32 %add, 2 br i1 %cmp1, label %if.then2, label %return if.then2: ; preds = %if.then %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #34 store ptr %call, ptr %node, align 8, !tbaa !32 store i64 %data, ptr %call, align 8, !tbaa !48 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 2 store i32 1, ptr %cnt, align 4, !tbaa !49 %diff = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 1 store i32 0, ptr %diff, align 8, !tbaa !46 %child = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 3 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %child, i8 0, i64 16, i1 false) br label %return if.else: ; preds = %entry %1 = load i64, ptr %0, align 8, !tbaa !48 %cmp8 = icmp eq i64 %1, %data br i1 %cmp8, label %if.then10, label %if.else56 if.then10: ; preds = %if.else switch i32 %add, label %land.lhs.true [ i32 2, label %if.then13 i32 0, label %if.else21 ] if.then13: ; preds = %if.then10 %cnt14 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %2 = load i32, ptr %cnt14, align 4, !tbaa !49 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %cnt14, align 4, !tbaa !49 br label %return land.lhs.true: ; preds = %if.then10 %cnt16 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %3 = load i32, ptr %cnt16, align 4, !tbaa !49 %cmp17 = icmp sgt i32 %3, 1 br i1 %cmp17, label %if.then19, label %if.else21 if.then19: ; preds = %land.lhs.true %dec = add nsw i32 %3, -1 store i32 %dec, ptr %cnt16, align 4, !tbaa !49 br label %return if.else21: ; preds = %if.then10, %land.lhs.true %child22 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3 %arrayidx23 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 1 %4 = load ptr, ptr %arrayidx23, align 8, !tbaa !32 %cmp24 = icmp eq ptr %4, null %5 = load ptr, ptr %child22, align 8, !tbaa !32 br i1 %cmp24, label %if.then26, label %if.else29 if.then26: ; preds = %if.else21 tail call void @free(ptr noundef nonnull %0) #33 store ptr %5, ptr %node, align 8, !tbaa !32 br label %return if.else29: ; preds = %if.else21 %cmp32 = icmp eq ptr %5, null br i1 %cmp32, label %if.then34, label %for.cond if.then34: ; preds = %if.else29 tail call void @free(ptr noundef nonnull %0) #33 store ptr %4, ptr %node, align 8, !tbaa !32 br label %return for.cond: ; preds = %if.else29, %for.cond %next_node.0 = phi ptr [ %6, %for.cond ], [ %5, %if.else29 ] %arrayidx41 = getelementptr inbounds %struct.node_AVL_set, ptr %next_node.0, i64 0, i32 3, i64 1 %6 = load ptr, ptr %arrayidx41, align 8, !tbaa !32 %cmp42.not = icmp eq ptr %6, null br i1 %cmp42.not, label %for.end, label %for.cond, !llvm.loop !50 for.end: ; preds = %for.cond %7 = load i64, ptr %next_node.0, align 8, !tbaa !48 store i64 %7, ptr %0, align 8, !tbaa !48 %8 = load i64, ptr %next_node.0, align 8, !tbaa !48 %call51 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %child22, i64 noundef %8, i32 noundef %add), !range !51 br label %if.end69 if.else56: ; preds = %if.else %cmp58.not = icmp sle i64 %1, %data %cmp62 = icmp sgt i64 %1, %data %cond64 = select i1 %cmp62, i32 1, i32 -1 %idxprom66 = zext i1 %cmp58.not to i64 %arrayidx67 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom66 %call68 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx67, i64 noundef %data, i32 noundef %add), !range !51 br label %if.end69 if.end69: ; preds = %if.else56, %for.end %delta.0 = phi i32 [ %call51, %for.end ], [ %call68, %if.else56 ] %delta_sign.0 = phi i32 [ 1, %for.end ], [ %cond64, %if.else56 ] %tobool70.not = icmp eq i32 %delta.0, 0 br i1 %tobool70.not, label %return, label %if.then71 if.then71: ; preds = %if.end69 %9 = load ptr, ptr %node, align 8, !tbaa !32 %diff72 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 1 %10 = load i32, ptr %diff72, align 8, !tbaa !46 %mul = mul nsw i32 %delta_sign.0, %delta.0 %add74 = add nsw i32 %10, %mul store i32 %add74, ptr %diff72, align 8, !tbaa !46 %cmp76 = icmp sgt i32 %add74, 1 br i1 %cmp76, label %if.then87, label %if.else79 if.else79: ; preds = %if.then71 %cmp81 = icmp slt i32 %add74, -1 br i1 %cmp81, label %if.then87, label %if.end110 if.then87: ; preds = %if.else79, %if.then71 %rotate_l.0.ph = phi i64 [ 0, %if.then71 ], [ 1, %if.else79 ] %diff_sign.0.ph = phi i32 [ 1, %if.then71 ], [ -1, %if.else79 ] %cmp.i197 = xor i1 %cmp76, true %arrayidx90 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 3, i64 %rotate_l.0.ph %11 = load ptr, ptr %arrayidx90, align 8, !tbaa !32 %diff91 = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 1 %12 = load i32, ptr %diff91, align 8, !tbaa !46 %mul96 = mul nsw i32 %12, %diff_sign.0.ph %cmp97 = icmp slt i32 %mul96, 0 br i1 %cmp97, label %if.then99, label %if.end104 if.then99: ; preds = %if.then87 %cond.i = select i1 %cmp76, i32 -1, i32 1 %idxprom.i = zext i1 %cmp76 to i64 %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 3, i64 %idxprom.i %13 = load ptr, ptr %arrayidx.i, align 8, !tbaa !32 %cmp3.not.i = icmp eq ptr %13, null br i1 %cmp3.not.i, label %if.end104, label %if.then.i if.then.i: ; preds = %if.then99 %mul.i = mul nsw i32 %12, %cond.i %diff8.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 1 %14 = load i32, ptr %diff8.i, align 8, !tbaa !46 %mul9.i = mul nsw i32 %14, %cond.i %tobool10.not.i = icmp eq i32 %mul9.i, -1 br i1 %tobool10.not.i, label %if.else.i, label %if.then11.i if.then11.i: ; preds = %if.then.i %15 = xor i32 %mul9.i, -1 %tobool14.not.i = icmp eq i32 %12, %14 %sub15.i = add nsw i32 %mul9.i, -1 %sub16.i = add nsw i32 %mul.i, -2 %cond17.i = select i1 %tobool14.not.i, i32 %sub16.i, i32 %sub15.i br label %if.end.i if.else.i: ; preds = %if.then.i %tobool19.not.i = icmp eq i32 %12, 0 %cond26.i = select i1 %tobool19.not.i, i32 -3, i32 -2 br label %if.end.i if.end.i: ; preds = %if.else.i, %if.then11.i %.pn.i = phi i32 [ %15, %if.then11.i ], [ -1, %if.else.i ] %nb.0.i = phi i32 [ %cond17.i, %if.then11.i ], [ %cond26.i, %if.else.i ] %na.0.i = add i32 %.pn.i, %mul.i %mul27.i = mul nsw i32 %na.0.i, %cond.i store i32 %mul27.i, ptr %diff91, align 8, !tbaa !46 %mul29.i = mul nsw i32 %nb.0.i, %cond.i store i32 %mul29.i, ptr %diff8.i, align 8, !tbaa !46 %idxprom35.i = zext i1 %cmp.i197 to i64 %arrayidx36.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 3, i64 %idxprom35.i %16 = load ptr, ptr %arrayidx36.i, align 8, !tbaa !32 store ptr %16, ptr %arrayidx.i, align 8, !tbaa !32 %17 = load ptr, ptr %arrayidx90, align 8, !tbaa !32 store ptr %17, ptr %arrayidx36.i, align 8, !tbaa !32 store ptr %13, ptr %arrayidx90, align 8, !tbaa !32 %.pre = load ptr, ptr %node, align 8, !tbaa !32 br label %if.end104 if.end104: ; preds = %if.end.i, %if.then99, %if.then87 %18 = phi ptr [ %.pre, %if.end.i ], [ %9, %if.then99 ], [ %9, %if.then87 ] %cond.i199 = select i1 %cmp76, i32 1, i32 -1 %idxprom.i200 = zext i1 %cmp.i197 to i64 %arrayidx.i201 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 3, i64 %idxprom.i200 %19 = load ptr, ptr %arrayidx.i201, align 8, !tbaa !32 %cmp3.not.i202 = icmp eq ptr %19, null br i1 %cmp3.not.i202, label %AVL_set_inside_rotate.exit225, label %if.then.i203 if.then.i203: ; preds = %if.end104 %diff.i204 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 1 %20 = load i32, ptr %diff.i204, align 8, !tbaa !46 %mul.i205 = mul nsw i32 %20, %cond.i199 %diff8.i206 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 1 %21 = load i32, ptr %diff8.i206, align 8, !tbaa !46 %mul9.i207 = mul nsw i32 %21, %cond.i199 %tobool10.not.i208 = icmp eq i32 %mul9.i207, -1 br i1 %tobool10.not.i208, label %if.else.i222, label %if.then11.i209 if.then11.i209: ; preds = %if.then.i203 %22 = xor i32 %mul9.i207, -1 %tobool14.not.i210 = icmp eq i32 %20, %21 %sub15.i211 = add nsw i32 %mul9.i207, -1 %sub16.i212 = add nsw i32 %mul.i205, -2 %cond17.i213 = select i1 %tobool14.not.i210, i32 %sub16.i212, i32 %sub15.i211 br label %if.end.i214 if.else.i222: ; preds = %if.then.i203 %tobool19.not.i223 = icmp eq i32 %20, 0 %cond26.i224 = select i1 %tobool19.not.i223, i32 -3, i32 -2 br label %if.end.i214 if.end.i214: ; preds = %if.else.i222, %if.then11.i209 %.pn.i215 = phi i32 [ %22, %if.then11.i209 ], [ -1, %if.else.i222 ] %nb.0.i216 = phi i32 [ %cond17.i213, %if.then11.i209 ], [ %cond26.i224, %if.else.i222 ] %na.0.i217 = add i32 %.pn.i215, %mul.i205 %mul27.i218 = mul nsw i32 %na.0.i217, %cond.i199 store i32 %mul27.i218, ptr %diff.i204, align 8, !tbaa !46 %mul29.i219 = mul nsw i32 %nb.0.i216, %cond.i199 store i32 %mul29.i219, ptr %diff8.i206, align 8, !tbaa !46 %idxprom35.i220 = zext i1 %cmp76 to i64 %arrayidx36.i221 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 3, i64 %idxprom35.i220 %23 = load ptr, ptr %arrayidx36.i221, align 8, !tbaa !32 store ptr %23, ptr %arrayidx.i201, align 8, !tbaa !32 %24 = load ptr, ptr %node, align 8, !tbaa !32 store ptr %24, ptr %arrayidx36.i221, align 8, !tbaa !32 store ptr %19, ptr %node, align 8, !tbaa !32 br label %AVL_set_inside_rotate.exit225 AVL_set_inside_rotate.exit225: ; preds = %if.end104, %if.end.i214 %cmp105 = icmp slt i32 %delta.0, 0 %cmp107 = icmp ne i32 %12, 0 %25 = and i1 %cmp105, %cmp107 %cond109 = sext i1 %25 to i32 br label %return if.end110: ; preds = %if.else79 %cmp111 = icmp sgt i32 %delta.0, 0 %cmp114 = icmp eq i32 %10, 0 %or.cond = and i1 %cmp111, %cmp114 br i1 %or.cond, label %return, label %if.else117 if.else117: ; preds = %if.end110 %cmp118 = icmp slt i32 %delta.0, 0 %cmp121 = icmp ne i32 %10, 0 %or.cond134 = and i1 %cmp118, %cmp121 %. = sext i1 %or.cond134 to i32 br label %return return: ; preds = %if.then13, %if.then19, %if.then26, %if.then34, %if.else117, %if.end110, %AVL_set_inside_rotate.exit225, %if.end69, %if.then2, %if.then %retval.2 = phi i32 [ 1, %if.then2 ], [ 0, %if.then ], [ 0, %if.then13 ], [ 0, %if.then19 ], [ -1, %if.then26 ], [ -1, %if.then34 ], [ %cond109, %AVL_set_inside_rotate.exit225 ], [ 1, %if.end110 ], [ %., %if.else117 ], [ 0, %if.end69 ] ret i32 %retval.2 } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @AVL_set_inside_print(ptr noundef readonly %node, i32 noundef %depth) local_unnamed_addr #2 { entry: %cmp9 = icmp eq ptr %node, null br i1 %cmp9, label %return, label %if.end if.end: ; preds = %entry, %if.end %depth.tr11 = phi i32 [ %add, %if.end ], [ %depth, %entry ] %node.tr10 = phi ptr [ %3, %if.end ], [ %node, %entry ] %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3, i64 1 %0 = load ptr, ptr %arrayidx, align 8, !tbaa !32 %add = add nsw i32 %depth.tr11, 1 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef %add) %1 = load i64, ptr %node.tr10, align 8, !tbaa !48 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 2 %2 = load i32, ptr %cnt, align 4, !tbaa !49 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %1, i32 noundef %2) %3 = load ptr, ptr %child, align 8, !tbaa !32 %cmp = icmp eq ptr %3, null br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local void @AVL_set_inside_free(ptr noundef %node) local_unnamed_addr #10 { entry: %cmp = icmp eq ptr %node, null br i1 %cmp, label %common.ret6, label %if.end common.ret6: ; preds = %entry, %if.end ret void if.end: ; preds = %entry %child = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3 %0 = load ptr, ptr %child, align 8, !tbaa !32 tail call void @AVL_set_inside_free(ptr noundef %0) %arrayidx2 = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx2, align 8, !tbaa !32 tail call void @AVL_set_inside_free(ptr noundef %1) tail call void @free(ptr noundef nonnull %node) #33 br label %common.ret6 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_count(ptr noundef readonly %root, i64 noundef %val) local_unnamed_addr #21 { entry: %tobool.not16 = icmp eq ptr %root, null br i1 %tobool.not16, label %cleanup, label %while.body while.body: ; preds = %entry, %if.end8 %node.017 = phi ptr [ %node.1, %if.end8 ], [ %root, %entry ] %0 = load i64, ptr %node.017, align 8, !tbaa !48 %cmp = icmp sgt i64 %0, %val br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3 br label %if.end8 if.else: ; preds = %while.body %cmp3 = icmp slt i64 %0, %val br i1 %cmp3, label %if.then4, label %if.else7 if.then4: ; preds = %if.else %arrayidx6 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3, i64 1 br label %if.end8 if.else7: ; preds = %if.else %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 2 %1 = load i32, ptr %cnt, align 4, !tbaa !49 %conv = sext i32 %1 to i64 br label %cleanup if.end8: ; preds = %if.then4, %if.then %node.1.in = phi ptr [ %child, %if.then ], [ %arrayidx6, %if.then4 ] %node.1 = load ptr, ptr %node.1.in, align 8, !tbaa !32 %tobool.not = icmp eq ptr %node.1, null br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !52 cleanup: ; preds = %if.end8, %entry, %if.else7 %retval.0 = phi i64 [ %conv, %if.else7 ], [ 0, %entry ], [ 0, %if.end8 ] ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @AVL_set_lowcomp(i64 noundef %node, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %cmp = icmp eq i64 %node, %val br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %cmp1.not = icmp eq i32 %type, 3 %. = zext i1 %cmp1.not to i32 br label %return if.end: ; preds = %entry %cmp3 = icmp slt i64 %node, %val br i1 %cmp3, label %return, label %if.end5 if.end5: ; preds = %if.end %cmp6 = icmp sgt i64 %node, %val %.13 = sext i1 %cmp6 to i32 br label %return return: ; preds = %if.end5, %if.end, %if.then %retval.0 = phi i32 [ %., %if.then ], [ 1, %if.end ], [ %.13, %if.end5 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local ptr @AVL_set_inside_lowerbound(ptr noundef readonly %root, i64 noundef %val, i32 noundef %type) local_unnamed_addr #22 { entry: %tobool.not42 = icmp eq ptr %root, null br i1 %tobool.not42, label %common.ret50, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %cmp1.not.i = icmp eq i32 %type, 3 %..i = zext i1 %cmp1.not.i to i32 br label %while.body while.body: ; preds = %while.body.lr.ph, %cleanup16 %node.043 = phi ptr [ %root, %while.body.lr.ph ], [ %2, %cleanup16 ] %0 = load i64, ptr %node.043, align 8, !tbaa !48 %cmp.i = icmp eq i64 %0, %val br i1 %cmp.i, label %AVL_set_lowcomp.exit, label %if.end.i if.end.i: ; preds = %while.body %cmp3.i = icmp slt i64 %0, %val br i1 %cmp3.i, label %cleanup16, label %if.end5.i if.end5.i: ; preds = %if.end.i %cmp6.i = icmp sgt i64 %0, %val %.13.i = sext i1 %cmp6.i to i32 br label %AVL_set_lowcomp.exit AVL_set_lowcomp.exit: ; preds = %while.body, %if.end5.i %retval.0.i = phi i32 [ %.13.i, %if.end5.i ], [ %..i, %while.body ] switch i32 %retval.0.i, label %if.then6 [ i32 0, label %common.ret50 i32 1, label %cleanup16 ] common.ret50: ; preds = %entry, %cleanup16, %AVL_set_lowcomp.exit, %if.then6 %common.ret50.op = phi ptr [ %retval.1, %if.then6 ], [ null, %entry ], [ %node.043, %AVL_set_lowcomp.exit ], [ null, %cleanup16 ] ret ptr %common.ret50.op if.then6: ; preds = %AVL_set_lowcomp.exit %child7 = getelementptr inbounds %struct.node_AVL_set, ptr %node.043, i64 0, i32 3 %1 = load ptr, ptr %child7, align 8, !tbaa !32 %call9 = tail call ptr @AVL_set_inside_lowerbound(ptr noundef %1, i64 noundef %val, i32 noundef %type) %cmp10 = icmp eq i32 %type, 1 %cmp12.not = icmp eq ptr %call9, null %node.1.call9 = select i1 %cmp12.not, ptr %node.043, ptr %call9 %retval.1 = select i1 %cmp10, ptr %call9, ptr %node.1.call9 br label %common.ret50 cleanup16: ; preds = %if.end.i, %AVL_set_lowcomp.exit %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %node.043, i64 0, i32 3, i64 1 %2 = load ptr, ptr %arrayidx, align 8, !tbaa !32 %tobool.not = icmp eq ptr %2, null br i1 %tobool.not, label %common.ret50, label %while.body, !llvm.loop !53 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @AVL_set_upcomp(i64 noundef %node, i64 noundef %val, i32 noundef %type) local_unnamed_addr #7 { entry: %cmp = icmp eq i64 %node, %val br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %cmp1.not = icmp eq i32 %type, 3 %. = sext i1 %cmp1.not to i32 br label %return if.end: ; preds = %entry %cmp3 = icmp slt i64 %node, %val br i1 %cmp3, label %return, label %if.end5 if.end5: ; preds = %if.end %cmp6 = icmp sgt i64 %node, %val %.13 = sext i1 %cmp6 to i32 br label %return return: ; preds = %if.end5, %if.end, %if.then %retval.0 = phi i32 [ %., %if.then ], [ 1, %if.end ], [ %.13, %if.end5 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local ptr @AVL_set_inside_upperbound(ptr noundef readonly %root, i64 noundef %val, i32 noundef %type) local_unnamed_addr #22 { entry: %tobool.not40 = icmp eq ptr %root, null br i1 %tobool.not40, label %common.ret48, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %cmp1.not.i = icmp eq i32 %type, 3 br label %while.body while.body: ; preds = %while.body.lr.ph, %cleanup16 %node.041 = phi ptr [ %root, %while.body.lr.ph ], [ %node.1.ph, %cleanup16 ] %0 = load i64, ptr %node.041, align 8, !tbaa !48 %cmp.i = icmp eq i64 %0, %val br i1 %cmp.i, label %AVL_set_upcomp.exit, label %if.end.i if.end.i: ; preds = %while.body %cmp3.i = icmp slt i64 %0, %val br i1 %cmp3.i, label %if.then6, label %if.end5.i if.end5.i: ; preds = %if.end.i %cmp6.i = icmp sgt i64 %0, %val br label %AVL_set_upcomp.exit AVL_set_upcomp.exit: ; preds = %while.body, %if.end5.i %retval.0.i.in = phi i1 [ %cmp6.i, %if.end5.i ], [ %cmp1.not.i, %while.body ] %retval.0.i = sext i1 %retval.0.i.in to i32 switch i32 %retval.0.i, label %cleanup16 [ i32 0, label %common.ret48 i32 -1, label %if.then3 ] if.then3: ; preds = %AVL_set_upcomp.exit %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.041, i64 0, i32 3 %1 = load ptr, ptr %child, align 8, !tbaa !32 br label %cleanup16 common.ret48: ; preds = %entry, %cleanup16, %AVL_set_upcomp.exit, %if.then6 %common.ret48.op = phi ptr [ %retval.1, %if.then6 ], [ null, %entry ], [ %node.041, %AVL_set_upcomp.exit ], [ null, %cleanup16 ] ret ptr %common.ret48.op if.then6: ; preds = %if.end.i %arrayidx8 = getelementptr inbounds %struct.node_AVL_set, ptr %node.041, i64 0, i32 3, i64 1 %2 = load ptr, ptr %arrayidx8, align 8, !tbaa !32 %call9 = tail call ptr @AVL_set_inside_upperbound(ptr noundef %2, i64 noundef %val, i32 noundef %type) %cmp10 = icmp eq i32 %type, 1 %cmp12.not = icmp eq ptr %call9, null %node.1.call9 = select i1 %cmp12.not, ptr %node.041, ptr %call9 %retval.1 = select i1 %cmp10, ptr %call9, ptr %node.1.call9 br label %common.ret48 cleanup16: ; preds = %if.then3, %AVL_set_upcomp.exit %node.1.ph = phi ptr [ %node.041, %AVL_set_upcomp.exit ], [ %1, %if.then3 ] %tobool.not = icmp eq ptr %node.1.ph, null br i1 %tobool.not, label %common.ret48, label %while.body, !llvm.loop !54 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_minmax(ptr nocapture noundef readonly %root, i32 noundef %type) local_unnamed_addr #21 { entry: %idxprom = sext i32 %type to i64 br label %while.cond while.cond: ; preds = %while.cond, %entry %root.addr.0 = phi ptr [ %root, %entry ], [ %0, %while.cond ] %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0, i64 0, i32 3, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !32 %cmp.not = icmp eq ptr %0, null br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !55 while.end: ; preds = %while.cond %1 = load i64, ptr %root.addr.0, align 8, !tbaa !48 ret i64 %1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @AVL_set_inside_swap(ptr nocapture noundef %node1, ptr nocapture noundef %node2) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %node1, align 8, !tbaa !32 %1 = load ptr, ptr %node2, align 8, !tbaa !32 store ptr %1, ptr %node1, align 8, !tbaa !32 store ptr %0, ptr %node2, align 8, !tbaa !32 ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @set_main(i32 noundef %command, i32 noundef %set_num, i64 noundef %val, i64 noundef %option) local_unnamed_addr #10 { entry: %.b152 = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152, label %if.end, label %if.then if.then: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry switch i32 %command, label %if.end79 [ i32 -1, label %if.then2 i32 1, label %if.then6 i32 2, label %if.then18 i32 3, label %if.then24 i32 4, label %if.end.if.then40_crit_edge i32 5, label %if.end.if.then49_crit_edge i32 6, label %if.end.if.then58_crit_edge i32 7, label %if.end.if.then63_crit_edge i32 8, label %if.end.if.then69_crit_edge i32 9, label %if.end.if.then75_crit_edge ] if.end.if.then40_crit_edge: ; preds = %if.end %.pre210 = sext i32 %set_num to i64 br label %if.then40 if.end.if.then49_crit_edge: ; preds = %if.end %.pre211 = sext i32 %set_num to i64 br label %if.then49 if.end.if.then58_crit_edge: ; preds = %if.end %.pre212 = sext i32 %set_num to i64 br label %if.then58 if.end.if.then63_crit_edge: ; preds = %if.end %.pre213 = sext i32 %set_num to i64 br label %if.then63 if.end.if.then69_crit_edge: ; preds = %if.end %.pre214 = sext i32 %set_num to i64 br label %if.then69 if.end.if.then75_crit_edge: ; preds = %if.end %.pre215 = sext i32 %set_num to i64 br label %if.then75 if.then2: ; preds = %if.end %idxprom = sext i32 %set_num to i64 %arrayidx3 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx3, align 8, !tbaa !32 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) br label %return if.then6: ; preds = %if.end %idxprom7 = sext i32 %set_num to i64 %arrayidx8 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7 %1 = load ptr, ptr %arrayidx8, align 8, !tbaa !32 %tobool.not16.i = icmp eq ptr %1, null br i1 %tobool.not16.i, label %cond.false, label %while.body.i while.body.i: ; preds = %if.then6, %if.end8.i %node.017.i = phi ptr [ %node.1.i, %if.end8.i ], [ %1, %if.then6 ] %2 = load i64, ptr %node.017.i, align 8, !tbaa !48 %cmp.i = icmp sgt i64 %2, %val br i1 %cmp.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body.i %child.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3 br label %if.end8.i if.else.i: ; preds = %while.body.i %cmp3.i = icmp slt i64 %2, %val br i1 %cmp3.i, label %if.then4.i, label %AVL_set_inside_count.exit if.then4.i: ; preds = %if.else.i %arrayidx6.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3, i64 1 br label %if.end8.i if.end8.i: ; preds = %if.then4.i, %if.then.i %node.1.in.i = phi ptr [ %child.i, %if.then.i ], [ %arrayidx6.i, %if.then4.i ] %node.1.i = load ptr, ptr %node.1.in.i, align 8, !tbaa !32 %tobool.not.i = icmp eq ptr %node.1.i, null br i1 %tobool.not.i, label %cond.false, label %while.body.i, !llvm.loop !52 AVL_set_inside_count.exit: ; preds = %if.else.i %cnt.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i, align 4, !tbaa !49 %tobool9.not = icmp eq i32 %3, 0 br i1 %tobool9.not, label %cond.false, label %cond.end cond.false: ; preds = %if.end8.i, %if.then6, %AVL_set_inside_count.exit %arrayidx11 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7 %4 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %inc12 = add nsw i64 %4, 1 store i64 %inc12, ptr %arrayidx11, align 8, !tbaa !5 br label %cond.end cond.end: ; preds = %AVL_set_inside_count.exit, %cond.false %call15 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8, i64 noundef %val, i32 noundef 2), !range !51 br label %if.end79 if.then18: ; preds = %if.end %.pre = sext i32 %set_num to i64 %arrayidx20 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre %5 = load ptr, ptr %arrayidx20, align 8, !tbaa !32 %tobool.not16.i153 = icmp eq ptr %5, null br i1 %tobool.not16.i153, label %return, label %while.body.i154 while.body.i154: ; preds = %if.then18, %if.end8.i165 %node.017.i155 = phi ptr [ %node.1.i167, %if.end8.i165 ], [ %5, %if.then18 ] %6 = load i64, ptr %node.017.i155, align 8, !tbaa !48 %cmp.i156 = icmp sgt i64 %6, %val br i1 %cmp.i156, label %if.then.i169, label %if.else.i157 if.then.i169: ; preds = %while.body.i154 %child.i170 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155, i64 0, i32 3 br label %if.end8.i165 if.else.i157: ; preds = %while.body.i154 %cmp3.i158 = icmp slt i64 %6, %val br i1 %cmp3.i158, label %if.then4.i163, label %if.else7.i159 if.then4.i163: ; preds = %if.else.i157 %arrayidx6.i164 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155, i64 0, i32 3, i64 1 br label %if.end8.i165 if.else7.i159: ; preds = %if.else.i157 %cnt.i160 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155, i64 0, i32 2 %7 = load i32, ptr %cnt.i160, align 4, !tbaa !49 %conv.i161 = sext i32 %7 to i64 br label %return if.end8.i165: ; preds = %if.then4.i163, %if.then.i169 %node.1.in.i166 = phi ptr [ %child.i170, %if.then.i169 ], [ %arrayidx6.i164, %if.then4.i163 ] %node.1.i167 = load ptr, ptr %node.1.in.i166, align 8, !tbaa !32 %tobool.not.i168 = icmp eq ptr %node.1.i167, null br i1 %tobool.not.i168, label %return, label %while.body.i154, !llvm.loop !52 if.then24: ; preds = %if.end %.pre209 = sext i32 %set_num to i64 %arrayidx26 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre209 %8 = load ptr, ptr %arrayidx26, align 8, !tbaa !32 %tobool.not16.i172 = icmp eq ptr %8, null br i1 %tobool.not16.i172, label %cond.false30, label %while.body.i173 while.body.i173: ; preds = %if.then24, %if.end8.i184 %node.017.i174 = phi ptr [ %node.1.i186, %if.end8.i184 ], [ %8, %if.then24 ] %9 = load i64, ptr %node.017.i174, align 8, !tbaa !48 %cmp.i175 = icmp sgt i64 %9, %val br i1 %cmp.i175, label %if.then.i188, label %if.else.i176 if.then.i188: ; preds = %while.body.i173 %child.i189 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174, i64 0, i32 3 br label %if.end8.i184 if.else.i176: ; preds = %while.body.i173 %cmp3.i177 = icmp slt i64 %9, %val br i1 %cmp3.i177, label %if.then4.i182, label %AVL_set_inside_count.exit190 if.then4.i182: ; preds = %if.else.i176 %arrayidx6.i183 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174, i64 0, i32 3, i64 1 br label %if.end8.i184 if.end8.i184: ; preds = %if.then4.i182, %if.then.i188 %node.1.in.i185 = phi ptr [ %child.i189, %if.then.i188 ], [ %arrayidx6.i183, %if.then4.i182 ] %node.1.i186 = load ptr, ptr %node.1.in.i185, align 8, !tbaa !32 %tobool.not.i187 = icmp eq ptr %node.1.i186, null br i1 %tobool.not.i187, label %cond.false30, label %while.body.i173, !llvm.loop !52 AVL_set_inside_count.exit190: ; preds = %if.else.i176 %cnt.i179 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174, i64 0, i32 2 %10 = load i32, ptr %cnt.i179, align 4, !tbaa !49 %cmp28 = icmp sgt i32 %10, 1 br i1 %cmp28, label %cond.end33, label %cond.false30 cond.false30: ; preds = %if.end8.i184, %if.then24, %AVL_set_inside_count.exit190 %arrayidx32 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre209 %11 = load i64, ptr %arrayidx32, align 8, !tbaa !5 %dec = add nsw i64 %11, -1 store i64 %dec, ptr %arrayidx32, align 8, !tbaa !5 br label %cond.end33 cond.end33: ; preds = %AVL_set_inside_count.exit190, %cond.false30 %call37 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26, i64 noundef %val, i32 noundef 1), !range !51 switch i32 %command, label %if.end79 [ i32 4, label %if.then40 i32 5, label %if.then49 i32 6, label %if.then58 i32 7, label %if.then63 i32 8, label %if.then69 i32 9, label %if.then75 ] if.then40: ; preds = %if.end.if.then40_crit_edge, %cond.end33 %idxprom41.pre-phi = phi i64 [ %.pre210, %if.end.if.then40_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx42 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom41.pre-phi %12 = load i64, ptr %arrayidx42, align 8, !tbaa !5 %dec43 = add nsw i64 %12, -1 store i64 %dec43, ptr %arrayidx42, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom41.pre-phi %call46 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45, i64 noundef %val, i32 noundef 0), !range !51 br label %return if.then49: ; preds = %if.end.if.then49_crit_edge, %cond.end33 %idxprom50.pre-phi = phi i64 [ %.pre211, %if.end.if.then49_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx51 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom50.pre-phi store i64 0, ptr %arrayidx51, align 8, !tbaa !5 %arrayidx53 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom50.pre-phi %13 = load ptr, ptr %arrayidx53, align 8, !tbaa !32 tail call void @AVL_set_inside_free(ptr noundef %13) store ptr null, ptr %arrayidx53, align 8, !tbaa !32 br label %return if.then58: ; preds = %if.end.if.then58_crit_edge, %cond.end33 %idxprom59.pre-phi = phi i64 [ %.pre212, %if.end.if.then58_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx60 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom59.pre-phi %14 = load i64, ptr %arrayidx60, align 8, !tbaa !5 br label %return if.then63: ; preds = %if.end.if.then63_crit_edge, %cond.end33 %idxprom64.pre-phi = phi i64 [ %.pre213, %if.end.if.then63_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx65 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom64.pre-phi %15 = load ptr, ptr %arrayidx65, align 8, !tbaa !32 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %if.then63 %root.addr.0.i = phi ptr [ %15, %if.then63 ], [ %16, %while.cond.i ] %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i, i64 0, i32 3, i64 1 %16 = load ptr, ptr %arrayidx.i, align 8, !tbaa !32 %cmp.not.i = icmp eq ptr %16, null br i1 %cmp.not.i, label %AVL_set_inside_minmax.exit, label %while.cond.i, !llvm.loop !55 AVL_set_inside_minmax.exit: ; preds = %while.cond.i %17 = load i64, ptr %root.addr.0.i, align 8, !tbaa !48 br label %return if.then69: ; preds = %if.end.if.then69_crit_edge, %cond.end33 %idxprom70.pre-phi = phi i64 [ %.pre214, %if.end.if.then69_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx71 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom70.pre-phi %18 = load ptr, ptr %arrayidx71, align 8, !tbaa !32 br label %while.cond.i191 while.cond.i191: ; preds = %while.cond.i191, %if.then69 %root.addr.0.i192 = phi ptr [ %18, %if.then69 ], [ %19, %while.cond.i191 ] %arrayidx.i193 = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i192, i64 0, i32 3, i64 0 %19 = load ptr, ptr %arrayidx.i193, align 8, !tbaa !32 %cmp.not.i194 = icmp eq ptr %19, null br i1 %cmp.not.i194, label %AVL_set_inside_minmax.exit195, label %while.cond.i191, !llvm.loop !55 AVL_set_inside_minmax.exit195: ; preds = %while.cond.i191 %20 = load i64, ptr %root.addr.0.i192, align 8, !tbaa !48 br label %return if.then75: ; preds = %if.end.if.then75_crit_edge, %cond.end33 %idxprom76.pre-phi = phi i64 [ %.pre215, %if.end.if.then75_crit_edge ], [ %.pre209, %cond.end33 ] %arrayidx77 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom76.pre-phi %arrayidx78 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %val %21 = load ptr, ptr %arrayidx77, align 8, !tbaa !32 %22 = load ptr, ptr %arrayidx78, align 8, !tbaa !32 store ptr %22, ptr %arrayidx77, align 8, !tbaa !32 store ptr %21, ptr %arrayidx78, align 8, !tbaa !32 br label %return if.end79: ; preds = %cond.end, %if.end, %cond.end33 %23 = add i32 %command, -10 %or.cond = icmp ult i32 %23, 3 br i1 %or.cond, label %if.then82, label %if.end89 if.then82: ; preds = %if.end79 %idxprom83 = sext i32 %set_num to i64 %arrayidx84 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom83 %24 = load ptr, ptr %arrayidx84, align 8, !tbaa !32 %sub = add nsw i32 %command, -9 %call85 = tail call ptr @AVL_set_inside_lowerbound(ptr noundef %24, i64 noundef %val, i32 noundef %sub) %cmp86 = icmp eq ptr %call85, null br i1 %cmp86, label %return, label %if.else if.else: ; preds = %if.then82 %25 = load i64, ptr %call85, align 8, !tbaa !48 br label %return if.end89: ; preds = %if.end79 %26 = add i32 %command, -13 %or.cond104 = icmp ult i32 %26, 3 br i1 %or.cond104, label %if.then93, label %return if.then93: ; preds = %if.end89 %idxprom94 = sext i32 %set_num to i64 %arrayidx95 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom94 %27 = load ptr, ptr %arrayidx95, align 8, !tbaa !32 %sub96 = add nsw i32 %command, -12 %call97 = tail call ptr @AVL_set_inside_upperbound(ptr noundef %27, i64 noundef %val, i32 noundef %sub96) %cmp98 = icmp eq ptr %call97, null br i1 %cmp98, label %return, label %if.else100 if.else100: ; preds = %if.then93 %28 = load i64, ptr %call97, align 8, !tbaa !48 br label %return return: ; preds = %if.end8.i165, %if.then49, %if.then40, %if.then2, %if.then75, %if.else7.i159, %if.then18, %if.end89, %if.else100, %if.then93, %if.else, %if.then82, %AVL_set_inside_minmax.exit195, %AVL_set_inside_minmax.exit, %if.then58 %retval.2 = phi i64 [ %14, %if.then58 ], [ %17, %AVL_set_inside_minmax.exit ], [ %20, %AVL_set_inside_minmax.exit195 ], [ %25, %if.else ], [ %option, %if.then82 ], [ %28, %if.else100 ], [ %option, %if.then93 ], [ 0, %if.end89 ], [ %conv.i161, %if.else7.i159 ], [ 0, %if.then18 ], [ 0, %if.then75 ], [ 0, %if.then2 ], [ 0, %if.then40 ], [ 0, %if.then49 ], [ 0, %if.end8.i165 ] ret i64 %retval.2 } ; Function Attrs: nofree nounwind uwtable define dso_local void @set_print(i32 noundef %set_num) local_unnamed_addr #2 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %idxprom.i = sext i32 %set_num to i64 %arrayidx3.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom.i %0 = load ptr, ptr %arrayidx3.i, align 8, !tbaa !32 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_insert(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #10 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %idxprom7.i = sext i32 %set_num to i64 %arrayidx8.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7.i %0 = load ptr, ptr %arrayidx8.i, align 8, !tbaa !32 %tobool.not16.i.i = icmp eq ptr %0, null br i1 %tobool.not16.i.i, label %cond.false.i, label %while.body.i.i while.body.i.i: ; preds = %if.end.i, %if.end8.i.i %node.017.i.i = phi ptr [ %node.1.i.i, %if.end8.i.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i.i, align 8, !tbaa !48 %cmp.i.i = icmp sgt i64 %1, %val br i1 %cmp.i.i, label %if.then.i.i, label %if.else.i.i if.then.i.i: ; preds = %while.body.i.i %child.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3 br label %if.end8.i.i if.else.i.i: ; preds = %while.body.i.i %cmp3.i.i = icmp slt i64 %1, %val br i1 %cmp3.i.i, label %if.then4.i.i, label %AVL_set_inside_count.exit.i if.then4.i.i: ; preds = %if.else.i.i %arrayidx6.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3, i64 1 br label %if.end8.i.i if.end8.i.i: ; preds = %if.then4.i.i, %if.then.i.i %node.1.in.i.i = phi ptr [ %child.i.i, %if.then.i.i ], [ %arrayidx6.i.i, %if.then4.i.i ] %node.1.i.i = load ptr, ptr %node.1.in.i.i, align 8, !tbaa !32 %tobool.not.i.i = icmp eq ptr %node.1.i.i, null br i1 %tobool.not.i.i, label %cond.false.i, label %while.body.i.i, !llvm.loop !52 AVL_set_inside_count.exit.i: ; preds = %if.else.i.i %cnt.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i.i, align 4, !tbaa !49 %tobool9.not.i = icmp eq i32 %2, 0 br i1 %tobool9.not.i, label %cond.false.i, label %set_main.exit cond.false.i: ; preds = %if.end8.i.i, %AVL_set_inside_count.exit.i, %if.end.i %arrayidx11.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7.i %3 = load i64, ptr %arrayidx11.i, align 8, !tbaa !5 %inc12.i = add nsw i64 %3, 1 store i64 %inc12.i, ptr %arrayidx11.i, align 8, !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %AVL_set_inside_count.exit.i, %cond.false.i %call15.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8.i, i64 noundef %val, i32 noundef 2), !range !51 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_count(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #23 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre.i = sext i32 %set_num to i64 %arrayidx20.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre.i %0 = load ptr, ptr %arrayidx20.i, align 8, !tbaa !32 %tobool.not16.i153.i = icmp eq ptr %0, null br i1 %tobool.not16.i153.i, label %set_main.exit, label %while.body.i154.i while.body.i154.i: ; preds = %if.end.i, %if.end8.i165.i %node.017.i155.i = phi ptr [ %node.1.i167.i, %if.end8.i165.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i155.i, align 8, !tbaa !48 %cmp.i156.i = icmp sgt i64 %1, %val br i1 %cmp.i156.i, label %if.then.i169.i, label %if.else.i157.i if.then.i169.i: ; preds = %while.body.i154.i %child.i170.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155.i, i64 0, i32 3 br label %if.end8.i165.i if.else.i157.i: ; preds = %while.body.i154.i %cmp3.i158.i = icmp slt i64 %1, %val br i1 %cmp3.i158.i, label %if.then4.i163.i, label %if.else7.i159.i if.then4.i163.i: ; preds = %if.else.i157.i %arrayidx6.i164.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155.i, i64 0, i32 3, i64 1 br label %if.end8.i165.i if.else7.i159.i: ; preds = %if.else.i157.i %cnt.i160.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i155.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i160.i, align 4, !tbaa !49 %conv.i161.i = sext i32 %2 to i64 br label %set_main.exit if.end8.i165.i: ; preds = %if.then4.i163.i, %if.then.i169.i %node.1.in.i166.i = phi ptr [ %child.i170.i, %if.then.i169.i ], [ %arrayidx6.i164.i, %if.then4.i163.i ] %node.1.i167.i = load ptr, ptr %node.1.in.i166.i, align 8, !tbaa !32 %tobool.not.i168.i = icmp eq ptr %node.1.i167.i, null br i1 %tobool.not.i168.i, label %set_main.exit, label %while.body.i154.i, !llvm.loop !52 set_main.exit: ; preds = %if.end8.i165.i, %if.end.i, %if.else7.i159.i %retval.2.i = phi i64 [ %conv.i161.i, %if.else7.i159.i ], [ 0, %if.end.i ], [ 0, %if.end8.i165.i ] ret i64 %retval.2.i } ; Function Attrs: nounwind uwtable define dso_local void @set_erase(i32 noundef %set_num, i64 noundef %val, i32 noundef %is_all) local_unnamed_addr #10 { entry: %tobool.not = icmp eq i32 %is_all, 0 %.b152.i4 = load i1, ptr @set_main.set_is_init, align 1 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %entry br i1 %.b152.i4, label %set_main.exit, label %if.then.i if.then.i: ; preds = %if.then store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %if.then, %if.then.i %.pre210.i = sext i32 %set_num to i64 %arrayidx42.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre210.i %0 = load i64, ptr %arrayidx42.i, align 8, !tbaa !5 %dec43.i = add nsw i64 %0, -1 store i64 %dec43.i, ptr %arrayidx42.i, align 8, !tbaa !5 %arrayidx45.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre210.i %call46.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45.i, i64 noundef %val, i32 noundef 0), !range !51 br label %if.end if.else: ; preds = %entry br i1 %.b152.i4, label %if.end.i, label %if.then.i5 if.then.i5: ; preds = %if.else store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i5, %if.else %.pre209.i = sext i32 %set_num to i64 %arrayidx26.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre209.i %1 = load ptr, ptr %arrayidx26.i, align 8, !tbaa !32 %tobool.not16.i172.i = icmp eq ptr %1, null br i1 %tobool.not16.i172.i, label %cond.false30.i, label %while.body.i173.i while.body.i173.i: ; preds = %if.end.i, %if.end8.i184.i %node.017.i174.i = phi ptr [ %node.1.i186.i, %if.end8.i184.i ], [ %1, %if.end.i ] %2 = load i64, ptr %node.017.i174.i, align 8, !tbaa !48 %cmp.i175.i = icmp sgt i64 %2, %val br i1 %cmp.i175.i, label %if.then.i188.i, label %if.else.i176.i if.then.i188.i: ; preds = %while.body.i173.i %child.i189.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174.i, i64 0, i32 3 br label %if.end8.i184.i if.else.i176.i: ; preds = %while.body.i173.i %cmp3.i177.i = icmp slt i64 %2, %val br i1 %cmp3.i177.i, label %if.then4.i182.i, label %AVL_set_inside_count.exit190.i if.then4.i182.i: ; preds = %if.else.i176.i %arrayidx6.i183.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174.i, i64 0, i32 3, i64 1 br label %if.end8.i184.i if.end8.i184.i: ; preds = %if.then4.i182.i, %if.then.i188.i %node.1.in.i185.i = phi ptr [ %child.i189.i, %if.then.i188.i ], [ %arrayidx6.i183.i, %if.then4.i182.i ] %node.1.i186.i = load ptr, ptr %node.1.in.i185.i, align 8, !tbaa !32 %tobool.not.i187.i = icmp eq ptr %node.1.i186.i, null br i1 %tobool.not.i187.i, label %cond.false30.i, label %while.body.i173.i, !llvm.loop !52 AVL_set_inside_count.exit190.i: ; preds = %if.else.i176.i %cnt.i179.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i174.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i179.i, align 4, !tbaa !49 %cmp28.i = icmp sgt i32 %3, 1 br i1 %cmp28.i, label %set_main.exit6, label %cond.false30.i cond.false30.i: ; preds = %if.end8.i184.i, %AVL_set_inside_count.exit190.i, %if.end.i %arrayidx32.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre209.i %4 = load i64, ptr %arrayidx32.i, align 8, !tbaa !5 %dec.i = add nsw i64 %4, -1 store i64 %dec.i, ptr %arrayidx32.i, align 8, !tbaa !5 br label %set_main.exit6 set_main.exit6: ; preds = %AVL_set_inside_count.exit190.i, %cond.false30.i %call37.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26.i, i64 noundef %val, i32 noundef 1), !range !51 br label %if.end if.end: ; preds = %set_main.exit6, %set_main.exit ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_clear(i32 noundef %set_num) local_unnamed_addr #10 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre211.i = sext i32 %set_num to i64 %arrayidx51.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre211.i store i64 0, ptr %arrayidx51.i, align 8, !tbaa !5 %arrayidx53.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre211.i %0 = load ptr, ptr %arrayidx53.i, align 8, !tbaa !32 tail call void @AVL_set_inside_free(ptr noundef %0) store ptr null, ptr %arrayidx53.i, align 8, !tbaa !32 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @set_size(i32 noundef %set_num) local_unnamed_addr #24 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre212.i = sext i32 %set_num to i64 %arrayidx60.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre212.i %0 = load i64, ptr %arrayidx60.i, align 8, !tbaa !5 ret i64 %0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_max(i32 noundef %set_num) local_unnamed_addr #23 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre213.i = sext i32 %set_num to i64 %arrayidx65.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre213.i %0 = load ptr, ptr %arrayidx65.i, align 8, !tbaa !32 br label %while.cond.i.i while.cond.i.i: ; preds = %while.cond.i.i, %if.end.i %root.addr.0.i.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i.i ] %arrayidx.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i.i, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx.i.i, align 8, !tbaa !32 %cmp.not.i.i = icmp eq ptr %1, null br i1 %cmp.not.i.i, label %set_main.exit, label %while.cond.i.i, !llvm.loop !55 set_main.exit: ; preds = %while.cond.i.i %2 = load i64, ptr %root.addr.0.i.i, align 8, !tbaa !48 ret i64 %2 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_min(i32 noundef %set_num) local_unnamed_addr #23 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre214.i = sext i32 %set_num to i64 %arrayidx71.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre214.i %0 = load ptr, ptr %arrayidx71.i, align 8, !tbaa !32 br label %while.cond.i191.i while.cond.i191.i: ; preds = %while.cond.i191.i, %if.end.i %root.addr.0.i192.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i191.i ] %arrayidx.i193.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i192.i, i64 0, i32 3, i64 0 %1 = load ptr, ptr %arrayidx.i193.i, align 8, !tbaa !32 %cmp.not.i194.i = icmp eq ptr %1, null br i1 %cmp.not.i194.i, label %set_main.exit, label %while.cond.i191.i, !llvm.loop !55 set_main.exit: ; preds = %while.cond.i191.i %2 = load i64, ptr %root.addr.0.i192.i, align 8, !tbaa !48 ret i64 %2 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @set_swap(i32 noundef %set_num1, i32 noundef %set_num2) local_unnamed_addr #24 { entry: %.b152.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b152.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !32 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %conv = sext i32 %set_num2 to i64 %.pre215.i = sext i32 %set_num1 to i64 %arrayidx77.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre215.i %arrayidx78.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %conv %0 = load ptr, ptr %arrayidx77.i, align 8, !tbaa !32 %1 = load ptr, ptr %arrayidx78.i, align 8, !tbaa !32 store ptr %1, ptr %arrayidx77.i, align 8, !tbaa !32 store ptr %0, ptr %arrayidx78.i, align 8, !tbaa !32 ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @set_lowerbound(i32 noundef %set_num, i64 noundef %val, i32 noundef %type, i64 noundef %error) local_unnamed_addr #10 { entry: %add = add nsw i32 %type, 9 %call = tail call i64 @set_main(i32 noundef %add, i32 noundef %set_num, i64 noundef %val, i64 noundef %error) ret i64 %call } ; Function Attrs: nounwind uwtable define dso_local i64 @set_upperbound(i32 noundef %set_num, i64 noundef %val, i32 noundef %type, i64 noundef %error) local_unnamed_addr #10 { entry: %add = add nsw i32 %type, 12 %call = tail call i64 @set_main(i32 noundef %add, i32 noundef %set_num, i64 noundef %val, i64 noundef %error) ret i64 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @seg_def_max() #7 { entry: ret i64 -4611686018427387904 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @seg_def_min() local_unnamed_addr #7 { entry: ret i64 4611686018427387904 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @seg_def_sum() local_unnamed_addr #7 { entry: ret i64 0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @seg_def_gcd() local_unnamed_addr #7 { entry: ret i64 0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @seg_ope_max(i64 noundef %a, i64 noundef %b) #4 { entry: %cond.i = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond.i } ; Function Attrs: nounwind uwtable define dso_local void @segmake(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #10 { entry: %seg_t.promoted = load i64, ptr @seg_t, align 8, !tbaa !5 %cmp47 = icmp slt i64 %seg_t.promoted, %n br i1 %cmp47, label %while.body, label %for.cond.preheader while.cond.for.cond.preheader_crit_edge: ; preds = %while.body store i64 %mul, ptr @seg_t, align 8, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %while.cond.for.cond.preheader_crit_edge, %entry %.lcssa = phi i64 [ %mul, %while.cond.for.cond.preheader_crit_edge ], [ %seg_t.promoted, %entry ] %cmp149 = icmp sgt i64 %.lcssa, 0 br i1 %cmp149, label %for.body.lr.ph, label %while.cond7.preheader for.body.lr.ph: ; preds = %for.cond.preheader %sub4 = add nsw i64 %.lcssa, -1 br label %for.body while.body: ; preds = %entry, %while.body %mul4648 = phi i64 [ %mul, %while.body ], [ %seg_t.promoted, %entry ] %mul = shl nsw i64 %mul4648, 1 %cmp = icmp slt i64 %mul, %n br i1 %cmp, label %while.body, label %while.cond.for.cond.preheader_crit_edge, !llvm.loop !56 while.cond7.preheader: ; preds = %for.inc, %for.cond.preheader %t.0.off54 = add i64 %.lcssa, 1 %tobool.not55 = icmp ult i64 %t.0.off54, 3 br i1 %tobool.not55, label %while.end28, label %for.cond10.preheader for.body: ; preds = %for.body.lr.ph, %for.inc %i.050 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] %cmp2 = icmp slt i64 %i.050, %n %add = add nsw i64 %sub4, %i.050 %arrayidx3 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %add br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.050 %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %for.inc if.else: ; preds = %for.body %1 = load ptr, ptr @seg_def, align 8, !tbaa !32 %call = tail call i64 %1() #33 br label %for.inc for.inc: ; preds = %if.then, %if.else %.sink = phi i64 [ %0, %if.then ], [ %call, %if.else ] store i64 %.sink, ptr %arrayidx3, align 8, !tbaa !5 %inc = add nuw nsw i64 %i.050, 1 %exitcond.not = icmp eq i64 %inc, %.lcssa br i1 %exitcond.not, label %while.cond7.preheader, label %for.body, !llvm.loop !57 while.cond7.loopexit: ; preds = %for.body13, %for.cond10.preheader %t.0.off = add nsw i64 %div56, 1 %tobool.not = icmp ult i64 %t.0.off, 3 br i1 %tobool.not, label %while.end28, label %for.cond10.preheader, !llvm.loop !58 for.cond10.preheader: ; preds = %while.cond7.preheader, %while.cond7.loopexit %div56.in = phi i64 [ %div56, %while.cond7.loopexit ], [ %.lcssa, %while.cond7.preheader ] %div56 = sdiv i64 %div56.in, 2 %cmp1151 = icmp sgt i64 %div56.in, 1 br i1 %cmp1151, label %for.body13, label %while.cond7.loopexit for.body13: ; preds = %for.cond10.preheader, %for.body13 %i9.052 = phi i64 [ %inc26, %for.body13 ], [ 0, %for.cond10.preheader ] %2 = load ptr, ptr @seg_ope, align 8, !tbaa !32 %add14 = add nsw i64 %i9.052, %div56 %mul15 = shl nsw i64 %add14, 1 %arrayidx16 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %mul15 %3 = load i64, ptr %arrayidx16, align 16, !tbaa !5 %sub19 = add nsw i64 %mul15, -1 %arrayidx20 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub19 %4 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %call21 = tail call i64 %2(i64 noundef %3, i64 noundef %4) #33 %sub23 = add nsw i64 %add14, -1 %arrayidx24 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub23 store i64 %call21, ptr %arrayidx24, align 8, !tbaa !5 %inc26 = add nuw nsw i64 %i9.052, 1 %exitcond57.not = icmp eq i64 %inc26, %div56 br i1 %exitcond57.not, label %while.cond7.loopexit, label %for.body13, !llvm.loop !59 while.end28: ; preds = %while.cond7.loopexit, %while.cond7.preheader ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @segmin(i64 noundef %from, i64 noundef %to, i64 noundef %a, i64 noundef %l, i64 noundef %r) local_unnamed_addr #25 { entry: %cmp.not = icmp slt i64 %l, %from %cmp1.not = icmp sgt i64 %r, %to %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %cond.false, label %cond.true cond.true: ; preds = %entry %arrayidx = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %a %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %common.ret33 cond.false: ; preds = %entry %cmp2 = icmp sgt i64 %l, %to %cmp3 = icmp slt i64 %r, %from %or.cond32 = or i1 %cmp2, %cmp3 br i1 %or.cond32, label %common.ret33, label %cond.false5 common.ret33: ; preds = %cond.false, %cond.true, %cond.false5 %common.ret33.op = phi i64 [ %cond.i, %cond.false5 ], [ %0, %cond.true ], [ -4611686018427387904, %cond.false ] ret i64 %common.ret33.op cond.false5: ; preds = %cond.false %mul = shl nsw i64 %a, 1 %add = or i64 %mul, 1 %add6 = add nsw i64 %r, %l %div = sdiv i64 %add6, 2 %call = tail call i64 @segmin(i64 noundef %from, i64 noundef %to, i64 noundef %add, i64 noundef %l, i64 noundef %div) %add8 = add nsw i64 %mul, 2 %add11 = add nsw i64 %div, 1 %call12 = tail call i64 @segmin(i64 noundef %from, i64 noundef %to, i64 noundef %add8, i64 noundef %add11, i64 noundef %r) %cond.i = tail call i64 @llvm.smax.i64(i64 %call, i64 %call12) br label %common.ret33 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @seggcd(i64 noundef %from, i64 noundef %to, i64 noundef %a, i64 noundef %l, i64 noundef %r) local_unnamed_addr #25 { entry: %cmp.not87 = icmp slt i64 %l, %from %cmp1.not7088 = icmp sgt i64 %r, %to %or.cond7189 = or i1 %cmp.not87, %cmp1.not7088 br i1 %or.cond7189, label %cond.false.lr.ph, label %cond.true cond.false.lr.ph: ; preds = %entry, %cond.true12 %cmp.not94 = phi i1 [ %cmp.not, %cond.true12 ], [ %cmp.not87, %entry ] %r.tr.ph93 = phi i64 [ %.us-phi77, %cond.true12 ], [ %r, %entry ] %l.tr.ph91 = phi i64 [ %add2.le, %cond.true12 ], [ %l, %entry ] %a.tr.ph90 = phi i64 [ %add14, %cond.true12 ], [ %a, %entry ] br i1 %cmp.not94, label %cond.false.lr.ph.split.us, label %cond.false cond.false.lr.ph.split.us: ; preds = %cond.false.lr.ph %add.us78 = add i64 %r.tr.ph93, %l.tr.ph91 %div.us79 = sdiv i64 %add.us78, 2 %cmp3.not.us80 = icmp slt i64 %div.us79, %to br i1 %cmp3.not.us80, label %cond.false8, label %cond.true4.us cond.true4.us: ; preds = %cond.false.lr.ph.split.us, %cond.true4.us %div.us82 = phi i64 [ %div.us, %cond.true4.us ], [ %div.us79, %cond.false.lr.ph.split.us ] %a.tr72.us81 = phi i64 [ %add5.us, %cond.true4.us ], [ %a.tr.ph90, %cond.false.lr.ph.split.us ] %mul.us = shl nsw i64 %a.tr72.us81, 1 %add5.us = or i64 %mul.us, 1 %add.us = add i64 %div.us82, %l.tr.ph91 %div.us = sdiv i64 %add.us, 2 %cmp3.not.us = icmp slt i64 %div.us, %to br i1 %cmp3.not.us, label %cond.false8, label %cond.true4.us cond.true: ; preds = %cond.true12, %cond.true4, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %add5, %cond.true4 ], [ %add14, %cond.true12 ] %arrayidx = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %a.tr.lcssa %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %cond.end34 cond.false: ; preds = %cond.false.lr.ph, %cond.true4 %r.tr73 = phi i64 [ %div, %cond.true4 ], [ %r.tr.ph93, %cond.false.lr.ph ] %a.tr72 = phi i64 [ %add5, %cond.true4 ], [ %a.tr.ph90, %cond.false.lr.ph ] %add = add i64 %r.tr73, %l.tr.ph91 %div = sdiv i64 %add, 2 %cmp3.not = icmp slt i64 %div, %to br i1 %cmp3.not, label %cond.false8, label %cond.true4 cond.true4: ; preds = %cond.false %mul = shl nsw i64 %a.tr72, 1 %add5 = or i64 %mul, 1 %cmp1.not = icmp sgt i64 %div, %to br i1 %cmp1.not, label %cond.false, label %cond.true cond.false8: ; preds = %cond.false, %cond.true4.us, %cond.false.lr.ph.split.us %.us-phi = phi i64 [ %div.us79, %cond.false.lr.ph.split.us ], [ %div.us, %cond.true4.us ], [ %div, %cond.false ] %.us-phi76 = phi i64 [ %a.tr.ph90, %cond.false.lr.ph.split.us ], [ %add5.us, %cond.true4.us ], [ %a.tr72, %cond.false ] %.us-phi77 = phi i64 [ %r.tr.ph93, %cond.false.lr.ph.split.us ], [ %div.us82, %cond.true4.us ], [ %r.tr73, %cond.false ] %add2.le = add nsw i64 %.us-phi, 1 %cmp11 = icmp slt i64 %.us-phi, %from %mul13 = shl nsw i64 %.us-phi76, 1 %add14 = add nsw i64 %mul13, 2 br i1 %cmp11, label %cond.true12, label %cond.false19 cond.true12: ; preds = %cond.false8 %cmp.not = icmp slt i64 %add2.le, %from %cmp1.not70 = icmp sgt i64 %.us-phi77, %to %or.cond71 = or i1 %cmp.not, %cmp1.not70 br i1 %or.cond71, label %cond.false.lr.ph, label %cond.true cond.false19: ; preds = %cond.false8 %call25 = tail call i64 @seggcd(i64 noundef %from, i64 noundef %to, i64 noundef %add14, i64 noundef %add2.le, i64 noundef %.us-phi77) %add27 = or i64 %mul13, 1 %call30 = tail call i64 @seggcd(i64 noundef %from, i64 noundef %to, i64 noundef %add27, i64 noundef %l.tr.ph91, i64 noundef %.us-phi) %tobool.not4.i = icmp eq i64 %call30, 0 br i1 %tobool.not4.i, label %cond.end34, label %cond.true.i cond.true.i: ; preds = %cond.false19, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %call30, %cond.false19 ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %call25, %cond.false19 ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %cond.end34, label %cond.true.i cond.end34: ; preds = %cond.true.i, %cond.false19, %cond.true %cond35 = phi i64 [ %0, %cond.true ], [ %call25, %cond.false19 ], [ %b.tr6.i, %cond.true.i ] ret i64 %cond35 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @segupdate(i64 noundef %a, i64 noundef %b) local_unnamed_addr #26 { entry: %0 = load i64, ptr @seg_t, align 8, !tbaa !5 %sub = add i64 %a, -1 %add = add i64 %sub, %0 %arrayidx = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %add store i64 %b, ptr %arrayidx, align 8, !tbaa !5 %cmp15 = icmp sgt i64 %add, 0 br i1 %cmp15, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %c.016 = phi i64 [ %div14, %while.body ], [ %add, %entry ] %dec = add nsw i64 %c.016, -1 %div14 = lshr i64 %dec, 1 %add1 = and i64 %dec, -2 %mul = add nuw i64 %add1, 2 %arrayidx2 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %mul %1 = load i64, ptr %arrayidx2, align 16, !tbaa !5 %sub5 = or i64 %dec, 1 %arrayidx6 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub5 %2 = load i64, ptr %arrayidx6, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %1, i64 %2) %arrayidx7 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %div14 store i64 %cond.i, ptr %arrayidx7, align 8, !tbaa !5 %cmp.not = icmp ult i64 %dec, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !60 while.end: ; preds = %while.body, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local void @solve() local_unnamed_addr #10 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #33 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %vla1 = alloca i64, i64 %2, align 16 %cmp34 = icmp sgt i64 %2, 0 br i1 %cmp34, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa33 = phi i64 [ %2, %entry ], [ %9, %for.body ] store ptr @seg_def_max, ptr @seg_def, align 8, !tbaa !32 store ptr @seg_ope_max, ptr @seg_ope, align 8, !tbaa !32 %seg_t.promoted.i = load i64, ptr @seg_t, align 8, !tbaa !5 %cmp47.i.not = icmp sgt i64 %seg_t.promoted.i, %.lcssa33 br i1 %cmp47.i.not, label %for.cond.preheader.i, label %while.body.i while.cond.for.cond.preheader_crit_edge.i: ; preds = %while.body.i store i64 %mul.i, ptr @seg_t, align 8, !tbaa !5 br label %for.cond.preheader.i for.cond.preheader.i: ; preds = %while.cond.for.cond.preheader_crit_edge.i, %for.cond.cleanup %.lcssa.i = phi i64 [ %mul.i, %while.cond.for.cond.preheader_crit_edge.i ], [ %seg_t.promoted.i, %for.cond.cleanup ] %cmp149.i = icmp sgt i64 %.lcssa.i, 0 br i1 %cmp149.i, label %for.body.lr.ph.i, label %while.cond7.preheader.i for.body.lr.ph.i: ; preds = %for.cond.preheader.i %sub4.i = add nsw i64 %.lcssa.i, -1 br label %for.body.i while.body.i: ; preds = %for.cond.cleanup, %while.body.i %mul4648.i = phi i64 [ %mul.i, %while.body.i ], [ %seg_t.promoted.i, %for.cond.cleanup ] %mul.i = shl nsw i64 %mul4648.i, 1 %cmp.i.not = icmp sgt i64 %mul.i, %.lcssa33 br i1 %cmp.i.not, label %while.cond.for.cond.preheader_crit_edge.i, label %while.body.i, !llvm.loop !56 while.cond7.preheader.i: ; preds = %for.inc.i, %for.cond.preheader.i %t.0.off54.i = add i64 %.lcssa.i, 1 %tobool.not55.i = icmp ult i64 %t.0.off54.i, 3 br i1 %tobool.not55.i, label %segmake.exit, label %for.cond10.preheader.i for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i %i.050.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %inc.i, %for.inc.i ] %cmp2.i.not = icmp sgt i64 %i.050.i, %.lcssa33 %add.i = add nsw i64 %sub4.i, %i.050.i %arrayidx3.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %add.i br i1 %cmp2.i.not, label %if.else.i, label %if.then.i if.then.i: ; preds = %for.body.i %arrayidx.i = getelementptr inbounds i64, ptr @fl, i64 %i.050.i %3 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 br label %for.inc.i if.else.i: ; preds = %for.body.i %4 = load ptr, ptr @seg_def, align 8, !tbaa !32 %call.i26 = call i64 %4() #33 br label %for.inc.i for.inc.i: ; preds = %if.else.i, %if.then.i %.sink.i = phi i64 [ %3, %if.then.i ], [ %call.i26, %if.else.i ] store i64 %.sink.i, ptr %arrayidx3.i, align 8, !tbaa !5 %inc.i = add nuw nsw i64 %i.050.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %.lcssa.i br i1 %exitcond.not.i, label %while.cond7.preheader.i, label %for.body.i, !llvm.loop !57 while.cond7.loopexit.i: ; preds = %for.body13.i, %for.cond10.preheader.i %t.0.off.i = add nsw i64 %div56.i, 1 %tobool.not.i = icmp ult i64 %t.0.off.i, 3 br i1 %tobool.not.i, label %segmake.exit, label %for.cond10.preheader.i, !llvm.loop !58 for.cond10.preheader.i: ; preds = %while.cond7.preheader.i, %while.cond7.loopexit.i %div56.in.i = phi i64 [ %div56.i, %while.cond7.loopexit.i ], [ %.lcssa.i, %while.cond7.preheader.i ] %div56.i = sdiv i64 %div56.in.i, 2 %cmp1151.i = icmp sgt i64 %div56.in.i, 1 br i1 %cmp1151.i, label %for.body13.i, label %while.cond7.loopexit.i for.body13.i: ; preds = %for.cond10.preheader.i, %for.body13.i %i9.052.i = phi i64 [ %inc26.i, %for.body13.i ], [ 0, %for.cond10.preheader.i ] %5 = load ptr, ptr @seg_ope, align 8, !tbaa !32 %add14.i = add nsw i64 %i9.052.i, %div56.i %mul15.i = shl nsw i64 %add14.i, 1 %arrayidx16.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %mul15.i %6 = load i64, ptr %arrayidx16.i, align 16, !tbaa !5 %sub19.i = add nsw i64 %mul15.i, -1 %arrayidx20.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub19.i %7 = load i64, ptr %arrayidx20.i, align 8, !tbaa !5 %call21.i = call i64 %5(i64 noundef %6, i64 noundef %7) #33 %sub23.i = add nsw i64 %add14.i, -1 %arrayidx24.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub23.i store i64 %call21.i, ptr %arrayidx24.i, align 8, !tbaa !5 %inc26.i = add nuw nsw i64 %i9.052.i, 1 %exitcond57.not.i = icmp eq i64 %inc26.i, %div56.i br i1 %exitcond57.not.i, label %while.cond7.loopexit.i, label %for.body13.i, !llvm.loop !59 segmake.exit: ; preds = %while.cond7.loopexit.i, %while.cond7.preheader.i %8 = load i64, ptr %n, align 8, !tbaa !5 %cmp436 = icmp sgt i64 %8, 0 br i1 %cmp436, label %for.body6, label %segmake.exit.for.cond.cleanup5_crit_edge segmake.exit.for.cond.cleanup5_crit_edge: ; preds = %segmake.exit %.pre = load i64, ptr @seg_t, align 8, !tbaa !5 %.pre41 = add nsw i64 %.pre, -1 br label %for.cond.cleanup5 for.body: ; preds = %entry, %for.body %i.035 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.035 %call.i27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.035, 1 %9 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !61 for.cond.cleanup5: ; preds = %segupdate.exit, %segmake.exit.for.cond.cleanup5_crit_edge %sub16.pre-phi = phi i64 [ %.pre41, %segmake.exit.for.cond.cleanup5_crit_edge ], [ %sub9, %segupdate.exit ] %.lcssa = phi i64 [ %8, %segmake.exit.for.cond.cleanup5_crit_edge ], [ %15, %segupdate.exit ] %call17 = call i64 @segmin(i64 noundef 0, i64 noundef %.lcssa, i64 noundef 0, i64 noundef 0, i64 noundef %sub16.pre-phi) %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %call17) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #33 ret void for.body6: ; preds = %segmake.exit, %segupdate.exit %i2.037 = phi i64 [ %inc14, %segupdate.exit ], [ 0, %segmake.exit ] %arrayidx7 = getelementptr inbounds i64, ptr %vla1, i64 %i2.037 %call.i28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %i2.037 %10 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %sub = add nsw i64 %10, -1 %11 = load i64, ptr @seg_t, align 8, !tbaa !5 %sub9 = add nsw i64 %11, -1 %call = call i64 @segmin(i64 noundef 0, i64 noundef %sub, i64 noundef 0, i64 noundef 0, i64 noundef %sub9) %12 = load i64, ptr %arrayidx7, align 8, !tbaa !5 %add12 = add nsw i64 %12, %call %add.i29 = add i64 %sub, %11 %arrayidx.i30 = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %add.i29 store i64 %add12, ptr %arrayidx.i30, align 8, !tbaa !5 %cmp15.i = icmp sgt i64 %add.i29, 0 br i1 %cmp15.i, label %while.body.i31, label %segupdate.exit while.body.i31: ; preds = %for.body6, %while.body.i31 %c.016.i = phi i64 [ %div14.i, %while.body.i31 ], [ %add.i29, %for.body6 ] %dec.i = add nsw i64 %c.016.i, -1 %div14.i = lshr i64 %dec.i, 1 %add1.i = and i64 %dec.i, -2 %mul.i32 = add nuw i64 %add1.i, 2 %arrayidx2.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %mul.i32 %13 = load i64, ptr %arrayidx2.i, align 16, !tbaa !5 %sub5.i = or i64 %dec.i, 1 %arrayidx6.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %sub5.i %14 = load i64, ptr %arrayidx6.i, align 8, !tbaa !5 %cond.i.i = call i64 @llvm.smax.i64(i64 %13, i64 %14) %arrayidx7.i = getelementptr inbounds [1151151 x i64], ptr @seg, i64 0, i64 %div14.i store i64 %cond.i.i, ptr %arrayidx7.i, align 8, !tbaa !5 %cmp.not.i = icmp ult i64 %dec.i, 2 br i1 %cmp.not.i, label %segupdate.exit, label %while.body.i31, !llvm.loop !60 segupdate.exit: ; preds = %while.body.i31, %for.body6 %inc14 = add nuw nsw i64 %i2.037, 1 %15 = load i64, ptr %n, align 8, !tbaa !5 %cmp4 = icmp slt i64 %inc14, %15 br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !62 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #10 { entry: tail call void @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #27 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #28 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #28 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #29 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #30 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #28 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #28 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #28 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #28 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #28 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #12 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #19 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #20 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #22 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #23 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #24 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #25 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #26 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #27 = { nofree nounwind } attributes #28 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #29 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #30 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #31 = { nounwind allocsize(1) } attributes #32 = { nounwind willreturn memory(read) } attributes #33 = { nounwind } attributes #34 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12} !15 = distinct !{!15, !10, !12, !13} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !18} !22 = !{!7, !7, i64 0} !23 = distinct !{!23, !18} !24 = !{!25, !25, i64 0} !25 = !{!"int", !7, i64 0} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10, !29, !12, !13} !29 = !{!"llvm.loop.peeled.count", i32 1} !30 = distinct !{!30, !10} !31 = distinct !{!31, !10} !32 = !{!33, !33, i64 0} !33 = !{!"any pointer", !7, i64 0} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !10} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10} !42 = distinct !{!42, !10, !12, !13} !43 = distinct !{!43, !10, !13, !12} !44 = !{!45, !6, i64 0} !45 = !{!"", !6, i64 0, !6, i64 8} !46 = !{!47, !25, i64 8} !47 = !{!"node_AVL_set", !6, i64 0, !25, i64 8, !25, i64 12, !7, i64 16} !48 = !{!47, !6, i64 0} !49 = !{!47, !25, i64 12} !50 = distinct !{!50, !10} !51 = !{i32 -1, i32 2} !52 = distinct !{!52, !10} !53 = distinct !{!53, !10} !54 = distinct !{!54, !10} !55 = distinct !{!55, !10} !56 = distinct !{!56, !10} !57 = distinct !{!57, !10} !58 = distinct !{!58, !10} !59 = distinct !{!59, !10} !60 = distinct !{!60, !10} !61 = distinct !{!61, !10} !62 = distinct !{!62, !10}