Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
/* ABC156_B Stuartyg */ #include <stdio.h> #include <string.h> #include <math.h> #include <stdbool.h> int main(void){ int n,base_num; double ans = 0; scanf("%d %d",&n,&base_num); ans = log(n)/log(base_num); printf("%d",(int)ans+1); /*型キャスト*/ return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193093/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193093/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: %n = alloca i32, align 4 %base_num = 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 %base_num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %base_num) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %call1 = call double @log(double noundef %conv) #4 %1 = load i32, ptr %base_num, align 4, !tbaa !5 %conv2 = sitofp i32 %1 to double %call3 = call double @log(double noundef %conv2) #4 %div = fdiv double %call1, %call3 %conv4 = fptosi double %div to i32 %add = add nsw i32 %conv4, 1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %base_num) #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(write) declare double @log(double 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 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(write) "no-trapping-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"}
/* ex3_2 Graku */ #include <stdio.h> #include <math.h> int main(void) { int n, k; //declaration scanf("%d %d", &n, &k); /* write n in k base, and divide n by k. this operation mean remove ones place. */ int count = 0; //initialized do { count++; } while (n /= k); printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193150/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193150/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: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %n.promoted = load i32, ptr %n, align 4, !tbaa !5 br label %do.body do.body: ; preds = %do.body, %entry %div3 = phi i32 [ %n.promoted, %entry ], [ %div, %do.body ] %count.0 = phi i32 [ 0, %entry ], [ %inc, %do.body ] %inc = add nuw nsw i32 %count.0, 1 %div = sdiv i32 %div3, %0 %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %do.end, label %do.body, !llvm.loop !9 do.end: ; preds = %do.body store i32 0, ptr %n, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int n; int r; int cnt = 0; scanf("%d %d", &n, &r); while(n){ cnt++; n /= r; } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193194/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193194/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: %n = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %r) %.pr = load i32, ptr %n, align 4, !tbaa !5 %tobool.not3 = icmp eq i32 %.pr, 0 br i1 %tobool.not3, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %0 = load i32, ptr %r, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %cnt.04 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ] %1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %div, %while.body ] %inc = add nuw nsw i32 %cnt.04, 1 %div = sdiv i32 %1, %0 %tobool.not = icmp eq i32 %div, 0 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 0, ptr %n, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %cnt.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int n, k; int i; scanf("%d %d", &n, &k); for( i = 0; n > 0; i++ ){ n /= k; } printf("%d\n", i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193237/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: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %.pr = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %i.04 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %1 = phi i32 [ %.pr, %for.body.lr.ph ], [ %div, %for.body ] %div = sdiv i32 %1, %0 %inc = add nuw nsw i32 %i.04, 1 %cmp = icmp sgt i32 %div, 0 br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !llvm.loop !9 for.cond.for.end_crit_edge: ; preds = %for.body store i32 %div, ptr %n, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %entry %i.0.lcssa = phi i32 [ %inc, %for.cond.for.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int N, K, i = 1, count = 0; scanf("%d %d", &N, &K); while (i <= N) { i *= K; count++; } printf("%d", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193280/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193280/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: %N = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not4 = icmp slt i32 %0, 1 br i1 %cmp.not4, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %1 = load i32, ptr %K, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %count.06 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ] %i.05 = phi i32 [ 1, %while.body.lr.ph ], [ %mul, %while.body ] %mul = mul nsw i32 %1, %i.05 %inc = add nuw nsw i32 %count.06, 1 %cmp.not = icmp sgt i32 %mul, %0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int main (void) { long long ans=1; long long temp; long long n; int k; scanf("%lld%d", &n, &k); temp = k; while ( temp <= n ) { temp *= k; ans++; } printf("%lld\n", ans); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193323/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"%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: %n = alloca i64, align 8 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %1 = load i64, ptr %n, align 8, !tbaa !9 %cmp.not6 = icmp slt i64 %1, %conv br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %temp.08 = phi i64 [ %mul, %while.body ], [ %conv, %entry ] %ans.07 = phi i64 [ %inc, %while.body ], [ 1, %entry ] %mul = mul nsw i64 %temp.08, %conv %inc = add nuw nsw i64 %ans.07, 1 %cmp.not = icmp sgt i64 %mul, %1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %inc, %while.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ double N,K; scanf("%lf %lf",&N,&K); int cnt=0; if(N < K){ printf("1"); }else{ while(N >= 1){ cnt++; N /= K; } printf("%d",cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193367/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193367/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"%lf %lf\00", align 1 @.str.2 = 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 double, align 8 %K = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load double, ptr %N, align 8, !tbaa !5 %1 = load double, ptr %K, align 8, !tbaa !5 %cmp = fcmp olt double %0, %1 br i1 %cmp, label %if.then, label %while.cond.preheader while.cond.preheader: ; preds = %entry %cmp25 = fcmp ult double %0, 1.000000e+00 br i1 %cmp25, label %while.end, label %while.body if.then: ; preds = %entry %putchar = call i32 @putchar(i32 49) br label %if.end while.body: ; preds = %while.cond.preheader, %while.body %cnt.06 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ] %2 = phi double [ %div, %while.body ], [ %0, %while.cond.preheader ] %inc = add nuw nsw i32 %cnt.06, 1 %div = fdiv double %2, %1 %cmp2 = fcmp ult double %div, 1.000000e+00 br i1 %cmp2, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store double %div, ptr %N, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %cnt.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) br label %if.end if.end: ; preds = %while.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #4 call void @llvm.lifetime.end.p0(i64 8, 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: 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 = !{!"double", !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() { int i,j,n; scanf("%d",&n); int ans[n]; int count=0; int arr[n][n]; for(i=0;i<n;i++) { ans[i]=1; for(j=0;j<n;j++) { scanf("%d",&arr[i][j]); if(arr[i][j]==1) { ans[i]=0; } else if(arr[i][j]==2) { ans[j]=0; } else if(arr[i][j]==3) { ans[i]=0; ans[j]=0; } } } for(i=0;i<n;i++) { if(ans[i]==1) count++; } //count=count-c1-c2-c3; //count=count-(c1+c2+c3)/2; printf("%d\n",count); for(i=0;i<n;i++) { if(ans[i]==1) { count--; if(count>0) printf("%d ",i+1); else printf("%d\n",i+1); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19341/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 @.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: %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 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %5 = mul nuw i64 %4, %4 %vla1 = alloca i32, i64 %5, align 16 %cmp100 = icmp sgt i32 %3, 0 br i1 %cmp100, label %for.body, label %for.end52 for.cond41.preheader: ; preds = %for.inc38 %cmp42102 = icmp sgt i32 %21, 0 br i1 %cmp42102, label %for.body43.preheader, label %for.end52 for.body43.preheader: ; preds = %for.cond41.preheader %wide.trip.count121 = zext i32 %21 to i64 %min.iters.check = icmp ult i32 %21, 8 br i1 %min.iters.check, label %for.body43.preheader137, label %vector.ph vector.ph: ; preds = %for.body43.preheader %n.vec = and i64 %wide.trip.count121, 4294967288 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 ], [ %12, %vector.body ] %vec.phi135 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %6 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load136 = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %9 = icmp eq <4 x i32> %wide.load136, <i32 1, i32 1, i32 1, i32 1> %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi135, %11 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count121 br i1 %cmp.n, label %for.end52, label %for.body43.preheader137 for.body43.preheader137: ; preds = %for.body43.preheader, %middle.block %indvars.iv118.ph = phi i64 [ 0, %for.body43.preheader ], [ %n.vec, %middle.block ] %count.0103.ph = phi i32 [ 0, %for.body43.preheader ], [ %15, %middle.block ] br label %for.body43 for.body: ; preds = %entry, %for.inc38 %16 = phi i32 [ %21, %for.inc38 ], [ %3, %entry ] %indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.inc38 ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv115 store i32 1, ptr %arrayidx, align 4, !tbaa !5 %cmp398 = icmp sgt i32 %16, 0 br i1 %cmp398, label %for.body4.lr.ph, label %for.body.for.inc38_crit_edge for.body.for.inc38_crit_edge: ; preds = %for.body %.pre = sext i32 %16 to i64 br label %for.inc38 for.body4.lr.ph: ; preds = %for.body %17 = mul nuw nsw i64 %indvars.iv115, %4 %arrayidx6 = getelementptr inbounds i32, ptr %vla1, i64 %17 br label %for.body4 for.body4: ; preds = %for.body4.lr.ph, %for.inc %indvars.iv112 = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next113, %for.inc ] %arrayidx8 = getelementptr inbounds i32, ptr %arrayidx6, i64 %indvars.iv112 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8) %18 = load i32, ptr %arrayidx8, align 4, !tbaa !5 switch i32 %18, label %for.inc [ i32 1, label %for.inc.sink.split i32 2, label %if.then22 i32 3, label %if.then31 ] if.then22: ; preds = %for.body4 %arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv112 br label %for.inc.sink.split if.then31: ; preds = %for.body4 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv112 br label %for.inc.sink.split for.inc.sink.split: ; preds = %for.body4, %if.then22, %if.then31 %arrayidx.sink = phi ptr [ %arrayidx35, %if.then31 ], [ %arrayidx24, %if.then22 ], [ %arrayidx, %for.body4 ] store i32 0, ptr %arrayidx.sink, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %for.body4 %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp3 = icmp slt i64 %indvars.iv.next113, %20 br i1 %cmp3, label %for.body4, label %for.inc38, !llvm.loop !13 for.inc38: ; preds = %for.inc, %for.body.for.inc38_crit_edge %.pre-phi = phi i64 [ %.pre, %for.body.for.inc38_crit_edge ], [ %20, %for.inc ] %21 = phi i32 [ %16, %for.body.for.inc38_crit_edge ], [ %19, %for.inc ] %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1 %cmp = icmp slt i64 %indvars.iv.next116, %.pre-phi br i1 %cmp, label %for.body, label %for.cond41.preheader, !llvm.loop !14 for.body43: ; preds = %for.body43.preheader137, %for.body43 %indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.body43 ], [ %indvars.iv118.ph, %for.body43.preheader137 ] %count.0103 = phi i32 [ %spec.select, %for.body43 ], [ %count.0103.ph, %for.body43.preheader137 ] %arrayidx45 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv118 %22 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %cmp46 = icmp eq i32 %22, 1 %inc48 = zext i1 %cmp46 to i32 %spec.select = add nuw nsw i32 %count.0103, %inc48 %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1 %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121 br i1 %exitcond122.not, label %for.end52, label %for.body43, !llvm.loop !16 for.end52: ; preds = %for.body43, %middle.block, %entry, %for.cond41.preheader %count.0.lcssa = phi i32 [ 0, %for.cond41.preheader ], [ 0, %entry ], [ %15, %middle.block ], [ %spec.select, %for.body43 ] %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp55106 = icmp sgt i32 %23, 0 br i1 %cmp55106, label %for.body56, label %for.end71 for.body56: ; preds = %for.end52, %for.inc69 %indvars.iv123 = phi i64 [ %indvars.iv.next124.pre-phi, %for.inc69 ], [ 0, %for.end52 ] %count.2107 = phi i32 [ %count.3, %for.inc69 ], [ %count.0.lcssa, %for.end52 ] %arrayidx58 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv123 %24 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %cmp59 = icmp eq i32 %24, 1 br i1 %cmp59, label %if.then60, label %for.body56.for.inc69_crit_edge for.body56.for.inc69_crit_edge: ; preds = %for.body56 %.pre128 = add nuw nsw i64 %indvars.iv123, 1 br label %for.inc69 if.then60: ; preds = %for.body56 %dec = add nsw i32 %count.2107, -1 %cmp61 = icmp sgt i32 %count.2107, 1 %25 = add nuw nsw i64 %indvars.iv123, 1 %26 = trunc i64 %25 to i32 br i1 %cmp61, label %if.then62, label %if.else64 if.then62: ; preds = %if.then60 %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) br label %for.inc69 if.else64: ; preds = %if.then60 %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %26) br label %for.inc69 for.inc69: ; preds = %for.body56.for.inc69_crit_edge, %if.else64, %if.then62 %indvars.iv.next124.pre-phi = phi i64 [ %.pre128, %for.body56.for.inc69_crit_edge ], [ %25, %if.else64 ], [ %25, %if.then62 ] %count.3 = phi i32 [ %count.2107, %for.body56.for.inc69_crit_edge ], [ %dec, %if.else64 ], [ %dec, %if.then62 ] %27 = load i32, ptr %n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp55 = icmp slt i64 %indvars.iv.next124.pre-phi, %28 br i1 %cmp55, label %for.body56, label %for.end71, !llvm.loop !17 for.end71: ; preds = %for.inc69, %for.end52 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.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 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, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int n, k; long long pow = 1; int cnt = 0; scanf("%d %d", &n, &k); while(1){ cnt++; pow *= k; if((long long)n < pow){ break; } } printf("%d", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193453/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193453/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: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %1 = load i32, ptr %n, align 4, !tbaa !5 %conv1 = sext i32 %1 to i64 br label %while.cond while.cond: ; preds = %while.cond, %entry %pow.0 = phi i64 [ 1, %entry ], [ %mul, %while.cond ] %cnt.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %inc = add nuw nsw i32 %cnt.0, 1 %mul = mul nsw i64 %pow.0, %conv %cmp = icmp sgt i64 %mul, %conv1 br i1 %cmp, label %while.end, label %while.cond while.end: ; preds = %while.cond %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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"}
#include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a<b || a==b) { int x = 1; printf("%d",x); } if(b<=a && a%b>0) { printf("%d",(a/b)+1); } if(a%b == 0 && a!=b) { printf("%d",a/b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193497/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193497/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) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %or.cond.not = icmp sgt i32 %0, %1 br i1 %or.cond.not, label %if.end, label %if.then if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1) %.pre = load i32, ptr %b, align 4, !tbaa !5 %.pre22 = load i32, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %entry, %if.then %2 = phi i32 [ %0, %entry ], [ %.pre22, %if.then ] %3 = phi i32 [ %1, %entry ], [ %.pre, %if.then ] %cmp3.not = icmp sgt i32 %3, %2 br i1 %cmp3.not, label %if.end7, label %land.lhs.true land.lhs.true: ; preds = %if.end %rem = srem i32 %2, %3 %div = sdiv i32 %2, %3 %cmp4 = icmp sgt i32 %rem, 0 br i1 %cmp4, label %if.then5, label %if.end7 if.then5: ; preds = %land.lhs.true %add = add nsw i32 %div, 1 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %.pre23 = load i32, ptr %a, align 4, !tbaa !5 %.pre24 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end7 if.end7: ; preds = %if.then5, %land.lhs.true, %if.end %4 = phi i32 [ %.pre24, %if.then5 ], [ %3, %land.lhs.true ], [ %3, %if.end ] %5 = phi i32 [ %.pre23, %if.then5 ], [ %2, %land.lhs.true ], [ %2, %if.end ] %rem8 = srem i32 %5, %4 %div13 = sdiv i32 %5, %4 %cmp9 = icmp ne i32 %rem8, 0 %cmp11.not = icmp eq i32 %5, %4 %or.cond21 = or i1 %cmp11.not, %cmp9 br i1 %or.cond21, label %if.end15, label %if.then12 if.then12: ; preds = %if.end7 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div13) br label %if.end15 if.end15: ; preds = %if.then12, %if.end7 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() { long long int n,m,r,t=0; scanf("%lld %lld",&n,&m); while(n>0) { n = n - m; t++; } printf("%d",t); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193554/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193554/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"%lld %lld\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 i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %.pr = load i64, ptr %n, align 8, !tbaa !5 %cmp3 = icmp sgt i64 %.pr, 0 br i1 %cmp3, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %0 = load i64, ptr %m, align 8, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %t.04 = phi i64 [ 0, %while.body.lr.ph ], [ %inc, %while.body ] %1 = phi i64 [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ] %sub = sub nsw i64 %1, %0 %inc = add nuw nsw i64 %t.04, 1 %cmp = icmp sgt i64 %sub, 0 br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i64 %sub, ptr %n, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %t.0.lcssa = phi i64 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %t.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long 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(void){ int h,a,i,count; scanf("%d %d",&h,&a); count=0; while(1){ h=h-a; count+=1; if(h<=0){ break; } } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193598/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193598/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: %h = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %h.promoted = load i32, ptr %h, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %sub3 = phi i32 [ %h.promoted, %entry ], [ %sub, %while.cond ] %count.0 = phi i32 [ 0, %entry ], [ %add, %while.cond ] %sub = sub nsw i32 %sub3, %0 %add = add nuw nsw i32 %count.0, 1 %cmp = icmp slt i32 %sub, 1 br i1 %cmp, label %while.end, label %while.cond while.end: ; preds = %while.cond store i32 %sub, ptr %h, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 H,A,b; scanf("%d%d",&H,&A); b=H/A; if(H%A!=0)b++; printf("%d",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193640/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193640/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: %H = alloca i32, align 4 %A = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A) %0 = load i32, ptr %H, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %cmp.not = icmp ne i32 %rem, 0 %inc = zext i1 %cmp.not to i32 %spec.select = add nsw i32 %div, %inc %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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 H, A, num; scanf("%d%d", &H, &A); for(num = 0; H > 0; num++) { H -= A; } printf("%d", num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193684/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193684/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: %H = alloca i32, align 4 %A = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A) %.pr = load i32, ptr %H, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %A, align 4, !tbaa !5 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %num.04 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %1 = phi i32 [ %.pr, %for.body.lr.ph ], [ %sub, %for.body ] %sub = sub nsw i32 %1, %0 %inc = add nuw nsw i32 %num.04, 1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !llvm.loop !9 for.cond.for.end_crit_edge: ; preds = %for.body store i32 %sub, ptr %H, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %entry %num.0.lcssa = phi i32 [ %inc, %for.cond.for.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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 main() { int h,a,i; scanf("%d %d",&h,&a); while(1){ h-=a; i++; if(h<=0){ break; } } printf("%d\n",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193734/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193734/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: %h = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %h.promoted = load i32, ptr %h, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %sub3 = phi i32 [ %h.promoted, %entry ], [ %sub, %while.cond ] %i.0 = phi i32 [ undef, %entry ], [ %inc, %while.cond ] %sub = sub nsw i32 %sub3, %0 %inc = add nsw i32 %i.0, 1 %cmp = icmp slt i32 %sub, 1 br i1 %cmp, label %while.end, label %while.cond while.end: ; preds = %while.cond store i32 %sub, ptr %h, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 h,a,i; scanf("%d %d",&h,&a); for(i=1;h>0;i++) { h=h-a; } printf("%d",i-1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193778/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193778/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: %h = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) %.pr = load i32, ptr %h, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %.pr, 0 br i1 %cmp4, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %a, align 4, !tbaa !5 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %i.05 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %for.body ] %1 = phi i32 [ %.pr, %for.body.lr.ph ], [ %sub, %for.body ] %sub = sub nsw i32 %1, %0 %inc = add nuw nsw i32 %i.05, 1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !llvm.loop !9 for.cond.for.end_crit_edge: ; preds = %for.body store i32 %sub, ptr %h, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %entry %i.0.lcssa = phi i32 [ %i.05, %for.cond.for.end_crit_edge ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 main(void){ int H,A; scanf("%d%d",&H,&A); int count = 0; while(0 < H){ H = H - A; count += 1; } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193828/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193828/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: %H = alloca i32, align 4 %A = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %A) %.pr = load i32, ptr %H, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %0 = load i32, ptr %A, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %count.04 = phi i32 [ 0, %while.body.lr.ph ], [ %add, %while.body ] %1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ] %sub = sub nsw i32 %1, %0 %add = add nuw nsw i32 %count.04, 1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %sub, ptr %H, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %count.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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 main() { int a,b,i,count=0; scanf("%d%d",&a,&b); for(i=0;;i++) { count++; a=a-b; if(a<0 || a==0) { break; } } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193871/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193871/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: %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 %a.promoted = load i32, ptr %a, align 4, !tbaa !5 br label %for.cond for.cond: ; preds = %for.cond, %entry %sub5 = phi i32 [ %a.promoted, %entry ], [ %sub, %for.cond ] %count.0 = phi i32 [ 0, %entry ], [ %inc, %for.cond ] %inc = add nuw nsw i32 %count.0, 1 %sub = sub nsw i32 %sub5, %0 %cmp = icmp slt i32 %sub, 0 %cmp1 = icmp eq i32 %sub5, %0 %or.cond = or i1 %cmp1, %cmp br i1 %or.cond, label %for.end, label %for.cond for.end: ; preds = %for.cond store i32 %sub, ptr %a, align 4, !tbaa !5 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) 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<math.h> #include <string.h> int main() { int i, j, k; long long int l = 0; int m, g, n, q; long long int f; int h; int a; scanf("%d %d", &h, &a); m = h / a; if (h%a == 0) { } else { m = m + 1; } printf("%d", m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193921/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: %h = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %cmp = icmp ne i32 %rem, 0 %add = zext i1 %cmp to i32 %spec.select = add nsw i32 %div, %add %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 h; int a; int cnt; scanf("%d %d", &h, &a); cnt = h/a; if(h%a!=0){ cnt++; } printf("%d", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_193965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_193965/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: %h = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %cmp.not = icmp ne i32 %rem, 0 %inc = zext i1 %cmp.not to i32 %spec.select = add nsw i32 %div, %inc %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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,i=0; scanf("%d %d",&a,&b); while(a>0) { a=a-b; i++; } printf("%d",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194007/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194007/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) %.pr = load i32, ptr %a, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %0 = load i32, ptr %b, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %i.04 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ] %1 = phi i32 [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ] %sub = sub nsw i32 %1, %0 %inc = add nuw nsw i32 %i.04, 1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %sub, ptr %a, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %i.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) 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 main() { int n,k,m,i,j,l=0; scanf("%d %d",&n,&k); m=((n-1)*(n-2)/2); if(k>m)printf("-1"); else { printf("%d\n",(n-1+m-k)); for(i=1;i<n;i++) { printf("%d %d\n",i,n); } for(i=1;i<n;i++) { for(j=i+1;j<n;j++) { k++; if(l<=(m-k))printf("%d %d\n",i,j); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194094/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194094/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"-1\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = 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: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %sub1 = add nsw i32 %0, -2 %mul = mul nsw i32 %sub, %sub1 %div = sdiv i32 %mul, 2 %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, %div br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end26 if.else: ; preds = %entry %add = sub i32 %sub, %1 %sub4 = add i32 %add, %div %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub4) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp638 = icmp sgt i32 %2, 1 br i1 %cmp638, label %for.body, label %if.end26 for.cond8.preheader: ; preds = %for.body %cmp942 = icmp sgt i32 %4, 1 br i1 %cmp942, label %for.body10, label %if.end26 for.body: ; preds = %if.else, %for.body %3 = phi i32 [ %4, %for.body ], [ %2, %if.else ] %i.039 = phi i32 [ %inc, %for.body ], [ 1, %if.else ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %i.039, i32 noundef %3) %inc = add nuw nsw i32 %i.039, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc, %4 br i1 %cmp6, label %for.body, label %for.cond8.preheader, !llvm.loop !9 for.cond8.loopexit: ; preds = %for.inc20, %for.body10 %5 = phi i32 [ %6, %for.body10 ], [ %10, %for.inc20 ] %cmp9 = icmp slt i32 %add11, %5 br i1 %cmp9, label %for.body10, label %if.end26, !llvm.loop !11 for.body10: ; preds = %for.cond8.preheader, %for.cond8.loopexit %6 = phi i32 [ %5, %for.cond8.loopexit ], [ %4, %for.cond8.preheader ] %i.143 = phi i32 [ %add11, %for.cond8.loopexit ], [ 1, %for.cond8.preheader ] %add11 = add nuw nsw i32 %i.143, 1 %cmp1340 = icmp slt i32 %add11, %6 br i1 %cmp1340, label %for.body14, label %for.cond8.loopexit for.body14: ; preds = %for.body10, %for.inc20 %7 = phi i32 [ %10, %for.inc20 ], [ %6, %for.body10 ] %8 = phi i32 [ %11, %for.inc20 ], [ %6, %for.body10 ] %j.041 = phi i32 [ %inc21, %for.inc20 ], [ %add11, %for.body10 ] %9 = load i32, ptr %k, align 4, !tbaa !5 %inc15 = add nsw i32 %9, 1 store i32 %inc15, ptr %k, align 4, !tbaa !5 %cmp17.not.not = icmp sgt i32 %div, %9 br i1 %cmp17.not.not, label %if.then18, label %for.inc20 if.then18: ; preds = %for.body14 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %i.143, i32 noundef %j.041) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc20 for.inc20: ; preds = %for.body14, %if.then18 %10 = phi i32 [ %7, %for.body14 ], [ %.pre, %if.then18 ] %11 = phi i32 [ %8, %for.body14 ], [ %.pre, %if.then18 ] %inc21 = add nuw nsw i32 %j.041, 1 %cmp13 = icmp slt i32 %inc21, %11 br i1 %cmp13, label %for.body14, label %for.cond8.loopexit, !llvm.loop !12 if.end26: ; preds = %for.cond8.loopexit, %if.else, %for.cond8.preheader, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> int main(void){ int n,min,max,answer; scanf("%d",&n); int w[n],ans[n-1]; for(int i=0;n>i;++i) scanf("%d",&w[i]); for(int t=1;n>t;++t){ min=0;max=0; for(int i=0;n>i;++i){ if(i<=t) min+=w[i]; else max+=w[i]; } ans[t-1]=abs(max-min); } min=ans[0]; for(int i=1;n-1>i;++i) min=min<=ans[i]?min:ans[i]; printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194144/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194144/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: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, 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 %n, align 4, !tbaa !5 %sub = add nsw i32 %3, -1 %4 = zext i32 %sub to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp61 = icmp sgt i32 %3, 0 call void @llvm.assume(i1 %cmp61) br label %for.body for.cond3.preheader: ; preds = %for.body %cmp469 = icmp sgt i32 %22, 1 call void @llvm.assume(i1 %cmp469) %wide.trip.count84 = zext i32 %22 to i64 %invariant.gep = getelementptr i32, ptr %vla1, i64 -1 %min.iters.check = icmp ult i32 %22, 8 %n.vec = and i64 %wide.trip.count84, 2147483640 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count84 br label %for.cond8.preheader.us for.cond8.preheader.us: ; preds = %for.cond3.preheader, %for.cond8.for.cond.cleanup10_crit_edge.us %indvars.iv80 = phi i64 [ 1, %for.cond3.preheader ], [ %indvars.iv.next81, %for.cond8.for.cond.cleanup10_crit_edge.us ] br i1 %min.iters.check, label %for.body11.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond8.preheader.us %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv80, 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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.phi97 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.phi98 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi99 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4> %5 = icmp ugt <4 x i64> %vec.ind, %broadcast.splat %6 = icmp ugt <4 x i64> %step.add, %broadcast.splat %7 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load100 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = select <4 x i1> %5, <4 x i32> %wide.load, <4 x i32> zeroinitializer %10 = select <4 x i1> %6, <4 x i32> %wide.load100, <4 x i32> zeroinitializer %11 = add <4 x i32> %vec.phi98, %9 %12 = add <4 x i32> %vec.phi99, %10 %13 = select <4 x i1> %5, <4 x i32> zeroinitializer, <4 x i32> %wide.load %14 = select <4 x i1> %6, <4 x i32> zeroinitializer, <4 x i32> %wide.load100 %15 = add <4 x i32> %vec.phi, %13 %16 = add <4 x i32> %vec.phi97, %14 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx101 = add <4 x i32> %12, %11 %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx101) %bin.rdx = add <4 x i32> %16, %15 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond8.for.cond.cleanup10_crit_edge.us, label %for.body11.us.preheader for.body11.us.preheader: ; preds = %for.cond8.preheader.us, %middle.block %indvars.iv77.ph = phi i64 [ 0, %for.cond8.preheader.us ], [ %n.vec, %middle.block ] %min.065.us.ph = phi i32 [ 0, %for.cond8.preheader.us ], [ %19, %middle.block ] %max.064.us.ph = phi i32 [ 0, %for.cond8.preheader.us ], [ %18, %middle.block ] br label %for.body11.us for.body11.us: ; preds = %for.body11.us.preheader, %for.body11.us %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body11.us ], [ %indvars.iv77.ph, %for.body11.us.preheader ] %min.065.us = phi i32 [ %min.1.us, %for.body11.us ], [ %min.065.us.ph, %for.body11.us.preheader ] %max.064.us = phi i32 [ %max.1.us, %for.body11.us ], [ %max.064.us.ph, %for.body11.us.preheader ] %cmp12.not.us = icmp ugt i64 %indvars.iv77, %indvars.iv80 %arrayidx16.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77 %20 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %add17.us = select i1 %cmp12.not.us, i32 %20, i32 0 %max.1.us = add nsw i32 %max.064.us, %add17.us %add.us = select i1 %cmp12.not.us, i32 0, i32 %20 %min.1.us = add nsw i32 %min.065.us, %add.us %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count84 br i1 %exitcond.not, label %for.cond8.for.cond.cleanup10_crit_edge.us, label %for.body11.us, !llvm.loop !13 for.cond8.for.cond.cleanup10_crit_edge.us: ; preds = %for.body11.us, %middle.block %max.1.us.lcssa = phi i32 [ %18, %middle.block ], [ %max.1.us, %for.body11.us ] %min.1.us.lcssa = phi i32 [ %19, %middle.block ], [ %min.1.us, %for.body11.us ] %sub21.us = sub nsw i32 %max.1.us.lcssa, %min.1.us.lcssa %21 = call i32 @llvm.abs.i32(i32 %sub21.us, i1 true) %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv80 store i32 %21, ptr %gep, align 4, !tbaa !5 %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %exitcond85.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count84 br i1 %exitcond85.not, label %for.cond.cleanup5, label %for.cond8.preheader.us, !llvm.loop !14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = trunc i64 %indvars.iv.next to i32 %cmp = icmp sgt i32 %22, %23 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !15 for.cond.cleanup5: ; preds = %for.cond8.for.cond.cleanup10_crit_edge.us %.pre = load i32, ptr %vla1, align 16, !tbaa !5 %cmp3271 = icmp ugt i32 %22, 2 br i1 %cmp3271, label %for.body34.preheader, label %for.cond.cleanup33 for.body34.preheader: ; preds = %for.cond.cleanup5 %sub31 = add nsw i32 %22, -1 %wide.trip.count89 = zext i32 %sub31 to i64 %24 = add nsw i64 %wide.trip.count89, -1 %min.iters.check105 = icmp ult i64 %24, 8 br i1 %min.iters.check105, label %for.body34.preheader119, label %vector.ph106 vector.ph106: ; preds = %for.body34.preheader %n.vec108 = and i64 %24, -8 %ind.end = or i64 %n.vec108, 1 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body111 vector.body111: ; preds = %vector.body111, %vector.ph106 %index112 = phi i64 [ 0, %vector.ph106 ], [ %index.next117, %vector.body111 ] %vec.phi113 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph106 ], [ %27, %vector.body111 ] %vec.phi114 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph106 ], [ %28, %vector.body111 ] %offset.idx = or i64 %index112, 1 %25 = getelementptr inbounds i32, ptr %vla1, i64 %offset.idx %wide.load115 = load <4 x i32>, ptr %25, align 4, !tbaa !5 %26 = getelementptr inbounds i32, ptr %25, i64 4 %wide.load116 = load <4 x i32>, ptr %26, align 4, !tbaa !5 %27 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi113, <4 x i32> %wide.load115) %28 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi114, <4 x i32> %wide.load116) %index.next117 = add nuw i64 %index112, 8 %29 = icmp eq i64 %index.next117, %n.vec108 br i1 %29, label %middle.block103, label %vector.body111, !llvm.loop !16 middle.block103: ; preds = %vector.body111 %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %27, <4 x i32> %28) %30 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n110 = icmp eq i64 %24, %n.vec108 br i1 %cmp.n110, label %for.cond.cleanup33, label %for.body34.preheader119 for.body34.preheader119: ; preds = %for.body34.preheader, %middle.block103 %indvars.iv86.ph = phi i64 [ 1, %for.body34.preheader ], [ %ind.end, %middle.block103 ] %min.272.ph = phi i32 [ %.pre, %for.body34.preheader ], [ %30, %middle.block103 ] br label %for.body34 for.cond.cleanup33: ; preds = %for.body34, %middle.block103, %for.cond.cleanup5 %min.2.lcssa = phi i32 [ %.pre, %for.cond.cleanup5 ], [ %30, %middle.block103 ], [ %.min.2, %for.body34 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %min.2.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 for.body34: ; preds = %for.body34.preheader119, %for.body34 %indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.body34 ], [ %indvars.iv86.ph, %for.body34.preheader119 ] %min.272 = phi i32 [ %.min.2, %for.body34 ], [ %min.272.ph, %for.body34.preheader119 ] %arrayidx36 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv86 %31 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %.min.2 = call i32 @llvm.smin.i32(i32 %min.272, i32 %31) %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89 br i1 %exitcond90.not, label %for.cond.cleanup33, label %for.body34, !llvm.loop !17 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #4 ; 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) #5 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.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 nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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, !11, !12} !17 = distinct !{!17, !10, !12, !11}
#include<stdio.h> int main(void) { int n,sa1,sa2; int w[101]; int s1=0,s2=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&w[i]); s2+=w[i]; } for(int i=0;i<n;i++){ if(s1<s2){ sa1=s2-s1; s1+=w[i]; s2-=w[i]; }else{ sa2=s1-s2; break; } } printf("%d",(sa1<sa2)?sa1:sa2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194201/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194201/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: %n = alloca i32, align 4 %w = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 404, 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 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %for.body, label %cleanup for.cond5.preheader: ; preds = %for.body %cmp651 = icmp sgt i32 %2, 0 br i1 %cmp651, label %for.body8.preheader, label %cleanup for.body8.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %2 to i64 %cmp974 = icmp sgt i32 %add, 0 br i1 %cmp974, label %if.then, label %if.else for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %s2.048 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr %w, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %s2.048 %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.cond5.preheader, !llvm.loop !9 for.body8: ; preds = %if.then %arrayidx11 = getelementptr inbounds [101 x i32], ptr %w, i64 0, i64 %indvars.iv6275 %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %add12 = add nsw i32 %4, %s1.05377 %sub15 = sub nsw i32 %s2.15476, %4 %cmp9 = icmp slt i32 %add12, %sub15 br i1 %cmp9, label %if.then, label %if.else.loopexit, !llvm.loop !11 if.then: ; preds = %for.body8.preheader, %for.body8 %s1.05377 = phi i32 [ %add12, %for.body8 ], [ 0, %for.body8.preheader ] %s2.15476 = phi i32 [ %sub15, %for.body8 ], [ %add, %for.body8.preheader ] %indvars.iv6275 = phi i64 [ %indvars.iv.next63, %for.body8 ], [ 0, %for.body8.preheader ] %indvars.iv.next63 = add nuw nsw i64 %indvars.iv6275, 1 %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count br i1 %exitcond.not, label %cleanup.loopexit, label %for.body8, !llvm.loop !11 if.else.loopexit: ; preds = %for.body8 %sub.le = sub nsw i32 %s2.15476, %s1.05377 br label %if.else if.else: ; preds = %if.else.loopexit, %for.body8.preheader %s2.154.lcssa = phi i32 [ %add, %for.body8.preheader ], [ %sub15, %if.else.loopexit ] %s1.053.lcssa = phi i32 [ 0, %for.body8.preheader ], [ %add12, %if.else.loopexit ] %sa1.052.lcssa = phi i32 [ undef, %for.body8.preheader ], [ %sub.le, %if.else.loopexit ] %sub16 = sub nsw i32 %s1.053.lcssa, %s2.154.lcssa br label %cleanup cleanup.loopexit: ; preds = %if.then %sub.le82 = sub nsw i32 %s2.15476, %s1.05377 br label %cleanup cleanup: ; preds = %cleanup.loopexit, %entry, %for.cond5.preheader, %if.else %sa1.046 = phi i32 [ %sa1.052.lcssa, %if.else ], [ undef, %for.cond5.preheader ], [ undef, %entry ], [ %sub.le82, %cleanup.loopexit ] %sa2.0 = phi i32 [ %sub16, %if.else ], [ undef, %for.cond5.preheader ], [ undef, %entry ], [ undef, %cleanup.loopexit ] %cond = call i32 @llvm.smin.i32(i32 %sa1.046, i32 %sa2.0) %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 404, 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: 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) #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 n, w[100]; int i, min = 100, t, s1, s2, add, mint; scanf("%d", &n); for(i=0; i<n; i++) scanf("%d", &w[i]); for(t=0; t<n-1; t++){ s1 = 0; s2 = 0; for(i=0; i<=t; i++){ s1 += w[i]; } for(i=t+1; i<n; i++){ s2 += w[i]; } add = s1 - s2; if(add < 0) add *= -1; if(min > add){ min = add; mint = t; } } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194245/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194245/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 %w = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, 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 %cmp51 = icmp sgt i32 %0, 0 br i1 %cmp51, label %for.body, label %for.end31 for.cond2.preheader: ; preds = %for.body %cmp359 = icmp sgt i32 %2, 1 br i1 %cmp359, label %for.cond5.preheader.preheader, label %for.end31 for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %wide.trip.count75 = zext i32 %2 to i64 %1 = add i32 %2, -2 br label %for.cond5.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 %w, 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 %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.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.end23 %indvar = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %indvar.next, %for.end23 ] %indvars.iv70 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next71, %for.end23 ] %t.061 = phi i32 [ 0, %for.cond5.preheader.preheader ], [ %add14, %for.end23 ] %min.060 = phi i32 [ 100, %for.cond5.preheader.preheader ], [ %min.1, %for.end23 ] %4 = xor i64 %indvar, -1 %5 = add i64 %4, %wide.trip.count75 %min.iters.check85 = icmp ult i64 %indvars.iv70, 8 br i1 %min.iters.check85, label %for.body7.preheader, label %vector.ph86 vector.ph86: ; preds = %for.cond5.preheader %n.vec88 = and i64 %indvars.iv70, 9223372036854775800 br label %vector.body91 vector.body91: ; preds = %vector.body91, %vector.ph86 %index92 = phi i64 [ 0, %vector.ph86 ], [ %index.next97, %vector.body91 ] %vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph86 ], [ %8, %vector.body91 ] %vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph86 ], [ %9, %vector.body91 ] %6 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %index92 %wide.load95 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load96 = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = add <4 x i32> %wide.load95, %vec.phi93 %9 = add <4 x i32> %wide.load96, %vec.phi94 %index.next97 = add nuw i64 %index92, 8 %10 = icmp eq i64 %index.next97, %n.vec88 br i1 %10, label %middle.block83, label %vector.body91, !llvm.loop !11 middle.block83: ; preds = %vector.body91 %bin.rdx98 = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx98) %cmp.n90 = icmp eq i64 %indvars.iv70, %n.vec88 br i1 %cmp.n90, label %for.end13, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond5.preheader, %middle.block83 %indvars.iv65.ph = phi i64 [ 0, %for.cond5.preheader ], [ %n.vec88, %middle.block83 ] %s1.053.ph = phi i32 [ 0, %for.cond5.preheader ], [ %11, %middle.block83 ] br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body7 ], [ %indvars.iv65.ph, %for.body7.preheader ] %s1.053 = phi i32 [ %add10, %for.body7 ], [ %s1.053.ph, %for.body7.preheader ] %arrayidx9 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %indvars.iv65 %12 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add10 = add nsw i32 %12, %s1.053 %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %exitcond.not = icmp eq i64 %indvars.iv.next66, %indvars.iv70 br i1 %exitcond.not, label %for.end13, label %for.body7, !llvm.loop !14 for.end13: ; preds = %for.body7, %middle.block83 %add10.lcssa = phi i32 [ %11, %middle.block83 ], [ %add10, %for.body7 ] %add14 = add nuw nsw i32 %t.061, 1 %cmp1655 = icmp slt i32 %add14, %2 br i1 %cmp1655, label %for.body17.preheader, label %for.end23 for.body17.preheader: ; preds = %for.end13 %min.iters.check = icmp ult i64 %5, 8 br i1 %min.iters.check, label %for.body17.preheader100, label %vector.ph vector.ph: ; preds = %for.body17.preheader %n.vec = and i64 %5, -8 %ind.end = add i64 %indvars.iv70, %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.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %offset.idx = add i64 %indvars.iv70, %index %13 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %13, align 4, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load82 = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = add <4 x i32> %wide.load, %vec.phi %16 = add <4 x i32> %wide.load82, %vec.phi81 %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 !15 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.end23, label %for.body17.preheader100 for.body17.preheader100: ; preds = %for.body17.preheader, %middle.block %indvars.iv72.ph = phi i64 [ %indvars.iv70, %for.body17.preheader ], [ %ind.end, %middle.block ] %s2.056.ph = phi i32 [ 0, %for.body17.preheader ], [ %18, %middle.block ] br label %for.body17 for.body17: ; preds = %for.body17.preheader100, %for.body17 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body17 ], [ %indvars.iv72.ph, %for.body17.preheader100 ] %s2.056 = phi i32 [ %add20, %for.body17 ], [ %s2.056.ph, %for.body17.preheader100 ] %arrayidx19 = getelementptr inbounds [100 x i32], ptr %w, i64 0, i64 %indvars.iv72 %19 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %add20 = add nsw i32 %19, %s2.056 %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75 br i1 %exitcond76.not, label %for.end23, label %for.body17, !llvm.loop !16 for.end23: ; preds = %for.body17, %middle.block, %for.end13 %s2.0.lcssa = phi i32 [ 0, %for.end13 ], [ %18, %middle.block ], [ %add20, %for.body17 ] %sub24 = sub nsw i32 %add10.lcssa, %s2.0.lcssa %spec.select = call i32 @llvm.abs.i32(i32 %sub24, i1 true) %min.1 = call i32 @llvm.smin.i32(i32 %min.060, i32 %spec.select) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %exitcond78.not = icmp eq i32 %t.061, %1 %indvar.next = add i64 %indvar, 1 br i1 %exitcond78.not, label %for.end31, label %for.cond5.preheader, !llvm.loop !17 for.end31: ; preds = %for.end23, %entry, %for.cond2.preheader %min.0.lcssa = phi i32 [ 100, %for.cond2.preheader ], [ 100, %entry ], [ %min.1, %for.end23 ] %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, 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.abs.i32(i32, i1 immarg) #3 ; 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 = 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, !10}
#include <stdio.h> int main (void) { int n,t[100],i,j,k[100],s1[100],s2[100],x; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&t[i]); } for(i=0;i<n-1;i++) { s1[i] = 0; s2[i] = 0; for(j=0;j<i+1;j++) { s1[i] += t[j]; } for(j=i+1;j<n;j++) { s2[i] += t[j]; } if(s1[i]<s2[i]){ k[i] = s2[i] - s1[i];} else { k[i] = s1[i] - s2[i];} } /*kはn-1個ある*/ for(i=0;i<n-2;i++) { for(j=i+1;j<n-1;j++) { if(k[i]<k[j]) { x = k[i]; k[i] = k[j]; k[j] = x; } } } printf("%d",k[n-2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194296/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194296/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: %n = alloca i32, align 4 %t = alloca [100 x i32], align 16 %k = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp126 = icmp sgt i32 %0, 0 br i1 %cmp126, label %for.body, label %for.cond54.preheader.thread for.cond2.preheader: ; preds = %for.body %sub = add i32 %2, -1 %cmp3132 = icmp sgt i32 %2, 1 br i1 %cmp3132, label %for.body4.preheader, label %for.cond54.preheader.thread for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count159 = zext i32 %sub to i64 %wide.trip.count152 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %t, 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 %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.cond2.preheader, !llvm.loop !9 for.cond54.preheader.thread: ; preds = %for.cond2.preheader, %entry %.lcssa175.ph = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ] %sub55179 = add i32 %.lcssa175.ph, -2 br label %for.end83 for.cond54.preheader: ; preds = %for.end31 %sub55 = add i32 %2, -2 %cmp56137 = icmp sgt i32 %2, 2 br i1 %cmp56137, label %for.body57.preheader, label %for.end83 for.body57.preheader: ; preds = %for.cond54.preheader %4 = zext i32 %sub to i64 %wide.trip.count170 = zext i32 %sub55 to i64 %wide.trip.count = zext i32 %sub to i64 br label %for.body57 for.body4: ; preds = %for.body4.preheader, %for.end31 %indvars.iv154 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next155, %for.end31 ] %indvars.iv147 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next148, %for.end31 ] %5 = xor i64 %indvars.iv154, -1 %6 = add nsw i64 %5, %wide.trip.count152 %min.iters.check186 = icmp ult i64 %indvars.iv147, 8 br i1 %min.iters.check186, label %for.body11.preheader, label %vector.ph187 vector.ph187: ; preds = %for.body4 %n.vec189 = and i64 %indvars.iv147, 9223372036854775800 br label %vector.body192 vector.body192: ; preds = %vector.body192, %vector.ph187 %index193 = phi i64 [ 0, %vector.ph187 ], [ %index.next198, %vector.body192 ] %vec.phi194 = phi <4 x i32> [ zeroinitializer, %vector.ph187 ], [ %9, %vector.body192 ] %vec.phi195 = phi <4 x i32> [ zeroinitializer, %vector.ph187 ], [ %10, %vector.body192 ] %7 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %index193 %wide.load196 = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load197 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = add <4 x i32> %vec.phi194, %wide.load196 %10 = add <4 x i32> %vec.phi195, %wide.load197 %index.next198 = add nuw i64 %index193, 8 %11 = icmp eq i64 %index.next198, %n.vec189 br i1 %11, label %middle.block184, label %vector.body192, !llvm.loop !11 middle.block184: ; preds = %vector.body192 %bin.rdx199 = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx199) %cmp.n191 = icmp eq i64 %indvars.iv147, %n.vec189 br i1 %cmp.n191, label %for.cond21.preheader, label %for.body11.preheader for.body11.preheader: ; preds = %for.body4, %middle.block184 %indvars.iv142.ph = phi i64 [ 0, %for.body4 ], [ %n.vec189, %middle.block184 ] %.ph202 = phi i32 [ 0, %for.body4 ], [ %12, %middle.block184 ] br label %for.body11 for.cond21.preheader: ; preds = %for.body11, %middle.block184 %add16.lcssa = phi i32 [ %12, %middle.block184 ], [ %add16, %for.body11 ] %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %cmp22130 = icmp ult i64 %indvars.iv.next155, %1 br i1 %cmp22130, label %for.body23.preheader, label %for.end31 for.body23.preheader: ; preds = %for.cond21.preheader %min.iters.check = icmp ult i64 %6, 8 br i1 %min.iters.check, label %for.body23.preheader201, label %vector.ph vector.ph: ; preds = %for.body23.preheader %n.vec = and i64 %6, -8 %ind.end = add i64 %indvars.iv147, %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.phi182 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %offset.idx = add i64 %indvars.iv147, %index %13 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %13, align 4, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load183 = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = add <4 x i32> %vec.phi, %wide.load %16 = add <4 x i32> %vec.phi182, %wide.load183 %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 !14 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 %6, %n.vec br i1 %cmp.n, label %for.end31, label %for.body23.preheader201 for.body23.preheader201: ; preds = %for.body23.preheader, %middle.block %indvars.iv149.ph = phi i64 [ %indvars.iv147, %for.body23.preheader ], [ %ind.end, %middle.block ] %.ph = phi i32 [ 0, %for.body23.preheader ], [ %18, %middle.block ] br label %for.body23 for.body11: ; preds = %for.body11.preheader, %for.body11 %indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.body11 ], [ %indvars.iv142.ph, %for.body11.preheader ] %19 = phi i32 [ %add16, %for.body11 ], [ %.ph202, %for.body11.preheader ] %arrayidx13 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %indvars.iv142 %20 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %add16 = add nsw i32 %19, %20 %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %exitcond.not = icmp eq i64 %indvars.iv.next143, %indvars.iv147 br i1 %exitcond.not, label %for.cond21.preheader, label %for.body11, !llvm.loop !15 for.body23: ; preds = %for.body23.preheader201, %for.body23 %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body23 ], [ %indvars.iv149.ph, %for.body23.preheader201 ] %21 = phi i32 [ %add28, %for.body23 ], [ %.ph, %for.body23.preheader201 ] %arrayidx25 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %indvars.iv149 %22 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %add28 = add nsw i32 %21, %22 %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count152 br i1 %exitcond153.not, label %for.end31, label %for.body23, !llvm.loop !16 for.end31: ; preds = %for.body23, %middle.block, %for.cond21.preheader %23 = phi i32 [ 0, %for.cond21.preheader ], [ %18, %middle.block ], [ %add28, %for.body23 ] %sub48 = sub nsw i32 %add16.lcssa, %23 %sub48.sink = call i32 @llvm.abs.i32(i32 %sub48, i1 true) %24 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %indvars.iv154 store i32 %sub48.sink, ptr %24, align 4 %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond160.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count159 br i1 %exitcond160.not, label %for.cond54.preheader, label %for.body4, !llvm.loop !17 for.cond54.loopexit: ; preds = %for.inc78, %for.body57 %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %exitcond171.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count170 br i1 %exitcond171.not, label %for.end83, label %for.body57, !llvm.loop !18 for.body57: ; preds = %for.body57.preheader, %for.cond54.loopexit %indvars.iv167 = phi i64 [ 0, %for.body57.preheader ], [ %indvars.iv.next168, %for.cond54.loopexit ] %indvars.iv161 = phi i64 [ 1, %for.body57.preheader ], [ %indvars.iv.next162, %for.cond54.loopexit ] %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1 %cmp61135 = icmp ult i64 %indvars.iv.next168, %4 br i1 %cmp61135, label %for.body62.lr.ph, label %for.cond54.loopexit for.body62.lr.ph: ; preds = %for.body57 %arrayidx64 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %indvars.iv167 br label %for.body62 for.body62: ; preds = %for.body62.lr.ph, %for.inc78 %indvars.iv163 = phi i64 [ %indvars.iv161, %for.body62.lr.ph ], [ %indvars.iv.next164, %for.inc78 ] %25 = load i32, ptr %arrayidx64, align 4, !tbaa !5 %arrayidx66 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %indvars.iv163 %26 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %cmp67 = icmp slt i32 %25, %26 br i1 %cmp67, label %if.then68, label %for.inc78 if.then68: ; preds = %for.body62 store i32 %26, ptr %arrayidx64, align 4, !tbaa !5 store i32 %25, ptr %arrayidx66, align 4, !tbaa !5 br label %for.inc78 for.inc78: ; preds = %for.body62, %if.then68 %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond166.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count br i1 %exitcond166.not, label %for.cond54.loopexit, label %for.body62, !llvm.loop !19 for.end83: ; preds = %for.cond54.loopexit, %for.cond54.preheader.thread, %for.cond54.preheader %sub55181 = phi i32 [ %sub55179, %for.cond54.preheader.thread ], [ %sub55, %for.cond54.preheader ], [ %sub55, %for.cond54.loopexit ] %idxprom85 = sext i32 %sub55181 to i64 %arrayidx86 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %idxprom85 %27 = load i32, ptr %arrayidx86, align 4, !tbaa !5 %call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %27) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %t) #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.abs.i32(i32, i1 immarg) #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 = 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, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include<stdio.h> int main(void){ int n,i,j,k; scanf("%d",&n); int w[n]; for(i=0;i<n;i++){ scanf("%d",&w[i]); } int s1,s2,min; s1=0; s2=0; min=1000000000; for(i=0;i<n;i++){ for(j=0;j<i;j++){ s1+=w[j]; } for(j=i;j<n;j++){ s2+=w[j]; } if(s1>=s2&&min>s1-s2){ min=s1-s2; } if(s1<s2&&min>s2-s1){ min=s2-s1; } //printf("%d",s1,s2); s1=0; s2=0; } printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194339/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194339/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: %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 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp62 = icmp sgt i32 %3, 0 br i1 %cmp62, label %for.body, label %for.end34 for.cond2.preheader: ; preds = %for.body %cmp372 = icmp sgt i32 %4, 0 br i1 %cmp372, label %for.cond5.preheader.preheader, label %for.end34 for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %wide.trip.count89 = zext i32 %4 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %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 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.end21 %indvars.iv81 = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %indvars.iv.next82, %for.end21 ] %min.074 = phi i32 [ 1000000000, %for.cond5.preheader.preheader ], [ %min.2, %for.end21 ] %6 = sub nsw i64 %wide.trip.count89, %indvars.iv81 %cmp664.not = icmp eq i64 %indvars.iv81, 0 br i1 %cmp664.not, label %for.body15.preheader, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond5.preheader %min.iters.check97 = icmp ult i64 %indvars.iv81, 8 br i1 %min.iters.check97, label %for.body7.preheader113, label %vector.ph98 vector.ph98: ; preds = %for.body7.preheader %n.vec100 = and i64 %indvars.iv81, 9223372036854775800 br label %vector.body103 vector.body103: ; preds = %vector.body103, %vector.ph98 %index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next109, %vector.body103 ] %vec.phi105 = phi <4 x i32> [ zeroinitializer, %vector.ph98 ], [ %9, %vector.body103 ] %vec.phi106 = phi <4 x i32> [ zeroinitializer, %vector.ph98 ], [ %10, %vector.body103 ] %7 = getelementptr inbounds i32, ptr %vla, i64 %index104 %wide.load107 = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load108 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = add <4 x i32> %wide.load107, %vec.phi105 %10 = add <4 x i32> %wide.load108, %vec.phi106 %index.next109 = add nuw i64 %index104, 8 %11 = icmp eq i64 %index.next109, %n.vec100 br i1 %11, label %middle.block95, label %vector.body103, !llvm.loop !11 middle.block95: ; preds = %vector.body103 %bin.rdx110 = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx110) %cmp.n102 = icmp eq i64 %indvars.iv81, %n.vec100 br i1 %cmp.n102, label %for.body15.preheader, label %for.body7.preheader113 for.body7.preheader113: ; preds = %for.body7.preheader, %middle.block95 %indvars.iv78.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec100, %middle.block95 ] %s1.166.ph = phi i32 [ 0, %for.body7.preheader ], [ %12, %middle.block95 ] br label %for.body7 for.body15.preheader: ; preds = %for.body7, %middle.block95, %for.cond5.preheader %s1.1.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %12, %middle.block95 ], [ %add, %for.body7 ] %min.iters.check = icmp ult i64 %6, 8 br i1 %min.iters.check, label %for.body15.preheader112, label %vector.ph vector.ph: ; preds = %for.body15.preheader %n.vec = and i64 %6, -8 %ind.end = add i64 %indvars.iv81, %n.vec %13 = getelementptr i32, ptr %vla, i64 %indvars.iv81 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 ], [ %16, %vector.body ] %vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %14 = getelementptr i32, ptr %13, i64 %index %wide.load = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load94 = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load94, %vec.phi93 %index.next = add nuw i64 %index, 8 %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 <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.end21, label %for.body15.preheader112 for.body15.preheader112: ; preds = %for.body15.preheader, %middle.block %indvars.iv83.ph = phi i64 [ %indvars.iv81, %for.body15.preheader ], [ %ind.end, %middle.block ] %s2.170.ph = phi i32 [ 0, %for.body15.preheader ], [ %19, %middle.block ] br label %for.body15 for.body7: ; preds = %for.body7.preheader113, %for.body7 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body7 ], [ %indvars.iv78.ph, %for.body7.preheader113 ] %s1.166 = phi i32 [ %add, %for.body7 ], [ %s1.166.ph, %for.body7.preheader113 ] %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv78 %20 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add = add nsw i32 %20, %s1.166 %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond.not = icmp eq i64 %indvars.iv.next79, %indvars.iv81 br i1 %exitcond.not, label %for.body15.preheader, label %for.body7, !llvm.loop !15 for.body15: ; preds = %for.body15.preheader112, %for.body15 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body15 ], [ %indvars.iv83.ph, %for.body15.preheader112 ] %s2.170 = phi i32 [ %add18, %for.body15 ], [ %s2.170.ph, %for.body15.preheader112 ] %arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83 %21 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %add18 = add nsw i32 %21, %s2.170 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count89 br i1 %exitcond87.not, label %for.end21, label %for.body15, !llvm.loop !16 for.end21: ; preds = %for.body15, %middle.block %add18.lcssa = phi i32 [ %19, %middle.block ], [ %add18, %for.body15 ] %cmp22.not = icmp slt i32 %s1.1.lcssa, %add18.lcssa %sub = sub nsw i32 %s1.1.lcssa, %add18.lcssa %spec.select = call i32 @llvm.smin.i32(i32 %min.074, i32 %sub) %min.1 = select i1 %cmp22.not, i32 %min.074, i32 %spec.select %sub27 = sub nsw i32 %add18.lcssa, %s1.1.lcssa %spec.select61 = call i32 @llvm.smin.i32(i32 %min.1, i32 %sub27) %min.2 = select i1 %cmp22.not, i32 %spec.select61, i32 %spec.select %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count89 br i1 %exitcond90.not, label %for.end34, label %for.cond5.preheader, !llvm.loop !17 for.end34: ; preds = %for.end21, %entry, %for.cond2.preheader %min.0.lcssa = phi i32 [ 1000000000, %for.cond2.preheader ], [ 1000000000, %entry ], [ %min.2, %for.end21 ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %min.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.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 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, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !10}
#include <stdio.h> #include <limits.h> #define ABS(a) ((a>0) ? a : (-a)) int main(void) { int N; scanf("%d", &N); int W[100]; for(int i = 0; i < N; i++) { scanf("%d", &W[i]); } int minS = 100000; for(int T = 1; T < N; T++) { int lp = 0; int left = 0; int right = 0; while((lp <= T) && (lp < N)) { left += W[lp++]; } while(lp < N) { right += W[lp++]; } //printf("T=%d left=%d right=%d\n", T, left, right); int S = ABS((left - right)); if(minS > S) minS = S; } printf("%d\n", minS); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194382/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194382/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 %W = alloca [100 x i32], align 16 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) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %W) #4 %0 = load i32, ptr %N, align 4 %cmp44 = icmp sgt i32 %0, 0 br i1 %cmp44, label %for.body, label %for.cond.cleanup4 for.cond2.preheader: ; preds = %for.body %cmp355 = icmp sgt i32 %29, 1 br i1 %cmp355, label %while.cond.preheader.us.preheader, label %for.cond.cleanup4 while.cond.preheader.us.preheader: ; preds = %for.cond2.preheader %1 = add i32 %29, -1 %2 = zext i32 %1 to i64 %3 = zext i32 %1 to i64 br label %while.cond.preheader.us while.cond.preheader.us: ; preds = %while.cond.preheader.us.preheader, %while.end18.us %indvar = phi i64 [ 0, %while.cond.preheader.us.preheader ], [ %indvar.next, %while.end18.us ] %T.057.us = phi i32 [ 1, %while.cond.preheader.us.preheader ], [ %inc25.us, %while.end18.us ] %minS.056.us = phi i32 [ 100000, %while.cond.preheader.us.preheader ], [ %minS.1.us, %while.end18.us ] %4 = add i64 %indvar, 1 %umin99 = call i64 @llvm.umin.i64(i64 %4, i64 %3) %5 = add nuw nsw i64 %umin99, 1 %6 = add i64 %indvar, 1 %umin96 = call i64 @llvm.umin.i64(i64 %6, i64 %2) %7 = trunc i64 %umin96 to i32 %8 = add nuw i32 %7, 2 %smax = call i32 @llvm.smax.i32(i32 %29, i32 %8) %9 = add i32 %smax, -2 %10 = sub i32 %9, %7 %11 = zext i32 %10 to i64 %12 = add nuw nsw i64 %11, 1 %umin = call i32 @llvm.umin.i32(i32 %T.057.us, i32 %1) %13 = add nuw nsw i32 %umin, 1 %wide.trip.count = zext i32 %13 to i64 %min.iters.check102 = icmp ult i64 %umin99, 7 br i1 %min.iters.check102, label %while.body.us.preheader, label %vector.ph103 vector.ph103: ; preds = %while.cond.preheader.us %n.vec105 = and i64 %5, 8589934584 %ind.end106 = or i64 %n.vec105, 1 br label %vector.body110 vector.body110: ; preds = %vector.body110, %vector.ph103 %index111 = phi i64 [ 0, %vector.ph103 ], [ %index.next117, %vector.body110 ] %vec.phi112 = phi <4 x i32> [ zeroinitializer, %vector.ph103 ], [ %16, %vector.body110 ] %vec.phi113 = phi <4 x i32> [ zeroinitializer, %vector.ph103 ], [ %17, %vector.body110 ] %14 = getelementptr inbounds [100 x i32], ptr %W, i64 0, i64 %index111 %wide.load115 = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load116 = load <4 x i32>, ptr %15, align 16, !tbaa !5 %16 = add <4 x i32> %wide.load115, %vec.phi112 %17 = add <4 x i32> %wide.load116, %vec.phi113 %index.next117 = add nuw i64 %index111, 8 %18 = icmp eq i64 %index.next117, %n.vec105 br i1 %18, label %middle.block100, label %vector.body110, !llvm.loop !9 middle.block100: ; preds = %vector.body110 %bin.rdx118 = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx118) %cmp.n109 = icmp eq i64 %5, %n.vec105 br i1 %cmp.n109, label %while.cond.while.cond11.preheader_crit_edge.us, label %while.body.us.preheader while.body.us.preheader: ; preds = %while.cond.preheader.us, %middle.block100 %indvars.iv88.ph = phi i64 [ 1, %while.cond.preheader.us ], [ %ind.end106, %middle.block100 ] %indvars.iv85.ph = phi i64 [ 0, %while.cond.preheader.us ], [ %n.vec105, %middle.block100 ] %left.048.us.ph = phi i32 [ 0, %while.cond.preheader.us ], [ %19, %middle.block100 ] br label %while.body.us while.end18.us: ; preds = %while.body13.us, %middle.block, %while.cond.while.cond11.preheader_crit_edge.us %right.0.lcssa.us = phi i32 [ 0, %while.cond.while.cond11.preheader_crit_edge.us ], [ %28, %middle.block ], [ %add17.us, %while.body13.us ] %sub.us = sub nsw i32 %add.us.lcssa, %right.0.lcssa.us %cond.us = call i32 @llvm.abs.i32(i32 %sub.us, i1 true) %minS.1.us = call i32 @llvm.smin.i32(i32 %minS.056.us, i32 %cond.us) %inc25.us = add nuw nsw i32 %T.057.us, 1 %exitcond93.not = icmp eq i32 %inc25.us, %29 %indvar.next = add i64 %indvar, 1 br i1 %exitcond93.not, label %for.cond.cleanup4, label %while.cond.preheader.us, !llvm.loop !13 while.body13.us: ; preds = %while.body13.us.preheader120, %while.body13.us %indvars.iv90 = phi i64 [ %indvars.iv.next91, %while.body13.us ], [ %indvars.iv90.ph, %while.body13.us.preheader120 ] %right.053.us = phi i32 [ %add17.us, %while.body13.us ], [ %right.053.us.ph, %while.body13.us.preheader120 ] %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %arrayidx16.us = getelementptr inbounds [100 x i32], ptr %W, i64 0, i64 %indvars.iv90 %20 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %add17.us = add nsw i32 %20, %right.053.us %21 = trunc i64 %indvars.iv.next91 to i32 %cmp12.us = icmp sgt i32 %29, %21 br i1 %cmp12.us, label %while.body13.us, label %while.end18.us, !llvm.loop !14 while.body.us: ; preds = %while.body.us.preheader, %while.body.us %indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.body.us ], [ %indvars.iv88.ph, %while.body.us.preheader ] %indvars.iv85 = phi i64 [ %indvars.iv.next86, %while.body.us ], [ %indvars.iv85.ph, %while.body.us.preheader ] %left.048.us = phi i32 [ %add.us, %while.body.us ], [ %left.048.us.ph, %while.body.us.preheader ] %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %W, i64 0, i64 %indvars.iv85 %22 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %add.us = add nsw i32 %22, %left.048.us %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 br i1 %exitcond.not, label %while.cond.while.cond11.preheader_crit_edge.us, label %while.body.us, !llvm.loop !15 while.cond.while.cond11.preheader_crit_edge.us: ; preds = %while.body.us, %middle.block100 %indvars.iv88.lcssa = phi i64 [ %n.vec105, %middle.block100 ], [ %indvars.iv88, %while.body.us ] %add.us.lcssa = phi i32 [ %19, %middle.block100 ], [ %add.us, %while.body.us ] %cmp1251.us = icmp slt i32 %13, %29 br i1 %cmp1251.us, label %while.body13.us.preheader, label %while.end18.us while.body13.us.preheader: ; preds = %while.cond.while.cond11.preheader_crit_edge.us %min.iters.check = icmp ult i32 %10, 7 br i1 %min.iters.check, label %while.body13.us.preheader120, label %vector.ph vector.ph: ; preds = %while.body13.us.preheader %n.vec = and i64 %12, 8589934584 %ind.end = add i64 %indvars.iv88.lcssa, %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 ], [ %25, %vector.body ] %vec.phi97 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ] %offset.idx = add i64 %indvars.iv88.lcssa, %index %23 = getelementptr inbounds [100 x i32], ptr %W, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %23, align 4, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 %wide.load98 = load <4 x i32>, ptr %24, align 4, !tbaa !5 %25 = add <4 x i32> %wide.load, %vec.phi %26 = add <4 x i32> %wide.load98, %vec.phi97 %index.next = add nuw i64 %index, 8 %27 = icmp eq i64 %index.next, %n.vec br i1 %27, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %26, %25 %28 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %while.end18.us, label %while.body13.us.preheader120 while.body13.us.preheader120: ; preds = %while.body13.us.preheader, %middle.block %indvars.iv90.ph = phi i64 [ %indvars.iv88.lcssa, %while.body13.us.preheader ], [ %ind.end, %middle.block ] %right.053.us.ph = phi i32 [ 0, %while.body13.us.preheader ], [ %28, %middle.block ] br label %while.body13.us for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %W, 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 %29 = load i32, ptr %N, align 4 %30 = sext i32 %29 to i64 %cmp = icmp slt i64 %indvars.iv.next, %30 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !17 for.cond.cleanup4: ; preds = %while.end18.us, %entry, %for.cond2.preheader %minS.0.lcssa = phi i32 [ 100000, %for.cond2.preheader ], [ 100000, %entry ], [ %minS.1.us, %while.end18.us ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %minS.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, 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: 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.abs.i32(i32, i1 immarg) #3 ; 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.umin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.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 = 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, !12, !11} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10}
#include <stdio.h> #include <stdlib.h> typedef struct graph_edge_sub graph_edge; typedef struct { int num; int next_num; graph_edge *next; int prev_num; }graph_vertex_sub; struct graph_edge_sub{ graph_vertex_sub *v; graph_edge *next; }; typedef struct graph_v_sub graph_vertex; struct graph_v_sub{ int num; int next_num; graph_vertex **next; int prev_num; graph_vertex **prev; }; typedef struct { int N; graph_vertex_sub **v_s; graph_vertex **v; }graph; //頂点数N, 各頂点の初期値ini_valのグラフを作る graph *make_graph(int N){ int i; graph *g = (graph *)malloc(sizeof(graph)); g->N = N; g->v_s = (graph_vertex_sub **)malloc(sizeof(graph_vertex_sub *) * N); g->v = (graph_vertex **)malloc(sizeof(graph_vertex *) * N); for(i = 0; i < N; i++){ (g->v_s)[i] = (graph_vertex_sub *)malloc(sizeof(graph_vertex_sub)); (g->v_s)[i]->num = i; (g->v_s)[i]->next_num = 0; (g->v_s)[i]->next = NULL; (g->v_s)[i]->prev_num = 0; (g->v)[i] = (graph_vertex *)malloc(sizeof(graph_vertex)); (g->v)[i]->num = i; (g->v)[i]->next_num = 0; (g->v)[i]->next = NULL; (g->v)[i]->prev_num = 0; (g->v)[i]->prev = NULL; } return g; } //グラフgの頂点aから頂点bに重みwの有向辺を張る (0 <= a, b <= N - 1) void set_edge_graph(int a, int b, graph *g){ graph_edge *new1 = (graph_edge *)malloc(sizeof(graph_edge)); new1->v = (g->v_s)[b]; new1->next = (g->v_s)[a]->next; (g->v_s)[a]->next = new1; (g->v_s)[a]->next_num++; (g->v_s)[b]->prev_num++; } //set_edge_graph後に呼び出す void build_graph(graph *g){ int i; graph_vertex_sub **v_s = g->v_s; graph_vertex **v = g->v; graph_vertex *nowv; graph_edge *nowe; for(i = 0; i < g->N; i++){ v[i]->next = (graph_vertex **)malloc(sizeof(graph_vertex *) * v_s[i]->next_num); v[i]->prev = (graph_vertex **)malloc(sizeof(graph_vertex *) * v_s[i]->prev_num); } for(i = 0; i < g->N; i++){ nowv = v[i]; for(nowe = v_s[i]->next; nowe != NULL; nowe = nowe->next){ (nowv->next)[nowv->next_num] = v[nowe->v->num]; nowv->next_num++; (v[nowe->v->num]->prev)[v[nowe->v->num]->prev_num] = nowv; v[nowe->v->num]->prev_num++; } } } typedef struct SCC_sub{ int num; //強連結成分番号 int vertex_num; //強連結成分に含まれる頂点の個数 int *vertexs; //強連結成分に含まれる元のグラフでの頂点番号 int next_num; struct SCC_sub **next; int prev_num; // struct SCC_sub **prev; }SCC; //強連結成分(Strongly Connected Components) typedef struct { int N; SCC **sorted_SCC; //topological sort済み }DAG; //非閉路有向グラフ(Directed Acyclic Graph) int dfs(int next_bt, int *used, int *bt, int *bt_inv, graph_vertex *v){ if(used[v->num] == 1){ return next_bt; } else{ int i; used[v->num] = 1; for(i = 0; i < v->next_num; i++){ next_bt = dfs(next_bt, used, bt, bt_inv, v->next[i]); } bt[v->num] = next_bt; bt_inv[next_bt] = v->num; return next_bt + 1; } } void dfs_rev1(int next_SCC_num, int *used, int *SCC_num, int *next_num, int *prev_num, graph_vertex *v){ if(used[v->num] == 1){ int i; used[v->num] = 2; for(i = 0; i < v->prev_num; i++){ dfs_rev1(next_SCC_num, used, SCC_num, next_num, prev_num, v->prev[i]); } SCC_num[v->num] = next_SCC_num; for(i = 0; i < v->next_num; i++){ if(used[v->next[i]->num] == 1){ next_num[v->num]++; prev_num[v->next[i]->num]++; //ここで自己ループを数えてしまう可能性がある } } } } void dfs_rev2(SCC *now_SCC, int *used, int *SCC_num, graph_vertex *v, DAG *dag){ if(used[v->num] == 2){ int i; SCC *next_SCC; used[v->num] = 3; for(i = 0; i < v->prev_num; i++){ dfs_rev2(now_SCC, used, SCC_num, v->prev[i], dag); } now_SCC->vertexs[now_SCC->vertex_num] = v->num; now_SCC->vertex_num++; for(i = 0; i < v->next_num; i++){ if(used[v->next[i]->num] == 2){ next_SCC = dag->sorted_SCC[SCC_num[v->next[i]->num]]; if(now_SCC->num != next_SCC->num){ //自己ループがないようにしている now_SCC->next[now_SCC->next_num] = next_SCC; now_SCC->next_num++; // next_SCC->prev[next_SCC->prev_num] = now_SCC; next_SCC->prev_num++; } } } } } DAG *build_DAG(graph *g){ int N = g->N, i; int *used = (int *)malloc(sizeof(int) * N); int *bt = (int *)malloc(sizeof(int) * N); int *bt_inv = (int *)malloc(sizeof(int) * N); for(i = 0; i < N; i++){ used[i] = 0; bt[i] = -1; bt_inv[i] = -1; } int next_bt; for(i = 0, next_bt = 0; i < N; i++){ next_bt = dfs(next_bt, used, bt, bt_inv, g->v[i]); } int *SCC_num = (int *)malloc(sizeof(int) * N); int *next_num = (int *)malloc(sizeof(int) * N); int *prev_num = (int *)malloc(sizeof(int) * N); for(i = 0; i < N; i++){ SCC_num[i] = 0; next_num[i] = 0; prev_num[i] = 0; } int next_SCC_num; for(i = N - 1, next_SCC_num = 0; i >= 0; i--){ if(used[bt_inv[i]] == 1){ dfs_rev1(next_SCC_num, used, SCC_num, next_num, prev_num, g->v[bt_inv[i]]); next_SCC_num++; } } DAG *dag = (DAG *)malloc(sizeof(DAG)); SCC *now_SCC; dag->N = next_SCC_num; dag->sorted_SCC = (SCC **)malloc(sizeof(SCC *) * dag->N); for(i = 0; i < dag->N; i++){ dag->sorted_SCC[i] = (SCC *)malloc(sizeof(SCC)); now_SCC = dag->sorted_SCC[i]; now_SCC->num = i; now_SCC->vertex_num = 0; now_SCC->vertexs = NULL; now_SCC->next_num = 0; now_SCC->next = NULL; now_SCC->prev_num = 0; // now_SCC->prev = NULL; } for(i = 0; i < N; i++){ now_SCC = dag->sorted_SCC[SCC_num[i]]; now_SCC->vertex_num++; now_SCC->next_num += next_num[i]; now_SCC->prev_num += prev_num[i]; } for(i = 0; i < dag->N; i++){ now_SCC = dag->sorted_SCC[i]; now_SCC->vertexs = (int *)malloc(sizeof(int) * now_SCC->vertex_num); now_SCC->next = (SCC **)malloc(sizeof(SCC *) * now_SCC->next_num); // now_SCC->prev = (SCC **)malloc(sizeof(SCC *) * now_SCC->prev_num); now_SCC->vertex_num = 0; now_SCC->next_num = 0; now_SCC->prev_num = 0; } for(i = N - 1, next_SCC_num = 0; i >= 0; i--){ if(used[bt_inv[i]] == 2){ dfs_rev2(dag->sorted_SCC[next_SCC_num], used, SCC_num, g->v[bt_inv[i]], dag); next_SCC_num++; } } free(used); free(bt); free(bt_inv); free(SCC_num); free(next_num); free(prev_num); return dag; } typedef struct { int i; int v; }pair; typedef struct { int x; int y; }pos; int pos_to_int(int x, int y, int N){ return N * x + y; } pos int_to_pos(int num, int N){ return (pos){num / N, num % N}; } //v降順 signed compair(const void *a, const void *b){ return ((pair *)b)->v - ((pair *)a)->v; } int search(int x, int y, int N, int **nexts_num, int ***nexts, int **visited){ if(visited[x][y] == 2 || visited[x][y] == -1){ return 0; } else if(visited[x][y] == 1){ visited[x][y] = 2; return 1; } else{ visited[x][y] = 1; int i; for(i = 0; i < nexts_num[x][y]; i++){ pos p = int_to_pos(nexts[x][y][i], N); if(search(p.x, p.y, N, nexts_num, nexts, visited) == 1){ if(visited[x][y] == 2){ return 0; } else{ visited[x][y] = 2; return 1; } } } visited[x][y] = -1; return 0; } } void setA(int N, int *L, int *R, int *U, int *D, int **B1, char **A){ int i, j, k; for(i = 0; i < N; i++){ for(j = 0, k = 0; k < L[i]; j++){ if(B1[i][j] == 0){ A[i][j] = 'L'; k++; } } for(j = N - 1, k = 0; k < R[i]; j--){ if(B1[i][j] == 0){ A[i][j] = 'R'; k++; } } } for(j = 0; j < N; j++){ for(i = 0, k = 0; k < U[j]; i++){ if(B1[i][j] == 1){ A[i][j] = 'U'; k++; } } for(i = N - 1, k = 0; k < D[j]; i--){ if(B1[i][j] == 1){ A[i][j] = 'D'; k++; } } } } int main(){ int N, i, j, k; scanf("%d", &N); int *U = (int *)malloc(sizeof(int) * N); int *D = (int *)malloc(sizeof(int) * N); int *L = (int *)malloc(sizeof(int) * N); int *R = (int *)malloc(sizeof(int) * N); for(i = 0; i < N; i++){ scanf("%d", &U[i]); } for(i = 0; i < N; i++){ scanf("%d", &D[i]); } for(i = 0; i < N; i++){ scanf("%d", &L[i]); } for(i = 0; i < N; i++){ scanf("%d", &R[i]); } pair *UD = (pair *)malloc(sizeof(pair) * N); pair *LR = (pair *)malloc(sizeof(pair) * N); for(i = 0; i < N; i++){ UD[i].i = i; UD[i].v = U[i] + D[i]; LR[i].i = i; LR[i].v = N - (L[i] + R[i]); } qsort(UD, N, sizeof(pair), compair); qsort(LR, N, sizeof(pair), compair); int **B0 = (int **)malloc(sizeof(int *) * N); for(i = 0; i < N; i++){ B0[i] = (int *)malloc(sizeof(int) * N); for(j = 0; j < N; j++){ B0[i][j] = 0; } } int lastv, l, r, tmp; for(i = 0; i < N; i++){ if(LR[i].v == 0){ break; } for(j = 0; j < LR[i].v; j++){ B0[i][j] = 1; } lastv = UD[j - 1].v; for(l = 0; UD[l].v != lastv; l++); for(r = N - 1; UD[r].v != lastv; r--); for(k = 0; k <= (r - l) / 2; k++){ tmp = B0[i][l + k]; B0[i][l + k] = B0[i][r - k]; B0[i][r - k] = tmp; } for(j = 0; j < N; j++){ UD[j].v -= B0[i][j]; if(UD[j].v < 0){ printf("NO\n"); return 0; } } } int **B1 = (int **)malloc(sizeof(int *) * N); char **A = (char **)malloc(sizeof(char *) * N); int **visited = (int **)malloc(sizeof(int *) * N); int **nexts_num = (int **)malloc(sizeof(int *) * N); int ***nexts = (int ***)malloc(sizeof(int **) * N); for(i = 0; i < N; i++){ B1[i] = (int *)malloc(sizeof(int) * N); A[i] = (char *)malloc(sizeof(char) * N); visited[i] = (int *)malloc(sizeof(int) * N); nexts_num[i] = (int *)malloc(sizeof(int) * N); nexts[i] = (int **)malloc(sizeof(int *) * N); for(j = 0; j < N; j++){ nexts[i][j] = (int *)malloc(sizeof(int) * N); } } for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ B1[LR[i].i][UD[j].i] = B0[i][j]; } } while(1){ setA(N, L, R, U, D, B1, A); for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ nexts_num[i][j] = 0; } } for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ if(B1[i][j] == 1){ for(k = j + 1; k < N; k++){ if(A[i][k] == 'L'){ nexts[i][j][nexts_num[i][j]] = pos_to_int(i, k, N); nexts_num[i][j]++; } } } } for(j = N - 1; j >= 0; j--){ if(B1[i][j] == 1){ for(k = j - 1; k >= 0; k--){ if(A[i][k] == 'R'){ nexts[i][j][nexts_num[i][j]] = pos_to_int(i, k, N); nexts_num[i][j]++; } } } } } for(j = 0; j < N; j++){ for(i = 0; i < N; i++){ if(B1[i][j] == 0){ for(k = i + 1; k < N; k++){ if(A[k][j] == 'U'){ nexts[i][j][nexts_num[i][j]] = pos_to_int(k, j, N); nexts_num[i][j]++; } } } } for(i = N - 1; i >= 0; i--){ if(B1[i][j] == 0){ for(k = i - 1; k >= 0; k--){ if(A[k][j] == 'D'){ nexts[i][j][nexts_num[i][j]] = pos_to_int(k, j, N); nexts_num[i][j]++; } } } } } for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ visited[i][j] = 0; } } for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ search(i, j, N, nexts_num, nexts, visited); } } int reverse_num = 0; for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ if(visited[i][j] == 2){ B1[i][j] ^= 1; reverse_num++; } } } if(reverse_num == 0){ break; } } graph *g = make_graph(N * N); for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ for(k = j + 1; k < N; k++){ if(A[i][k] == 'L'){ set_edge_graph(pos_to_int(i, j, N), pos_to_int(i, k, N), g); break; } } } for(j = N - 1; j >= 0; j--){ for(k = j - 1; k >= 0; k--){ if(A[i][k] == 'R'){ set_edge_graph(pos_to_int(i, j, N), pos_to_int(i, k, N), g); break; } } } } for(j = 0; j < N; j++){ for(i = 0; i < N; i++){ for(k = i + 1; k < N; k++){ if(A[k][j] == 'U'){ set_edge_graph(pos_to_int(i, j, N), pos_to_int(k, j, N), g); break; } } } for(i = N - 1; i >= 0; i--){ for(k = i - 1; k >= 0; k--){ if(A[k][j] == 'D'){ set_edge_graph(pos_to_int(i, j, N), pos_to_int(k, j, N), g); break; } } } } build_graph(g); DAG *dag = build_DAG(g); for(i = 0; i < dag->N; i++){ pos p = int_to_pos(dag->sorted_SCC[i]->vertexs[0], N); printf("%c", A[p.x][p.y]); if(B1[p.x][p.y] == 0){ printf("%d\n", p.x + 1); } else{ printf("%d\n", p.y + 1); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194425/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194425/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.graph = type { i32, ptr, ptr } %struct.graph_vertex_sub = type { i32, i32, ptr, i32 } %struct.graph_v_sub = type { i32, i32, ptr, i32, ptr } %struct.graph_edge_sub = type { ptr, ptr } %struct.SCC_sub = type { i32, i32, ptr, i32, ptr, i32 } %struct.DAG = type { i32, ptr } %struct.pair = type { i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable define dso_local noalias ptr @make_graph(i32 noundef %N) local_unnamed_addr #0 { entry: %call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #15 store i32 %N, ptr %call, align 8, !tbaa !5 %conv = sext i32 %N to i64 %mul = shl nsw i64 %conv, 3 %call2 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %v_s = getelementptr inbounds %struct.graph, ptr %call, i64 0, i32 1 store ptr %call2, ptr %v_s, align 8, !tbaa !11 %call5 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %v = getelementptr inbounds %struct.graph, ptr %call, i64 0, i32 2 store ptr %call5, ptr %v, align 8, !tbaa !12 %cmp75 = icmp sgt i32 %N, 0 br i1 %cmp75, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %N to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %call7 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #15 %arrayidx = getelementptr inbounds ptr, ptr %call2, i64 %indvars.iv store ptr %call7, ptr %arrayidx, align 8, !tbaa !13 %0 = trunc i64 %indvars.iv to i32 store i32 %0, ptr %call7, align 8, !tbaa !14 %next_num = getelementptr inbounds %struct.graph_vertex_sub, ptr %call7, i64 0, i32 1 %call21 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #15 %arrayidx24 = getelementptr inbounds ptr, ptr %call5, i64 %indvars.iv tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %next_num, i8 0, i64 16, i1 false) store ptr %call21, ptr %arrayidx24, align 8, !tbaa !13 store i32 %0, ptr %call21, align 8, !tbaa !16 %next_num32 = getelementptr inbounds %struct.graph_v_sub, ptr %call21, i64 0, i32 1 %prev = getelementptr inbounds %struct.graph_v_sub, ptr %call21, i64 0, i32 4 store ptr null, ptr %prev, align 8, !tbaa !18 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %next_num32, i8 0, i64 16, i1 false) br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !19 for.end: ; preds = %for.body, %entry ret ptr %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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 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 nounwind willreturn uwtable define dso_local void @set_edge_graph(i32 noundef %a, i32 noundef %b, ptr nocapture noundef readonly %g) local_unnamed_addr #3 { entry: %call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 %v_s = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 1 %0 = load ptr, ptr %v_s, align 8, !tbaa !11 %idxprom = sext i32 %b to i64 %arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom %1 = load ptr, ptr %arrayidx, align 8, !tbaa !13 store ptr %1, ptr %call, align 8, !tbaa !21 %idxprom2 = sext i32 %a to i64 %arrayidx3 = getelementptr inbounds ptr, ptr %0, i64 %idxprom2 %2 = load ptr, ptr %arrayidx3, align 8, !tbaa !13 %next = getelementptr inbounds %struct.graph_vertex_sub, ptr %2, i64 0, i32 2 %3 = load ptr, ptr %next, align 8, !tbaa !23 %next4 = getelementptr inbounds %struct.graph_edge_sub, ptr %call, i64 0, i32 1 store ptr %3, ptr %next4, align 8, !tbaa !24 %4 = load ptr, ptr %arrayidx3, align 8, !tbaa !13 %next8 = getelementptr inbounds %struct.graph_vertex_sub, ptr %4, i64 0, i32 2 store ptr %call, ptr %next8, align 8, !tbaa !23 %5 = load ptr, ptr %arrayidx3, align 8, !tbaa !13 %next_num = getelementptr inbounds %struct.graph_vertex_sub, ptr %5, i64 0, i32 1 %6 = load i32, ptr %next_num, align 4, !tbaa !25 %inc = add nsw i32 %6, 1 store i32 %inc, ptr %next_num, align 4, !tbaa !25 %7 = load ptr, ptr %arrayidx, align 8, !tbaa !13 %prev_num = getelementptr inbounds %struct.graph_vertex_sub, ptr %7, i64 0, i32 3 %8 = load i32, ptr %prev_num, align 8, !tbaa !26 %inc15 = add nsw i32 %8, 1 store i32 %inc15, ptr %prev_num, align 8, !tbaa !26 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @build_graph(ptr nocapture noundef readonly %g) local_unnamed_addr #4 { entry: %v_s1 = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 1 %0 = load ptr, ptr %v_s1, align 8, !tbaa !11 %v2 = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2 %1 = load ptr, ptr %v2, align 8, !tbaa !12 %2 = load i32, ptr %g, align 8, !tbaa !5 %cmp87 = icmp sgt i32 %2, 0 br i1 %cmp87, label %for.body.preheader, label %for.end58 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %2 to i64 br label %for.body for.cond12.preheader: ; preds = %for.body br i1 %cmp87, label %for.body16.preheader, label %for.end58 for.body16.preheader: ; preds = %for.cond12.preheader %wide.trip.count102 = zext i32 %2 to i64 br label %for.body16 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv %3 = load ptr, ptr %arrayidx, align 8, !tbaa !13 %next_num = getelementptr inbounds %struct.graph_vertex_sub, ptr %3, i64 0, i32 1 %4 = load i32, ptr %next_num, align 4, !tbaa !25 %conv = sext i32 %4 to i64 %mul = shl nsw i64 %conv, 3 %call = tail call noalias ptr @malloc(i64 noundef %mul) #15 %arrayidx4 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv %5 = load ptr, ptr %arrayidx4, align 8, !tbaa !13 %next = getelementptr inbounds %struct.graph_v_sub, ptr %5, i64 0, i32 2 store ptr %call, ptr %next, align 8, !tbaa !27 %6 = load ptr, ptr %arrayidx, align 8, !tbaa !13 %prev_num = getelementptr inbounds %struct.graph_vertex_sub, ptr %6, i64 0, i32 3 %7 = load i32, ptr %prev_num, align 8, !tbaa !26 %conv7 = sext i32 %7 to i64 %mul8 = shl nsw i64 %conv7, 3 %call9 = tail call noalias ptr @malloc(i64 noundef %mul8) #15 %8 = load ptr, ptr %arrayidx4, align 8, !tbaa !13 %prev = getelementptr inbounds %struct.graph_v_sub, ptr %8, i64 0, i32 4 store ptr %call9, ptr %prev, align 8, !tbaa !18 %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.cond12.preheader, label %for.body, !llvm.loop !28 for.body16: ; preds = %for.body16.preheader, %for.inc56 %indvars.iv99 = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next100, %for.inc56 ] %arrayidx18 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv99 %9 = load ptr, ptr %arrayidx18, align 8, !tbaa !13 %arrayidx20 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv99 %10 = load ptr, ptr %arrayidx20, align 8, !tbaa !13 %next21 = getelementptr inbounds %struct.graph_vertex_sub, ptr %10, i64 0, i32 2 %nowe.089 = load ptr, ptr %next21, align 8, !tbaa !13 %cmp23.not90 = icmp eq ptr %nowe.089, null br i1 %cmp23.not90, label %for.inc56, label %for.body25.lr.ph for.body25.lr.ph: ; preds = %for.body16 %next29 = getelementptr inbounds %struct.graph_v_sub, ptr %9, i64 0, i32 2 %next_num30 = getelementptr inbounds %struct.graph_v_sub, ptr %9, i64 0, i32 1 %next_num30.promoted = load i32, ptr %next_num30, align 4, !tbaa !29 %11 = sext i32 %next_num30.promoted to i64 br label %for.body25 for.body25: ; preds = %for.body25.lr.ph, %for.body25 %indvars.iv96 = phi i64 [ %11, %for.body25.lr.ph ], [ %indvars.iv.next97, %for.body25 ] %nowe.091 = phi ptr [ %nowe.089, %for.body25.lr.ph ], [ %nowe.0, %for.body25 ] %12 = load ptr, ptr %nowe.091, align 8, !tbaa !21 %13 = load i32, ptr %12, align 8, !tbaa !14 %idxprom27 = sext i32 %13 to i64 %arrayidx28 = getelementptr inbounds ptr, ptr %1, i64 %idxprom27 %14 = load ptr, ptr %arrayidx28, align 8, !tbaa !13 %15 = load ptr, ptr %next29, align 8, !tbaa !27 %arrayidx32 = getelementptr inbounds ptr, ptr %15, i64 %indvars.iv96 store ptr %14, ptr %arrayidx32, align 8, !tbaa !13 %indvars.iv.next97 = add i64 %indvars.iv96, 1 %16 = load ptr, ptr %nowe.091, align 8, !tbaa !21 %17 = load i32, ptr %16, align 8, !tbaa !14 %idxprom37 = sext i32 %17 to i64 %arrayidx38 = getelementptr inbounds ptr, ptr %1, i64 %idxprom37 %18 = load ptr, ptr %arrayidx38, align 8, !tbaa !13 %prev39 = getelementptr inbounds %struct.graph_v_sub, ptr %18, i64 0, i32 4 %19 = load ptr, ptr %prev39, align 8, !tbaa !18 %prev_num44 = getelementptr inbounds %struct.graph_v_sub, ptr %18, i64 0, i32 3 %20 = load i32, ptr %prev_num44, align 8, !tbaa !30 %idxprom45 = sext i32 %20 to i64 %arrayidx46 = getelementptr inbounds ptr, ptr %19, i64 %idxprom45 store ptr %9, ptr %arrayidx46, align 8, !tbaa !13 %21 = load ptr, ptr %nowe.091, align 8, !tbaa !21 %22 = load i32, ptr %21, align 8, !tbaa !14 %idxprom49 = sext i32 %22 to i64 %arrayidx50 = getelementptr inbounds ptr, ptr %1, i64 %idxprom49 %23 = load ptr, ptr %arrayidx50, align 8, !tbaa !13 %prev_num51 = getelementptr inbounds %struct.graph_v_sub, ptr %23, i64 0, i32 3 %24 = load i32, ptr %prev_num51, align 8, !tbaa !30 %inc52 = add nsw i32 %24, 1 store i32 %inc52, ptr %prev_num51, align 8, !tbaa !30 %next54 = getelementptr inbounds %struct.graph_edge_sub, ptr %nowe.091, i64 0, i32 1 %nowe.0 = load ptr, ptr %next54, align 8, !tbaa !13 %cmp23.not = icmp eq ptr %nowe.0, null br i1 %cmp23.not, label %for.cond22.for.inc56_crit_edge, label %for.body25, !llvm.loop !31 for.cond22.for.inc56_crit_edge: ; preds = %for.body25 %25 = trunc i64 %indvars.iv.next97 to i32 store i32 %25, ptr %next_num30, align 4, !tbaa !29 br label %for.inc56 for.inc56: ; preds = %for.cond22.for.inc56_crit_edge, %for.body16 %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102 br i1 %exitcond103.not, label %for.end58, label %for.body16, !llvm.loop !32 for.end58: ; preds = %for.inc56, %entry, %for.cond12.preheader ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %next_bt, ptr nocapture noundef %used, ptr nocapture noundef writeonly %bt, ptr nocapture noundef writeonly %bt_inv, ptr nocapture noundef readonly %v) local_unnamed_addr #5 { entry: %0 = load i32, ptr %v, align 8, !tbaa !16 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds i32, ptr %used, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !33 %cmp = icmp eq i32 %1, 1 br i1 %cmp, label %return, label %if.else if.else: ; preds = %entry store i32 1, ptr %arrayidx, align 4, !tbaa !33 %next_num = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 1 %2 = load i32, ptr %next_num, align 4, !tbaa !29 %cmp428 = icmp sgt i32 %2, 0 br i1 %cmp428, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.else %next = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 2 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %next_bt.addr.029 = phi i32 [ %next_bt, %for.body.lr.ph ], [ %call, %for.body ] %3 = load ptr, ptr %next, align 8, !tbaa !27 %arrayidx6 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv %4 = load ptr, ptr %arrayidx6, align 8, !tbaa !13 %call = tail call i32 @dfs(i32 noundef %next_bt.addr.029, ptr noundef %used, ptr noundef %bt, ptr noundef %bt_inv, ptr noundef %4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %next_num, align 4, !tbaa !29 %6 = sext i32 %5 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp4, label %for.body, label %for.end, !llvm.loop !34 for.end: ; preds = %for.body, %if.else %next_bt.addr.0.lcssa = phi i32 [ %next_bt, %if.else ], [ %call, %for.body ] %7 = load i32, ptr %v, align 8, !tbaa !16 %idxprom8 = sext i32 %7 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %bt, i64 %idxprom8 store i32 %next_bt.addr.0.lcssa, ptr %arrayidx9, align 4, !tbaa !33 %8 = load i32, ptr %v, align 8, !tbaa !16 %idxprom11 = sext i32 %next_bt.addr.0.lcssa to i64 %arrayidx12 = getelementptr inbounds i32, ptr %bt_inv, i64 %idxprom11 store i32 %8, ptr %arrayidx12, align 4, !tbaa !33 %add = add nsw i32 %next_bt.addr.0.lcssa, 1 br label %return return: ; preds = %entry, %for.end %retval.0 = phi i32 [ %add, %for.end ], [ %next_bt, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dfs_rev1(i32 noundef %next_SCC_num, ptr nocapture noundef %used, ptr nocapture noundef writeonly %SCC_num, ptr nocapture noundef %next_num, ptr nocapture noundef %prev_num, ptr nocapture noundef readonly %v) local_unnamed_addr #5 { entry: %0 = load i32, ptr %v, align 8, !tbaa !16 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds i32, ptr %used, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !33 %cmp = icmp eq i32 %1, 1 br i1 %cmp, label %if.then, label %if.end36 if.then: ; preds = %entry store i32 2, ptr %arrayidx, align 4, !tbaa !33 %prev_num4 = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 3 %2 = load i32, ptr %prev_num4, align 8, !tbaa !30 %cmp558 = icmp sgt i32 %2, 0 br i1 %cmp558, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.then %prev = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 4 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %3 = load ptr, ptr %prev, align 8, !tbaa !18 %arrayidx7 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv %4 = load ptr, ptr %arrayidx7, align 8, !tbaa !13 tail call void @dfs_rev1(i32 noundef %next_SCC_num, ptr noundef %used, ptr noundef %SCC_num, ptr noundef %next_num, ptr noundef %prev_num, ptr noundef %4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %prev_num4, align 8, !tbaa !30 %6 = sext i32 %5 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp5, label %for.body, label %for.end, !llvm.loop !35 for.end: ; preds = %for.body, %if.then %7 = load i32, ptr %v, align 8, !tbaa !16 %idxprom9 = sext i32 %7 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %SCC_num, i64 %idxprom9 store i32 %next_SCC_num, ptr %arrayidx10, align 4, !tbaa !33 %next_num12 = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 1 %8 = load i32, ptr %next_num12, align 4, !tbaa !29 %cmp1360 = icmp sgt i32 %8, 0 br i1 %cmp1360, label %for.body14.lr.ph, label %if.end36 for.body14.lr.ph: ; preds = %for.end %next = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 2 %9 = load ptr, ptr %next, align 8, !tbaa !27 br label %for.body14 for.body14: ; preds = %for.body14.lr.ph, %for.inc33 %10 = phi i32 [ %8, %for.body14.lr.ph ], [ %18, %for.inc33 ] %indvars.iv63 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next64, %for.inc33 ] %arrayidx16 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv63 %11 = load ptr, ptr %arrayidx16, align 8, !tbaa !13 %12 = load i32, ptr %11, align 8, !tbaa !16 %idxprom18 = sext i32 %12 to i64 %arrayidx19 = getelementptr inbounds i32, ptr %used, i64 %idxprom18 %13 = load i32, ptr %arrayidx19, align 4, !tbaa !33 %cmp20 = icmp eq i32 %13, 1 br i1 %cmp20, label %if.then21, label %for.inc33 if.then21: ; preds = %for.body14 %14 = load i32, ptr %v, align 8, !tbaa !16 %idxprom23 = sext i32 %14 to i64 %arrayidx24 = getelementptr inbounds i32, ptr %next_num, i64 %idxprom23 %15 = load i32, ptr %arrayidx24, align 4, !tbaa !33 %inc25 = add nsw i32 %15, 1 store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !33 %16 = load i32, ptr %11, align 8, !tbaa !16 %idxprom30 = sext i32 %16 to i64 %arrayidx31 = getelementptr inbounds i32, ptr %prev_num, i64 %idxprom30 %17 = load i32, ptr %arrayidx31, align 4, !tbaa !33 %inc32 = add nsw i32 %17, 1 store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !33 %.pre = load i32, ptr %next_num12, align 4, !tbaa !29 br label %for.inc33 for.inc33: ; preds = %for.body14, %if.then21 %18 = phi i32 [ %10, %for.body14 ], [ %.pre, %if.then21 ] %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %19 = sext i32 %18 to i64 %cmp13 = icmp slt i64 %indvars.iv.next64, %19 br i1 %cmp13, label %for.body14, label %if.end36, !llvm.loop !36 if.end36: ; preds = %for.inc33, %for.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dfs_rev2(ptr nocapture noundef %now_SCC, ptr nocapture noundef %used, ptr nocapture noundef readonly %SCC_num, ptr nocapture noundef readonly %v, ptr nocapture noundef readonly %dag) local_unnamed_addr #5 { entry: %0 = load i32, ptr %v, align 8, !tbaa !16 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds i32, ptr %used, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !33 %cmp = icmp eq i32 %1, 2 br i1 %cmp, label %if.then, label %if.end46 if.then: ; preds = %entry store i32 3, ptr %arrayidx, align 4, !tbaa !33 %prev_num = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 3 %2 = load i32, ptr %prev_num, align 8, !tbaa !30 %cmp474 = icmp sgt i32 %2, 0 br i1 %cmp474, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.then %prev = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 4 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %3 = load ptr, ptr %prev, align 8, !tbaa !18 %arrayidx6 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv %4 = load ptr, ptr %arrayidx6, align 8, !tbaa !13 tail call void @dfs_rev2(ptr noundef %now_SCC, ptr noundef %used, ptr noundef %SCC_num, ptr noundef %4, ptr noundef %dag) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %prev_num, align 8, !tbaa !30 %6 = sext i32 %5 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp4, label %for.body, label %for.end, !llvm.loop !37 for.end: ; preds = %for.body, %if.then %7 = load i32, ptr %v, align 8, !tbaa !16 %vertexs = getelementptr inbounds %struct.SCC_sub, ptr %now_SCC, i64 0, i32 2 %8 = load ptr, ptr %vertexs, align 8, !tbaa !38 %vertex_num = getelementptr inbounds %struct.SCC_sub, ptr %now_SCC, i64 0, i32 1 %9 = load i32, ptr %vertex_num, align 4, !tbaa !40 %idxprom8 = sext i32 %9 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %8, i64 %idxprom8 store i32 %7, ptr %arrayidx9, align 4, !tbaa !33 %10 = load i32, ptr %vertex_num, align 4, !tbaa !40 %inc11 = add nsw i32 %10, 1 store i32 %inc11, ptr %vertex_num, align 4, !tbaa !40 %next_num = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 1 %11 = load i32, ptr %next_num, align 4, !tbaa !29 %cmp1376 = icmp sgt i32 %11, 0 br i1 %cmp1376, label %for.body14.lr.ph, label %if.end46 for.body14.lr.ph: ; preds = %for.end %next = getelementptr inbounds %struct.graph_v_sub, ptr %v, i64 0, i32 2 %sorted_SCC = getelementptr inbounds %struct.DAG, ptr %dag, i64 0, i32 1 %next34 = getelementptr inbounds %struct.SCC_sub, ptr %now_SCC, i64 0, i32 4 %next_num35 = getelementptr inbounds %struct.SCC_sub, ptr %now_SCC, i64 0, i32 3 %wide.trip.count = zext i32 %11 to i64 br label %for.body14 for.body14: ; preds = %for.body14.lr.ph, %for.inc43 %indvars.iv79 = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next80, %for.inc43 ] %12 = load ptr, ptr %next, align 8, !tbaa !27 %arrayidx16 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv79 %13 = load ptr, ptr %arrayidx16, align 8, !tbaa !13 %14 = load i32, ptr %13, align 8, !tbaa !16 %idxprom18 = sext i32 %14 to i64 %arrayidx19 = getelementptr inbounds i32, ptr %used, i64 %idxprom18 %15 = load i32, ptr %arrayidx19, align 4, !tbaa !33 %cmp20 = icmp eq i32 %15, 2 br i1 %cmp20, label %if.then21, label %for.inc43 if.then21: ; preds = %for.body14 %16 = load ptr, ptr %sorted_SCC, align 8, !tbaa !41 %arrayidx27 = getelementptr inbounds i32, ptr %SCC_num, i64 %idxprom18 %17 = load i32, ptr %arrayidx27, align 4, !tbaa !33 %idxprom28 = sext i32 %17 to i64 %arrayidx29 = getelementptr inbounds ptr, ptr %16, i64 %idxprom28 %18 = load ptr, ptr %arrayidx29, align 8, !tbaa !13 %19 = load i32, ptr %now_SCC, align 8, !tbaa !43 %20 = load i32, ptr %18, align 8, !tbaa !43 %cmp32.not = icmp eq i32 %19, %20 br i1 %cmp32.not, label %for.inc43, label %if.then33 if.then33: ; preds = %if.then21 %21 = load ptr, ptr %next34, align 8, !tbaa !44 %22 = load i32, ptr %next_num35, align 8, !tbaa !45 %idxprom36 = sext i32 %22 to i64 %arrayidx37 = getelementptr inbounds ptr, ptr %21, i64 %idxprom36 store ptr %18, ptr %arrayidx37, align 8, !tbaa !13 %inc39 = add nsw i32 %22, 1 store i32 %inc39, ptr %next_num35, align 8, !tbaa !45 %prev_num40 = getelementptr inbounds %struct.SCC_sub, ptr %18, i64 0, i32 5 %23 = load i32, ptr %prev_num40, align 8, !tbaa !46 %inc41 = add nsw i32 %23, 1 store i32 %inc41, ptr %prev_num40, align 8, !tbaa !46 br label %for.inc43 for.inc43: ; preds = %for.body14, %if.then33, %if.then21 %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count br i1 %exitcond.not, label %if.end46, label %for.body14, !llvm.loop !47 if.end46: ; preds = %for.inc43, %for.end, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local noalias ptr @build_DAG(ptr nocapture noundef readonly %g) local_unnamed_addr #6 { entry: %0 = load i32, ptr %g, align 8, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #15 %call4 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %call7 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %cmp257 = icmp sgt i32 %0, 0 br i1 %cmp257, label %for.body16.lr.ph, label %for.end22 for.body16.lr.ph: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr align 4 %call, i8 0, i64 %2, i1 false), !tbaa !33 tail call void @llvm.memset.p0.i64(ptr align 4 %call4, i8 -1, i64 %2, i1 false), !tbaa !33 tail call void @llvm.memset.p0.i64(ptr align 4 %call7, i8 -1, i64 %2, i1 false), !tbaa !33 %v = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2 %wide.trip.count = zext i32 %0 to i64 br label %for.body16 for.body16: ; preds = %for.body16.lr.ph, %for.body16 %indvars.iv = phi i64 [ 0, %for.body16.lr.ph ], [ %indvars.iv.next, %for.body16 ] %next_bt.0260 = phi i32 [ 0, %for.body16.lr.ph ], [ %call19, %for.body16 ] %3 = load ptr, ptr %v, align 8, !tbaa !12 %arrayidx18 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv %4 = load ptr, ptr %arrayidx18, align 8, !tbaa !13 %call19 = tail call i32 @dfs(i32 noundef %next_bt.0260, ptr noundef %call, ptr noundef %call4, ptr noundef %call7, ptr noundef %4) %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.end22, label %for.body16, !llvm.loop !48 for.end22: ; preds = %for.body16, %entry %call25 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %call28 = tail call noalias ptr @malloc(i64 noundef %mul) #15 %call31 = tail call noalias ptr @malloc(i64 noundef %mul) #15 br i1 %cmp257, label %for.body48.lr.ph, label %for.end44 for.end44: ; preds = %for.end22 %sub = add i32 %0, -1 br label %for.end62 for.body48.lr.ph: ; preds = %for.end22 %5 = zext i32 %0 to i64 %6 = shl nuw nsw i64 %5, 2 tail call void @llvm.memset.p0.i64(ptr align 4 %call25, i8 0, i64 %6, i1 false), !tbaa !33 tail call void @llvm.memset.p0.i64(ptr align 4 %call28, i8 0, i64 %6, i1 false), !tbaa !33 tail call void @llvm.memset.p0.i64(ptr align 4 %call31, i8 0, i64 %6, i1 false), !tbaa !33 %sub302 = add nsw i32 %0, -1 %v55 = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2 %7 = zext i32 %sub302 to i64 br label %for.body48 for.body48: ; preds = %for.body48.lr.ph, %for.inc61 %indvars.iv281 = phi i64 [ %7, %for.body48.lr.ph ], [ %indvars.iv.next282, %for.inc61 ] %next_SCC_num.0265 = phi i32 [ 0, %for.body48.lr.ph ], [ %next_SCC_num.1, %for.inc61 ] %arrayidx50 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv281 %8 = load i32, ptr %arrayidx50, align 4, !tbaa !33 %idxprom51 = sext i32 %8 to i64 %arrayidx52 = getelementptr inbounds i32, ptr %call, i64 %idxprom51 %9 = load i32, ptr %arrayidx52, align 4, !tbaa !33 %cmp53 = icmp eq i32 %9, 1 br i1 %cmp53, label %if.then, label %for.inc61 if.then: ; preds = %for.body48 %10 = load ptr, ptr %v55, align 8, !tbaa !12 %arrayidx59 = getelementptr inbounds ptr, ptr %10, i64 %idxprom51 %11 = load ptr, ptr %arrayidx59, align 8, !tbaa !13 tail call void @dfs_rev1(i32 noundef %next_SCC_num.0265, ptr noundef nonnull %call, ptr noundef %call25, ptr noundef %call28, ptr noundef %call31, ptr noundef %11) %inc60 = add nsw i32 %next_SCC_num.0265, 1 br label %for.inc61 for.inc61: ; preds = %for.body48, %if.then %next_SCC_num.1 = phi i32 [ %inc60, %if.then ], [ %next_SCC_num.0265, %for.body48 ] %indvars.iv.next282 = add nsw i64 %indvars.iv281, -1 %cmp46 = icmp sgt i64 %indvars.iv281, 0 br i1 %cmp46, label %for.body48, label %for.end62, !llvm.loop !49 for.end62: ; preds = %for.inc61, %for.end44 %sub304 = phi i32 [ %sub, %for.end44 ], [ %sub302, %for.inc61 ] %next_SCC_num.0.lcssa = phi i32 [ 0, %for.end44 ], [ %next_SCC_num.1, %for.inc61 ] %call63 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 store i32 %next_SCC_num.0.lcssa, ptr %call63, align 8, !tbaa !50 %conv66 = sext i32 %next_SCC_num.0.lcssa to i64 %mul67 = shl nsw i64 %conv66, 3 %call68 = tail call noalias ptr @malloc(i64 noundef %mul67) #15 %sorted_SCC = getelementptr inbounds %struct.DAG, ptr %call63, i64 0, i32 1 store ptr %call68, ptr %sorted_SCC, align 8, !tbaa !41 %cmp71267 = icmp sgt i32 %next_SCC_num.0.lcssa, 0 br i1 %cmp71267, label %for.body73.preheader, label %for.cond86.preheader for.body73.preheader: ; preds = %for.end62 %wide.trip.count287 = zext i32 %next_SCC_num.0.lcssa to i64 br label %for.body73 for.cond86.preheader: ; preds = %for.body73, %for.end62 br i1 %cmp257, label %for.body89.preheader, label %for.cond107.preheader for.body89.preheader: ; preds = %for.cond86.preheader %wide.trip.count292 = zext i32 %0 to i64 br label %for.body89 for.body73: ; preds = %for.body73.preheader, %for.body73 %indvars.iv284 = phi i64 [ 0, %for.body73.preheader ], [ %indvars.iv.next285, %for.body73 ] %call74 = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #15 %arrayidx77 = getelementptr inbounds ptr, ptr %call68, i64 %indvars.iv284 store ptr %call74, ptr %arrayidx77, align 8, !tbaa !13 %12 = trunc i64 %indvars.iv284 to i32 store i32 %12, ptr %call74, align 8, !tbaa !43 %vertex_num = getelementptr inbounds %struct.SCC_sub, ptr %call74, i64 0, i32 1 %next = getelementptr inbounds %struct.SCC_sub, ptr %call74, i64 0, i32 4 store ptr null, ptr %next, align 8, !tbaa !44 %prev_num82 = getelementptr inbounds %struct.SCC_sub, ptr %call74, i64 0, i32 5 store i32 0, ptr %prev_num82, align 8, !tbaa !46 %indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1 %exitcond288.not = icmp eq i64 %indvars.iv.next285, %wide.trip.count287 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %vertex_num, i8 0, i64 16, i1 false) br i1 %exitcond288.not, label %for.cond86.preheader, label %for.body73, !llvm.loop !51 for.cond107.preheader: ; preds = %for.body89, %for.cond86.preheader br i1 %cmp71267, label %for.body111.preheader, label %for.cond132.preheader for.body111.preheader: ; preds = %for.cond107.preheader %wide.trip.count297 = zext i32 %next_SCC_num.0.lcssa to i64 br label %for.body111 for.body89: ; preds = %for.body89.preheader, %for.body89 %indvars.iv289 = phi i64 [ 0, %for.body89.preheader ], [ %indvars.iv.next290, %for.body89 ] %arrayidx92 = getelementptr inbounds i32, ptr %call25, i64 %indvars.iv289 %13 = load i32, ptr %arrayidx92, align 4, !tbaa !33 %idxprom93 = sext i32 %13 to i64 %arrayidx94 = getelementptr inbounds ptr, ptr %call68, i64 %idxprom93 %14 = load ptr, ptr %arrayidx94, align 8, !tbaa !13 %vertex_num95 = getelementptr inbounds %struct.SCC_sub, ptr %14, i64 0, i32 1 %15 = load i32, ptr %vertex_num95, align 4, !tbaa !40 %inc96 = add nsw i32 %15, 1 store i32 %inc96, ptr %vertex_num95, align 4, !tbaa !40 %arrayidx98 = getelementptr inbounds i32, ptr %call28, i64 %indvars.iv289 %16 = load i32, ptr %arrayidx98, align 4, !tbaa !33 %next_num99 = getelementptr inbounds %struct.SCC_sub, ptr %14, i64 0, i32 3 %17 = load i32, ptr %next_num99, align 8, !tbaa !45 %add = add nsw i32 %17, %16 store i32 %add, ptr %next_num99, align 8, !tbaa !45 %arrayidx101 = getelementptr inbounds i32, ptr %call31, i64 %indvars.iv289 %18 = load i32, ptr %arrayidx101, align 4, !tbaa !33 %prev_num102 = getelementptr inbounds %struct.SCC_sub, ptr %14, i64 0, i32 5 %19 = load i32, ptr %prev_num102, align 8, !tbaa !46 %add103 = add nsw i32 %19, %18 store i32 %add103, ptr %prev_num102, align 8, !tbaa !46 %indvars.iv.next290 = add nuw nsw i64 %indvars.iv289, 1 %exitcond293.not = icmp eq i64 %indvars.iv.next290, %wide.trip.count292 br i1 %exitcond293.not, label %for.cond107.preheader, label %for.body89, !llvm.loop !52 for.cond132.preheader: ; preds = %for.body111, %for.cond107.preheader br i1 %cmp257, label %for.body135.lr.ph, label %for.end155 for.body135.lr.ph: ; preds = %for.cond132.preheader %v146 = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2 %20 = zext i32 %sub304 to i64 br label %for.body135 for.body111: ; preds = %for.body111.preheader, %for.body111 %indvars.iv294 = phi i64 [ 0, %for.body111.preheader ], [ %indvars.iv.next295, %for.body111 ] %arrayidx114 = getelementptr inbounds ptr, ptr %call68, i64 %indvars.iv294 %21 = load ptr, ptr %arrayidx114, align 8, !tbaa !13 %vertex_num115 = getelementptr inbounds %struct.SCC_sub, ptr %21, i64 0, i32 1 %22 = load i32, ptr %vertex_num115, align 4, !tbaa !40 %conv116 = sext i32 %22 to i64 %mul117 = shl nsw i64 %conv116, 2 %call118 = tail call noalias ptr @malloc(i64 noundef %mul117) #15 %vertexs119 = getelementptr inbounds %struct.SCC_sub, ptr %21, i64 0, i32 2 store ptr %call118, ptr %vertexs119, align 8, !tbaa !38 %next_num120 = getelementptr inbounds %struct.SCC_sub, ptr %21, i64 0, i32 3 %23 = load i32, ptr %next_num120, align 8, !tbaa !45 %conv121 = sext i32 %23 to i64 %mul122 = shl nsw i64 %conv121, 3 %call123 = tail call noalias ptr @malloc(i64 noundef %mul122) #15 %next124 = getelementptr inbounds %struct.SCC_sub, ptr %21, i64 0, i32 4 store ptr %call123, ptr %next124, align 8, !tbaa !44 store i32 0, ptr %vertex_num115, align 4, !tbaa !40 store i32 0, ptr %next_num120, align 8, !tbaa !45 %prev_num127 = getelementptr inbounds %struct.SCC_sub, ptr %21, i64 0, i32 5 store i32 0, ptr %prev_num127, align 8, !tbaa !46 %indvars.iv.next295 = add nuw nsw i64 %indvars.iv294, 1 %exitcond298.not = icmp eq i64 %indvars.iv.next295, %wide.trip.count297 br i1 %exitcond298.not, label %for.cond132.preheader, label %for.body111, !llvm.loop !53 for.body135: ; preds = %for.body135.lr.ph, %for.inc153 %indvars.iv299 = phi i64 [ %20, %for.body135.lr.ph ], [ %indvars.iv.next300, %for.inc153 ] %next_SCC_num.2274 = phi i32 [ 0, %for.body135.lr.ph ], [ %next_SCC_num.3, %for.inc153 ] %arrayidx137 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv299 %24 = load i32, ptr %arrayidx137, align 4, !tbaa !33 %idxprom138 = sext i32 %24 to i64 %arrayidx139 = getelementptr inbounds i32, ptr %call, i64 %idxprom138 %25 = load i32, ptr %arrayidx139, align 4, !tbaa !33 %cmp140 = icmp eq i32 %25, 2 br i1 %cmp140, label %if.then142, label %for.inc153 if.then142: ; preds = %for.body135 %idxprom144 = sext i32 %next_SCC_num.2274 to i64 %arrayidx145 = getelementptr inbounds ptr, ptr %call68, i64 %idxprom144 %26 = load ptr, ptr %arrayidx145, align 8, !tbaa !13 %27 = load ptr, ptr %v146, align 8, !tbaa !12 %arrayidx150 = getelementptr inbounds ptr, ptr %27, i64 %idxprom138 %28 = load ptr, ptr %arrayidx150, align 8, !tbaa !13 tail call void @dfs_rev2(ptr noundef %26, ptr noundef nonnull %call, ptr noundef %call25, ptr noundef %28, ptr noundef nonnull %call63) %inc151 = add nsw i32 %next_SCC_num.2274, 1 br label %for.inc153 for.inc153: ; preds = %for.body135, %if.then142 %next_SCC_num.3 = phi i32 [ %inc151, %if.then142 ], [ %next_SCC_num.2274, %for.body135 ] %indvars.iv.next300 = add nsw i64 %indvars.iv299, -1 %cmp133 = icmp sgt i64 %indvars.iv299, 0 br i1 %cmp133, label %for.body135, label %for.end155, !llvm.loop !54 for.end155: ; preds = %for.inc153, %for.cond132.preheader tail call void @free(ptr noundef %call) #16 tail call void @free(ptr noundef %call4) #16 tail call void @free(ptr noundef %call7) #16 tail call void @free(ptr noundef %call25) #16 tail call void @free(ptr noundef %call28) #16 tail call void @free(ptr noundef %call31) #16 ret ptr %call63 } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @pos_to_int(i32 noundef %x, i32 noundef %y, i32 noundef %N) local_unnamed_addr #8 { entry: %mul = mul nsw i32 %N, %x %add = add nsw i32 %mul, %y ret i32 %add } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @int_to_pos(i32 noundef %num, i32 noundef %N) local_unnamed_addr #8 { entry: %div = sdiv i32 %num, %N %rem = srem i32 %num, %N %retval.sroa.2.0.insert.ext = zext i32 %rem to i64 %retval.sroa.2.0.insert.shift = shl nuw i64 %retval.sroa.2.0.insert.ext, 32 %retval.sroa.0.0.insert.ext = zext i32 %div to i64 %retval.sroa.0.0.insert.insert = or i64 %retval.sroa.2.0.insert.shift, %retval.sroa.0.0.insert.ext ret i64 %retval.sroa.0.0.insert.insert } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compair(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #9 { entry: %v = getelementptr inbounds %struct.pair, ptr %b, i64 0, i32 1 %0 = load i32, ptr %v, align 4, !tbaa !55 %v1 = getelementptr inbounds %struct.pair, ptr %a, i64 0, i32 1 %1 = load i32, ptr %v1, align 4, !tbaa !55 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @search(i32 noundef %x, i32 noundef %y, i32 noundef %N, ptr nocapture noundef readonly %nexts_num, ptr nocapture noundef readonly %nexts, ptr nocapture noundef readonly %visited) local_unnamed_addr #5 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds ptr, ptr %visited, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !13 %idxprom1 = sext i32 %y to i64 %arrayidx2 = getelementptr inbounds i32, ptr %0, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !33 switch i32 %1, label %if.else18 [ i32 2, label %return i32 -1, label %return i32 1, label %if.then13 ] if.then13: ; preds = %entry store i32 2, ptr %arrayidx2, align 4, !tbaa !33 br label %return if.else18: ; preds = %entry store i32 1, ptr %arrayidx2, align 4, !tbaa !33 %arrayidx24 = getelementptr inbounds ptr, ptr %nexts_num, i64 %idxprom %2 = load ptr, ptr %arrayidx24, align 8, !tbaa !13 %arrayidx2687 = getelementptr inbounds i32, ptr %2, i64 %idxprom1 %3 = load i32, ptr %arrayidx2687, align 4, !tbaa !33 %cmp2788 = icmp sgt i32 %3, 0 br i1 %cmp2788, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.else18 %arrayidx29 = getelementptr inbounds ptr, ptr %nexts, i64 %idxprom br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load ptr, ptr %arrayidx24, align 8, !tbaa !13 %arrayidx26 = getelementptr inbounds i32, ptr %4, i64 %idxprom1 %5 = load i32, ptr %arrayidx26, align 4, !tbaa !33 %6 = sext i32 %5 to i64 %cmp27 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp27, label %for.body, label %for.end.loopexit, !llvm.loop !57 for.body: ; preds = %for.body.lr.ph, %for.cond %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ] %7 = load ptr, ptr %arrayidx29, align 8, !tbaa !13 %arrayidx31 = getelementptr inbounds ptr, ptr %7, i64 %idxprom1 %8 = load ptr, ptr %arrayidx31, align 8, !tbaa !13 %arrayidx33 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv %9 = load i32, ptr %arrayidx33, align 4, !tbaa !33 %div.i = sdiv i32 %9, %N %rem.i = srem i32 %9, %N %call36 = tail call i32 @search(i32 noundef %div.i, i32 noundef %rem.i, i32 noundef %N, ptr noundef nonnull %nexts_num, ptr noundef %nexts, ptr noundef %visited) %cmp37.not = icmp eq i32 %call36, 1 br i1 %cmp37.not, label %if.then38, label %for.cond if.then38: ; preds = %for.body %10 = load ptr, ptr %arrayidx, align 8, !tbaa !13 %arrayidx42 = getelementptr inbounds i32, ptr %10, i64 %idxprom1 %11 = load i32, ptr %arrayidx42, align 4, !tbaa !33 %cmp43 = icmp eq i32 %11, 2 br i1 %cmp43, label %return, label %if.else45 if.else45: ; preds = %if.then38 store i32 2, ptr %arrayidx42, align 4, !tbaa !33 br label %return for.end.loopexit: ; preds = %for.cond %.pre = load ptr, ptr %arrayidx, align 8, !tbaa !13 br label %for.end for.end: ; preds = %for.end.loopexit, %if.else18 %12 = phi ptr [ %.pre, %for.end.loopexit ], [ %0, %if.else18 ] %arrayidx53 = getelementptr inbounds i32, ptr %12, i64 %idxprom1 store i32 -1, ptr %arrayidx53, align 4, !tbaa !33 br label %return return: ; preds = %if.else45, %if.then38, %for.end, %entry, %entry, %if.then13 %retval.3 = phi i32 [ 1, %if.then13 ], [ 0, %entry ], [ 0, %entry ], [ 0, %for.end ], [ 0, %if.then38 ], [ 1, %if.else45 ] ret i32 %retval.3 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @setA(i32 noundef %N, ptr nocapture noundef readonly %L, ptr nocapture noundef readonly %R, ptr nocapture noundef readonly %U, ptr nocapture noundef readonly %D, ptr nocapture noundef readonly %B1, ptr nocapture noundef readonly %A) local_unnamed_addr #10 { entry: %cmp132 = icmp sgt i32 %N, 0 br i1 %cmp132, label %for.cond1.preheader.lr.ph, label %for.end82 for.cond1.preheader.lr.ph: ; preds = %entry %0 = zext i32 %N to i64 %wide.trip.count = zext i32 %N to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc33 %indvars.iv147 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next148, %for.inc33 ] %arrayidx = getelementptr inbounds i32, ptr %L, i64 %indvars.iv147 %1 = load i32, ptr %arrayidx, align 4, !tbaa !33 %cmp2125 = icmp sgt i32 %1, 0 br i1 %cmp2125, label %for.body3.lr.ph, label %for.cond14.preheader for.body3.lr.ph: ; preds = %for.cond1.preheader %arrayidx5 = getelementptr inbounds ptr, ptr %B1, i64 %indvars.iv147 %arrayidx10 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv147 br label %for.body3 for.cond36.preheader: ; preds = %for.inc33 br i1 %cmp132, label %for.cond39.preheader.lr.ph, label %for.end82 for.cond39.preheader.lr.ph: ; preds = %for.cond36.preheader %2 = zext i32 %N to i64 %wide.trip.count159 = zext i32 %N to i64 br label %for.cond39.preheader for.cond14.preheader: ; preds = %for.inc, %for.cond1.preheader %arrayidx16 = getelementptr inbounds i32, ptr %R, i64 %indvars.iv147 %3 = load i32, ptr %arrayidx16, align 4, !tbaa !33 %cmp17129 = icmp sgt i32 %3, 0 br i1 %cmp17129, label %for.body18.lr.ph, label %for.inc33 for.body18.lr.ph: ; preds = %for.cond14.preheader %arrayidx20 = getelementptr inbounds ptr, ptr %B1, i64 %indvars.iv147 %arrayidx26 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv147 br label %for.body18 for.body3: ; preds = %for.body3.lr.ph, %for.inc %4 = phi i32 [ %1, %for.body3.lr.ph ], [ %8, %for.inc ] %indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.inc ] %k.0127 = phi i32 [ 0, %for.body3.lr.ph ], [ %k.1, %for.inc ] %5 = load ptr, ptr %arrayidx5, align 8, !tbaa !13 %arrayidx7 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv %6 = load i32, ptr %arrayidx7, align 4, !tbaa !33 %cmp8 = icmp eq i32 %6, 0 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body3 %7 = load ptr, ptr %arrayidx10, align 8, !tbaa !13 %arrayidx12 = getelementptr inbounds i8, ptr %7, i64 %indvars.iv store i8 76, ptr %arrayidx12, align 1, !tbaa !58 %inc = add nsw i32 %k.0127, 1 %.pre = load i32, ptr %arrayidx, align 4, !tbaa !33 br label %for.inc for.inc: ; preds = %for.body3, %if.then %8 = phi i32 [ %.pre, %if.then ], [ %4, %for.body3 ] %k.1 = phi i32 [ %inc, %if.then ], [ %k.0127, %for.body3 ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp2 = icmp slt i32 %k.1, %8 br i1 %cmp2, label %for.body3, label %for.cond14.preheader, !llvm.loop !59 for.body18: ; preds = %for.body18.lr.ph, %for.inc31 %9 = phi i32 [ %3, %for.body18.lr.ph ], [ %13, %for.inc31 ] %indvars.iv144 = phi i64 [ %0, %for.body18.lr.ph ], [ %indvars.iv.next145, %for.inc31 ] %k.2130 = phi i32 [ 0, %for.body18.lr.ph ], [ %k.3, %for.inc31 ] %indvars.iv.next145 = add nsw i64 %indvars.iv144, -1 %10 = load ptr, ptr %arrayidx20, align 8, !tbaa !13 %arrayidx22 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next145 %11 = load i32, ptr %arrayidx22, align 4, !tbaa !33 %cmp23 = icmp eq i32 %11, 0 br i1 %cmp23, label %if.then24, label %for.inc31 if.then24: ; preds = %for.body18 %12 = load ptr, ptr %arrayidx26, align 8, !tbaa !13 %arrayidx28 = getelementptr inbounds i8, ptr %12, i64 %indvars.iv.next145 store i8 82, ptr %arrayidx28, align 1, !tbaa !58 %inc29 = add nsw i32 %k.2130, 1 %.pre161 = load i32, ptr %arrayidx16, align 4, !tbaa !33 br label %for.inc31 for.inc31: ; preds = %for.body18, %if.then24 %13 = phi i32 [ %.pre161, %if.then24 ], [ %9, %for.body18 ] %k.3 = phi i32 [ %inc29, %if.then24 ], [ %k.2130, %for.body18 ] %cmp17 = icmp slt i32 %k.3, %13 br i1 %cmp17, label %for.body18, label %for.inc33, !llvm.loop !60 for.inc33: ; preds = %for.inc31, %for.cond14.preheader %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count br i1 %exitcond.not, label %for.cond36.preheader, label %for.cond1.preheader, !llvm.loop !61 for.cond39.preheader: ; preds = %for.cond39.preheader.lr.ph, %for.inc80 %indvars.iv156 = phi i64 [ 0, %for.cond39.preheader.lr.ph ], [ %indvars.iv.next157, %for.inc80 ] %arrayidx41 = getelementptr inbounds i32, ptr %U, i64 %indvars.iv156 %14 = load i32, ptr %arrayidx41, align 4, !tbaa !33 %cmp42134 = icmp sgt i32 %14, 0 br i1 %cmp42134, label %for.body43, label %for.cond60.preheader for.cond60.preheader: ; preds = %for.inc56, %for.cond39.preheader %arrayidx62 = getelementptr inbounds i32, ptr %D, i64 %indvars.iv156 %15 = load i32, ptr %arrayidx62, align 4, !tbaa !33 %cmp63138 = icmp sgt i32 %15, 0 br i1 %cmp63138, label %for.body64, label %for.inc80 for.body43: ; preds = %for.cond39.preheader, %for.inc56 %16 = phi i32 [ %20, %for.inc56 ], [ %14, %for.cond39.preheader ] %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc56 ], [ 0, %for.cond39.preheader ] %k.4136 = phi i32 [ %k.5, %for.inc56 ], [ 0, %for.cond39.preheader ] %arrayidx45 = getelementptr inbounds ptr, ptr %B1, i64 %indvars.iv150 %17 = load ptr, ptr %arrayidx45, align 8, !tbaa !13 %arrayidx47 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv156 %18 = load i32, ptr %arrayidx47, align 4, !tbaa !33 %cmp48 = icmp eq i32 %18, 1 br i1 %cmp48, label %if.then49, label %for.inc56 if.then49: ; preds = %for.body43 %arrayidx51 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv150 %19 = load ptr, ptr %arrayidx51, align 8, !tbaa !13 %arrayidx53 = getelementptr inbounds i8, ptr %19, i64 %indvars.iv156 store i8 85, ptr %arrayidx53, align 1, !tbaa !58 %inc54 = add nsw i32 %k.4136, 1 %.pre162 = load i32, ptr %arrayidx41, align 4, !tbaa !33 br label %for.inc56 for.inc56: ; preds = %for.body43, %if.then49 %20 = phi i32 [ %.pre162, %if.then49 ], [ %16, %for.body43 ] %k.5 = phi i32 [ %inc54, %if.then49 ], [ %k.4136, %for.body43 ] %indvars.iv.next151 = add nuw i64 %indvars.iv150, 1 %cmp42 = icmp slt i32 %k.5, %20 br i1 %cmp42, label %for.body43, label %for.cond60.preheader, !llvm.loop !62 for.body64: ; preds = %for.cond60.preheader, %for.inc77 %21 = phi i32 [ %25, %for.inc77 ], [ %15, %for.cond60.preheader ] %indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.inc77 ], [ %2, %for.cond60.preheader ] %k.6139 = phi i32 [ %k.7, %for.inc77 ], [ 0, %for.cond60.preheader ] %indvars.iv.next154 = add nsw i64 %indvars.iv153, -1 %arrayidx66 = getelementptr inbounds ptr, ptr %B1, i64 %indvars.iv.next154 %22 = load ptr, ptr %arrayidx66, align 8, !tbaa !13 %arrayidx68 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv156 %23 = load i32, ptr %arrayidx68, align 4, !tbaa !33 %cmp69 = icmp eq i32 %23, 1 br i1 %cmp69, label %if.then70, label %for.inc77 if.then70: ; preds = %for.body64 %arrayidx72 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv.next154 %24 = load ptr, ptr %arrayidx72, align 8, !tbaa !13 %arrayidx74 = getelementptr inbounds i8, ptr %24, i64 %indvars.iv156 store i8 68, ptr %arrayidx74, align 1, !tbaa !58 %inc75 = add nsw i32 %k.6139, 1 %.pre163 = load i32, ptr %arrayidx62, align 4, !tbaa !33 br label %for.inc77 for.inc77: ; preds = %for.body64, %if.then70 %25 = phi i32 [ %.pre163, %if.then70 ], [ %21, %for.body64 ] %k.7 = phi i32 [ %inc75, %if.then70 ], [ %k.6139, %for.body64 ] %cmp63 = icmp slt i32 %k.7, %25 br i1 %cmp63, label %for.body64, label %for.inc80, !llvm.loop !63 for.inc80: ; preds = %for.inc77, %for.cond60.preheader %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %exitcond160.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count159 br i1 %exitcond160.not, label %for.end82, label %for.cond39.preheader, !llvm.loop !64 for.end82: ; preds = %for.inc80, %entry, %for.cond36.preheader ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #16 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !33 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #15 %call4 = call noalias ptr @malloc(i64 noundef %mul) #15 %call7 = call noalias ptr @malloc(i64 noundef %mul) #15 %call10 = call noalias ptr @malloc(i64 noundef %mul) #15 %cmp1161 = icmp sgt i32 %0, 0 br i1 %cmp1161, label %for.body, label %for.cond33.preheader.for.end42_crit_edge for.cond13.preheader: ; preds = %for.body %cmp141163 = icmp sgt i32 %1, 0 br i1 %cmp141163, label %for.body16, label %for.cond33.preheader.for.end42_crit_edge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !33 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond13.preheader, !llvm.loop !65 for.cond23.preheader: ; preds = %for.body16 %cmp241165 = icmp sgt i32 %3, 0 br i1 %cmp241165, label %for.body26, label %for.cond33.preheader.for.end42_crit_edge for.body16: ; preds = %for.cond13.preheader, %for.body16 %indvars.iv1283 = phi i64 [ %indvars.iv.next1284, %for.body16 ], [ 0, %for.cond13.preheader ] %arrayidx18 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv1283 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx18) %indvars.iv.next1284 = add nuw nsw i64 %indvars.iv1283, 1 %3 = load i32, ptr %N, align 4, !tbaa !33 %4 = sext i32 %3 to i64 %cmp14 = icmp slt i64 %indvars.iv.next1284, %4 br i1 %cmp14, label %for.body16, label %for.cond23.preheader, !llvm.loop !66 for.cond33.preheader: ; preds = %for.body26 %cmp341167 = icmp sgt i32 %6, 0 br i1 %cmp341167, label %for.body36, label %for.cond33.preheader.for.end42_crit_edge for.cond33.preheader.for.end42_crit_edge: ; preds = %entry, %for.cond13.preheader, %for.cond23.preheader, %for.cond33.preheader %5 = phi i32 [ %6, %for.cond33.preheader ], [ %3, %for.cond23.preheader ], [ %1, %for.cond13.preheader ], [ %0, %entry ] %.pre1486 = sext i32 %5 to i64 br label %for.end42 for.body26: ; preds = %for.cond23.preheader, %for.body26 %indvars.iv1286 = phi i64 [ %indvars.iv.next1287, %for.body26 ], [ 0, %for.cond23.preheader ] %arrayidx28 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv1286 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx28) %indvars.iv.next1287 = add nuw nsw i64 %indvars.iv1286, 1 %6 = load i32, ptr %N, align 4, !tbaa !33 %7 = sext i32 %6 to i64 %cmp24 = icmp slt i64 %indvars.iv.next1287, %7 br i1 %cmp24, label %for.body26, label %for.cond33.preheader, !llvm.loop !67 for.body36: ; preds = %for.cond33.preheader, %for.body36 %indvars.iv1289 = phi i64 [ %indvars.iv.next1290, %for.body36 ], [ 0, %for.cond33.preheader ] %arrayidx38 = getelementptr inbounds i32, ptr %call10, i64 %indvars.iv1289 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx38) %indvars.iv.next1290 = add nuw nsw i64 %indvars.iv1289, 1 %8 = load i32, ptr %N, align 4, !tbaa !33 %9 = sext i32 %8 to i64 %cmp34 = icmp slt i64 %indvars.iv.next1290, %9 br i1 %cmp34, label %for.body36, label %for.end42, !llvm.loop !68 for.end42: ; preds = %for.body36, %for.cond33.preheader.for.end42_crit_edge %conv43.pre-phi = phi i64 [ %.pre1486, %for.cond33.preheader.for.end42_crit_edge ], [ %9, %for.body36 ] %.lcssa1160 = phi i32 [ %5, %for.cond33.preheader.for.end42_crit_edge ], [ %8, %for.body36 ] %mul44 = shl nsw i64 %conv43.pre-phi, 3 %call45 = call noalias ptr @malloc(i64 noundef %mul44) #15 %call48 = call noalias ptr @malloc(i64 noundef %mul44) #15 %cmp501169 = icmp sgt i32 %.lcssa1160, 0 br i1 %cmp501169, label %for.body52.preheader, label %for.end75 for.body52.preheader: ; preds = %for.end42 %wide.trip.count = zext i32 %.lcssa1160 to i64 %min.iters.check = icmp eq i32 %.lcssa1160, 1 br i1 %min.iters.check, label %for.body52.preheader1653, label %vector.ph vector.ph: ; preds = %for.body52.preheader %n.vec = and i64 %wide.trip.count, 4294967294 %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %.lcssa1160, i64 0 %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> 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.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %10 = getelementptr inbounds i32, ptr %call1, i64 %index %wide.load = load <2 x i32>, ptr %10, align 4, !tbaa !33 %11 = getelementptr inbounds i32, ptr %call4, i64 %index %wide.load1618 = load <2 x i32>, ptr %11, align 4, !tbaa !33 %12 = add nsw <2 x i32> %wide.load1618, %wide.load %13 = getelementptr inbounds %struct.pair, ptr %call45, i64 %index %interleaved.vec = shufflevector <2 x i32> %vec.ind, <2 x i32> %12, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec, ptr %13, align 4, !tbaa !33 %14 = getelementptr inbounds i32, ptr %call7, i64 %index %wide.load1619 = load <2 x i32>, ptr %14, align 4, !tbaa !33 %15 = getelementptr inbounds i32, ptr %call10, i64 %index %wide.load1620 = load <2 x i32>, ptr %15, align 4, !tbaa !33 %16 = add <2 x i32> %wide.load1619, %wide.load1620 %17 = sub <2 x i32> %broadcast.splat, %16 %18 = getelementptr inbounds %struct.pair, ptr %call48, i64 %index %interleaved.vec1621 = shufflevector <2 x i32> %vec.ind, <2 x i32> %17, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x i32> %interleaved.vec1621, ptr %18, align 4, !tbaa !33 %index.next = add nuw i64 %index, 2 %vec.ind.next = add <2 x i32> %vec.ind, <i32 2, i32 2> %19 = icmp eq i64 %index.next, %n.vec br i1 %19, label %middle.block, label %vector.body, !llvm.loop !69 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end75, label %for.body52.preheader1653 for.body52.preheader1653: ; preds = %for.body52.preheader, %middle.block %indvars.iv1292.ph = phi i64 [ 0, %for.body52.preheader ], [ %n.vec, %middle.block ] br label %for.body52 for.body52: ; preds = %for.body52.preheader1653, %for.body52 %indvars.iv1292 = phi i64 [ %indvars.iv.next1293, %for.body52 ], [ %indvars.iv1292.ph, %for.body52.preheader1653 ] %arrayidx54 = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv1292 %20 = trunc i64 %indvars.iv1292 to i32 store i32 %20, ptr %arrayidx54, align 4, !tbaa !72 %arrayidx57 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv1292 %21 = load i32, ptr %arrayidx57, align 4, !tbaa !33 %arrayidx59 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv1292 %22 = load i32, ptr %arrayidx59, align 4, !tbaa !33 %add = add nsw i32 %22, %21 %v = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv1292, i32 1 store i32 %add, ptr %v, align 4, !tbaa !55 %arrayidx63 = getelementptr inbounds %struct.pair, ptr %call48, i64 %indvars.iv1292 store i32 %20, ptr %arrayidx63, align 4, !tbaa !72 %arrayidx66 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv1292 %23 = load i32, ptr %arrayidx66, align 4, !tbaa !33 %arrayidx68 = getelementptr inbounds i32, ptr %call10, i64 %indvars.iv1292 %24 = load i32, ptr %arrayidx68, align 4, !tbaa !33 %25 = add i32 %23, %24 %sub = sub i32 %.lcssa1160, %25 %v72 = getelementptr inbounds %struct.pair, ptr %call48, i64 %indvars.iv1292, i32 1 store i32 %sub, ptr %v72, align 4, !tbaa !55 %indvars.iv.next1293 = add nuw nsw i64 %indvars.iv1292, 1 %exitcond.not = icmp eq i64 %indvars.iv.next1293, %wide.trip.count br i1 %exitcond.not, label %for.end75, label %for.body52, !llvm.loop !73 for.end75: ; preds = %for.body52, %middle.block, %for.end42 call void @qsort(ptr noundef %call45, i64 noundef %conv43.pre-phi, i64 noundef 8, ptr noundef nonnull @compair) #16 %26 = load i32, ptr %N, align 4, !tbaa !33 %conv77 = sext i32 %26 to i64 call void @qsort(ptr noundef %call48, i64 noundef %conv77, i64 noundef 8, ptr noundef nonnull @compair) #16 %27 = load i32, ptr %N, align 4, !tbaa !33 %conv78 = sext i32 %27 to i64 %mul79 = shl nsw i64 %conv78, 3 %call80 = call noalias ptr @malloc(i64 noundef %mul79) #15 %cmp821173 = icmp sgt i32 %27, 0 br i1 %cmp821173, label %for.body84.lr.ph, label %for.end204 for.body84.lr.ph: ; preds = %for.end75 %mul86 = shl nsw i64 %conv78, 2 %28 = zext i32 %27 to i64 %29 = shl nuw nsw i64 %28, 2 br label %for.inc101 for.cond104.preheader: ; preds = %for.inc101 br i1 %cmp821173, label %for.body107.preheader, label %for.end204 for.body107.preheader: ; preds = %for.cond104.preheader %v1101614 = getelementptr inbounds %struct.pair, ptr %call48, i64 0, i32 1 %30 = load i32, ptr %v1101614, align 4, !tbaa !55 %cmp1111615 = icmp eq i32 %30, 0 br i1 %cmp1111615, label %for.body107.for.end204.loopexit_crit_edge, label %for.cond113.preheader for.inc101: ; preds = %for.body84.lr.ph, %for.inc101 %indvars.iv1298 = phi i64 [ 0, %for.body84.lr.ph ], [ %indvars.iv.next1299, %for.inc101 ] %call87 = call noalias ptr @malloc(i64 noundef %mul86) #15 %arrayidx89 = getelementptr inbounds ptr, ptr %call80, i64 %indvars.iv1298 store ptr %call87, ptr %arrayidx89, align 8, !tbaa !13 call void @llvm.memset.p0.i64(ptr align 4 %call87, i8 0, i64 %29, i1 false), !tbaa !33 %indvars.iv.next1299 = add nuw nsw i64 %indvars.iv1298, 1 %exitcond1302.not = icmp eq i64 %indvars.iv.next1299, %28 br i1 %exitcond1302.not, label %for.cond104.preheader, label %for.inc101, !llvm.loop !74 for.body107: ; preds = %for.inc202 %v110 = getelementptr inbounds %struct.pair, ptr %call48, i64 %indvars.iv.next1325, i32 1 %31 = load i32, ptr %v110, align 4, !tbaa !55 %cmp111 = icmp eq i32 %31, 0 br i1 %cmp111, label %for.body107.for.end204.loopexit_crit_edge, label %for.cond113.preheader, !llvm.loop !75 for.body107.for.end204.loopexit_crit_edge: ; preds = %for.body107, %for.body107.preheader %.lcssa1603 = phi i32 [ %27, %for.body107.preheader ], [ %51, %for.body107 ] %.pre1498 = sext i32 %.lcssa1603 to i64 br label %for.end204.loopexit for.cond113.preheader: ; preds = %for.body107.preheader, %for.body107 %32 = phi i32 [ %31, %for.body107 ], [ %30, %for.body107.preheader ] %v1101617 = phi ptr [ %v110, %for.body107 ], [ %v1101614, %for.body107.preheader ] %indvars.iv13241616 = phi i64 [ %indvars.iv.next1325, %for.body107 ], [ 0, %for.body107.preheader ] %cmp1171175 = icmp sgt i32 %32, 0 br i1 %cmp1171175, label %for.body119.lr.ph, label %for.end126 for.body119.lr.ph: ; preds = %for.cond113.preheader %arrayidx121 = getelementptr inbounds ptr, ptr %call80, i64 %indvars.iv13241616 %33 = load ptr, ptr %arrayidx121, align 8, !tbaa !13 br label %for.body119 for.body119: ; preds = %for.body119.lr.ph, %for.body119 %indvars.iv1303 = phi i64 [ 0, %for.body119.lr.ph ], [ %indvars.iv.next1304, %for.body119 ] %arrayidx123 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv1303 store i32 1, ptr %arrayidx123, align 4, !tbaa !33 %indvars.iv.next1304 = add nuw nsw i64 %indvars.iv1303, 1 %34 = load i32, ptr %v1101617, align 4, !tbaa !55 %35 = sext i32 %34 to i64 %cmp117 = icmp slt i64 %indvars.iv.next1304, %35 br i1 %cmp117, label %for.body119, label %for.end126, !llvm.loop !76 for.end126: ; preds = %for.body119, %for.cond113.preheader %j.1.lcssa = phi i64 [ -1, %for.cond113.preheader ], [ %indvars.iv1303, %for.body119 ] %sext = shl i64 %j.1.lcssa, 32 %idxprom128 = ashr exact i64 %sext, 32 %v130 = getelementptr inbounds %struct.pair, ptr %call45, i64 %idxprom128, i32 1 %36 = load i32, ptr %v130, align 4, !tbaa !55 br label %for.cond131 for.cond131: ; preds = %for.cond131, %for.end126 %indvars.iv1306 = phi i64 [ %indvars.iv.next1307, %for.cond131 ], [ 0, %for.end126 ] %v134 = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv1306, i32 1 %37 = load i32, ptr %v134, align 4, !tbaa !55 %cmp135.not = icmp eq i32 %37, %36 %indvars.iv.next1307 = add nuw i64 %indvars.iv1306, 1 br i1 %cmp135.not, label %for.end140, label %for.cond131, !llvm.loop !77 for.end140: ; preds = %for.cond131 %38 = load i32, ptr %N, align 4, !tbaa !33 %39 = sext i32 %38 to i64 br label %for.cond142 for.cond142: ; preds = %for.cond142, %for.end140 %indvars.iv1309 = phi i64 [ %indvars.iv.next1310, %for.cond142 ], [ %39, %for.end140 ] %indvars.iv.next1310 = add nsw i64 %indvars.iv1309, -1 %v145 = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv.next1310, i32 1 %40 = load i32, ptr %v145, align 4, !tbaa !55 %cmp146.not = icmp eq i32 %40, %36 br i1 %cmp146.not, label %for.cond151.preheader, label %for.cond142, !llvm.loop !78 for.cond151.preheader: ; preds = %for.cond142 %41 = trunc i64 %indvars.iv1306 to i32 %42 = trunc i64 %indvars.iv.next1310 to i32 %sub152 = sub nsw i32 %42, %41 %cmp153.not1178 = icmp slt i32 %sub152, -1 br i1 %cmp153.not1178, label %for.cond179.preheader, label %for.body155.lr.ph for.body155.lr.ph: ; preds = %for.cond151.preheader %div = sdiv i32 %sub152, 2 %arrayidx157 = getelementptr inbounds ptr, ptr %call80, i64 %indvars.iv13241616 %43 = load ptr, ptr %arrayidx157, align 8, !tbaa !13 %sext1499 = shl i64 %indvars.iv1306, 32 %44 = ashr exact i64 %sext1499, 32 %sext1500 = shl i64 %indvars.iv.next1310, 32 %45 = ashr exact i64 %sext1500, 32 %46 = add nuw nsw i32 %div, 1 %wide.trip.count1317 = zext i32 %46 to i64 %invariant.gep = getelementptr i32, ptr %43, i64 %44 %xtraiter = and i64 %wide.trip.count1317, 1 %sub152.off = add i32 %sub152, 1 %47 = icmp ult i32 %sub152.off, 3 br i1 %47, label %for.cond179.preheader.loopexit.unr-lcssa, label %for.body155.lr.ph.new for.body155.lr.ph.new: ; preds = %for.body155.lr.ph %unroll_iter = and i64 %wide.trip.count1317, 4294967294 br label %for.body155 for.cond179.preheader.loopexit.unr-lcssa: ; preds = %for.body155, %for.body155.lr.ph %indvars.iv1312.unr = phi i64 [ 0, %for.body155.lr.ph ], [ %indvars.iv.next1313.1, %for.body155 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond179.preheader.loopexit, label %for.body155.epil for.body155.epil: ; preds = %for.cond179.preheader.loopexit.unr-lcssa %gep.epil = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv1312.unr %48 = load i32, ptr %gep.epil, align 4, !tbaa !33 %49 = sub nsw i64 %45, %indvars.iv1312.unr %arrayidx165.epil = getelementptr inbounds i32, ptr %43, i64 %49 %50 = load i32, ptr %arrayidx165.epil, align 4, !tbaa !33 store i32 %50, ptr %gep.epil, align 4, !tbaa !33 store i32 %48, ptr %arrayidx165.epil, align 4, !tbaa !33 br label %for.cond179.preheader.loopexit for.cond179.preheader.loopexit: ; preds = %for.cond179.preheader.loopexit.unr-lcssa, %for.body155.epil %.pre = load i32, ptr %N, align 4, !tbaa !33 br label %for.cond179.preheader for.cond179.preheader: ; preds = %for.cond179.preheader.loopexit, %for.cond151.preheader %51 = phi i32 [ %.pre, %for.cond179.preheader.loopexit ], [ %38, %for.cond151.preheader ] %cmp1801180 = icmp sgt i32 %51, 0 br i1 %cmp1801180, label %for.body182.lr.ph, label %for.inc202 for.body182.lr.ph: ; preds = %for.cond179.preheader %arrayidx184 = getelementptr inbounds ptr, ptr %call80, i64 %indvars.iv13241616 %52 = load ptr, ptr %arrayidx184, align 8, !tbaa !13 %wide.trip.count1322 = zext i32 %51 to i64 br label %for.body182 for.body155: ; preds = %for.body155, %for.body155.lr.ph.new %indvars.iv1312 = phi i64 [ 0, %for.body155.lr.ph.new ], [ %indvars.iv.next1313.1, %for.body155 ] %niter = phi i64 [ 0, %for.body155.lr.ph.new ], [ %niter.next.1, %for.body155 ] %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv1312 %53 = load i32, ptr %gep, align 4, !tbaa !33 %54 = sub nsw i64 %45, %indvars.iv1312 %arrayidx165 = getelementptr inbounds i32, ptr %43, i64 %54 %55 = load i32, ptr %arrayidx165, align 4, !tbaa !33 store i32 %55, ptr %gep, align 4, !tbaa !33 store i32 %53, ptr %arrayidx165, align 4, !tbaa !33 %indvars.iv.next1313 = or i64 %indvars.iv1312, 1 %gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next1313 %56 = load i32, ptr %gep.1, align 4, !tbaa !33 %57 = sub nsw i64 %45, %indvars.iv.next1313 %arrayidx165.1 = getelementptr inbounds i32, ptr %43, i64 %57 %58 = load i32, ptr %arrayidx165.1, align 4, !tbaa !33 store i32 %58, ptr %gep.1, align 4, !tbaa !33 store i32 %56, ptr %arrayidx165.1, align 4, !tbaa !33 %indvars.iv.next1313.1 = add nuw nsw i64 %indvars.iv1312, 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.cond179.preheader.loopexit.unr-lcssa, label %for.body155, !llvm.loop !79 for.cond179: ; preds = %for.body182 %indvars.iv.next1320 = add nuw nsw i64 %indvars.iv1319, 1 %exitcond1323.not = icmp eq i64 %indvars.iv.next1320, %wide.trip.count1322 br i1 %exitcond1323.not, label %for.inc202, label %for.body182, !llvm.loop !80 for.body182: ; preds = %for.body182.lr.ph, %for.cond179 %indvars.iv1319 = phi i64 [ 0, %for.body182.lr.ph ], [ %indvars.iv.next1320, %for.cond179 ] %arrayidx186 = getelementptr inbounds i32, ptr %52, i64 %indvars.iv1319 %59 = load i32, ptr %arrayidx186, align 4, !tbaa !33 %v189 = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv1319, i32 1 %60 = load i32, ptr %v189, align 4, !tbaa !55 %sub190 = sub nsw i32 %60, %59 store i32 %sub190, ptr %v189, align 4, !tbaa !55 %cmp194 = icmp slt i32 %sub190, 0 br i1 %cmp194, label %if.then196, label %for.cond179 if.then196: ; preds = %for.body182 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup748 for.inc202: ; preds = %for.cond179, %for.cond179.preheader %indvars.iv.next1325 = add nuw nsw i64 %indvars.iv13241616, 1 %61 = sext i32 %51 to i64 %cmp105 = icmp slt i64 %indvars.iv.next1325, %61 br i1 %cmp105, label %for.body107, label %for.end204.loopexit, !llvm.loop !75 for.end204.loopexit: ; preds = %for.inc202, %for.body107.for.end204.loopexit_crit_edge %.pre1484.pre-phi = phi i64 [ %.pre1498, %for.body107.for.end204.loopexit_crit_edge ], [ %61, %for.inc202 ] %.lcssa1158.ph = phi i32 [ %.lcssa1603, %for.body107.for.end204.loopexit_crit_edge ], [ %51, %for.inc202 ] %.pre1485 = shl nsw i64 %.pre1484.pre-phi, 3 br label %for.end204 for.end204: ; preds = %for.end75, %for.end204.loopexit, %for.cond104.preheader %mul206.pre-phi = phi i64 [ %.pre1485, %for.end204.loopexit ], [ %mul79, %for.cond104.preheader ], [ %mul79, %for.end75 ] %conv205.pre-phi = phi i64 [ %.pre1484.pre-phi, %for.end204.loopexit ], [ %conv78, %for.cond104.preheader ], [ %conv78, %for.end75 ] %62 = phi i32 [ %.lcssa1158.ph, %for.end204.loopexit ], [ %27, %for.cond104.preheader ], [ %27, %for.end75 ] %call207 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %call210 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %call213 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %call216 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %call219 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %cmp2211188 = icmp sgt i32 %62, 0 br i1 %cmp2211188, label %for.body223.lr.ph, label %while.cond.preheader for.body223.lr.ph: ; preds = %for.end204 %mul225 = shl nsw i64 %conv205.pre-phi, 2 %wide.trip.count1335 = zext i32 %62 to i64 br label %for.body252.preheader for.cond266.preheader: ; preds = %for.inc263 br i1 %cmp2211188, label %for.cond270.preheader, label %while.cond.preheader for.body252.preheader: ; preds = %for.inc263, %for.body223.lr.ph %indvars.iv1332 = phi i64 [ 0, %for.body223.lr.ph ], [ %indvars.iv.next1333, %for.inc263 ] %call226 = call noalias ptr @malloc(i64 noundef %mul225) #15 %arrayidx228 = getelementptr inbounds ptr, ptr %call207, i64 %indvars.iv1332 store ptr %call226, ptr %arrayidx228, align 8, !tbaa !13 %call231 = call noalias ptr @malloc(i64 noundef %conv205.pre-phi) #15 %arrayidx233 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1332 store ptr %call231, ptr %arrayidx233, align 8, !tbaa !13 %call236 = call noalias ptr @malloc(i64 noundef %mul225) #15 %arrayidx238 = getelementptr inbounds ptr, ptr %call213, i64 %indvars.iv1332 store ptr %call236, ptr %arrayidx238, align 8, !tbaa !13 %call241 = call noalias ptr @malloc(i64 noundef %mul225) #15 %arrayidx243 = getelementptr inbounds ptr, ptr %call216, i64 %indvars.iv1332 store ptr %call241, ptr %arrayidx243, align 8, !tbaa !13 %call246 = call noalias ptr @malloc(i64 noundef %mul206.pre-phi) #15 %arrayidx248 = getelementptr inbounds ptr, ptr %call219, i64 %indvars.iv1332 store ptr %call246, ptr %arrayidx248, align 8, !tbaa !13 br label %for.body252 for.body252: ; preds = %for.body252.preheader, %for.body252 %indvars.iv1327 = phi i64 [ 0, %for.body252.preheader ], [ %indvars.iv.next1328, %for.body252 ] %call255 = call noalias ptr @malloc(i64 noundef %mul225) #15 %arrayidx259 = getelementptr inbounds ptr, ptr %call246, i64 %indvars.iv1327 store ptr %call255, ptr %arrayidx259, align 8, !tbaa !13 %indvars.iv.next1328 = add nuw nsw i64 %indvars.iv1327, 1 %exitcond1331.not = icmp eq i64 %indvars.iv.next1328, %wide.trip.count1335 br i1 %exitcond1331.not, label %for.inc263, label %for.body252, !llvm.loop !81 for.inc263: ; preds = %for.body252 %indvars.iv.next1333 = add nuw nsw i64 %indvars.iv1332, 1 %exitcond1336.not = icmp eq i64 %indvars.iv.next1333, %wide.trip.count1335 br i1 %exitcond1336.not, label %for.cond266.preheader, label %for.body252.preheader, !llvm.loop !82 for.cond270.preheader: ; preds = %for.cond266.preheader, %for.inc291 %63 = phi i32 [ %71, %for.inc291 ], [ %62, %for.cond266.preheader ] %indvars.iv1340 = phi i64 [ %indvars.iv.next1341, %for.inc291 ], [ 0, %for.cond266.preheader ] %cmp2711190 = icmp sgt i32 %63, 0 br i1 %cmp2711190, label %for.body273.lr.ph, label %for.cond270.preheader.for.inc291_crit_edge for.cond270.preheader.for.inc291_crit_edge: ; preds = %for.cond270.preheader %.pre1487 = sext i32 %63 to i64 br label %for.inc291 for.body273.lr.ph: ; preds = %for.cond270.preheader %arrayidx275 = getelementptr inbounds ptr, ptr %call80, i64 %indvars.iv1340 %64 = load ptr, ptr %arrayidx275, align 8, !tbaa !13 %arrayidx279 = getelementptr inbounds %struct.pair, ptr %call48, i64 %indvars.iv1340 br label %for.body273 for.body273: ; preds = %for.body273.lr.ph, %for.body273 %indvars.iv1337 = phi i64 [ 0, %for.body273.lr.ph ], [ %indvars.iv.next1338, %for.body273 ] %arrayidx277 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv1337 %65 = load i32, ptr %arrayidx277, align 4, !tbaa !33 %66 = load i32, ptr %arrayidx279, align 4, !tbaa !72 %idxprom281 = sext i32 %66 to i64 %arrayidx282 = getelementptr inbounds ptr, ptr %call207, i64 %idxprom281 %67 = load ptr, ptr %arrayidx282, align 8, !tbaa !13 %arrayidx284 = getelementptr inbounds %struct.pair, ptr %call45, i64 %indvars.iv1337 %68 = load i32, ptr %arrayidx284, align 4, !tbaa !72 %idxprom286 = sext i32 %68 to i64 %arrayidx287 = getelementptr inbounds i32, ptr %67, i64 %idxprom286 store i32 %65, ptr %arrayidx287, align 4, !tbaa !33 %indvars.iv.next1338 = add nuw nsw i64 %indvars.iv1337, 1 %69 = load i32, ptr %N, align 4, !tbaa !33 %70 = sext i32 %69 to i64 %cmp271 = icmp slt i64 %indvars.iv.next1338, %70 br i1 %cmp271, label %for.body273, label %for.inc291, !llvm.loop !83 for.inc291: ; preds = %for.body273, %for.cond270.preheader.for.inc291_crit_edge %.pre-phi = phi i64 [ %.pre1487, %for.cond270.preheader.for.inc291_crit_edge ], [ %70, %for.body273 ] %71 = phi i32 [ %63, %for.cond270.preheader.for.inc291_crit_edge ], [ %69, %for.body273 ] %indvars.iv.next1341 = add nuw nsw i64 %indvars.iv1340, 1 %cmp267 = icmp slt i64 %indvars.iv.next1341, %.pre-phi br i1 %cmp267, label %for.cond270.preheader, label %while.cond.preheader, !llvm.loop !84 while.cond.preheader: ; preds = %for.inc291, %for.end204, %for.cond266.preheader %.ph = phi i32 [ %62, %for.end204 ], [ %62, %for.cond266.preheader ], [ %71, %for.inc291 ] br label %while.cond while.cond: ; preds = %while.cond.preheader, %for.end579 %72 = phi i32 [ %184, %for.end579 ], [ %.ph, %while.cond.preheader ] call void @setA(i32 noundef %72, ptr noundef %call7, ptr noundef %call10, ptr noundef %call1, ptr noundef %call4, ptr noundef %call207, ptr noundef %call210) %73 = load i32, ptr %N, align 4, !tbaa !33 %cmp2951196 = icmp sgt i32 %73, 0 br i1 %cmp2951196, label %for.cond298.preheader, label %while.end for.cond312.preheader: ; preds = %for.inc309 %cmp3131210 = icmp sgt i32 %78, 0 br i1 %cmp3131210, label %for.cond316.preheader, label %while.end for.cond298.preheader: ; preds = %while.cond, %for.inc309 %74 = phi i32 [ %78, %for.inc309 ], [ %73, %while.cond ] %indvars.iv1346 = phi i64 [ %indvars.iv.next1347, %for.inc309 ], [ 0, %while.cond ] %cmp2991194 = icmp sgt i32 %74, 0 br i1 %cmp2991194, label %for.body301.lr.ph, label %for.cond298.preheader.for.inc309_crit_edge for.cond298.preheader.for.inc309_crit_edge: ; preds = %for.cond298.preheader %.pre1488 = sext i32 %74 to i64 br label %for.inc309 for.body301.lr.ph: ; preds = %for.cond298.preheader %arrayidx303 = getelementptr inbounds ptr, ptr %call216, i64 %indvars.iv1346 %75 = load ptr, ptr %arrayidx303, align 8, !tbaa !13 br label %for.body301 for.body301: ; preds = %for.body301.lr.ph, %for.body301 %indvars.iv1343 = phi i64 [ 0, %for.body301.lr.ph ], [ %indvars.iv.next1344, %for.body301 ] %arrayidx305 = getelementptr inbounds i32, ptr %75, i64 %indvars.iv1343 store i32 0, ptr %arrayidx305, align 4, !tbaa !33 %indvars.iv.next1344 = add nuw nsw i64 %indvars.iv1343, 1 %76 = load i32, ptr %N, align 4, !tbaa !33 %77 = sext i32 %76 to i64 %cmp299 = icmp slt i64 %indvars.iv.next1344, %77 br i1 %cmp299, label %for.body301, label %for.inc309, !llvm.loop !86 for.inc309: ; preds = %for.body301, %for.cond298.preheader.for.inc309_crit_edge %.pre-phi1489 = phi i64 [ %.pre1488, %for.cond298.preheader.for.inc309_crit_edge ], [ %77, %for.body301 ] %78 = phi i32 [ %74, %for.cond298.preheader.for.inc309_crit_edge ], [ %76, %for.body301 ] %indvars.iv.next1347 = add nuw nsw i64 %indvars.iv1346, 1 %cmp295 = icmp slt i64 %indvars.iv.next1347, %.pre-phi1489 br i1 %cmp295, label %for.cond298.preheader, label %for.cond312.preheader, !llvm.loop !87 for.cond416.preheader: ; preds = %for.inc413 %cmp4171224 = icmp sgt i32 %120, 0 br i1 %cmp4171224, label %for.cond420.preheader, label %while.end for.cond316.preheader: ; preds = %for.cond312.preheader, %for.inc413 %79 = phi i32 [ %120, %for.inc413 ], [ %78, %for.cond312.preheader ] %indvars.iv1366 = phi i64 [ %indvars.iv.next1367, %for.inc413 ], [ 0, %for.cond312.preheader ] %cmp3171201 = icmp sgt i32 %79, 0 br i1 %cmp3171201, label %for.body319.lr.ph, label %for.inc413 for.body319.lr.ph: ; preds = %for.cond316.preheader %arrayidx321 = getelementptr inbounds ptr, ptr %call207, i64 %indvars.iv1366 %80 = load ptr, ptr %arrayidx321, align 8, !tbaa !13 %arrayidx333 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1366 %arrayidx342 = getelementptr inbounds ptr, ptr %call219, i64 %indvars.iv1366 %arrayidx346 = getelementptr inbounds ptr, ptr %call216, i64 %indvars.iv1366 %81 = trunc i64 %indvars.iv1366 to i32 br label %for.body319 for.cond365.preheader: ; preds = %for.inc361 %cmp3661207 = icmp sgt i32 %107, 0 br i1 %cmp3661207, label %for.body368.lr.ph, label %for.inc413 for.body368.lr.ph: ; preds = %for.cond365.preheader %arrayidx370 = getelementptr inbounds ptr, ptr %call207, i64 %indvars.iv1366 %82 = load ptr, ptr %arrayidx370, align 8, !tbaa !13 %arrayidx382 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1366 %arrayidx391 = getelementptr inbounds ptr, ptr %call219, i64 %indvars.iv1366 %arrayidx395 = getelementptr inbounds ptr, ptr %call216, i64 %indvars.iv1366 %83 = add nsw i32 %107, -2 %84 = zext i32 %107 to i64 %85 = trunc i64 %indvars.iv1366 to i32 br label %for.body368 for.body319: ; preds = %for.body319.lr.ph, %for.inc361 %86 = phi i32 [ %79, %for.body319.lr.ph ], [ %106, %for.inc361 ] %87 = phi i32 [ %79, %for.body319.lr.ph ], [ %107, %for.inc361 ] %indvars.iv1354 = phi i64 [ 0, %for.body319.lr.ph ], [ %89, %for.inc361 ] %indvars.iv1349 = phi i64 [ 1, %for.body319.lr.ph ], [ %indvars.iv.next1350, %for.inc361 ] %arrayidx323 = getelementptr inbounds i32, ptr %80, i64 %indvars.iv1354 %88 = load i32, ptr %arrayidx323, align 4, !tbaa !33 %cmp324 = icmp eq i32 %88, 1 %89 = add nuw nsw i64 %indvars.iv1354, 1 %90 = sext i32 %87 to i64 %cmp3291199 = icmp slt i64 %89, %90 %or.cond = select i1 %cmp324, i1 %cmp3291199, i1 false br i1 %or.cond, label %for.body331.lr.ph, label %for.inc361 for.body331.lr.ph: ; preds = %for.body319 %91 = load ptr, ptr %arrayidx333, align 8, !tbaa !13 br label %for.body331 for.body331: ; preds = %for.body331.lr.ph, %for.inc357 %92 = phi i32 [ %86, %for.body331.lr.ph ], [ %102, %for.inc357 ] %93 = phi i32 [ %87, %for.body331.lr.ph ], [ %103, %for.inc357 ] %94 = phi i32 [ %87, %for.body331.lr.ph ], [ %104, %for.inc357 ] %indvars.iv1351 = phi i64 [ %indvars.iv1349, %for.body331.lr.ph ], [ %indvars.iv.next1352, %for.inc357 ] %arrayidx335 = getelementptr inbounds i8, ptr %91, i64 %indvars.iv1351 %95 = load i8, ptr %arrayidx335, align 1, !tbaa !58 %cmp337 = icmp eq i8 %95, 76 br i1 %cmp337, label %if.then339, label %for.inc357 if.then339: ; preds = %for.body331 %mul.i = mul nsw i32 %94, %81 %96 = trunc i64 %indvars.iv1351 to i32 %add.i = add nsw i32 %mul.i, %96 %97 = load ptr, ptr %arrayidx342, align 8, !tbaa !13 %arrayidx344 = getelementptr inbounds ptr, ptr %97, i64 %indvars.iv1354 %98 = load ptr, ptr %arrayidx344, align 8, !tbaa !13 %99 = load ptr, ptr %arrayidx346, align 8, !tbaa !13 %arrayidx348 = getelementptr inbounds i32, ptr %99, i64 %indvars.iv1354 %100 = load i32, ptr %arrayidx348, align 4, !tbaa !33 %idxprom349 = sext i32 %100 to i64 %arrayidx350 = getelementptr inbounds i32, ptr %98, i64 %idxprom349 store i32 %add.i, ptr %arrayidx350, align 4, !tbaa !33 %101 = load i32, ptr %arrayidx348, align 4, !tbaa !33 %inc355 = add nsw i32 %101, 1 store i32 %inc355, ptr %arrayidx348, align 4, !tbaa !33 %.pre1479 = load i32, ptr %N, align 4, !tbaa !33 br label %for.inc357 for.inc357: ; preds = %for.body331, %if.then339 %102 = phi i32 [ %92, %for.body331 ], [ %.pre1479, %if.then339 ] %103 = phi i32 [ %93, %for.body331 ], [ %.pre1479, %if.then339 ] %104 = phi i32 [ %94, %for.body331 ], [ %.pre1479, %if.then339 ] %indvars.iv.next1352 = add nuw nsw i64 %indvars.iv1351, 1 %105 = trunc i64 %indvars.iv.next1352 to i32 %cmp329 = icmp sgt i32 %104, %105 br i1 %cmp329, label %for.body331, label %for.inc361, !llvm.loop !88 for.inc361: ; preds = %for.inc357, %for.body319 %106 = phi i32 [ %86, %for.body319 ], [ %102, %for.inc357 ] %107 = phi i32 [ %87, %for.body319 ], [ %103, %for.inc357 ] %108 = sext i32 %107 to i64 %cmp317 = icmp slt i64 %89, %108 %indvars.iv.next1350 = add nuw nsw i64 %indvars.iv1349, 1 br i1 %cmp317, label %for.body319, label %for.cond365.preheader, !llvm.loop !89 for.body368: ; preds = %for.body368.lr.ph, %for.inc410 %indvars.iv1363 = phi i64 [ %84, %for.body368.lr.ph ], [ %indvars.iv.next1364, %for.inc410 ] %indvars.iv1358 = phi i32 [ %83, %for.body368.lr.ph ], [ %indvars.iv.next1359, %for.inc410 ] %109 = zext i32 %indvars.iv1358 to i64 %indvars.iv.next1364 = add nsw i64 %indvars.iv1363, -1 %idxprom371 = and i64 %indvars.iv.next1364, 4294967295 %arrayidx372 = getelementptr inbounds i32, ptr %82, i64 %idxprom371 %110 = load i32, ptr %arrayidx372, align 4, !tbaa !33 %cmp373 = icmp eq i32 %110, 1 br i1 %cmp373, label %if.then375, label %for.inc410 if.then375: ; preds = %for.body368 %cmp3781204 = icmp ugt i64 %indvars.iv1363, 1 br i1 %cmp3781204, label %for.body380.lr.ph, label %for.inc413.loopexit for.body380.lr.ph: ; preds = %if.then375 %111 = load ptr, ptr %arrayidx382, align 8, !tbaa !13 br label %for.body380 for.body380: ; preds = %for.body380.lr.ph, %for.inc406 %indvars.iv1360 = phi i64 [ %109, %for.body380.lr.ph ], [ %indvars.iv.next1361, %for.inc406 ] %arrayidx384 = getelementptr inbounds i8, ptr %111, i64 %indvars.iv1360 %112 = load i8, ptr %arrayidx384, align 1, !tbaa !58 %cmp386 = icmp eq i8 %112, 82 br i1 %cmp386, label %if.then388, label %for.body380.for.inc406_crit_edge for.body380.for.inc406_crit_edge: ; preds = %for.body380 %.pre1491 = trunc i64 %indvars.iv1360 to i32 br label %for.inc406 if.then388: ; preds = %for.body380 %113 = load i32, ptr %N, align 4, !tbaa !33 %mul.i1085 = mul nsw i32 %113, %85 %114 = trunc i64 %indvars.iv1360 to i32 %add.i1086 = add nsw i32 %mul.i1085, %114 %115 = load ptr, ptr %arrayidx391, align 8, !tbaa !13 %arrayidx393 = getelementptr inbounds ptr, ptr %115, i64 %idxprom371 %116 = load ptr, ptr %arrayidx393, align 8, !tbaa !13 %117 = load ptr, ptr %arrayidx395, align 8, !tbaa !13 %arrayidx397 = getelementptr inbounds i32, ptr %117, i64 %idxprom371 %118 = load i32, ptr %arrayidx397, align 4, !tbaa !33 %idxprom398 = sext i32 %118 to i64 %arrayidx399 = getelementptr inbounds i32, ptr %116, i64 %idxprom398 store i32 %add.i1086, ptr %arrayidx399, align 4, !tbaa !33 %119 = load i32, ptr %arrayidx397, align 4, !tbaa !33 %inc404 = add nsw i32 %119, 1 store i32 %inc404, ptr %arrayidx397, align 4, !tbaa !33 br label %for.inc406 for.inc406: ; preds = %for.body380.for.inc406_crit_edge, %if.then388 %.pre-phi1492 = phi i32 [ %.pre1491, %for.body380.for.inc406_crit_edge ], [ %114, %if.then388 ] %indvars.iv.next1361 = add nsw i64 %indvars.iv1360, -1 %cmp378 = icmp sgt i32 %.pre-phi1492, 0 br i1 %cmp378, label %for.body380, label %for.inc410, !llvm.loop !90 for.inc410: ; preds = %for.inc406, %for.body368 %cmp366 = icmp sgt i64 %indvars.iv1363, 1 %indvars.iv.next1359 = add nsw i32 %indvars.iv1358, -1 br i1 %cmp366, label %for.body368, label %for.inc413.loopexit, !llvm.loop !91 for.inc413.loopexit: ; preds = %if.then375, %for.inc410 %.pre1480 = load i32, ptr %N, align 4, !tbaa !33 br label %for.inc413 for.inc413: ; preds = %for.cond316.preheader, %for.inc413.loopexit, %for.cond365.preheader %120 = phi i32 [ %.pre1480, %for.inc413.loopexit ], [ %106, %for.cond365.preheader ], [ %79, %for.cond316.preheader ] %indvars.iv.next1367 = add nuw nsw i64 %indvars.iv1366, 1 %121 = sext i32 %120 to i64 %cmp313 = icmp slt i64 %indvars.iv.next1367, %121 br i1 %cmp313, label %for.cond316.preheader, label %for.cond416.preheader, !llvm.loop !92 for.cond520.preheader: ; preds = %for.inc517 %cmp5211228 = icmp sgt i32 %163, 0 br i1 %cmp5211228, label %for.cond524.preheader, label %while.end for.cond420.preheader: ; preds = %for.cond416.preheader, %for.inc517 %122 = phi i32 [ %163, %for.inc517 ], [ %120, %for.cond416.preheader ] %indvars.iv1391 = phi i64 [ %indvars.iv.next1392, %for.inc517 ], [ 0, %for.cond416.preheader ] %cmp4211215 = icmp sgt i32 %122, 0 br i1 %cmp4211215, label %for.body423.lr.ph, label %for.inc517 for.body423.lr.ph: ; preds = %for.cond420.preheader %123 = trunc i64 %indvars.iv1391 to i32 br label %for.body423 for.cond469.preheader: ; preds = %for.inc465 %cmp4701221 = icmp sgt i32 %149, 0 br i1 %cmp4701221, label %for.body472.lr.ph, label %for.inc517 for.body472.lr.ph: ; preds = %for.cond469.preheader %124 = add nsw i32 %149, -2 %125 = zext i32 %149 to i64 %126 = trunc i64 %indvars.iv1391 to i32 br label %for.body472 for.body423: ; preds = %for.body423.lr.ph, %for.inc465 %127 = phi i32 [ %122, %for.body423.lr.ph ], [ %148, %for.inc465 ] %128 = phi i32 [ %122, %for.body423.lr.ph ], [ %149, %for.inc465 ] %indvars.iv1376 = phi i64 [ 0, %for.body423.lr.ph ], [ %131, %for.inc465 ] %indvars.iv1370 = phi i64 [ 1, %for.body423.lr.ph ], [ %indvars.iv.next1371, %for.inc465 ] %arrayidx425 = getelementptr inbounds ptr, ptr %call207, i64 %indvars.iv1376 %129 = load ptr, ptr %arrayidx425, align 8, !tbaa !13 %arrayidx427 = getelementptr inbounds i32, ptr %129, i64 %indvars.iv1391 %130 = load i32, ptr %arrayidx427, align 4, !tbaa !33 %cmp428 = icmp eq i32 %130, 0 %131 = add nuw nsw i64 %indvars.iv1376, 1 %132 = sext i32 %128 to i64 %cmp4331213 = icmp slt i64 %131, %132 %or.cond1576 = select i1 %cmp428, i1 %cmp4331213, i1 false br i1 %or.cond1576, label %for.body435.lr.ph, label %for.inc465 for.body435.lr.ph: ; preds = %for.body423 %arrayidx446 = getelementptr inbounds ptr, ptr %call219, i64 %indvars.iv1376 %arrayidx450 = getelementptr inbounds ptr, ptr %call216, i64 %indvars.iv1376 br label %for.body435 for.body435: ; preds = %for.body435.lr.ph, %for.inc461 %133 = phi i32 [ %127, %for.body435.lr.ph ], [ %144, %for.inc461 ] %134 = phi i32 [ %128, %for.body435.lr.ph ], [ %145, %for.inc461 ] %135 = phi i32 [ %128, %for.body435.lr.ph ], [ %146, %for.inc461 ] %indvars.iv1372 = phi i64 [ %indvars.iv1370, %for.body435.lr.ph ], [ %indvars.iv.next1373, %for.inc461 ] %arrayidx437 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1372 %136 = load ptr, ptr %arrayidx437, align 8, !tbaa !13 %arrayidx439 = getelementptr inbounds i8, ptr %136, i64 %indvars.iv1391 %137 = load i8, ptr %arrayidx439, align 1, !tbaa !58 %cmp441 = icmp eq i8 %137, 85 br i1 %cmp441, label %if.then443, label %for.inc461 if.then443: ; preds = %for.body435 %138 = trunc i64 %indvars.iv1372 to i32 %mul.i1087 = mul nsw i32 %135, %138 %add.i1088 = add nsw i32 %mul.i1087, %123 %139 = load ptr, ptr %arrayidx446, align 8, !tbaa !13 %arrayidx448 = getelementptr inbounds ptr, ptr %139, i64 %indvars.iv1391 %140 = load ptr, ptr %arrayidx448, align 8, !tbaa !13 %141 = load ptr, ptr %arrayidx450, align 8, !tbaa !13 %arrayidx452 = getelementptr inbounds i32, ptr %141, i64 %indvars.iv1391 %142 = load i32, ptr %arrayidx452, align 4, !tbaa !33 %idxprom453 = sext i32 %142 to i64 %arrayidx454 = getelementptr inbounds i32, ptr %140, i64 %idxprom453 store i32 %add.i1088, ptr %arrayidx454, align 4, !tbaa !33 %143 = load i32, ptr %arrayidx452, align 4, !tbaa !33 %inc459 = add nsw i32 %143, 1 store i32 %inc459, ptr %arrayidx452, align 4, !tbaa !33 %.pre1481 = load i32, ptr %N, align 4, !tbaa !33 br label %for.inc461 for.inc461: ; preds = %for.body435, %if.then443 %144 = phi i32 [ %133, %for.body435 ], [ %.pre1481, %if.then443 ] %145 = phi i32 [ %134, %for.body435 ], [ %.pre1481, %if.then443 ] %146 = phi i32 [ %135, %for.body435 ], [ %.pre1481, %if.then443 ] %indvars.iv.next1373 = add nuw nsw i64 %indvars.iv1372, 1 %147 = trunc i64 %indvars.iv.next1373 to i32 %cmp433 = icmp sgt i32 %146, %147 br i1 %cmp433, label %for.body435, label %for.inc465, !llvm.loop !93 for.inc465: ; preds = %for.inc461, %for.body423 %148 = phi i32 [ %127, %for.body423 ], [ %144, %for.inc461 ] %149 = phi i32 [ %128, %for.body423 ], [ %145, %for.inc461 ] %150 = sext i32 %149 to i64 %cmp421 = icmp slt i64 %131, %150 %indvars.iv.next1371 = add nuw nsw i64 %indvars.iv1370, 1 br i1 %cmp421, label %for.body423, label %for.cond469.preheader, !llvm.loop !94 for.body472: ; preds = %for.body472.lr.ph, %for.inc514 %indvars.iv1387 = phi i64 [ %125, %for.body472.lr.ph ], [ %indvars.iv.next1388, %for.inc514 ] %indvars.iv1381 = phi i32 [ %124, %for.body472.lr.ph ], [ %indvars.iv.next1382, %for.inc514 ] %151 = zext i32 %indvars.iv1381 to i64 %indvars.iv.next1388 = add nsw i64 %indvars.iv1387, -1 %idxprom473 = and i64 %indvars.iv.next1388, 4294967295 %arrayidx474 = getelementptr inbounds ptr, ptr %call207, i64 %idxprom473 %152 = load ptr, ptr %arrayidx474, align 8, !tbaa !13 %arrayidx476 = getelementptr inbounds i32, ptr %152, i64 %indvars.iv1391 %153 = load i32, ptr %arrayidx476, align 4, !tbaa !33 %cmp477 = icmp eq i32 %153, 0 br i1 %cmp477, label %if.then479, label %for.inc514 if.then479: ; preds = %for.body472 %cmp4821218 = icmp ugt i64 %indvars.iv1387, 1 br i1 %cmp4821218, label %for.body484.lr.ph, label %for.inc517.loopexit for.body484.lr.ph: ; preds = %if.then479 %arrayidx495 = getelementptr inbounds ptr, ptr %call219, i64 %idxprom473 %arrayidx499 = getelementptr inbounds ptr, ptr %call216, i64 %idxprom473 br label %for.body484 for.body484: ; preds = %for.body484.lr.ph, %for.inc510 %indvars.iv1383 = phi i64 [ %151, %for.body484.lr.ph ], [ %indvars.iv.next1384, %for.inc510 ] %arrayidx486 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1383 %154 = load ptr, ptr %arrayidx486, align 8, !tbaa !13 %arrayidx488 = getelementptr inbounds i8, ptr %154, i64 %indvars.iv1391 %155 = load i8, ptr %arrayidx488, align 1, !tbaa !58 %cmp490 = icmp eq i8 %155, 68 br i1 %cmp490, label %if.then492, label %for.body484.for.inc510_crit_edge for.body484.for.inc510_crit_edge: ; preds = %for.body484 %.pre1494 = trunc i64 %indvars.iv1383 to i32 br label %for.inc510 if.then492: ; preds = %for.body484 %156 = load i32, ptr %N, align 4, !tbaa !33 %157 = trunc i64 %indvars.iv1383 to i32 %mul.i1089 = mul nsw i32 %156, %157 %add.i1090 = add nsw i32 %mul.i1089, %126 %158 = load ptr, ptr %arrayidx495, align 8, !tbaa !13 %arrayidx497 = getelementptr inbounds ptr, ptr %158, i64 %indvars.iv1391 %159 = load ptr, ptr %arrayidx497, align 8, !tbaa !13 %160 = load ptr, ptr %arrayidx499, align 8, !tbaa !13 %arrayidx501 = getelementptr inbounds i32, ptr %160, i64 %indvars.iv1391 %161 = load i32, ptr %arrayidx501, align 4, !tbaa !33 %idxprom502 = sext i32 %161 to i64 %arrayidx503 = getelementptr inbounds i32, ptr %159, i64 %idxprom502 store i32 %add.i1090, ptr %arrayidx503, align 4, !tbaa !33 %162 = load i32, ptr %arrayidx501, align 4, !tbaa !33 %inc508 = add nsw i32 %162, 1 store i32 %inc508, ptr %arrayidx501, align 4, !tbaa !33 br label %for.inc510 for.inc510: ; preds = %for.body484.for.inc510_crit_edge, %if.then492 %.pre-phi1495 = phi i32 [ %.pre1494, %for.body484.for.inc510_crit_edge ], [ %157, %if.then492 ] %indvars.iv.next1384 = add nsw i64 %indvars.iv1383, -1 %cmp482 = icmp sgt i32 %.pre-phi1495, 0 br i1 %cmp482, label %for.body484, label %for.inc514, !llvm.loop !95 for.inc514: ; preds = %for.inc510, %for.body472 %cmp470 = icmp sgt i64 %indvars.iv1387, 1 %indvars.iv.next1382 = add nsw i32 %indvars.iv1381, -1 br i1 %cmp470, label %for.body472, label %for.inc517.loopexit, !llvm.loop !96 for.inc517.loopexit: ; preds = %if.then479, %for.inc514 %.pre1482 = load i32, ptr %N, align 4, !tbaa !33 br label %for.inc517 for.inc517: ; preds = %for.cond420.preheader, %for.inc517.loopexit, %for.cond469.preheader %163 = phi i32 [ %.pre1482, %for.inc517.loopexit ], [ %148, %for.cond469.preheader ], [ %122, %for.cond420.preheader ] %indvars.iv.next1392 = add nuw nsw i64 %indvars.iv1391, 1 %164 = sext i32 %163 to i64 %cmp417 = icmp slt i64 %indvars.iv.next1392, %164 br i1 %cmp417, label %for.cond420.preheader, label %for.cond520.preheader, !llvm.loop !97 for.cond538.preheader: ; preds = %for.inc535 %cmp5391232 = icmp sgt i32 %169, 0 br i1 %cmp5391232, label %for.cond542.preheader, label %while.end for.cond524.preheader: ; preds = %for.cond520.preheader, %for.inc535 %165 = phi i32 [ %169, %for.inc535 ], [ %163, %for.cond520.preheader ] %indvars.iv1399 = phi i64 [ %indvars.iv.next1400, %for.inc535 ], [ 0, %for.cond520.preheader ] %cmp5251226 = icmp sgt i32 %165, 0 br i1 %cmp5251226, label %for.body527.lr.ph, label %for.cond524.preheader.for.inc535_crit_edge for.cond524.preheader.for.inc535_crit_edge: ; preds = %for.cond524.preheader %.pre1496 = sext i32 %165 to i64 br label %for.inc535 for.body527.lr.ph: ; preds = %for.cond524.preheader %arrayidx529 = getelementptr inbounds ptr, ptr %call213, i64 %indvars.iv1399 %166 = load ptr, ptr %arrayidx529, align 8, !tbaa !13 br label %for.body527 for.body527: ; preds = %for.body527.lr.ph, %for.body527 %indvars.iv1395 = phi i64 [ 0, %for.body527.lr.ph ], [ %indvars.iv.next1396, %for.body527 ] %arrayidx531 = getelementptr inbounds i32, ptr %166, i64 %indvars.iv1395 store i32 0, ptr %arrayidx531, align 4, !tbaa !33 %indvars.iv.next1396 = add nuw nsw i64 %indvars.iv1395, 1 %167 = load i32, ptr %N, align 4, !tbaa !33 %168 = sext i32 %167 to i64 %cmp525 = icmp slt i64 %indvars.iv.next1396, %168 br i1 %cmp525, label %for.body527, label %for.inc535, !llvm.loop !98 for.inc535: ; preds = %for.body527, %for.cond524.preheader.for.inc535_crit_edge %.pre-phi1497 = phi i64 [ %.pre1496, %for.cond524.preheader.for.inc535_crit_edge ], [ %168, %for.body527 ] %169 = phi i32 [ %165, %for.cond524.preheader.for.inc535_crit_edge ], [ %167, %for.body527 ] %indvars.iv.next1400 = add nuw nsw i64 %indvars.iv1399, 1 %cmp521 = icmp slt i64 %indvars.iv.next1400, %.pre-phi1497 br i1 %cmp521, label %for.cond524.preheader, label %for.cond538.preheader, !llvm.loop !99 for.cond553.preheader: ; preds = %for.inc550 %cmp5541238 = icmp sgt i32 %173, 0 br i1 %cmp5541238, label %for.cond557.preheader, label %while.end for.cond542.preheader: ; preds = %for.cond538.preheader, %for.inc550 %170 = phi i32 [ %173, %for.inc550 ], [ %169, %for.cond538.preheader ] %i.141233 = phi i32 [ %inc551, %for.inc550 ], [ 0, %for.cond538.preheader ] %cmp5431230 = icmp sgt i32 %170, 0 br i1 %cmp5431230, label %for.body545, label %for.inc550 for.body545: ; preds = %for.cond542.preheader, %for.body545 %171 = phi i32 [ %172, %for.body545 ], [ %170, %for.cond542.preheader ] %j.101231 = phi i32 [ %inc548, %for.body545 ], [ 0, %for.cond542.preheader ] %call546 = call i32 @search(i32 noundef %i.141233, i32 noundef %j.101231, i32 noundef %171, ptr noundef %call216, ptr noundef %call219, ptr noundef %call213) %inc548 = add nuw nsw i32 %j.101231, 1 %172 = load i32, ptr %N, align 4, !tbaa !33 %cmp543 = icmp slt i32 %inc548, %172 br i1 %cmp543, label %for.body545, label %for.inc550, !llvm.loop !100 for.inc550: ; preds = %for.body545, %for.cond542.preheader %173 = phi i32 [ %170, %for.cond542.preheader ], [ %172, %for.body545 ] %inc551 = add nuw nsw i32 %i.141233, 1 %cmp539 = icmp slt i32 %inc551, %173 br i1 %cmp539, label %for.cond542.preheader, label %for.cond553.preheader, !llvm.loop !101 for.cond557.preheader: ; preds = %for.cond553.preheader, %for.inc577 %174 = phi i32 [ %184, %for.inc577 ], [ %173, %for.cond553.preheader ] %indvars.iv1407 = phi i64 [ %indvars.iv.next1408, %for.inc577 ], [ 0, %for.cond553.preheader ] %reverse_num.01239 = phi i32 [ %reverse_num.1.lcssa, %for.inc577 ], [ 0, %for.cond553.preheader ] %cmp5581234 = icmp sgt i32 %174, 0 br i1 %cmp5581234, label %for.body560.lr.ph, label %for.inc577 for.body560.lr.ph: ; preds = %for.cond557.preheader %arrayidx562 = getelementptr inbounds ptr, ptr %call213, i64 %indvars.iv1407 %175 = load ptr, ptr %arrayidx562, align 8, !tbaa !13 %arrayidx569 = getelementptr inbounds ptr, ptr %call207, i64 %indvars.iv1407 br label %for.body560 for.body560: ; preds = %for.body560.lr.ph, %for.inc574 %176 = phi i32 [ %174, %for.body560.lr.ph ], [ %181, %for.inc574 ] %177 = phi i32 [ %174, %for.body560.lr.ph ], [ %182, %for.inc574 ] %indvars.iv1403 = phi i64 [ 0, %for.body560.lr.ph ], [ %indvars.iv.next1404, %for.inc574 ] %reverse_num.11235 = phi i32 [ %reverse_num.01239, %for.body560.lr.ph ], [ %reverse_num.2, %for.inc574 ] %arrayidx564 = getelementptr inbounds i32, ptr %175, i64 %indvars.iv1403 %178 = load i32, ptr %arrayidx564, align 4, !tbaa !33 %cmp565 = icmp eq i32 %178, 2 br i1 %cmp565, label %if.then567, label %for.inc574 if.then567: ; preds = %for.body560 %179 = load ptr, ptr %arrayidx569, align 8, !tbaa !13 %arrayidx571 = getelementptr inbounds i32, ptr %179, i64 %indvars.iv1403 %180 = load i32, ptr %arrayidx571, align 4, !tbaa !33 %xor = xor i32 %180, 1 store i32 %xor, ptr %arrayidx571, align 4, !tbaa !33 %inc572 = add nsw i32 %reverse_num.11235, 1 %.pre1483 = load i32, ptr %N, align 4, !tbaa !33 br label %for.inc574 for.inc574: ; preds = %for.body560, %if.then567 %181 = phi i32 [ %.pre1483, %if.then567 ], [ %176, %for.body560 ] %182 = phi i32 [ %.pre1483, %if.then567 ], [ %177, %for.body560 ] %reverse_num.2 = phi i32 [ %inc572, %if.then567 ], [ %reverse_num.11235, %for.body560 ] %indvars.iv.next1404 = add nuw nsw i64 %indvars.iv1403, 1 %183 = sext i32 %182 to i64 %cmp558 = icmp slt i64 %indvars.iv.next1404, %183 br i1 %cmp558, label %for.body560, label %for.inc577, !llvm.loop !102 for.inc577: ; preds = %for.inc574, %for.cond557.preheader %184 = phi i32 [ %174, %for.cond557.preheader ], [ %181, %for.inc574 ] %reverse_num.1.lcssa = phi i32 [ %reverse_num.01239, %for.cond557.preheader ], [ %reverse_num.2, %for.inc574 ] %indvars.iv.next1408 = add nuw nsw i64 %indvars.iv1407, 1 %185 = sext i32 %184 to i64 %cmp554 = icmp slt i64 %indvars.iv.next1408, %185 br i1 %cmp554, label %for.cond557.preheader, label %for.end579, !llvm.loop !103 for.end579: ; preds = %for.inc577 %cmp580 = icmp eq i32 %reverse_num.1.lcssa, 0 br i1 %cmp580, label %while.end, label %while.cond while.end: ; preds = %while.cond, %for.cond312.preheader, %for.cond416.preheader, %for.cond520.preheader, %for.cond538.preheader, %for.cond553.preheader, %for.end579 %186 = phi i32 [ %184, %for.end579 ], [ %173, %for.cond553.preheader ], [ %169, %for.cond538.preheader ], [ %163, %for.cond520.preheader ], [ %120, %for.cond416.preheader ], [ %78, %for.cond312.preheader ], [ %73, %while.cond ] %mul584 = mul nsw i32 %186, %186 %call.i = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #15 store i32 %mul584, ptr %call.i, align 8, !tbaa !5 %conv.i = zext i32 %mul584 to i64 %mul.i1091 = shl nuw nsw i64 %conv.i, 3 %call2.i = call noalias ptr @malloc(i64 noundef %mul.i1091) #15 %v_s.i = getelementptr inbounds %struct.graph, ptr %call.i, i64 0, i32 1 store ptr %call2.i, ptr %v_s.i, align 8, !tbaa !11 %call5.i = call noalias ptr @malloc(i64 noundef %mul.i1091) #15 %v.i = getelementptr inbounds %struct.graph, ptr %call.i, i64 0, i32 2 store ptr %call5.i, ptr %v.i, align 8, !tbaa !12 %cmp75.i.not = icmp eq i32 %186, 0 br i1 %cmp75.i.not, label %for.end705, label %for.body.i for.body.i: ; preds = %while.end, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %while.end ] %call7.i = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #15 %arrayidx.i = getelementptr inbounds ptr, ptr %call2.i, i64 %indvars.iv.i store ptr %call7.i, ptr %arrayidx.i, align 8, !tbaa !13 %187 = trunc i64 %indvars.iv.i to i32 store i32 %187, ptr %call7.i, align 8, !tbaa !14 %next_num.i = getelementptr inbounds %struct.graph_vertex_sub, ptr %call7.i, i64 0, i32 1 %call21.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #15 %arrayidx24.i = getelementptr inbounds ptr, ptr %call5.i, i64 %indvars.iv.i call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %next_num.i, i8 0, i64 16, i1 false) store ptr %call21.i, ptr %arrayidx24.i, align 8, !tbaa !13 store i32 %187, ptr %call21.i, align 8, !tbaa !16 %next_num32.i = getelementptr inbounds %struct.graph_v_sub, ptr %call21.i, i64 0, i32 1 %prev.i = getelementptr inbounds %struct.graph_v_sub, ptr %call21.i, i64 0, i32 4 store ptr null, ptr %prev.i, align 8, !tbaa !18 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %conv.i call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %next_num32.i, i8 0, i64 16, i1 false) br i1 %exitcond.not.i, label %make_graph.exit, label %for.body.i, !llvm.loop !19 make_graph.exit: ; preds = %for.body.i %cmp5871254 = icmp sgt i32 %186, 0 br i1 %cmp5871254, label %for.cond590.preheader.lr.ph, label %for.end705 for.cond590.preheader.lr.ph: ; preds = %make_graph.exit %188 = zext i32 %186 to i64 %wide.trip.count1440 = zext i32 %186 to i64 br label %for.body593.lr.ph for.body593.lr.ph: ; preds = %for.inc643, %for.cond590.preheader.lr.ph %indvars.iv1432 = phi i64 [ 0, %for.cond590.preheader.lr.ph ], [ %indvars.iv.next1433, %for.inc643 ] %arrayidx600 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1432 %189 = mul nsw i64 %indvars.iv1432, %188 %invariant.gep1566 = getelementptr ptr, ptr %call2.i, i64 %189 %invariant.gep1568 = getelementptr ptr, ptr %call2.i, i64 %189 br label %for.body593 for.cond646.preheader: ; preds = %for.inc643 br i1 %cmp5871254, label %for.cond650.preheader.lr.ph, label %for.end705 for.cond650.preheader.lr.ph: ; preds = %for.cond646.preheader %190 = zext i32 %186 to i64 %wide.trip.count1471 = zext i32 %186 to i64 br label %for.body653.lr.ph for.body620.lr.ph: ; preds = %for.inc613 %arrayidx627 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1432 %191 = mul nsw i64 %indvars.iv1432, %188 %192 = getelementptr ptr, ptr %call2.i, i64 %191 %invariant.gep1570 = getelementptr ptr, ptr %call2.i, i64 %191 br label %for.body620 for.body593: ; preds = %for.body593.lr.ph, %for.inc613 %indvars.iv1419 = phi i64 [ 0, %for.body593.lr.ph ], [ %indvars.iv.next1420, %for.inc613 ] %indvars.iv1411 = phi i64 [ 1, %for.body593.lr.ph ], [ %indvars.iv.next1412, %for.inc613 ] %indvars.iv.next1420 = add nuw nsw i64 %indvars.iv1419, 1 %cmp5961243 = icmp ult i64 %indvars.iv.next1420, %188 br i1 %cmp5961243, label %for.body598.lr.ph, label %for.inc613 for.body598.lr.ph: ; preds = %for.body593 %193 = load ptr, ptr %arrayidx600, align 8, !tbaa !13 br label %for.body598 for.body598: ; preds = %for.body598.lr.ph, %for.inc610 %indvars.iv1413 = phi i64 [ %indvars.iv1411, %for.body598.lr.ph ], [ %indvars.iv.next1414, %for.inc610 ] %arrayidx602 = getelementptr inbounds i8, ptr %193, i64 %indvars.iv1413 %194 = load i8, ptr %arrayidx602, align 1, !tbaa !58 %cmp604 = icmp eq i8 %194, 76 br i1 %cmp604, label %if.then606, label %for.inc610 if.then606: ; preds = %for.body598 %sext1501 = shl i64 %indvars.iv1413, 32 %195 = ashr exact i64 %sext1501, 32 %call.i1096 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 %gep1567 = getelementptr ptr, ptr %invariant.gep1566, i64 %195 %196 = load ptr, ptr %gep1567, align 8, !tbaa !13 store ptr %196, ptr %call.i1096, align 8, !tbaa !21 %gep1569 = getelementptr ptr, ptr %invariant.gep1568, i64 %indvars.iv1419 %197 = load ptr, ptr %gep1569, align 8, !tbaa !13 %next.i = getelementptr inbounds %struct.graph_vertex_sub, ptr %197, i64 0, i32 2 %198 = load ptr, ptr %next.i, align 8, !tbaa !23 %next4.i = getelementptr inbounds %struct.graph_edge_sub, ptr %call.i1096, i64 0, i32 1 store ptr %198, ptr %next4.i, align 8, !tbaa !24 store ptr %call.i1096, ptr %next.i, align 8, !tbaa !23 %199 = load ptr, ptr %gep1569, align 8, !tbaa !13 %next_num.i1099 = getelementptr inbounds %struct.graph_vertex_sub, ptr %199, i64 0, i32 1 %200 = load i32, ptr %next_num.i1099, align 4, !tbaa !25 %inc.i = add nsw i32 %200, 1 store i32 %inc.i, ptr %next_num.i1099, align 4, !tbaa !25 %201 = load ptr, ptr %gep1567, align 8, !tbaa !13 %prev_num.i = getelementptr inbounds %struct.graph_vertex_sub, ptr %201, i64 0, i32 3 %202 = load i32, ptr %prev_num.i, align 8, !tbaa !26 %inc15.i = add nsw i32 %202, 1 store i32 %inc15.i, ptr %prev_num.i, align 8, !tbaa !26 br label %for.inc613 for.inc610: ; preds = %for.body598 %indvars.iv.next1414 = add nuw nsw i64 %indvars.iv1413, 1 %exitcond1418.not = icmp eq i64 %indvars.iv.next1414, %wide.trip.count1440 br i1 %exitcond1418.not, label %for.inc613, label %for.body598, !llvm.loop !104 for.inc613: ; preds = %for.inc610, %for.body593, %if.then606 %indvars.iv.next1412 = add nuw nsw i64 %indvars.iv1411, 1 %exitcond1425.not = icmp eq i64 %indvars.iv.next1420, %wide.trip.count1440 br i1 %exitcond1425.not, label %for.body620.lr.ph, label %for.body593, !llvm.loop !105 for.body620: ; preds = %for.body620.lr.ph, %for.inc640 %indvars.iv1426 = phi i64 [ %188, %for.body620.lr.ph ], [ %indvars.iv.next1427, %for.inc640 ] %indvars.iv.next1427 = add nsw i64 %indvars.iv1426, -1 %cmp6231247 = icmp sgt i64 %indvars.iv1426, 1 br i1 %cmp6231247, label %for.body625.lr.ph, label %for.inc643 for.body625.lr.ph: ; preds = %for.body620 %203 = load ptr, ptr %arrayidx627, align 8, !tbaa !13 %204 = trunc i64 %indvars.iv1426 to i32 %205 = add i32 %204, -2 br label %for.body625 for.body625: ; preds = %for.body625.lr.ph, %for.inc637 %k.61248 = phi i32 [ %205, %for.body625.lr.ph ], [ %dec638, %for.inc637 ] %idxprom628 = zext i32 %k.61248 to i64 %arrayidx629 = getelementptr inbounds i8, ptr %203, i64 %idxprom628 %206 = load i8, ptr %arrayidx629, align 1, !tbaa !58 %cmp631 = icmp eq i8 %206, 82 br i1 %cmp631, label %if.then633, label %for.inc637 if.then633: ; preds = %for.body625 %207 = sext i32 %k.61248 to i64 %call.i1104 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 %arrayidx.i1107 = getelementptr ptr, ptr %192, i64 %207 %208 = load ptr, ptr %arrayidx.i1107, align 8, !tbaa !13 store ptr %208, ptr %call.i1104, align 8, !tbaa !21 %gep1571 = getelementptr ptr, ptr %invariant.gep1570, i64 %indvars.iv.next1427 %209 = load ptr, ptr %gep1571, align 8, !tbaa !13 %next.i1110 = getelementptr inbounds %struct.graph_vertex_sub, ptr %209, i64 0, i32 2 %210 = load ptr, ptr %next.i1110, align 8, !tbaa !23 %next4.i1111 = getelementptr inbounds %struct.graph_edge_sub, ptr %call.i1104, i64 0, i32 1 store ptr %210, ptr %next4.i1111, align 8, !tbaa !24 store ptr %call.i1104, ptr %next.i1110, align 8, !tbaa !23 %211 = load ptr, ptr %gep1571, align 8, !tbaa !13 %next_num.i1113 = getelementptr inbounds %struct.graph_vertex_sub, ptr %211, i64 0, i32 1 %212 = load i32, ptr %next_num.i1113, align 4, !tbaa !25 %inc.i1114 = add nsw i32 %212, 1 store i32 %inc.i1114, ptr %next_num.i1113, align 4, !tbaa !25 %213 = load ptr, ptr %arrayidx.i1107, align 8, !tbaa !13 %prev_num.i1115 = getelementptr inbounds %struct.graph_vertex_sub, ptr %213, i64 0, i32 3 %214 = load i32, ptr %prev_num.i1115, align 8, !tbaa !26 %inc15.i1116 = add nsw i32 %214, 1 store i32 %inc15.i1116, ptr %prev_num.i1115, align 8, !tbaa !26 br label %for.inc640 for.inc637: ; preds = %for.body625 %dec638 = add nsw i32 %k.61248, -1 %cmp623 = icmp sgt i32 %k.61248, 0 br i1 %cmp623, label %for.body625, label %for.inc640, !llvm.loop !106 for.inc640: ; preds = %for.inc637, %if.then633 br i1 %cmp6231247, label %for.body620, label %for.inc643, !llvm.loop !107 for.inc643: ; preds = %for.body620, %for.inc640 %indvars.iv.next1433 = add nuw nsw i64 %indvars.iv1432, 1 %exitcond1441.not = icmp eq i64 %indvars.iv.next1433, %wide.trip.count1440 br i1 %exitcond1441.not, label %for.cond646.preheader, label %for.body593.lr.ph, !llvm.loop !108 for.body653.lr.ph: ; preds = %for.inc703, %for.cond650.preheader.lr.ph %indvars.iv1465 = phi i64 [ 0, %for.cond650.preheader.lr.ph ], [ %indvars.iv.next1466, %for.inc703 ] %215 = getelementptr ptr, ptr %call2.i, i64 %indvars.iv1465 %invariant.gep1572 = getelementptr ptr, ptr %call2.i, i64 %indvars.iv1465 br label %for.body653 for.body680.lr.ph: ; preds = %for.inc673 %216 = getelementptr ptr, ptr %call2.i, i64 %indvars.iv1465 %invariant.gep1574 = getelementptr ptr, ptr %call2.i, i64 %indvars.iv1465 br label %for.body680 for.body653: ; preds = %for.body653.lr.ph, %for.inc673 %indvars.iv1450 = phi i64 [ 0, %for.body653.lr.ph ], [ %indvars.iv.next1451, %for.inc673 ] %indvars.iv1442 = phi i64 [ 1, %for.body653.lr.ph ], [ %indvars.iv.next1443, %for.inc673 ] %indvars.iv.next1451 = add nuw nsw i64 %indvars.iv1450, 1 %cmp6561256 = icmp ult i64 %indvars.iv.next1451, %190 br i1 %cmp6561256, label %for.body658, label %for.inc673 for.body658: ; preds = %for.body653, %for.inc670 %indvars.iv1444 = phi i64 [ %indvars.iv.next1445, %for.inc670 ], [ %indvars.iv1442, %for.body653 ] %arrayidx660 = getelementptr inbounds ptr, ptr %call210, i64 %indvars.iv1444 %217 = load ptr, ptr %arrayidx660, align 8, !tbaa !13 %arrayidx662 = getelementptr inbounds i8, ptr %217, i64 %indvars.iv1465 %218 = load i8, ptr %arrayidx662, align 1, !tbaa !58 %cmp664 = icmp eq i8 %218, 85 br i1 %cmp664, label %if.then666, label %for.inc670 if.then666: ; preds = %for.body658 %219 = trunc i64 %indvars.iv1444 to i32 %220 = mul nsw i64 %indvars.iv1450, %190 %mul.i1119 = mul nsw i32 %186, %219 %221 = sext i32 %mul.i1119 to i64 %call.i1121 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 %arrayidx.i1124 = getelementptr ptr, ptr %215, i64 %221 %222 = load ptr, ptr %arrayidx.i1124, align 8, !tbaa !13 store ptr %222, ptr %call.i1121, align 8, !tbaa !21 %gep1573 = getelementptr ptr, ptr %invariant.gep1572, i64 %220 %223 = load ptr, ptr %gep1573, align 8, !tbaa !13 %next.i1127 = getelementptr inbounds %struct.graph_vertex_sub, ptr %223, i64 0, i32 2 %224 = load ptr, ptr %next.i1127, align 8, !tbaa !23 %next4.i1128 = getelementptr inbounds %struct.graph_edge_sub, ptr %call.i1121, i64 0, i32 1 store ptr %224, ptr %next4.i1128, align 8, !tbaa !24 store ptr %call.i1121, ptr %next.i1127, align 8, !tbaa !23 %225 = load ptr, ptr %gep1573, align 8, !tbaa !13 %next_num.i1130 = getelementptr inbounds %struct.graph_vertex_sub, ptr %225, i64 0, i32 1 %226 = load i32, ptr %next_num.i1130, align 4, !tbaa !25 %inc.i1131 = add nsw i32 %226, 1 store i32 %inc.i1131, ptr %next_num.i1130, align 4, !tbaa !25 %227 = load ptr, ptr %arrayidx.i1124, align 8, !tbaa !13 %prev_num.i1132 = getelementptr inbounds %struct.graph_vertex_sub, ptr %227, i64 0, i32 3 %228 = load i32, ptr %prev_num.i1132, align 8, !tbaa !26 %inc15.i1133 = add nsw i32 %228, 1 store i32 %inc15.i1133, ptr %prev_num.i1132, align 8, !tbaa !26 br label %for.inc673 for.inc670: ; preds = %for.body658 %indvars.iv.next1445 = add nuw nsw i64 %indvars.iv1444, 1 %exitcond1449.not = icmp eq i64 %indvars.iv.next1445, %wide.trip.count1471 br i1 %exitcond1449.not, label %for.inc673, label %for.body658, !llvm.loop !109 for.inc673: ; preds = %for.inc670, %for.body653, %if.then666 %indvars.iv.next1443 = add nuw nsw i64 %indvars.iv1442, 1 %exitcond1457.not = icmp eq i64 %indvars.iv.next1451, %wide.trip.count1471 br i1 %exitcond1457.not, label %for.body680.lr.ph, label %for.body653, !llvm.loop !110 for.body680: ; preds = %for.body680.lr.ph, %for.inc700 %indvars.iv1458 = phi i64 [ %190, %for.body680.lr.ph ], [ %indvars.iv.next1459, %for.inc700 ] %indvars.iv.next1459 = add nsw i64 %indvars.iv1458, -1 %cmp6831260 = icmp sgt i64 %indvars.iv1458, 1 br i1 %cmp6831260, label %for.body685.preheader, label %for.inc703 for.body685.preheader: ; preds = %for.body680 %229 = trunc i64 %indvars.iv1458 to i32 %230 = add i32 %229, -2 br label %for.body685 for.body685: ; preds = %for.body685.preheader, %for.inc697 %k.81261 = phi i32 [ %dec698, %for.inc697 ], [ %230, %for.body685.preheader ] %idxprom686 = zext i32 %k.81261 to i64 %arrayidx687 = getelementptr inbounds ptr, ptr %call210, i64 %idxprom686 %231 = load ptr, ptr %arrayidx687, align 8, !tbaa !13 %arrayidx689 = getelementptr inbounds i8, ptr %231, i64 %indvars.iv1465 %232 = load i8, ptr %arrayidx689, align 1, !tbaa !58 %cmp691 = icmp eq i8 %232, 68 br i1 %cmp691, label %if.then693, label %for.inc697 if.then693: ; preds = %for.body685 %233 = mul nsw i64 %indvars.iv.next1459, %190 %mul.i1136 = mul nsw i32 %k.81261, %186 %234 = sext i32 %mul.i1136 to i64 %call.i1138 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #15 %arrayidx.i1141 = getelementptr ptr, ptr %216, i64 %234 %235 = load ptr, ptr %arrayidx.i1141, align 8, !tbaa !13 store ptr %235, ptr %call.i1138, align 8, !tbaa !21 %gep1575 = getelementptr ptr, ptr %invariant.gep1574, i64 %233 %236 = load ptr, ptr %gep1575, align 8, !tbaa !13 %next.i1144 = getelementptr inbounds %struct.graph_vertex_sub, ptr %236, i64 0, i32 2 %237 = load ptr, ptr %next.i1144, align 8, !tbaa !23 %next4.i1145 = getelementptr inbounds %struct.graph_edge_sub, ptr %call.i1138, i64 0, i32 1 store ptr %237, ptr %next4.i1145, align 8, !tbaa !24 store ptr %call.i1138, ptr %next.i1144, align 8, !tbaa !23 %238 = load ptr, ptr %gep1575, align 8, !tbaa !13 %next_num.i1147 = getelementptr inbounds %struct.graph_vertex_sub, ptr %238, i64 0, i32 1 %239 = load i32, ptr %next_num.i1147, align 4, !tbaa !25 %inc.i1148 = add nsw i32 %239, 1 store i32 %inc.i1148, ptr %next_num.i1147, align 4, !tbaa !25 %240 = load ptr, ptr %arrayidx.i1141, align 8, !tbaa !13 %prev_num.i1149 = getelementptr inbounds %struct.graph_vertex_sub, ptr %240, i64 0, i32 3 %241 = load i32, ptr %prev_num.i1149, align 8, !tbaa !26 %inc15.i1150 = add nsw i32 %241, 1 store i32 %inc15.i1150, ptr %prev_num.i1149, align 8, !tbaa !26 br label %for.inc700 for.inc697: ; preds = %for.body685 %dec698 = add nsw i32 %k.81261, -1 %cmp683 = icmp sgt i32 %k.81261, 0 br i1 %cmp683, label %for.body685, label %for.inc700, !llvm.loop !111 for.inc700: ; preds = %for.inc697, %if.then693 br i1 %cmp6831260, label %for.body680, label %for.inc703, !llvm.loop !112 for.inc703: ; preds = %for.body680, %for.inc700 %indvars.iv.next1466 = add nuw nsw i64 %indvars.iv1465, 1 %exitcond1472.not = icmp eq i64 %indvars.iv.next1466, %wide.trip.count1471 br i1 %exitcond1472.not, label %for.end705, label %for.body653.lr.ph, !llvm.loop !113 for.end705: ; preds = %for.inc703, %while.end, %make_graph.exit, %for.cond646.preheader call void @build_graph(ptr noundef nonnull %call.i) %call706 = call ptr @build_DAG(ptr noundef nonnull %call.i) %242 = load i32, ptr %call706, align 8, !tbaa !50 %cmp7091269 = icmp sgt i32 %242, 0 br i1 %cmp7091269, label %for.body711.lr.ph, label %cleanup748 for.body711.lr.ph: ; preds = %for.end705 %sorted_SCC = getelementptr inbounds %struct.DAG, ptr %call706, i64 0, i32 1 %243 = load ptr, ptr %sorted_SCC, align 8, !tbaa !41 %wide.trip.count1477 = zext i32 %242 to i64 br label %for.body711 for.body711: ; preds = %for.body711.lr.ph, %for.body711 %indvars.iv1473 = phi i64 [ 0, %for.body711.lr.ph ], [ %indvars.iv.next1474, %for.body711 ] %arrayidx713 = getelementptr inbounds ptr, ptr %243, i64 %indvars.iv1473 %244 = load ptr, ptr %arrayidx713, align 8, !tbaa !13 %vertexs = getelementptr inbounds %struct.SCC_sub, ptr %244, i64 0, i32 2 %245 = load ptr, ptr %vertexs, align 8, !tbaa !38 %246 = load i32, ptr %245, align 4, !tbaa !33 %247 = load i32, ptr %N, align 4, !tbaa !33 %div.i = sdiv i32 %246, %247 %rem.i = srem i32 %246, %247 %idxprom716 = sext i32 %div.i to i64 %arrayidx717 = getelementptr inbounds ptr, ptr %call210, i64 %idxprom716 %248 = load ptr, ptr %arrayidx717, align 8, !tbaa !13 %idxprom718 = sext i32 %rem.i to i64 %arrayidx719 = getelementptr inbounds i8, ptr %248, i64 %idxprom718 %249 = load i8, ptr %arrayidx719, align 1, !tbaa !58 %conv720 = sext i8 %249 to i32 %putchar = call i32 @putchar(i32 %conv720) %arrayidx724 = getelementptr inbounds ptr, ptr %call207, i64 %idxprom716 %250 = load ptr, ptr %arrayidx724, align 8, !tbaa !13 %arrayidx727 = getelementptr inbounds i32, ptr %250, i64 %idxprom718 %251 = load i32, ptr %arrayidx727, align 4, !tbaa !33 %cmp728 = icmp eq i32 %251, 0 %div.i.rem.i = select i1 %cmp728, i32 %div.i, i32 %rem.i %add735 = add nsw i32 %div.i.rem.i, 1 %call736 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add735) %indvars.iv.next1474 = add nuw nsw i64 %indvars.iv1473, 1 %exitcond1478.not = icmp eq i64 %indvars.iv.next1474, %wide.trip.count1477 br i1 %exitcond1478.not, label %cleanup748, label %for.body711, !llvm.loop !114 cleanup748: ; preds = %for.body711, %for.end705, %if.then196 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #16 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #12 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #13 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #13 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #14 attributes #0 = { nofree nounwind memory(write, argmem: none, 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn 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 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 #6 = { 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 = { 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 #8 = { 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 #9 = { 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 #10 = { nofree norecurse 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 #11 = { 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 #12 = { 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 #13 = { nofree nounwind } attributes #14 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #15 = { nounwind allocsize(0) } attributes #16 = { 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, !7, i64 0} !6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"any pointer", !8, i64 0} !11 = !{!6, !10, i64 8} !12 = !{!6, !10, i64 16} !13 = !{!10, !10, i64 0} !14 = !{!15, !7, i64 0} !15 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16} !16 = !{!17, !7, i64 0} !17 = !{!"graph_v_sub", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16, !10, i64 24} !18 = !{!17, !10, i64 24} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.mustprogress"} !21 = !{!22, !10, i64 0} !22 = !{!"graph_edge_sub", !10, i64 0, !10, i64 8} !23 = !{!15, !10, i64 8} !24 = !{!22, !10, i64 8} !25 = !{!15, !7, i64 4} !26 = !{!15, !7, i64 16} !27 = !{!17, !10, i64 8} !28 = distinct !{!28, !20} !29 = !{!17, !7, i64 4} !30 = !{!17, !7, i64 16} !31 = distinct !{!31, !20} !32 = distinct !{!32, !20} !33 = !{!7, !7, i64 0} !34 = distinct !{!34, !20} !35 = distinct !{!35, !20} !36 = distinct !{!36, !20} !37 = distinct !{!37, !20} !38 = !{!39, !10, i64 8} !39 = !{!"SCC_sub", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32} !40 = !{!39, !7, i64 4} !41 = !{!42, !10, i64 8} !42 = !{!"", !7, i64 0, !10, i64 8} !43 = !{!39, !7, i64 0} !44 = !{!39, !10, i64 24} !45 = !{!39, !7, i64 16} !46 = !{!39, !7, i64 32} !47 = distinct !{!47, !20} !48 = distinct !{!48, !20} !49 = distinct !{!49, !20} !50 = !{!42, !7, i64 0} !51 = distinct !{!51, !20} !52 = distinct !{!52, !20} !53 = distinct !{!53, !20} !54 = distinct !{!54, !20} !55 = !{!56, !7, i64 4} !56 = !{!"", !7, i64 0, !7, i64 4} !57 = distinct !{!57, !20} !58 = !{!8, !8, i64 0} !59 = distinct !{!59, !20} !60 = distinct !{!60, !20} !61 = distinct !{!61, !20} !62 = distinct !{!62, !20} !63 = distinct !{!63, !20} !64 = distinct !{!64, !20} !65 = distinct !{!65, !20} !66 = distinct !{!66, !20} !67 = distinct !{!67, !20} !68 = distinct !{!68, !20} !69 = distinct !{!69, !20, !70, !71} !70 = !{!"llvm.loop.isvectorized", i32 1} !71 = !{!"llvm.loop.unroll.runtime.disable"} !72 = !{!56, !7, i64 0} !73 = distinct !{!73, !20, !71, !70} !74 = distinct !{!74, !20} !75 = distinct !{!75, !20} !76 = distinct !{!76, !20} !77 = distinct !{!77, !20} !78 = distinct !{!78, !20} !79 = distinct !{!79, !20} !80 = distinct !{!80, !20} !81 = distinct !{!81, !20} !82 = distinct !{!82, !20} !83 = distinct !{!83, !20} !84 = distinct !{!84, !20, !85} !85 = !{!"llvm.loop.unswitch.partial.disable"} !86 = distinct !{!86, !20} !87 = distinct !{!87, !20, !85} !88 = distinct !{!88, !20} !89 = distinct !{!89, !20} !90 = distinct !{!90, !20} !91 = distinct !{!91, !20} !92 = distinct !{!92, !20} !93 = distinct !{!93, !20} !94 = distinct !{!94, !20} !95 = distinct !{!95, !20} !96 = distinct !{!96, !20} !97 = distinct !{!97, !20} !98 = distinct !{!98, !20} !99 = distinct !{!99, !20, !85} !100 = distinct !{!100, !20} !101 = distinct !{!101, !20} !102 = distinct !{!102, !20} !103 = distinct !{!103, !20} !104 = distinct !{!104, !20} !105 = distinct !{!105, !20} !106 = distinct !{!106, !20} !107 = distinct !{!107, !20} !108 = distinct !{!108, !20} !109 = distinct !{!109, !20} !110 = distinct !{!110, !20} !111 = distinct !{!111, !20} !112 = distinct !{!112, !20} !113 = distinct !{!113, !20} !114 = distinct !{!114, !20}
#include <stdio.h> #define MAX 11 int main() { unsigned int line[MAX][MAX] = {}; unsigned int number, answer, i, j; while ( scanf( "%d", &number) == 1 ) { if ( number == 0 ) { break; } for ( i = 0 ; i < number ; i++ ) { for ( j = 0 ; j < number ; j++ ) { scanf( "%d", &line[i][j] ); line[i][number] += line[i][j]; line[number][j] += line[i][j]; } } for ( i = 0 ; i < number ; i++ ) { line[number][number] += line[number][i]; } for ( i = 0 ; i <= number ; i++ ) { for ( j = 0 ; j <= number ; j++ ) { if ( j == number ) { printf( "%5d\n", line[i][j] ); } else { printf( "%5d", line[i][j] ); } line[i][j] = 0; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194483/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 [5 x i8] c"%5d\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%5d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %line = alloca [11 x [11 x i32]], align 16 %number = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %line) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %line, i8 0, i64 484, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number) #4 %call106 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %cmp107 = icmp ne i32 %call106, 1 %0 = load i32, ptr %number, align 4 %cmp1108 = icmp eq i32 %0, 0 %or.cond109 = select i1 %cmp107, i1 true, i1 %cmp1108 br i1 %or.cond109, label %while.end, label %for.cond3.preheader while.cond.loopexit: ; preds = %for.inc70 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %cmp = icmp ne i32 %call, 1 %1 = load i32, ptr %number, align 4 %cmp1 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %while.end, label %for.cond3.preheader.backedge for.cond29.preheader: ; preds = %for.inc26 %cmp30102.not = icmp eq i32 %5, 0 br i1 %cmp30102.not, label %for.cond47.preheader.preheader, label %for.body31.lr.ph for.body31.lr.ph: ; preds = %for.cond29.preheader %idxprom32 = zext i32 %5 to i64 %arrayidx39 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %idxprom32 %arrayidx39.promoted = load i32, ptr %arrayidx39, align 4, !tbaa !5 %xtraiter = and i64 %idxprom32, 3 %2 = icmp ult i32 %5, 4 br i1 %2, label %for.cond47.preheader.preheader.loopexit.unr-lcssa, label %for.body31.lr.ph.new for.body31.lr.ph.new: ; preds = %for.body31.lr.ph %unroll_iter = and i64 %idxprom32, 4294967292 br label %for.body31 for.cond3.preheader: ; preds = %entry, %for.cond3.preheader.backedge %3 = phi i32 [ %.be, %for.cond3.preheader.backedge ], [ 1, %entry ] %indvars.iv113 = phi i64 [ %indvars.iv113.be, %for.cond3.preheader.backedge ], [ 0, %entry ] %cmp498.not = icmp eq i32 %3, 0 br i1 %cmp498.not, label %for.cond47.preheader.preheader, label %for.body5 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %indvars.iv113, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %5 = load i32, ptr %number, align 4, !tbaa !5 %idxprom15 = zext i32 %5 to i64 %arrayidx16 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %indvars.iv113, i64 %idxprom15 %6 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %add = add i32 %6, %4 store i32 %add, ptr %arrayidx16, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx24 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom15, i64 %indvars.iv %8 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %add25 = add i32 %8, %7 store i32 %add25, ptr %arrayidx24, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp4 = icmp ult i64 %indvars.iv.next, %idxprom15 br i1 %cmp4, label %for.body5, label %for.inc26, !llvm.loop !9 for.inc26: ; preds = %for.body5 %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %9 = zext i32 %5 to i64 %cmp2 = icmp ult i64 %indvars.iv.next114, %9 br i1 %cmp2, label %for.cond3.preheader.backedge, label %for.cond29.preheader for.cond3.preheader.backedge: ; preds = %for.inc26, %while.cond.loopexit %.be = phi i32 [ %5, %for.inc26 ], [ 1, %while.cond.loopexit ] %indvars.iv113.be = phi i64 [ %indvars.iv.next114, %for.inc26 ], [ 0, %while.cond.loopexit ] br label %for.cond3.preheader, !llvm.loop !11 for.body31: ; preds = %for.body31, %for.body31.lr.ph.new %indvars.iv116 = phi i64 [ 0, %for.body31.lr.ph.new ], [ %indvars.iv.next117.3, %for.body31 ] %10 = phi i32 [ %arrayidx39.promoted, %for.body31.lr.ph.new ], [ %add40.3, %for.body31 ] %niter = phi i64 [ 0, %for.body31.lr.ph.new ], [ %niter.next.3, %for.body31 ] %arrayidx35 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %indvars.iv116 %11 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %add40 = add i32 %10, %11 store i32 %add40, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next117 = or i64 %indvars.iv116, 1 %arrayidx35.1 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %indvars.iv.next117 %12 = load i32, ptr %arrayidx35.1, align 4, !tbaa !5 %add40.1 = add i32 %add40, %12 store i32 %add40.1, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next117.1 = or i64 %indvars.iv116, 2 %arrayidx35.2 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %indvars.iv.next117.1 %13 = load i32, ptr %arrayidx35.2, align 4, !tbaa !5 %add40.2 = add i32 %add40.1, %13 store i32 %add40.2, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next117.2 = or i64 %indvars.iv116, 3 %arrayidx35.3 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %indvars.iv.next117.2 %14 = load i32, ptr %arrayidx35.3, align 4, !tbaa !5 %add40.3 = add i32 %add40.2, %14 store i32 %add40.3, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next117.3 = add nuw nsw i64 %indvars.iv116, 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.cond47.preheader.preheader.loopexit.unr-lcssa, label %for.body31, !llvm.loop !12 for.cond47.preheader.preheader.loopexit.unr-lcssa: ; preds = %for.body31, %for.body31.lr.ph %indvars.iv116.unr = phi i64 [ 0, %for.body31.lr.ph ], [ %indvars.iv.next117.3, %for.body31 ] %.unr = phi i32 [ %arrayidx39.promoted, %for.body31.lr.ph ], [ %add40.3, %for.body31 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond47.preheader.preheader, label %for.body31.epil for.body31.epil: ; preds = %for.cond47.preheader.preheader.loopexit.unr-lcssa, %for.body31.epil %indvars.iv116.epil = phi i64 [ %indvars.iv.next117.epil, %for.body31.epil ], [ %indvars.iv116.unr, %for.cond47.preheader.preheader.loopexit.unr-lcssa ] %15 = phi i32 [ %add40.epil, %for.body31.epil ], [ %.unr, %for.cond47.preheader.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body31.epil ], [ 0, %for.cond47.preheader.preheader.loopexit.unr-lcssa ] %arrayidx35.epil = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom32, i64 %indvars.iv116.epil %16 = load i32, ptr %arrayidx35.epil, align 4, !tbaa !5 %add40.epil = add i32 %15, %16 store i32 %add40.epil, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next117.epil = add nuw nsw i64 %indvars.iv116.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.cond47.preheader.preheader, label %for.body31.epil, !llvm.loop !13 for.cond47.preheader.preheader: ; preds = %for.cond47.preheader.preheader.loopexit.unr-lcssa, %for.body31.epil, %for.cond3.preheader, %for.cond29.preheader %.ph = phi i32 [ 0, %for.cond3.preheader ], [ 0, %for.cond29.preheader ], [ %5, %for.body31.epil ], [ %5, %for.cond47.preheader.preheader.loopexit.unr-lcssa ] br label %for.cond47.preheader for.cond47.preheader: ; preds = %for.cond47.preheader.preheader, %for.inc70 %17 = phi i32 [ %21, %for.inc70 ], [ %.ph, %for.cond47.preheader.preheader ] %i.2105 = phi i32 [ %inc71, %for.inc70 ], [ 0, %for.cond47.preheader.preheader ] %idxprom57 = zext i32 %i.2105 to i64 br label %for.body49 for.body49: ; preds = %for.cond47.preheader, %if.end62 %18 = phi i32 [ %17, %for.cond47.preheader ], [ %21, %if.end62 ] %j.1104 = phi i32 [ 0, %for.cond47.preheader ], [ %inc68, %if.end62 ] %cmp50 = icmp eq i32 %j.1104, %18 br i1 %cmp50, label %if.then51, label %if.else if.then51: ; preds = %for.body49 %idxprom54 = zext i32 %18 to i64 %arrayidx55 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom57, i64 %idxprom54 %19 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19) %.pre = zext i32 %j.1104 to i64 br label %if.end62 if.else: ; preds = %for.body49 %idxprom59 = zext i32 %j.1104 to i64 %arrayidx60 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom57, i64 %idxprom59 %20 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) br label %if.end62 if.end62: ; preds = %if.else, %if.then51 %idxprom65.pre-phi = phi i64 [ %idxprom59, %if.else ], [ %.pre, %if.then51 ] %arrayidx66 = getelementptr inbounds [11 x [11 x i32]], ptr %line, i64 0, i64 %idxprom57, i64 %idxprom65.pre-phi store i32 0, ptr %arrayidx66, align 4, !tbaa !5 %inc68 = add i32 %j.1104, 1 %21 = load i32, ptr %number, align 4, !tbaa !5 %cmp48.not = icmp ugt i32 %inc68, %21 br i1 %cmp48.not, label %for.inc70, label %for.body49, !llvm.loop !15 for.inc70: ; preds = %if.end62 %inc71 = add i32 %i.2105, 1 %cmp45.not = icmp ugt i32 %inc71, %21 br i1 %cmp45.not, label %while.cond.loopexit, label %for.cond47.preheader, !llvm.loop !16 while.end: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number) #4 call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %line) #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: 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 @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) #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 = { 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" } 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 = distinct !{!12, !10} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> int main(void) { int a[100][100]; int n; int i, j, k, l; int kami = 0; int kami2[100]; scanf("%d", &n); while (n != 0) { for (i = 0; i < 50; i++) { kami2[i] = 0; kami = 0; } for (j = 0; j < 10; j++) { for (i = 0; i < 10; i++) { a[i][j] = 0; } } for (j = 0; j < n; j++) { for (i = 0; i < n; i++) { scanf("%d", &a[i][j]); } } for (j = 0; j < n + 1; j++) { if (j < n) { for (i = 0; i < n; i++) { printf("%5d", a[i][j]); } for (i = 0; i < n; i++) { kami += a[i][j]; } printf("%5d", kami); a[n][j] = kami; kami = 0; printf("\n"); } else { for (k = 0; k <= n; k++) { for (l = 0; l < n + 1; l++) { kami2[k] += a[k][l]; } } for (k = 0; k < n + 1; k++) { printf("%5d", kami2[k]); } printf("\n"); //for (k = 0; k < n; k++) { // kami += a[n][k]; //} //printf("%5d\n", kami); } } scanf("%d", &n); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194526/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194526/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"%5d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [100 x [100 x i32]], align 16 %n = alloca i32, align 4 %kami2 = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %kami2) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not160 = icmp eq i32 %0, 0 br i1 %cmp.not160, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %scevgep = getelementptr inbounds i8, ptr %a, i64 400 %scevgep165 = getelementptr inbounds i8, ptr %a, i64 800 %scevgep166 = getelementptr inbounds i8, ptr %a, i64 1200 %scevgep167 = getelementptr inbounds i8, ptr %a, i64 1600 %scevgep168 = getelementptr inbounds i8, ptr %a, i64 2000 %scevgep169 = getelementptr inbounds i8, ptr %a, i64 2400 %scevgep170 = getelementptr inbounds i8, ptr %a, i64 2800 %scevgep171 = getelementptr inbounds i8, ptr %a, i64 3200 %scevgep172 = getelementptr inbounds i8, ptr %a, i64 3600 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.end100 %1 = phi i32 [ %0, %for.cond.preheader.preheader ], [ %62, %for.end100 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %kami2, i8 0, i64 200, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %a, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep165, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep166, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep167, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep168, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep169, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep170, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep171, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %scevgep172, i8 0, i64 40, i1 false), !tbaa !5 %cmp19143 = icmp sgt i32 %1, 0 br i1 %cmp19143, label %for.cond21.preheader, label %for.end100 for.cond35.preheader: ; preds = %for.inc32 %cmp36.not158 = icmp slt i32 %5, 0 br i1 %cmp36.not158, label %for.end100, label %for.body37 for.cond21.preheader: ; preds = %for.cond.preheader, %for.inc32 %2 = phi i32 [ %5, %for.inc32 ], [ %1, %for.cond.preheader ] %indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.inc32 ], [ 0, %for.cond.preheader ] %cmp22141 = icmp sgt i32 %2, 0 br i1 %cmp22141, label %for.body23, label %for.cond21.preheader.for.inc32_crit_edge for.cond21.preheader.for.inc32_crit_edge: ; preds = %for.cond21.preheader %.pre = sext i32 %2 to i64 br label %for.inc32 for.body23: ; preds = %for.cond21.preheader, %for.body23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body23 ], [ 0, %for.cond21.preheader ] %arrayidx27 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 %indvars.iv175 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27) %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 %cmp22 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp22, label %for.body23, label %for.inc32, !llvm.loop !9 for.inc32: ; preds = %for.body23, %for.cond21.preheader.for.inc32_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond21.preheader.for.inc32_crit_edge ], [ %4, %for.body23 ] %5 = phi i32 [ %2, %for.cond21.preheader.for.inc32_crit_edge ], [ %3, %for.body23 ] %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %cmp19 = icmp slt i64 %indvars.iv.next176, %.pre-phi br i1 %cmp19, label %for.cond21.preheader, label %for.cond35.preheader, !llvm.loop !11 for.body37: ; preds = %for.cond35.preheader, %for.inc98 %indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.inc98 ], [ 0, %for.cond35.preheader ] %6 = phi i32 [ %60, %for.inc98 ], [ %5, %for.cond35.preheader ] %7 = sext i32 %6 to i64 %cmp38 = icmp slt i64 %indvars.iv197, %7 br i1 %cmp38, label %for.cond39.preheader, label %for.cond67.preheader for.cond67.preheader: ; preds = %for.body37 %cmp68.not148 = icmp slt i32 %6, 0 br i1 %cmp68.not148, label %for.inc98, label %for.cond70.preheader.preheader for.cond70.preheader.preheader: ; preds = %for.cond67.preheader %8 = add nuw i32 %6, 1 %wide.trip.count184 = zext i32 %8 to i64 %min.iters.check212 = icmp ult i32 %6, 7 %n.vec215 = and i64 %wide.trip.count184, 4294967288 %cmp.n217 = icmp eq i64 %n.vec215, %wide.trip.count184 br label %for.cond70.preheader for.cond39.preheader: ; preds = %for.body37 %cmp40152 = icmp sgt i32 %6, 0 br i1 %cmp40152, label %for.body41, label %for.end60 for.cond50.preheader: ; preds = %for.body41 %cmp51154 = icmp sgt i32 %45, 0 br i1 %cmp51154, label %for.body52.lr.ph, label %for.end60 for.body52.lr.ph: ; preds = %for.cond50.preheader %wide.trip.count195 = zext i32 %45 to i64 %min.iters.check = icmp ult i32 %45, 8 br i1 %min.iters.check, label %for.body52.preheader, label %vector.ph vector.ph: ; preds = %for.body52.lr.ph %n.vec = and i64 %wide.trip.count195, 4294967288 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 ], [ %40, %vector.body ] %vec.phi209 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ] %9 = or i64 %index, 1 %10 = or i64 %index, 2 %11 = or i64 %index, 3 %12 = or i64 %index, 4 %13 = or i64 %index, 5 %14 = or i64 %index, 6 %15 = or i64 %index, 7 %16 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %index, i64 %indvars.iv197 %17 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %9, i64 %indvars.iv197 %18 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %10, i64 %indvars.iv197 %19 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %11, i64 %indvars.iv197 %20 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %12, i64 %indvars.iv197 %21 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %13, i64 %indvars.iv197 %22 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %14, i64 %indvars.iv197 %23 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %15, i64 %indvars.iv197 %24 = load i32, ptr %16, align 4, !tbaa !5 %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 = insertelement <4 x i32> poison, i32 %24, i64 0 %29 = insertelement <4 x i32> %28, i32 %25, i64 1 %30 = insertelement <4 x i32> %29, i32 %26, i64 2 %31 = insertelement <4 x i32> %30, i32 %27, i64 3 %32 = load i32, ptr %20, align 4, !tbaa !5 %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 = insertelement <4 x i32> poison, i32 %32, i64 0 %37 = insertelement <4 x i32> %36, i32 %33, i64 1 %38 = insertelement <4 x i32> %37, i32 %34, i64 2 %39 = insertelement <4 x i32> %38, i32 %35, i64 3 %40 = add <4 x i32> %31, %vec.phi %41 = add <4 x i32> %39, %vec.phi209 %index.next = add nuw i64 %index, 8 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %41, %40 %43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count195 br i1 %cmp.n, label %for.end60, label %for.body52.preheader for.body52.preheader: ; preds = %for.body52.lr.ph, %middle.block %indvars.iv192.ph = phi i64 [ 0, %for.body52.lr.ph ], [ %n.vec, %middle.block ] %kami.3156.ph = phi i32 [ 0, %for.body52.lr.ph ], [ %43, %middle.block ] br label %for.body52 for.body41: ; preds = %for.cond39.preheader, %for.body41 %indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.body41 ], [ 0, %for.cond39.preheader ] %arrayidx45 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv189, i64 %indvars.iv197 %44 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %44) %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1 %45 = load i32, ptr %n, align 4, !tbaa !5 %46 = sext i32 %45 to i64 %cmp40 = icmp slt i64 %indvars.iv.next190, %46 br i1 %cmp40, label %for.body41, label %for.cond50.preheader, !llvm.loop !16 for.body52: ; preds = %for.body52.preheader, %for.body52 %indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.body52 ], [ %indvars.iv192.ph, %for.body52.preheader ] %kami.3156 = phi i32 [ %add57, %for.body52 ], [ %kami.3156.ph, %for.body52.preheader ] %arrayidx56 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv192, i64 %indvars.iv197 %47 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %add57 = add nsw i32 %47, %kami.3156 %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1 %exitcond196.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count195 br i1 %exitcond196.not, label %for.end60, label %for.body52, !llvm.loop !17 for.end60: ; preds = %for.body52, %middle.block, %for.cond39.preheader, %for.cond50.preheader %kami.3.lcssa = phi i32 [ 0, %for.cond50.preheader ], [ 0, %for.cond39.preheader ], [ %43, %middle.block ], [ %add57, %for.body52 ] %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %kami.3.lcssa) %48 = load i32, ptr %n, align 4, !tbaa !5 %idxprom62 = sext i32 %48 to i64 %arrayidx65 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %idxprom62, i64 %indvars.iv197 store i32 %kami.3.lcssa, ptr %arrayidx65, align 4, !tbaa !5 br label %for.inc98 for.cond87.preheader: ; preds = %for.cond70.for.inc84_crit_edge br i1 %cmp68.not148, label %for.inc98, label %for.body90 for.cond70.preheader: ; preds = %for.cond70.preheader.preheader, %for.cond70.for.inc84_crit_edge %indvars.iv181 = phi i64 [ 0, %for.cond70.preheader.preheader ], [ %indvars.iv.next182, %for.cond70.for.inc84_crit_edge ] %arrayidx79 = getelementptr inbounds [100 x i32], ptr %kami2, i64 0, i64 %indvars.iv181 %arrayidx79.promoted = load i32, ptr %arrayidx79, align 4, !tbaa !5 br i1 %min.iters.check212, label %for.body73.preheader, label %vector.ph213 vector.ph213: ; preds = %for.cond70.preheader %49 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %arrayidx79.promoted, i64 0 br label %vector.body218 vector.body218: ; preds = %vector.body218, %vector.ph213 %index219 = phi i64 [ 0, %vector.ph213 ], [ %index.next223, %vector.body218 ] %vec.phi220 = phi <4 x i32> [ %49, %vector.ph213 ], [ %52, %vector.body218 ] %vec.phi221 = phi <4 x i32> [ zeroinitializer, %vector.ph213 ], [ %53, %vector.body218 ] %50 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv181, i64 %index219 %wide.load = load <4 x i32>, ptr %50, align 16, !tbaa !5 %51 = getelementptr inbounds i32, ptr %50, i64 4 %wide.load222 = load <4 x i32>, ptr %51, align 16, !tbaa !5 %52 = add <4 x i32> %vec.phi220, %wide.load %53 = add <4 x i32> %vec.phi221, %wide.load222 %index.next223 = add nuw i64 %index219, 8 %54 = icmp eq i64 %index.next223, %n.vec215 br i1 %54, label %middle.block210, label %vector.body218, !llvm.loop !18 middle.block210: ; preds = %vector.body218 %bin.rdx224 = add <4 x i32> %53, %52 %55 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx224) br i1 %cmp.n217, label %for.cond70.for.inc84_crit_edge, label %for.body73.preheader for.body73.preheader: ; preds = %for.cond70.preheader, %middle.block210 %indvars.iv178.ph = phi i64 [ 0, %for.cond70.preheader ], [ %n.vec215, %middle.block210 ] %add80147.ph = phi i32 [ %arrayidx79.promoted, %for.cond70.preheader ], [ %55, %middle.block210 ] br label %for.body73 for.body73: ; preds = %for.body73.preheader, %for.body73 %indvars.iv178 = phi i64 [ %indvars.iv.next179, %for.body73 ], [ %indvars.iv178.ph, %for.body73.preheader ] %add80147 = phi i32 [ %add80, %for.body73 ], [ %add80147.ph, %for.body73.preheader ] %arrayidx77 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv181, i64 %indvars.iv178 %56 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %add80 = add nsw i32 %add80147, %56 %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1 %exitcond.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count184 br i1 %exitcond.not, label %for.cond70.for.inc84_crit_edge, label %for.body73, !llvm.loop !19 for.cond70.for.inc84_crit_edge: ; preds = %for.body73, %middle.block210 %add80.lcssa = phi i32 [ %55, %middle.block210 ], [ %add80, %for.body73 ] store i32 %add80.lcssa, ptr %arrayidx79, align 4, !tbaa !5 %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1 %exitcond185.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count184 br i1 %exitcond185.not, label %for.cond87.preheader, label %for.cond70.preheader, !llvm.loop !20 for.body90: ; preds = %for.cond87.preheader, %for.body90 %indvars.iv186 = phi i64 [ %indvars.iv.next187, %for.body90 ], [ 0, %for.cond87.preheader ] %arrayidx92 = getelementptr inbounds [100 x i32], ptr %kami2, i64 0, i64 %indvars.iv186 %57 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %57) %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1 %58 = load i32, ptr %n, align 4, !tbaa !5 %59 = sext i32 %58 to i64 %cmp89.not.not = icmp slt i64 %indvars.iv186, %59 br i1 %cmp89.not.not, label %for.body90, label %for.inc98, !llvm.loop !21 for.inc98: ; preds = %for.body90, %for.cond87.preheader, %for.cond67.preheader, %for.end60 %putchar137 = call i32 @putchar(i32 10) %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 %60 = load i32, ptr %n, align 4, !tbaa !5 %61 = sext i32 %60 to i64 %cmp36.not.not = icmp slt i64 %indvars.iv197, %61 br i1 %cmp36.not.not, label %for.body37, label %for.end100, !llvm.loop !22 for.end100: ; preds = %for.inc98, %for.cond.preheader, %for.cond35.preheader %call101 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %62 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not = icmp eq i32 %62, 0 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !23 while.end: ; preds = %for.end100, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %kami2) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 40000, 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) #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 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 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !15, !14} !18 = distinct !{!18, !10, !14, !15} !19 = distinct !{!19, !10, !15, !14} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10}
#include <stdio.h> int main(void) { int num,i,j,data[11][11]={0}; while(scanf("%d",&num),num){ for(i=0;i<num;i++){ switch(num){ case 1: scanf("%d",&data[i][0]); break; case 2: scanf("%d %d",&data[i][0],&data[i][1]); break; case 3: scanf("%d %d %d",&data[i][0],&data[i][1],&data[i][2]); break; case 4: scanf("%d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3]); break; case 5: scanf("%d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4]); break; case 6: scanf("%d %d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4],&data[i][5]); break; case 7: scanf("%d %d %d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4],&data[i][5],&data[i][6]); break; case 8: scanf("%d %d %d %d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4],&data[i][5],&data[i][6],&data[i][7]); break; case 9: scanf("%d %d %d %d %d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4],&data[i][5],&data[i][6],&data[i][7],&data[i][8]); break; case 10: scanf("%d %d %d %d %d %d %d %d %d %d",&data[i][0],&data[i][1],&data[i][2],&data[i][3],&data[i][4],&data[i][5],&data[i][6],&data[i][7],&data[i][8],&data[i][9]); break; } } for(i=0;i<num;i++){ for(j=0;j<num;j++){ data[i][num]=data[i][num]+data[i][j]; data[num][i]=data[num][i]+data[j][i]; } } for(i=0;i<num;i++){ data[num][num]=data[num][num]+data[num][i]; } for(i=0;i<=num;i++){ for(j=0;j<num;j++){ printf("%5d",data[i][j]); } printf("%5d\n",data[i][num]); } for(i=0;i<11;i++){ for(j=0;j<11;j++){ data[i][j]=0; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194584/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194584/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 [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.3 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.4 = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.5 = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1 @.str.6 = private unnamed_addr constant [21 x i8] c"%d %d %d %d %d %d %d\00", align 1 @.str.7 = private unnamed_addr constant [24 x i8] c"%d %d %d %d %d %d %d %d\00", align 1 @.str.8 = private unnamed_addr constant [27 x i8] c"%d %d %d %d %d %d %d %d %d\00", align 1 @.str.9 = private unnamed_addr constant [30 x i8] c"%d %d %d %d %d %d %d %d %d %d\00", align 1 @.str.10 = private unnamed_addr constant [4 x i8] c"%5d\00", align 1 @.str.11 = private unnamed_addr constant [5 x i8] c"%5d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %data = alloca [11 x [11 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %data) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %data, i8 0, i64 484, i1 false) %call379 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %tobool.not380 = icmp eq i32 %0, 0 br i1 %tobool.not380, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond261.preheader %1 = phi i32 [ %25, %for.cond261.preheader ], [ %0, %entry ] %cmp364 = icmp sgt i32 %1, 0 br i1 %cmp364, label %for.body, label %for.cond261.preheader for.cond183.preheader: ; preds = %for.inc %cmp184368 = icmp sgt i32 %.pr, 0 br i1 %cmp184368, label %for.cond186.preheader.lr.ph, label %for.cond239.preheader for.cond186.preheader.lr.ph: ; preds = %for.cond183.preheader %idxprom191 = zext i32 %.pr to i64 %wide.trip.count389 = zext i32 %.pr to i64 %xtraiter = and i64 %idxprom191, 1 %2 = icmp eq i32 %.pr, 1 %unroll_iter = and i64 %idxprom191, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond186.preheader.us for.cond186.preheader.us: ; preds = %for.cond186.for.inc217_crit_edge.us, %for.cond186.preheader.lr.ph %indvars.iv386 = phi i64 [ %indvars.iv.next387, %for.cond186.for.inc217_crit_edge.us ], [ 0, %for.cond186.preheader.lr.ph ] %arrayidx192.us = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv386, i64 %idxprom191 %arrayidx204.us = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom191, i64 %indvars.iv386 br i1 %2, label %for.cond186.for.inc217_crit_edge.us.unr-lcssa, label %for.body188.us for.body188.us: ; preds = %for.cond186.preheader.us, %for.body188.us %indvars.iv383 = phi i64 [ %indvars.iv.next384.1, %for.body188.us ], [ 0, %for.cond186.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.body188.us ], [ 0, %for.cond186.preheader.us ] %3 = load i32, ptr %arrayidx192.us, align 4, !tbaa !5 %arrayidx196.us = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv386, i64 %indvars.iv383 %4 = load i32, ptr %arrayidx196.us, align 4, !tbaa !5 %add.us = add nsw i32 %4, %3 store i32 %add.us, ptr %arrayidx192.us, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx204.us, align 4, !tbaa !5 %arrayidx208.us = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv383, i64 %indvars.iv386 %6 = load i32, ptr %arrayidx208.us, align 4, !tbaa !5 %add209.us = add nsw i32 %6, %5 store i32 %add209.us, ptr %arrayidx204.us, align 4, !tbaa !5 %indvars.iv.next384 = or i64 %indvars.iv383, 1 %7 = load i32, ptr %arrayidx192.us, align 4, !tbaa !5 %arrayidx196.us.1 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv386, i64 %indvars.iv.next384 %8 = load i32, ptr %arrayidx196.us.1, align 4, !tbaa !5 %add.us.1 = add nsw i32 %8, %7 store i32 %add.us.1, ptr %arrayidx192.us, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx204.us, align 4, !tbaa !5 %arrayidx208.us.1 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv.next384, i64 %indvars.iv386 %10 = load i32, ptr %arrayidx208.us.1, align 4, !tbaa !5 %add209.us.1 = add nsw i32 %10, %9 store i32 %add209.us.1, ptr %arrayidx204.us, align 4, !tbaa !5 %indvars.iv.next384.1 = add nuw nsw i64 %indvars.iv383, 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.cond186.for.inc217_crit_edge.us.unr-lcssa, label %for.body188.us, !llvm.loop !9 for.cond186.for.inc217_crit_edge.us.unr-lcssa: ; preds = %for.body188.us, %for.cond186.preheader.us %indvars.iv383.unr = phi i64 [ 0, %for.cond186.preheader.us ], [ %indvars.iv.next384.1, %for.body188.us ] br i1 %lcmp.mod.not, label %for.cond186.for.inc217_crit_edge.us, label %for.body188.us.epil for.body188.us.epil: ; preds = %for.cond186.for.inc217_crit_edge.us.unr-lcssa %11 = load i32, ptr %arrayidx192.us, align 4, !tbaa !5 %arrayidx196.us.epil = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv386, i64 %indvars.iv383.unr %12 = load i32, ptr %arrayidx196.us.epil, align 4, !tbaa !5 %add.us.epil = add nsw i32 %12, %11 store i32 %add.us.epil, ptr %arrayidx192.us, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx204.us, align 4, !tbaa !5 %arrayidx208.us.epil = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv383.unr, i64 %indvars.iv386 %14 = load i32, ptr %arrayidx208.us.epil, align 4, !tbaa !5 %add209.us.epil = add nsw i32 %14, %13 store i32 %add209.us.epil, ptr %arrayidx204.us, align 4, !tbaa !5 br label %for.cond186.for.inc217_crit_edge.us for.cond186.for.inc217_crit_edge.us: ; preds = %for.cond186.for.inc217_crit_edge.us.unr-lcssa, %for.body188.us.epil %indvars.iv.next387 = add nuw nsw i64 %indvars.iv386, 1 %exitcond390.not = icmp eq i64 %indvars.iv.next387, %wide.trip.count389 br i1 %exitcond390.not, label %for.cond220.preheader, label %for.cond186.preheader.us, !llvm.loop !11 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond.preheader ] %15 = phi i32 [ %.pr, %for.inc ], [ %1, %for.cond.preheader ] switch i32 %15, label %for.inc [ i32 1, label %sw.bb i32 2, label %sw.bb3 i32 3, label %sw.bb11 i32 4, label %sw.bb22 i32 5, label %sw.bb36 i32 6, label %sw.bb53 i32 7, label %sw.bb73 i32 8, label %sw.bb96 i32 9, label %sw.bb122 i32 10, label %sw.bb151 ] sw.bb: ; preds = %for.body %arrayidx = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) br label %for.inc sw.bb3: ; preds = %for.body %arrayidx5 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx9 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx9) br label %for.inc sw.bb11: ; preds = %for.body %arrayidx13 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx17 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx20 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx13, ptr noundef nonnull %arrayidx17, ptr noundef nonnull %arrayidx20) br label %for.inc sw.bb22: ; preds = %for.body %arrayidx24 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx28 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx31 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx34 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx24, ptr noundef nonnull %arrayidx28, ptr noundef nonnull %arrayidx31, ptr noundef nonnull %arrayidx34) br label %for.inc sw.bb36: ; preds = %for.body %arrayidx38 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx42 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx45 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx48 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx51 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %call52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx38, ptr noundef nonnull %arrayidx42, ptr noundef nonnull %arrayidx45, ptr noundef nonnull %arrayidx48, ptr noundef nonnull %arrayidx51) br label %for.inc sw.bb53: ; preds = %for.body %arrayidx55 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx59 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx62 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx65 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx68 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %arrayidx71 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 5 %call72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx55, ptr noundef nonnull %arrayidx59, ptr noundef nonnull %arrayidx62, ptr noundef nonnull %arrayidx65, ptr noundef nonnull %arrayidx68, ptr noundef nonnull %arrayidx71) br label %for.inc sw.bb73: ; preds = %for.body %arrayidx75 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx79 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx82 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx85 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx88 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %arrayidx91 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 5 %arrayidx94 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 6 %call95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %arrayidx75, ptr noundef nonnull %arrayidx79, ptr noundef nonnull %arrayidx82, ptr noundef nonnull %arrayidx85, ptr noundef nonnull %arrayidx88, ptr noundef nonnull %arrayidx91, ptr noundef nonnull %arrayidx94) br label %for.inc sw.bb96: ; preds = %for.body %arrayidx98 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx102 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx105 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx108 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx111 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %arrayidx114 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 5 %arrayidx117 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 6 %arrayidx120 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 7 %call121 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %arrayidx98, ptr noundef nonnull %arrayidx102, ptr noundef nonnull %arrayidx105, ptr noundef nonnull %arrayidx108, ptr noundef nonnull %arrayidx111, ptr noundef nonnull %arrayidx114, ptr noundef nonnull %arrayidx117, ptr noundef nonnull %arrayidx120) br label %for.inc sw.bb122: ; preds = %for.body %arrayidx124 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx128 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx131 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx134 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx137 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %arrayidx140 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 5 %arrayidx143 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 6 %arrayidx146 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 7 %arrayidx149 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 8 %call150 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %arrayidx124, ptr noundef nonnull %arrayidx128, ptr noundef nonnull %arrayidx131, ptr noundef nonnull %arrayidx134, ptr noundef nonnull %arrayidx137, ptr noundef nonnull %arrayidx140, ptr noundef nonnull %arrayidx143, ptr noundef nonnull %arrayidx146, ptr noundef nonnull %arrayidx149) br label %for.inc sw.bb151: ; preds = %for.body %arrayidx153 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv %arrayidx157 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 1 %arrayidx160 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 2 %arrayidx163 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 3 %arrayidx166 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 4 %arrayidx169 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 5 %arrayidx172 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 6 %arrayidx175 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 7 %arrayidx178 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 8 %arrayidx181 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv, i64 9 %call182 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %arrayidx153, ptr noundef nonnull %arrayidx157, ptr noundef nonnull %arrayidx160, ptr noundef nonnull %arrayidx163, ptr noundef nonnull %arrayidx166, ptr noundef nonnull %arrayidx169, ptr noundef nonnull %arrayidx172, ptr noundef nonnull %arrayidx175, ptr noundef nonnull %arrayidx178, ptr noundef nonnull %arrayidx181) br label %for.inc for.inc: ; preds = %sw.bb, %sw.bb3, %sw.bb11, %sw.bb22, %sw.bb36, %sw.bb53, %sw.bb73, %sw.bb96, %sw.bb122, %sw.bb151, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %num, align 4, !tbaa !5 %16 = sext i32 %.pr to i64 %cmp = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp, label %for.body, label %for.cond183.preheader, !llvm.loop !12 for.cond220.preheader: ; preds = %for.cond186.for.inc217_crit_edge.us br i1 %cmp184368, label %for.body222.lr.ph, label %for.cond239.preheader for.body222.lr.ph: ; preds = %for.cond220.preheader %idxprom223 = zext i32 %.pr to i64 %arrayidx226 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %idxprom223 %arrayidx226.promoted = load i32, ptr %arrayidx226, align 4, !tbaa !5 %xtraiter410 = and i64 %idxprom191, 3 %17 = icmp ult i32 %.pr, 4 br i1 %17, label %for.cond239.preheader.loopexit.unr-lcssa, label %for.body222.lr.ph.new for.body222.lr.ph.new: ; preds = %for.body222.lr.ph %unroll_iter412 = and i64 %idxprom191, 4294967292 br label %for.body222 for.cond239.preheader.loopexit.unr-lcssa: ; preds = %for.body222, %for.body222.lr.ph %indvars.iv391.unr = phi i64 [ 0, %for.body222.lr.ph ], [ %indvars.iv.next392.3, %for.body222 ] %.unr = phi i32 [ %arrayidx226.promoted, %for.body222.lr.ph ], [ %add231.3, %for.body222 ] %lcmp.mod411.not = icmp eq i64 %xtraiter410, 0 br i1 %lcmp.mod411.not, label %for.cond239.preheader, label %for.body222.epil for.body222.epil: ; preds = %for.cond239.preheader.loopexit.unr-lcssa, %for.body222.epil %indvars.iv391.epil = phi i64 [ %indvars.iv.next392.epil, %for.body222.epil ], [ %indvars.iv391.unr, %for.cond239.preheader.loopexit.unr-lcssa ] %18 = phi i32 [ %add231.epil, %for.body222.epil ], [ %.unr, %for.cond239.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body222.epil ], [ 0, %for.cond239.preheader.loopexit.unr-lcssa ] %arrayidx230.epil = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %indvars.iv391.epil %19 = load i32, ptr %arrayidx230.epil, align 4, !tbaa !5 %add231.epil = add nsw i32 %19, %18 store i32 %add231.epil, ptr %arrayidx226, align 4, !tbaa !5 %indvars.iv.next392.epil = add nuw nsw i64 %indvars.iv391.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter410 br i1 %epil.iter.cmp.not, label %for.cond239.preheader, label %for.body222.epil, !llvm.loop !13 for.cond239.preheader: ; preds = %for.cond239.preheader.loopexit.unr-lcssa, %for.body222.epil, %for.cond183.preheader, %for.cond220.preheader %cmp240.not375 = icmp slt i32 %.pr, 0 br i1 %cmp240.not375, label %for.cond261.preheader, label %for.cond242.preheader for.body222: ; preds = %for.body222, %for.body222.lr.ph.new %indvars.iv391 = phi i64 [ 0, %for.body222.lr.ph.new ], [ %indvars.iv.next392.3, %for.body222 ] %20 = phi i32 [ %arrayidx226.promoted, %for.body222.lr.ph.new ], [ %add231.3, %for.body222 ] %niter413 = phi i64 [ 0, %for.body222.lr.ph.new ], [ %niter413.next.3, %for.body222 ] %arrayidx230 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %indvars.iv391 %21 = load i32, ptr %arrayidx230, align 4, !tbaa !5 %add231 = add nsw i32 %21, %20 store i32 %add231, ptr %arrayidx226, align 4, !tbaa !5 %indvars.iv.next392 = or i64 %indvars.iv391, 1 %arrayidx230.1 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %indvars.iv.next392 %22 = load i32, ptr %arrayidx230.1, align 4, !tbaa !5 %add231.1 = add nsw i32 %22, %add231 store i32 %add231.1, ptr %arrayidx226, align 4, !tbaa !5 %indvars.iv.next392.1 = or i64 %indvars.iv391, 2 %arrayidx230.2 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %indvars.iv.next392.1 %23 = load i32, ptr %arrayidx230.2, align 4, !tbaa !5 %add231.2 = add nsw i32 %23, %add231.1 store i32 %add231.2, ptr %arrayidx226, align 4, !tbaa !5 %indvars.iv.next392.2 = or i64 %indvars.iv391, 3 %arrayidx230.3 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %idxprom223, i64 %indvars.iv.next392.2 %24 = load i32, ptr %arrayidx230.3, align 4, !tbaa !5 %add231.3 = add nsw i32 %24, %add231.2 store i32 %add231.3, ptr %arrayidx226, align 4, !tbaa !5 %indvars.iv.next392.3 = add nuw nsw i64 %indvars.iv391, 4 %niter413.next.3 = add i64 %niter413, 4 %niter413.ncmp.3 = icmp eq i64 %niter413.next.3, %unroll_iter412 br i1 %niter413.ncmp.3, label %for.cond239.preheader.loopexit.unr-lcssa, label %for.body222, !llvm.loop !15 for.cond261.preheader: ; preds = %for.end252, %for.cond.preheader, %for.cond239.preheader call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %data, i8 0, i64 484, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %25 = load i32, ptr %num, align 4, !tbaa !5 %tobool.not = icmp eq i32 %25, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !16 for.cond242.preheader: ; preds = %for.cond239.preheader, %for.end252 %26 = phi i32 [ %31, %for.end252 ], [ %.pr, %for.cond239.preheader ] %indvars.iv399 = phi i64 [ %indvars.iv.next400, %for.end252 ], [ 0, %for.cond239.preheader ] %cmp243372 = icmp sgt i32 %26, 0 br i1 %cmp243372, label %for.body244, label %for.cond242.preheader.for.end252_crit_edge for.cond242.preheader.for.end252_crit_edge: ; preds = %for.cond242.preheader %.pre = sext i32 %26 to i64 br label %for.end252 for.body244: ; preds = %for.cond242.preheader, %for.body244 %indvars.iv396 = phi i64 [ %indvars.iv.next397, %for.body244 ], [ 0, %for.cond242.preheader ] %arrayidx248 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv399, i64 %indvars.iv396 %27 = load i32, ptr %arrayidx248, align 4, !tbaa !5 %call249 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %27) %indvars.iv.next397 = add nuw nsw i64 %indvars.iv396, 1 %28 = load i32, ptr %num, align 4, !tbaa !5 %29 = sext i32 %28 to i64 %cmp243 = icmp slt i64 %indvars.iv.next397, %29 br i1 %cmp243, label %for.body244, label %for.end252, !llvm.loop !17 for.end252: ; preds = %for.body244, %for.cond242.preheader.for.end252_crit_edge %idxprom255.pre-phi = phi i64 [ %.pre, %for.cond242.preheader.for.end252_crit_edge ], [ %29, %for.body244 ] %arrayidx256 = getelementptr inbounds [11 x [11 x i32]], ptr %data, i64 0, i64 %indvars.iv399, i64 %idxprom255.pre-phi %30 = load i32, ptr %arrayidx256, align 4, !tbaa !5 %call257 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %30) %indvars.iv.next400 = add nuw nsw i64 %indvars.iv399, 1 %31 = load i32, ptr %num, align 4, !tbaa !5 %32 = sext i32 %31 to i64 %cmp240.not.not = icmp slt i64 %indvars.iv399, %32 br i1 %cmp240.not.not, label %for.cond242.preheader, label %for.cond261.preheader, !llvm.loop !18 while.end: ; preds = %for.cond261.preheader, %entry call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %data) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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: 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 @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) #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 = { 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" } 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 = distinct !{!12, !10} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include <stdio.h> #include <math.h> #include <string.h> #include <ctype.h> int main(void) { int n; while(1) { int a[11][11] ={}; int i, j; scanf("%d", &n); if(n==0) break; for(i=0; i<n; i++) { for(j=0; j<n; j++) { scanf("%d", &a[i][j]); a[i][n]+=a[i][j]; } a[n][n]+=a[i][n]; } for(i=0; i<n; i++) for(j=0; j<n; j++) a[n][i]+=a[j][i]; for(i=0; i<n+1; i++) { for(j=0; j<n+1; j++) printf("%5d", a[i][j]); puts(""); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194634/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"%5d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [11 x [11 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %a, i8 0, i64 484, i1 false) %call111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp112 = icmp eq i32 %0, 0 br i1 %cmp112, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %23, %cleanup ], [ %0, %entry ] %cmp199 = icmp sgt i32 %1, 0 br i1 %cmp199, label %for.cond2.preheader, label %cleanup for.cond28.preheader: ; preds = %for.end %cmp29105 = icmp sgt i32 %14, 0 br i1 %cmp29105, label %for.cond31.preheader.lr.ph, label %for.cond49.preheader for.cond31.preheader.lr.ph: ; preds = %for.cond28.preheader %idxprom38 = zext i32 %14 to i64 %wide.trip.count131 = zext i32 %14 to i64 %xtraiter = and i64 %wide.trip.count131, 3 %2 = icmp ult i32 %14, 4 %unroll_iter = and i64 %wide.trip.count131, 4294967292 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond31.preheader.us for.cond31.preheader.us: ; preds = %for.cond31.for.inc46_crit_edge.us, %for.cond31.preheader.lr.ph %indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.cond31.for.inc46_crit_edge.us ], [ 0, %for.cond31.preheader.lr.ph ] %arrayidx41.us = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %idxprom38, i64 %indvars.iv128 %arrayidx41.promoted.us = load i32, ptr %arrayidx41.us, align 4, !tbaa !5 br i1 %2, label %for.cond31.for.inc46_crit_edge.us.unr-lcssa, label %for.body33.us for.body33.us: ; preds = %for.cond31.preheader.us, %for.body33.us %indvars.iv123 = phi i64 [ %indvars.iv.next124.3, %for.body33.us ], [ 0, %for.cond31.preheader.us ] %3 = phi i32 [ %add42.us.3, %for.body33.us ], [ %arrayidx41.promoted.us, %for.cond31.preheader.us ] %niter = phi i64 [ %niter.next.3, %for.body33.us ], [ 0, %for.cond31.preheader.us ] %arrayidx37.us = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv128 %4 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 %add42.us = add nsw i32 %3, %4 store i32 %add42.us, ptr %arrayidx41.us, align 4, !tbaa !5 %indvars.iv.next124 = or i64 %indvars.iv123, 1 %arrayidx37.us.1 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv.next124, i64 %indvars.iv128 %5 = load i32, ptr %arrayidx37.us.1, align 4, !tbaa !5 %add42.us.1 = add nsw i32 %add42.us, %5 store i32 %add42.us.1, ptr %arrayidx41.us, align 4, !tbaa !5 %indvars.iv.next124.1 = or i64 %indvars.iv123, 2 %arrayidx37.us.2 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv.next124.1, i64 %indvars.iv128 %6 = load i32, ptr %arrayidx37.us.2, align 4, !tbaa !5 %add42.us.2 = add nsw i32 %add42.us.1, %6 store i32 %add42.us.2, ptr %arrayidx41.us, align 4, !tbaa !5 %indvars.iv.next124.2 = or i64 %indvars.iv123, 3 %arrayidx37.us.3 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv.next124.2, i64 %indvars.iv128 %7 = load i32, ptr %arrayidx37.us.3, align 4, !tbaa !5 %add42.us.3 = add nsw i32 %add42.us.2, %7 store i32 %add42.us.3, ptr %arrayidx41.us, align 4, !tbaa !5 %indvars.iv.next124.3 = add nuw nsw i64 %indvars.iv123, 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.cond31.for.inc46_crit_edge.us.unr-lcssa, label %for.body33.us, !llvm.loop !9 for.cond31.for.inc46_crit_edge.us.unr-lcssa: ; preds = %for.body33.us, %for.cond31.preheader.us %indvars.iv123.unr = phi i64 [ 0, %for.cond31.preheader.us ], [ %indvars.iv.next124.3, %for.body33.us ] %.unr = phi i32 [ %arrayidx41.promoted.us, %for.cond31.preheader.us ], [ %add42.us.3, %for.body33.us ] br i1 %lcmp.mod.not, label %for.cond31.for.inc46_crit_edge.us, label %for.body33.us.epil for.body33.us.epil: ; preds = %for.cond31.for.inc46_crit_edge.us.unr-lcssa, %for.body33.us.epil %indvars.iv123.epil = phi i64 [ %indvars.iv.next124.epil, %for.body33.us.epil ], [ %indvars.iv123.unr, %for.cond31.for.inc46_crit_edge.us.unr-lcssa ] %8 = phi i32 [ %add42.us.epil, %for.body33.us.epil ], [ %.unr, %for.cond31.for.inc46_crit_edge.us.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body33.us.epil ], [ 0, %for.cond31.for.inc46_crit_edge.us.unr-lcssa ] %arrayidx37.us.epil = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv123.epil, i64 %indvars.iv128 %9 = load i32, ptr %arrayidx37.us.epil, align 4, !tbaa !5 %add42.us.epil = add nsw i32 %8, %9 store i32 %add42.us.epil, ptr %arrayidx41.us, align 4, !tbaa !5 %indvars.iv.next124.epil = add nuw nsw i64 %indvars.iv123.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.cond31.for.inc46_crit_edge.us, label %for.body33.us.epil, !llvm.loop !11 for.cond31.for.inc46_crit_edge.us: ; preds = %for.body33.us.epil, %for.cond31.for.inc46_crit_edge.us.unr-lcssa %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131 br i1 %exitcond132.not, label %for.cond49.preheader, label %for.cond31.preheader.us, !llvm.loop !13 for.cond2.preheader: ; preds = %for.cond.preheader, %for.end %10 = phi i32 [ %14, %for.end ], [ %1, %for.cond.preheader ] %indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.end ], [ 0, %for.cond.preheader ] %cmp397 = icmp sgt i32 %10, 0 br i1 %cmp397, label %for.body4, label %for.cond2.preheader.for.end_crit_edge for.cond2.preheader.for.end_crit_edge: ; preds = %for.cond2.preheader %idxprom18.phi.trans.insert = sext i32 %10 to i64 %arrayidx19.phi.trans.insert = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv120, i64 %idxprom18.phi.trans.insert %.pre = load i32, ptr %arrayidx19.phi.trans.insert, align 4, !tbaa !5 br label %for.end for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv117 = phi i64 [ %indvars.iv.next118, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv120, i64 %indvars.iv117 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %11 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %12 = load i32, ptr %n, align 4, !tbaa !5 %idxprom14 = sext i32 %12 to i64 %arrayidx15 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv120, i64 %idxprom14 %13 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %add = add nsw i32 %13, %11 store i32 %add, ptr %arrayidx15, align 4, !tbaa !5 %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %cmp3 = icmp slt i64 %indvars.iv.next118, %idxprom14 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body4, %for.cond2.preheader.for.end_crit_edge %idxprom18.pre-phi = phi i64 [ %idxprom18.phi.trans.insert, %for.cond2.preheader.for.end_crit_edge ], [ %idxprom14, %for.body4 ] %14 = phi i32 [ %10, %for.cond2.preheader.for.end_crit_edge ], [ %12, %for.body4 ] %15 = phi i32 [ %.pre, %for.cond2.preheader.for.end_crit_edge ], [ %add, %for.body4 ] %arrayidx23 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %idxprom18.pre-phi, i64 %idxprom18.pre-phi %16 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %add24 = add nsw i32 %16, %15 store i32 %add24, ptr %arrayidx23, align 4, !tbaa !5 %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %cmp1 = icmp slt i64 %indvars.iv.next121, %idxprom18.pre-phi br i1 %cmp1, label %for.cond2.preheader, label %for.cond28.preheader, !llvm.loop !15 for.cond49.preheader: ; preds = %for.cond31.for.inc46_crit_edge.us, %for.cond28.preheader %cmp51.not109 = icmp slt i32 %14, 0 br i1 %cmp51.not109, label %cleanup, label %for.cond53.preheader for.cond53.preheader: ; preds = %for.cond49.preheader, %for.end64 %17 = phi i32 [ %21, %for.end64 ], [ %14, %for.cond49.preheader ] %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.end64 ], [ 0, %for.cond49.preheader ] %cmp55.not107 = icmp slt i32 %17, 0 br i1 %cmp55.not107, label %for.end64, label %for.body56 for.body56: ; preds = %for.cond53.preheader, %for.body56 %indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.body56 ], [ 0, %for.cond53.preheader ] %arrayidx60 = getelementptr inbounds [11 x [11 x i32]], ptr %a, i64 0, i64 %indvars.iv136, i64 %indvars.iv133 %18 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18) %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp55.not.not = icmp slt i64 %indvars.iv133, %20 br i1 %cmp55.not.not, label %for.body56, label %for.end64, !llvm.loop !17 for.end64: ; preds = %for.body56, %for.cond53.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp51.not.not = icmp slt i64 %indvars.iv136, %22 br i1 %cmp51.not.not, label %for.cond53.preheader, label %cleanup, !llvm.loop !18 cleanup: ; preds = %for.end64, %for.cond.preheader, %for.cond49.preheader call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 484, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) %a, i8 0, i64 484, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %23, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 484, ptr nonnull %a) #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: 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 @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) #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 = { 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" } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !16} !16 = !{!"llvm.loop.unswitch.partial.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,G[100][100]; int color[100],d[100],f[100],tt; void DFS_visit(int v){ int i; color[v]=GRAY; d[v]=++tt; for(i=0;i<n;i++){ if(G[v][i]==0)continue; if(color[i]==WHITE){ DFS_visit(i); } } color[v]=BLACK; f[v]=++tt; } void DFS(){ int i; //初期化 for(i=0;i<n;i++){ color[i]=WHITE; } tt=0; for(i=0;i<n;i++){ if(color[i]==WHITE){ DFS_visit(i); } } for(i=0;i<n;i++){ printf("%d %d %d\n",i+1,d[i],f[i]); } } int main(){ int i,j,u,k,v; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ G[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; G[u][v]=1; } } DFS(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194678/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194678/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" @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @DFS_visit(i32 noundef %v) local_unnamed_addr #0 { entry: %idxprom = sext i32 %v to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @DFS_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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 nounwind uwtable define dso_local void @DFS() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread for.cond10.preheader.thread: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.end19 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @DFS_visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader ret void } ; 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 #2 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @G, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @G, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13 for.cond9.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @G, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1442 = icmp sgt i32 %14, 0 br i1 %cmp1442, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.143, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17 for.end27: ; preds = %for.inc25 %cmp31.i = icmp sgt i32 %.pr, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27 store i32 0, ptr @tt, align 4, !tbaa !5 br label %DFS.exit for.body3.preheader.i: ; preds = %for.end27 %18 = zext i32 %.pr to i64 %19 = shl nuw nsw i64 %18, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %20 = icmp sgt i32 %24, 0 br i1 %20, label %for.body12.i, label %DFS.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %22, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %23 = trunc i64 %indvars.iv.i to i32 call void @DFS_visit(i32 noundef %23) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %25 = sext i32 %24 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %25 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i %27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %28 = trunc i64 %indvars.iv.next40.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27) %29 = load i32, ptr @n, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30 br i1 %cmp11.i, label %for.body12.i, label %DFS.exit, !llvm.loop !12 DFS.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = { 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define N 200 int n, time = 0; int color[N], d[N], f[N], A[N][N]; void DFSVisit(int u){ int v; color[u] = GRAY; d[u] = ++time; for(v=1; v <= n; v++){ if((color[v]== WHITE) && (A[u][v] == 1)) DFSVisit(v); } color[u] = BLACK; f[u] = ++time; } void DFS(){ int u; for(u=1; u <= n; u++){ color[u] = WHITE; } for(u=1; u <= n; u++){ if(color[u] == WHITE) DFSVisit(u); } } int main(void){ int i, j, u, v, k; scanf("%d", &n); for(i=1; i<=n; i++){ for(j=1; j<=n; j++){ A[i][j] = 0; } } for(i=1; i<=n; i++){ scanf("%d%d", &u, &k); for(j=1; j<=k; j++){ scanf("%d", &v); A[u][v] = 1; } } DFS(); for(i=1; i<=n; i++) printf("%d %d %d\n", i, d[i], f[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194735/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194735/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" @time = dso_local local_unnamed_addr global i32 0, align 4 @color = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @A = dso_local local_unnamed_addr global [200 x [200 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @DFSVisit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @time, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [200 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %1, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx4 = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %3, 0 br i1 %cmp5, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx9 = getelementptr inbounds [200 x [200 x i32]], ptr @A, i64 0, i64 %idxprom, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 1 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @DFSVisit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre28 = load i32, ptr @time, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre28, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc14 = add nsw i32 %8, 1 store i32 %inc14, ptr @time, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [200 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc14, ptr %arrayidx16, 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(readwrite, inaccessiblemem: none) uwtable define dso_local void @DFS() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not16 = icmp slt i32 %0, 1 br i1 %cmp.not16, label %for.end9, label %for.body3.preheader for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([200 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc7 %3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ] %indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %4, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %5 = trunc i64 %indvars.iv to i32 tail call void @DFSVisit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not54 = icmp slt i32 %0, 1 br i1 %cmp.not54, label %for.end37, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.preheader.new for.cond1.preheader.preheader.new: ; preds = %for.cond1.preheader.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %indvar.next.7, %for.cond1.preheader ] %niter = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %niter.next.7, %for.cond1.preheader ] %4 = mul nuw nsw i64 %indvar, 800 %gep = getelementptr i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 %4 tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 800 %gep68 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 800), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep68, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 800 %gep69 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 1600), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 4 %gep69, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 800 %gep70 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 2400), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep70, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 800 %gep71 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 3200), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 4 %gep71, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 800 %gep72 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 4000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep72, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 800 %gep73 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 4800), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 4 %gep73, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 800 %gep74 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 5600), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep74, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader, !llvm.loop !12 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next.7, %for.cond1.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.epil for.cond1.preheader.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 800 %gep.epil = getelementptr i8, ptr getelementptr inbounds ([200 x [200 x i32]], ptr @A, i64 0, i64 1, i64 1), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.epil, !llvm.loop !13 for.cond9.preheader: ; preds = %for.cond1.preheader.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp.not54, label %for.end37, label %for.body11 for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.159 = phi i32 [ %inc25, %for.inc24 ], [ 1, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %k, align 4, !tbaa !5 %cmp14.not56 = icmp slt i32 %13, 1 br i1 %cmp14.not56, label %for.inc24, label %for.body15 for.body15: ; preds = %for.body11, %for.body15 %j.157 = phi i32 [ %inc22, %for.body15 ], [ 1, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %14 = load i32, ptr %u, align 4, !tbaa !5 %idxprom17 = sext i32 %14 to i64 %15 = load i32, ptr %v, align 4, !tbaa !5 %idxprom19 = sext i32 %15 to i64 %arrayidx20 = getelementptr inbounds [200 x [200 x i32]], ptr @A, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.157, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14.not.not = icmp slt i32 %j.157, %16 br i1 %cmp14.not.not, label %for.body15, label %for.inc24, !llvm.loop !15 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.159, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10.not.not = icmp slt i32 %i.159, %.pr br i1 %cmp10.not.not, label %for.body11, label %for.end26, !llvm.loop !16 for.end26: ; preds = %for.inc24 %cmp.not16.i = icmp slt i32 %.pr, 1 br i1 %cmp.not16.i, label %for.end37, label %for.body3.preheader.i for.body3.preheader.i: ; preds = %for.end26 %17 = zext i32 %.pr to i64 %18 = shl nuw nsw i64 %17, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([200 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %18, i1 false), !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ] %indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [200 x i32], ptr @color, i64 0, i64 %indvars.iv.i %20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %20, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %21 = trunc i64 %indvars.iv.i to i32 call void @DFSVisit(i32 noundef %21) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %23 = sext i32 %22 to i64 %cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %23 br i1 %cmp2.not.not.i, label %for.body3.i, label %DFS.exit, !llvm.loop !11 DFS.exit: ; preds = %for.inc7.i %24 = icmp slt i32 %22, 1 br i1 %24, label %for.end37, label %for.body29 for.body29: ; preds = %DFS.exit, %for.body29 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body29 ], [ 1, %DFS.exit ] %arrayidx31 = getelementptr inbounds [200 x i32], ptr @d, i64 0, i64 %indvars.iv %25 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %arrayidx33 = getelementptr inbounds [200 x i32], ptr @f, i64 0, i64 %indvars.iv %26 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %27 = trunc i64 %indvars.iv to i32 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27, i32 noundef %25, i32 noundef %26) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %28 = load i32, ptr @n, align 4, !tbaa !5 %29 = sext i32 %28 to i64 %cmp28.not.not = icmp slt i64 %indvars.iv, %29 br i1 %cmp28.not.not, label %for.body29, label %for.end37, !llvm.loop !17 for.end37: ; preds = %for.body29, %entry, %for.cond9.preheader, %for.end26, %DFS.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #6 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 ; 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> void visit(int); int map[101][101]; int f[101],d[101],color[101],time,n; void visit(int u) { int i; color[u]=1; d[u]=++time; for(i=0;i<n;i++){ if(map[u][i]==1){ if(color[i]==0)visit(i); } } color[u]=2; f[u]=++time; } int main() { int i,j,v,v2,m; scanf("%d",&n); for(i=0;i<n;i++){ color[i]=0; for(j=0;j<n;j++){ map[i][j]=0; } } time=0; for(i=0;i<n;i++){ scanf("%d%d",&v,&m); for(j=0;j<m;j++){ scanf("%d",&v2); map[v-1][v2-1]=1; } } for(i=0;i<n;i++){ if(color[i]==0)visit(i); } for(i=0;i<n;i++){ printf("%d %d %d\n",i+1,d[i],f[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194779/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194779/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" @color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @time = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @map = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @time, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @map, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.then %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then11, %if.then %6 = phi i32 [ %2, %for.body ], [ %.pre, %if.then11 ], [ %2, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @time, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @time, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %v = alloca i32, align 4 %v2 = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v2) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp70 = icmp sgt i32 %0, 0 br i1 %cmp70, label %for.body.us.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry store i32 0, ptr @time, align 4, !tbaa !5 br label %for.end49 for.body.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.end10.unr-lcssa, label %for.body.us.preheader.new for.body.us.preheader.new: ; preds = %for.body.us.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.body.us for.body.us: ; preds = %for.body.us, %for.body.us.preheader.new %indvar = phi i64 [ 0, %for.body.us.preheader.new ], [ %indvar.next.7, %for.body.us ] %niter = phi i64 [ 0, %for.body.us.preheader.new ], [ %niter.next.7, %for.body.us ] %4 = mul nuw nsw i64 %indvar, 404 %scevgep = getelementptr i8, ptr @map, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 404 %gep = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 404), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 404 %gep92 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 808), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 8 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 404 %gep93 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 1212), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 404 %gep94 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 1616), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 404 %gep95 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 2020), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep95, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 404 %gep96 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 2424), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 8 %gep96, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 404 %gep97 = getelementptr i8, ptr getelementptr (i8, ptr @map, i64 2828), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep97, i8 0, i64 %2, 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.end10.unr-lcssa, label %for.body.us, !llvm.loop !11 for.end10.unr-lcssa: ; preds = %for.body.us, %for.body.us.preheader %indvar.unr = phi i64 [ 0, %for.body.us.preheader ], [ %indvar.next.7, %for.body.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end10, label %for.body.us.epil for.body.us.epil: ; preds = %for.end10.unr-lcssa, %for.body.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.body.us.epil ], [ %indvar.unr, %for.end10.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.us.epil ], [ 0, %for.end10.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 404 %scevgep.epil = getelementptr i8, ptr @map, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, 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.end10, label %for.body.us.epil, !llvm.loop !12 for.end10: ; preds = %for.body.us.epil, %for.end10.unr-lcssa store i32 0, ptr @time, align 4, !tbaa !5 br i1 %cmp70, label %for.body13, label %for.end49 for.cond30.preheader: ; preds = %for.inc27 %cmp3176 = icmp sgt i32 %17, 0 br i1 %cmp3176, label %for.body32, label %for.end49 for.body13: ; preds = %for.end10, %for.inc27 %i.175 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.end10 ] %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %m) %13 = load i32, ptr %m, align 4, !tbaa !5 %cmp1672 = icmp sgt i32 %13, 0 br i1 %cmp1672, label %for.body17, label %for.inc27 for.body17: ; preds = %for.body13, %for.body17 %j.173 = phi i32 [ %inc25, %for.body17 ], [ 0, %for.body13 ] %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v2) %14 = load i32, ptr %v, align 4, !tbaa !5 %sub = add nsw i32 %14, -1 %idxprom19 = sext i32 %sub to i64 %15 = load i32, ptr %v2, align 4, !tbaa !5 %sub21 = add nsw i32 %15, -1 %idxprom22 = sext i32 %sub21 to i64 %arrayidx23 = getelementptr inbounds [101 x [101 x i32]], ptr @map, i64 0, i64 %idxprom19, i64 %idxprom22 store i32 1, ptr %arrayidx23, align 4, !tbaa !5 %inc25 = add nuw nsw i32 %j.173, 1 %16 = load i32, ptr %m, align 4, !tbaa !5 %cmp16 = icmp slt i32 %inc25, %16 br i1 %cmp16, label %for.body17, label %for.inc27, !llvm.loop !14 for.inc27: ; preds = %for.body17, %for.body13 %inc28 = add nuw nsw i32 %i.175, 1 %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc28, %17 br i1 %cmp12, label %for.body13, label %for.cond30.preheader, !llvm.loop !15 for.cond39.preheader: ; preds = %for.inc36 %18 = icmp sgt i32 %22, 0 br i1 %18, label %for.body41, label %for.end49 for.body32: ; preds = %for.cond30.preheader, %for.inc36 %19 = phi i32 [ %22, %for.inc36 ], [ %17, %for.cond30.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc36 ], [ 0, %for.cond30.preheader ] %arrayidx34 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv %20 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %cmp35 = icmp eq i32 %20, 0 br i1 %cmp35, label %if.then, label %for.inc36 if.then: ; preds = %for.body32 %21 = trunc i64 %indvars.iv to i32 call void @visit(i32 noundef %21) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc36 for.inc36: ; preds = %for.body32, %if.then %22 = phi i32 [ %19, %for.body32 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = sext i32 %22 to i64 %cmp31 = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp31, label %for.body32, label %for.cond39.preheader, !llvm.loop !16 for.body41: ; preds = %for.cond39.preheader, %for.body41 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body41 ], [ 0, %for.cond39.preheader ] %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %arrayidx43 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv83 %24 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %arrayidx45 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv83 %25 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %26 = trunc i64 %indvars.iv.next84 to i32 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26, i32 noundef %24, i32 noundef %25) %27 = load i32, ptr @n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp40 = icmp slt i64 %indvars.iv.next84, %28 br i1 %cmp40, label %for.body41, label %for.end49, !llvm.loop !17 for.end49: ; preds = %for.body41, %for.end10.thread, %for.end10, %for.cond30.preheader, %for.cond39.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v2) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #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 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 = { 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #define N 100 #define White 0 #define Gray 1 #define Black 2 void dfs_init(void); void dfs(int); int tops(void); void push(int); void pop(void); int next(int); int n, M[N][N]; int color[N],d[N],f[N],co,rem[N]; int S[N*N],top=-1; int main(){ int i,j,u,k,v; for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ M[i][j] = 0; } } scanf("%d",&n); for(i = 0; i < n; i++){ scanf("%d %d",&u,&k); for(j = 0; j < k; j++){ scanf("%d",&v); M[u-1][v-1] = 1; } } dfs_init(); for(i = 0; i < n; i++){ if(color[i] == White) dfs(i); } for(i = 0; i < n; i++){ printf("%d %d %d\n",i+1,d[i],f[i]); } return 0; } void dfs_init(){ int i; for(i = 0; i < n; i++){ color[i] = White; } } void dfs(int r){ int u,v; push(r); color[r] = Gray; d[r] = ++co; while(top != -1){ u = tops(); v = next(u); if(v != -1){ if(color[v] == White){ color[v] = Gray; d[v] = ++co; push(v); } } else { pop(); color[u] = Black; f[u] = ++co; } } } int tops(){ return S[top]; } void push(int u){ S[++top] = u; } void pop(){ top--; } int next(int u){ int v; for(v = rem[u]; v < n; v++){ rem[u] = v + 1; if(M[u][v]) return v; } return -1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194843/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194843/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" @top = dso_local local_unnamed_addr global i32 -1, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @co = dso_local local_unnamed_addr global i32 0, align 4 @S = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16 @rem = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #9 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) @M, i8 0, i64 40000, i1 false), !tbaa !5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp1069 = icmp sgt i32 %0, 0 br i1 %cmp1069, label %for.body11, label %for.end47 for.body11: ; preds = %entry, %for.inc25 %i.170 = phi i32 [ %inc26, %for.inc25 ], [ 0, %entry ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp1467 = icmp sgt i32 %1, 0 br i1 %cmp1467, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.168 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %2 = load i32, ptr %u, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom17 = sext i32 %sub to i64 %3 = load i32, ptr %v, align 4, !tbaa !5 %sub19 = add nsw i32 %3, -1 %idxprom20 = sext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom17, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.168, 1 %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %4 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !9 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.170, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %5 br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !11 for.end27: ; preds = %for.inc25 %cmp3.i = icmp sgt i32 %5, 0 br i1 %cmp3.i, label %for.body30.preheader, label %for.end47 for.body30.preheader: ; preds = %for.end27 %6 = zext i32 %5 to i64 %7 = shl nuw nsw i64 %6, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %7, i1 false), !tbaa !5 br label %for.body30 for.cond37.preheader: ; preds = %for.inc34 %8 = icmp sgt i32 %12, 0 br i1 %8, label %for.body39, label %for.end47 for.body30: ; preds = %for.body30.preheader, %for.inc34 %9 = phi i32 [ %5, %for.body30.preheader ], [ %12, %for.inc34 ] %indvars.iv = phi i64 [ 0, %for.body30.preheader ], [ %indvars.iv.next, %for.inc34 ] %arrayidx32 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %10 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %cmp33 = icmp eq i32 %10, 0 br i1 %cmp33, label %if.then, label %for.inc34 if.then: ; preds = %for.body30 %11 = trunc i64 %indvars.iv to i32 call void @dfs(i32 noundef %11) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc34 for.inc34: ; preds = %for.body30, %if.then %12 = phi i32 [ %9, %for.body30 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = sext i32 %12 to i64 %cmp29 = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp29, label %for.body30, label %for.cond37.preheader, !llvm.loop !12 for.body39: ; preds = %for.cond37.preheader, %for.body39 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body39 ], [ 0, %for.cond37.preheader ] %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %arrayidx41 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv79 %14 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv79 %15 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %16 = trunc i64 %indvars.iv.next80 to i32 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16, i32 noundef %14, i32 noundef %15) %17 = load i32, ptr @n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp38 = icmp slt i64 %indvars.iv.next80, %18 br i1 %cmp38, label %for.body39, label %for.end47, !llvm.loop !13 for.end47: ; preds = %for.body39, %for.end27, %entry, %for.cond37.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #9 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 nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_init() local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %0, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %r) local_unnamed_addr #4 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %inc.i = add nsw i32 %0, 1 store i32 %inc.i, ptr @top, align 4, !tbaa !5 %idxprom.i = sext i32 %inc.i to i64 %arrayidx.i = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom.i store i32 %r, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom = sext i32 %r to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr @co, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @co, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not42 = icmp eq i32 %inc.i, -1 br i1 %cmp.not42, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %2 = load i32, ptr @n, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end19 %dec.i3944 = phi i32 [ %inc.i, %while.body.lr.ph ], [ %dec.i38, %if.end19 ] %inc164143 = phi i32 [ %inc, %while.body.lr.ph ], [ %inc1640, %if.end19 ] %idxprom.i28 = sext i32 %dec.i3944 to i64 %arrayidx.i29 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom.i28 %3 = load i32, ptr %arrayidx.i29, align 4, !tbaa !5 %idxprom.i30 = sext i32 %3 to i64 %arrayidx.i31 = getelementptr inbounds [100 x i32], ptr @rem, i64 0, i64 %idxprom.i30 %4 = load i32, ptr %arrayidx.i31, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %smax.i = tail call i32 @llvm.smax.i32(i32 %4, i32 %2) %wide.trip.count.i = sext i32 %smax.i to i64 br label %for.cond.i for.cond.i: ; preds = %for.body.i, %while.body %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %5, %while.body ] %exitcond.not.i = icmp eq i64 %indvars.iv.i, %wide.trip.count.i br i1 %exitcond.not.i, label %if.else, label %for.body.i for.body.i: ; preds = %for.cond.i %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %6 = trunc i64 %indvars.iv.next.i to i32 store i32 %6, ptr %arrayidx.i31, align 4, !tbaa !5 %arrayidx6.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom.i30, i64 %indvars.iv.i %7 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %tobool.not.i = icmp eq i32 %7, 0 br i1 %tobool.not.i, label %for.cond.i, label %next.exit, !llvm.loop !14 next.exit: ; preds = %for.body.i %8 = trunc i64 %indvars.iv.i to i32 %cmp4.not = icmp eq i32 %8, -1 br i1 %cmp4.not, label %if.else, label %if.then if.then: ; preds = %next.exit %sext = shl i64 %indvars.iv.i, 32 %idxprom5 = ashr exact i64 %sext, 32 %arrayidx6 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom5 %9 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %9, 0 br i1 %cmp7, label %if.then8, label %if.end19 if.then8: ; preds = %if.then store i32 1, ptr %arrayidx6, align 4, !tbaa !5 %inc11 = add nsw i32 %inc164143, 1 store i32 %inc11, ptr @co, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom5 store i32 %inc11, ptr %arrayidx13, align 4, !tbaa !5 %inc.i32 = add nsw i32 %dec.i3944, 1 store i32 %inc.i32, ptr @top, align 4, !tbaa !5 %idxprom.i33 = sext i32 %inc.i32 to i64 %arrayidx.i34 = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom.i33 store i32 %8, ptr %arrayidx.i34, align 4, !tbaa !5 br label %if.end19 if.else: ; preds = %for.cond.i, %next.exit %dec.i = add nsw i32 %dec.i3944, -1 store i32 %dec.i, ptr @top, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom.i30 store i32 2, ptr %arrayidx15, align 4, !tbaa !5 %inc16 = add nsw i32 %inc164143, 1 store i32 %inc16, ptr @co, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom.i30 store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 br label %if.end19 if.end19: ; preds = %if.then, %if.then8, %if.else %inc1640 = phi i32 [ %inc164143, %if.then ], [ %inc11, %if.then8 ], [ %inc16, %if.else ] %dec.i38 = phi i32 [ %dec.i3944, %if.then ], [ %inc.i32, %if.then8 ], [ %dec.i, %if.else ] %cmp.not = icmp eq i32 %dec.i38, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %if.end19, %entry ret void } ; 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 norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @push(i32 noundef %u) local_unnamed_addr #5 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @top, align 4, !tbaa !5 %idxprom = sext i32 %inc to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom store i32 %u, ptr %arrayidx, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @tops() local_unnamed_addr #6 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr @S, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 ret i32 %1 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @next(i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @rem, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %0 to i64 %smax = tail call i32 @llvm.smax.i32(i32 %0, i32 %1) %wide.trip.count = sext i32 %smax to i64 br label %for.cond for.cond: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %2, %entry ] %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body for.body: ; preds = %for.cond %indvars.iv.next = add nsw i64 %indvars.iv, 1 %3 = trunc i64 %indvars.iv.next to i32 store i32 %3, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %for.cond, label %cleanup.split.loop.exit14, !llvm.loop !14 cleanup.split.loop.exit14: ; preds = %for.body %5 = trunc i64 %indvars.iv to i32 br label %cleanup cleanup: ; preds = %for.cond, %cleanup.split.loop.exit14 %retval.0 = phi i32 [ %5, %cleanup.split.loop.exit14 ], [ -1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @pop() local_unnamed_addr #5 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr @top, align 4, !tbaa !5 ret void } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 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 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 #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 = { mustprogress nofree norecurse 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 #6 = { mustprogress nofree norecurse nosync nounwind willreturn 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { 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} !15 = distinct !{!15, !10}
#include<stdio.h> #define MAX 105 #define WHITE 0 #define GRAY 1 #define BLACK 2 void dfs(void); void visit(int); int m[MAX][MAX]; int d[MAX]; int f[MAX]; int color[MAX]; int n; int time; int main(){ int i,j,u,k,ne; scanf("%d",&n); for(i = 1; i <= n; i++){ for(j = 1; j <= n; j++){ m[i][j] = 0; } } for(i = 1; i <= n;i++){ scanf("%d",&u); scanf("%d",&k); for(j = 1; j <= k; j++){ scanf("%d",&ne); m[i][ne] = 1; } } dfs(); for(i = 1; i <= n; i++){ printf("%d %d %d\n",i,d[i],f[i]); } return 0; } void dfs(void){ int u; for(u = 1; u <= n; u++){ color[u] = WHITE; } time = 0; for(u = 1; u <= n; u++){ if(color[u] == WHITE) visit(u); } } void visit(int u){ int v; color[u] = GRAY; d[u] = ++time; for(v = 1; v <= n; v++){ if(m[u][v] == 1 && color[v] == WHITE) visit(v); } color[u] = BLACK; f[u] = ++time; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194887/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194887/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 @n = dso_local global i32 0, align 4 @m = dso_local local_unnamed_addr global [105 x [105 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @d = dso_local local_unnamed_addr global [105 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [105 x i32] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [105 x i32] zeroinitializer, align 16 @time = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %ne = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ne) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not56 = icmp slt i32 %0, 1 br i1 %cmp.not56, label %dfs.exit.thread, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.preheader.new for.cond1.preheader.preheader.new: ; preds = %for.cond1.preheader.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %indvar.next.7, %for.cond1.preheader ] %niter = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %niter.next.7, %for.cond1.preheader ] %4 = mul nuw nsw i64 %indvar, 420 %gep = getelementptr i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 %4 tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 420 %gep73 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 420), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep73, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 420 %gep74 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 840), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep74, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 420 %gep75 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 1260), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep75, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 420 %gep76 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 1680), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 8 %gep76, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 420 %gep77 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 2100), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep77, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 420 %gep78 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 2520), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep78, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 420 %gep79 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 2940), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep79, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader, !llvm.loop !9 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next.7, %for.cond1.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.epil for.cond1.preheader.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 420 %gep.epil = getelementptr i8, ptr getelementptr inbounds ([105 x [105 x i32]], ptr @m, i64 0, i64 1, i64 1), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.epil, !llvm.loop !11 for.cond9.preheader: ; preds = %for.cond1.preheader.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp.not56, label %dfs.exit.thread, label %for.body11 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc25 ], [ 1, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u) %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %13 = load i32, ptr %k, align 4, !tbaa !5 %cmp15.not58 = icmp slt i32 %13, 1 br i1 %cmp15.not58, label %for.inc25, label %for.body16 for.body16: ; preds = %for.body11, %for.body16 %j.159 = phi i32 [ %inc23, %for.body16 ], [ 1, %for.body11 ] %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ne) %14 = load i32, ptr %ne, align 4, !tbaa !5 %idxprom20 = sext i32 %14 to i64 %arrayidx21 = getelementptr inbounds [105 x [105 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.159, 1 %15 = load i32, ptr %k, align 4, !tbaa !5 %cmp15.not.not = icmp slt i32 %j.159, %15 br i1 %cmp15.not.not, label %for.body16, label %for.inc25, !llvm.loop !13 for.inc25: ; preds = %for.body16, %for.body11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %16 = sext i32 %.pr to i64 %cmp10.not.not = icmp slt i64 %indvars.iv, %16 br i1 %cmp10.not.not, label %for.body11, label %for.end27, !llvm.loop !14 for.end27: ; preds = %for.inc25 %cmp.not16.i = icmp slt i32 %.pr, 1 br i1 %cmp.not16.i, label %dfs.exit.thread, label %for.body3.preheader.i dfs.exit.thread: ; preds = %for.end27, %for.cond9.preheader, %entry store i32 0, ptr @time, align 4, !tbaa !5 br label %for.end38 for.body3.preheader.i: ; preds = %for.end27 %17 = zext i32 %.pr to i64 %18 = shl nuw nsw i64 %17, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([105 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %18, i1 false), !tbaa !5 store i32 0, ptr @time, align 4, !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ] %indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [105 x i32], ptr @color, i64 0, i64 %indvars.iv.i %20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %20, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %21 = trunc i64 %indvars.iv.i to i32 call void @visit(i32 noundef %21) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %23 = sext i32 %22 to i64 %cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %23 br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs.exit, !llvm.loop !15 dfs.exit: ; preds = %for.inc7.i %24 = icmp slt i32 %22, 1 br i1 %24, label %for.end38, label %for.body30 for.body30: ; preds = %dfs.exit, %for.body30 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body30 ], [ 1, %dfs.exit ] %arrayidx32 = getelementptr inbounds [105 x i32], ptr @d, i64 0, i64 %indvars.iv67 %25 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %arrayidx34 = getelementptr inbounds [105 x i32], ptr @f, i64 0, i64 %indvars.iv67 %26 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %27 = trunc i64 %indvars.iv67 to i32 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %27, i32 noundef %25, i32 noundef %26) %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %28 = load i32, ptr @n, align 4, !tbaa !5 %29 = sext i32 %28 to i64 %cmp29.not.not = icmp slt i64 %indvars.iv67, %29 br i1 %cmp29.not.not, label %for.body30, label %for.end38, !llvm.loop !16 for.end38: ; preds = %for.body30, %dfs.exit.thread, %dfs.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ne) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dfs() local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not16 = icmp slt i32 %0, 1 br i1 %cmp.not16, label %for.end.thread, label %for.body3.preheader for.end.thread: ; preds = %entry store i32 0, ptr @time, align 4, !tbaa !5 br label %for.end9 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([105 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @time, align 4, !tbaa !5 br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc7 %3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ] %indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [105 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %4, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !15 for.end9: ; preds = %for.inc7, %for.end.thread ret void } ; 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [105 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @time, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [105 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %1, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [105 x [105 x i32]], ptr @m, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx9 = getelementptr inbounds [105 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.end.loopexit, !llvm.loop !17 for.end.loopexit: ; preds = %for.inc %.pre28 = load i32, ptr @time, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre28, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc14 = add nsw i32 %8, 1 store i32 %inc14, ptr @time, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [105 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc14, ptr %arrayidx16, align 4, !tbaa !5 ret void } ; 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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> int n, G[110][110], d[110], f[110], c[110]; int t = 0; void visit(int u){ int i, j, v; c[u] = 1; d[u] = ++t; for(i = 1; i <= n; i++) if(G[u][i] == 1 && c[i] == 0) visit(i); c[u] = 2; f[u] = ++t; } int main(){ int i, j, k, u, v; scanf("%d", &n); for(i = 1; i <= n; i++){ c[i] = 0; for(j = 1; j <= n; j++){ G[i][j] = 0; } } t = 0; for(i = 1; i <= n; i++){ scanf("%d%d", &u, &k); for(j = 1; j <= k; j++){ scanf("%d", &v); G[u][v] = 1; } } for(i = 1; i <= n; i++) if(c[i] == 0) visit(i); for(i = 1; i <= n; i++) printf("%d %d %d\n", i, d[i], f[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_194973/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_194973/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" @t = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @G = dso_local local_unnamed_addr global [110 x [110 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [110 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [110 x i32], ptr @c, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [110 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %1, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [110 x [110 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx9 = getelementptr inbounds [110 x i32], ptr @c, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre28 = load i32, ptr @t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre28, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc14 = add nsw i32 %8, 1 store i32 %inc14, ptr @t, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc14, ptr %arrayidx16, 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %k = alloca i32, align 4 %u = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not69 = icmp slt i32 %0, 1 br i1 %cmp.not69, label %for.end10.thread, label %for.body.preheader for.end10.thread: ; preds = %entry store i32 0, ptr @t, align 4, !tbaa !5 br label %for.end48 for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([110 x i32], ptr @c, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.end10.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvar = phi i64 [ 0, %for.body.preheader.new ], [ %indvar.next.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %4 = mul nuw nsw i64 %indvar, 440 %gep = getelementptr i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 %4 tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 440 %gep91 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 440), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep91, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 440 %gep92 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 880), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 4 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 440 %gep93 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 1320), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 440 %gep94 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 1760), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 4 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 440 %gep95 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 2200), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep95, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 440 %gep96 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 2640), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 4 %gep96, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 440 %gep97 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 3080), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep97, i8 0, i64 %2, 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.end10.unr-lcssa, label %for.body, !llvm.loop !11 for.end10.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvar.unr = phi i64 [ 0, %for.body.preheader ], [ %indvar.next.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end10, label %for.body.epil for.body.epil: ; preds = %for.end10.unr-lcssa, %for.body.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.body.epil ], [ %indvar.unr, %for.end10.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end10.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 440 %gep.epil = getelementptr i8, ptr getelementptr inbounds ([110 x [110 x i32]], ptr @G, i64 0, i64 1, i64 1), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, 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.end10, label %for.body.epil, !llvm.loop !12 for.end10: ; preds = %for.body.epil, %for.end10.unr-lcssa store i32 0, ptr @t, align 4, !tbaa !5 br i1 %cmp.not69, label %for.end48, label %for.body13 for.cond29.preheader: ; preds = %for.inc26 %cmp30.not75 = icmp slt i32 %17, 1 br i1 %cmp30.not75, label %for.end48, label %for.body31 for.body13: ; preds = %for.end10, %for.inc26 %i.174 = phi i32 [ %inc27, %for.inc26 ], [ 1, %for.end10 ] %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %k, align 4, !tbaa !5 %cmp16.not71 = icmp slt i32 %13, 1 br i1 %cmp16.not71, label %for.inc26, label %for.body17 for.body17: ; preds = %for.body13, %for.body17 %j.172 = phi i32 [ %inc24, %for.body17 ], [ 1, %for.body13 ] %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %14 = load i32, ptr %u, align 4, !tbaa !5 %idxprom19 = sext i32 %14 to i64 %15 = load i32, ptr %v, align 4, !tbaa !5 %idxprom21 = sext i32 %15 to i64 %arrayidx22 = getelementptr inbounds [110 x [110 x i32]], ptr @G, i64 0, i64 %idxprom19, i64 %idxprom21 store i32 1, ptr %arrayidx22, align 4, !tbaa !5 %inc24 = add nuw nsw i32 %j.172, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp16.not.not = icmp slt i32 %j.172, %16 br i1 %cmp16.not.not, label %for.body17, label %for.inc26, !llvm.loop !14 for.inc26: ; preds = %for.body17, %for.body13 %inc27 = add nuw nsw i32 %i.174, 1 %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp12.not.not = icmp slt i32 %i.174, %17 br i1 %cmp12.not.not, label %for.body13, label %for.cond29.preheader, !llvm.loop !15 for.cond38.preheader: ; preds = %for.inc35 %18 = icmp slt i32 %22, 1 br i1 %18, label %for.end48, label %for.body40 for.body31: ; preds = %for.cond29.preheader, %for.inc35 %19 = phi i32 [ %22, %for.inc35 ], [ %17, %for.cond29.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc35 ], [ 1, %for.cond29.preheader ] %arrayidx33 = getelementptr inbounds [110 x i32], ptr @c, i64 0, i64 %indvars.iv %20 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %cmp34 = icmp eq i32 %20, 0 br i1 %cmp34, label %if.then, label %for.inc35 if.then: ; preds = %for.body31 %21 = trunc i64 %indvars.iv to i32 call void @visit(i32 noundef %21) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc35 for.inc35: ; preds = %for.body31, %if.then %22 = phi i32 [ %19, %for.body31 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = sext i32 %22 to i64 %cmp30.not.not = icmp slt i64 %indvars.iv, %23 br i1 %cmp30.not.not, label %for.body31, label %for.cond38.preheader, !llvm.loop !16 for.body40: ; preds = %for.cond38.preheader, %for.body40 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body40 ], [ 1, %for.cond38.preheader ] %arrayidx42 = getelementptr inbounds [110 x i32], ptr @d, i64 0, i64 %indvars.iv82 %24 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %arrayidx44 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %indvars.iv82 %25 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %26 = trunc i64 %indvars.iv82 to i32 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26, i32 noundef %24, i32 noundef %25) %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %27 = load i32, ptr @n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp39.not.not = icmp slt i64 %indvars.iv82, %28 br i1 %cmp39.not.not, label %for.body40, label %for.end48, !llvm.loop !17 for.end48: ; preds = %for.body40, %for.end10.thread, %for.end10, %for.cond29.preheader, %for.cond38.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 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 = { 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #define N 100 #define DISCOVERY 0 #define FINISHING 1 int n, k, l, t; int A[N][N]; int B[N][2]; int cnt; int searchYet() { int i; for ( i = 0; i < n; i++) { if(B[i][DISCOVERY] == 0) return i; } return -1; } void dfs(int v) { int i, j; B[v][DISCOVERY] = ++cnt; for ( i = 0; i < n; i++) { if (A[v][i] == 1 && B[i][DISCOVERY] == 0) { dfs(i); } } B[v][FINISHING] = ++cnt; return; } int main() { int i, j; int res; for ( i = 0; i < N; i++) { for ( j = 0; j < N; j++) { A[i][j] = 0; } } for ( i = 0; i < N; i++) { for ( j = 0; j < 2; j++) { B[i][j] = 0; } } scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d%d",&l , &k); for ( j = 0; j < k; j++) { scanf("%d", &t); A[l-1][t-1] = 1; } } dfs(0); while(1){ res = searchYet(); if (res == -1) break; dfs(res); } for ( i = 0; i < n; i++) { printf("%d ", i+1); printf("%d %d", B[i][DISCOVERY], B[i][FINISHING]); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195015/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195015/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" @n = dso_local global i32 0, align 4 @B = dso_local local_unnamed_addr global [100 x [2 x i32]] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @A = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @l = dso_local global i32 0, align 4 @k = dso_local global i32 0, align 4 @t = dso_local global i32 0, align 4 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @searchYet() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 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 [100 x [2 x i32]], ptr @B, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 8, !tbaa !5 %cmp2 = icmp eq i32 %1, 0 br i1 %cmp2, label %cleanup.loopexit.split.loop.exit10, 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 %cleanup, label %for.body, !llvm.loop !9 cleanup.loopexit.split.loop.exit10: ; preds = %for.body %2 = trunc i64 %indvars.iv to i32 br label %cleanup cleanup: ; preds = %for.inc, %cleanup.loopexit.split.loop.exit10, %entry %retval.0 = phi i32 [ -1, %entry ], [ %2, %cleanup.loopexit.split.loop.exit10 ], [ -1, %for.inc ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %v) local_unnamed_addr #1 { entry: %0 = load i32, ptr @cnt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %idxprom = sext i32 %v to i64 %arrayidx = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx, align 8, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %1, 0 br i1 %cmp22, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %3, 1 br i1 %cmp6, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx8 = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx8, align 8, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @dfs(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !11 for.end.loopexit: ; preds = %for.inc %.pre25 = load i32, ptr @cnt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre25, %for.end.loopexit ], [ %inc, %entry ] %inc12 = add nsw i32 %8, 1 store i32 %inc12, ptr @cnt, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %idxprom, i64 1 store i32 %inc12, ptr %arrayidx15, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) @A, i8 0, i64 40000, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) @B, i8 0, i64 800, i1 false), !tbaa !5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp2688 = icmp sgt i32 %0, 0 br i1 %cmp2688, label %for.body27, label %while.cond.preheader for.body27: ; preds = %entry, %for.inc41 %i.289 = phi i32 [ %inc42, %for.inc41 ], [ 0, %entry ] %call28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @l, ptr noundef nonnull @k) %1 = load i32, ptr @k, align 4, !tbaa !5 %cmp3086 = icmp sgt i32 %1, 0 br i1 %cmp3086, label %for.body31, label %for.inc41 for.body31: ; preds = %for.body27, %for.body31 %j.287 = phi i32 [ %inc39, %for.body31 ], [ 0, %for.body27 ] %call32 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t) %2 = load i32, ptr @l, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom33 = sext i32 %sub to i64 %3 = load i32, ptr @t, align 4, !tbaa !5 %sub35 = add nsw i32 %3, -1 %idxprom36 = sext i32 %sub35 to i64 %arrayidx37 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom33, i64 %idxprom36 store i32 1, ptr %arrayidx37, align 4, !tbaa !5 %inc39 = add nuw nsw i32 %j.287, 1 %4 = load i32, ptr @k, align 4, !tbaa !5 %cmp30 = icmp slt i32 %inc39, %4 br i1 %cmp30, label %for.body31, label %for.inc41, !llvm.loop !12 for.inc41: ; preds = %for.body31, %for.body27 %inc42 = add nuw nsw i32 %i.289, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp26 = icmp slt i32 %inc42, %5 br i1 %cmp26, label %for.body27, label %while.cond.preheader, !llvm.loop !13 while.cond.preheader: ; preds = %for.inc41, %entry br label %while.cond while.cond: ; preds = %while.cond.preheader, %searchYet.exit %.sink = phi i32 [ %8, %searchYet.exit ], [ 0, %while.cond.preheader ] tail call void @dfs(i32 noundef %.sink) %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp6.i = icmp sgt i32 %6, 0 br i1 %cmp6.i, label %for.body.preheader.i, label %for.end60 for.body.preheader.i: ; preds = %while.cond %wide.trip.count.i = zext i32 %6 to i64 br label %for.body.i for.body.i: ; preds = %for.inc.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %arrayidx.i = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %indvars.iv.i %7 = load i32, ptr %arrayidx.i, align 8, !tbaa !5 %cmp2.i = icmp eq i32 %7, 0 br i1 %cmp2.i, label %searchYet.exit, label %for.inc.i for.inc.i: ; preds = %for.body.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.cond46.preheader, label %for.body.i, !llvm.loop !9 searchYet.exit: ; preds = %for.body.i %8 = trunc i64 %indvars.iv.i to i32 %cmp45 = icmp eq i32 %8, -1 br i1 %cmp45, label %for.cond46.preheader, label %while.cond for.cond46.preheader: ; preds = %searchYet.exit, %for.inc.i br i1 %cmp6.i, label %for.body48, label %for.end60 for.body48: ; preds = %for.cond46.preheader, %for.body48 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body48 ], [ 0, %for.cond46.preheader ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = trunc i64 %indvars.iv.next to i32 %call49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %arrayidx51 = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %indvars.iv %10 = load i32, ptr %arrayidx51, align 8, !tbaa !5 %arrayidx55 = getelementptr inbounds [100 x [2 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 1 %11 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %call56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10, i32 noundef %11) %putchar = tail call i32 @putchar(i32 10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp47 = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp47, label %for.body48, label %for.end60, !llvm.loop !14 for.end60: ; preds = %while.cond, %for.body48, %for.cond46.preheader 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) 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 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 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 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 = { nofree nounwind } attributes #5 = { 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 = 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 N 1000 int t,n,d[N],f[N],M[N][N] = {}; char c[N]; void visit(int); void depth(); int main(){ int a,b,c,i,j; scanf("%d", &n); for (i=1;i<=n;i++) { scanf("%d%d",&a,&b); for (j=1;j<=b;j++) { scanf("%d",&c); M[a][c] = 1; } } depth(); for (i=1;i<=n;i++) { printf("%d %d %d\n",i,d[i],f[i]); } return 0; } void visit(int a){ int i; c[a] = 'G'; d[a] = ++t; for (i=1;i<=n;i++) { if (M[a][i] == 1 && c[i] == 'W') { visit(i); } } c[a] = 'B'; f[a] = ++t; } void depth(){ int i; for (i=1;i<=n;i++) c[i] = 'W'; t = 0; for (i=1;i<=n;i++) if (c[i] == 'W') visit(i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195059/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" @M = dso_local local_unnamed_addr global [1000 x [1000 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @d = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [1000 x i8] zeroinitializer, align 16 @t = dso_local local_unnamed_addr global i32 0, align 4 ; 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 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not31 = icmp slt i32 %0, 1 br i1 %cmp.not31, label %depth.exit.thread, label %for.body for.body: ; preds = %entry, %for.inc8 %i.032 = phi i32 [ %inc9, %for.inc8 ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp3.not29 = icmp slt i32 %1, 1 br i1 %cmp3.not29, label %for.inc8, label %for.body4 for.body4: ; preds = %for.body, %for.body4 %j.030 = phi i32 [ %inc, %for.body4 ], [ 1, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %2 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 %3 = load i32, ptr %c, align 4, !tbaa !5 %idxprom6 = sext i32 %3 to i64 %arrayidx7 = getelementptr inbounds [1000 x [1000 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.030, 1 %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp3.not.not = icmp slt i32 %j.030, %4 br i1 %cmp3.not.not, label %for.body4, label %for.inc8, !llvm.loop !9 for.inc8: ; preds = %for.body4, %for.body %inc9 = add nuw nsw i32 %i.032, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.032, %5 br i1 %cmp.not.not, label %for.body, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.inc8 %cmp.not17.i = icmp slt i32 %5, 1 br i1 %cmp.not17.i, label %depth.exit.thread, label %for.body3.preheader.i depth.exit.thread: ; preds = %for.end10, %entry store i32 0, ptr @t, align 4, !tbaa !5 br label %for.end21 for.body3.preheader.i: ; preds = %for.end10 %6 = zext i32 %5 to i64 call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([1000 x i8], ptr @c, i64 0, i64 1), i8 87, i64 %6, i1 false), !tbaa !12 store i32 0, ptr @t, align 4, !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.inc8.i, %for.body3.preheader.i %7 = phi i32 [ %5, %for.body3.preheader.i ], [ %10, %for.inc8.i ] %indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc8.i ] %arrayidx5.i = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %indvars.iv.i %8 = load i8, ptr %arrayidx5.i, align 1, !tbaa !12 %cmp6.i = icmp eq i8 %8, 87 br i1 %cmp6.i, label %if.then.i, label %for.inc8.i if.then.i: ; preds = %for.body3.i %9 = trunc i64 %indvars.iv.i to i32 call void @visit(i32 noundef %9) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc8.i for.inc8.i: ; preds = %if.then.i, %for.body3.i %10 = phi i32 [ %7, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %11 = sext i32 %10 to i64 %cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %11 br i1 %cmp2.not.not.i, label %for.body3.i, label %depth.exit, !llvm.loop !13 depth.exit: ; preds = %for.inc8.i %12 = icmp slt i32 %10, 1 br i1 %12, label %for.end21, label %for.body13 for.body13: ; preds = %depth.exit, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 1, %depth.exit ] %arrayidx15 = getelementptr inbounds [1000 x i32], ptr @d, i64 0, i64 %indvars.iv %13 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %arrayidx17 = getelementptr inbounds [1000 x i32], ptr @f, i64 0, i64 %indvars.iv %14 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %15 = trunc i64 %indvars.iv to i32 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15, i32 noundef %13, i32 noundef %14) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %16 = load i32, ptr @n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp12.not.not = icmp slt i64 %indvars.iv, %17 br i1 %cmp12.not.not, label %for.body13, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.body13, %depth.exit.thread, %depth.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 4, 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) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %a) local_unnamed_addr #3 { entry: %idxprom = sext i32 %a to i64 %arrayidx = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %idxprom store i8 71, ptr %arrayidx, align 1, !tbaa !12 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [1000 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not26 = icmp slt i32 %1, 1 br i1 %cmp.not26, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [1000 x [1000 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx9 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx9, align 1, !tbaa !12 %cmp10 = icmp eq i8 %4, 87 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.end.loopexit, !llvm.loop !15 for.end.loopexit: ; preds = %for.inc %.pre29 = load i32, ptr @t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre29, %for.end.loopexit ], [ %inc, %entry ] store i8 66, ptr %arrayidx, align 1, !tbaa !12 %inc15 = add nsw i32 %8, 1 store i32 %inc15, ptr @t, align 4, !tbaa !5 %arrayidx17 = getelementptr inbounds [1000 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc15, ptr %arrayidx17, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @depth() local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not17 = icmp slt i32 %0, 1 br i1 %cmp.not17, label %for.end.thread, label %for.body3.preheader for.end.thread: ; preds = %entry store i32 0, ptr @t, align 4, !tbaa !5 br label %for.end10 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 tail call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([1000 x i8], ptr @c, i64 0, i64 1), i8 87, i64 %1, i1 false), !tbaa !12 store i32 0, ptr @t, align 4, !tbaa !5 br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc8 %2 = phi i32 [ %0, %for.body3.preheader ], [ %5, %for.inc8 ] %indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc8 ] %arrayidx5 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %indvars.iv %3 = load i8, ptr %arrayidx5, align 1, !tbaa !12 %cmp6 = icmp eq i8 %3, 87 br i1 %cmp6, label %if.then, label %for.inc8 if.then: ; preds = %for.body3 %4 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %4) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc8 for.inc8: ; preds = %for.body3, %if.then %5 = phi i32 [ %2, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = sext i32 %5 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp2.not.not, label %for.body3, label %for.end10, !llvm.loop !13 for.end10: ; preds = %for.inc8, %for.end.thread ret void } ; 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 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!7, !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 static int n; static int M[N][N]; static int color[N]; static int start[N]; static int end[N]; static int t; static void dfs_visit(int u) { color[u] = GRAY; start[u] = ++t; for (int v = 0; v < n; v++) { if (M[u][v] == 0) continue; if (color[v] == WHITE) dfs_visit(v); } color[u] = BLACK; end[u] = ++t; } static void dfs() { for (int i = 0; i < n; i++) { color[i] = WHITE; } t = 0; for (int i = 0; i < n; i++) { if (color[i] == WHITE) { dfs_visit(i); } } for (int i = 0; i < n; i++) { printf("%d %d %d\n", i + 1, start[i], end[i]); } } int main() { int u, v, k; scanf("%d", &n); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { M[i][j] = 0; } } for (int i = 0; i < n; i++) { scanf("%d %d", &u, &k); for (int j = 0; j < k; j++) { scanf("%d", &v); M[u - 1][v - 1] = 1; } } dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195109/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195109/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 @n = internal global i32 0, align 4 @M = internal unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @color = internal unnamed_addr global [100 x i32] zeroinitializer, align 16 @t = internal unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @start = internal unnamed_addr global [100 x i32] zeroinitializer, align 16 @end = internal unnamed_addr global [100 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.cond1.preheader.us.preheader, label %for.cond13.preheader.thread.i for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond11.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep57 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep57, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep58 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep58, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep59 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep59, i8 0, i64 %2, 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.cond11.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9 for.cond11.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond11.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond11.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond11.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond11.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11 for.cond11.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond11.preheader.unr-lcssa br i1 %cmp43, label %for.body14, label %for.cond13.preheader.thread.i for.cond.cleanup13: ; preds = %for.cond.cleanup19 %cmp33.i = icmp sgt i32 %.pr, 0 br i1 %cmp33.i, label %for.body5.preheader.i, label %for.cond13.preheader.thread.i for.cond13.preheader.thread.i: ; preds = %entry, %for.cond11.preheader, %for.cond.cleanup13 store i32 0, ptr @t, align 4, !tbaa !5 br label %dfs.exit for.body5.preheader.i: ; preds = %for.cond.cleanup13 %13 = zext i32 %.pr to i64 %14 = shl nuw nsw i64 %13, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %14, i1 false), !tbaa !5 store i32 0, ptr @t, align 4, !tbaa !5 br label %for.body5.i for.cond13.preheader.i: ; preds = %for.inc9.i %15 = icmp sgt i32 %19, 0 br i1 %15, label %for.body16.i, label %dfs.exit for.body5.i: ; preds = %for.inc9.i, %for.body5.preheader.i %16 = phi i32 [ %.pr, %for.body5.preheader.i ], [ %19, %for.inc9.i ] %indvars.iv.i = phi i64 [ 0, %for.body5.preheader.i ], [ %indvars.iv.next.i, %for.inc9.i ] %arrayidx7.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %17 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5 %cmp8.i = icmp eq i32 %17, 0 br i1 %cmp8.i, label %if.then.i, label %for.inc9.i if.then.i: ; preds = %for.body5.i %18 = trunc i64 %indvars.iv.i to i32 call fastcc void @dfs_visit(i32 noundef %18) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc9.i for.inc9.i: ; preds = %if.then.i, %for.body5.i %19 = phi i32 [ %16, %for.body5.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %20 = sext i32 %19 to i64 %cmp3.i = icmp slt i64 %indvars.iv.next.i, %20 br i1 %cmp3.i, label %for.body5.i, label %for.cond13.preheader.i, !llvm.loop !13 for.body16.i: ; preds = %for.cond13.preheader.i, %for.body16.i %indvars.iv41.i = phi i64 [ %indvars.iv.next42.i, %for.body16.i ], [ 0, %for.cond13.preheader.i ] %indvars.iv.next42.i = add nuw nsw i64 %indvars.iv41.i, 1 %arrayidx18.i = getelementptr inbounds [100 x i32], ptr @start, i64 0, i64 %indvars.iv41.i %21 = load i32, ptr %arrayidx18.i, align 4, !tbaa !5 %arrayidx20.i = getelementptr inbounds [100 x i32], ptr @end, i64 0, i64 %indvars.iv41.i %22 = load i32, ptr %arrayidx20.i, align 4, !tbaa !5 %23 = trunc i64 %indvars.iv.next42.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23, i32 noundef %21, i32 noundef %22) %24 = load i32, ptr @n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp14.i = icmp slt i64 %indvars.iv.next42.i, %25 br i1 %cmp14.i, label %for.body16.i, label %dfs.exit, !llvm.loop !14 dfs.exit: ; preds = %for.body16.i, %for.cond13.preheader.thread.i, %for.cond13.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 for.body14: ; preds = %for.cond11.preheader, %for.cond.cleanup19 %i10.048 = phi i32 [ %inc31, %for.cond.cleanup19 ], [ 0, %for.cond11.preheader ] %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %26 = load i32, ptr %k, align 4, !tbaa !5 %cmp1845 = icmp sgt i32 %26, 0 br i1 %cmp1845, label %for.body20, label %for.cond.cleanup19 for.cond.cleanup19: ; preds = %for.body20, %for.body14 %inc31 = add nuw nsw i32 %i10.048, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc31, %.pr br i1 %cmp12, label %for.body14, label %for.cond.cleanup13, !llvm.loop !15 for.body20: ; preds = %for.body14, %for.body20 %j16.046 = phi i32 [ %inc28, %for.body20 ], [ 0, %for.body14 ] %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %27 = load i32, ptr %u, align 4, !tbaa !5 %sub = add nsw i32 %27, -1 %idxprom22 = sext i32 %sub to i64 %28 = load i32, ptr %v, align 4, !tbaa !5 %sub24 = add nsw i32 %28, -1 %idxprom25 = sext i32 %sub24 to i64 %arrayidx26 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom22, i64 %idxprom25 store i32 1, ptr %arrayidx26, align 4, !tbaa !5 %inc28 = add nuw nsw i32 %j16.046, 1 %29 = load i32, ptr %k, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc28, %29 br i1 %cmp18, label %for.body20, label %for.cond.cleanup19, !llvm.loop !16 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define internal fastcc void @dfs_visit(i32 noundef %u) unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @start, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.cond.cleanup for.cond.cleanup.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @t, align 4, !tbaa !5 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %2 = phi i32 [ %.pre30, %for.cond.cleanup.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %2, 1 store i32 %inc16, ptr @t, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @end, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void for.body: ; preds = %entry, %for.inc %3 = phi i32 [ %7, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %4, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %5, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %6 = trunc i64 %indvars.iv to i32 tail call fastcc void @dfs_visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %7 = phi i32 [ %3, %if.end ], [ %.pre, %if.then11 ], [ %3, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !17 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 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 #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"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[N][N]; int color[N],d[N],f[N],tt; void dfs_visit(int i) { int j; color[i]=GRAY; d[i]=++tt; for(j=0;j<n;j++) { if(M[i][j]==0)continue; if(color[j]==WHITE) { dfs_visit(j); } } color[i]=BLACK; f[i]=++tt; } void dfs() { int i; for(i=0;i<n;i++) { color[i]=WHITE; } tt=0; for(i=0;i<n;i++) { if(color[i]==WHITE)dfs_visit(i); } for(i=0;i<n;i++) { printf("%d %d %d\n",i+1,d[i],f[i]); } } int main() { int i,j,id,n2,v; scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { M[i][j]=0; } } for(i=0;i<n;i++) { scanf("%d %d",&id,&n2); { id=id-1; for(j=0;j<n2;j++) { scanf("%d",&v); v=v-1; M[id][v]=1; } } } dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195152/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195152/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" @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\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"%d %d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_visit(i32 noundef %i) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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 nounwind uwtable define dso_local void @dfs() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread for.cond10.preheader.thread: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.end19 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader ret void } ; 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 #2 { entry: %id = alloca i32, align 4 %n2 = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13 for.cond9.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %id, ptr noundef nonnull %n2) %13 = load i32, ptr %id, align 4, !tbaa !5 %sub = add nsw i32 %13, -1 store i32 %sub, ptr %id, align 4, !tbaa !5 %14 = load i32, ptr %n2, align 4, !tbaa !5 %cmp1442 = icmp sgt i32 %14, 0 br i1 %cmp1442, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %sub17 = add nsw i32 %15, -1 store i32 %sub17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %id, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %sub17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.143, 1 %17 = load i32, ptr %n2, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17 for.end27: ; preds = %for.inc25 %cmp31.i = icmp sgt i32 %.pr, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27 store i32 0, ptr @tt, align 4, !tbaa !5 br label %dfs.exit for.body3.preheader.i: ; preds = %for.end27 %18 = zext i32 %.pr to i64 %19 = shl nuw nsw i64 %18, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %20 = icmp sgt i32 %24, 0 br i1 %20, label %for.body12.i, label %dfs.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %22, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %23 = trunc i64 %indvars.iv.i to i32 call void @dfs_visit(i32 noundef %23) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %25 = sext i32 %24 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %25 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i %27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %28 = trunc i64 %indvars.iv.next40.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27) %29 = load i32, ptr @n, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30 br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12 dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = { 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #define N 100 void dep(int); int G[N+1][N+1],s[N+1],de[N+1],f[N+1],n,w=1; int main(){ int i, j, u, v; scanf("%d", &n); for(i=1;i<=n;i++){ de[i]=0; f[i] = 0; scanf("%d", &u); scanf("%d", &s[u]); for(j=1;j<=s[u];j++) scanf("%d", &G[u][j]); } for(i=1;i<=n;i++) { if(!de[i]) dep(i); } for(i=1;i<=n;i++) { printf("%d %d %d\n", i, de[i], f[i]); } return 0; } void dep(int p){ int i; de[p] = w++; for(i=1;i<=s[p];i++) { if(!de[G[p][i]]) dep(G[p][i]); } f[p] = w++; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195196/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195196/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" @w = dso_local local_unnamed_addr global i32 1, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @de = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @s = dso_local global [101 x i32] zeroinitializer, align 16 @G = dso_local global [101 x [101 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not58 = icmp slt i32 %0, 1 br i1 %cmp.not58, label %for.end38, label %for.body for.cond20.preheader: ; preds = %for.inc17 %cmp21.not60 = icmp slt i32 %7, 1 br i1 %cmp21.not60, label %for.end38, label %for.body22 for.body: ; preds = %entry, %for.inc17 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.inc17 ], [ 1, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr @de, i64 0, i64 %indvars.iv65 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv65 store i32 0, ptr %arrayidx2, align 4, !tbaa !5 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u) %1 = load i32, ptr %u, align 4, !tbaa !5 %idxprom4 = sext i32 %1 to i64 %arrayidx5 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %idxprom4 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %2 = load i32, ptr %u, align 4, !tbaa !5 %idxprom853 = sext i32 %2 to i64 %arrayidx954 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %idxprom853 %3 = load i32, ptr %arrayidx954, align 4, !tbaa !5 %cmp10.not55 = icmp slt i32 %3, 1 br i1 %cmp10.not55, label %for.inc17, label %for.body11 for.body11: ; preds = %for.body, %for.body11 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body11 ], [ 1, %for.body ] %idxprom857 = phi i64 [ %idxprom8, %for.body11 ], [ %idxprom853, %for.body ] %arrayidx15 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom857, i64 %indvars.iv %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %u, align 4, !tbaa !5 %idxprom8 = sext i32 %4 to i64 %arrayidx9 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %idxprom8 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp10.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp10.not.not, label %for.body11, label %for.inc17, !llvm.loop !9 for.inc17: ; preds = %for.body11, %for.body %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %7 = load i32, ptr @n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp.not.not = icmp slt i64 %indvars.iv65, %8 br i1 %cmp.not.not, label %for.body, label %for.cond20.preheader, !llvm.loop !11 for.cond28.preheader: ; preds = %for.inc25 %9 = icmp slt i32 %13, 1 br i1 %9, label %for.end38, label %for.body30 for.body22: ; preds = %for.cond20.preheader, %for.inc25 %10 = phi i32 [ %13, %for.inc25 ], [ %7, %for.cond20.preheader ] %indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.inc25 ], [ 1, %for.cond20.preheader ] %arrayidx24 = getelementptr inbounds [101 x i32], ptr @de, i64 0, i64 %indvars.iv68 %11 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %tobool.not = icmp eq i32 %11, 0 br i1 %tobool.not, label %if.then, label %for.inc25 if.then: ; preds = %for.body22 %12 = trunc i64 %indvars.iv68 to i32 call void @dep(i32 noundef %12) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body22, %if.then %13 = phi i32 [ %10, %for.body22 ], [ %.pre, %if.then ] %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %14 = sext i32 %13 to i64 %cmp21.not.not = icmp slt i64 %indvars.iv68, %14 br i1 %cmp21.not.not, label %for.body22, label %for.cond28.preheader, !llvm.loop !12 for.body30: ; preds = %for.cond28.preheader, %for.body30 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body30 ], [ 1, %for.cond28.preheader ] %arrayidx32 = getelementptr inbounds [101 x i32], ptr @de, i64 0, i64 %indvars.iv71 %15 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %arrayidx34 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv71 %16 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv71 to i32 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17, i32 noundef %15, i32 noundef %16) %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp29.not.not = icmp slt i64 %indvars.iv71, %19 br i1 %cmp29.not.not, label %for.body30, label %for.end38, !llvm.loop !13 for.end38: ; preds = %for.body30, %entry, %for.cond20.preheader, %for.cond28.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dep(i32 noundef %p) local_unnamed_addr #3 { entry: %0 = load i32, ptr @w, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @w, align 4, !tbaa !5 %idxprom = sext i32 %p to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @de, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %1, 1 br i1 %cmp.not24, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %5, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %3 to i64 %arrayidx8 = getelementptr inbounds [101 x i32], ptr @de, i64 0, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %if.then, label %for.inc if.then: ; preds = %for.body tail call void @dep(i32 noundef %3) %.pre = load i32, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %5 = phi i32 [ %2, %for.body ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !14 for.end.loopexit: ; preds = %for.inc %.pre27 = load i32, ptr @w, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %7 = phi i32 [ %.pre27, %for.end.loopexit ], [ %inc, %entry ] %inc14 = add nsw i32 %7, 1 store i32 %inc14, ptr @w, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom store i32 %7, ptr %arrayidx16, align 4, !tbaa !5 ret void } ; 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 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 #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 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #define N 100 int a[N+1][N+1], b[N+1], c[N+1], d[N+1], n, t; void kansu(int x){ int i; c[x] = t++; for(i=1;i<=b[x];i++) if(!c[a[x][i]]) kansu(a[x][i]); d[x] = t++; } int main(){ int i, j, r, v; scanf("%d", &n); t=1; for(i=1;i<=n;i++){ c[i] = d[i] = 0; scanf("%d", &r); scanf("%d", &b[r]); for(j=1;j<=b[r];j++) scanf("%d", &a[r][j]); } for(i=1;i<=n;i++) if(!c[i]) kansu(i); for(i=1;i<=n;i++) printf("%d %d %d\n", i, c[i], d[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195239/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195239/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" @t = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @b = dso_local global [101 x i32] zeroinitializer, align 16 @a = dso_local global [101 x [101 x i32]] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @kansu(i32 noundef %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %1, 1 br i1 %cmp.not24, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %5, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %3 to i64 %arrayidx8 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %if.then, label %for.inc if.then: ; preds = %for.body tail call void @kansu(i32 noundef %3) %.pre = load i32, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %5 = phi i32 [ %2, %for.body ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre27 = load i32, ptr @t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %7 = phi i32 [ %.pre27, %for.end.loopexit ], [ %inc, %entry ] %inc14 = add nsw i32 %7, 1 store i32 %inc14, ptr @t, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom store i32 %7, ptr %arrayidx16, 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) store i32 1, ptr @t, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not58 = icmp slt i32 %0, 1 br i1 %cmp.not58, label %for.end38, label %for.body for.cond20.preheader: ; preds = %for.inc17 %cmp21.not60 = icmp slt i32 %7, 1 br i1 %cmp21.not60, label %for.end38, label %for.body22 for.body: ; preds = %entry, %for.inc17 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.inc17 ], [ 1, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv65 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv65 store i32 0, ptr %arrayidx2, align 4, !tbaa !5 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %1 = load i32, ptr %r, align 4, !tbaa !5 %idxprom4 = sext i32 %1 to i64 %arrayidx5 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom4 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %2 = load i32, ptr %r, align 4, !tbaa !5 %idxprom853 = sext i32 %2 to i64 %arrayidx954 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom853 %3 = load i32, ptr %arrayidx954, align 4, !tbaa !5 %cmp10.not55 = icmp slt i32 %3, 1 br i1 %cmp10.not55, label %for.inc17, label %for.body11 for.body11: ; preds = %for.body, %for.body11 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body11 ], [ 1, %for.body ] %idxprom857 = phi i64 [ %idxprom8, %for.body11 ], [ %idxprom853, %for.body ] %arrayidx15 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom857, i64 %indvars.iv %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %r, align 4, !tbaa !5 %idxprom8 = sext i32 %4 to i64 %arrayidx9 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom8 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp10.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp10.not.not, label %for.body11, label %for.inc17, !llvm.loop !11 for.inc17: ; preds = %for.body11, %for.body %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %7 = load i32, ptr @n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp.not.not = icmp slt i64 %indvars.iv65, %8 br i1 %cmp.not.not, label %for.body, label %for.cond20.preheader, !llvm.loop !12 for.cond28.preheader: ; preds = %for.inc25 %9 = icmp slt i32 %13, 1 br i1 %9, label %for.end38, label %for.body30 for.body22: ; preds = %for.cond20.preheader, %for.inc25 %10 = phi i32 [ %13, %for.inc25 ], [ %7, %for.cond20.preheader ] %indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.inc25 ], [ 1, %for.cond20.preheader ] %arrayidx24 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv68 %11 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %tobool.not = icmp eq i32 %11, 0 br i1 %tobool.not, label %if.then, label %for.inc25 if.then: ; preds = %for.body22 %12 = trunc i64 %indvars.iv68 to i32 call void @kansu(i32 noundef %12) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body22, %if.then %13 = phi i32 [ %10, %for.body22 ], [ %.pre, %if.then ] %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %14 = sext i32 %13 to i64 %cmp21.not.not = icmp slt i64 %indvars.iv68, %14 br i1 %cmp21.not.not, label %for.body22, label %for.cond28.preheader, !llvm.loop !13 for.body30: ; preds = %for.cond28.preheader, %for.body30 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body30 ], [ 1, %for.cond28.preheader ] %arrayidx32 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv71 %15 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %arrayidx34 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv71 %16 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv71 to i32 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17, i32 noundef %15, i32 noundef %16) %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp29.not.not = icmp slt i64 %indvars.iv71, %19 br i1 %cmp29.not.not, label %for.body30, label %for.end38, !llvm.loop !14 for.end38: ; preds = %for.body30, %entry, %for.cond20.preheader, %for.cond28.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 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 = { 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 = !{!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> int n,A[100][100],cnt[100],d[100],f[100],t=0; void dfs(int); int main(){ int u,v,k,i,j; scanf("%d",&n); for(i=0;i<n;i++){ cnt[i]=0; for(j=0;j<n;j++){ A[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; A[u][v]=1; } } for(i=0;i<n;i++){ if(cnt[i]==0){ dfs(i); } } for(i=0;i<n;i++){ printf("%d %d %d\n",i+1,d[i],f[i]); } return 0; } void dfs(int u){ int v; cnt[u]=1; d[u]=++t; for(v=0;v<n;v++){ if(A[u][v]==0){ continue; } if(cnt[v]==0){ dfs(v); } } cnt[u]=2; f[u]=++t; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195282/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195282/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" @t = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @cnt = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @A = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp70 = icmp sgt i32 %0, 0 br i1 %cmp70, label %for.body.us.preheader, label %for.end49 for.body.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @cnt, i8 0, i64 %2, i1 false), !tbaa !5 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond11.preheader.unr-lcssa, label %for.body.us.preheader.new for.body.us.preheader.new: ; preds = %for.body.us.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.body.us for.body.us: ; preds = %for.body.us, %for.body.us.preheader.new %indvar = phi i64 [ 0, %for.body.us.preheader.new ], [ %indvar.next.7, %for.body.us ] %niter = phi i64 [ 0, %for.body.us.preheader.new ], [ %niter.next.7, %for.body.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @A, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep92 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep93 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep94 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep95 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep95, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep96 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep96, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep97 = getelementptr i8, ptr getelementptr (i8, ptr @A, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep97, i8 0, i64 %2, 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.cond11.preheader.unr-lcssa, label %for.body.us, !llvm.loop !9 for.cond11.preheader.unr-lcssa: ; preds = %for.body.us, %for.body.us.preheader %indvar.unr = phi i64 [ 0, %for.body.us.preheader ], [ %indvar.next.7, %for.body.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.body.us.epil for.body.us.epil: ; preds = %for.cond11.preheader.unr-lcssa, %for.body.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.body.us.epil ], [ %indvar.unr, %for.cond11.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.us.epil ], [ 0, %for.cond11.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @A, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond11.preheader, label %for.body.us.epil, !llvm.loop !11 for.cond11.preheader: ; preds = %for.body.us.epil, %for.cond11.preheader.unr-lcssa br i1 %cmp70, label %for.body13, label %for.end49 for.cond30.preheader: ; preds = %for.inc27 %cmp3176 = icmp sgt i32 %18, 0 br i1 %cmp3176, label %for.body32, label %for.end49 for.body13: ; preds = %for.cond11.preheader, %for.inc27 %i.175 = phi i32 [ %inc28, %for.inc27 ], [ 0, %for.cond11.preheader ] %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1672 = icmp sgt i32 %14, 0 br i1 %cmp1672, label %for.body17, label %for.inc27 for.body17: ; preds = %for.body13, %for.body17 %j.173 = phi i32 [ %inc25, %for.body17 ], [ 0, %for.body13 ] %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec19 = add nsw i32 %15, -1 store i32 %dec19, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom20 = sext i32 %16 to i64 %idxprom22 = sext i32 %dec19 to i64 %arrayidx23 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom20, i64 %idxprom22 store i32 1, ptr %arrayidx23, align 4, !tbaa !5 %inc25 = add nuw nsw i32 %j.173, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp16 = icmp slt i32 %inc25, %17 br i1 %cmp16, label %for.body17, label %for.inc27, !llvm.loop !13 for.inc27: ; preds = %for.body17, %for.body13 %inc28 = add nuw nsw i32 %i.175, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc28, %18 br i1 %cmp12, label %for.body13, label %for.cond30.preheader, !llvm.loop !14 for.cond39.preheader: ; preds = %for.inc36 %19 = icmp sgt i32 %23, 0 br i1 %19, label %for.body41, label %for.end49 for.body32: ; preds = %for.cond30.preheader, %for.inc36 %20 = phi i32 [ %23, %for.inc36 ], [ %18, %for.cond30.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc36 ], [ 0, %for.cond30.preheader ] %arrayidx34 = getelementptr inbounds [100 x i32], ptr @cnt, i64 0, i64 %indvars.iv %21 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %cmp35 = icmp eq i32 %21, 0 br i1 %cmp35, label %if.then, label %for.inc36 if.then: ; preds = %for.body32 %22 = trunc i64 %indvars.iv to i32 call void @dfs(i32 noundef %22) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc36 for.inc36: ; preds = %for.body32, %if.then %23 = phi i32 [ %20, %for.body32 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %24 = sext i32 %23 to i64 %cmp31 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp31, label %for.body32, label %for.cond39.preheader, !llvm.loop !15 for.body41: ; preds = %for.cond39.preheader, %for.body41 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body41 ], [ 0, %for.cond39.preheader ] %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %arrayidx43 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv83 %25 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %arrayidx45 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv83 %26 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %27 = trunc i64 %indvars.iv.next84 to i32 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27, i32 noundef %25, i32 noundef %26) %28 = load i32, ptr @n, align 4, !tbaa !5 %29 = sext i32 %28 to i64 %cmp40 = icmp slt i64 %indvars.iv.next84, %29 br i1 %cmp40, label %for.body41, label %for.end49, !llvm.loop !16 for.end49: ; preds = %for.body41, %entry, %for.cond11.preheader, %for.cond30.preheader, %for.cond39.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @cnt, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @cnt, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @dfs(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !17 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @t, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; 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 = { 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 #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"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int graph[101][101], d[101], f[101], n, color[101], timee; void visit(int u) { int i; color[u] = 0; d[u] = ++timee; for (i = 1; i <= n; i++) { if (graph[u][i] == 1) { if (color[i] == 1) visit(i); } } color[u] = -1; f[u] = ++timee; } void dfs() { int i; for (i = 1; i <= n; i++) color[i] = 1; timee = 0; for (i = 1; i <= n; i++) { if (color[i] == 1) visit(i); } } int main(void){ int dd, i, a, j, n2; scanf("%d", &n); for (i = 1; i <= 100; i++) { for (j = 1; j <= 100; j++) { graph[i][j] = 0; } } for (i = 0; i < n; i++) { scanf("%d %d", &dd, &n2); for (j = 0; j < n2; j++) { scanf("%d", &a); graph[dd][a] = 1; } } dfs(); for (i = 1; i <= n; i++) { printf("%d %d %d\n", i, d[i], f[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195325/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195325/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" @color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @timee = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @graph = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom store i32 0, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @timee, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @timee, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not27 = icmp slt i32 %1, 1 br i1 %cmp.not27, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @graph, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 1 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.then %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then11, %if.then %6 = phi i32 [ %2, %for.body ], [ %.pre, %if.then11 ], [ %2, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @timee, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 -1, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @timee, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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(readwrite, inaccessiblemem: none) uwtable define dso_local void @dfs() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not16 = icmp slt i32 %0, 1 br i1 %cmp.not16, label %for.end.thread, label %for.body.preheader for.end.thread: ; preds = %entry store i32 0, ptr @timee, align 4, !tbaa !5 br label %for.end9 for.body.preheader: ; preds = %entry %1 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader24, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %2, -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 ] %offset.idx = or i64 %index, 1 %3 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %offset.idx store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 4, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %2, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader24 for.body.preheader24: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader24, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader24 ] %arrayidx = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx, align 4, !tbaa !5 %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.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block store i32 0, ptr @timee, align 4, !tbaa !5 br i1 %cmp.not16, label %for.end9, label %for.body3 for.body3: ; preds = %for.end, %for.inc7 %6 = phi i32 [ %9, %for.inc7 ], [ %0, %for.end ] %indvars.iv21 = phi i64 [ %indvars.iv.next22, %for.inc7 ], [ 1, %for.end ] %arrayidx5 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv21 %7 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %7, 1 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %8 = trunc i64 %indvars.iv21 to i32 tail call void @visit(i32 noundef %8) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %9 = phi i32 [ %6, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1 %10 = sext i32 %9 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv21, %10 br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !15 for.end9: ; preds = %for.inc7, %for.end.thread, %for.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %dd = alloca i32, align 4 %a = alloca i32, align 4 %n2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dd) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader, %entry %indvar = phi i64 [ 0, %entry ], [ %indvar.next.4, %for.cond1.preheader ] %0 = mul nuw nsw i64 %indvar, 404 %gep = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @graph, i64 0, i64 1, i64 1), i64 %0 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep, i8 0, i64 400, i1 false), !tbaa !5 %1 = mul nuw i64 %indvar, 404 %gep69 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @graph, i64 0, i64 1, i64 1), i64 404), i64 %1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep69, i8 0, i64 400, i1 false), !tbaa !5 %2 = mul nuw i64 %indvar, 404 %gep70 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @graph, i64 0, i64 1, i64 1), i64 808), i64 %2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep70, i8 0, i64 400, i1 false), !tbaa !5 %3 = mul nuw i64 %indvar, 404 %gep71 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @graph, i64 0, i64 1, i64 1), i64 1212), i64 %3 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep71, i8 0, i64 400, i1 false), !tbaa !5 %4 = mul nuw i64 %indvar, 404 %gep72 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @graph, i64 0, i64 1, i64 1), i64 1616), i64 %4 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep72, i8 0, i64 400, i1 false), !tbaa !5 %indvar.next.4 = add nuw nsw i64 %indvar, 5 %exitcond.not.4 = icmp eq i64 %indvar.next.4, 100 br i1 %exitcond.not.4, label %for.cond9.preheader, label %for.cond1.preheader, !llvm.loop !16 for.cond9.preheader: ; preds = %for.cond1.preheader %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp1055 = icmp sgt i32 %5, 0 br i1 %cmp1055, label %for.body11, label %dfs.exit.thread for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.156 = phi i32 [ %inc25, %for.inc24 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %dd, ptr noundef nonnull %n2) %6 = load i32, ptr %n2, align 4, !tbaa !5 %cmp1453 = icmp sgt i32 %6, 0 br i1 %cmp1453, label %for.body15, label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %j.154 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %7 = load i32, ptr %dd, align 4, !tbaa !5 %idxprom17 = sext i32 %7 to i64 %8 = load i32, ptr %a, align 4, !tbaa !5 %idxprom19 = sext i32 %8 to i64 %arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr @graph, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.154, 1 %9 = load i32, ptr %n2, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %9 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !17 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.156, 1 %10 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc25, %10 br i1 %cmp10, label %for.body11, label %for.end26, !llvm.loop !18 for.end26: ; preds = %for.inc24 %cmp.not16.i = icmp slt i32 %10, 1 br i1 %cmp.not16.i, label %dfs.exit.thread, label %for.body.preheader.i dfs.exit.thread: ; preds = %for.end26, %for.cond9.preheader store i32 0, ptr @timee, align 4, !tbaa !5 br label %for.end37 for.body.preheader.i: ; preds = %for.end26 %11 = add nuw i32 %10, 1 %wide.trip.count.i = zext i32 %11 to i64 %12 = add nsw i64 %wide.trip.count.i, -1 %min.iters.check = icmp ult i32 %10, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %12, -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 ] %offset.idx = or i64 %index, 1 %13 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %offset.idx store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %13, align 4, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %14, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %for.end.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 1, %for.body.preheader.i ], [ %ind.end, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv.i store i32 1, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.end.i, label %for.body.i, !llvm.loop !20 for.end.i: ; preds = %for.body.i, %middle.block store i32 0, ptr @timee, align 4, !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.end.i, %for.inc7.i %16 = phi i32 [ %19, %for.inc7.i ], [ %10, %for.end.i ] %indvars.iv21.i = phi i64 [ %indvars.iv.next22.i, %for.inc7.i ], [ 1, %for.end.i ] %arrayidx5.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv21.i %17 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %17, 1 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %18 = trunc i64 %indvars.iv21.i to i32 call void @visit(i32 noundef %18) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %19 = phi i32 [ %16, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next22.i = add nuw nsw i64 %indvars.iv21.i, 1 %20 = sext i32 %19 to i64 %cmp2.not.not.i = icmp slt i64 %indvars.iv21.i, %20 br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs.exit, !llvm.loop !15 dfs.exit: ; preds = %for.inc7.i %21 = icmp slt i32 %19, 1 br i1 %21, label %for.end37, label %for.body29 for.body29: ; preds = %dfs.exit, %for.body29 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body29 ], [ 1, %dfs.exit ] %arrayidx31 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv %22 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %arrayidx33 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv %23 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %24 = trunc i64 %indvars.iv to i32 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24, i32 noundef %22, i32 noundef %23) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %25 = load i32, ptr @n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp28.not.not = icmp slt i64 %indvars.iv, %26 br i1 %cmp28.not.not, label %for.body29, label %for.end37, !llvm.loop !21 for.end37: ; preds = %for.body29, %dfs.exit.thread, %dfs.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dd) #6 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 ; 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !12, !13} !20 = distinct !{!20, !10, !13, !12} !21 = distinct !{!21, !10}
#include<stdio.h> #define N 100 int n,a[N][N]; int x=0,y=1,z=2; int b[N],c[N],d[N],time; void visit(int u){ int v; b[u]=y; time++; c[u]=time; for(v=0;v<n;v++){ if(a[u][v]==0) continue; if(b[v]==x){ visit(v); } } b[u]=z; d[u]=++time; } void dfs(){ int i,u; for(i=0;i<n;i++){ b[i]=x; } time=0; for(u=0;u<n;u++){ if(b[u]==x){ visit(u); } } for(i=0;i<n;i++){ printf("%d %d %d\n",i+1,c[i],d[i]); } } int main(){ int i,j,u,k,v; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ a[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; a[u][v]=1; } } dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195369/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195369/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" @x = dso_local local_unnamed_addr global i32 0, align 4 @y = dso_local local_unnamed_addr global i32 1, align 4 @z = dso_local local_unnamed_addr global i32 2, align 4 @b = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @time = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @a = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 { entry: %0 = load i32, ptr @y, align 4, !tbaa !5 %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @time, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %2 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %2, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %3 = phi i32 [ %8, %for.inc ], [ %2, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %4, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %6 = load i32, ptr @x, align 4, !tbaa !5 %cmp10 = icmp eq i32 %5, %6 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %7 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %7) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %8 = phi i32 [ %3, %if.end ], [ %.pre, %if.then11 ], [ %3, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @time, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %10 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] %11 = load i32, ptr @z, align 4, !tbaa !5 store i32 %11, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %10, 1 store i32 %inc16, ptr @time, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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 nounwind uwtable define dso_local void @dfs() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %0, 0 br i1 %cmp30, label %for.body.lr.ph, label %for.end.thread for.end.thread: ; preds = %entry store i32 0, ptr @time, align 4, !tbaa !5 br label %for.end19 for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @x, align 4, !tbaa !5 %wide.trip.count = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, 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 ] %2 = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %index store <4 x i32> %broadcast.splat, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> %broadcast.splat, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %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 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %indvars.iv store i32 %1, ptr %arrayidx, align 4, !tbaa !5 %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.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block store i32 0, ptr @time, align 4, !tbaa !5 br i1 %cmp30, label %for.body3.preheader, label %for.end19 for.body3.preheader: ; preds = %for.end %.pre43 = load i32, ptr @x, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %5 = icmp sgt i32 %10, 0 br i1 %5, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %6 = phi i32 [ %0, %for.body3.preheader ], [ %10, %for.inc7 ] %7 = phi i32 [ %.pre43, %for.body3.preheader ], [ %11, %for.inc7 ] %indvars.iv37 = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next38, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %indvars.iv37 %8 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %8, %7 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %9 = trunc i64 %indvars.iv37 to i32 tail call void @visit(i32 noundef %9) %.pre = load i32, ptr @x, align 4, !tbaa !5 %.pre44 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %10 = phi i32 [ %6, %for.body3 ], [ %.pre44, %if.then ] %11 = phi i32 [ %7, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1 %12 = sext i32 %10 to i64 %cmp2 = icmp slt i64 %indvars.iv.next38, %12 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !15 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv40 %13 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv40 %14 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %15 = trunc i64 %indvars.iv.next41 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15, i32 noundef %13, i32 noundef %14) %16 = load i32, ptr @n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp11 = icmp slt i64 %indvars.iv.next41, %17 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !16 for.end19: ; preds = %for.body12, %for.end.thread, %for.end, %for.cond10.preheader ret void } ; 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 #2 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.end.thread.i for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @a, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !17 for.cond9.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @a, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !18 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp40, label %for.body11, label %for.end.thread.i for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1442 = icmp sgt i32 %14, 0 br i1 %cmp1442, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @a, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.143, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !20 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !21 for.end27: ; preds = %for.inc25 %cmp30.i = icmp sgt i32 %.pr, 0 br i1 %cmp30.i, label %for.body.lr.ph.i, label %for.end.thread.i for.end.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27 store i32 0, ptr @time, align 4, !tbaa !5 br label %dfs.exit for.body.lr.ph.i: ; preds = %for.end27 %18 = load i32, ptr @x, align 4, !tbaa !5 %wide.trip.count.i = zext i32 %.pr to i64 %min.iters.check = icmp ult i32 %.pr, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph.i %n.vec = and i64 %wide.trip.count.i, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %18, 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 ] %19 = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %index store <4 x i32> %broadcast.splat, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 store <4 x i32> %broadcast.splat, ptr %20, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.body3.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.lr.ph.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.lr.ph.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %indvars.iv.i store i32 %18, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.body3.preheader.i, label %for.body.i, !llvm.loop !23 for.body3.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr @time, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %22 = icmp sgt i32 %27, 0 br i1 %22, label %for.body12.i, label %dfs.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %23 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %27, %for.inc7.i ] %24 = phi i32 [ %18, %for.body3.preheader.i ], [ %28, %for.inc7.i ] %indvars.iv37.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next38.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @b, i64 0, i64 %indvars.iv37.i %25 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %25, %24 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %26 = trunc i64 %indvars.iv37.i to i32 call void @visit(i32 noundef %26) %.pre.i = load i32, ptr @x, align 4, !tbaa !5 %.pre44.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %27 = phi i32 [ %23, %for.body3.i ], [ %.pre44.i, %if.then.i ] %28 = phi i32 [ %24, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next38.i = add nuw nsw i64 %indvars.iv37.i, 1 %29 = sext i32 %27 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next38.i, %29 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !15 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv40.i = phi i64 [ %indvars.iv.next41.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next41.i = add nuw nsw i64 %indvars.iv40.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv40.i %30 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv40.i %31 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %32 = trunc i64 %indvars.iv.next41.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %32, i32 noundef %30, i32 noundef %31) %33 = load i32, ptr @n, align 4, !tbaa !5 %34 = sext i32 %33 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next41.i, %34 br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !16 dfs.exit: ; preds = %for.body12.i, %for.end.thread.i, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = { 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 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"} !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} !17 = distinct !{!17, !10} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.unroll.disable"} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12, !13} !23 = distinct !{!23, !10, !13, !12}
#include<stdio.h> #include<stdlib.h> void visit(int**,int*,int*,int*,int,int); int t = 0; int main(){ int i,j,n,u,k,v,*d,*f,*color,**G; scanf("%d",&n); G = malloc((n+1) * sizeof(int *)); d = malloc((n+1) * sizeof(int)); f = malloc((n+1) * sizeof(int)); color = malloc((n+1) * sizeof(int)); for(i=1;i<=n;i++){ G[i] = malloc((n+1) * sizeof(int)); } for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ G[i][j] = 0; } } for(i=0;i<n;i++){ scanf("%d %d",&u,&k); for(j=0;j<k;j++){ scanf("%d",&v); G[u][v] = 1; } } for(i=1;i<=n;i++){ color[i]=1; } for(i=1;i<=n;i++){ if(color[i]==1){ visit(G,d,f,color,n,i); } } for(i=1;i<=n;i++){ printf("%d %d %d\n",i,d[i],f[i]); } return 0; } void visit(int **G,int *d,int *f,int *color,int n,int u){ int i; color[u] = 0; d[u] = ++t; for(i=1;i<=n;i++){ if(G[u][i]==1){ if(color[i] == 1){ visit(G,d,f,color,n,i); } } } color[u] = -1; f[u] = ++t; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195411/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195411/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" @t = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%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 [10 x i8] c"%d %d %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 %u = alloca i32, align 4 %k = alloca i32, align 4 %v = 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 %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #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 i32 %0, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 3 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 %mul4 = shl nsw i64 %conv, 2 %call5 = call noalias ptr @malloc(i64 noundef %mul4) #6 %call9 = call noalias ptr @malloc(i64 noundef %mul4) #6 %call13 = call noalias ptr @malloc(i64 noundef %mul4) #6 %cmp.not120 = icmp slt i32 %0, 1 br i1 %cmp.not120, label %for.end88, label %for.body.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %add to i64 br label %for.body for.cond19.preheader: ; preds = %for.body br i1 %cmp.not120, label %for.end88, label %for.cond23.preheader for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %call18 = call noalias ptr @malloc(i64 noundef %mul4) #6 %arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv store ptr %call18, ptr %arrayidx, align 8, !tbaa !9 %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.cond19.preheader, label %for.body, !llvm.loop !11 for.cond23.preheader: ; preds = %for.cond19.preheader, %for.inc34 %1 = phi i32 [ %5, %for.inc34 ], [ %0, %for.cond19.preheader ] %indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.inc34 ], [ 1, %for.cond19.preheader ] %cmp24.not122 = icmp slt i32 %1, 1 br i1 %cmp24.not122, label %for.cond23.preheader.for.inc34_crit_edge, label %for.body26.lr.ph for.cond23.preheader.for.inc34_crit_edge: ; preds = %for.cond23.preheader %.pre156 = sext i32 %1 to i64 br label %for.inc34 for.body26.lr.ph: ; preds = %for.cond23.preheader %arrayidx28 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv142 %2 = load ptr, ptr %arrayidx28, align 8, !tbaa !9 br label %for.body26 for.cond37.preheader: ; preds = %for.inc34 %cmp38128 = icmp sgt i32 %5, 0 br i1 %cmp38128, label %for.body40, label %for.end88 for.body26: ; preds = %for.body26.lr.ph, %for.body26 %indvars.iv139 = phi i64 [ 1, %for.body26.lr.ph ], [ %indvars.iv.next140, %for.body26 ] %arrayidx30 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv139 store i32 0, ptr %arrayidx30, align 4, !tbaa !5 %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp24.not.not = icmp slt i64 %indvars.iv139, %4 br i1 %cmp24.not.not, label %for.body26, label %for.inc34, !llvm.loop !13 for.inc34: ; preds = %for.body26, %for.cond23.preheader.for.inc34_crit_edge %.pre-phi = phi i64 [ %.pre156, %for.cond23.preheader.for.inc34_crit_edge ], [ %4, %for.body26 ] %5 = phi i32 [ %1, %for.cond23.preheader.for.inc34_crit_edge ], [ %3, %for.body26 ] %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %cmp20.not.not = icmp slt i64 %indvars.iv142, %.pre-phi br i1 %cmp20.not.not, label %for.cond23.preheader, label %for.cond37.preheader, !llvm.loop !14 for.cond57.preheader: ; preds = %for.inc54 %cmp58.not130 = icmp slt i32 %16, 1 br i1 %cmp58.not130, label %for.end88, label %for.body60.preheader for.body60.preheader: ; preds = %for.cond57.preheader %6 = add nuw i32 %16, 1 %wide.trip.count148 = zext i32 %6 to i64 %7 = add nsw i64 %wide.trip.count148, -1 %min.iters.check = icmp ult i32 %16, 8 br i1 %min.iters.check, label %for.body60.preheader170, label %vector.ph vector.ph: ; preds = %for.body60.preheader %n.vec = and i64 %7, -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 ] %offset.idx = or i64 %index, 1 %8 = getelementptr inbounds i32, ptr %call13, i64 %offset.idx store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 4, !tbaa !5 %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 !16 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %for.cond66.preheader, label %for.body60.preheader170 for.body60.preheader170: ; preds = %for.body60.preheader, %middle.block %indvars.iv145.ph = phi i64 [ 1, %for.body60.preheader ], [ %ind.end, %middle.block ] br label %for.body60 for.body40: ; preds = %for.cond37.preheader, %for.inc54 %i.2129 = phi i32 [ %inc55, %for.inc54 ], [ 0, %for.cond37.preheader ] %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %11 = load i32, ptr %k, align 4, !tbaa !5 %cmp43126 = icmp sgt i32 %11, 0 br i1 %cmp43126, label %for.body45, label %for.inc54 for.body45: ; preds = %for.body40, %for.body45 %j.1127 = phi i32 [ %inc52, %for.body45 ], [ 0, %for.body40 ] %call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %12 = load i32, ptr %u, align 4, !tbaa !5 %idxprom47 = sext i32 %12 to i64 %arrayidx48 = getelementptr inbounds ptr, ptr %call1, i64 %idxprom47 %13 = load ptr, ptr %arrayidx48, align 8, !tbaa !9 %14 = load i32, ptr %v, align 4, !tbaa !5 %idxprom49 = sext i32 %14 to i64 %arrayidx50 = getelementptr inbounds i32, ptr %13, i64 %idxprom49 store i32 1, ptr %arrayidx50, align 4, !tbaa !5 %inc52 = add nuw nsw i32 %j.1127, 1 %15 = load i32, ptr %k, align 4, !tbaa !5 %cmp43 = icmp slt i32 %inc52, %15 br i1 %cmp43, label %for.body45, label %for.inc54, !llvm.loop !19 for.inc54: ; preds = %for.body45, %for.body40 %inc55 = add nuw nsw i32 %i.2129, 1 %16 = load i32, ptr %n, align 4, !tbaa !5 %cmp38 = icmp slt i32 %inc55, %16 br i1 %cmp38, label %for.body40, label %for.cond57.preheader, !llvm.loop !20 for.cond66.preheader: ; preds = %for.body60, %middle.block br i1 %cmp58.not130, label %for.end88, label %for.body69 for.body60: ; preds = %for.body60.preheader170, %for.body60 %indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.body60 ], [ %indvars.iv145.ph, %for.body60.preheader170 ] %arrayidx62 = getelementptr inbounds i32, ptr %call13, i64 %indvars.iv145 store i32 1, ptr %arrayidx62, align 4, !tbaa !5 %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148 br i1 %exitcond149.not, label %for.cond66.preheader, label %for.body60, !llvm.loop !21 for.cond77.preheader: ; preds = %for.inc74 %17 = icmp slt i32 %21, 1 br i1 %17, label %for.end88, label %for.body80 for.body69: ; preds = %for.cond66.preheader, %for.inc74 %18 = phi i32 [ %21, %for.inc74 ], [ %16, %for.cond66.preheader ] %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc74 ], [ 1, %for.cond66.preheader ] %arrayidx71 = getelementptr inbounds i32, ptr %call13, i64 %indvars.iv150 %19 = load i32, ptr %arrayidx71, align 4, !tbaa !5 %cmp72 = icmp eq i32 %19, 1 br i1 %cmp72, label %if.then, label %for.inc74 if.then: ; preds = %for.body69 %20 = trunc i64 %indvars.iv150 to i32 call void @visit(ptr noundef %call1, ptr noundef %call5, ptr noundef %call9, ptr noundef nonnull %call13, i32 noundef %18, i32 noundef %20) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc74 for.inc74: ; preds = %for.body69, %if.then %21 = phi i32 [ %18, %for.body69 ], [ %.pre, %if.then ] %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %22 = sext i32 %21 to i64 %cmp67.not.not = icmp slt i64 %indvars.iv150, %22 br i1 %cmp67.not.not, label %for.body69, label %for.cond77.preheader, !llvm.loop !22 for.body80: ; preds = %for.cond77.preheader, %for.body80 %indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.body80 ], [ 1, %for.cond77.preheader ] %arrayidx82 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv153 %23 = load i32, ptr %arrayidx82, align 4, !tbaa !5 %arrayidx84 = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv153 %24 = load i32, ptr %arrayidx84, align 4, !tbaa !5 %25 = trunc i64 %indvars.iv153 to i32 %call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25, i32 noundef %23, i32 noundef %24) %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %26 = load i32, ptr %n, align 4, !tbaa !5 %27 = sext i32 %26 to i64 %cmp78.not.not = icmp slt i64 %indvars.iv153, %27 br i1 %cmp78.not.not, label %for.body80, label %for.end88, !llvm.loop !23 for.end88: ; preds = %for.body80, %for.cond57.preheader, %entry, %for.cond19.preheader, %for.cond37.preheader, %for.cond66.preheader, %for.cond77.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @visit(ptr nocapture noundef readonly %G, ptr nocapture noundef writeonly %d, ptr nocapture noundef writeonly %f, ptr nocapture noundef %color, i32 noundef %n, i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds i32, ptr %color, i64 %idxprom store i32 0, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %d, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not34 = icmp slt i32 %n, 1 br i1 %cmp.not34, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %arrayidx4 = getelementptr inbounds ptr, ptr %G, i64 %idxprom %1 = add nuw i32 %n, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %2 = load ptr, ptr %arrayidx4, align 8, !tbaa !9 %arrayidx6 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx9 = getelementptr inbounds i32, ptr %color, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 1 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.then %5 = trunc i64 %indvars.iv to i32 tail call void @visit(ptr noundef nonnull %G, ptr noundef %d, ptr noundef %f, ptr noundef nonnull %color, i32 noundef %n, i32 noundef %5) br label %for.inc for.inc: ; preds = %for.body, %if.then11, %if.then %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.end, label %for.body, !llvm.loop !24 for.end: ; preds = %for.inc, %entry store i32 -1, ptr %arrayidx, align 4, !tbaa !5 %6 = load i32, ptr @t, align 4, !tbaa !5 %inc16 = add nsw i32 %6, 1 store i32 %inc16, ptr @t, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds i32, ptr %f, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; 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 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 #4 = { 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 #5 = { nounwind } attributes #6 = { 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !12, !17, !18} !17 = !{!"llvm.loop.isvectorized", i32 1} !18 = !{!"llvm.loop.unroll.runtime.disable"} !19 = distinct !{!19, !12} !20 = distinct !{!20, !12} !21 = distinct !{!21, !12, !18, !17} !22 = distinct !{!22, !12} !23 = distinct !{!23, !12} !24 = distinct !{!24, !12}
#include <stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[N][N], color[N], d[N], f[N], tt; void dfs(); void dfs_visit(int); void dfs_print(); int main(){ int u, v, k, i, j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++) M[i][j] = 0; } for(i=0;i<n;i++){ scanf("%d %d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; M[u][v] = 1; } } dfs(); dfs_print(); return 0; } void dfs(){ int u; for(u=0;u<n;u++) color[N] = WHITE; tt = 0; for(u=0;u<n;u++){ if(color[u]==WHITE) dfs_visit(u); } } void dfs_visit(int u){ int v; color[u] = GRAY; d[u] = ++tt; for(v=0;v<n;v++){ if(M[u][v]==0) continue; if(color[v]==WHITE) dfs_visit(v); } color[u] = BLACK; f[u] = ++tt; } void dfs_print(){ int u; for(u=0;u<n;u++) printf("%d %d %d\n",u+1, d[u], f[u]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195462/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195462/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 @n = dso_local global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.cond1.preheader.us.preheader, label %dfs.exit.thread for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep57 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep57, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep58 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep58, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep59 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep59, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep60 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep60, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9 for.cond9.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp43, label %for.body11, label %dfs.exit.thread for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.148 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1445 = icmp sgt i32 %14, 0 br i1 %cmp1445, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.146 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.146, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !13 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.148, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !14 for.end27: ; preds = %for.inc25 %cmp13.i = icmp sgt i32 %.pr, 0 br i1 %cmp13.i, label %for.body3.preheader.i, label %dfs.exit.thread dfs.exit.thread: ; preds = %for.end27, %for.cond9.preheader, %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %dfs_print.exit for.body3.preheader.i: ; preds = %for.end27 store i32 0, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 1, i64 0), align 16, !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.inc5.i, %for.body3.preheader.i %18 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %21, %for.inc5.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc5.i ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %19 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp4.i = icmp eq i32 %19, 0 br i1 %cmp4.i, label %if.then.i, label %for.inc5.i if.then.i: ; preds = %for.body3.i %20 = trunc i64 %indvars.iv.i to i32 call void @dfs_visit(i32 noundef %20) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc5.i for.inc5.i: ; preds = %if.then.i, %for.body3.i %21 = phi i32 [ %18, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %22 = sext i32 %21 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %22 br i1 %cmp2.i, label %for.body3.i, label %dfs.exit, !llvm.loop !15 dfs.exit: ; preds = %for.inc5.i %23 = icmp sgt i32 %21, 0 br i1 %23, label %for.body.i, label %dfs_print.exit for.body.i: ; preds = %dfs.exit, %for.body.i %indvars.iv.i37 = phi i64 [ %indvars.iv.next.i38, %for.body.i ], [ 0, %dfs.exit ] %indvars.iv.next.i38 = add nuw nsw i64 %indvars.iv.i37, 1 %arrayidx.i39 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.i37 %24 = load i32, ptr %arrayidx.i39, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv.i37 %25 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %26 = trunc i64 %indvars.iv.next.i38 to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26, i32 noundef %24, i32 noundef %25) %27 = load i32, ptr @n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp.i = icmp slt i64 %indvars.iv.next.i38, %28 br i1 %cmp.i, label %for.body.i, label %dfs_print.exit, !llvm.loop !16 dfs_print.exit: ; preds = %for.body.i, %dfs.exit.thread, %dfs.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 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(readwrite, inaccessiblemem: none) uwtable define dso_local void @dfs() local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 0 br i1 %cmp13, label %for.body3.preheader, label %for.end for.end: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.end7 for.body3.preheader: ; preds = %entry store i32 0, ptr getelementptr inbounds ([100 x i32], ptr @color, i64 1, i64 0), align 16, !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc5 %1 = phi i32 [ %0, %for.body3.preheader ], [ %4, %for.inc5 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc5 ] %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp eq i32 %2, 0 br i1 %cmp4, label %if.then, label %for.inc5 if.then: ; preds = %for.body3 %3 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %3) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc5 for.inc5: ; preds = %for.body3, %if.then %4 = phi i32 [ %1, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = sext i32 %4 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %for.body3, label %for.end7, !llvm.loop !15 for.end7: ; preds = %for.inc5, %for.end ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #4 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !17 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dfs_print() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %3 = trunc i64 %indvars.iv.next to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3, i32 noundef %1, i32 noundef %2) %4 = load i32, ptr @n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #include<stdlib.h> #define N 102 #define white 0 #define gray 1 #define black 2 int n,color[N],d[N],f[N],S[N],top=0,t=0,nt[N],a[N][N]; void push(int x){ if(top==N){ printf("Stack overflow!\n"); exit(2); } S[++top]=x; } int pop(void){ if(top==0){ printf("Stack is empty!\n"); exit(3); } top--; return S[top+1]; } int next(int u){ int v; for(v=nt[u];v<=n;v++){ nt[u]=v+1; if(a[u][v]) return v; } return -1; } void dfs(int r){ int i; for(i=1;i<=n;i++) nt[i]=0; push(r); color[r]=gray; d[r]=++t; while(S[top]!=0){ int u=S[top],v=next(u); if(v!=-1){ if(color[v]==white){ color[v]=gray; d[v]=++t; push(v); } } else { pop(); color[u]=black; f[u]=++t; } } } void dfs_init(){ int i,u; for(i=1;i<=n;i++){ color[i]=white; } t=0; for(u=1;u<=n;u++){ if(color[u]==white) dfs(u); } } void print(){ int i; for(i=1;i<=n;i++) printf("%d %d %d\n",i,d[i],f[i]); } int main(){ int i,j,u,k,v; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ a[i][j]=0; } } for(i=1;i<=n;i++){ scanf("%d%d",&u,&k); for(j=1;j<=k;j++){ scanf("%d",&v); a[u][v]=1; } } dfs_init(); print(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195505/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" @top = dso_local local_unnamed_addr global i32 0, align 4 @t = dso_local local_unnamed_addr global i32 0, align 4 @S = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @nt = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @a = dso_local local_unnamed_addr global [102 x [102 x i32]] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [16 x i8] c"Stack overflow!\00", align 1 @str.5 = private unnamed_addr constant [16 x i8] c"Stack is empty!\00", align 1 ; Function Attrs: nounwind uwtable define dso_local void @push(i32 noundef %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 102 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) tail call void @exit(i32 noundef 2) #8 unreachable if.end: ; preds = %entry %inc = add nsw i32 %0, 1 store i32 %inc, ptr @top, align 4, !tbaa !5 %idxprom = sext i32 %inc to i64 %arrayidx = getelementptr inbounds [102 x i32], ptr @S, i64 0, i64 %idxprom store i32 %x, ptr %arrayidx, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #2 ; Function Attrs: nounwind uwtable define dso_local i32 @pop() local_unnamed_addr #0 { entry: %0 = load i32, ptr @top, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5) tail call void @exit(i32 noundef 3) #8 unreachable if.end: ; preds = %entry %dec = add nsw i32 %0, -1 store i32 %dec, ptr @top, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [102 x i32], ptr @S, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 ret i32 %1 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @next(i32 noundef %u) local_unnamed_addr #3 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [102 x i32], ptr @nt, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %0 to i64 %3 = sext i32 %1 to i64 br label %for.cond for.cond: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %2, %entry ] %cmp.not = icmp sgt i64 %indvars.iv, %3 br i1 %cmp.not, label %cleanup, label %for.body for.body: ; preds = %for.cond %indvars.iv.next = add nsw i64 %indvars.iv, 1 %4 = trunc i64 %indvars.iv.next to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [102 x [102 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %for.cond, label %cleanup.split.loop.exit14, !llvm.loop !9 cleanup.split.loop.exit14: ; preds = %for.body %6 = trunc i64 %indvars.iv to i32 br label %cleanup cleanup: ; preds = %for.cond, %cleanup.split.loop.exit14 %retval.0 = phi i32 [ %6, %cleanup.split.loop.exit14 ], [ -1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nounwind uwtable define dso_local void @dfs(i32 noundef %r) local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not55 = icmp slt i32 %0, 1 br i1 %cmp.not55, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([102 x i32], ptr @nt, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry %3 = load i32, ptr @top, align 4, !tbaa !5 %cmp.i = icmp eq i32 %3, 102 br i1 %cmp.i, label %if.then.i, label %push.exit if.then.i: ; preds = %for.end %puts.i = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) tail call void @exit(i32 noundef 2) #8 unreachable push.exit: ; preds = %for.end %inc.i = add nsw i32 %3, 1 store i32 %inc.i, ptr @top, align 4, !tbaa !5 %idxprom.i = sext i32 %inc.i to i64 %arrayidx.i = getelementptr inbounds [102 x i32], ptr @S, i64 0, i64 %idxprom.i store i32 %r, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom1 = sext i32 %r to i64 %arrayidx2 = getelementptr inbounds [102 x i32], ptr @color, i64 0, i64 %idxprom1 store i32 1, ptr %arrayidx2, align 4, !tbaa !5 %4 = load i32, ptr @t, align 4, !tbaa !5 %inc3 = add nsw i32 %4, 1 store i32 %inc3, ptr @t, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds [102 x i32], ptr @d, i64 0, i64 %idxprom1 store i32 %inc3, ptr %arrayidx5, align 4, !tbaa !5 %cmp8.not63 = icmp eq i32 %r, 0 br i1 %cmp8.not63, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %push.exit %5 = sext i32 %0 to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end27 %6 = phi i32 [ %r, %while.body.lr.ph ], [ %13, %if.end27 ] %dec.i5865 = phi i32 [ %inc.i, %while.body.lr.ph ], [ %dec.i57, %if.end27 ] %inc246064 = phi i32 [ %inc3, %while.body.lr.ph ], [ %inc2459, %if.end27 ] %idxprom.i38 = sext i32 %6 to i64 %arrayidx.i39 = getelementptr inbounds [102 x i32], ptr @nt, i64 0, i64 %idxprom.i38 %7 = load i32, ptr %arrayidx.i39, align 4, !tbaa !5 %8 = sext i32 %7 to i64 br label %for.cond.i for.cond.i: ; preds = %for.body.i, %while.body %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %8, %while.body ] %cmp.not.i = icmp sgt i64 %indvars.iv.i, %5 br i1 %cmp.not.i, label %if.else, label %for.body.i for.body.i: ; preds = %for.cond.i %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %9 = trunc i64 %indvars.iv.next.i to i32 store i32 %9, ptr %arrayidx.i39, align 4, !tbaa !5 %arrayidx6.i = getelementptr inbounds [102 x [102 x i32]], ptr @a, i64 0, i64 %idxprom.i38, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %tobool.not.i = icmp eq i32 %10, 0 br i1 %tobool.not.i, label %for.cond.i, label %next.exit, !llvm.loop !9 next.exit: ; preds = %for.body.i %11 = trunc i64 %indvars.iv.i to i32 %cmp11.not = icmp eq i32 %11, -1 br i1 %cmp11.not, label %if.else, label %if.then if.then: ; preds = %next.exit %sext = shl i64 %indvars.iv.i, 32 %idxprom12 = ashr exact i64 %sext, 32 %arrayidx13 = getelementptr inbounds [102 x i32], ptr @color, i64 0, i64 %idxprom12 %12 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp eq i32 %12, 0 br i1 %cmp14, label %if.then15, label %if.end27 if.then15: ; preds = %if.then store i32 1, ptr %arrayidx13, align 4, !tbaa !5 %inc18 = add nsw i32 %inc246064, 1 store i32 %inc18, ptr @t, align 4, !tbaa !5 %arrayidx20 = getelementptr inbounds [102 x i32], ptr @d, i64 0, i64 %idxprom12 store i32 %inc18, ptr %arrayidx20, align 4, !tbaa !5 %cmp.i40 = icmp eq i32 %dec.i5865, 102 br i1 %cmp.i40, label %if.then.i44, label %push.exit46 if.then.i44: ; preds = %if.then15 %puts.i45 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) tail call void @exit(i32 noundef 2) #8 unreachable push.exit46: ; preds = %if.then15 %inc.i41 = add nsw i32 %dec.i5865, 1 store i32 %inc.i41, ptr @top, align 4, !tbaa !5 %idxprom.i42 = sext i32 %inc.i41 to i64 %arrayidx.i43 = getelementptr inbounds [102 x i32], ptr @S, i64 0, i64 %idxprom.i42 store i32 %11, ptr %arrayidx.i43, align 4, !tbaa !5 br label %if.end27 if.else: ; preds = %for.cond.i, %next.exit %cmp.i47 = icmp eq i32 %dec.i5865, 0 br i1 %cmp.i47, label %if.then.i50, label %pop.exit if.then.i50: ; preds = %if.else %puts.i51 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5) tail call void @exit(i32 noundef 3) #8 unreachable pop.exit: ; preds = %if.else %dec.i = add nsw i32 %dec.i5865, -1 store i32 %dec.i, ptr @top, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds [102 x i32], ptr @color, i64 0, i64 %idxprom.i38 store i32 2, ptr %arrayidx23, align 4, !tbaa !5 %inc24 = add nsw i32 %inc246064, 1 store i32 %inc24, ptr @t, align 4, !tbaa !5 %arrayidx26 = getelementptr inbounds [102 x i32], ptr @f, i64 0, i64 %idxprom.i38 store i32 %inc24, ptr %arrayidx26, align 4, !tbaa !5 br label %if.end27 if.end27: ; preds = %if.then, %push.exit46, %pop.exit %inc2459 = phi i32 [ %inc246064, %if.then ], [ %inc18, %push.exit46 ], [ %inc24, %pop.exit ] %dec.i57 = phi i32 [ %dec.i5865, %if.then ], [ %inc.i41, %push.exit46 ], [ %dec.i, %pop.exit ] %idxprom6 = sext i32 %dec.i57 to i64 %arrayidx7 = getelementptr inbounds [102 x i32], ptr @S, i64 0, i64 %idxprom6 %13 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not = icmp eq i32 %13, 0 br i1 %cmp8.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end27, %push.exit ret void } ; Function Attrs: nounwind uwtable define dso_local void @dfs_init() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not15 = icmp slt i32 %0, 1 br i1 %cmp.not15, label %for.end.thread, label %for.body3.preheader for.end.thread: ; preds = %entry store i32 0, ptr @t, align 4, !tbaa !5 br label %for.end9 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([102 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @t, align 4, !tbaa !5 br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.inc7 %3 = phi i32 [ %0, %for.body3.preheader ], [ %6, %for.inc7 ] %indvars.iv = phi i64 [ 1, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [102 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %4, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %5 = trunc i64 %indvars.iv to i32 tail call void @dfs(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %6 = phi i32 [ %3, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp2.not.not, label %for.body3, label %for.end9, !llvm.loop !12 for.end9: ; preds = %for.inc7, %for.end.thread ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print() local_unnamed_addr #5 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not7 = icmp slt i32 %0, 1 br i1 %cmp.not7, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [102 x i32], ptr @d, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [102 x i32], ptr @f, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %3 = trunc i64 %indvars.iv to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3, i32 noundef %1, i32 noundef %2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr @n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %5 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #9 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, 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 %dfs_init.exit.thread, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.preheader.new for.cond1.preheader.preheader.new: ; preds = %for.cond1.preheader.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %indvar.next.7, %for.cond1.preheader ] %niter = phi i64 [ 0, %for.cond1.preheader.preheader.new ], [ %niter.next.7, %for.cond1.preheader ] %4 = mul nuw nsw i64 %indvar, 408 %gep = getelementptr i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 %4 tail call void @llvm.memset.p0.i64(ptr align 4 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 408 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 408), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 408 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 816), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 4 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 408 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 1224), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 408 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 1632), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 4 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 408 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2040), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 408 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2448), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 4 %gep56, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 408 %gep57 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 2856), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep57, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader, !llvm.loop !14 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader, %for.cond1.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next.7, %for.cond1.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.epil for.cond1.preheader.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 408 %gep.epil = getelementptr i8, ptr getelementptr inbounds ([102 x [102 x i32]], ptr @a, i64 0, i64 1, i64 1), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.epil, !llvm.loop !15 for.cond9.preheader: ; preds = %for.cond1.preheader.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp.not40, label %dfs_init.exit.thread, label %for.body11 for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.145 = phi i32 [ %inc25, %for.inc24 ], [ 1, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %k, align 4, !tbaa !5 %cmp14.not42 = icmp slt i32 %13, 1 br i1 %cmp14.not42, label %for.inc24, label %for.body15 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc22, %for.body15 ], [ 1, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %v) %14 = load i32, ptr %u, align 4, !tbaa !5 %idxprom17 = sext i32 %14 to i64 %15 = load i32, ptr %v, align 4, !tbaa !5 %idxprom19 = sext i32 %15 to i64 %arrayidx20 = getelementptr inbounds [102 x [102 x i32]], ptr @a, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.143, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14.not.not = icmp slt i32 %j.143, %16 br i1 %cmp14.not.not, label %for.body15, label %for.inc24, !llvm.loop !17 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10.not.not = icmp slt i32 %i.145, %.pr br i1 %cmp10.not.not, label %for.body11, label %for.end26, !llvm.loop !18 for.end26: ; preds = %for.inc24 %cmp.not15.i = icmp slt i32 %.pr, 1 br i1 %cmp.not15.i, label %dfs_init.exit.thread, label %for.body3.preheader.i dfs_init.exit.thread: ; preds = %for.end26, %for.cond9.preheader, %entry store i32 0, ptr @t, align 4, !tbaa !5 br label %print.exit for.body3.preheader.i: ; preds = %for.end26 %17 = zext i32 %.pr to i64 %18 = shl nuw nsw i64 %17, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([102 x i32], ptr @color, i64 0, i64 1), i8 0, i64 %18, i1 false), !tbaa !5 store i32 0, ptr @t, align 4, !tbaa !5 br label %for.body3.i for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %19 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %22, %for.inc7.i ] %indvars.iv.i = phi i64 [ 1, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [102 x i32], ptr @color, i64 0, i64 %indvars.iv.i %20 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %20, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %21 = trunc i64 %indvars.iv.i to i32 call void @dfs(i32 noundef %21) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %22 = phi i32 [ %19, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %23 = sext i32 %22 to i64 %cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %23 br i1 %cmp2.not.not.i, label %for.body3.i, label %dfs_init.exit, !llvm.loop !12 dfs_init.exit: ; preds = %for.inc7.i %24 = icmp slt i32 %22, 1 br i1 %24, label %print.exit, label %for.body.i for.body.i: ; preds = %dfs_init.exit, %for.body.i %indvars.iv.i35 = phi i64 [ %indvars.iv.next.i36, %for.body.i ], [ 1, %dfs_init.exit ] %arrayidx.i = getelementptr inbounds [102 x i32], ptr @d, i64 0, i64 %indvars.iv.i35 %25 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds [102 x i32], ptr @f, i64 0, i64 %indvars.iv.i35 %26 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %27 = trunc i64 %indvars.iv.i35 to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27, i32 noundef %25, i32 noundef %26) %indvars.iv.next.i36 = add nuw nsw i64 %indvars.iv.i35, 1 %28 = load i32, ptr @n, align 4, !tbaa !5 %29 = sext i32 %28 to i64 %cmp.not.not.i = icmp slt i64 %indvars.iv.i35, %29 br i1 %cmp.not.not.i, label %for.body.i, label %print.exit, !llvm.loop !13 print.exit: ; preds = %for.body.i, %dfs_init.exit.thread, %dfs_init.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #9 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 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 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 = { noreturn 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(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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { 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 #6 = { nofree nounwind } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { noreturn nounwind } attributes #9 = { 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} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #define max 100 #define White 0 #define Gray 1 #define Brack 2 int color[max],d[max],Dep[max][max]={0}; int tt,g[max]; int n; void visit(int u){ int i; color[u]=Gray; d[u] = ++tt; for(i=0;i<n;i++){ if(Dep[u][i]==0)continue; if(color[i]==White){ visit(i); } } color[u] = Brack; g[u]=++tt; } void dfs(){ int i; for(i=0;i<n;i++){ color[i]=White; } tt = 0; for(i=0;i<n;i++){ if(color[i]==White)visit(i); } for(i=0;i<n;i++){ printf("%d %d %d\n",i+1,d[i],g[i]); } } int main(){ int u,k,num; int i,j; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&num); num--; Dep[u][num]=1; } } dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195549/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195549/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" @Dep = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @g = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @Dep, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @g, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, 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 nounwind uwtable define dso_local void @dfs() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread for.cond10.preheader.thread: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.end19 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @g, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader ret void } ; 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 #2 { entry: %u = alloca i32, align 4 %k = alloca i32, align 4 %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body, label %for.cond10.preheader.thread.i for.body: ; preds = %entry, %for.inc9 %i.018 = phi i32 [ %inc10, %for.inc9 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k) %1 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp315 = icmp sgt i32 %2, 0 br i1 %cmp315, label %for.body4, label %for.inc9 for.body4: ; preds = %for.body, %for.body4 %j.016 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %num) %3 = load i32, ptr %num, align 4, !tbaa !5 %dec6 = add nsw i32 %3, -1 store i32 %dec6, ptr %num, align 4, !tbaa !5 %4 = load i32, ptr %u, align 4, !tbaa !5 %idxprom = sext i32 %4 to i64 %idxprom7 = sext i32 %dec6 to i64 %arrayidx8 = getelementptr inbounds [100 x [100 x i32]], ptr @Dep, i64 0, i64 %idxprom, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.016, 1 %5 = load i32, ptr %k, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %5 br i1 %cmp3, label %for.body4, label %for.inc9, !llvm.loop !13 for.inc9: ; preds = %for.body4, %for.body %inc10 = add nuw nsw i32 %i.018, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc10, %6 br i1 %cmp, label %for.body, label %for.end11, !llvm.loop !14 for.end11: ; preds = %for.inc9 %cmp31.i = icmp sgt i32 %6, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i for.cond10.preheader.thread.i: ; preds = %entry, %for.end11 store i32 0, ptr @tt, align 4, !tbaa !5 br label %dfs.exit for.body3.preheader.i: ; preds = %for.end11 %7 = zext i32 %6 to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %8, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %9 = icmp sgt i32 %13, 0 br i1 %9, label %for.body12.i, label %dfs.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %10 = phi i32 [ %6, %for.body3.preheader.i ], [ %13, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %11 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %11, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %12 = trunc i64 %indvars.iv.i to i32 call void @visit(i32 noundef %12) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %13 = phi i32 [ %10, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %14 = sext i32 %13 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %14 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %15 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @g, i64 0, i64 %indvars.iv39.i %16 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %17 = trunc i64 %indvars.iv.next40.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17, i32 noundef %15, i32 noundef %16) %18 = load i32, ptr @n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %19 br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12 dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = { 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 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(void) { int r1,r2,c1,c2,d1,d2,a,b,c,d,status=0; scanf("%d%d%d%d%d%d",&r1,&r2,&c1,&c2,&d1,&d2); for(a=1;a<=9 && status==0;a++) for(b=1;b<=9 && status==0;b++) for(c=1;c<=9 && status==0;c++) for(d=1;d<=9 && status==0;d++) if(a!=b && a!=c && a!=d && b!=c && b!=d && c!=d) if(a+b==r1 && c+d==r2 && a+c==c1 && b+d==c2 && a+d==d1 && b+c==d2) { printf("%d %d\n%d %d\n",a,b,c,d); status=1; } if(status==0) printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1956/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1956/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 [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%d %d\0A%d %d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r1 = alloca i32, align 4 %r2 = alloca i32, align 4 %c1 = alloca i32, align 4 %c2 = alloca i32, align 4 %d1 = alloca i32, align 4 %d2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r1, ptr noundef nonnull %r2, ptr noundef nonnull %c1, ptr noundef nonnull %c2, ptr noundef nonnull %d1, ptr noundef nonnull %d2) %0 = load i32, ptr %r1, align 4 %1 = load i32, ptr %r2, align 4 %2 = load i32, ptr %c1, align 4 %3 = load i32, ptr %c2, align 4 %4 = load i32, ptr %d1, align 4 %5 = load i32, ptr %d2, align 4 br label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.inc55 %a.0105 = phi i32 [ 1, %entry ], [ %inc56, %for.inc55 ] %cmp23.not = icmp eq i32 %a.0105, 1 %add41 = add nuw nsw i32 %a.0105, 1 %cmp42 = icmp eq i32 %add41, %4 %cmp23.not.1 = icmp eq i32 %a.0105, 2 %add41.1 = add nuw nsw i32 %a.0105, 2 %cmp42.1 = icmp eq i32 %add41.1, %4 %cmp23.not.2 = icmp eq i32 %a.0105, 3 %add41.2 = add nuw nsw i32 %a.0105, 3 %cmp42.2 = icmp eq i32 %add41.2, %4 %cmp23.not.3 = icmp eq i32 %a.0105, 4 %add41.3 = add nuw nsw i32 %a.0105, 4 %cmp42.3 = icmp eq i32 %add41.3, %4 %cmp23.not.4 = icmp eq i32 %a.0105, 5 %add41.4 = add nuw nsw i32 %a.0105, 5 %cmp42.4 = icmp eq i32 %add41.4, %4 %cmp23.not.5 = icmp eq i32 %a.0105, 6 %add41.5 = add nuw nsw i32 %a.0105, 6 %cmp42.5 = icmp eq i32 %add41.5, %4 %cmp23.not.6 = icmp eq i32 %a.0105, 7 %add41.6 = add nuw nsw i32 %a.0105, 7 %cmp42.6 = icmp eq i32 %add41.6, %4 %cmp23.not.7 = icmp eq i32 %a.0105, 8 %add41.7 = add nuw nsw i32 %a.0105, 8 %cmp42.7 = icmp eq i32 %add41.7, %4 %cmp23.not.8 = icmp eq i32 %a.0105, 9 %add41.8 = add nuw nsw i32 %a.0105, 9 %cmp42.8 = icmp eq i32 %add41.8, %4 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond2.preheader, %for.inc52 %b.0104 = phi i32 [ 1, %for.cond2.preheader ], [ %inc53, %for.inc52 ] %cmp20.not = icmp eq i32 %a.0105, %b.0104 %add = add nuw nsw i32 %b.0104, %a.0105 %cmp30 = icmp ne i32 %add, %0 %cmp27.not = icmp eq i32 %b.0104, 1 %or.cond100 = or i1 %cmp27.not, %cmp23.not %add38 = add nuw nsw i32 %b.0104, 1 %cmp39 = icmp eq i32 %add38, %3 %cmp27.not.1 = icmp eq i32 %b.0104, 2 %or.cond100.1 = or i1 %cmp27.not.1, %cmp23.not.1 %add38.1 = add nuw nsw i32 %b.0104, 2 %cmp39.1 = icmp eq i32 %add38.1, %3 %cmp27.not.2 = icmp eq i32 %b.0104, 3 %or.cond100.2 = or i1 %cmp27.not.2, %cmp23.not.2 %add38.2 = add nuw nsw i32 %b.0104, 3 %cmp39.2 = icmp eq i32 %add38.2, %3 %cmp27.not.3 = icmp eq i32 %b.0104, 4 %or.cond100.3 = or i1 %cmp27.not.3, %cmp23.not.3 %add38.3 = add nuw nsw i32 %b.0104, 4 %cmp39.3 = icmp eq i32 %add38.3, %3 %cmp27.not.4 = icmp eq i32 %b.0104, 5 %or.cond100.4 = or i1 %cmp27.not.4, %cmp23.not.4 %add38.4 = add nuw nsw i32 %b.0104, 5 %cmp39.4 = icmp eq i32 %add38.4, %3 %cmp27.not.5 = icmp eq i32 %b.0104, 6 %or.cond100.5 = or i1 %cmp27.not.5, %cmp23.not.5 %add38.5 = add nuw nsw i32 %b.0104, 6 %cmp39.5 = icmp eq i32 %add38.5, %3 %cmp27.not.6 = icmp eq i32 %b.0104, 7 %or.cond100.6 = or i1 %cmp27.not.6, %cmp23.not.6 %add38.6 = add nuw nsw i32 %b.0104, 7 %cmp39.6 = icmp eq i32 %add38.6, %3 %cmp27.not.7 = icmp eq i32 %b.0104, 8 %or.cond100.7 = or i1 %cmp27.not.7, %cmp23.not.7 %add38.7 = add nuw nsw i32 %b.0104, 8 %cmp39.7 = icmp eq i32 %add38.7, %3 %cmp27.not.8 = icmp eq i32 %b.0104, 9 %or.cond100.8 = or i1 %cmp27.not.8, %cmp23.not.8 %add38.8 = add nuw nsw i32 %b.0104, 9 %cmp39.8 = icmp eq i32 %add38.8, %3 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond8.preheader, %for.inc49 %c.0103 = phi i32 [ 1, %for.cond8.preheader ], [ %inc50, %for.inc49 ] %cmp21.not = icmp eq i32 %a.0105, %c.0103 %or.cond = or i1 %cmp20.not, %cmp21.not %cmp25.not = icmp eq i32 %b.0104, %c.0103 %cmp25.not.fr = freeze i1 %cmp25.not %or.cond.fr = freeze i1 %or.cond %6 = or i1 %cmp25.not.fr, %or.cond.fr br i1 %6, label %for.inc49, label %for.body19.preheader for.body19.preheader: ; preds = %for.cond14.preheader %add44 = add nuw nsw i32 %c.0103, %b.0104 %add35 = add nuw nsw i32 %c.0103, %a.0105 %cmp36 = icmp eq i32 %add35, %2 %cmp45 = icmp eq i32 %add44, %5 %cmp29.not = icmp eq i32 %c.0103, 1 %or.cond101 = or i1 %cmp29.not, %or.cond100 %or.cond106.not = select i1 %or.cond101, i1 true, i1 %cmp30 br i1 %or.cond106.not, label %for.inc, label %land.lhs.true31 land.lhs.true31: ; preds = %for.body19.preheader %add32 = add nuw nsw i32 %c.0103, 1 %cmp33 = icmp eq i32 %add32, %1 %or.cond107 = select i1 %cmp33, i1 %cmp36, i1 false %or.cond133 = select i1 %or.cond107, i1 %cmp39, i1 false %or.cond108 = select i1 %cmp42, i1 %cmp45, i1 false %or.cond145 = select i1 %or.cond133, i1 %or.cond108, i1 false br i1 %or.cond145, label %for.end57.thread, label %for.inc for.end57.thread: ; preds = %land.lhs.true31.8, %land.lhs.true31.7, %land.lhs.true31.6, %land.lhs.true31.5, %land.lhs.true31.4, %land.lhs.true31.3, %land.lhs.true31.2, %land.lhs.true31.1, %land.lhs.true31 %d.0102.lcssa = phi i32 [ 1, %land.lhs.true31 ], [ 2, %land.lhs.true31.1 ], [ 3, %land.lhs.true31.2 ], [ 4, %land.lhs.true31.3 ], [ 5, %land.lhs.true31.4 ], [ 6, %land.lhs.true31.5 ], [ 7, %land.lhs.true31.6 ], [ 8, %land.lhs.true31.7 ], [ 9, %land.lhs.true31.8 ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0105, i32 noundef %b.0104, i32 noundef %c.0103, i32 noundef %d.0102.lcssa) br label %if.end61 for.inc: ; preds = %for.body19.preheader, %land.lhs.true31 %cmp29.not.1 = icmp eq i32 %c.0103, 2 %or.cond101.1 = or i1 %cmp29.not.1, %or.cond100.1 %or.cond106.not.1 = select i1 %or.cond101.1, i1 true, i1 %cmp30 br i1 %or.cond106.not.1, label %for.inc.1, label %land.lhs.true31.1 land.lhs.true31.1: ; preds = %for.inc %add32.1 = add nuw nsw i32 %c.0103, 2 %cmp33.1 = icmp eq i32 %add32.1, %1 %or.cond107.1 = select i1 %cmp33.1, i1 %cmp36, i1 false %or.cond133.1 = select i1 %or.cond107.1, i1 %cmp39.1, i1 false %or.cond108.1 = select i1 %cmp42.1, i1 %cmp45, i1 false %or.cond146 = select i1 %or.cond133.1, i1 %or.cond108.1, i1 false br i1 %or.cond146, label %for.end57.thread, label %for.inc.1 for.inc.1: ; preds = %land.lhs.true31.1, %for.inc %cmp29.not.2 = icmp eq i32 %c.0103, 3 %or.cond101.2 = or i1 %cmp29.not.2, %or.cond100.2 %or.cond106.not.2 = select i1 %or.cond101.2, i1 true, i1 %cmp30 br i1 %or.cond106.not.2, label %for.inc.2, label %land.lhs.true31.2 land.lhs.true31.2: ; preds = %for.inc.1 %add32.2 = add nuw nsw i32 %c.0103, 3 %cmp33.2 = icmp eq i32 %add32.2, %1 %or.cond107.2 = select i1 %cmp33.2, i1 %cmp36, i1 false %or.cond133.2 = select i1 %or.cond107.2, i1 %cmp39.2, i1 false %or.cond108.2 = select i1 %cmp42.2, i1 %cmp45, i1 false %or.cond147 = select i1 %or.cond133.2, i1 %or.cond108.2, i1 false br i1 %or.cond147, label %for.end57.thread, label %for.inc.2 for.inc.2: ; preds = %land.lhs.true31.2, %for.inc.1 %cmp29.not.3 = icmp eq i32 %c.0103, 4 %or.cond101.3 = or i1 %cmp29.not.3, %or.cond100.3 %or.cond106.not.3 = select i1 %or.cond101.3, i1 true, i1 %cmp30 br i1 %or.cond106.not.3, label %for.inc.3, label %land.lhs.true31.3 land.lhs.true31.3: ; preds = %for.inc.2 %add32.3 = add nuw nsw i32 %c.0103, 4 %cmp33.3 = icmp eq i32 %add32.3, %1 %or.cond107.3 = select i1 %cmp33.3, i1 %cmp36, i1 false %or.cond133.3 = select i1 %or.cond107.3, i1 %cmp39.3, i1 false %or.cond108.3 = select i1 %cmp42.3, i1 %cmp45, i1 false %or.cond148 = select i1 %or.cond133.3, i1 %or.cond108.3, i1 false br i1 %or.cond148, label %for.end57.thread, label %for.inc.3 for.inc.3: ; preds = %land.lhs.true31.3, %for.inc.2 %cmp29.not.4 = icmp eq i32 %c.0103, 5 %or.cond101.4 = or i1 %cmp29.not.4, %or.cond100.4 %or.cond106.not.4 = select i1 %or.cond101.4, i1 true, i1 %cmp30 br i1 %or.cond106.not.4, label %for.inc.4, label %land.lhs.true31.4 land.lhs.true31.4: ; preds = %for.inc.3 %add32.4 = add nuw nsw i32 %c.0103, 5 %cmp33.4 = icmp eq i32 %add32.4, %1 %or.cond107.4 = select i1 %cmp33.4, i1 %cmp36, i1 false %or.cond133.4 = select i1 %or.cond107.4, i1 %cmp39.4, i1 false %or.cond108.4 = select i1 %cmp42.4, i1 %cmp45, i1 false %or.cond149 = select i1 %or.cond133.4, i1 %or.cond108.4, i1 false br i1 %or.cond149, label %for.end57.thread, label %for.inc.4 for.inc.4: ; preds = %land.lhs.true31.4, %for.inc.3 %cmp29.not.5 = icmp eq i32 %c.0103, 6 %or.cond101.5 = or i1 %cmp29.not.5, %or.cond100.5 %or.cond106.not.5 = select i1 %or.cond101.5, i1 true, i1 %cmp30 br i1 %or.cond106.not.5, label %for.inc.5, label %land.lhs.true31.5 land.lhs.true31.5: ; preds = %for.inc.4 %add32.5 = add nuw nsw i32 %c.0103, 6 %cmp33.5 = icmp eq i32 %add32.5, %1 %or.cond107.5 = select i1 %cmp33.5, i1 %cmp36, i1 false %or.cond133.5 = select i1 %or.cond107.5, i1 %cmp39.5, i1 false %or.cond108.5 = select i1 %cmp42.5, i1 %cmp45, i1 false %or.cond150 = select i1 %or.cond133.5, i1 %or.cond108.5, i1 false br i1 %or.cond150, label %for.end57.thread, label %for.inc.5 for.inc.5: ; preds = %land.lhs.true31.5, %for.inc.4 %cmp29.not.6 = icmp eq i32 %c.0103, 7 %or.cond101.6 = or i1 %cmp29.not.6, %or.cond100.6 %or.cond106.not.6 = select i1 %or.cond101.6, i1 true, i1 %cmp30 br i1 %or.cond106.not.6, label %for.inc.6, label %land.lhs.true31.6 land.lhs.true31.6: ; preds = %for.inc.5 %add32.6 = add nuw nsw i32 %c.0103, 7 %cmp33.6 = icmp eq i32 %add32.6, %1 %or.cond107.6 = select i1 %cmp33.6, i1 %cmp36, i1 false %or.cond133.6 = select i1 %or.cond107.6, i1 %cmp39.6, i1 false %or.cond108.6 = select i1 %cmp42.6, i1 %cmp45, i1 false %or.cond151 = select i1 %or.cond133.6, i1 %or.cond108.6, i1 false br i1 %or.cond151, label %for.end57.thread, label %for.inc.6 for.inc.6: ; preds = %land.lhs.true31.6, %for.inc.5 %cmp29.not.7 = icmp eq i32 %c.0103, 8 %or.cond101.7 = or i1 %cmp29.not.7, %or.cond100.7 %or.cond106.not.7 = select i1 %or.cond101.7, i1 true, i1 %cmp30 br i1 %or.cond106.not.7, label %for.inc.7, label %land.lhs.true31.7 land.lhs.true31.7: ; preds = %for.inc.6 %add32.7 = add nuw nsw i32 %c.0103, 8 %cmp33.7 = icmp eq i32 %add32.7, %1 %or.cond107.7 = select i1 %cmp33.7, i1 %cmp36, i1 false %or.cond133.7 = select i1 %or.cond107.7, i1 %cmp39.7, i1 false %or.cond108.7 = select i1 %cmp42.7, i1 %cmp45, i1 false %or.cond152 = select i1 %or.cond133.7, i1 %or.cond108.7, i1 false br i1 %or.cond152, label %for.end57.thread, label %for.inc.7 for.inc.7: ; preds = %land.lhs.true31.7, %for.inc.6 %cmp29.not.8 = icmp eq i32 %c.0103, 9 %or.cond101.8 = or i1 %cmp29.not.8, %or.cond100.8 %or.cond106.not.8 = select i1 %or.cond101.8, i1 true, i1 %cmp30 br i1 %or.cond106.not.8, label %for.inc49, label %land.lhs.true31.8 land.lhs.true31.8: ; preds = %for.inc.7 %add32.8 = add nuw nsw i32 %c.0103, 9 %cmp33.8 = icmp eq i32 %add32.8, %1 %or.cond107.8 = select i1 %cmp33.8, i1 %cmp36, i1 false %or.cond133.8 = select i1 %or.cond107.8, i1 %cmp39.8, i1 false %or.cond108.8 = select i1 %cmp42.8, i1 %cmp45, i1 false %or.cond153 = select i1 %or.cond133.8, i1 %or.cond108.8, i1 false br i1 %or.cond153, label %for.end57.thread, label %for.inc49 for.inc49: ; preds = %for.inc.7, %land.lhs.true31.8, %for.cond14.preheader %inc50 = add nuw nsw i32 %c.0103, 1 %cmp9 = icmp ult i32 %c.0103, 9 br i1 %cmp9, label %for.cond14.preheader, label %for.inc52, !llvm.loop !5 for.inc52: ; preds = %for.inc49 %inc53 = add nuw nsw i32 %b.0104, 1 %cmp3 = icmp ult i32 %b.0104, 9 br i1 %cmp3, label %for.cond8.preheader, label %for.inc55, !llvm.loop !7 for.inc55: ; preds = %for.inc52 %inc56 = add nuw nsw i32 %a.0105, 1 %cmp = icmp ult i32 %a.0105, 9 br i1 %cmp, label %for.cond2.preheader, label %if.then59, !llvm.loop !8 if.then59: ; preds = %for.inc55 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end61 if.end61: ; preds = %for.end57.thread, %if.then59 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r1) #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: 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6}
#include<stdio.h> #define N 100 #define W 0 #define G 1 #define B 2 int n,m[N][N]; int c[N],d[N],f[N],g; void in(){ int a,b,c,i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ m[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d%d",&a,&b); a--; for(j=0;j<b;j++){ scanf("%d",&c); c--; m[a][c]=1; } } } void visit(int x){ int y; c[x]=G; d[x]=++g; for(y=0;y<n;y++){ if(m[x][y]==0)continue; if(c[y]==W){ visit(y); } } c[x]=B; f[x]=++g; } void dfs(){ int x; for(x=0;x<n;x++)c[x]=W; g=0; for(x=0;x<n;x++)if(c[x]==W)visit(x); for(x=0;x<n;x++)printf("%d %d %d\n",x+1,d[x],f[x]); } int main(){ in(); dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195642/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195642/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 @n = dso_local global i32 0, align 4 @m = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @c = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @g = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @in() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = 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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp38 = icmp sgt i32 %0, 0 br i1 %cmp38, label %for.cond1.preheader.us.preheader, label %for.end27 for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.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, 4294967288 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.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @m, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep46 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep46, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep47 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep47, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep48 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep48, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep49 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep49, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep50 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep50, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @m, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, 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.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9 for.cond9.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.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @m, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, 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.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp38, label %for.body11, label %for.end27 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.143 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %13 = load i32, ptr %a, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 %14 = load i32, ptr %b, align 4, !tbaa !5 %cmp1440 = icmp sgt i32 %14, 0 br i1 %cmp1440, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.141 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %15 = load i32, ptr %c, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %c, align 4, !tbaa !5 %16 = load i32, ptr %a, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.141, 1 %17 = load i32, ptr %b, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !13 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.143, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !14 for.end27: ; preds = %for.inc25, %entry, %for.cond9.preheader 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 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: 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @visit(i32 noundef %x) local_unnamed_addr #3 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @g, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @g, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !15 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @g, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @g, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dfs() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread for.cond10.preheader.thread: ; preds = %entry store i32 0, ptr @g, align 4, !tbaa !5 br label %for.end19 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @c, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @g, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !16 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !17 for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader 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 i32 @main() local_unnamed_addr #0 { entry: tail call void @in() %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31.i = icmp sgt i32 %0, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i for.cond10.preheader.thread.i: ; preds = %entry store i32 0, ptr @g, align 4, !tbaa !5 br label %dfs.exit for.body3.preheader.i: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @c, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @g, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12.i, label %dfs.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %4 = phi i32 [ %0, %for.body3.preheader.i ], [ %7, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv.i %5 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %5, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %6 = trunc i64 %indvars.iv.i to i32 tail call void @visit(i32 noundef %6) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %7 = phi i32 [ %4, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %8 = sext i32 %7 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %8 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !16 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %9 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i %10 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40.i to i32 %call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %13 br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !17 dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i ret i32 0 } ; 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 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 #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"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> // uint64_t #define max(a,b) ((a) > (b) ? (a) : (b)) #define min(a,b) ((a) > (b) ? (b) : (a)) #define BUF_SIZE 30 #define DIVISOR 1000000007 int get_int3(int *a1, int *a2, int *a3) { #ifdef BUF_SIZE char line[BUF_SIZE]; if(!fgets(line, BUF_SIZE, stdin)) return -1; sscanf(line, "%d %d %d", a1, a2, a3); #else #error #endif return 0; } int get_int4(int *a1, int *a2, int *a3, int *a4) { #ifdef BUF_SIZE char line[BUF_SIZE]; if(!fgets(line, BUF_SIZE, stdin)) return -1; sscanf(line, "%d %d %d %d", a1, a2, a3, a4); #else #error #endif return 0; } struct query { int v1; int v2; int dist; int point; }; #define QUERY_MAX 50 #define NUM_MAX 10 int desc_by_point(const void *a1, const void *a2) { struct query *qa1 = (struct query*)a1; struct query *qa2 = (struct query*)a2; return qa2->point - qa1->dist; } int main(void) { int num, limit, qs; struct query queries[QUERY_MAX]; get_int3(&num, &limit, &qs); int i; for(i = 0; i < qs; i++) { int v1, v2, dist, point; get_int4(&v1, &v2, &dist, &point); v1--; v2--; queries[i] = (struct query){v1, v2, dist, point}; } qsort(queries, qs, sizeof(struct query), desc_by_point); int sum = num + limit - 1; int pat; int ans = 0; for(pat = 1; pat < (1<<sum); pat++) { int cnt = __builtin_popcount(pat); if(cnt != num) continue; int as[NUM_MAX] = {0}; int aidx = 0; int bidx = 0; for(i = 0; i < sum; i++) { int flag = (pat & (1<<i)); if(flag) { as[aidx++] = bidx; } else { bidx++; } } int res = 0; for(i = 0; i < qs; i++) { struct query q = queries[i]; if(q.dist == as[q.v2] - as[q.v1]) res += q.point; } ans = max(res, ans); } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195686/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195686/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.query = type { i32, i32, i32, i32 } @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %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 @get_int3(ptr noundef %a1, ptr noundef %a2, ptr noundef %a3) local_unnamed_addr #0 { entry: %line = alloca [30 x i8], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %line) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 30, ptr noundef %0) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %cleanup, label %if.end if.end: ; preds = %entry %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef %a1, ptr noundef %a2, ptr noundef %a3) #8 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ] call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %line) #8 ret i32 %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: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, 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 uwtable define dso_local i32 @get_int4(ptr noundef %a1, ptr noundef %a2, ptr noundef %a3, ptr noundef %a4) local_unnamed_addr #0 { entry: %line = alloca [30 x i8], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %line) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 30, ptr noundef %0) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %cleanup, label %if.end if.end: ; preds = %entry %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str.1, ptr noundef %a1, ptr noundef %a2, ptr noundef %a3, ptr noundef %a4) #8 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ] call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %line) #8 ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @desc_by_point(ptr nocapture noundef readonly %a1, ptr nocapture noundef readonly %a2) #3 { entry: %point = getelementptr inbounds %struct.query, ptr %a2, i64 0, i32 3 %0 = load i32, ptr %point, align 4, !tbaa !9 %dist = getelementptr inbounds %struct.query, ptr %a1, i64 0, i32 2 %1 = load i32, ptr %dist, align 4, !tbaa !12 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %line.i81 = alloca [30 x i8], align 16 %line.i = alloca [30 x i8], align 16 %num = alloca i32, align 4 %limit = alloca i32, align 4 %qs = alloca i32, align 4 %queries = alloca [50 x %struct.query], align 16 %v1 = alloca i32, align 4 %v2 = alloca i32, align 4 %dist = alloca i32, align 4 %point = alloca i32, align 4 %as = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %limit) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qs) #8 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %queries) #8 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %line.i) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call ptr @fgets(ptr noundef nonnull %line.i, i32 noundef 30, ptr noundef %0) %tobool.not.i = icmp eq ptr %call.i, null br i1 %tobool.not.i, label %get_int3.exit, label %if.end.i if.end.i: ; preds = %entry %call2.i = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line.i, ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %limit, ptr noundef nonnull %qs) #8 br label %get_int3.exit get_int3.exit: ; preds = %entry, %if.end.i call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %line.i) #8 %1 = load i32, ptr %qs, align 4, !tbaa !13 %cmp87 = icmp sgt i32 %1, 0 br i1 %cmp87, label %for.body, label %get_int3.exit.for.end_crit_edge get_int3.exit.for.end_crit_edge: ; preds = %get_int3.exit %.pre = sext i32 %1 to i64 br label %for.end for.body: ; preds = %get_int3.exit, %get_int4.exit %indvars.iv = phi i64 [ %indvars.iv.next, %get_int4.exit ], [ 0, %get_int3.exit ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v1) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v2) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dist) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %point) #8 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %line.i81) #8 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i82 = call ptr @fgets(ptr noundef nonnull %line.i81, i32 noundef 30, ptr noundef %2) %tobool.not.i83 = icmp eq ptr %call.i82, null br i1 %tobool.not.i83, label %get_int4.exit, label %if.end.i84 if.end.i84: ; preds = %for.body %call2.i85 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line.i81, ptr noundef nonnull @.str.1, ptr noundef nonnull %v1, ptr noundef nonnull %v2, ptr noundef nonnull %dist, ptr noundef nonnull %point) #8 br label %get_int4.exit get_int4.exit: ; preds = %for.body, %if.end.i84 call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %line.i81) #8 %3 = load i32, ptr %v1, align 4, !tbaa !13 %dec = add nsw i32 %3, -1 %4 = load i32, ptr %v2, align 4, !tbaa !13 %dec2 = add nsw i32 %4, -1 %arrayidx = getelementptr inbounds [50 x %struct.query], ptr %queries, i64 0, i64 %indvars.iv %5 = load i32, ptr %dist, align 4, !tbaa !13 %6 = load i32, ptr %point, align 4, !tbaa !13 store i32 %dec, ptr %arrayidx, align 16, !tbaa.struct !14 %.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4 store i32 %dec2, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 4, !tbaa.struct !15 %.compoundliteral.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i32 %5, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx, align 8, !tbaa.struct !16 %.compoundliteral.sroa.4.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 12 store i32 %6, ptr %.compoundliteral.sroa.4.0.arrayidx.sroa_idx, align 4, !tbaa.struct !17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %point) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dist) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v2) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v1) #8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %qs, align 4, !tbaa !13 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !18 for.end: ; preds = %get_int4.exit, %get_int3.exit.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %get_int3.exit.for.end_crit_edge ], [ %8, %get_int4.exit ] call void @qsort(ptr noundef nonnull %queries, i64 noundef %conv.pre-phi, i64 noundef 16, ptr noundef nonnull @desc_by_point) #8 %9 = load i32, ptr %num, align 4, !tbaa !13 %10 = load i32, ptr %limit, align 4, !tbaa !13 %add = add i32 %9, -1 %sub = add i32 %add, %10 %sub.fr = freeze i32 %sub %shl = shl nuw i32 1, %sub.fr %cmp897 = icmp sgt i32 %shl, 1 br i1 %cmp897, label %for.body10.lr.ph, label %for.end54 for.body10.lr.ph: ; preds = %for.end %cmp1489 = icmp sgt i32 %sub.fr, 0 %11 = load i32, ptr %qs, align 4 %.fr = freeze i32 %11 %cmp2893 = icmp sgt i32 %.fr, 0 br i1 %cmp2893, label %for.body10.us.preheader, label %for.body10.lr.ph.split for.body10.us.preheader: ; preds = %for.body10.lr.ph %wide.trip.count = zext i32 %.fr to i64 %xtraiter151 = and i32 %sub.fr, 1 %12 = icmp eq i32 %sub.fr, 1 %unroll_iter153 = and i32 %sub.fr, -2 %lcmp.mod152.not = icmp eq i32 %xtraiter151, 0 %xtraiter155 = and i64 %wide.trip.count, 1 %13 = icmp eq i32 %.fr, 1 %unroll_iter158 = and i64 %wide.trip.count, 4294967294 %lcmp.mod156.not = icmp eq i64 %xtraiter155, 0 br label %for.body10.us for.body10.us: ; preds = %for.body10.us.preheader, %cleanup.us %pat.099.us = phi i32 [ %inc53.us, %cleanup.us ], [ 1, %for.body10.us.preheader ] %ans.098.us = phi i32 [ %ans.1.us, %cleanup.us ], [ 0, %for.body10.us.preheader ] %14 = call i32 @llvm.ctpop.i32(i32 %pat.099.us), !range !20 %cmp11.not.us = icmp eq i32 %14, %9 br i1 %cmp11.not.us, label %if.end.us, label %cleanup.us if.end.us: ; preds = %for.body10.us call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %as) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %as, i8 0, i64 40, i1 false) br i1 %cmp1489, label %for.body16.us.preheader, label %for.body30.us.preheader for.body16.us.preheader: ; preds = %if.end.us br i1 %12, label %for.body30.us.preheader.loopexit.unr-lcssa, label %for.body16.us for.body30.us.preheader.loopexit.unr-lcssa: ; preds = %if.end23.us.1, %for.body16.us.preheader %i.192.us.unr = phi i32 [ 0, %for.body16.us.preheader ], [ %inc25.us.1, %if.end23.us.1 ] %bidx.091.us.unr = phi i32 [ 0, %for.body16.us.preheader ], [ %bidx.1.us.1, %if.end23.us.1 ] %aidx.090.us.unr = phi i32 [ 0, %for.body16.us.preheader ], [ %aidx.1.us.1, %if.end23.us.1 ] br i1 %lcmp.mod152.not, label %for.body30.us.preheader, label %for.body16.us.epil for.body16.us.epil: ; preds = %for.body30.us.preheader.loopexit.unr-lcssa %shl17.us.epil = shl nuw i32 1, %i.192.us.unr %and.us.epil = and i32 %shl17.us.epil, %pat.099.us %tobool.not.us.epil = icmp eq i32 %and.us.epil, 0 br i1 %tobool.not.us.epil, label %for.body30.us.preheader, label %if.then18.us.epil if.then18.us.epil: ; preds = %for.body16.us.epil %idxprom20.us.epil = sext i32 %aidx.090.us.unr to i64 %arrayidx21.us.epil = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us.epil store i32 %bidx.091.us.unr, ptr %arrayidx21.us.epil, align 4, !tbaa !13 br label %for.body30.us.preheader for.body30.us.preheader: ; preds = %for.body30.us.preheader.loopexit.unr-lcssa, %for.body16.us.epil, %if.then18.us.epil, %if.end.us br i1 %13, label %for.cond27.for.end49_crit_edge.us.unr-lcssa, label %for.body30.us cleanup.us: ; preds = %for.cond27.for.end49_crit_edge.us, %for.body10.us %ans.1.us = phi i32 [ %cond.us, %for.cond27.for.end49_crit_edge.us ], [ %ans.098.us, %for.body10.us ] %inc53.us = add nuw nsw i32 %pat.099.us, 1 %exitcond145.not = icmp eq i32 %inc53.us, %shl br i1 %exitcond145.not, label %for.end54, label %for.body10.us, !llvm.loop !21 for.body30.us: ; preds = %for.body30.us.preheader, %if.end46.us.1 %indvars.iv141 = phi i64 [ %indvars.iv.next142.1, %if.end46.us.1 ], [ 0, %for.body30.us.preheader ] %res.094.us = phi i32 [ %res.1.us.1, %if.end46.us.1 ], [ 0, %for.body30.us.preheader ] %niter159 = phi i64 [ %niter159.next.1, %if.end46.us.1 ], [ 0, %for.body30.us.preheader ] %arrayidx32.us = getelementptr inbounds [50 x %struct.query], ptr %queries, i64 0, i64 %indvars.iv141 %q.sroa.0.0.copyload.us = load i32, ptr %arrayidx32.us, align 16, !tbaa.struct !14 %q.sroa.4.0.arrayidx32.sroa_idx.us = getelementptr inbounds i8, ptr %arrayidx32.us, i64 4 %q.sroa.4.0.copyload.us = load i32, ptr %q.sroa.4.0.arrayidx32.sroa_idx.us, align 4, !tbaa.struct !15 %q.sroa.5.0.arrayidx32.sroa_idx.us = getelementptr inbounds i8, ptr %arrayidx32.us, i64 8 %q.sroa.5.0.copyload.us = load i32, ptr %q.sroa.5.0.arrayidx32.sroa_idx.us, align 8, !tbaa.struct !16 %idxprom35.us = sext i32 %q.sroa.4.0.copyload.us to i64 %arrayidx36.us = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom35.us %15 = load i32, ptr %arrayidx36.us, align 4, !tbaa !13 %idxprom38.us = sext i32 %q.sroa.0.0.copyload.us to i64 %arrayidx39.us = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom38.us %16 = load i32, ptr %arrayidx39.us, align 4, !tbaa !13 %sub40.us = sub nsw i32 %15, %16 %cmp41.us = icmp eq i32 %q.sroa.5.0.copyload.us, %sub40.us br i1 %cmp41.us, label %if.then43.us, label %if.end46.us if.then43.us: ; preds = %for.body30.us %q.sroa.6.0.arrayidx32.sroa_idx.us = getelementptr inbounds i8, ptr %arrayidx32.us, i64 12 %q.sroa.6.0.copyload.us = load i32, ptr %q.sroa.6.0.arrayidx32.sroa_idx.us, align 4, !tbaa.struct !17 %add45.us = add nsw i32 %q.sroa.6.0.copyload.us, %res.094.us br label %if.end46.us if.end46.us: ; preds = %if.then43.us, %for.body30.us %res.1.us = phi i32 [ %add45.us, %if.then43.us ], [ %res.094.us, %for.body30.us ] %indvars.iv.next142 = or i64 %indvars.iv141, 1 %arrayidx32.us.1 = getelementptr inbounds [50 x %struct.query], ptr %queries, i64 0, i64 %indvars.iv.next142 %q.sroa.0.0.copyload.us.1 = load i32, ptr %arrayidx32.us.1, align 16, !tbaa.struct !14 %q.sroa.4.0.arrayidx32.sroa_idx.us.1 = getelementptr inbounds i8, ptr %arrayidx32.us.1, i64 4 %q.sroa.4.0.copyload.us.1 = load i32, ptr %q.sroa.4.0.arrayidx32.sroa_idx.us.1, align 4, !tbaa.struct !15 %q.sroa.5.0.arrayidx32.sroa_idx.us.1 = getelementptr inbounds i8, ptr %arrayidx32.us.1, i64 8 %q.sroa.5.0.copyload.us.1 = load i32, ptr %q.sroa.5.0.arrayidx32.sroa_idx.us.1, align 8, !tbaa.struct !16 %idxprom35.us.1 = sext i32 %q.sroa.4.0.copyload.us.1 to i64 %arrayidx36.us.1 = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom35.us.1 %17 = load i32, ptr %arrayidx36.us.1, align 4, !tbaa !13 %idxprom38.us.1 = sext i32 %q.sroa.0.0.copyload.us.1 to i64 %arrayidx39.us.1 = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom38.us.1 %18 = load i32, ptr %arrayidx39.us.1, align 4, !tbaa !13 %sub40.us.1 = sub nsw i32 %17, %18 %cmp41.us.1 = icmp eq i32 %q.sroa.5.0.copyload.us.1, %sub40.us.1 br i1 %cmp41.us.1, label %if.then43.us.1, label %if.end46.us.1 if.then43.us.1: ; preds = %if.end46.us %q.sroa.6.0.arrayidx32.sroa_idx.us.1 = getelementptr inbounds i8, ptr %arrayidx32.us.1, i64 12 %q.sroa.6.0.copyload.us.1 = load i32, ptr %q.sroa.6.0.arrayidx32.sroa_idx.us.1, align 4, !tbaa.struct !17 %add45.us.1 = add nsw i32 %q.sroa.6.0.copyload.us.1, %res.1.us br label %if.end46.us.1 if.end46.us.1: ; preds = %if.then43.us.1, %if.end46.us %res.1.us.1 = phi i32 [ %add45.us.1, %if.then43.us.1 ], [ %res.1.us, %if.end46.us ] %indvars.iv.next142.1 = add nuw nsw i64 %indvars.iv141, 2 %niter159.next.1 = add i64 %niter159, 2 %niter159.ncmp.1 = icmp eq i64 %niter159.next.1, %unroll_iter158 br i1 %niter159.ncmp.1, label %for.cond27.for.end49_crit_edge.us.unr-lcssa, label %for.body30.us, !llvm.loop !22 for.body16.us: ; preds = %for.body16.us.preheader, %if.end23.us.1 %i.192.us = phi i32 [ %inc25.us.1, %if.end23.us.1 ], [ 0, %for.body16.us.preheader ] %bidx.091.us = phi i32 [ %bidx.1.us.1, %if.end23.us.1 ], [ 0, %for.body16.us.preheader ] %aidx.090.us = phi i32 [ %aidx.1.us.1, %if.end23.us.1 ], [ 0, %for.body16.us.preheader ] %niter154 = phi i32 [ %niter154.next.1, %if.end23.us.1 ], [ 0, %for.body16.us.preheader ] %shl17.us = shl nuw i32 1, %i.192.us %and.us = and i32 %shl17.us, %pat.099.us %tobool.not.us = icmp eq i32 %and.us, 0 br i1 %tobool.not.us, label %if.else.us, label %if.then18.us if.then18.us: ; preds = %for.body16.us %inc19.us = add nsw i32 %aidx.090.us, 1 %idxprom20.us = sext i32 %aidx.090.us to i64 %arrayidx21.us = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us store i32 %bidx.091.us, ptr %arrayidx21.us, align 4, !tbaa !13 br label %if.end23.us if.else.us: ; preds = %for.body16.us %inc22.us = add nsw i32 %bidx.091.us, 1 br label %if.end23.us if.end23.us: ; preds = %if.else.us, %if.then18.us %aidx.1.us = phi i32 [ %inc19.us, %if.then18.us ], [ %aidx.090.us, %if.else.us ] %bidx.1.us = phi i32 [ %bidx.091.us, %if.then18.us ], [ %inc22.us, %if.else.us ] %inc25.us = or i32 %i.192.us, 1 %shl17.us.1 = shl nuw i32 1, %inc25.us %and.us.1 = and i32 %shl17.us.1, %pat.099.us %tobool.not.us.1 = icmp eq i32 %and.us.1, 0 br i1 %tobool.not.us.1, label %if.else.us.1, label %if.then18.us.1 if.then18.us.1: ; preds = %if.end23.us %inc19.us.1 = add nsw i32 %aidx.1.us, 1 %idxprom20.us.1 = sext i32 %aidx.1.us to i64 %arrayidx21.us.1 = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us.1 store i32 %bidx.1.us, ptr %arrayidx21.us.1, align 4, !tbaa !13 br label %if.end23.us.1 if.else.us.1: ; preds = %if.end23.us %inc22.us.1 = add nsw i32 %bidx.1.us, 1 br label %if.end23.us.1 if.end23.us.1: ; preds = %if.else.us.1, %if.then18.us.1 %aidx.1.us.1 = phi i32 [ %inc19.us.1, %if.then18.us.1 ], [ %aidx.1.us, %if.else.us.1 ] %bidx.1.us.1 = phi i32 [ %bidx.1.us, %if.then18.us.1 ], [ %inc22.us.1, %if.else.us.1 ] %inc25.us.1 = add nuw nsw i32 %i.192.us, 2 %niter154.next.1 = add i32 %niter154, 2 %niter154.ncmp.1 = icmp eq i32 %niter154.next.1, %unroll_iter153 br i1 %niter154.ncmp.1, label %for.body30.us.preheader.loopexit.unr-lcssa, label %for.body16.us, !llvm.loop !23 for.cond27.for.end49_crit_edge.us.unr-lcssa: ; preds = %if.end46.us.1, %for.body30.us.preheader %res.1.us.lcssa.ph = phi i32 [ undef, %for.body30.us.preheader ], [ %res.1.us.1, %if.end46.us.1 ] %indvars.iv141.unr = phi i64 [ 0, %for.body30.us.preheader ], [ %indvars.iv.next142.1, %if.end46.us.1 ] %res.094.us.unr = phi i32 [ 0, %for.body30.us.preheader ], [ %res.1.us.1, %if.end46.us.1 ] br i1 %lcmp.mod156.not, label %for.cond27.for.end49_crit_edge.us, label %for.body30.us.epil for.body30.us.epil: ; preds = %for.cond27.for.end49_crit_edge.us.unr-lcssa %arrayidx32.us.epil = getelementptr inbounds [50 x %struct.query], ptr %queries, i64 0, i64 %indvars.iv141.unr %q.sroa.0.0.copyload.us.epil = load i32, ptr %arrayidx32.us.epil, align 16, !tbaa.struct !14 %q.sroa.4.0.arrayidx32.sroa_idx.us.epil = getelementptr inbounds i8, ptr %arrayidx32.us.epil, i64 4 %q.sroa.4.0.copyload.us.epil = load i32, ptr %q.sroa.4.0.arrayidx32.sroa_idx.us.epil, align 4, !tbaa.struct !15 %q.sroa.5.0.arrayidx32.sroa_idx.us.epil = getelementptr inbounds i8, ptr %arrayidx32.us.epil, i64 8 %q.sroa.5.0.copyload.us.epil = load i32, ptr %q.sroa.5.0.arrayidx32.sroa_idx.us.epil, align 8, !tbaa.struct !16 %idxprom35.us.epil = sext i32 %q.sroa.4.0.copyload.us.epil to i64 %arrayidx36.us.epil = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom35.us.epil %19 = load i32, ptr %arrayidx36.us.epil, align 4, !tbaa !13 %idxprom38.us.epil = sext i32 %q.sroa.0.0.copyload.us.epil to i64 %arrayidx39.us.epil = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom38.us.epil %20 = load i32, ptr %arrayidx39.us.epil, align 4, !tbaa !13 %sub40.us.epil = sub nsw i32 %19, %20 %cmp41.us.epil = icmp eq i32 %q.sroa.5.0.copyload.us.epil, %sub40.us.epil br i1 %cmp41.us.epil, label %if.then43.us.epil, label %for.cond27.for.end49_crit_edge.us if.then43.us.epil: ; preds = %for.body30.us.epil %q.sroa.6.0.arrayidx32.sroa_idx.us.epil = getelementptr inbounds i8, ptr %arrayidx32.us.epil, i64 12 %q.sroa.6.0.copyload.us.epil = load i32, ptr %q.sroa.6.0.arrayidx32.sroa_idx.us.epil, align 4, !tbaa.struct !17 %add45.us.epil = add nsw i32 %q.sroa.6.0.copyload.us.epil, %res.094.us.unr br label %for.cond27.for.end49_crit_edge.us for.cond27.for.end49_crit_edge.us: ; preds = %for.body30.us.epil, %if.then43.us.epil, %for.cond27.for.end49_crit_edge.us.unr-lcssa %res.1.us.lcssa = phi i32 [ %res.1.us.lcssa.ph, %for.cond27.for.end49_crit_edge.us.unr-lcssa ], [ %add45.us.epil, %if.then43.us.epil ], [ %res.094.us.unr, %for.body30.us.epil ] %cond.us = call i32 @llvm.smax.i32(i32 %res.1.us.lcssa, i32 %ans.098.us) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %as) #8 br label %cleanup.us for.body10.lr.ph.split: ; preds = %for.body10.lr.ph br i1 %cmp1489, label %for.body10.us101.preheader, label %for.end54 for.body10.us101.preheader: ; preds = %for.body10.lr.ph.split %xtraiter = and i32 %sub.fr, 1 %21 = icmp eq i32 %sub.fr, 1 %unroll_iter = and i32 %sub.fr, -2 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br label %for.body10.us101 for.body10.us101: ; preds = %for.body10.us101.preheader, %cleanup.us106 %pat.099.us102 = phi i32 [ %inc53.us108, %cleanup.us106 ], [ 1, %for.body10.us101.preheader ] %22 = call i32 @llvm.ctpop.i32(i32 %pat.099.us102), !range !20 %cmp11.not.us104 = icmp eq i32 %22, %9 br i1 %cmp11.not.us104, label %if.end.us105, label %cleanup.us106 if.end.us105: ; preds = %for.body10.us101 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %as) #8 br i1 %21, label %for.cond13.for.cond27.preheader_crit_edge.us131.unr-lcssa, label %for.body16.us110 cleanup.us106: ; preds = %for.cond13.for.cond27.preheader_crit_edge.us131, %for.body10.us101 %inc53.us108 = add nuw nsw i32 %pat.099.us102, 1 %exitcond139.not = icmp eq i32 %inc53.us108, %shl br i1 %exitcond139.not, label %for.end54, label %for.body10.us101, !llvm.loop !21 for.body16.us110: ; preds = %if.end.us105, %if.end23.us123.1 %i.192.us111 = phi i32 [ %inc25.us126.1, %if.end23.us123.1 ], [ 0, %if.end.us105 ] %bidx.091.us112 = phi i32 [ %bidx.1.us125.1, %if.end23.us123.1 ], [ 0, %if.end.us105 ] %aidx.090.us113 = phi i32 [ %aidx.1.us124.1, %if.end23.us123.1 ], [ 0, %if.end.us105 ] %niter = phi i32 [ %niter.next.1, %if.end23.us123.1 ], [ 0, %if.end.us105 ] %shl17.us114 = shl nuw i32 1, %i.192.us111 %and.us115 = and i32 %shl17.us114, %pat.099.us102 %tobool.not.us116 = icmp eq i32 %and.us115, 0 br i1 %tobool.not.us116, label %if.else.us121, label %if.then18.us117 if.then18.us117: ; preds = %for.body16.us110 %inc19.us118 = add nsw i32 %aidx.090.us113, 1 %idxprom20.us119 = sext i32 %aidx.090.us113 to i64 %arrayidx21.us120 = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us119 store i32 %bidx.091.us112, ptr %arrayidx21.us120, align 4, !tbaa !13 br label %if.end23.us123 if.else.us121: ; preds = %for.body16.us110 %inc22.us122 = add nsw i32 %bidx.091.us112, 1 br label %if.end23.us123 if.end23.us123: ; preds = %if.else.us121, %if.then18.us117 %aidx.1.us124 = phi i32 [ %inc19.us118, %if.then18.us117 ], [ %aidx.090.us113, %if.else.us121 ] %bidx.1.us125 = phi i32 [ %bidx.091.us112, %if.then18.us117 ], [ %inc22.us122, %if.else.us121 ] %inc25.us126 = or i32 %i.192.us111, 1 %shl17.us114.1 = shl nuw i32 1, %inc25.us126 %and.us115.1 = and i32 %shl17.us114.1, %pat.099.us102 %tobool.not.us116.1 = icmp eq i32 %and.us115.1, 0 br i1 %tobool.not.us116.1, label %if.else.us121.1, label %if.then18.us117.1 if.then18.us117.1: ; preds = %if.end23.us123 %inc19.us118.1 = add nsw i32 %aidx.1.us124, 1 %idxprom20.us119.1 = sext i32 %aidx.1.us124 to i64 %arrayidx21.us120.1 = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us119.1 store i32 %bidx.1.us125, ptr %arrayidx21.us120.1, align 4, !tbaa !13 br label %if.end23.us123.1 if.else.us121.1: ; preds = %if.end23.us123 %inc22.us122.1 = add nsw i32 %bidx.1.us125, 1 br label %if.end23.us123.1 if.end23.us123.1: ; preds = %if.else.us121.1, %if.then18.us117.1 %aidx.1.us124.1 = phi i32 [ %inc19.us118.1, %if.then18.us117.1 ], [ %aidx.1.us124, %if.else.us121.1 ] %bidx.1.us125.1 = phi i32 [ %bidx.1.us125, %if.then18.us117.1 ], [ %inc22.us122.1, %if.else.us121.1 ] %inc25.us126.1 = add nuw nsw i32 %i.192.us111, 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.cond13.for.cond27.preheader_crit_edge.us131.unr-lcssa, label %for.body16.us110, !llvm.loop !23 for.cond13.for.cond27.preheader_crit_edge.us131.unr-lcssa: ; preds = %if.end23.us123.1, %if.end.us105 %i.192.us111.unr = phi i32 [ 0, %if.end.us105 ], [ %inc25.us126.1, %if.end23.us123.1 ] %bidx.091.us112.unr = phi i32 [ 0, %if.end.us105 ], [ %bidx.1.us125.1, %if.end23.us123.1 ] %aidx.090.us113.unr = phi i32 [ 0, %if.end.us105 ], [ %aidx.1.us124.1, %if.end23.us123.1 ] br i1 %lcmp.mod.not, label %for.cond13.for.cond27.preheader_crit_edge.us131, label %for.body16.us110.epil for.body16.us110.epil: ; preds = %for.cond13.for.cond27.preheader_crit_edge.us131.unr-lcssa %shl17.us114.epil = shl nuw i32 1, %i.192.us111.unr %and.us115.epil = and i32 %shl17.us114.epil, %pat.099.us102 %tobool.not.us116.epil = icmp eq i32 %and.us115.epil, 0 br i1 %tobool.not.us116.epil, label %for.cond13.for.cond27.preheader_crit_edge.us131, label %if.then18.us117.epil if.then18.us117.epil: ; preds = %for.body16.us110.epil %idxprom20.us119.epil = sext i32 %aidx.090.us113.unr to i64 %arrayidx21.us120.epil = getelementptr inbounds [10 x i32], ptr %as, i64 0, i64 %idxprom20.us119.epil store i32 %bidx.091.us112.unr, ptr %arrayidx21.us120.epil, align 4, !tbaa !13 br label %for.cond13.for.cond27.preheader_crit_edge.us131 for.cond13.for.cond27.preheader_crit_edge.us131: ; preds = %if.then18.us117.epil, %for.body16.us110.epil, %for.cond13.for.cond27.preheader_crit_edge.us131.unr-lcssa call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %as) #8 br label %cleanup.us106 for.end54: ; preds = %cleanup.us106, %cleanup.us, %for.body10.lr.ph.split, %for.end %ans.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.body10.lr.ph.split ], [ %ans.1.us, %cleanup.us ], [ 0, %cleanup.us106 ] %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %queries) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qs) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %limit) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #8 ret i32 0 } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.ctpop.i32(i32) #5 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 ; 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) #7 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 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 "no-trapping-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 speculatable willreturn memory(none) } attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { 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, !11, i64 12} !10 = !{!"query", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12} !11 = !{!"int", !7, i64 0} !12 = !{!10, !11, i64 8} !13 = !{!11, !11, i64 0} !14 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13, i64 12, i64 4, !13} !15 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13} !16 = !{i64 0, i64 4, !13, i64 4, i64 4, !13} !17 = !{i64 0, i64 4, !13} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.mustprogress"} !20 = !{i32 0, i32 32} !21 = distinct !{!21, !19} !22 = distinct !{!22, !19} !23 = distinct !{!23, !19}
#include <stdio.h> #include <string.h> int next_seq(int *seq, const int len, const int m) { int carry = 0, last, last_value; for (int i = len - 1; i >= 0; i--) { if (seq[i] >= m && i > 0) { seq[i] = seq[i - 1] + 1; } else if (seq[i] >= m) { carry = 1; } else { seq[i]++; last = i; last_value = seq[i]; break; } } for (int i = last + 1; i < len; i++) { seq[i] = last_value; } return carry; } int main() { int n, m, q, max = 0; int a[50] = { 0, }; int b[50] = { 0, }; int c[50] = { 0, }; int d[50] = { 0, }; int seq[11] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; scanf("%d %d %d", &n, &m, &q); for (int i = 0; i < q; i++) { scanf("%d %d %d %d", &a[i], &b[i], &c[i], &d[i]); } seq[n - 1] = 0; while (!next_seq(seq, n, m)) { int sum = 0; for (int i = 1; i <= q; i++) { if (seq[b[i - 1] - 1] - seq[a[i - 1] - 1] == c[i - 1]) sum += d[i - 1]; } /* for (int i = 0; i < n; i++) { printf("%02d ", seq[i]); } */ max = max < sum ? sum : max; //printf(" %d\n", sum); } printf("%d", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195729/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195729/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" @__const.main.seq = private unnamed_addr constant [11 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1], align 16 @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @next_seq(ptr nocapture noundef %seq, i32 noundef %len, i32 noundef %m) local_unnamed_addr #0 { entry: %cmp57 = icmp sgt i32 %len, 0 br i1 %cmp57, label %for.body.preheader, label %for.cond.cleanup22 for.body.preheader: ; preds = %entry %0 = zext i32 %len 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 ] %carry.058 = phi i32 [ 0, %for.body.preheader ], [ %carry.1, %for.inc ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom = and i64 %indvars.iv.next, 4294967295 %arrayidx = getelementptr inbounds i32, ptr %seq, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp sge i32 %1, %m %cmp2 = icmp ne i64 %indvars.iv, 1 %or.cond = and i1 %cmp2, %cmp1 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body %sub3 = add nuw i64 %indvars.iv, 4294967294 %idxprom4 = and i64 %sub3, 4294967295 %arrayidx5 = getelementptr inbounds i32, ptr %seq, i64 %idxprom4 %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %add = add nsw i32 %2, 1 store i32 %add, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %for.body br i1 %cmp1, label %for.inc, label %if.else12 if.else12: ; preds = %if.else %indvars69.le = trunc i64 %indvars.iv to i32 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 br label %cleanup for.inc: ; preds = %if.else, %if.then %carry.1 = phi i32 [ %carry.058, %if.then ], [ 1, %if.else ] %cmp = icmp ugt i64 %indvars.iv, 1 br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9 cleanup: ; preds = %for.inc, %if.else12 %carry.055 = phi i32 [ %carry.058, %if.else12 ], [ %carry.1, %for.inc ] %i.0.in53 = phi i32 [ %indvars69.le, %if.else12 ], [ 0, %for.inc ] %last_value.0 = phi i32 [ %inc, %if.else12 ], [ undef, %for.inc ] %cmp2162 = icmp slt i32 %i.0.in53, %len br i1 %cmp2162, label %for.body23.preheader, label %for.cond.cleanup22 for.body23.preheader: ; preds = %cleanup %3 = sext i32 %i.0.in53 to i64 %wide.trip.count = sext i32 %len to i64 %4 = sub nsw i64 %wide.trip.count, %3 %min.iters.check = icmp ult i64 %4, 8 br i1 %min.iters.check, label %for.body23.preheader87, label %vector.ph vector.ph: ; preds = %for.body23.preheader %n.vec = and i64 %4, -8 %ind.end = add nsw i64 %n.vec, %3 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %last_value.0, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %seq, i64 %3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 store <4 x i32> %broadcast.splat, ptr %5, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.cond.cleanup22, label %for.body23.preheader87 for.body23.preheader87: ; preds = %for.body23.preheader, %middle.block %indvars.iv70.ph = phi i64 [ %3, %for.body23.preheader ], [ %ind.end, %middle.block ] br label %for.body23 for.cond.cleanup22: ; preds = %for.body23, %middle.block, %entry, %cleanup %carry.05578 = phi i32 [ %carry.055, %cleanup ], [ 0, %entry ], [ %carry.055, %middle.block ], [ %carry.055, %for.body23 ] ret i32 %carry.05578 for.body23: ; preds = %for.body23.preheader87, %for.body23 %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body23 ], [ %indvars.iv70.ph, %for.body23.preheader87 ] %arrayidx25 = getelementptr inbounds i32, ptr %seq, i64 %indvars.iv70 store i32 %last_value.0, ptr %arrayidx25, align 4, !tbaa !5 %indvars.iv.next71 = add nsw i64 %indvars.iv70, 1 %exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup22, label %for.body23, !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: 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 %q = alloca i32, align 4 %a = alloca [50 x i32], align 16 %b = alloca [50 x i32], align 16 %c = alloca [50 x i32], align 16 %d = alloca [50 x i32], align 16 %seq = alloca [11 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #8 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %a) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %a, i8 0, i64 200, i1 false) call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %b) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %b, i8 0, i64 200, i1 false) call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %c) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %c, i8 0, i64 200, i1 false) call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %d) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %d, i8 0, i64 200, i1 false) call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %seq) #8 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(44) %seq, ptr noundef nonnull align 16 dereferenceable(44) @__const.main.seq, i64 44, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp60 = icmp sgt i32 %0, 0 br i1 %cmp60, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa59 = phi i32 [ %0, %entry ], [ %18, %for.body ] %1 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [11 x i32], ptr %seq, i64 0, i64 %idxprom8 store i32 0, ptr %arrayidx9, align 4, !tbaa !5 %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp57.i = icmp sgt i32 %1, 0 %3 = zext i32 %1 to i64 %wide.trip.count.i = zext i32 %1 to i64 %cmp13.not62 = icmp slt i32 %.lcssa59, 1 call void @llvm.assume(i1 %cmp57.i) %4 = add i32 %.lcssa59, 1 %wide.trip.count = zext i32 %4 to i64 br label %while.cond.us while.cond.us: ; preds = %for.cond.cleanup, %for.cond.cleanup14.us %max.0.us = phi i32 [ %cond.us, %for.cond.cleanup14.us ], [ 0, %for.cond.cleanup ] br label %for.body.i.us for.body.i.us: ; preds = %for.inc.i.us, %while.cond.us %indvars.iv.i.us = phi i64 [ %3, %while.cond.us ], [ %indvars.iv.next.i.us, %for.inc.i.us ] %carry.058.i.us = phi i32 [ 0, %while.cond.us ], [ %carry.1.i.us, %for.inc.i.us ] %indvars.iv.next.i.us = add nsw i64 %indvars.iv.i.us, -1 %idxprom.i.us = and i64 %indvars.iv.next.i.us, 4294967295 %arrayidx.i.us = getelementptr inbounds i32, ptr %seq, i64 %idxprom.i.us %5 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %cmp1.i.us = icmp sge i32 %5, %2 %cmp2.i.us = icmp ne i64 %indvars.iv.i.us, 1 %or.cond.i.us = and i1 %cmp2.i.us, %cmp1.i.us br i1 %or.cond.i.us, label %if.then.i.us, label %if.else.i.us if.else.i.us: ; preds = %for.body.i.us br i1 %cmp1.i.us, label %for.inc.i.us, label %if.else12.i.us if.else12.i.us: ; preds = %if.else.i.us %indvars69.le.i.us = trunc i64 %indvars.iv.i.us to i32 %inc.i.us = add nsw i32 %5, 1 store i32 %inc.i.us, ptr %arrayidx.i.us, align 4, !tbaa !5 br label %cleanup.i.us if.then.i.us: ; preds = %for.body.i.us %sub3.i.us = add nuw nsw i64 %indvars.iv.i.us, 4294967294 %idxprom4.i.us = and i64 %sub3.i.us, 4294967295 %arrayidx5.i.us = getelementptr inbounds i32, ptr %seq, i64 %idxprom4.i.us %6 = load i32, ptr %arrayidx5.i.us, align 4, !tbaa !5 %add.i.us = add nsw i32 %6, 1 store i32 %add.i.us, ptr %arrayidx.i.us, align 4, !tbaa !5 br label %for.inc.i.us for.inc.i.us: ; preds = %if.then.i.us, %if.else.i.us %carry.1.i.us = phi i32 [ %carry.058.i.us, %if.then.i.us ], [ 1, %if.else.i.us ] %cmp.i.us = icmp ugt i64 %indvars.iv.i.us, 1 br i1 %cmp.i.us, label %for.body.i.us, label %cleanup.i.us, !llvm.loop !9 cleanup.i.us: ; preds = %for.inc.i.us, %if.else12.i.us %carry.055.i.us = phi i32 [ %carry.058.i.us, %if.else12.i.us ], [ %carry.1.i.us, %for.inc.i.us ] %i.0.in53.i.us = phi i32 [ %indvars69.le.i.us, %if.else12.i.us ], [ 0, %for.inc.i.us ] %last_value.0.i.us = phi i32 [ %inc.i.us, %if.else12.i.us ], [ undef, %for.inc.i.us ] %cmp2162.i.us = icmp slt i32 %i.0.in53.i.us, %1 br i1 %cmp2162.i.us, label %for.body23.preheader.i.us, label %next_seq.exit.us for.body23.preheader.i.us: ; preds = %cleanup.i.us %7 = sext i32 %i.0.in53.i.us to i64 %8 = sub nsw i64 %3, %7 %min.iters.check = icmp ult i64 %8, 8 br i1 %min.iters.check, label %for.body23.i.us.preheader, label %vector.ph vector.ph: ; preds = %for.body23.preheader.i.us %n.vec = and i64 %8, -8 %ind.end = add nsw i64 %n.vec, %7 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %last_value.0.i.us, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %seq, i64 %7 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %gep, i64 4 store <4 x i32> %broadcast.splat, ptr %9, align 4, !tbaa !5 %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 !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %8, %n.vec br i1 %cmp.n, label %next_seq.exit.us, label %for.body23.i.us.preheader for.body23.i.us.preheader: ; preds = %for.body23.preheader.i.us, %middle.block %indvars.iv70.i.us.ph = phi i64 [ %7, %for.body23.preheader.i.us ], [ %ind.end, %middle.block ] br label %for.body23.i.us for.body23.i.us: ; preds = %for.body23.i.us.preheader, %for.body23.i.us %indvars.iv70.i.us = phi i64 [ %indvars.iv.next71.i.us, %for.body23.i.us ], [ %indvars.iv70.i.us.ph, %for.body23.i.us.preheader ] %arrayidx25.i.us = getelementptr inbounds i32, ptr %seq, i64 %indvars.iv70.i.us store i32 %last_value.0.i.us, ptr %arrayidx25.i.us, align 4, !tbaa !5 %indvars.iv.next71.i.us = add nsw i64 %indvars.iv70.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next71.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %next_seq.exit.us, label %for.body23.i.us, !llvm.loop !16 next_seq.exit.us: ; preds = %for.body23.i.us, %middle.block, %cleanup.i.us %tobool.not.us = icmp eq i32 %carry.055.i.us, 0 br i1 %tobool.not.us, label %for.cond12.preheader.us, label %while.end for.body15.us: ; preds = %for.cond12.preheader.us, %for.inc36.us %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.inc36.us ], [ 1, %for.cond12.preheader.us ] %sum.063.us = phi i32 [ %sum.1.us, %for.inc36.us ], [ 0, %for.cond12.preheader.us ] %11 = add nsw i64 %indvars.iv81, -1 %arrayidx18.us = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %11 %12 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %sub19.us = add nsw i32 %12, -1 %idxprom20.us = sext i32 %sub19.us to i64 %arrayidx21.us = getelementptr inbounds [11 x i32], ptr %seq, i64 0, i64 %idxprom20.us %13 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5 %arrayidx24.us = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %11 %14 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5 %sub25.us = add nsw i32 %14, -1 %idxprom26.us = sext i32 %sub25.us to i64 %arrayidx27.us = getelementptr inbounds [11 x i32], ptr %seq, i64 0, i64 %idxprom26.us %15 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5 %sub28.us = sub nsw i32 %13, %15 %arrayidx31.us = getelementptr inbounds [50 x i32], ptr %c, i64 0, i64 %11 %16 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5 %cmp32.us = icmp eq i32 %sub28.us, %16 br i1 %cmp32.us, label %if.then.us, label %for.inc36.us if.then.us: ; preds = %for.body15.us %arrayidx35.us = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %11 %17 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %add.us = add nsw i32 %17, %sum.063.us br label %for.inc36.us for.inc36.us: ; preds = %if.then.us, %for.body15.us %sum.1.us = phi i32 [ %add.us, %if.then.us ], [ %sum.063.us, %for.body15.us ] %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 %for.cond.cleanup14.us, label %for.body15.us, !llvm.loop !17 for.cond.cleanup14.us: ; preds = %for.inc36.us, %for.cond12.preheader.us %sum.0.lcssa.us = phi i32 [ 0, %for.cond12.preheader.us ], [ %sum.1.us, %for.inc36.us ] %cond.us = call i32 @llvm.smax.i32(i32 %max.0.us, i32 %sum.0.lcssa.us) br label %while.cond.us, !llvm.loop !18 for.cond12.preheader.us: ; preds = %next_seq.exit.us br i1 %cmp13.not62, label %for.cond.cleanup14.us, label %for.body15.us for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [50 x i32], ptr %c, i64 0, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %18 = load i32, ptr %q, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp = icmp slt i64 %indvars.iv.next, %19 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 while.end: ; preds = %next_seq.exit.us %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.us) call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %seq) #8 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %d) #8 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %c) #8 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %b) #8 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %a) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 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) #3 ; Function Attrs: mustprogress 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 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #7 attributes #0 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #8 = { 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, !12, !13} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> int main(void) { //変数の宣言 int n; int p[100010]; int i; int count=0; //データの読み込み scanf("%d",&n); for(i=1;i<n+1;i++){ scanf("%d",&p[i]); } // printf("nは%dです\n", n); // printf("データの読み込み終了\n"); //実際の処理 i=1; while(i<n+1){ if(p[i]==i){ count++; i++; } i++; } // printf("計算部分終了\n"); //出力 printf("%d",count); // printf("結果の出力終了\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195772/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: %n = alloca i32, align 4 %p = alloca [100010 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %p) #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.not19 = icmp slt i32 %0, 1 br i1 %cmp.not19, label %while.end, label %for.body while.cond.preheader: ; preds = %for.body %cmp3.not21 = icmp slt i32 %1, 1 br i1 %cmp3.not21, label %while.end, label %while.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100010 x i32], ptr %p, 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 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %while.body %count.023 = phi i32 [ %count.1, %while.body ], [ 0, %while.cond.preheader ] %i.122 = phi i32 [ %inc9, %while.body ], [ 1, %while.cond.preheader ] %idxprom4 = sext i32 %i.122 to i64 %arrayidx5 = getelementptr inbounds [100010 x i32], ptr %p, i64 0, i64 %idxprom4 %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %3, %i.122 %inc8 = zext i1 %cmp6 to i32 %count.1 = add nuw nsw i32 %count.023, %inc8 %i.2 = add i32 %i.122, 1 %inc9 = add i32 %i.2, %inc8 %cmp3.not = icmp sgt i32 %inc9, %1 br i1 %cmp3.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry, %while.cond.preheader %count.0.lcssa = phi i32 [ 0, %while.cond.preheader ], [ 0, %entry ], [ %count.1, %while.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %p) #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a<b)&&(b<c)) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195815/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195815/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(a<b&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195859/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195859/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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %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) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a , b , c; scanf("%d %d %d\n", &a, &b, &c); if(a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195901/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195901/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 %d\0A\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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(0<=a&&a<=100){ if(0<=b&&b<=100){ if(0<=c&&c<=100){ if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195945/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195945/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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %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) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4 %or.cond = icmp ult i32 %0, 101 br i1 %or.cond, label %if.then, label %if.end20 if.then: ; preds = %entry %1 = load i32, ptr %b, align 4 %or.cond21 = icmp ult i32 %1, 101 br i1 %or.cond21, label %if.then7, label %if.end20 if.then7: ; preds = %if.then %2 = load i32, ptr %c, align 4 %or.cond22 = icmp ult i32 %2, 101 br i1 %or.cond22, label %if.then11, label %if.end20 if.then11: ; preds = %if.then7 %cmp12 = icmp ult i32 %0, %1 %cmp14 = icmp ult i32 %1, %2 %or.cond26 = and i1 %cmp12, %cmp14 %str.3.str = select i1 %or.cond26, ptr @str.3, ptr @str %puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) br label %if.end20 if.end20: ; preds = %if.then11, %if.then, %if.then7, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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)"}
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195996/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195996/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d", &a, &b, &c); if(a < b && b < c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196038/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196038/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196081/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196081/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b){ if(b<c){ printf("Yes\n"); } else{ printf("No\n"); } } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196124/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196124/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 @str.3 = 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 no_a, no_b,no_c; scanf("%d %d %d", &no_a, &no_b,&no_c); if (no_a < no_b&&no_b<no_c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196168/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196168/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 @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: %no_a = alloca i32, align 4 %no_b = alloca i32, align 4 %no_c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no_a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no_b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no_c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no_a, ptr noundef nonnull %no_b, ptr noundef nonnull %no_c) %0 = load i32, ptr %no_a, align 4, !tbaa !5 %1 = load i32, ptr %no_b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %no_c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %no_c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no_b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no_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"}
#include<stdio.h> int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if((a<b)&&(b<c)) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196210/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196210/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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> #include<stdlib.h> int main() { int i,k,a,b,c; char number[3][100]; i = 0; k = 0; while((c = getchar()) != EOF) { if(c == ' ') { k++; i = 0; }else{ number[k][i] = c; i++; } } a = atoi(number[0]); b = atoi(number[1]); c = atoi(number[2]); if(a < b && b < c) { printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196254/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196254/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" @stdin = external local_unnamed_addr global ptr, align 8 @str = 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: %number = alloca [3 x [100 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 300, ptr nonnull %number) #5 br label %while.cond.outer while.cond.outer: ; preds = %if.then, %entry %k.0.ph = phi i32 [ %inc, %if.then ], [ 0, %entry ] %idxprom = zext i32 %k.0.ph to i64 br label %while.cond while.cond: ; preds = %while.cond.outer, %if.else %i.0 = phi i32 [ %inc4, %if.else ], [ 0, %while.cond.outer ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) switch i32 %call.i, label %if.else [ i32 -1, label %while.end i32 32, label %if.then ] if.then: ; preds = %while.cond %inc = add nuw nsw i32 %k.0.ph, 1 br label %while.cond.outer, !llvm.loop !9 if.else: ; preds = %while.cond %conv = trunc i32 %call.i to i8 %idxprom2 = zext i32 %i.0 to i64 %arrayidx3 = getelementptr inbounds [3 x [100 x i8]], ptr %number, i64 0, i64 %idxprom, i64 %idxprom2 store i8 %conv, ptr %arrayidx3, align 1, !tbaa !11 %inc4 = add nuw nsw i32 %i.0, 1 br label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %call.i28 = call i64 @strtol(ptr nocapture noundef nonnull %number, ptr noundef null, i32 noundef 10) #5 %conv.i = trunc i64 %call.i28 to i32 %arrayidx7 = getelementptr inbounds [3 x [100 x i8]], ptr %number, i64 0, i64 1 %call.i29 = call i64 @strtol(ptr nocapture noundef nonnull %arrayidx7, ptr noundef null, i32 noundef 10) #5 %conv.i30 = trunc i64 %call.i29 to i32 %cmp13 = icmp slt i32 %conv.i, %conv.i30 br i1 %cmp13, label %land.lhs.true, label %if.else19 land.lhs.true: ; preds = %while.end %arrayidx10 = getelementptr inbounds [3 x [100 x i8]], ptr %number, i64 0, i64 2 %call.i31 = call i64 @strtol(ptr nocapture noundef nonnull %arrayidx10, ptr noundef null, i32 noundef 10) #5 %conv.i32 = trunc i64 %call.i31 to i32 %cmp15 = icmp slt i32 %conv.i30, %conv.i32 br i1 %cmp15, label %if.end21, label %if.else19 if.else19: ; preds = %land.lhs.true, %while.end br label %if.end21 if.end21: ; preds = %land.lhs.true, %if.else19 %str.sink = phi ptr [ @str, %if.else19 ], [ @str.2, %land.lhs.true ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %number) #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: 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 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #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 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 #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 = !{!"any pointer", !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}
#include <stdio.h> int main(void) { int a; int b; int c; scanf("%d %d %d", &a, &b, &c); if(a < b && b < c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196298/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196298/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a, b, c; scanf ("%d%d%d", &a, &b, &c); if (a < b && b < c){ printf ("Yes\n"); } else { printf ("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196348/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196348/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 = 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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b && b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196391/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a>=b){ printf("No\n"); }else if(b>=c){ printf("No\n"); }else if(a>=c){ printf("No\n"); }else{ printf("Yes\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196434/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 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.5 = 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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %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 %2 = load i32, ptr %c, align 4 %cmp2.not = icmp slt i32 %1, %2 %str.str.4 = select i1 %cmp2.not, ptr @str, ptr @str.5 %str.4.sink = select i1 %cmp.not, ptr %str.str.4, ptr @str.5 %puts16 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&a<c&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196478/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196478/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp slt i32 %0, %2 %cmp3 = icmp slt i32 %1, %2 %or.cond = and i1 %cmp1, %cmp3 br i1 %or.cond, label %if.end, label %if.else if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b && b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196520/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196520/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a, b, c; scanf("%d %d %d", &a, &b, &c); if (a < b){ if (b < c) printf("Yes\n"); else printf("No\n"); } else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196571/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196571/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 @str.3 = 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b && b < c){ printf("Yes\n"); } else if(a >= b || b >= c){ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196614/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196614/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b && b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196665/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196665/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a=0; int b=0; int c=0; printf(""); scanf("%d %d %d",&a,&b,&c); while(1){ if(a>=0 && a<=100 && b>=0 && b<=100 && c>=0 && c<=100){ break; }else{ printf(""); scanf("%d %d",&a,&b); continue; } } if(a<b && b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196708/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196708/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.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\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: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 store i32 0, ptr %a, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 store i32 0, ptr %b, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 store i32 0, ptr %c, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4 %or.cond29 = icmp ult i32 %0, 101 %1 = load i32, ptr %b, align 4 %cmp430 = icmp sgt i32 %1, -1 %or.cond2031 = select i1 %or.cond29, i1 %cmp430, i1 false %cmp632 = icmp slt i32 %1, 101 %or.cond2133 = select i1 %or.cond2031, i1 %cmp632, i1 false %2 = load i32, ptr %c, align 4 %cmp834 = icmp sgt i32 %2, -1 %or.cond2235 = select i1 %or.cond2133, i1 %cmp834, i1 false %cmp1036 = icmp slt i32 %2, 101 %or.cond2337 = select i1 %or.cond2235, i1 %cmp1036, i1 false br i1 %or.cond2337, label %while.end, label %if.else if.else: ; preds = %entry, %if.else %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i32, ptr %a, align 4 %or.cond = icmp ult i32 %3, 101 %4 = load i32, ptr %b, align 4 %cmp4 = icmp sgt i32 %4, -1 %or.cond20 = select i1 %or.cond, i1 %cmp4, i1 false %cmp6 = icmp slt i32 %4, 101 %or.cond21 = select i1 %or.cond20, i1 %cmp6, i1 false %5 = load i32, ptr %c, align 4 %cmp8 = icmp sgt i32 %5, -1 %or.cond22 = select i1 %or.cond21, i1 %cmp8, i1 false %cmp10 = icmp slt i32 %5, 101 %or.cond23 = select i1 %or.cond22, i1 %cmp10, i1 false br i1 %or.cond23, label %while.end, label %if.else while.end: ; preds = %if.else, %entry %.lcssa28 = phi i32 [ %0, %entry ], [ %3, %if.else ] %.lcssa27 = phi i32 [ %1, %entry ], [ %4, %if.else ] %.lcssa = phi i32 [ %2, %entry ], [ %5, %if.else ] %cmp13 = icmp ult i32 %.lcssa28, %.lcssa27 %cmp15 = icmp ult i32 %.lcssa27, %.lcssa %or.cond26 = select i1 %cmp13, i1 %cmp15, i1 false %str.5.str = select i1 %or.cond26, ptr @str.5, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a,b,c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(a>=b){ printf("No\n"); }else if(b>=c){ printf("No\n"); }else{ printf("Yes\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196751/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196751/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.4 = 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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %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) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %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 %2 = load i32, ptr %c, align 4 %cmp4.not = icmp slt i32 %1, %2 %str.str.3 = select i1 %cmp4.not, ptr @str, ptr @str.4 %str.3.sink = select i1 %cmp.not, ptr %str.str.3, ptr @str.4 %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a,b,c ; scanf("%d %d %d \n",&a,&b,&c); if(a<b && b<c){ printf("Yes\n") ;} else{ printf("No\n") ; } return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196795/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196795/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"%d %d %d \0A\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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196838/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196889/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196889/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if (a<b&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196931/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196931/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a, b, c; scanf("%d %d %d", &a, &b, &c); if(a < b && b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196982/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196982/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d", &a,&b,&c); if(a < b && b < c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197024/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197024/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b&&b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197075/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197075/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b&&b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197125/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197125/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a>=0 && b>=0 && c>=0 && a<=100 && b<=100 && c<=100) { if(a<b && b<c)printf("Yes\n"); else printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197176/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197176/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4 %cmp = icmp sgt i32 %0, -1 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, -1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %2 = load i32, ptr %c, align 4 %cmp3 = icmp sgt i32 %2, -1 %or.cond17 = select i1 %or.cond, i1 %cmp3, i1 false %cmp5 = icmp slt i32 %0, 101 %or.cond18 = and i1 %cmp5, %or.cond17 %cmp7 = icmp slt i32 %1, 101 %or.cond19 = select i1 %or.cond18, i1 %cmp7, i1 false %cmp9 = icmp slt i32 %2, 101 %or.cond20 = select i1 %or.cond19, i1 %cmp9, i1 false br i1 %or.cond20, label %if.then, label %if.end16 if.then: ; preds = %entry %cmp10 = icmp ult i32 %0, %1 %cmp12 = icmp ult i32 %1, %2 %or.cond24 = select i1 %cmp10, i1 %cmp12, i1 false %str.3.str = select i1 %or.cond24, ptr @str.3, ptr @str %puts23 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) br label %if.end16 if.end16: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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)"}
#include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197219/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197219/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 = 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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c){ printf("Yes\n"); } else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197262/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197262/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b){ if(b<c){ printf("Yes\n"); }else{ printf("No\n"); }}else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197305/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197305/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 @str.3 = 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 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: 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 a, b, c, hantei; hantei = 1; scanf("%d %d %d", &a, &b, &c); if ( (a >= b) || (b >= c) || (a >= c) ) { hantei = 0; } if (hantei == 1) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197363/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197363/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %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 %2 = load i32, ptr %c, align 4 %cmp1.not = icmp slt i32 %1, %2 %or.cond = select i1 %cmp.not, i1 %cmp1.not, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b && b<c)puts("Yes"); else puts("No"); return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197406/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197406/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 @.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: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 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 @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 n,b; scanf("%d",&n); if(n<10) b=n; else if(n>=10&&n<=189) { n-=9; if(n%2) { b=n/20+1; } else b=(n/2-1)%10; } else { n-=189; if(n%3==0) b=(n/3-1)%10; else if(n%3==1) b=n/300+1; else b=n/30%10; } printf("%d",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19745/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19745/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: %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 %cmp = icmp slt i32 %0, 10 br i1 %cmp, label %if.end29, label %if.else if.else: ; preds = %entry %cmp2 = icmp ult i32 %0, 190 br i1 %cmp2, label %if.then3, label %if.else9 if.then3: ; preds = %if.else %sub = add nsw i32 %0, -9 store i32 %sub, ptr %n, align 4, !tbaa !5 %rem = and i32 %sub, 1 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %if.else5, label %if.then4 if.then4: ; preds = %if.then3 %div.lhs.trunc = trunc i32 %sub to i8 %div33 = udiv i8 %div.lhs.trunc, 20 %narrow = add nuw nsw i8 %div33, 1 %add = zext i8 %narrow to i32 br label %if.end29 if.else5: ; preds = %if.then3 %div631 = lshr i32 %sub, 1 %1 = trunc i32 %div631 to i8 %rem8.lhs.trunc = add nsw i8 %1, -1 %rem832 = srem i8 %rem8.lhs.trunc, 10 %rem8.sext = sext i8 %rem832 to i32 br label %if.end29 if.else9: ; preds = %if.else %sub10 = add nsw i32 %0, -189 store i32 %sub10, ptr %n, align 4, !tbaa !5 %rem11 = urem i32 %sub10, 3 %div14 = udiv i32 %sub10, 3 switch i32 %rem11, label %if.else23 [ i32 0, label %if.then13 i32 1, label %if.then20 ] if.then13: ; preds = %if.else9 %sub15 = add nsw i32 %div14, -1 %rem16 = srem i32 %sub15, 10 br label %if.end29 if.then20: ; preds = %if.else9 %div21 = udiv i32 %sub10, 300 %add22 = add nuw nsw i32 %div21, 1 br label %if.end29 if.else23: ; preds = %if.else9 %div24 = udiv i32 %sub10, 30 %rem25 = urem i32 %div24, 10 br label %if.end29 if.end29: ; preds = %entry, %if.else5, %if.then4, %if.then20, %if.else23, %if.then13 %b.0 = phi i32 [ %add, %if.then4 ], [ %rem8.sext, %if.else5 ], [ %rem16, %if.then13 ], [ %add22, %if.then20 ], [ %rem25, %if.else23 ], [ %0, %entry ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %b.0) 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(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197493/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf("%d %d %d",&a ,&b ,&c); if((a<b)&&(b<c)){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197536/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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> #include<math.h> int main( ) { int n,i,j,k,l=0; scanf("%d",&n); if(n<10) { printf("%d\n",(n%10)); } else if((n>=10)&&(n<190)) { k=n-9; // printf("k is %d\n",k); if(k%2==1) { l=(k/2)+1; } else { l=k/2; } if(n%2==0) { printf("%d\n",((9+l)/10)); } else { printf("%d\n",((9+l)%10)); } } else if(190<=n<=1000) { k=(n-189); if((k%3)>0) { l=(k/3)+1; // printf("%d\n",l); } else { l=(k/3); } if(k%3==1) { printf("%d\n",((99+l)/100)); } else if(k%3==2) { printf("%d\n",(((99+l)/10)%10)); } else if(k%3==0) { printf("%d\n",((99+l)%10)); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19758/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19758/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) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4 %cmp = icmp slt i32 %0, 10 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %rem = srem i32 %0, 10 br label %if.end65.sink.split if.else: ; preds = %entry %cmp3 = icmp ult i32 %0, 190 br i1 %cmp3, label %if.then4, label %if.then25 if.then4: ; preds = %if.else %sub = add nsw i32 %0, -9 %rem5 = and i32 %sub, 1 %div79 = lshr i32 %sub, 1 %l.0 = add nuw nsw i32 %div79, %rem5 %1 = and i32 %0, 1 %cmp11 = icmp eq i32 %1, 0 %2 = trunc i32 %l.0 to i8 %div14.lhs.trunc = add nuw nsw i8 %2, 9 %div1482 = udiv i8 %div14.lhs.trunc, 10 %rem1883 = urem i8 %div14.lhs.trunc, 10 br i1 %cmp11, label %if.then12, label %if.else16 if.then12: ; preds = %if.then4 %div14.zext = zext i8 %div1482 to i32 br label %if.end65.sink.split if.else16: ; preds = %if.then4 %rem18.zext = zext i8 %rem1883 to i32 br label %if.end65.sink.split if.then25: ; preds = %if.else %sub26 = add nsw i32 %0, -189 %rem27 = urem i32 %sub26, 3 %div34 = udiv i32 %sub26, 3 switch i32 %rem27, label %if.end65 [ i32 0, label %if.end35.thread i32 1, label %if.then39 i32 2, label %if.then47 ] if.end35.thread: ; preds = %if.then25 %add57 = add nuw nsw i32 %div34, 99 %rem58 = urem i32 %add57, 10 br label %if.end65.sink.split if.then39: ; preds = %if.then25 %add40 = add nuw nsw i32 %div34, 100 %div41 = udiv i32 %add40, 100 br label %if.end65.sink.split if.then47: ; preds = %if.then25 %add48 = add nuw nsw i32 %div34, 100 %div49 = udiv i32 %add48, 10 %rem50 = urem i32 %div49, 10 br label %if.end65.sink.split if.end65.sink.split: ; preds = %if.then, %if.then47, %if.end35.thread, %if.then39, %if.then12, %if.else16 %rem18.zext.sink = phi i32 [ %rem18.zext, %if.else16 ], [ %div14.zext, %if.then12 ], [ %div41, %if.then39 ], [ %rem58, %if.end35.thread ], [ %rem50, %if.then47 ], [ %rem, %if.then ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem18.zext.sink) br label %if.end65 if.end65: ; preds = %if.end65.sink.split, %if.then25 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)"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define pi 3.1415926 int main() { //int p = 1000; //int s, n; //for (s=1;s<p;++s) //{ // n = s; int n; scanf("%d", &n); int i, k, remain, results; if (n<10) { printf("%d",n); //continue; return 0; } if (n<190) { n = n - 9; k = n / 2; remain = n%2; results = 10 + k; if (!remain) { results -= 1; } if (remain) { for (i=0;i<(2-remain);++i) { results = results/10; } } results = results%10; printf("%d", results); //continue; return 0; } if (n<2701) { n = n - 189; k = n / 3; remain = n%3; results = 100 + k; if (!remain) { results -= 1; } if (remain) { for (i=0;i<(3-remain);++i) { results = results/10; } } results = results%10; printf("%d", results); //continue; return 0; } // n = n - 329; // k = n / 4; // remain = n%4; // results = 1000 + k; // if (!remain) // { // results -= 1; // } // if (remain) // { // for (i=0;i<(4-remain);++i) // { // results = results/10; // } // } // results = results%10; // printf("%d", results); // continue; // return 0; // } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19763/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19763/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: %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 slt i32 %0, 10 br i1 %cmp, label %cleanup.sink.split, label %if.end if.end: ; preds = %entry %cmp2 = icmp ult i32 %0, 190 br i1 %cmp2, label %if.then3, label %if.end15 if.then3: ; preds = %if.end %sub = add nsw i32 %0, -9 store i32 %sub, ptr %n, align 4, !tbaa !5 %div60 = lshr i32 %sub, 1 %rem = and i32 %sub, 1 %tobool.not = icmp eq i32 %rem, 0 %sub5 = add nuw nsw i32 %div60, 9 %1 = trunc i32 %div60 to i8 %div11.lhs.trunc = add i8 %1, 10 %div1168 = udiv i8 %div11.lhs.trunc, 10 %div11.zext = zext i8 %div1168 to i32 %results.2 = select i1 %tobool.not, i32 %sub5, i32 %div11.zext %rem13.lhs.trunc = trunc i32 %results.2 to i8 %rem1369 = urem i8 %rem13.lhs.trunc, 10 %rem13.zext = zext i8 %rem1369 to i32 br label %cleanup.sink.split if.end15: ; preds = %if.end %cmp16 = icmp ult i32 %0, 2701 br i1 %cmp16, label %if.then17, label %cleanup if.then17: ; preds = %if.end15 %sub18 = add nsw i32 %0, -189 store i32 %sub18, ptr %n, align 4, !tbaa !5 %div19.lhs.trunc = trunc i32 %sub18 to i16 %div1962 = udiv i16 %div19.lhs.trunc, 3 %div19.zext = zext i16 %div1962 to i32 %rem2063 = urem i16 %div19.lhs.trunc, 3 %tobool22.not = icmp eq i16 %rem2063, 0 %sub24 = add nuw nsw i32 %div19.zext, 99 br i1 %tobool22.not, label %if.end36, label %for.cond28.preheader for.cond28.preheader: ; preds = %if.then17 %add21 = add nuw nsw i32 %div19.zext, 100 %2 = xor i16 %rem2063, 3 %cmp3064.not = icmp eq i16 %2, 0 br i1 %cmp3064.not, label %if.end36, label %for.body31 for.body31: ; preds = %for.cond28.preheader %div32 = udiv i32 %add21, 10 %exitcond.not = icmp eq i16 %2, 1 br i1 %exitcond.not, label %if.end36, label %for.body31.1, !llvm.loop !9 for.body31.1: ; preds = %for.body31 %div32.1 = udiv i32 %add21, 100 %exitcond.not.1 = icmp eq i16 %2, 2 br i1 %exitcond.not.1, label %if.end36, label %for.body31.2, !llvm.loop !9 for.body31.2: ; preds = %for.body31.1 %div32.2 = udiv i32 %add21, 1000 br label %if.end36 if.end36: ; preds = %for.body31, %for.body31.1, %for.body31.2, %for.cond28.preheader, %if.then17 %results.5 = phi i32 [ %sub24, %if.then17 ], [ %add21, %for.cond28.preheader ], [ %div32, %for.body31 ], [ %div32.1, %for.body31.1 ], [ %div32.2, %for.body31.2 ] %rem37 = srem i32 %results.5, 10 br label %cleanup.sink.split cleanup.sink.split: ; preds = %entry, %if.then3, %if.end36 %rem37.sink = phi i32 [ %rem37, %if.end36 ], [ %rem13.zext, %if.then3 ], [ %0, %entry ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem37.sink) br label %cleanup cleanup: ; preds = %cleanup.sink.split, %if.end15 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197673/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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 a,b,c; scanf( "%d %d %d", &a, &b, &c); if( a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197716/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 @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 %b = alloca i32, align 4 %c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %c) #4 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: 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"}