Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int main(void){ // Your code here! int a,b; double t; scanf("%d %d %lf",&a,&b,&t); int make = (t + 0.5) / a; printf("%d",b*make); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292259/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292259/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 %lf\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 %t = alloca double, align 8 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 8, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t) %0 = load double, ptr %t, align 8, !tbaa !5 %add = fadd double %0, 5.000000e-01 %1 = load i32, ptr %a, align 4, !tbaa !9 %conv = sitofp i32 %1 to double %div = fdiv double %add, %conv %conv1 = fptosi double %div to i32 %2 = load i32, ptr %b, align 4, !tbaa !9 %mul = mul nsw i32 %2, %conv1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #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 @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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0}
#include <stdio.h> int main(){ int a,b,c; int total = 0; scanf("%d %d %d",&a,&b,&c); for (int i=0;i<c+0.5;i++){ if(i%a == 0 && i != 0){ total += b; } } printf("%d\n",total); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292301/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292301/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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %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 %c, align 4, !tbaa !5 %conv1 = sitofp i32 %0 to double %add = fadd double %conv1, 5.000000e-01 %cmp13 = fcmp ogt double %add, 0.000000e+00 br i1 %cmp13, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %total.0.lcssa = phi i32 [ 0, %entry ], [ %total.1, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %total.0.lcssa) 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 for.body: ; preds = %for.body.lr.ph, %for.body %i.015 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %total.014 = phi i32 [ 0, %for.body.lr.ph ], [ %total.1, %for.body ] %rem = srem i32 %i.015, %1 %cmp3 = icmp eq i32 %rem, 0 %cmp5 = icmp ne i32 %i.015, 0 %or.cond = and i1 %cmp5, %cmp3 %add7 = select i1 %or.cond, i32 %2, i32 0 %total.1 = add nsw i32 %add7, %total.014 %inc = add nuw nsw i32 %i.015, 1 %conv = sitofp i32 %inc to double %cmp = fcmp ogt double %add, %conv br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; 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 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,T,i=1,sum=0; scanf("%d",&A); scanf("%d",&B); scanf("%d",&T); while((float)i*A<(float)T +0.5){ sum=sum+B; i++; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292345/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292345/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: %A = alloca i32, align 4 %B = alloca i32, align 4 %T = 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 %T) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %A, align 4, !tbaa !5 %conv3 = sitofp i32 %0 to float %1 = load i32, ptr %T, align 4, !tbaa !5 %conv5 = sitofp i32 %1 to float %conv6 = fpext float %conv5 to double %add = fadd double %conv6, 5.000000e-01 %conv412 = fpext float %conv3 to double %cmp13 = fcmp ogt double %add, %conv412 br i1 %cmp13, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %2 = load i32, ptr %B, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %sum.015 = phi i32 [ 0, %while.body.lr.ph ], [ %add8, %while.body ] %i.014 = phi i32 [ 1, %while.body.lr.ph ], [ %inc, %while.body ] %add8 = add nsw i32 %2, %sum.015 %inc = add nuw nsw i32 %i.014, 1 %conv = sitofp i32 %inc to float %mul = fmul float %conv, %conv3 %conv4 = fpext float %mul to double %cmp = fcmp ogt double %add, %conv4 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add8, %while.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #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 @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,t; scanf("%d %d %d",&a,&b,&t); int ans = (t/a) * b; printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292396/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292396/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 [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 %t = 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 %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %2 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %2, %div %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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 @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"}
#if 0 cat <<EOF >mistaken-paste #endif // thx Ebi-chan! #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 2000000000000007LL #define MOD 1000000007 #define FOD 998244353 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 1048576 #ifdef __cplusplus #include <queue> #include <stack> #include <tuple> #include <set> #include <map> #include <string> #include <algorithm> #include <functional> #include <array> using std::queue; using std::priority_queue; using std::stack; using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; using std::string; using std::get; template <typename T, typename U> pair<T, U> operator+(pair<T, U> l, pair<T, U> r) { return pair<T, U>(l.first + r.first, l.second + r.second); } #endif typedef struct { sll a; sll b; } hwll; typedef struct { sll a; sll b; sll c; } hwllc; typedef struct { hwll a; hwll b; } linell; typedef struct { double a; double b; } hwreal; ull n, m; ull h, w; ull k; ull q; sll va, vb, vc, vd, ve, vf; ull ua, ub, uc, ud, ue, uf; long double vra, vrb, vrc; double vda, vdb, vdc; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #define BEGCMP(NAME) int32_t NAME (const void *left, const void *right) #define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right #define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1 // int32_t pullcomp (const void *left, const void *right) { // ull l = *(ull*)left; // ull r = *(ull*)right; // if (l < r) { // return -1; // } // if (l > r) { // return +1; // } // return 0; // } BEGCMP(pullcomp){ DEFLR(ull); CMPRET(l, r); return 0; } BEGCMP(prevcomp){ DEFLR(sll); CMPRET(r, l); return 0; } BEGCMP(psllcomp){ DEFLR(sll); CMPRET(l, r); return 0; } BEGCMP(pcharcomp){ DEFLR(char); CMPRET(l, r); return 0; } BEGCMP(pdoublecomp){ DEFLR(double); CMPRET(l, r); return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } BEGCMP(phwllABcomp){ DEFLR(hwll); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } BEGCMP(phwllREVcomp){ DEFLR(hwll); CMPRET(l.b, r.b); CMPRET(l.a, r.a); return 0; } BEGCMP(ptriplecomp){ DEFLR(hwllc); CMPRET(l.a, r.a); CMPRET(l.b, r.b); CMPRET(l.c, r.c); return 0; } BEGCMP(ptripleREVcomp){ DEFLR(hwllc); CMPRET(l.b, r.b); CMPRET(l.a, r.a); CMPRET(l.c, r.c); return 0; } BEGCMP(phwrealcomp){ DEFLR(hwreal); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } int32_t pquadcomp (const void *left, const void *right) { linell l = *(linell*)left; linell r = *(linell*)right; sll ac = phwllABcomp(&(l.a), &(r.a)); if (ac) return ac; sll bc = phwllABcomp(&(l.b), &(r.b)); if (bc) return bc; return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } bool isinrange_soft (sll left, sll x, sll right) { return (left <= x && x <= right) || (left >= x && x >= right); } sll a[N_MAX + 5]; // ull a[N_MAX + 5]; // sll a[3001][3001]; sll b[N_MAX + 5]; // ull b[N_MAX + 5]; // sll b[3001][3001]; sll c[N_MAX + 5]; sll d[N_MAX + 5]; sll e[N_MAX * 4]; char s[N_MAX + 1]; // char s[3010][3010]; char t[N_MAX + 1]; // char t[3010][3010]; char u[N_MAX + 1]; hwll xy[N_MAX + 5]; hwllc tup[N_MAX + 5]; // sll table[3005][3005]; ull gin[N_MAX]; // here we go ull solve () { sll i, j, ki, li; // ull result = 0; sll result = 0; double dresult = 0; // ull maybe = 0; sll maybe = 0; // ull sum = 0; sll sum = 0; sll item; sll *dpcell; result = (k / n) * m; printf("%lld\n", result); // printf("%.15lf\n", dresult); // puts(s); return 0; success: puts("YES"); // puts("Yes"); // printf("%llu\n", result); // puts("0"); // puts("Hanako"); return 0; fail: // puts("NO"); // puts("No"); // puts("0"); puts("-1"); // puts("-1 -1 -1"); // puts("Jiro"); return 1; } int32_t main (int argc, char *argv[]) { int32_t i, j; n = 3; m = 0; // scanf("%llu%llu", &h, &w); scanf("%llu%llu", &n, &m); scanf("%llu", &k, &n, &m); // scanf("%llu%llu", &h, &w); // scanf("%llu", &q); // scanf("%s", s); // scanf("%lld%lld", &va, &vb, &vc, &vd); // scanf("%llu%llu%llu", &ua, &ub, &uc, &ud, &ue); // scanf("%s", t); // scanf("%s", u); // scanf("%llu", &k); // scanf("%lld", &m); // for (i = 0; i < n; i++) { // scanf("%lld", &a[i]); // // scanf("%lld", &d[i]); // } // scanf("%llu", &q); // for (i = 0; i < n; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c); // // scanf("%lld", &c[i]); // scanf("%lld", &a[i]); // // scanf("%lld", &b[i]); // // scanf("%lld", &c[i]); // // scanf("%lld", &d[i]); // // a[i]--; // // b[i]--; // // c[i]--; // // d[i]--; // // xy[i].a--; // // xy[i].b--; // // tup[i].a--; // // tup[i].b--; // } // for (i = 0; i < n; i++) { // // scanf("%lld%lld", &a[i], &b[i]); // scanf("%lld", &b[i]); // // a[i]--; // // b[i]--; // // scanf("%lld", &d[i]); // // scanf("%lld", &e[i]); // // d[i]--; // } // for (i = 0; i < q; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld", &c[i]); // // xy[i].a--; // // xy[i].b--; // } // for (i = 0; i < n; i++) { // for (j = 0; j < m; j++) { // scanf("%lld", &table[i][j]); // // table[i][j]--; // } // } // for (i = 0; i < n; i++) { // scanf("%s", s[i]); // } // scanf("%llu", &q); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292439/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292439/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.hwll = type { i64, i64 } %struct.hwllc = type { i64, i64, i64 } @k = dso_local global i64 0, align 8 @n = dso_local global i64 0, align 8 @m = dso_local global i64 0, align 8 @.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @q = dso_local local_unnamed_addr global i64 0, align 8 @va = dso_local local_unnamed_addr global i64 0, align 8 @vb = dso_local local_unnamed_addr global i64 0, align 8 @vc = dso_local local_unnamed_addr global i64 0, align 8 @vd = dso_local local_unnamed_addr global i64 0, align 8 @ve = dso_local local_unnamed_addr global i64 0, align 8 @vf = dso_local local_unnamed_addr global i64 0, align 8 @ua = dso_local local_unnamed_addr global i64 0, align 8 @ub = dso_local local_unnamed_addr global i64 0, align 8 @uc = dso_local local_unnamed_addr global i64 0, align 8 @ud = dso_local local_unnamed_addr global i64 0, align 8 @ue = dso_local local_unnamed_addr global i64 0, align 8 @uf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @a = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @e = dso_local local_unnamed_addr global [4194304 x i64] zeroinitializer, align 16 @s = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16 @t = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16 @u = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16 @xy = dso_local local_unnamed_addr global [1048581 x %struct.hwll] zeroinitializer, align 16 @tup = dso_local local_unnamed_addr global [1048581 x %struct.hwllc] zeroinitializer, align 16 @gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 { entry: %sub = add i64 %modulo, -2 %tobool.not12.i = icmp eq i64 %sub, 0 br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i while.body.i: ; preds = %entry, %if.end.i %result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ] %a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ] %x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ] %and.i = and i64 %x.addr.013.i, 1 %tobool1.not.i = icmp eq i64 %and.i, 0 br i1 %tobool1.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul i64 %a.addr.014.i, %result.015.i %rem.i = urem i64 %mul.i, %modulo br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ] %div11.i = lshr i64 %x.addr.013.i, 1 %mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i %rem3.i = urem i64 %mul2.i, %modulo %tobool.not.i = icmp ult i64 %x.addr.013.i, 2 br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5 bitpow.exit: ; preds = %if.end.i, %entry %result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ] %mul = mul i64 %result.0.lcssa.i, %a %rem = urem i64 %mul, %modulo ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %1, %0 %cmp1 = icmp sgt i64 %1, %0 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i8, ptr %left, align 1, !tbaa !12 %1 = load i8, ptr %right, align 1, !tbaa !12 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load double, ptr %left, align 8, !tbaa !13 %1 = load double, ptr %right, align 8, !tbaa !13 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp ogt double %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !15 %1 = load ptr, ptr %right, align 8, !tbaa !15 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = fcmp ogt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22 %l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19 %l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17 %l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24 %l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22 %r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19 %r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17 %r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24 %r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18 %cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp.i, label %cleanup10, label %if.end.i if.end.i: ; preds = %entry %cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4.i, label %cleanup10, label %if.end6.i if.end6.i: ; preds = %if.end.i %cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit phwllABcomp.exit: ; preds = %if.end6.i %cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp13.i.not, label %cleanup10, label %if.end if.end: ; preds = %phwllABcomp.exit %cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp.i21, label %cleanup10, label %if.end.i22 if.end.i22: ; preds = %if.end %cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24 if.end6.i24: ; preds = %if.end.i22 %cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26 if.end10.i26: ; preds = %if.end6.i24 %cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload %..i28 = zext i1 %cmp13.i27 to i32 br label %cleanup10 cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit %retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ] ret i32 %retval.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp = icmp sle i64 %left, %x %cmp1 = icmp sle i64 %x, %right %0 = and i1 %cmp, %cmp1 ret i1 %0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp.not = icmp sgt i64 %left, %x %cmp1.not = icmp sgt i64 %x, %right %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %lor.rhs, label %lor.end lor.rhs: ; preds = %entry %cmp2 = icmp sge i64 %left, %x %cmp3 = icmp sge i64 %x, %right %0 = and i1 %cmp2, %cmp3 br label %lor.end lor.end: ; preds = %entry, %lor.rhs %1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ] ret i1 %1 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #6 { entry: %0 = load i64, ptr @k, align 8, !tbaa !8 %1 = load i64, ptr @n, align 8, !tbaa !8 %div = udiv i64 %0, %1 %2 = load i64, ptr @m, align 8, !tbaa !8 %mul = mul i64 %2, %div %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %mul) ret i64 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #6 { entry: store i64 3, ptr @n, align 8, !tbaa !8 store i64 0, ptr @m, align 8, !tbaa !8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @k, ptr noundef nonnull @n, ptr noundef nonnull @m) %0 = load i64, ptr @k, align 8, !tbaa !8 %1 = load i64, ptr @n, align 8, !tbaa !8 %div.i = udiv i64 %0, %1 %2 = load i64, ptr @m, align 8, !tbaa !8 %mul.i = mul i64 %2, %div.i %call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %mul.i) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #8 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"long", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = !{!10, !10, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"double", !10, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !10, i64 0} !17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8} !18 = !{i64 0, i64 8, !8} !19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8} !20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13} !21 = !{i64 0, i64 8, !13} !22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
#define ll long long #define MOD 1000000007 #include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> typedef struct data { int a; int b; } data; FILE *in, *ans; int tno; int out(const char *s) { #ifdef TEST char buf[8192]; fgets(buf, sizeof(buf), ans); if (strcmp(buf, s)) { printf("err\n"); } #else printf(s); #endif return 0; } int outi(int i) { char s[128]; sprintf(s, "%d\n", i); out(s); return 0; } int outll(ll l) { char s[128]; sprintf(s, "%lld\n", l); out(s); return 0; } int geti() { int i; fscanf(in, "%d", &i); return i; } ll getll() { ll l; fscanf(in, "%lld", &l); return l; } int getstr(char *s) { fscanf(in, "%s", s); return 0; } int fnc() { int a = geti(); int b = geti(); int t = geti(); int c = t / a * b; outi(c); return 0; } int main() { #ifdef TEST for (tno = TEST_SNO; tno <= TEST_ENO; tno++) { char str[128]; sprintf(str, "test%d.txt", tno); in = fopen(str, "r"); sprintf(str, "ans%d.txt", tno); ans = fopen(str, "r"); fnc(); fclose(in); fclose(ans); } printf("end\n"); #else in = stdin; fnc(); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292482/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292482/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @in = dso_local local_unnamed_addr global ptr null, align 8 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @ans = dso_local local_unnamed_addr global ptr null, align 8 @tno = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @out(ptr nocapture noundef readonly %s) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %s) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @outi(i32 noundef %i) local_unnamed_addr #0 { entry: %s = alloca [128 x i8], align 16 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %s) #5 %call = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i) #5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @outll(i64 noundef %l) local_unnamed_addr #0 { entry: %s = alloca [128 x i8], align 16 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %s) #5 %call = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %l) #5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: nounwind uwtable define dso_local i32 @geti() local_unnamed_addr #3 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #5 %0 = load ptr, ptr @in, align 8, !tbaa !5 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.2, ptr noundef nonnull %i) #5 %1 = load i32, ptr %i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #5 ret i32 %1 } declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4 ; Function Attrs: nounwind uwtable define dso_local i64 @getll() local_unnamed_addr #3 { entry: %l = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #5 %0 = load ptr, ptr @in, align 8, !tbaa !5 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.3, ptr noundef nonnull %l) #5 %1 = load i64, ptr %l, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #5 ret i64 %1 } ; Function Attrs: nounwind uwtable define dso_local i32 @getstr(ptr noundef %s) local_unnamed_addr #3 { entry: %0 = load ptr, ptr @in, align 8, !tbaa !5 %call = tail call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.4, ptr noundef %s) #5 ret i32 0 } ; Function Attrs: nounwind uwtable define dso_local i32 @fnc() local_unnamed_addr #3 { entry: %s.i = alloca [128 x i8], align 16 %i.i6 = alloca i32, align 4 %i.i4 = alloca i32, align 4 %i.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #5 %0 = load ptr, ptr @in, align 8, !tbaa !5 %call.i = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i) #5 %1 = load i32, ptr %i.i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i4) #5 %2 = load ptr, ptr @in, align 8, !tbaa !5 %call.i5 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i4) #5 %3 = load i32, ptr %i.i4, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i4) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i6) #5 %4 = load ptr, ptr @in, align 8, !tbaa !5 %call.i7 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %4, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i6) #5 %5 = load i32, ptr %i.i6, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i6) #5 %div = sdiv i32 %5, %1 %mul = mul nsw i32 %div, %3 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %s.i) #5 %call.i8 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s.i, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul) #5 %call.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %s.i) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %s.i) #5 ret i32 0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %s.i.i = alloca [128 x i8], align 16 %i.i6.i = alloca i32, align 4 %i.i4.i = alloca i32, align 4 %i.i.i = alloca i32, align 4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 store ptr %0, ptr @in, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i.i) #5 %call.i.i = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i.i) #5 %1 = load i32, ptr %i.i.i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i.i) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i4.i) #5 %2 = load ptr, ptr @in, align 8, !tbaa !5 %call.i5.i = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i4.i) #5 %3 = load i32, ptr %i.i4.i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i4.i) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i6.i) #5 %4 = load ptr, ptr @in, align 8, !tbaa !5 %call.i7.i = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %4, ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i6.i) #5 %5 = load i32, ptr %i.i6.i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i6.i) #5 %div.i = sdiv i32 %5, %1 %mul.i = mul nsw i32 %div.i, %3 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %s.i.i) #5 %call.i8.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s.i.i, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul.i) #5 %call.i.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %s.i.i) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %s.i.i) #5 ret i32 0 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0}
#include <stdio.h> int main(void){ int A,B,T; scanf("%d %d %d",&A,&B,&T); int a=A; int N=0; while(A<=(T+0.5)){ N+=B; A = A + a; } printf("%d\n",N); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292532/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292532/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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %T = 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 %T) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %T, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %add = fadd double %conv1, 5.000000e-01 %conv8 = sitofp i32 %0 to double %cmp9 = fcmp ult double %add, %conv8 br i1 %cmp9, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %2 = load i32, ptr %B, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %N.011 = phi i32 [ 0, %while.body.lr.ph ], [ %add3, %while.body ] %add4710 = phi i32 [ %0, %while.body.lr.ph ], [ %add4, %while.body ] %add3 = add nsw i32 %2, %N.011 %add4 = add nsw i32 %add4710, %0 %conv = sitofp i32 %add4 to double %cmp = fcmp ult double %add, %conv br i1 %cmp, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %add4, ptr %A, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %N.0.lcssa = phi i32 [ %add3, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %N.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #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 @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,T; scanf("%d %d %d", &A,&B,&T); printf("%d\n", (T / A) * B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292576/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292576/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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %T = 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 %T) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %2 = load i32, ptr %B, align 4, !tbaa !5 %mul = mul nsw i32 %2, %div %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #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 @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, T; scanf("%d %d %d", &A, &B, &T); int ans=0; ans = (T/A) * B; printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292619/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292619/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 [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 %T = 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 %T) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %2 = load i32, ptr %B, align 4, !tbaa !5 %mul = mul nsw i32 %2, %div %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #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 @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"}
//Trie + comp //CF2016qB-E #include<stdio.h> #include<string.h> #define lk 32 typedef struct{ int lp; int par; int bkw; int chi[lk]; }trn; int trc=0; trn trie[524288]; void trinit(){ int i; trie[0].lp=0; trie[0].par=-1; trie[0].bkw=-1; for(i=0;i<lk;i++){ trie[0].chi[i]=-1; } trc=1; } void crn(int x,int pt){ int i; trie[x].chi[pt]=trc; trie[trc].par=x; trie[trc].bkw=pt; trie[trc].lp=trie[x].lp+1; for(i=0;i<lk;i++){ trie[trc].chi[i]=-1; } trc++; } int run(char s[]){ int i,l=strlen(s),v=0,c; for(i=0;i<=l;i++){ if(i!=l){c=s[i]-'`';} else{c=0;} if(trie[v].chi[c]==-1){ crn(v,c); } v=trie[v].chi[c]; } return v; } void tricomp(){ int i,j,c,tac; for(i=0;i<trc;i++){ if(trie[i].par==-1){continue;} c=0; for(j=0;j<lk;j++){ if(trie[i].chi[j]!=-1){tac=trie[i].chi[j];c++;} } if(c==1){ trie[trie[i].par].chi[trie[i].bkw]=tac; trie[tac].par=trie[i].par; trie[tac].bkw=trie[i].bkw; } } } int main(){ trinit(); int n,i,j,w[524288]={0},id[524288]={0},q,k,res,v,vp,f; char s[524288],p[32]; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%s",s); id[i]=run(s); w[id[i]]++; } tricomp(); for(i=trc-1;i>=0;i--){ if(trie[i].par==-1){continue;} w[trie[i].par]+=w[i]; } scanf("%d",&q); for(i=0;i<q;i++){ scanf("%d%s",&k,p); res=0; v=id[k]; while(trie[v].par!=-1){ vp=trie[v].par; f=0; if(trie[v].bkw==0){f=1;} for(j=0;j<26;j++){ if(f==1 && trie[vp].chi[p[j]-'`']!=-1){ res+=w[trie[vp].chi[p[j]-'`']]; } if(trie[v].bkw==p[j]-'`'){f=1;} } v=vp; } printf("%d\n",n-res); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292662/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292662/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.trn = type { i32, i32, i32, [32 x i32] } @trc = dso_local local_unnamed_addr global i32 0, align 4 @trie = dso_local local_unnamed_addr global [524288 x %struct.trn] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @trinit() local_unnamed_addr #0 { entry: store i32 0, ptr @trie, align 16, !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(136) getelementptr inbounds ([524288 x %struct.trn], ptr @trie, i64 0, i64 0, i32 1), i8 -1, i64 136, i1 false) store i32 1, ptr @trc, align 4, !tbaa !10 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @crn(i32 noundef %x, i32 noundef %pt) local_unnamed_addr #2 { entry: %0 = load i32, ptr @trc, align 4, !tbaa !10 %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom %idxprom1 = sext i32 %pt to i64 %arrayidx2 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom, i32 3, i64 %idxprom1 store i32 %0, ptr %arrayidx2, align 4, !tbaa !10 %idxprom3 = sext i32 %0 to i64 %par = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3, i32 1 store i32 %x, ptr %par, align 4, !tbaa !11 %bkw = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3, i32 2 store i32 %pt, ptr %bkw, align 4, !tbaa !12 %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, 1 %arrayidx10 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3 store i32 %add, ptr %arrayidx10, align 4, !tbaa !5 %2 = mul nsw i64 %idxprom3, 140 %3 = getelementptr i8, ptr @trie, i64 %2 %scevgep = getelementptr i8, ptr %3, i64 12 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(128) %scevgep, i8 -1, i64 128, i1 false), !tbaa !10 %inc17 = add nsw i32 %0, 1 store i32 %inc17, ptr @trc, align 4, !tbaa !10 ret void } ; Function Attrs: nofree nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @run(ptr nocapture noundef readonly %s) local_unnamed_addr #3 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #10 %0 = and i64 %call, 2147483648 %cmp.not30.not = icmp eq i64 %0, 0 br i1 %cmp.not30.not, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %trc.promoted = load i32, ptr @trc, align 4, !tbaa !10 %1 = and i64 %call, 4294967295 %2 = add nuw i64 %call, 1 %wide.trip.count = and i64 %2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %if.end12 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %if.end12 ] %v.033 = phi i32 [ 0, %for.body.preheader ], [ %7, %if.end12 ] %inc17.i2931 = phi i32 [ %trc.promoted, %for.body.preheader ], [ %inc17.i28, %if.end12 ] %cmp2.not = icmp eq i64 %indvars.iv, %1 br i1 %cmp2.not, label %if.end, label %if.then if.then: ; preds = %for.body %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv %3 = load i8, ptr %arrayidx, align 1, !tbaa !13 %conv4 = sext i8 %3 to i32 %sub = add nsw i32 %conv4, -96 br label %if.end if.end: ; preds = %for.body, %if.then %c.0 = phi i32 [ %sub, %if.then ], [ 0, %for.body ] %idxprom5 = sext i32 %v.033 to i64 %idxprom7 = sext i32 %c.0 to i64 %arrayidx8 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom5, i32 3, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !10 %cmp9 = icmp eq i32 %4, -1 br i1 %cmp9, label %if.then11, label %if.end12 if.then11: ; preds = %if.end %arrayidx.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom5 store i32 %inc17.i2931, ptr %arrayidx8, align 4, !tbaa !10 %idxprom3.i = sext i32 %inc17.i2931 to i64 %par.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i, i32 1 store i32 %v.033, ptr %par.i, align 4, !tbaa !11 %bkw.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i, i32 2 store i32 %c.0, ptr %bkw.i, align 4, !tbaa !12 %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %add.i = add nsw i32 %5, 1 %arrayidx10.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i store i32 %add.i, ptr %arrayidx10.i, align 4, !tbaa !5 %6 = mul nsw i64 %idxprom3.i, 140 %gep = getelementptr i8, ptr getelementptr inbounds ([524288 x %struct.trn], ptr @trie, i64 0, i64 0, i32 3, i64 0), i64 %6 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(128) %gep, i8 -1, i64 128, i1 false), !tbaa !10 %inc17.i = add nsw i32 %inc17.i2931, 1 store i32 %inc17.i, ptr @trc, align 4, !tbaa !10 %.pre = load i32, ptr %arrayidx8, align 4, !tbaa !10 br label %if.end12 if.end12: ; preds = %if.then11, %if.end %7 = phi i32 [ %.pre, %if.then11 ], [ %4, %if.end ] %inc17.i28 = phi i32 [ %inc17.i, %if.then11 ], [ %inc17.i2931, %if.end ] %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 = %if.end12, %entry %v.0.lcssa = phi i32 [ 0, %entry ], [ %7, %if.end12 ] ret i32 %v.0.lcssa } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @tricomp() local_unnamed_addr #5 { entry: %0 = load i32, ptr @trc, align 4, !tbaa !10 %cmp64 = icmp sgt i32 %0, 0 br i1 %cmp64, label %for.body.preheader, label %for.end45 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc43 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc43 ] %tac.066 = phi i32 [ undef, %for.body.preheader ], [ %tac.3, %for.inc43 ] %par = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 1 %1 = load i32, ptr %par, align 4, !tbaa !11 %cmp1 = icmp eq i32 %1, -1 br i1 %cmp1, label %for.inc43, label %for.body4.preheader for.body4.preheader: ; preds = %for.body %arrayidx8 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 0 %2 = load i32, ptr %arrayidx8, align 4, !tbaa !10 %arrayidx8.1 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 1 %3 = load i32, ptr %arrayidx8.1, align 4, !tbaa !10 %arrayidx8.2 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 2 %4 = load i32, ptr %arrayidx8.2, align 4, !tbaa !10 %arrayidx8.3 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 3 %5 = load <2 x i32>, ptr %arrayidx8.3, align 4, !tbaa !10 %arrayidx8.5 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 5 %6 = load <8 x i32>, ptr %arrayidx8.5, align 4, !tbaa !10 %arrayidx8.13 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 13 %7 = load <4 x i32>, ptr %arrayidx8.13, align 4, !tbaa !10 %8 = insertelement <16 x i32> poison, i32 %2, i64 0 %9 = insertelement <16 x i32> %8, i32 %4, i64 1 %10 = shufflevector <2 x i32> %5, <2 x i32> poison, <16 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %11 = shufflevector <16 x i32> %9, <16 x i32> %10, <16 x i32> <i32 0, i32 1, i32 16, i32 17, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %12 = shufflevector <8 x i32> %6, <8 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %13 = shufflevector <16 x i32> %11, <16 x i32> %12, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 poison, i32 poison, i32 poison, i32 poison> %14 = shufflevector <4 x i32> %7, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %15 = shufflevector <16 x i32> %13, <16 x i32> %14, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 16, i32 17, i32 18, i32 19> %16 = icmp ne <16 x i32> %15, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1> %17 = extractelement <16 x i1> %16, i64 0 %spec.select60 = select i1 %17, i32 %2, i32 %tac.066 %18 = extractelement <16 x i1> %16, i64 1 %19 = extractelement <16 x i1> %16, i64 2 %20 = extractelement <16 x i1> %16, i64 3 %21 = extractelement <16 x i1> %16, i64 4 %22 = extractelement <16 x i1> %16, i64 5 %23 = extractelement <16 x i1> %16, i64 6 %24 = extractelement <16 x i1> %16, i64 7 %25 = extractelement <16 x i1> %16, i64 8 %26 = extractelement <16 x i1> %16, i64 9 %27 = extractelement <16 x i1> %16, i64 10 %28 = extractelement <16 x i1> %16, i64 11 %29 = extractelement <16 x i1> %16, i64 12 %30 = extractelement <16 x i1> %16, i64 13 %31 = extractelement <16 x i1> %16, i64 14 %32 = extractelement <16 x i1> %16, i64 15 %arrayidx8.17 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 17 %33 = load <2 x i32>, ptr %arrayidx8.17, align 4, !tbaa !10 %arrayidx8.19 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 19 %34 = load <4 x i32>, ptr %arrayidx8.19, align 4, !tbaa !10 %arrayidx8.23 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 23 %35 = load <8 x i32>, ptr %arrayidx8.23, align 4, !tbaa !10 %arrayidx8.31 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 3, i64 31 %36 = load i32, ptr %arrayidx8.31, align 4, !tbaa !10 %37 = shufflevector <8 x i32> %35, <8 x i32> poison, <16 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %38 = shufflevector <4 x i32> %34, <4 x i32> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %39 = shufflevector <16 x i32> %37, <16 x i32> %38, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison> %40 = shufflevector <2 x i32> %33, <2 x i32> poison, <16 x i32> <i32 1, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %41 = shufflevector <16 x i32> %39, <16 x i32> %40, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 16, i32 17, i32 poison, i32 poison> %42 = insertelement <16 x i32> %41, i32 %3, i64 14 %43 = insertelement <16 x i32> %42, i32 %36, i64 15 %44 = icmp ne <16 x i32> %43, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1> %45 = extractelement <16 x i1> %44, i64 14 %spec.select60.1 = select i1 %45, i32 %3, i32 %spec.select60 %spec.select60.2 = select i1 %18, i32 %4, i32 %spec.select60.1 %46 = extractelement <2 x i32> %5, i64 0 %spec.select60.3 = select i1 %19, i32 %46, i32 %spec.select60.2 %47 = extractelement <2 x i32> %5, i64 1 %spec.select60.4 = select i1 %20, i32 %47, i32 %spec.select60.3 %48 = extractelement <8 x i32> %6, i64 0 %spec.select60.5 = select i1 %21, i32 %48, i32 %spec.select60.4 %49 = extractelement <8 x i32> %6, i64 1 %spec.select60.6 = select i1 %22, i32 %49, i32 %spec.select60.5 %50 = extractelement <8 x i32> %6, i64 2 %spec.select60.7 = select i1 %23, i32 %50, i32 %spec.select60.6 %51 = extractelement <8 x i32> %6, i64 3 %spec.select60.8 = select i1 %24, i32 %51, i32 %spec.select60.7 %52 = extractelement <8 x i32> %6, i64 4 %spec.select60.9 = select i1 %25, i32 %52, i32 %spec.select60.8 %53 = extractelement <8 x i32> %6, i64 5 %spec.select60.10 = select i1 %26, i32 %53, i32 %spec.select60.9 %54 = extractelement <8 x i32> %6, i64 6 %spec.select60.11 = select i1 %27, i32 %54, i32 %spec.select60.10 %55 = extractelement <8 x i32> %6, i64 7 %spec.select60.12 = select i1 %28, i32 %55, i32 %spec.select60.11 %56 = extractelement <4 x i32> %7, i64 0 %spec.select60.13 = select i1 %29, i32 %56, i32 %spec.select60.12 %57 = extractelement <4 x i32> %7, i64 1 %spec.select60.14 = select i1 %30, i32 %57, i32 %spec.select60.13 %58 = extractelement <4 x i32> %7, i64 2 %spec.select60.15 = select i1 %31, i32 %58, i32 %spec.select60.14 %59 = extractelement <4 x i32> %7, i64 3 %spec.select60.16 = select i1 %32, i32 %59, i32 %spec.select60.15 %60 = extractelement <16 x i1> %44, i64 13 %61 = extractelement <2 x i32> %33, i64 0 %spec.select60.17 = select i1 %60, i32 %61, i32 %spec.select60.16 %62 = extractelement <16 x i1> %44, i64 12 %63 = extractelement <2 x i32> %33, i64 1 %spec.select60.18 = select i1 %62, i32 %63, i32 %spec.select60.17 %64 = extractelement <16 x i1> %44, i64 11 %65 = extractelement <4 x i32> %34, i64 0 %spec.select60.19 = select i1 %64, i32 %65, i32 %spec.select60.18 %66 = extractelement <16 x i1> %44, i64 10 %67 = extractelement <4 x i32> %34, i64 1 %spec.select60.20 = select i1 %66, i32 %67, i32 %spec.select60.19 %68 = extractelement <16 x i1> %44, i64 9 %69 = extractelement <4 x i32> %34, i64 2 %spec.select60.21 = select i1 %68, i32 %69, i32 %spec.select60.20 %70 = extractelement <16 x i1> %44, i64 8 %71 = extractelement <4 x i32> %34, i64 3 %spec.select60.22 = select i1 %70, i32 %71, i32 %spec.select60.21 %72 = extractelement <16 x i1> %44, i64 7 %73 = extractelement <8 x i32> %35, i64 0 %spec.select60.23 = select i1 %72, i32 %73, i32 %spec.select60.22 %74 = extractelement <16 x i1> %44, i64 6 %75 = extractelement <8 x i32> %35, i64 1 %spec.select60.24 = select i1 %74, i32 %75, i32 %spec.select60.23 %76 = extractelement <16 x i1> %44, i64 5 %77 = extractelement <8 x i32> %35, i64 2 %spec.select60.25 = select i1 %76, i32 %77, i32 %spec.select60.24 %78 = extractelement <16 x i1> %44, i64 4 %79 = extractelement <8 x i32> %35, i64 3 %spec.select60.26 = select i1 %78, i32 %79, i32 %spec.select60.25 %80 = extractelement <16 x i1> %44, i64 3 %81 = extractelement <8 x i32> %35, i64 4 %spec.select60.27 = select i1 %80, i32 %81, i32 %spec.select60.26 %82 = extractelement <16 x i1> %44, i64 2 %83 = extractelement <8 x i32> %35, i64 5 %spec.select60.28 = select i1 %82, i32 %83, i32 %spec.select60.27 %84 = extractelement <16 x i1> %44, i64 1 %85 = extractelement <8 x i32> %35, i64 6 %spec.select60.29 = select i1 %84, i32 %85, i32 %spec.select60.28 %86 = extractelement <16 x i1> %44, i64 0 %87 = extractelement <8 x i32> %35, i64 7 %spec.select60.30 = select i1 %86, i32 %87, i32 %spec.select60.29 %88 = bitcast <16 x i1> %16 to i16 %89 = tail call i16 @llvm.ctpop.i16(i16 %88), !range !16 %90 = bitcast <16 x i1> %44 to i16 %91 = tail call i16 @llvm.ctpop.i16(i16 %90), !range !16 %narrow = add nuw nsw i16 %91, %89 %92 = extractelement <16 x i1> %44, i64 15 %spec.select60.31 = select i1 %92, i32 %36, i32 %spec.select60.30 %cmp18 = icmp eq i16 %narrow, 1 br i1 %cmp18, label %if.then19, label %for.inc43 if.then19: ; preds = %for.body4.preheader %idxprom23 = sext i32 %1 to i64 %bkw = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %indvars.iv, i32 2 %93 = load i32, ptr %bkw, align 4, !tbaa !12 %idxprom28 = sext i32 %93 to i64 %arrayidx29 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom23, i32 3, i64 %idxprom28 store i32 %spec.select60.31, ptr %arrayidx29, align 4, !tbaa !10 %idxprom33 = sext i32 %spec.select60.31 to i64 %par35 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom33, i32 1 %94 = load <2 x i32>, ptr %par, align 4, !tbaa !10 store <2 x i32> %94, ptr %par35, align 4, !tbaa !10 br label %for.inc43 for.inc43: ; preds = %for.body4.preheader, %if.then19, %for.body %tac.3 = phi i32 [ %tac.066, %for.body ], [ %spec.select60.31, %if.then19 ], [ %spec.select60.31, %for.body4.preheader ] %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.end45, label %for.body, !llvm.loop !17 for.end45: ; preds = %for.inc43, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %n = alloca i32, align 4 %w = alloca [524288 x i32], align 16 %id = alloca [524288 x i32], align 16 %q = alloca i32, align 4 %k = alloca i32, align 4 %s = alloca [524288 x i8], align 16 %p = alloca [32 x i8], align 16 store i32 0, ptr @trie, align 16, !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(136) getelementptr inbounds ([524288 x %struct.trn], ptr @trie, i64 0, i64 0, i32 1), i8 -1, i64 136, i1 false) store i32 1, ptr @trc, align 4, !tbaa !10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %w) #11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097152) %w, i8 0, i64 2097152, i1 false) call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %id) #11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097152) %id, i8 0, i64 2097152, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #11 call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %s) #11 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %p) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp.not112 = icmp slt i32 %0, 1 br i1 %cmp.not112, label %for.end, label %for.body for.body: ; preds = %entry, %run.exit %indvars.iv = phi i64 [ %indvars.iv.next, %run.exit ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #10 %1 = and i64 %call.i, 2147483648 %cmp.not30.not.i = icmp eq i64 %1, 0 br i1 %cmp.not30.not.i, label %for.body.preheader.i, label %run.exit for.body.preheader.i: ; preds = %for.body %trc.promoted.i = load i32, ptr @trc, align 4, !tbaa !10 %2 = and i64 %call.i, 4294967295 %3 = add nuw i64 %call.i, 1 %wide.trip.count.i = and i64 %3, 4294967295 br label %for.body.i for.body.i: ; preds = %if.end12.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %if.end12.i ] %v.033.i = phi i32 [ 0, %for.body.preheader.i ], [ %8, %if.end12.i ] %inc17.i2931.i = phi i32 [ %trc.promoted.i, %for.body.preheader.i ], [ %inc17.i28.i, %if.end12.i ] %cmp2.not.i = icmp eq i64 %indvars.iv.i, %2 br i1 %cmp2.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %for.body.i %arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i %4 = load i8, ptr %arrayidx.i, align 1, !tbaa !13 %conv4.i = sext i8 %4 to i32 %sub.i = add nsw i32 %conv4.i, -96 br label %if.end.i if.end.i: ; preds = %if.then.i, %for.body.i %c.0.i = phi i32 [ %sub.i, %if.then.i ], [ 0, %for.body.i ] %idxprom5.i = sext i32 %v.033.i to i64 %idxprom7.i = sext i32 %c.0.i to i64 %arrayidx8.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom5.i, i32 3, i64 %idxprom7.i %5 = load i32, ptr %arrayidx8.i, align 4, !tbaa !10 %cmp9.i = icmp eq i32 %5, -1 br i1 %cmp9.i, label %if.then11.i, label %if.end12.i if.then11.i: ; preds = %if.end.i %arrayidx.i.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom5.i store i32 %inc17.i2931.i, ptr %arrayidx8.i, align 4, !tbaa !10 %idxprom3.i.i = sext i32 %inc17.i2931.i to i64 %par.i.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i.i, i32 1 store i32 %v.033.i, ptr %par.i.i, align 4, !tbaa !11 %bkw.i.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i.i, i32 2 store i32 %c.0.i, ptr %bkw.i.i, align 4, !tbaa !12 %6 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %add.i.i = add nsw i32 %6, 1 %arrayidx10.i.i = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom3.i.i store i32 %add.i.i, ptr %arrayidx10.i.i, align 4, !tbaa !5 %7 = mul nsw i64 %idxprom3.i.i, 140 %gep.i = getelementptr i8, ptr getelementptr inbounds ([524288 x %struct.trn], ptr @trie, i64 0, i64 0, i32 3, i64 0), i64 %7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(128) %gep.i, i8 -1, i64 128, i1 false), !tbaa !10 %inc17.i.i = add nsw i32 %inc17.i2931.i, 1 store i32 %inc17.i.i, ptr @trc, align 4, !tbaa !10 %.pre.i = load i32, ptr %arrayidx8.i, align 4, !tbaa !10 br label %if.end12.i if.end12.i: ; preds = %if.then11.i, %if.end.i %8 = phi i32 [ %.pre.i, %if.then11.i ], [ %5, %if.end.i ] %inc17.i28.i = phi i32 [ %inc17.i.i, %if.then11.i ], [ %inc17.i2931.i, %if.end.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 %run.exit, label %for.body.i, !llvm.loop !14 run.exit: ; preds = %if.end12.i, %for.body %v.0.lcssa.i = phi i32 [ 0, %for.body ], [ %8, %if.end12.i ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %id, i64 0, i64 %indvars.iv store i32 %v.0.lcssa.i, ptr %arrayidx, align 4, !tbaa !10 %idxprom6 = sext i32 %v.0.lcssa.i to i64 %arrayidx7 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom6 %9 = load i32, ptr %arrayidx7, align 4, !tbaa !10 %inc = add nsw i32 %9, 1 store i32 %inc, ptr %arrayidx7, align 4, !tbaa !10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %n, align 4, !tbaa !10 %11 = sext i32 %10 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %11 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !18 for.end: ; preds = %run.exit, %entry call void @tricomp() %12 = load i32, ptr @trc, align 4, !tbaa !10 %cmp10115 = icmp sgt i32 %12, 0 br i1 %cmp10115, label %for.body11.preheader, label %for.end23 for.body11.preheader: ; preds = %for.end %13 = zext i32 %12 to i64 %xtraiter = and i64 %13, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body11.prol.loopexit, label %for.body11.prol for.body11.prol: ; preds = %for.body11.preheader %indvars.iv.next129.prol = add nsw i64 %13, -1 %idxprom12.prol = and i64 %indvars.iv.next129.prol, 4294967295 %par.prol = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom12.prol, i32 1 %14 = load i32, ptr %par.prol, align 4, !tbaa !11 %cmp14.prol = icmp eq i32 %14, -1 br i1 %cmp14.prol, label %for.body11.prol.loopexit, label %if.end.prol if.end.prol: ; preds = %for.body11.prol %arrayidx16.prol = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom12.prol %15 = load i32, ptr %arrayidx16.prol, align 4, !tbaa !10 %idxprom20.prol = sext i32 %14 to i64 %arrayidx21.prol = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom20.prol %16 = load i32, ptr %arrayidx21.prol, align 4, !tbaa !10 %add.prol = add nsw i32 %16, %15 store i32 %add.prol, ptr %arrayidx21.prol, align 4, !tbaa !10 br label %for.body11.prol.loopexit for.body11.prol.loopexit: ; preds = %for.body11.prol, %if.end.prol, %for.body11.preheader %indvars.iv128.unr = phi i64 [ %13, %for.body11.preheader ], [ %indvars.iv.next129.prol, %if.end.prol ], [ %indvars.iv.next129.prol, %for.body11.prol ] %17 = icmp eq i32 %12, 1 br i1 %17, label %for.end23, label %for.body11 for.body11: ; preds = %for.body11.prol.loopexit, %for.inc22.1 %indvars.iv128 = phi i64 [ %indvars.iv.next129.1, %for.inc22.1 ], [ %indvars.iv128.unr, %for.body11.prol.loopexit ] %indvars.iv.next129 = add nsw i64 %indvars.iv128, -1 %idxprom12 = and i64 %indvars.iv.next129, 4294967295 %par = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom12, i32 1 %18 = load i32, ptr %par, align 4, !tbaa !11 %cmp14 = icmp eq i32 %18, -1 br i1 %cmp14, label %for.inc22, label %if.end if.end: ; preds = %for.body11 %arrayidx16 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom12 %19 = load i32, ptr %arrayidx16, align 4, !tbaa !10 %idxprom20 = sext i32 %18 to i64 %arrayidx21 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom20 %20 = load i32, ptr %arrayidx21, align 4, !tbaa !10 %add = add nsw i32 %20, %19 store i32 %add, ptr %arrayidx21, align 4, !tbaa !10 br label %for.inc22 for.inc22: ; preds = %for.body11, %if.end %indvars.iv.next129.1 = add nsw i64 %indvars.iv128, -2 %idxprom12.1 = and i64 %indvars.iv.next129.1, 4294967295 %par.1 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom12.1, i32 1 %21 = load i32, ptr %par.1, align 4, !tbaa !11 %cmp14.1 = icmp eq i32 %21, -1 br i1 %cmp14.1, label %for.inc22.1, label %if.end.1 if.end.1: ; preds = %for.inc22 %arrayidx16.1 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom12.1 %22 = load i32, ptr %arrayidx16.1, align 4, !tbaa !10 %idxprom20.1 = sext i32 %21 to i64 %arrayidx21.1 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom20.1 %23 = load i32, ptr %arrayidx21.1, align 4, !tbaa !10 %add.1 = add nsw i32 %23, %22 store i32 %add.1, ptr %arrayidx21.1, align 4, !tbaa !10 br label %for.inc22.1 for.inc22.1: ; preds = %if.end.1, %for.inc22 %cmp10.1 = icmp ugt i64 %indvars.iv.next129, 1 br i1 %cmp10.1, label %for.body11, label %for.end23, !llvm.loop !19 for.end23: ; preds = %for.body11.prol.loopexit, %for.inc22.1, %for.end %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %24 = load i32, ptr %q, align 4, !tbaa !10 %cmp26125 = icmp sgt i32 %24, 0 br i1 %cmp26125, label %for.body27, label %for.end89 for.body27: ; preds = %for.end23, %while.end %i.2126 = phi i32 [ %inc88, %while.end ], [ 0, %for.end23 ] %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %k, ptr noundef nonnull %p) %25 = load i32, ptr %k, align 4, !tbaa !10 %idxprom30 = sext i32 %25 to i64 %arrayidx31 = getelementptr inbounds [524288 x i32], ptr %id, i64 0, i64 %idxprom30 %26 = load i32, ptr %arrayidx31, align 4, !tbaa !10 %idxprom32120 = sext i32 %26 to i64 %par34121 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom32120, i32 1 %27 = load i32, ptr %par34121, align 4, !tbaa !11 %cmp35.not122 = icmp eq i32 %27, -1 br i1 %cmp35.not122, label %while.end, label %while.body while.cond.loopexit: ; preds = %if.end70 %par34 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom48, i32 1 %28 = load i32, ptr %par34, align 4, !tbaa !11 %cmp35.not = icmp eq i32 %28, -1 br i1 %cmp35.not, label %while.end, label %while.body, !llvm.loop !20 while.body: ; preds = %for.body27, %while.cond.loopexit %29 = phi i32 [ %28, %while.cond.loopexit ], [ %27, %for.body27 ] %idxprom32124 = phi i64 [ %idxprom48, %while.cond.loopexit ], [ %idxprom32120, %for.body27 ] %res.0123 = phi i32 [ %res.2, %while.cond.loopexit ], [ 0, %for.body27 ] %bkw = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom32124, i32 2 %30 = load i32, ptr %bkw, align 4, !tbaa !12 %cmp41 = icmp eq i32 %30, 0 %spec.store.select = zext i1 %cmp41 to i32 %idxprom48 = sext i32 %29 to i64 br label %for.body46 for.body46: ; preds = %while.body, %if.end70 %indvars.iv131 = phi i64 [ 0, %while.body ], [ %indvars.iv.next132, %if.end70 ] %f.0119 = phi i32 [ %spec.store.select, %while.body ], [ %spec.select, %if.end70 ] %res.1118 = phi i32 [ %res.0123, %while.body ], [ %res.2, %if.end70 ] %cmp47 = icmp eq i32 %f.0119, 1 %arrayidx51 = getelementptr inbounds [32 x i8], ptr %p, i64 0, i64 %indvars.iv131 %31 = load i8, ptr %arrayidx51, align 1, !tbaa !13 br i1 %cmp47, label %land.lhs.true, label %if.end70 land.lhs.true: ; preds = %for.body46 %conv = sext i8 %31 to i64 %sub52 = add nsw i64 %conv, -96 %arrayidx54 = getelementptr inbounds [524288 x %struct.trn], ptr @trie, i64 0, i64 %idxprom48, i32 3, i64 %sub52 %32 = load i32, ptr %arrayidx54, align 4, !tbaa !10 %cmp55.not = icmp eq i32 %32, -1 br i1 %cmp55.not, label %if.end70, label %if.then57 if.then57: ; preds = %land.lhs.true %idxprom67 = sext i32 %32 to i64 %arrayidx68 = getelementptr inbounds [524288 x i32], ptr %w, i64 0, i64 %idxprom67 %33 = load i32, ptr %arrayidx68, align 4, !tbaa !10 %add69 = add nsw i32 %33, %res.1118 br label %if.end70 if.end70: ; preds = %for.body46, %if.then57, %land.lhs.true %res.2 = phi i32 [ %add69, %if.then57 ], [ %res.1118, %land.lhs.true ], [ %res.1118, %for.body46 ] %conv76 = sext i8 %31 to i32 %sub77 = add nsw i32 %conv76, -96 %cmp78 = icmp eq i32 %30, %sub77 %spec.select = select i1 %cmp78, i32 1, i32 %f.0119 %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond.not = icmp eq i64 %indvars.iv.next132, 26 br i1 %exitcond.not, label %while.cond.loopexit, label %for.body46, !llvm.loop !21 while.end: ; preds = %while.cond.loopexit, %for.body27 %res.0.lcssa = phi i32 [ 0, %for.body27 ], [ %res.2, %while.cond.loopexit ] %34 = load i32, ptr %n, align 4, !tbaa !10 %sub85 = sub nsw i32 %34, %res.0.lcssa %call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub85) %inc88 = add nuw nsw i32 %i.2126, 1 %35 = load i32, ptr %q, align 4, !tbaa !10 %cmp26 = icmp slt i32 %inc88, %35 br i1 %cmp26, label %for.body27, label %for.end89, !llvm.loop !22 for.end89: ; preds = %while.end, %for.end23 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %p) #11 call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %s) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #11 call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %id) #11 call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %w) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 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) #7 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #9 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(write, 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 = { 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 #3 = { nofree nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { 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, !7, i64 4, !7, i64 8, !8, i64 12} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!7, !7, i64 0} !11 = !{!6, !7, i64 4} !12 = !{!6, !7, i64 8} !13 = !{!8, !8, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = !{i16 0, i16 17} !17 = distinct !{!17, !15} !18 = distinct !{!18, !15} !19 = distinct !{!19, !15} !20 = distinct !{!20, !15} !21 = distinct !{!21, !15} !22 = distinct !{!22, !15}
//Graph #include <stdio.h> int Adj[101][101],n; void Initialization(){ int i,j; for(i=1;i<=n;i++) for(j=1;j<=n;j++) Adj[i][j]=0; } void Print(){ int i,j; for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ printf("%d",Adj[i][j]); if(j!=n)printf(" "); } printf("\n"); } } int main(){ int i,j,element,number,key; scanf("%d",&n); Initialization(); for(i=0;i<n;i++){ scanf("%d%d",&element,&number); for(j=0;j<number;j++){ scanf("%d",&key); Adj[element][key]=1; } } Print(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292705/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292705/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 @Adj = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = 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 @Initialization() 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.end8, 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.end8.loopexit.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, 404 %gep = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, 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, 404 %gep18 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 404), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 4 %gep18, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 404 %gep19 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 808), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep19, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 404 %gep20 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 1212), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep20, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 404 %gep21 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 1616), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 8 %gep21, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 404 %gep22 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2020), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep22, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 404 %gep23 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2424), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep23, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 404 %gep24 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2828), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep24, 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.end8.loopexit.unr-lcssa, label %for.cond1.preheader, !llvm.loop !9 for.end8.loopexit.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.end8, label %for.cond1.preheader.epil for.cond1.preheader.epil: ; preds = %for.end8.loopexit.unr-lcssa, %for.cond1.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.epil ], [ %indvar.unr, %for.end8.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.epil ], [ 0, %for.end8.loopexit.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 404 %gep.epil = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, 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.end8, label %for.cond1.preheader.epil, !llvm.loop !11 for.end8: ; preds = %for.end8.loopexit.unr-lcssa, %for.cond1.preheader.epil, %entry 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 @Print() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not20 = icmp slt i32 %0, 1 br i1 %cmp.not20, label %for.end11, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %7, %for.end ], [ %0, %entry ] %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.end ], [ 1, %entry ] %cmp2.not18 = icmp slt i32 %1, 1 br i1 %cmp2.not18, label %for.end, label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr @Adj, i64 0, i64 %indvars.iv23, i64 %indvars.iv %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2) %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %cmp6.not = icmp eq i64 %indvars.iv, %4 br i1 %cmp6.not, label %for.inc, label %if.then if.then: ; preds = %for.body3 %putchar17 = tail call i32 @putchar(i32 32) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %5 = phi i32 [ %3, %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.end, !llvm.loop !13 for.end: ; preds = %for.inc, %for.cond1.preheader %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %7 = load i32, ptr @n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp.not.not = icmp slt i64 %indvars.iv23, %8 br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end11, !llvm.loop !14 for.end11: ; preds = %for.end, %entry 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: %element = alloca i32, align 4 %number = alloca i32, align 4 %key = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %element) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #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.not15.i = icmp slt i32 %0, 1 br i1 %cmp.not15.i, label %Print.exit, label %for.cond1.preheader.preheader.i for.cond1.preheader.preheader.i: ; 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 %Initialization.exit.unr-lcssa, label %for.cond1.preheader.preheader.i.new for.cond1.preheader.preheader.i.new: ; preds = %for.cond1.preheader.preheader.i %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader.i for.cond1.preheader.i: ; preds = %for.cond1.preheader.i, %for.cond1.preheader.preheader.i.new %indvar.i = phi i64 [ 0, %for.cond1.preheader.preheader.i.new ], [ %indvar.next.i.7, %for.cond1.preheader.i ] %niter = phi i64 [ 0, %for.cond1.preheader.preheader.i.new ], [ %niter.next.7, %for.cond1.preheader.i ] %4 = mul nuw nsw i64 %indvar.i, 404 %gep.i = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 %4 tail call void @llvm.memset.p0.i64(ptr align 8 %gep.i, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar.i, 404 %gep = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), 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.i, 404 %gep22 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 808), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep22, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar.i, 404 %gep23 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 1212), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 4 %gep23, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar.i, 404 %gep24 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 1616), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 8 %gep24, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar.i, 404 %gep25 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2020), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 4 %gep25, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar.i, 404 %gep26 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2424), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep26, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar.i, 404 %gep27 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 2828), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 4 %gep27, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.i.7 = add nuw nsw i64 %indvar.i, 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 %Initialization.exit.unr-lcssa, label %for.cond1.preheader.i, !llvm.loop !9 Initialization.exit.unr-lcssa: ; preds = %for.cond1.preheader.i, %for.cond1.preheader.preheader.i %indvar.i.unr = phi i64 [ 0, %for.cond1.preheader.preheader.i ], [ %indvar.next.i.7, %for.cond1.preheader.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %Initialization.exit, label %for.cond1.preheader.i.epil for.cond1.preheader.i.epil: ; preds = %Initialization.exit.unr-lcssa, %for.cond1.preheader.i.epil %indvar.i.epil = phi i64 [ %indvar.next.i.epil, %for.cond1.preheader.i.epil ], [ %indvar.i.unr, %Initialization.exit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.i.epil ], [ 0, %Initialization.exit.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.i.epil, 404 %gep.i.epil = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @Adj, i64 0, i64 1, i64 1), i64 %12 tail call void @llvm.memset.p0.i64(ptr align 4 %gep.i.epil, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.i.epil = add nuw nsw i64 %indvar.i.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %Initialization.exit, label %for.cond1.preheader.i.epil, !llvm.loop !15 Initialization.exit: ; preds = %for.cond1.preheader.i.epil, %Initialization.exit.unr-lcssa %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.body, label %Print.exit for.body: ; preds = %Initialization.exit, %for.inc8 %i.017 = phi i32 [ %inc9, %for.inc8 ], [ 0, %Initialization.exit ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %element, ptr noundef nonnull %number) %13 = load i32, ptr %number, align 4, !tbaa !5 %cmp314 = icmp sgt i32 %13, 0 br i1 %cmp314, label %for.body4, label %for.inc8 for.body4: ; preds = %for.body, %for.body4 %j.015 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key) %14 = load i32, ptr %element, align 4, !tbaa !5 %idxprom = sext i32 %14 to i64 %15 = load i32, ptr %key, align 4, !tbaa !5 %idxprom6 = sext i32 %15 to i64 %arrayidx7 = getelementptr inbounds [101 x [101 x i32]], ptr @Adj, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.015, 1 %16 = load i32, ptr %number, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %16 br i1 %cmp3, label %for.body4, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body4, %for.body %inc9 = add nuw nsw i32 %i.017, 1 %17 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %17 br i1 %cmp, label %for.body, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 %cmp.not20.i = icmp slt i32 %17, 1 br i1 %cmp.not20.i, label %Print.exit, label %for.cond1.preheader.i13 for.cond1.preheader.i13: ; preds = %for.end10, %for.end.i %18 = phi i32 [ %24, %for.end.i ], [ %17, %for.end10 ] %indvars.iv23.i = phi i64 [ %indvars.iv.next24.i, %for.end.i ], [ 1, %for.end10 ] %cmp2.not18.i = icmp slt i32 %18, 1 br i1 %cmp2.not18.i, label %for.end.i, label %for.body3.i for.body3.i: ; preds = %for.cond1.preheader.i13, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 1, %for.cond1.preheader.i13 ] %arrayidx5.i = getelementptr inbounds [101 x [101 x i32]], ptr @Adj, i64 0, i64 %indvars.iv23.i, i64 %indvars.iv.i %19 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19) %20 = load i32, ptr @n, align 4, !tbaa !5 %21 = zext i32 %20 to i64 %cmp6.not.i = icmp eq i64 %indvars.iv.i, %21 br i1 %cmp6.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body3.i %putchar17.i = call i32 @putchar(i32 32) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body3.i %22 = phi i32 [ %20, %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 %for.end.i, !llvm.loop !13 for.end.i: ; preds = %for.inc.i, %for.cond1.preheader.i13 %putchar.i = call i32 @putchar(i32 10) %indvars.iv.next24.i = add nuw nsw i64 %indvars.iv23.i, 1 %24 = load i32, ptr @n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp.not.not.i = icmp slt i64 %indvars.iv23.i, %25 br i1 %cmp.not.not.i, label %for.cond1.preheader.i13, label %Print.exit, !llvm.loop !14 Print.exit: ; preds = %for.end.i, %entry, %Initialization.exit, %for.end10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %element) #6 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 @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 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 = { nofree nounwind } 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, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #define N 100 int main(void){ int i,j,n,u,k,w; int v[N][N]; scanf("%d",&n); for(i =0; i<n ;i++){ for (j=0 ; j<n; j++){ v[i][j]=0; } } for(i=0 ;i<n;i++){ scanf("%d%d",&u,&k); for (j=0;j<k;j++){ scanf("%d",&w); v[u-1][w-1]=1; } } for (i =0 ; i <n ;i++){ for(j=0 ; j<n ; j++){ if(j) printf(" "); printf("%d",v[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292749/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"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %u = alloca i32, align 4 %k = alloca i32, align 4 %w = alloca i32, align 4 %v = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 call void @llvm.lifetime.start.p0(i64 40000, 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 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.cond1.preheader.us.preheader, label %for.end46 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 %invariant.gep = getelementptr i8, ptr %v, i64 400 %invariant.gep83 = getelementptr i8, ptr %v, i64 800 %invariant.gep85 = getelementptr i8, ptr %v, i64 1200 %invariant.gep87 = getelementptr i8, ptr %v, i64 1600 %invariant.gep89 = getelementptr i8, ptr %v, i64 2000 %invariant.gep91 = getelementptr i8, ptr %v, i64 2400 %invariant.gep93 = getelementptr i8, ptr %v, i64 2800 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 %v, i64 %4 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep84 = getelementptr i8, ptr %invariant.gep83, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep84, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep86 = getelementptr i8, ptr %invariant.gep85, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep86, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep88 = getelementptr i8, ptr %invariant.gep87, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep88, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep94, 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 %v, i64 %12 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 %cmp65, label %for.body11, label %for.end46 for.cond28.preheader: ; preds = %for.inc25 %cmp2973 = icmp sgt i32 %17, 0 br i1 %cmp2973, label %for.cond31.preheader, label %for.end46 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.170 = 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 %k, align 4, !tbaa !5 %cmp1467 = icmp sgt i32 %13, 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 %w) %14 = load i32, ptr %u, align 4, !tbaa !5 %sub = add nsw i32 %14, -1 %idxprom17 = sext i32 %sub to i64 %15 = load i32, ptr %w, align 4, !tbaa !5 %sub19 = add nsw i32 %15, -1 %idxprom20 = sext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr %v, i64 0, i64 %idxprom17, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.168, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %16 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.170, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %17 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end42 %18 = phi i32 [ %24, %for.end42 ], [ %17, %for.cond28.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end42 ], [ 0, %for.cond28.preheader ] %cmp3271 = icmp sgt i32 %18, 0 br i1 %cmp3271, label %if.end.peel, label %for.end42 if.end.peel: ; preds = %for.cond31.preheader %arrayidx38.peel = getelementptr inbounds [100 x [100 x i32]], ptr %v, i64 0, i64 %indvars.iv79, i64 0 %19 = load i32, ptr %arrayidx38.peel, align 16, !tbaa !5 %call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19) %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %20, 1 br i1 %cmp32.peel, label %if.end, label %for.end42 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar62 = call i32 @putchar(i32 32) %arrayidx38 = getelementptr inbounds [100 x [100 x i32]], ptr %v, i64 0, i64 %indvars.iv79, i64 %indvars.iv %21 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp32, label %if.end, label %for.end42, !llvm.loop !15 for.end42: ; preds = %if.end, %if.end.peel, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp29 = icmp slt i64 %indvars.iv.next80, %25 br i1 %cmp29, label %for.cond31.preheader, label %for.end46, !llvm.loop !17 for.end46: ; preds = %for.end42, %entry, %for.cond9.preheader, %for.cond28.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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.peeled.count", i32 1} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int i,j,k,u,n,l; int adj[1000]; int finish[1000][1000]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&u,&k); for(j=0;j<k;j++){ scanf("%d",&adj[j]); for(l=0;l<n;l++){ if(adj[j]==l+1){ finish[i][l]=1; }/*else{ finish[i][l]=0; }*/ } } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(j>0){ printf(" "); } printf("%d",finish[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292806/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292806/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %u = alloca i32, align 4 %n = alloca i32, align 4 %adj = alloca [1000 x i32], align 16 %finish = alloca [1000 x [1000 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %adj) #4 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %finish) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp64 = icmp sgt i32 %0, 0 br i1 %cmp64, label %for.body, label %for.end43 for.cond22.preheader: ; preds = %for.inc19 %cmp2368 = icmp sgt i32 %8, 0 br i1 %cmp2368, label %for.cond25.preheader, label %for.end43 for.body: ; preds = %entry, %for.inc19 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.inc19 ], [ 0, %entry ] %call1 = 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 %cmp362 = icmp sgt i32 %1, 0 br i1 %cmp362, label %for.body4, label %for.body.for.inc19_crit_edge for.body.for.inc19_crit_edge: ; preds = %for.body %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc19 for.body4: ; preds = %for.body, %for.inc16 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc16 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %adj, i64 0, i64 %indvars.iv71 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp760 = icmp sgt i32 %2, 0 br i1 %cmp760, label %for.body8.lr.ph, label %for.inc16 for.body8.lr.ph: ; preds = %for.body4 %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %2, 1 br i1 %5, label %for.inc16.loopexit.unr-lcssa, label %for.body8.lr.ph.new for.body8.lr.ph.new: ; preds = %for.body8.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body8 for.body8: ; preds = %for.inc.1, %for.body8.lr.ph.new %indvars.iv = phi i64 [ 0, %for.body8.lr.ph.new ], [ %indvars.iv.next.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body8.lr.ph.new ], [ %niter.next.1, %for.inc.1 ] %indvars.iv.next = or i64 %indvars.iv, 1 %cmp11 = icmp eq i64 %indvars.iv.next, %4 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body8 %arrayidx15 = getelementptr inbounds [1000 x [1000 x i32]], ptr %finish, i64 0, i64 %indvars.iv74, i64 %indvars.iv store i32 1, ptr %arrayidx15, align 8, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body8, %if.then %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %cmp11.1 = icmp eq i64 %indvars.iv.next.1, %4 br i1 %cmp11.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %arrayidx15.1 = getelementptr inbounds [1000 x [1000 x i32]], ptr %finish, i64 0, i64 %indvars.iv74, i64 %indvars.iv.next store i32 1, ptr %arrayidx15.1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %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.inc16.loopexit.unr-lcssa, label %for.body8, !llvm.loop !9 for.inc16.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body8.lr.ph %indvars.iv.unr = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next.1, %for.inc.1 ] %lcmp.mod.not = icmp ne i64 %xtraiter, 0 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 %cmp11.epil = icmp eq i64 %indvars.iv.next.epil, %4 %or.cond = select i1 %lcmp.mod.not, i1 %cmp11.epil, i1 false br i1 %or.cond, label %if.then.epil, label %for.inc16 if.then.epil: ; preds = %for.inc16.loopexit.unr-lcssa %arrayidx15.epil = getelementptr inbounds [1000 x [1000 x i32]], ptr %finish, i64 0, i64 %indvars.iv74, i64 %indvars.iv.unr store i32 1, ptr %arrayidx15.epil, align 4, !tbaa !5 br label %for.inc16 for.inc16: ; preds = %for.inc16.loopexit.unr-lcssa, %if.then.epil, %for.body4 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %6 = load i32, ptr %k, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp3 = icmp slt i64 %indvars.iv.next72, %7 br i1 %cmp3, label %for.body4, label %for.inc19, !llvm.loop !11 for.inc19: ; preds = %for.inc16, %for.body.for.inc19_crit_edge %8 = phi i32 [ %.pre, %for.body.for.inc19_crit_edge ], [ %2, %for.inc16 ] %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next75, %9 br i1 %cmp, label %for.body, label %for.cond22.preheader, !llvm.loop !12 for.cond25.preheader: ; preds = %for.cond22.preheader, %for.end39 %10 = phi i32 [ %16, %for.end39 ], [ %8, %for.cond22.preheader ] %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.end39 ], [ 0, %for.cond22.preheader ] %cmp2666 = icmp sgt i32 %10, 0 br i1 %cmp2666, label %if.end31.peel, label %for.end39 if.end31.peel: ; preds = %for.cond25.preheader %arrayidx35.peel = getelementptr inbounds [1000 x [1000 x i32]], ptr %finish, i64 0, i64 %indvars.iv81, i64 0 %11 = load i32, ptr %arrayidx35.peel, align 16, !tbaa !5 %call36.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp26.peel = icmp sgt i32 %12, 1 br i1 %cmp26.peel, label %if.end31, label %for.end39 if.end31: ; preds = %if.end31.peel, %if.end31 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %if.end31 ], [ 1, %if.end31.peel ] %putchar59 = call i32 @putchar(i32 32) %arrayidx35 = getelementptr inbounds [1000 x [1000 x i32]], ptr %finish, i64 0, i64 %indvars.iv81, i64 %indvars.iv77 %13 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13) %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp26 = icmp slt i64 %indvars.iv.next78, %15 br i1 %cmp26, label %if.end31, label %for.end39, !llvm.loop !13 for.end39: ; preds = %if.end31, %if.end31.peel, %for.cond25.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %16 = load i32, ptr %n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp23 = icmp slt i64 %indvars.iv.next82, %17 br i1 %cmp23, label %for.cond25.preheader, label %for.end43, !llvm.loop !15 for.end43: ; preds = %for.end39, %entry, %for.cond22.preheader call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %finish) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %adj) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 = !{!"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} !14 = !{!"llvm.loop.peeled.count", i32 1} !15 = distinct !{!15, !10}
#include <stdio.h> int main(){ int i, j, n, u, k, temp; int Adj[101][101]; scanf("%d", &n); for(i=1; i<=n; i++){ for(j=1; j<=n; j++){ Adj[i][j] = 0; } } for(i=0; i<n; i++){ scanf("%d%d", &u, &k); for(j=0; j<k; j++){ scanf("%d",&temp); Adj[u][temp] = 1; } } for(i=1; i<=n; i++){ for(j=1; j<=n; j++){ if(j == 1) printf("%d", Adj[i][j]); else printf(" %d", Adj[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292857/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292857/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"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %u = alloca i32, align 4 %k = alloca i32, align 4 %temp = alloca i32, align 4 %Adj = alloca [101 x [101 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %Adj) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not70 = icmp slt i32 %0, 1 br i1 %cmp.not70, label %for.end50, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %invariant.gep = getelementptr inbounds i8, ptr %Adj, i64 408 %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 %invariant.gep89 = getelementptr i8, ptr %invariant.gep, i64 404 %invariant.gep91 = getelementptr i8, ptr %invariant.gep, i64 808 %invariant.gep93 = getelementptr i8, ptr %invariant.gep, i64 1212 %invariant.gep95 = getelementptr i8, ptr %invariant.gep, i64 1616 %invariant.gep97 = getelementptr i8, ptr %invariant.gep, i64 2020 %invariant.gep99 = getelementptr i8, ptr %invariant.gep, i64 2424 %invariant.gep101 = getelementptr i8, ptr %invariant.gep, i64 2828 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, 404 %gep = getelementptr i8, ptr %invariant.gep, i64 %4 call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 404 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %5 call void @llvm.memset.p0.i64(ptr align 4 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 404 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 404 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %7 call void @llvm.memset.p0.i64(ptr align 4 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 404 %gep96 = getelementptr i8, ptr %invariant.gep95, i64 %8 call void @llvm.memset.p0.i64(ptr align 8 %gep96, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 404 %gep98 = getelementptr i8, ptr %invariant.gep97, i64 %9 call void @llvm.memset.p0.i64(ptr align 4 %gep98, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 404 %gep100 = getelementptr i8, ptr %invariant.gep99, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep100, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 404 %gep102 = getelementptr i8, ptr %invariant.gep101, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %gep102, 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, 404 %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %12 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 %cmp1074 = icmp sgt i32 %0, 0 br i1 %cmp1074, label %for.body11, label %for.end50 for.cond27.preheader: ; preds = %for.inc24 %cmp28.not78 = icmp slt i32 %17, 1 br i1 %cmp28.not78, label %for.end50, label %for.cond30.preheader for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.175 = phi i32 [ %inc25, %for.inc24 ], [ 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 %k, align 4, !tbaa !5 %cmp1472 = icmp sgt i32 %13, 0 br i1 %cmp1472, label %for.body15, label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %j.173 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %14 = load i32, ptr %u, align 4, !tbaa !5 %idxprom17 = sext i32 %14 to i64 %15 = load i32, ptr %temp, align 4, !tbaa !5 %idxprom19 = sext i32 %15 to i64 %arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr %Adj, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.173, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %16 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !13 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.175, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc25, %17 br i1 %cmp10, label %for.body11, label %for.cond27.preheader, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond27.preheader, %for.end46 %18 = phi i32 [ %22, %for.end46 ], [ %17, %for.cond27.preheader ] %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.end46 ], [ 1, %for.cond27.preheader ] %cmp31.not76 = icmp slt i32 %18, 1 br i1 %cmp31.not76, label %for.end46, label %for.inc44.peel for.inc44.peel: ; preds = %for.cond30.preheader %arrayidx37 = getelementptr inbounds [101 x [101 x i32]], ptr %Adj, i64 0, i64 %indvars.iv83, i64 1 %19 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19) %.pre = load i32, ptr %n, align 4, !tbaa !5 %cmp31.not.not.peel = icmp sgt i32 %.pre, 1 br i1 %cmp31.not.not.peel, label %for.inc44, label %for.end46 for.inc44: ; preds = %for.inc44.peel, %for.inc44 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc44 ], [ 2, %for.inc44.peel ] %arrayidx42 = getelementptr inbounds [101 x [101 x i32]], ptr %Adj, i64 0, i64 %indvars.iv83, i64 %indvars.iv %20 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20) %.pre86 = load i32, ptr %n, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %21 = sext i32 %.pre86 to i64 %cmp31.not.not = icmp slt i64 %indvars.iv, %21 br i1 %cmp31.not.not, label %for.inc44, label %for.end46, !llvm.loop !15 for.end46: ; preds = %for.inc44, %for.inc44.peel, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp28.not.not = icmp slt i64 %indvars.iv83, %23 br i1 %cmp28.not.not, label %for.cond30.preheader, label %for.end50, !llvm.loop !17 for.end50: ; preds = %for.end46, %entry, %for.cond9.preheader, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %Adj) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #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: 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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.peeled.count", i32 1} !17 = distinct !{!17, !10}
#include<stdio.h> #define N 100 void init(void); void printGraph(void); int graph[N][N]; int n; int main() { int i, j, l, m, in; init(); scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d %d", &l, &m); for (j = 0; j < m; j++) { scanf("%d", &in); graph[l - 1][in - 1] = 1; } } printGraph(); return 0; } void init(void) { int i, j; for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { graph[i][j] = 0; } } } void printGraph(void) { int i, j; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (j > 0) printf(" "); printf("%d", graph[i][j]); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292921/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 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @graph = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i32, align 4 %m = alloca i32, align 4 %in = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in) #6 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) @graph, 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 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.body, label %printGraph.exit for.body: ; preds = %entry, %for.inc9 %i.017 = phi i32 [ %inc10, %for.inc9 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %m) %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp314 = icmp sgt i32 %1, 0 br i1 %cmp314, label %for.body4, label %for.inc9 for.body4: ; preds = %for.body, %for.body4 %j.015 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %2 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %in, align 4, !tbaa !5 %sub6 = add nsw i32 %3, -1 %idxprom7 = sext i32 %sub6 to i64 %arrayidx8 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %idxprom, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.015, 1 %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body4, label %for.inc9, !llvm.loop !9 for.inc9: ; preds = %for.body4, %for.body %inc10 = add nuw nsw i32 %i.017, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc10, %5 br i1 %cmp, label %for.body, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.inc9 %cmp20.i = icmp sgt i32 %5, 0 br i1 %cmp20.i, label %for.cond1.preheader.i, label %printGraph.exit for.cond1.preheader.i: ; preds = %for.end11, %for.end.i %6 = phi i32 [ %11, %for.end.i ], [ %5, %for.end11 ] %indvars.iv24.i = phi i64 [ %indvars.iv.next25.i, %for.end.i ], [ 0, %for.end11 ] %cmp218.i = icmp sgt i32 %6, 0 br i1 %cmp218.i, label %if.end.peel.i, label %for.end.i if.end.peel.i: ; preds = %for.cond1.preheader.i %arrayidx6.peel.phi.trans.insert.i = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %indvars.iv24.i, i64 0 %.pre.i = load i32, ptr %arrayidx6.peel.phi.trans.insert.i, align 16, !tbaa !5 %call7.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i) %7 = load i32, ptr @n, align 4, !tbaa !5 %cmp2.peel.i = icmp sgt i32 %7, 1 br i1 %cmp2.peel.i, label %if.end.i, label %for.end.i if.end.i: ; preds = %if.end.peel.i, %if.end.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ] %putchar17.i = call i32 @putchar(i32 32) %arrayidx6.i = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %indvars.iv24.i, i64 %indvars.iv.i %8 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %call7.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %9 = load i32, ptr @n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %10 br i1 %cmp2.i, label %if.end.i, label %for.end.i, !llvm.loop !12 for.end.i: ; preds = %if.end.i, %if.end.peel.i, %for.cond1.preheader.i %putchar.i = call i32 @putchar(i32 10) %indvars.iv.next25.i = add nuw nsw i64 %indvars.iv24.i, 1 %11 = load i32, ptr @n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp.i = icmp slt i64 %indvars.iv.next25.i, %12 br i1 %cmp.i, label %for.cond1.preheader.i, label %printGraph.exit, !llvm.loop !14 printGraph.exit: ; preds = %for.end.i, %entry, %for.end11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @init() local_unnamed_addr #2 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) @graph, i8 0, i64 40000, i1 false), !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @printGraph() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end11 for.cond1.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %6, %for.end ], [ %0, %entry ] %indvars.iv24 = phi i64 [ %indvars.iv.next25, %for.end ], [ 0, %entry ] %cmp218 = icmp sgt i32 %1, 0 br i1 %cmp218, label %if.end.peel, label %for.end if.end.peel: ; preds = %for.cond1.preheader %arrayidx6.peel.phi.trans.insert = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %indvars.iv24, i64 0 %.pre = load i32, ptr %arrayidx6.peel.phi.trans.insert, align 16, !tbaa !5 %call7.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %2 = load i32, ptr @n, align 4, !tbaa !5 %cmp2.peel = icmp sgt i32 %2, 1 br i1 %cmp2.peel, label %if.end, label %for.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar17 = tail call i32 @putchar(i32 32) %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @graph, i64 0, i64 %indvars.iv24, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %if.end, label %for.end, !llvm.loop !12 for.end: ; preds = %if.end, %if.end.peel, %for.cond1.preheader %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next25, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end11, !llvm.loop !14 for.end11: ; preds = %for.end, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 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 nofree nosync nounwind willreturn memory(write, 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 #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) } 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} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !10}
#include<stdio.h> int main() { int i,j,k,l,m,n; scanf("%d",&n); int a[n][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",&k,&l); for(j=0;j<l;j++){ scanf("%d",&m); a[k-1][m-1]=1; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(j!=0){ printf(" "); } printf("%d",a[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_292965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_292965/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"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %l = alloca i32, align 4 %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %3 = mul nuw i64 %1, %1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %4, 0 br i1 %cmp66, label %for.cond1.preheader.us.preheader, label %for.end47 for.cond1.preheader.us.preheader: ; preds = %entry %5 = shl nuw nsw i64 %1, 2 %6 = zext i32 %4 to i64 %7 = shl nuw nsw i64 %6, 2 %xtraiter = and i64 %6, 7 %8 = icmp ult i32 %4, 8 br i1 %8, 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 %6, 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 ] %9 = mul nuw nsw i64 %5, %indvar %scevgep = getelementptr i8, ptr %vla, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %10 = mul nuw nsw i64 %5, %indvar.next %scevgep.1 = getelementptr i8, ptr %vla, i64 %10 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.1 = or i64 %indvar, 2 %11 = mul nuw nsw i64 %5, %indvar.next.1 %scevgep.2 = getelementptr i8, ptr %vla, i64 %11 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.2, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.2 = or i64 %indvar, 3 %12 = mul nuw nsw i64 %5, %indvar.next.2 %scevgep.3 = getelementptr i8, ptr %vla, i64 %12 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.3, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.3 = or i64 %indvar, 4 %13 = mul nuw nsw i64 %5, %indvar.next.3 %scevgep.4 = getelementptr i8, ptr %vla, i64 %13 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.4 = or i64 %indvar, 5 %14 = mul nuw nsw i64 %5, %indvar.next.4 %scevgep.5 = getelementptr i8, ptr %vla, i64 %14 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.5, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.5 = or i64 %indvar, 6 %15 = mul nuw nsw i64 %5, %indvar.next.5 %scevgep.6 = getelementptr i8, ptr %vla, i64 %15 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.6, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.6 = or i64 %indvar, 7 %16 = mul nuw nsw i64 %5, %indvar.next.6 %scevgep.7 = getelementptr i8, ptr %vla, i64 %16 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.7, i8 0, i64 %7, 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 ] %17 = mul nuw nsw i64 %5, %indvar.epil %scevgep.epil = getelementptr i8, ptr %vla, i64 %17 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %7, 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 %cmp66, label %for.body11, label %for.end47 for.cond28.preheader: ; preds = %for.inc25 %cmp2974 = icmp sgt i32 %23, 0 br i1 %cmp2974, label %for.cond31.preheader, label %for.end47 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.171 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k, ptr noundef nonnull %l) %18 = load i32, ptr %l, align 4, !tbaa !5 %cmp1468 = icmp sgt i32 %18, 0 br i1 %cmp1468, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.169 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %19 = load i32, ptr %k, align 4, !tbaa !5 %sub = add nsw i32 %19, -1 %idxprom17 = sext i32 %sub to i64 %20 = mul nsw i64 %idxprom17, %1 %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %20 %21 = load i32, ptr %m, align 4, !tbaa !5 %sub19 = add nsw i32 %21, -1 %idxprom20 = sext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds i32, ptr %arrayidx18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.169, 1 %22 = load i32, ptr %l, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %22 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.171, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %23 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end43 %24 = phi i32 [ %31, %for.end43 ], [ %23, %for.cond28.preheader ] %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.end43 ], [ 0, %for.cond28.preheader ] %cmp3272 = icmp sgt i32 %24, 0 br i1 %cmp3272, label %if.end.peel, label %for.end43 if.end.peel: ; preds = %for.cond31.preheader %25 = mul nuw nsw i64 %indvars.iv80, %1 %arrayidx37 = getelementptr inbounds i32, ptr %vla, i64 %25 %26 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call40.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26) %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %27, 1 br i1 %cmp32.peel, label %if.end, label %for.end43 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar63 = call i32 @putchar(i32 32) %arrayidx39 = getelementptr inbounds i32, ptr %arrayidx37, i64 %indvars.iv %28 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %29 = load i32, ptr %n, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %30 br i1 %cmp32, label %if.end, label %for.end43, !llvm.loop !15 for.end43: ; preds = %if.end, %if.end.peel, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %31 = load i32, ptr %n, align 4, !tbaa !5 %32 = sext i32 %31 to i64 %cmp29 = icmp slt i64 %indvars.iv.next81, %32 br i1 %cmp29, label %for.cond31.preheader, label %for.end47, !llvm.loop !17 for.end47: ; preds = %for.end43, %entry, %for.cond9.preheader, %for.cond28.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 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 declare void @llvm.stackrestore.p0(ptr) #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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } 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} !16 = !{!"llvm.loop.peeled.count", i32 1} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int G[100][100],n,i,j,s,u,k; 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); if(k!=0)for(j=0;j<k;j++){ scanf("%d",&s); G[u-1][s-1] = 1; } } for(i=0;i<n;i++) for(j=0;j<n;j++){ if(j!=n-1)printf("%d ",G[i][j]); else printf("%d\n",G[i][j]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293007/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293007/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"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = 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: %G = alloca [100 x [100 x i32]], align 16 %n = alloca i32, align 4 %s = alloca i32, align 4 %u = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %G) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, 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 %cmp74 = icmp sgt i32 %0, 0 br i1 %cmp74, label %for.cond1.preheader.us.preheader, label %for.end54 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 %invariant.gep = getelementptr i8, ptr %G, i64 400 %invariant.gep100 = getelementptr i8, ptr %G, i64 800 %invariant.gep102 = getelementptr i8, ptr %G, i64 1200 %invariant.gep104 = getelementptr i8, ptr %G, i64 1600 %invariant.gep106 = getelementptr i8, ptr %G, i64 2000 %invariant.gep108 = getelementptr i8, ptr %G, i64 2400 %invariant.gep110 = getelementptr i8, ptr %G, i64 2800 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 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep101 = getelementptr i8, ptr %invariant.gep100, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep101, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep103 = getelementptr i8, ptr %invariant.gep102, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep103, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep105 = getelementptr i8, ptr %invariant.gep104, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep105, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep107 = getelementptr i8, ptr %invariant.gep106, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep107, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep109 = getelementptr i8, ptr %invariant.gep108, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep109, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep111 = getelementptr i8, ptr %invariant.gep110, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep111, 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 %G, i64 %12 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 %cmp74, label %for.body11, label %for.end54 for.cond29.preheader: ; preds = %for.inc26 %cmp3082 = icmp sgt i32 %17, 0 br i1 %cmp3082, label %for.cond32.preheader, label %for.end54 for.body11: ; preds = %for.cond9.preheader, %for.inc26 %i.179 = phi i32 [ %inc27, %for.inc26 ], [ 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 %k, align 4 %cmp1576 = icmp sgt i32 %13, 0 br i1 %cmp1576, label %for.body16, label %for.inc26 for.body16: ; preds = %for.body11, %for.body16 %j.177 = phi i32 [ %inc24, %for.body16 ], [ 0, %for.body11 ] %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %14 = load i32, ptr %u, align 4, !tbaa !5 %sub = add nsw i32 %14, -1 %idxprom18 = sext i32 %sub to i64 %15 = load i32, ptr %s, align 4, !tbaa !5 %sub20 = add nsw i32 %15, -1 %idxprom21 = sext i32 %sub20 to i64 %arrayidx22 = getelementptr inbounds [100 x [100 x i32]], ptr %G, i64 0, i64 %idxprom18, i64 %idxprom21 store i32 1, ptr %arrayidx22, align 4, !tbaa !5 %inc24 = add nuw nsw i32 %j.177, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp15 = icmp slt i32 %inc24, %16 br i1 %cmp15, label %for.body16, label %for.inc26, !llvm.loop !13 for.inc26: ; preds = %for.body16, %for.body11 %inc27 = add nuw nsw i32 %i.179, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc27, %17 br i1 %cmp10, label %for.body11, label %for.cond29.preheader, !llvm.loop !14 for.cond32.preheader: ; preds = %for.cond29.preheader, %for.inc52 %18 = phi i32 [ %24, %for.inc52 ], [ %17, %for.cond29.preheader ] %indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.inc52 ], [ 0, %for.cond29.preheader ] %cmp3380 = icmp sgt i32 %18, 0 br i1 %cmp3380, label %for.body34, label %for.cond32.preheader.for.inc52_crit_edge for.cond32.preheader.for.inc52_crit_edge: ; preds = %for.cond32.preheader %.pre = sext i32 %18 to i64 br label %for.inc52 for.body34: ; preds = %for.cond32.preheader, %for.body34 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body34 ], [ 0, %for.cond32.preheader ] %19 = phi i32 [ %22, %for.body34 ], [ %18, %for.cond32.preheader ] %sub35 = add nsw i32 %19, -1 %20 = zext i32 %sub35 to i64 %cmp36.not = icmp eq i64 %indvars.iv, %20 %arrayidx46 = getelementptr inbounds [100 x [100 x i32]], ptr %G, i64 0, i64 %indvars.iv88, i64 %indvars.iv %21 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %.str.3..str.2 = select i1 %cmp36.not, ptr @.str.3, ptr @.str.2 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2, i32 noundef %21) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp33 = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp33, label %for.body34, label %for.inc52, !llvm.loop !15 for.inc52: ; preds = %for.body34, %for.cond32.preheader.for.inc52_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond32.preheader.for.inc52_crit_edge ], [ %23, %for.body34 ] %24 = phi i32 [ %18, %for.cond32.preheader.for.inc52_crit_edge ], [ %22, %for.body34 ] %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %cmp30 = icmp slt i64 %indvars.iv.next89, %.pre-phi br i1 %cmp30, label %for.cond32.preheader, label %for.end54, !llvm.loop !16 for.end54: ; preds = %for.inc52, %entry, %for.cond9.preheader, %for.cond29.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %G) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !17} !17 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> #define N 100 int G[N][N]; int main(){ int i,j,n,k,v,e,t; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&v,&e); for(j=0;j<e;j++){ scanf("%d",&t); G[i][t-1]=1; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ printf("%d",G[i][j]); if(j<n-1){ printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293050/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293050/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"%d%d\00", align 1 @G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %v = alloca i32, align 4 %e = alloca i32, align 4 %t = 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 %v) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %for.end31 for.cond11.preheader: ; preds = %for.inc8 %cmp1249 = icmp sgt i32 %4, 0 br i1 %cmp1249, label %for.cond14.preheader, label %for.end31 for.body: ; preds = %entry, %for.inc8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc8 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %e) %1 = load i32, ptr %e, align 4, !tbaa !5 %cmp343 = icmp sgt i32 %1, 0 br i1 %cmp343, label %for.body4, label %for.inc8 for.body4: ; preds = %for.body, %for.body4 %j.044 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %2 = load i32, ptr %t, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom6 = sext i32 %sub to i64 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.044, 1 %3 = load i32, ptr %e, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %3 br i1 %cmp3, label %for.body4, label %for.inc8, !llvm.loop !9 for.inc8: ; preds = %for.body4, %for.body %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.cond11.preheader, !llvm.loop !11 for.cond14.preheader: ; preds = %for.cond11.preheader, %for.end27 %6 = phi i32 [ %12, %for.end27 ], [ %4, %for.cond11.preheader ] %indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.end27 ], [ 0, %for.cond11.preheader ] %cmp1547 = icmp sgt i32 %6, 0 br i1 %cmp1547, label %for.body16, label %for.end27 for.body16: ; preds = %for.cond14.preheader, %for.inc25 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.inc25 ], [ 0, %for.cond14.preheader ] %arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv55, i64 %indvars.iv52 %7 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %sub22 = add nsw i32 %8, -1 %9 = sext i32 %sub22 to i64 %cmp23 = icmp slt i64 %indvars.iv52, %9 br i1 %cmp23, label %if.then, label %for.inc25 if.then: ; preds = %for.body16 %putchar42 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body16, %if.then %10 = phi i32 [ %8, %for.body16 ], [ %.pre, %if.then ] %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %11 = sext i32 %10 to i64 %cmp15 = icmp slt i64 %indvars.iv.next53, %11 br i1 %cmp15, label %for.body16, label %for.end27, !llvm.loop !12 for.end27: ; preds = %for.inc25, %for.cond14.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp12 = icmp slt i64 %indvars.iv.next56, %13 br i1 %cmp12, label %for.cond14.preheader, label %for.end31, !llvm.loop !13 for.end31: ; preds = %for.end27, %entry, %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(){ int n, u, k, v, i, j, A[101][101]; 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; } } for(i = 1; i <= n; i++){ for(j = 1; j < n; j++){ printf("%d ", A[i][j]); } printf("%d\n", A[i][j]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293094/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293094/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"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = 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 %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 %A = alloca [101 x [101 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not67 = icmp slt i32 %0, 1 br i1 %cmp.not67, label %for.end48, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %invariant.gep = getelementptr inbounds i8, ptr %A, i64 408 %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 %invariant.gep83 = getelementptr i8, ptr %invariant.gep, i64 404 %invariant.gep85 = getelementptr i8, ptr %invariant.gep, i64 808 %invariant.gep87 = getelementptr i8, ptr %invariant.gep, i64 1212 %invariant.gep89 = getelementptr i8, ptr %invariant.gep, i64 1616 %invariant.gep91 = getelementptr i8, ptr %invariant.gep, i64 2020 %invariant.gep93 = getelementptr i8, ptr %invariant.gep, i64 2424 %invariant.gep95 = getelementptr i8, ptr %invariant.gep, i64 2828 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, 404 %gep = getelementptr i8, ptr %invariant.gep, i64 %4 call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 404 %gep84 = getelementptr i8, ptr %invariant.gep83, i64 %5 call void @llvm.memset.p0.i64(ptr align 4 %gep84, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 404 %gep86 = getelementptr i8, ptr %invariant.gep85, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep86, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 404 %gep88 = getelementptr i8, ptr %invariant.gep87, i64 %7 call void @llvm.memset.p0.i64(ptr align 4 %gep88, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 404 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %8 call void @llvm.memset.p0.i64(ptr align 8 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 404 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %9 call void @llvm.memset.p0.i64(ptr align 4 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 404 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 404 %gep96 = getelementptr i8, ptr %invariant.gep95, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %gep96, 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, 404 %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %12 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.not67, label %for.end48, label %for.body11 for.cond27.preheader: ; preds = %for.inc24 %cmp28.not75 = icmp slt i32 %17, 1 br i1 %cmp28.not75, label %for.end48, label %for.cond30.preheader for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.172 = 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.not69 = icmp slt i32 %13, 1 br i1 %cmp14.not69, label %for.inc24, label %for.body15 for.body15: ; preds = %for.body11, %for.body15 %j.170 = 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 [101 x [101 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.170, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14.not.not = icmp slt i32 %j.170, %16 br i1 %cmp14.not.not, label %for.body15, label %for.inc24, !llvm.loop !13 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.172, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp10.not.not = icmp slt i32 %i.172, %17 br i1 %cmp10.not.not, label %for.body11, label %for.cond27.preheader, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond27.preheader, %for.end40 %18 = phi i32 [ %23, %for.end40 ], [ %17, %for.cond27.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end40 ], [ 1, %for.cond27.preheader ] %cmp3173 = icmp sgt i32 %18, 1 br i1 %cmp3173, label %for.body32, label %for.end40 for.body32: ; preds = %for.cond30.preheader, %for.body32 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body32 ], [ 1, %for.cond30.preheader ] %arrayidx36 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv79, i64 %indvars.iv %19 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %20 = load i32, ptr %n, align 4, !tbaa !5 %21 = sext i32 %20 to i64 %cmp31 = icmp slt i64 %indvars.iv.next, %21 br i1 %cmp31, label %for.body32, label %for.end40, !llvm.loop !15 for.end40: ; preds = %for.body32, %for.cond30.preheader %j.2.lcssa = phi i64 [ 1, %for.cond30.preheader ], [ %indvars.iv.next, %for.body32 ] %idxprom43 = and i64 %j.2.lcssa, 4294967295 %arrayidx44 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv79, i64 %idxprom43 %22 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %22) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp28.not.not = icmp slt i64 %indvars.iv79, %24 br i1 %cmp28.not.not, label %for.cond30.preheader, label %for.end48, !llvm.loop !16 for.end48: ; preds = %for.end40, %entry, %for.cond9.preheader, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> int main(){ int i, j, u, k, n, v, A[101][101] = {}; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d",&u); scanf("%d", &k); for(j=1;j<=k;j++){ scanf("%d", &v); A[u][v] = 1; } } for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ if(j != 1)printf(" "); printf("%d", A[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293137/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293137/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: %u = alloca i32, align 4 %k = alloca i32, align 4 %n = alloca i32, align 4 %v = alloca i32, align 4 %A = alloca [101 x [101 x i32]], align 16 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 %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %A) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %A, i8 0, i64 40804, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, 0 br i1 %cmp44, label %for.body, label %for.end31 for.cond12.preheader: ; preds = %for.inc9 %cmp13.not48 = icmp slt i32 %5, 1 br i1 %cmp13.not48, label %for.end31, label %for.cond15.preheader for.body: ; preds = %entry, %for.inc9 %i.045 = phi i32 [ %inc10, %for.inc9 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %u) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp4.not42 = icmp slt i32 %1, 1 br i1 %cmp4.not42, label %for.inc9, label %for.body5 for.body5: ; preds = %for.body, %for.body5 %j.043 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %2 = load i32, ptr %u, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 %3 = load i32, ptr %v, align 4, !tbaa !5 %idxprom7 = sext i32 %3 to i64 %arrayidx8 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %idxprom, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.043, 1 %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp4.not.not = icmp slt i32 %j.043, %4 br i1 %cmp4.not.not, label %for.body5, label %for.inc9, !llvm.loop !9 for.inc9: ; preds = %for.body5, %for.body %inc10 = add nuw nsw i32 %i.045, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc10, %5 br i1 %cmp, label %for.body, label %for.cond12.preheader, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond12.preheader, %for.end27 %6 = phi i32 [ %12, %for.end27 ], [ %5, %for.cond12.preheader ] %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.end27 ], [ 1, %for.cond12.preheader ] %cmp16.not46 = icmp slt i32 %6, 1 br i1 %cmp16.not46, label %for.end27, label %if.end.peel if.end.peel: ; preds = %for.cond15.preheader %arrayidx23.peel = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv52, i64 1 %7 = load i32, ptr %arrayidx23.peel, align 4, !tbaa !5 %call24.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp16.not.not.peel = icmp sgt i32 %8, 1 br i1 %cmp16.not.not.peel, label %if.end, label %for.end27 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ] %putchar41 = call i32 @putchar(i32 32) %arrayidx23 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv52, i64 %indvars.iv %9 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp16.not.not = icmp slt i64 %indvars.iv, %11 br i1 %cmp16.not.not, label %if.end, label %for.end27, !llvm.loop !12 for.end27: ; preds = %if.end, %if.end.peel, %for.cond15.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp13.not.not = icmp slt i64 %indvars.iv52, %13 br i1 %cmp13.not.not, label %for.cond15.preheader, label %for.end31, !llvm.loop !14 for.end31: ; preds = %for.end27, %entry, %for.cond12.preheader call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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: 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, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.peeled.count", i32 1} !14 = distinct !{!14, !10}
#include<stdio.h> void print(); int n,i,j; int Adj[100][100]; int main() { int u,k,v; scanf("%d",&n); for( i=0 ; i<n ; i++) for( j=0 ; j<n ; j++) Adj[i][j] = 0; for( i=0 ; i<n ; i++){ scanf("%d%d", &u, &k); for( j=0 ; j<k ; j++) { scanf("%d", &v); Adj[i][v-1] = 1; } } print(); return 0; } void print() { for( i=0 ; i<n ; i++ ){ for( j=0 ; j<n ; j++ ) { printf("%d", Adj[i][j]); if(j != n-1) printf(" "); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293180/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 @i = dso_local local_unnamed_addr global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @Adj = 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 ; 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) #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, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp33 = icmp sgt i32 %0, 0 br i1 %cmp33, label %for.cond1.preheader.us.preheader, label %for.end26.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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 @Adj, 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 store i32 %0, ptr @j, align 4, !tbaa !5 store i32 0, ptr @i, align 4, !tbaa !5 br i1 %cmp33, label %for.body11, label %for.end26.thread for.body11: ; preds = %for.cond9.preheader, %for.inc24 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) store i32 0, ptr @j, align 4, !tbaa !5 %13 = load i32, ptr %k, align 4, !tbaa !5 %cmp1439 = icmp sgt i32 %13, 0 br i1 %cmp1439, label %for.body15, label %for.body11.for.inc24_crit_edge for.body11.for.inc24_crit_edge: ; preds = %for.body11 %.pre = load i32, ptr @i, align 4, !tbaa !5 br label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %14 = load i32, ptr @i, align 4, !tbaa !5 %idxprom17 = sext i32 %14 to i64 %15 = load i32, ptr %v, align 4, !tbaa !5 %sub = add nsw i32 %15, -1 %idxprom19 = sext i32 %sub to i64 %arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr @Adj, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %16 = load i32, ptr @j, align 4, !tbaa !5 %inc22 = add nsw i32 %16, 1 store i32 %inc22, ptr @j, align 4, !tbaa !5 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %17 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !13 for.inc24: ; preds = %for.body15, %for.body11.for.inc24_crit_edge %18 = phi i32 [ %.pre, %for.body11.for.inc24_crit_edge ], [ %14, %for.body15 ] %inc25 = add nsw i32 %18, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 store i32 %inc25, ptr @i, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc25, %.pr br i1 %cmp10, label %for.body11, label %for.end26, !llvm.loop !14 for.end26.thread: ; preds = %entry, %for.cond9.preheader store i32 0, ptr @i, align 4, !tbaa !5 br label %print.exit for.end26: ; preds = %for.inc24 store i32 0, ptr @i, align 4, !tbaa !5 %cmp16.i = icmp sgt i32 %.pr, 0 br i1 %cmp16.i, label %for.cond1.preheader.i, label %print.exit for.cond1.preheader.i: ; preds = %for.end26, %for.end.i %19 = phi i32 [ %27, %for.end.i ], [ %.pr, %for.end26 ] store i32 0, ptr @j, align 4, !tbaa !5 %cmp214.i = icmp sgt i32 %19, 0 br i1 %cmp214.i, label %for.body3.i, label %for.end.i for.body3.i: ; preds = %for.cond1.preheader.i, %for.inc.i %storemerge1215.i = phi i32 [ %inc.i, %for.inc.i ], [ 0, %for.cond1.preheader.i ] %20 = load i32, ptr @i, align 4, !tbaa !5 %idxprom.i = sext i32 %20 to i64 %idxprom4.i = sext i32 %storemerge1215.i to i64 %arrayidx5.i = getelementptr inbounds [100 x [100 x i32]], ptr @Adj, i64 0, i64 %idxprom.i, i64 %idxprom4.i %21 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21) %22 = load i32, ptr @j, align 4, !tbaa !5 %23 = load i32, ptr @n, align 4, !tbaa !5 %sub.i = add nsw i32 %23, -1 %cmp6.not.i = icmp eq i32 %22, %sub.i br i1 %cmp6.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body3.i %putchar13.i = call i32 @putchar(i32 32) %.pre.i = load i32, ptr @j, align 4, !tbaa !5 %.pre17.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body3.i %24 = phi i32 [ %23, %for.body3.i ], [ %.pre17.i, %if.then.i ] %25 = phi i32 [ %22, %for.body3.i ], [ %.pre.i, %if.then.i ] %inc.i = add nsw i32 %25, 1 store i32 %inc.i, ptr @j, align 4, !tbaa !5 %cmp2.i = icmp slt i32 %inc.i, %24 br i1 %cmp2.i, label %for.body3.i, label %for.end.i, !llvm.loop !15 for.end.i: ; preds = %for.inc.i, %for.cond1.preheader.i %putchar.i = call i32 @putchar(i32 10) %26 = load i32, ptr @i, align 4, !tbaa !5 %inc10.i = add nsw i32 %26, 1 store i32 %inc10.i, ptr @i, align 4, !tbaa !5 %27 = load i32, ptr @n, align 4, !tbaa !5 %cmp.i = icmp slt i32 %inc10.i, %27 br i1 %cmp.i, label %for.cond1.preheader.i, label %print.exit, !llvm.loop !16 print.exit: ; preds = %for.end.i, %for.end26.thread, %for.end26 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: 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 uwtable define dso_local void @print() local_unnamed_addr #0 { entry: store i32 0, ptr @i, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.cond1.preheader, label %for.end11 for.cond1.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %9, %for.end ], [ %0, %entry ] store i32 0, ptr @j, align 4, !tbaa !5 %cmp214 = icmp sgt i32 %1, 0 br i1 %cmp214, label %for.body3, label %for.end for.body3: ; preds = %for.cond1.preheader, %for.inc %storemerge1215 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond1.preheader ] %2 = load i32, ptr @i, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 %idxprom4 = sext i32 %storemerge1215 to i64 %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @Adj, i64 0, i64 %idxprom, i64 %idxprom4 %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %4 = load i32, ptr @j, align 4, !tbaa !5 %5 = load i32, ptr @n, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %cmp6.not = icmp eq i32 %4, %sub br i1 %cmp6.not, label %for.inc, label %if.then if.then: ; preds = %for.body3 %putchar13 = tail call i32 @putchar(i32 32) %.pre = load i32, ptr @j, align 4, !tbaa !5 %.pre17 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %6 = phi i32 [ %5, %for.body3 ], [ %.pre17, %if.then ] %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %inc = add nsw i32 %7, 1 store i32 %inc, ptr @j, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %6 br i1 %cmp2, label %for.body3, label %for.end, !llvm.loop !15 for.end: ; preds = %for.inc, %for.cond1.preheader %putchar = tail call i32 @putchar(i32 10) %8 = load i32, ptr @i, align 4, !tbaa !5 %inc10 = add nsw i32 %8, 1 store i32 %inc10, ptr @i, align 4, !tbaa !5 %9 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc10, %9 br i1 %cmp, label %for.cond1.preheader, label %for.end11, !llvm.loop !16 for.end11: ; preds = %for.end, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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}
#include<stdio.h> int main(void) { int MM[100][100]; int n, u, k, v, i, j; scanf("%d", &n); for ( i = 0; i < n; i++ ) { for ( j = 0; j < n; j++ ) MM[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--; MM[u][v] = 1; } } for ( i = 0; i < n; i++ ) { for ( j = 0; j < n; j++ ) { if ( j ) printf(" "); printf("%d", MM[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293223/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293223/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %MM = alloca [100 x [100 x i32]], align 16 %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 40000, ptr nonnull %MM) #5 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 %cmp65 = icmp sgt i32 %0, 0 br i1 %cmp65, label %for.cond1.preheader.us.preheader, label %for.end46 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 %invariant.gep = getelementptr i8, ptr %MM, i64 400 %invariant.gep83 = getelementptr i8, ptr %MM, i64 800 %invariant.gep85 = getelementptr i8, ptr %MM, i64 1200 %invariant.gep87 = getelementptr i8, ptr %MM, i64 1600 %invariant.gep89 = getelementptr i8, ptr %MM, i64 2000 %invariant.gep91 = getelementptr i8, ptr %MM, i64 2400 %invariant.gep93 = getelementptr i8, ptr %MM, i64 2800 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 %MM, i64 %4 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep84 = getelementptr i8, ptr %invariant.gep83, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep84, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep86 = getelementptr i8, ptr %invariant.gep85, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep86, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep88 = getelementptr i8, ptr %invariant.gep87, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep88, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep94, 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 %MM, i64 %12 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 %cmp65, label %for.body11, label %for.end46 for.cond28.preheader: ; preds = %for.inc25 %cmp2973 = icmp sgt i32 %18, 0 br i1 %cmp2973, label %for.cond31.preheader, label %for.end46 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.170 = 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 %cmp1467 = icmp sgt i32 %14, 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) %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 %MM, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.168, 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.170, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end42 %19 = phi i32 [ %25, %for.end42 ], [ %18, %for.cond28.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end42 ], [ 0, %for.cond28.preheader ] %cmp3271 = icmp sgt i32 %19, 0 br i1 %cmp3271, label %if.end.peel, label %for.end42 if.end.peel: ; preds = %for.cond31.preheader %arrayidx38.peel = getelementptr inbounds [100 x [100 x i32]], ptr %MM, i64 0, i64 %indvars.iv79, i64 0 %20 = load i32, ptr %arrayidx38.peel, align 16, !tbaa !5 %call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %21, 1 br i1 %cmp32.peel, label %if.end, label %for.end42 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar62 = call i32 @putchar(i32 32) %arrayidx38 = getelementptr inbounds [100 x [100 x i32]], ptr %MM, i64 0, i64 %indvars.iv79, i64 %indvars.iv %22 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp32, label %if.end, label %for.end42, !llvm.loop !15 for.end42: ; preds = %if.end, %if.end.peel, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp29 = icmp slt i64 %indvars.iv.next80, %26 br i1 %cmp29, label %for.cond31.preheader, label %for.end46, !llvm.loop !17 for.end46: ; preds = %for.end42, %entry, %for.cond9.preheader, %for.cond28.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 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %MM) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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.peeled.count", i32 1} !17 = distinct !{!17, !10}
/*s1190073 Rina Sato File name: prog11a.c This is a program that outputs adjacency matrix of a graph. */ #include <stdio.h> typedef struct Input{ int u; int k; int v[1000]; }input; int main(void){ int n,i,j,A[100][100]; input Adj[100]; scanf("%d",&n); for(i = 0 ; i < n ; i++){ scanf("%d",&Adj[i].u); scanf("%d",&Adj[i].k); if(Adj[i].k != 0){ for(j = 0 ; j < Adj[i].k ; j++){ scanf("%d",&Adj[i].v[j]); } } } 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 < Adj[i].k ; j++){ A[Adj[i].u-1][Adj[i].v[j]-1] = 1; } } for(i = 0 ; i < n ; i++){ for(j = 0 ; j < n ; j++){ printf("%d",A[i][j]); if(j < n-1){ printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293267/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293267/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.Input = type { i32, i32, [1000 x i32] } @.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 %A = alloca [100 x [100 x i32]], align 16 %Adj = alloca [100 x %struct.Input], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 400800, ptr nonnull %Adj) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp122 = icmp sgt i32 %0, 0 br i1 %cmp122, label %for.body, label %for.end89 for.cond23.preheader: ; preds = %for.inc20 %cmp24126 = icmp sgt i32 %15, 0 br i1 %cmp24126, label %for.cond26.preheader.us.preheader, label %for.end89 for.cond26.preheader.us.preheader: ; preds = %for.cond23.preheader %1 = zext i32 %15 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %15, 8 br i1 %3, label %for.cond39.preheader.unr-lcssa, label %for.cond26.preheader.us.preheader.new for.cond26.preheader.us.preheader.new: ; preds = %for.cond26.preheader.us.preheader %unroll_iter = and i64 %1, 4294967288 %invariant.gep = getelementptr i8, ptr %A, i64 400 %invariant.gep172 = getelementptr i8, ptr %A, i64 800 %invariant.gep174 = getelementptr i8, ptr %A, i64 1200 %invariant.gep176 = getelementptr i8, ptr %A, i64 1600 %invariant.gep178 = getelementptr i8, ptr %A, i64 2000 %invariant.gep180 = getelementptr i8, ptr %A, i64 2400 %invariant.gep182 = getelementptr i8, ptr %A, i64 2800 br label %for.cond26.preheader.us for.cond26.preheader.us: ; preds = %for.cond26.preheader.us, %for.cond26.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond26.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond26.preheader.us ] %niter = phi i64 [ 0, %for.cond26.preheader.us.preheader.new ], [ %niter.next.7, %for.cond26.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr %A, i64 %4 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep173 = getelementptr i8, ptr %invariant.gep172, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep173, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep175 = getelementptr i8, ptr %invariant.gep174, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep175, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep177 = getelementptr i8, ptr %invariant.gep176, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep177, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep179 = getelementptr i8, ptr %invariant.gep178, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep179, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep181 = getelementptr i8, ptr %invariant.gep180, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep181, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep183 = getelementptr i8, ptr %invariant.gep182, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep183, 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.cond39.preheader.unr-lcssa, label %for.cond26.preheader.us, !llvm.loop !9 for.body: ; preds = %entry, %for.inc20 %indvars.iv138 = phi i64 [ %indvars.iv.next139, %for.inc20 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv138 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %k = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv138, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %12 = load i32, ptr %k, align 4, !tbaa !11 %cmp13120 = icmp sgt i32 %12, 0 br i1 %cmp13120, label %for.body14, label %for.inc20 for.body14: ; preds = %for.body, %for.body14 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ 0, %for.body ] %arrayidx18 = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv138, i32 2, i64 %indvars.iv %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx18) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr %k, align 4, !tbaa !11 %14 = sext i32 %13 to i64 %cmp13 = icmp slt i64 %indvars.iv.next, %14 br i1 %cmp13, label %for.body14, label %for.inc20, !llvm.loop !13 for.inc20: ; preds = %for.body14, %for.body %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next139, %16 br i1 %cmp, label %for.body, label %for.cond23.preheader, !llvm.loop !14 for.cond39.preheader.unr-lcssa: ; preds = %for.cond26.preheader.us, %for.cond26.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond26.preheader.us.preheader ], [ %indvar.next.7, %for.cond26.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond39.preheader, label %for.cond26.preheader.us.epil for.cond26.preheader.us.epil: ; preds = %for.cond39.preheader.unr-lcssa, %for.cond26.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond26.preheader.us.epil ], [ %indvar.unr, %for.cond39.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond26.preheader.us.epil ], [ 0, %for.cond39.preheader.unr-lcssa ] %17 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr %A, i64 %17 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.cond39.preheader, label %for.cond26.preheader.us.epil, !llvm.loop !15 for.cond39.preheader: ; preds = %for.cond26.preheader.us.epil, %for.cond39.preheader.unr-lcssa br i1 %cmp24126, label %for.cond42.preheader.preheader, label %for.end89 for.cond42.preheader.preheader: ; preds = %for.cond39.preheader %wide.trip.count153 = zext i32 %15 to i64 br label %for.cond42.preheader for.cond42.preheader: ; preds = %for.cond42.preheader.preheader, %for.inc64 %indvars.iv150 = phi i64 [ 0, %for.cond42.preheader.preheader ], [ %indvars.iv.next151, %for.inc64 ] %k45 = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv150, i32 1 %18 = load i32, ptr %k45, align 4, !tbaa !11 %cmp46128 = icmp sgt i32 %18, 0 br i1 %cmp46128, label %for.body47.lr.ph, label %for.inc64 for.body47.lr.ph: ; preds = %for.cond42.preheader %arrayidx44 = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv150 %19 = load i32, ptr %arrayidx44, align 8, !tbaa !17 %sub = add nsw i32 %19, -1 %idxprom51 = sext i32 %sub to i64 %wide.trip.count148 = zext i32 %18 to i64 %xtraiter167 = and i64 %wide.trip.count148, 1 %20 = icmp eq i32 %18, 1 br i1 %20, label %for.inc64.loopexit.unr-lcssa, label %for.body47.lr.ph.new for.body47.lr.ph.new: ; preds = %for.body47.lr.ph %unroll_iter170 = and i64 %wide.trip.count148, 4294967294 br label %for.body47 for.cond67.preheader: ; preds = %for.inc64 br i1 %cmp24126, label %for.cond70.preheader, label %for.end89 for.body47: ; preds = %for.body47, %for.body47.lr.ph.new %indvars.iv145 = phi i64 [ 0, %for.body47.lr.ph.new ], [ %indvars.iv.next146.1, %for.body47 ] %niter171 = phi i64 [ 0, %for.body47.lr.ph.new ], [ %niter171.next.1, %for.body47 ] %arrayidx57 = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv150, i32 2, i64 %indvars.iv145 %21 = load i32, ptr %arrayidx57, align 8, !tbaa !5 %sub58 = add nsw i32 %21, -1 %idxprom59 = sext i32 %sub58 to i64 %arrayidx60 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %idxprom51, i64 %idxprom59 store i32 1, ptr %arrayidx60, align 4, !tbaa !5 %indvars.iv.next146 = or i64 %indvars.iv145, 1 %arrayidx57.1 = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv150, i32 2, i64 %indvars.iv.next146 %22 = load i32, ptr %arrayidx57.1, align 4, !tbaa !5 %sub58.1 = add nsw i32 %22, -1 %idxprom59.1 = sext i32 %sub58.1 to i64 %arrayidx60.1 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %idxprom51, i64 %idxprom59.1 store i32 1, ptr %arrayidx60.1, align 4, !tbaa !5 %indvars.iv.next146.1 = add nuw nsw i64 %indvars.iv145, 2 %niter171.next.1 = add i64 %niter171, 2 %niter171.ncmp.1 = icmp eq i64 %niter171.next.1, %unroll_iter170 br i1 %niter171.ncmp.1, label %for.inc64.loopexit.unr-lcssa, label %for.body47, !llvm.loop !18 for.inc64.loopexit.unr-lcssa: ; preds = %for.body47, %for.body47.lr.ph %indvars.iv145.unr = phi i64 [ 0, %for.body47.lr.ph ], [ %indvars.iv.next146.1, %for.body47 ] %lcmp.mod169.not = icmp eq i64 %xtraiter167, 0 br i1 %lcmp.mod169.not, label %for.inc64, label %for.body47.epil for.body47.epil: ; preds = %for.inc64.loopexit.unr-lcssa %arrayidx57.epil = getelementptr inbounds [100 x %struct.Input], ptr %Adj, i64 0, i64 %indvars.iv150, i32 2, i64 %indvars.iv145.unr %23 = load i32, ptr %arrayidx57.epil, align 4, !tbaa !5 %sub58.epil = add nsw i32 %23, -1 %idxprom59.epil = sext i32 %sub58.epil to i64 %arrayidx60.epil = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %idxprom51, i64 %idxprom59.epil store i32 1, ptr %arrayidx60.epil, align 4, !tbaa !5 br label %for.inc64 for.inc64: ; preds = %for.body47.epil, %for.inc64.loopexit.unr-lcssa, %for.cond42.preheader %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153 br i1 %exitcond154.not, label %for.cond67.preheader, label %for.cond42.preheader, !llvm.loop !19 for.cond70.preheader: ; preds = %for.cond67.preheader, %for.end85 %24 = phi i32 [ %30, %for.end85 ], [ %15, %for.cond67.preheader ] %indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.end85 ], [ 0, %for.cond67.preheader ] %cmp71132 = icmp sgt i32 %24, 0 br i1 %cmp71132, label %for.body72, label %for.end85 for.body72: ; preds = %for.cond70.preheader, %for.inc83 %indvars.iv155 = phi i64 [ %indvars.iv.next156, %for.inc83 ], [ 0, %for.cond70.preheader ] %arrayidx76 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 0, i64 %indvars.iv158, i64 %indvars.iv155 %25 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %25) %26 = load i32, ptr %n, align 4, !tbaa !5 %sub78 = add nsw i32 %26, -1 %27 = sext i32 %sub78 to i64 %cmp79 = icmp slt i64 %indvars.iv155, %27 br i1 %cmp79, label %if.then80, label %for.inc83 if.then80: ; preds = %for.body72 %putchar119 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %for.body72, %if.then80 %28 = phi i32 [ %26, %for.body72 ], [ %.pre, %if.then80 ] %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1 %29 = sext i32 %28 to i64 %cmp71 = icmp slt i64 %indvars.iv.next156, %29 br i1 %cmp71, label %for.body72, label %for.end85, !llvm.loop !20 for.end85: ; preds = %for.inc83, %for.cond70.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %30 = load i32, ptr %n, align 4, !tbaa !5 %31 = sext i32 %30 to i64 %cmp68 = icmp slt i64 %indvars.iv.next159, %31 br i1 %cmp68, label %for.cond70.preheader, label %for.end89, !llvm.loop !21 for.end89: ; preds = %for.end85, %entry, %for.cond23.preheader, %for.cond39.preheader, %for.cond67.preheader call void @llvm.lifetime.end.p0(i64 400800, ptr nonnull %Adj) #5 call void @llvm.lifetime.end.p0(i64 40000, 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: 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !6, i64 4} !12 = !{!"Input", !6, i64 0, !6, i64 4, !7, i64 8} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = !{!12, !6, i64 0} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10}
#include <stdio.h> typedef struct { int b, e; } PFactor; PFactor pFactor[5000][10]; int g[5000]; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int pFactorize(int n, int idx) { int i; int cnt = 0; for (i = 2; i * i <= n; i++) if (n % i == 0) { int e = 0; do { e++; n /= i; } while (n % i == 0); pFactor[idx][cnt].b = i; pFactor[idx][cnt].e = e; cnt++; } if (n > 1) { pFactor[idx][cnt].b = n; pFactor[idx][cnt].e = 1; cnt++; } return cnt; } int binarySearch(int *data, int n, int key) { int l = 0, r = n - 1, m; while (l <= r) { m = (l + r) / 2; if (key == data[m]) return 1; else if (key < data[m]) r = m - 1; else l = m + 1; } return 0; } int main(void) { int i, j, k, l; int n, m, a[5000], b[5000], numPF[5000], max, hoge; scanf("%d %d", &n, &m); for (i = 0; i < n; i++) scanf("%d", a + i); for (i = 0; i < m; i++) scanf("%d", b + i); for (i = 0; i < n; i++) numPF[i] = pFactorize(a[i], i); max = 0; for (i = 0; i < n; i++) for (j = 0; j < numPF[i]; j++) max += binarySearch(b, m, pFactor[i][j].b) ? -pFactor[i][j].e : pFactor[i][j].e; g[0] = a[0]; for (i = 1; i < n; i++) g[i] = gcd(g[i - 1], a[i]); for (i = 0; i < n; i++) numPF[i] = pFactorize(g[i], i); hoge = 0; for (i = n - 1; i >= 0; i--) { int sum; sum = 0; for (j = 0; j < numPF[i]; j++) sum += binarySearch(b, m, pFactor[i][j].b) ? -pFactor[i][j].e : pFactor[i][j].e; sum -= hoge; if (sum < 0) { hoge += sum; max -= (sum) * (i + 1); // for (j = 0; j < numPF[i]; j++) // for (k = 0; k <= i; k++) { // for (l = 0; pFactor[k][l].b != pFactor[i][j].b; l++) ; // pFactor[k][l].e -= pFactor[i][j].e; // } } } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29331/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29331/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.PFactor = type { i32, i32 } @pFactor = dso_local local_unnamed_addr global [5000 x [10 x %struct.PFactor]] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @g = dso_local local_unnamed_addr global [5000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %tobool.not4 = icmp eq i32 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i32 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @pFactorize(i32 noundef %n, i32 noundef %idx) local_unnamed_addr #1 { entry: %cmp.not48 = icmp slt i32 %n, 4 br i1 %cmp.not48, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %idxprom = sext i32 %idx to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %cnt.051 = phi i32 [ 0, %for.body.lr.ph ], [ %cnt.1, %for.inc ] %i.050 = phi i32 [ 2, %for.body.lr.ph ], [ %inc12, %for.inc ] %n.addr.049 = phi i32 [ %n, %for.body.lr.ph ], [ %n.addr.2, %for.inc ] %rem = srem i32 %n.addr.049, %i.050 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %do.body, label %for.inc do.body: ; preds = %for.body, %do.body %n.addr.1 = phi i32 [ %div, %do.body ], [ %n.addr.049, %for.body ] %e.0 = phi i32 [ %inc, %do.body ], [ 0, %for.body ] %inc = add nuw nsw i32 %e.0, 1 %div = sdiv i32 %n.addr.1, %i.050 %rem2 = srem i32 %div, %i.050 %cmp3 = icmp eq i32 %rem2, 0 br i1 %cmp3, label %do.body, label %do.end, !llvm.loop !5 do.end: ; preds = %do.body %idxprom4 = sext i32 %cnt.051 to i64 %arrayidx5 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom, i64 %idxprom4 store i32 %i.050, ptr %arrayidx5, align 8, !tbaa !7 %e10 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom, i64 %idxprom4, i32 1 store i32 %inc, ptr %e10, align 4, !tbaa !12 %inc11 = add nsw i32 %cnt.051, 1 br label %for.inc for.inc: ; preds = %for.body, %do.end %n.addr.2 = phi i32 [ %div, %do.end ], [ %n.addr.049, %for.body ] %cnt.1 = phi i32 [ %inc11, %do.end ], [ %cnt.051, %for.body ] %inc12 = add nuw nsw i32 %i.050, 1 %mul = mul nsw i32 %inc12, %inc12 %cmp.not = icmp sgt i32 %mul, %n.addr.2 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.inc, %entry %n.addr.0.lcssa = phi i32 [ %n, %entry ], [ %n.addr.2, %for.inc ] %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %for.inc ] %cmp13 = icmp sgt i32 %n.addr.0.lcssa, 1 br i1 %cmp13, label %if.then14, label %if.end26 if.then14: ; preds = %for.end %idxprom15 = sext i32 %idx to i64 %idxprom17 = sext i32 %cnt.0.lcssa to i64 %arrayidx18 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom15, i64 %idxprom17 store i32 %n.addr.0.lcssa, ptr %arrayidx18, align 8, !tbaa !7 %e24 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom15, i64 %idxprom17, i32 1 store i32 1, ptr %e24, align 4, !tbaa !12 %inc25 = add nsw i32 %cnt.0.lcssa, 1 br label %if.end26 if.end26: ; preds = %if.then14, %for.end %cnt.2 = phi i32 [ %inc25, %if.then14 ], [ %cnt.0.lcssa, %for.end ] ret i32 %cnt.2 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @binarySearch(ptr nocapture noundef readonly %data, i32 noundef %n, i32 noundef %key) local_unnamed_addr #3 { entry: %cmp.not19 = icmp slt i32 %n, 1 br i1 %cmp.not19, label %cleanup, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %if.else %r.021 = phi i32 [ %r.1, %if.else ], [ %sub, %while.body.preheader ] %l.020 = phi i32 [ %l.1, %if.else ], [ 0, %while.body.preheader ] %add = add nsw i32 %r.021, %l.020 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %data, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !14 %cmp1 = icmp eq i32 %0, %key br i1 %cmp1, label %cleanup, label %if.else if.else: ; preds = %while.body %cmp4 = icmp sgt i32 %0, %key %sub6 = add nsw i32 %div, -1 %add8 = add nsw i32 %div, 1 %l.1 = select i1 %cmp4, i32 %l.020, i32 %add8 %r.1 = select i1 %cmp4, i32 %sub6, i32 %r.021 %cmp.not = icmp sgt i32 %l.1, %r.1 br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !15 cleanup: ; preds = %while.body, %if.else, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %if.else ], [ 1, %while.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [5000 x i32], align 16 %b = alloca [5000 x i32], align 16 %numPF = alloca [5000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %b) #7 call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %numPF) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !14 %cmp239 = icmp sgt i32 %0, 0 br i1 %cmp239, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %3, %for.body ] %2 = load i32, ptr %m, align 4, !tbaa !14 %cmp3241 = icmp sgt i32 %2, 0 br i1 %cmp3241, label %for.body4, label %for.cond12.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !14 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !16 for.cond12.preheader.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !14 br label %for.cond12.preheader for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit, %for.cond2.preheader %5 = phi i32 [ %1, %for.cond2.preheader ], [ %.pre, %for.cond12.preheader.loopexit ] %.lcssa238 = phi i32 [ %2, %for.cond2.preheader ], [ %6, %for.cond12.preheader.loopexit ] %.lcssa238.fr = freeze i32 %.lcssa238 %cmp13243 = icmp sgt i32 %5, 0 br i1 %cmp13243, label %for.body14.preheader, label %for.cond66.preheader.thread for.body14.preheader: ; preds = %for.cond12.preheader %wide.trip.count = zext i32 %5 to i64 br label %for.body14 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv273 = phi i64 [ %indvars.iv.next274, %for.body4 ], [ 0, %for.cond2.preheader ] %add.ptr7 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv273 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr7) %indvars.iv.next274 = add nuw nsw i64 %indvars.iv273, 1 %6 = load i32, ptr %m, align 4, !tbaa !14 %7 = sext i32 %6 to i64 %cmp3 = icmp slt i64 %indvars.iv.next274, %7 br i1 %cmp3, label %for.body4, label %for.cond12.preheader.loopexit, !llvm.loop !17 for.cond21.preheader: ; preds = %pFactorize.exit br i1 %cmp13243, label %for.cond24.preheader.lr.ph, label %for.cond66.preheader.thread for.cond24.preheader.lr.ph: ; preds = %for.cond21.preheader %cmp.not19.i = icmp slt i32 %.lcssa238.fr, 1 %sub.i = add nsw i32 %.lcssa238.fr, -1 %wide.trip.count297 = zext i32 %5 to i64 br i1 %cmp.not19.i, label %for.cond24.preheader.us, label %for.cond24.preheader for.cond24.preheader.us: ; preds = %for.cond24.preheader.lr.ph, %for.inc48.us %indvars.iv294 = phi i64 [ %indvars.iv.next295, %for.inc48.us ], [ 0, %for.cond24.preheader.lr.ph ] %max.0252.us = phi i32 [ %max.1.lcssa.us, %for.inc48.us ], [ 0, %for.cond24.preheader.lr.ph ] %arrayidx26.us = getelementptr inbounds [5000 x i32], ptr %numPF, i64 0, i64 %indvars.iv294 %8 = load i32, ptr %arrayidx26.us, align 4, !tbaa !14 %cmp27246.us = icmp sgt i32 %8, 0 br i1 %cmp27246.us, label %for.body28.us.us.preheader, label %for.inc48.us for.body28.us.us.preheader: ; preds = %for.cond24.preheader.us %wide.trip.count292 = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 9 br i1 %min.iters.check, label %for.body28.us.us.preheader359, label %vector.ph vector.ph: ; preds = %for.body28.us.us.preheader %n.mod.vf = and i64 %wide.trip.count292, 7 %9 = icmp eq i64 %n.mod.vf, 0 %10 = select i1 %9, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count292, %10 %11 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %max.0252.us, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %11, %vector.ph ], [ %15, %vector.body ] %vec.phi335 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %12 = or i64 %index, 4 %13 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv294, i64 %index, i32 1 %14 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv294, i64 %12, i32 1 %wide.vec = load <8 x i32>, ptr %13, align 4, !tbaa !12 %wide.vec336 = load <8 x i32>, ptr %14, align 4, !tbaa !12 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec337 = shufflevector <8 x i32> %wide.vec336, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %15 = add <4 x i32> %strided.vec, %vec.phi %16 = add <4 x i32> %strided.vec337, %vec.phi335 %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 !18 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) br label %for.body28.us.us.preheader359 for.body28.us.us.preheader359: ; preds = %for.body28.us.us.preheader, %middle.block %indvars.iv289.ph = phi i64 [ 0, %for.body28.us.us.preheader ], [ %n.vec, %middle.block ] %max.1248.us.us.ph = phi i32 [ %max.0252.us, %for.body28.us.us.preheader ], [ %18, %middle.block ] br label %for.body28.us.us for.inc48.us: ; preds = %for.body28.us.us, %for.cond24.preheader.us %max.1.lcssa.us = phi i32 [ %max.0252.us, %for.cond24.preheader.us ], [ %add.us.us, %for.body28.us.us ] %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.end50, label %for.cond24.preheader.us, !llvm.loop !21 for.body28.us.us: ; preds = %for.body28.us.us.preheader359, %for.body28.us.us %indvars.iv289 = phi i64 [ %indvars.iv.next290, %for.body28.us.us ], [ %indvars.iv289.ph, %for.body28.us.us.preheader359 ] %max.1248.us.us = phi i32 [ %add.us.us, %for.body28.us.us ], [ %max.1248.us.us.ph, %for.body28.us.us.preheader359 ] %e44.us.us = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv294, i64 %indvars.iv289, i32 1 %19 = load i32, ptr %e44.us.us, align 4, !tbaa !12 %add.us.us = add nsw i32 %19, %max.1248.us.us %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.inc48.us, label %for.body28.us.us, !llvm.loop !22 for.body14: ; preds = %for.body14.preheader, %pFactorize.exit %indvars.iv276 = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next277, %pFactorize.exit ] %arrayidx = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv276 %20 = load i32, ptr %arrayidx, align 4, !tbaa !14 %cmp.not48.i = icmp slt i32 %20, 4 br i1 %cmp.not48.i, label %for.end.i, label %for.body.i for.body.i: ; preds = %for.body14, %for.inc.i %cnt.051.i = phi i32 [ %cnt.1.i, %for.inc.i ], [ 0, %for.body14 ] %i.050.i = phi i32 [ %inc12.i, %for.inc.i ], [ 2, %for.body14 ] %n.addr.049.i = phi i32 [ %n.addr.2.i, %for.inc.i ], [ %20, %for.body14 ] %rem.i = srem i32 %n.addr.049.i, %i.050.i %cmp1.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.i, label %do.body.i, label %for.inc.i do.body.i: ; preds = %for.body.i, %do.body.i %n.addr.1.i = phi i32 [ %div.i, %do.body.i ], [ %n.addr.049.i, %for.body.i ] %e.0.i = phi i32 [ %inc.i, %do.body.i ], [ 0, %for.body.i ] %inc.i = add nuw nsw i32 %e.0.i, 1 %div.i = sdiv i32 %n.addr.1.i, %i.050.i %rem2.i = srem i32 %div.i, %i.050.i %cmp3.i = icmp eq i32 %rem2.i, 0 br i1 %cmp3.i, label %do.body.i, label %do.end.i, !llvm.loop !5 do.end.i: ; preds = %do.body.i %idxprom4.i = sext i32 %cnt.051.i to i64 %arrayidx5.i = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv276, i64 %idxprom4.i store i32 %i.050.i, ptr %arrayidx5.i, align 8, !tbaa !7 %e10.i = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv276, i64 %idxprom4.i, i32 1 store i32 %inc.i, ptr %e10.i, align 4, !tbaa !12 %inc11.i = add nsw i32 %cnt.051.i, 1 br label %for.inc.i for.inc.i: ; preds = %do.end.i, %for.body.i %n.addr.2.i = phi i32 [ %div.i, %do.end.i ], [ %n.addr.049.i, %for.body.i ] %cnt.1.i = phi i32 [ %inc11.i, %do.end.i ], [ %cnt.051.i, %for.body.i ] %inc12.i = add nuw nsw i32 %i.050.i, 1 %mul.i = mul nsw i32 %inc12.i, %inc12.i %cmp.not.i = icmp sgt i32 %mul.i, %n.addr.2.i br i1 %cmp.not.i, label %for.end.i, label %for.body.i, !llvm.loop !13 for.end.i: ; preds = %for.inc.i, %for.body14 %n.addr.0.lcssa.i = phi i32 [ %20, %for.body14 ], [ %n.addr.2.i, %for.inc.i ] %cnt.0.lcssa.i = phi i32 [ 0, %for.body14 ], [ %cnt.1.i, %for.inc.i ] %cmp13.i = icmp sgt i32 %n.addr.0.lcssa.i, 1 br i1 %cmp13.i, label %if.then14.i, label %pFactorize.exit if.then14.i: ; preds = %for.end.i %idxprom17.i = sext i32 %cnt.0.lcssa.i to i64 %arrayidx18.i = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv276, i64 %idxprom17.i store i32 %n.addr.0.lcssa.i, ptr %arrayidx18.i, align 8, !tbaa !7 %e24.i = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv276, i64 %idxprom17.i, i32 1 store i32 1, ptr %e24.i, align 4, !tbaa !12 %inc25.i = add nsw i32 %cnt.0.lcssa.i, 1 br label %pFactorize.exit pFactorize.exit: ; preds = %for.end.i, %if.then14.i %cnt.2.i = phi i32 [ %inc25.i, %if.then14.i ], [ %cnt.0.lcssa.i, %for.end.i ] %arrayidx17 = getelementptr inbounds [5000 x i32], ptr %numPF, i64 0, i64 %indvars.iv276 store i32 %cnt.2.i, ptr %arrayidx17, align 4, !tbaa !14 %indvars.iv.next277 = add nuw nsw i64 %indvars.iv276, 1 %exitcond.not = icmp eq i64 %indvars.iv.next277, %wide.trip.count br i1 %exitcond.not, label %for.cond21.preheader, label %for.body14, !llvm.loop !23 for.cond24.preheader: ; preds = %for.cond24.preheader.lr.ph, %for.inc48 %indvars.iv284 = phi i64 [ %indvars.iv.next285, %for.inc48 ], [ 0, %for.cond24.preheader.lr.ph ] %max.0252 = phi i32 [ %max.1.lcssa, %for.inc48 ], [ 0, %for.cond24.preheader.lr.ph ] %arrayidx26 = getelementptr inbounds [5000 x i32], ptr %numPF, i64 0, i64 %indvars.iv284 %21 = load i32, ptr %arrayidx26, align 4, !tbaa !14 %cmp27246 = icmp sgt i32 %21, 0 br i1 %cmp27246, label %for.body28.preheader, label %for.inc48 for.body28.preheader: ; preds = %for.cond24.preheader %wide.trip.count282 = zext i32 %21 to i64 br label %for.body28 for.body28: ; preds = %for.body28.preheader, %cond.end %indvars.iv279 = phi i64 [ 0, %for.body28.preheader ], [ %indvars.iv.next280, %cond.end ] %max.1248 = phi i32 [ %max.0252, %for.body28.preheader ], [ %add, %cond.end ] %arrayidx33 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv284, i64 %indvars.iv279 %22 = load i32, ptr %arrayidx33, align 8, !tbaa !7 br label %while.body.i while.body.i: ; preds = %if.else.i, %for.body28 %r.021.i = phi i32 [ %r.1.i, %if.else.i ], [ %sub.i, %for.body28 ] %l.020.i = phi i32 [ %l.1.i, %if.else.i ], [ 0, %for.body28 ] %add.i = add nsw i32 %l.020.i, %r.021.i %div.i170 = sdiv i32 %add.i, 2 %idxprom.i171 = sext i32 %div.i170 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %b, i64 %idxprom.i171 %23 = load i32, ptr %arrayidx.i, align 4, !tbaa !14 %cmp1.i172 = icmp eq i32 %23, %22 br i1 %cmp1.i172, label %cond.true, label %if.else.i if.else.i: ; preds = %while.body.i %cmp4.i = icmp sgt i32 %23, %22 %sub6.i = add nsw i32 %div.i170, -1 %add8.i = add nsw i32 %div.i170, 1 %l.1.i = select i1 %cmp4.i, i32 %l.020.i, i32 %add8.i %r.1.i = select i1 %cmp4.i, i32 %sub6.i, i32 %r.021.i %cmp.not.i173 = icmp sgt i32 %l.1.i, %r.1.i br i1 %cmp.not.i173, label %cond.false.loopexit, label %while.body.i, !llvm.loop !15 cond.true: ; preds = %while.body.i %e = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv284, i64 %indvars.iv279, i32 1 %24 = load i32, ptr %e, align 4, !tbaa !12 %sub = sub nsw i32 0, %24 br label %cond.end cond.false.loopexit: ; preds = %if.else.i %e44 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv284, i64 %indvars.iv279, i32 1 %25 = load i32, ptr %e44, align 4, !tbaa !12 br label %cond.end cond.end: ; preds = %cond.false.loopexit, %cond.true %cond = phi i32 [ %sub, %cond.true ], [ %25, %cond.false.loopexit ] %add = add nsw i32 %cond, %max.1248 %indvars.iv.next280 = add nuw nsw i64 %indvars.iv279, 1 %exitcond283.not = icmp eq i64 %indvars.iv.next280, %wide.trip.count282 br i1 %exitcond283.not, label %for.inc48, label %for.body28, !llvm.loop !24 for.inc48: ; preds = %cond.end, %for.cond24.preheader %max.1.lcssa = phi i32 [ %max.0252, %for.cond24.preheader ], [ %add, %cond.end ] %indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1 %exitcond288.not = icmp eq i64 %indvars.iv.next285, %wide.trip.count297 br i1 %exitcond288.not, label %for.end50, label %for.cond24.preheader, !llvm.loop !21 for.cond66.preheader.thread: ; preds = %for.cond12.preheader, %for.cond21.preheader %26 = load i32, ptr %a, align 16, !tbaa !14 store i32 %26, ptr @g, align 16, !tbaa !14 br label %for.end119 for.end50: ; preds = %for.inc48, %for.inc48.us %max.0.lcssa = phi i32 [ %max.1.lcssa.us, %for.inc48.us ], [ %max.1.lcssa, %for.inc48 ] %27 = load i32, ptr %a, align 16, !tbaa !14 store i32 %27, ptr @g, align 16, !tbaa !14 %cmp53255 = icmp sgt i32 %5, 1 br i1 %cmp53255, label %for.body54.preheader, label %for.cond66.preheader for.body54.preheader: ; preds = %for.end50 %wide.trip.count303 = zext i32 %5 to i64 br label %for.body54 for.cond66.preheader: ; preds = %gcd.exit, %for.end50 br i1 %cmp13243, label %for.body68.preheader, label %for.end119 for.body68.preheader: ; preds = %for.cond66.preheader %wide.trip.count308 = zext i32 %5 to i64 br label %for.body68 for.body54: ; preds = %for.body54.preheader, %gcd.exit %28 = phi i32 [ %27, %for.body54.preheader ], [ %a.tr.lcssa.i, %gcd.exit ] %indvars.iv299 = phi i64 [ 1, %for.body54.preheader ], [ %indvars.iv.next300, %gcd.exit ] %arrayidx59 = getelementptr inbounds [5000 x i32], ptr %a, i64 0, i64 %indvars.iv299 %29 = load i32, ptr %arrayidx59, align 4, !tbaa !14 %tobool.not4.i = icmp eq i32 %29, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %for.body54, %cond.true.i %b.tr6.i = phi i32 [ %rem.i174, %cond.true.i ], [ %29, %for.body54 ] %a.tr5.i = phi i32 [ %b.tr6.i, %cond.true.i ], [ %28, %for.body54 ] %rem.i174 = srem i32 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i32 %rem.i174, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %for.body54 %a.tr.lcssa.i = phi i32 [ %28, %for.body54 ], [ %b.tr6.i, %cond.true.i ] %arrayidx62 = getelementptr inbounds [5000 x i32], ptr @g, i64 0, i64 %indvars.iv299 store i32 %a.tr.lcssa.i, ptr %arrayidx62, align 4, !tbaa !14 %indvars.iv.next300 = add nuw nsw i64 %indvars.iv299, 1 %exitcond304.not = icmp eq i64 %indvars.iv.next300, %wide.trip.count303 br i1 %exitcond304.not, label %for.cond66.preheader, label %for.body54, !llvm.loop !25 for.cond78.preheader: ; preds = %pFactorize.exit213 br i1 %cmp13243, label %for.cond81.preheader.lr.ph, label %for.end119 for.cond81.preheader.lr.ph: ; preds = %for.cond78.preheader %cmp.not19.i214 = icmp slt i32 %.lcssa238.fr, 1 %sub.i216 = add nsw i32 %.lcssa238.fr, -1 %30 = zext i32 %5 to i64 br label %for.cond81.preheader for.body68: ; preds = %for.body68.preheader, %pFactorize.exit213 %indvars.iv305 = phi i64 [ 0, %for.body68.preheader ], [ %indvars.iv.next306, %pFactorize.exit213 ] %arrayidx70 = getelementptr inbounds [5000 x i32], ptr @g, i64 0, i64 %indvars.iv305 %31 = load i32, ptr %arrayidx70, align 4, !tbaa !14 %cmp.not48.i175 = icmp slt i32 %31, 4 br i1 %cmp.not48.i175, label %for.end.i190, label %for.body.i178 for.body.i178: ; preds = %for.body68, %for.inc.i184 %cnt.051.i179 = phi i32 [ %cnt.1.i186, %for.inc.i184 ], [ 0, %for.body68 ] %i.050.i180 = phi i32 [ %inc12.i187, %for.inc.i184 ], [ 2, %for.body68 ] %n.addr.049.i181 = phi i32 [ %n.addr.2.i185, %for.inc.i184 ], [ %31, %for.body68 ] %rem.i182 = srem i32 %n.addr.049.i181, %i.050.i180 %cmp1.i183 = icmp eq i32 %rem.i182, 0 br i1 %cmp1.i183, label %do.body.i201, label %for.inc.i184 do.body.i201: ; preds = %for.body.i178, %do.body.i201 %n.addr.1.i202 = phi i32 [ %div.i205, %do.body.i201 ], [ %n.addr.049.i181, %for.body.i178 ] %e.0.i203 = phi i32 [ %inc.i204, %do.body.i201 ], [ 0, %for.body.i178 ] %inc.i204 = add nuw nsw i32 %e.0.i203, 1 %div.i205 = sdiv i32 %n.addr.1.i202, %i.050.i180 %rem2.i206 = srem i32 %div.i205, %i.050.i180 %cmp3.i207 = icmp eq i32 %rem2.i206, 0 br i1 %cmp3.i207, label %do.body.i201, label %do.end.i208, !llvm.loop !5 do.end.i208: ; preds = %do.body.i201 %idxprom4.i209 = sext i32 %cnt.051.i179 to i64 %arrayidx5.i210 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv305, i64 %idxprom4.i209 store i32 %i.050.i180, ptr %arrayidx5.i210, align 8, !tbaa !7 %e10.i211 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv305, i64 %idxprom4.i209, i32 1 store i32 %inc.i204, ptr %e10.i211, align 4, !tbaa !12 %inc11.i212 = add nsw i32 %cnt.051.i179, 1 br label %for.inc.i184 for.inc.i184: ; preds = %do.end.i208, %for.body.i178 %n.addr.2.i185 = phi i32 [ %div.i205, %do.end.i208 ], [ %n.addr.049.i181, %for.body.i178 ] %cnt.1.i186 = phi i32 [ %inc11.i212, %do.end.i208 ], [ %cnt.051.i179, %for.body.i178 ] %inc12.i187 = add nuw nsw i32 %i.050.i180, 1 %mul.i188 = mul nsw i32 %inc12.i187, %inc12.i187 %cmp.not.i189 = icmp sgt i32 %mul.i188, %n.addr.2.i185 br i1 %cmp.not.i189, label %for.end.i190, label %for.body.i178, !llvm.loop !13 for.end.i190: ; preds = %for.inc.i184, %for.body68 %n.addr.0.lcssa.i191 = phi i32 [ %31, %for.body68 ], [ %n.addr.2.i185, %for.inc.i184 ] %cnt.0.lcssa.i192 = phi i32 [ 0, %for.body68 ], [ %cnt.1.i186, %for.inc.i184 ] %cmp13.i193 = icmp sgt i32 %n.addr.0.lcssa.i191, 1 br i1 %cmp13.i193, label %if.then14.i195, label %pFactorize.exit213 if.then14.i195: ; preds = %for.end.i190 %idxprom17.i197 = sext i32 %cnt.0.lcssa.i192 to i64 %arrayidx18.i198 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv305, i64 %idxprom17.i197 store i32 %n.addr.0.lcssa.i191, ptr %arrayidx18.i198, align 8, !tbaa !7 %e24.i199 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %indvars.iv305, i64 %idxprom17.i197, i32 1 store i32 1, ptr %e24.i199, align 4, !tbaa !12 %inc25.i200 = add nsw i32 %cnt.0.lcssa.i192, 1 br label %pFactorize.exit213 pFactorize.exit213: ; preds = %for.end.i190, %if.then14.i195 %cnt.2.i194 = phi i32 [ %inc25.i200, %if.then14.i195 ], [ %cnt.0.lcssa.i192, %for.end.i190 ] %arrayidx73 = getelementptr inbounds [5000 x i32], ptr %numPF, i64 0, i64 %indvars.iv305 store i32 %cnt.2.i194, ptr %arrayidx73, align 4, !tbaa !14 %indvars.iv.next306 = add nuw nsw i64 %indvars.iv305, 1 %exitcond309.not = icmp eq i64 %indvars.iv.next306, %wide.trip.count308 br i1 %exitcond309.not, label %for.cond78.preheader, label %for.body68, !llvm.loop !26 for.cond81.preheader: ; preds = %for.cond81.preheader.lr.ph, %for.end112 %indvars.iv320 = phi i64 [ %30, %for.cond81.preheader.lr.ph ], [ %indvars.iv.next321, %for.end112 ] %hoge.0267 = phi i32 [ 0, %for.cond81.preheader.lr.ph ], [ %hoge.1, %for.end112 ] %max.2266 = phi i32 [ %max.0.lcssa, %for.cond81.preheader.lr.ph ], [ %max.3, %for.end112 ] %indvars.iv.next321 = add nsw i64 %indvars.iv320, -1 %idxprom82 = and i64 %indvars.iv.next321, 4294967295 %arrayidx83 = getelementptr inbounds [5000 x i32], ptr %numPF, i64 0, i64 %idxprom82 %32 = load i32, ptr %arrayidx83, align 4, !tbaa !14 %cmp84259 = icmp sgt i32 %32, 0 br i1 %cmp84259, label %for.body85.lr.ph, label %for.end112 for.body85.lr.ph: ; preds = %for.cond81.preheader %wide.trip.count318 = zext i32 %32 to i64 br i1 %cmp.not19.i214, label %for.body85.us.preheader, label %for.body85 for.body85.us.preheader: ; preds = %for.body85.lr.ph %min.iters.check340 = icmp ult i32 %32, 9 br i1 %min.iters.check340, label %for.body85.us.preheader356, label %vector.ph341 vector.ph341: ; preds = %for.body85.us.preheader %n.mod.vf342 = and i64 %wide.trip.count318, 7 %33 = icmp eq i64 %n.mod.vf342, 0 %34 = select i1 %33, i64 8, i64 %n.mod.vf342 %n.vec343 = sub nsw i64 %wide.trip.count318, %34 br label %vector.body345 vector.body345: ; preds = %vector.body345, %vector.ph341 %index346 = phi i64 [ 0, %vector.ph341 ], [ %index.next353, %vector.body345 ] %vec.phi347 = phi <4 x i32> [ zeroinitializer, %vector.ph341 ], [ %38, %vector.body345 ] %vec.phi348 = phi <4 x i32> [ zeroinitializer, %vector.ph341 ], [ %39, %vector.body345 ] %35 = or i64 %index346, 4 %36 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %index346, i32 1 %37 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %35, i32 1 %wide.vec349 = load <8 x i32>, ptr %36, align 4, !tbaa !12 %wide.vec350 = load <8 x i32>, ptr %37, align 4, !tbaa !12 %strided.vec351 = shufflevector <8 x i32> %wide.vec349, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec352 = shufflevector <8 x i32> %wide.vec350, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %38 = add <4 x i32> %strided.vec351, %vec.phi347 %39 = add <4 x i32> %strided.vec352, %vec.phi348 %index.next353 = add nuw i64 %index346, 8 %40 = icmp eq i64 %index.next353, %n.vec343 br i1 %40, label %middle.block338, label %vector.body345, !llvm.loop !27 middle.block338: ; preds = %vector.body345 %bin.rdx354 = add <4 x i32> %39, %38 %41 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx354) br label %for.body85.us.preheader356 for.body85.us.preheader356: ; preds = %for.body85.us.preheader, %middle.block338 %indvars.iv315.ph = phi i64 [ 0, %for.body85.us.preheader ], [ %n.vec343, %middle.block338 ] %sum.0261.us.ph = phi i32 [ 0, %for.body85.us.preheader ], [ %41, %middle.block338 ] br label %for.body85.us for.body85.us: ; preds = %for.body85.us.preheader356, %for.body85.us %indvars.iv315 = phi i64 [ %indvars.iv.next316, %for.body85.us ], [ %indvars.iv315.ph, %for.body85.us.preheader356 ] %sum.0261.us = phi i32 [ %add109.us, %for.body85.us ], [ %sum.0261.us.ph, %for.body85.us.preheader356 ] %e106.us = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %indvars.iv315, i32 1 %42 = load i32, ptr %e106.us, align 4, !tbaa !12 %add109.us = add nsw i32 %42, %sum.0261.us %indvars.iv.next316 = add nuw nsw i64 %indvars.iv315, 1 %exitcond319.not = icmp eq i64 %indvars.iv.next316, %wide.trip.count318 br i1 %exitcond319.not, label %for.end112, label %for.body85.us, !llvm.loop !28 for.body85: ; preds = %for.body85.lr.ph, %cond.end107 %indvars.iv310 = phi i64 [ %indvars.iv.next311, %cond.end107 ], [ 0, %for.body85.lr.ph ] %sum.0261 = phi i32 [ %add109, %cond.end107 ], [ 0, %for.body85.lr.ph ] %arrayidx90 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %indvars.iv310 %43 = load i32, ptr %arrayidx90, align 8, !tbaa !7 br label %while.body.i217 while.body.i217: ; preds = %if.else.i225, %for.body85 %r.021.i218 = phi i32 [ %r.1.i230, %if.else.i225 ], [ %sub.i216, %for.body85 ] %l.020.i219 = phi i32 [ %l.1.i229, %if.else.i225 ], [ 0, %for.body85 ] %add.i220 = add nsw i32 %l.020.i219, %r.021.i218 %div.i221 = sdiv i32 %add.i220, 2 %idxprom.i222 = sext i32 %div.i221 to i64 %arrayidx.i223 = getelementptr inbounds i32, ptr %b, i64 %idxprom.i222 %44 = load i32, ptr %arrayidx.i223, align 4, !tbaa !14 %cmp1.i224 = icmp eq i32 %44, %43 br i1 %cmp1.i224, label %cond.true94, label %if.else.i225 if.else.i225: ; preds = %while.body.i217 %cmp4.i226 = icmp sgt i32 %44, %43 %sub6.i227 = add nsw i32 %div.i221, -1 %add8.i228 = add nsw i32 %div.i221, 1 %l.1.i229 = select i1 %cmp4.i226, i32 %l.020.i219, i32 %add8.i228 %r.1.i230 = select i1 %cmp4.i226, i32 %sub6.i227, i32 %r.021.i218 %cmp.not.i231 = icmp sgt i32 %l.1.i229, %r.1.i230 br i1 %cmp.not.i231, label %cond.false101.loopexit, label %while.body.i217, !llvm.loop !15 cond.true94: ; preds = %while.body.i217 %e99 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %indvars.iv310, i32 1 %45 = load i32, ptr %e99, align 4, !tbaa !12 %sub100 = sub nsw i32 0, %45 br label %cond.end107 cond.false101.loopexit: ; preds = %if.else.i225 %e106 = getelementptr inbounds [5000 x [10 x %struct.PFactor]], ptr @pFactor, i64 0, i64 %idxprom82, i64 %indvars.iv310, i32 1 %46 = load i32, ptr %e106, align 4, !tbaa !12 br label %cond.end107 cond.end107: ; preds = %cond.false101.loopexit, %cond.true94 %cond108 = phi i32 [ %sub100, %cond.true94 ], [ %46, %cond.false101.loopexit ] %add109 = add nsw i32 %cond108, %sum.0261 %indvars.iv.next311 = add nuw nsw i64 %indvars.iv310, 1 %exitcond314.not = icmp eq i64 %indvars.iv.next311, %wide.trip.count318 br i1 %exitcond314.not, label %for.end112, label %for.body85, !llvm.loop !29 for.end112: ; preds = %cond.end107, %for.body85.us, %for.cond81.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond81.preheader ], [ %add109.us, %for.body85.us ], [ %add109, %cond.end107 ] %sub113 = sub nsw i32 %sum.0.lcssa, %hoge.0267 %cmp114 = icmp slt i32 %sub113, 0 %47 = trunc i64 %indvars.iv320 to i32 %mul = mul nsw i32 %sub113, %47 %sub117 = select i1 %cmp114, i32 %mul, i32 0 %max.3 = sub nsw i32 %max.2266, %sub117 %hoge.1 = select i1 %cmp114, i32 %sum.0.lcssa, i32 %hoge.0267 %cmp79 = icmp sgt i64 %indvars.iv320, 1 br i1 %cmp79, label %for.cond81.preheader, label %for.end119, !llvm.loop !30 for.end119: ; preds = %for.end112, %for.cond66.preheader, %for.cond66.preheader.thread, %for.cond78.preheader %max.2.lcssa = phi i32 [ %max.0.lcssa, %for.cond78.preheader ], [ %max.0.lcssa, %for.cond66.preheader ], [ 0, %for.cond66.preheader.thread ], [ %max.3, %for.end112 ] %call120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.2.lcssa) call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %numPF) #7 call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: 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.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(write, 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !9, i64 0} !8 = !{!"", !9, i64 0, !9, i64 4} !9 = !{!"int", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = !{!8, !9, i64 4} !13 = distinct !{!13, !6} !14 = !{!9, !9, i64 0} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6, !19, !20} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = distinct !{!21, !6} !22 = distinct !{!22, !6, !20, !19} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = distinct !{!25, !6} !26 = distinct !{!26, !6} !27 = distinct !{!27, !6, !19, !20} !28 = distinct !{!28, !6, !20, !19} !29 = distinct !{!29, !6} !30 = distinct !{!30, !6}
#include<stdio.h> #define MAX 100 int main() { int i, j, n, u, k, v, M[MAX+1][MAX+1]; scanf("%d", &n); for( i=1; i<=n; i++ ) { for( j=1; j<=n; j++ ) { M[i][j] = 0; } } for( i=0; i<n; i++ ) { scanf("%d%d", &u, &k); for( j=0; j<k; j++ ) { scanf("%d", &v); M[u][v] = 1; } } for( i=1; i<=n; i++ ) { for( j=1; j<=n; j++ ) { printf("%d", M[i][j]); if( j == n ) break; printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293353/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"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 %M = alloca [101 x [101 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %M) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not65 = icmp slt i32 %0, 1 br i1 %cmp.not65, label %for.end46, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %invariant.gep = getelementptr inbounds i8, ptr %M, i64 408 %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 %invariant.gep82 = getelementptr i8, ptr %invariant.gep, i64 404 %invariant.gep84 = getelementptr i8, ptr %invariant.gep, i64 808 %invariant.gep86 = getelementptr i8, ptr %invariant.gep, i64 1212 %invariant.gep88 = getelementptr i8, ptr %invariant.gep, i64 1616 %invariant.gep90 = getelementptr i8, ptr %invariant.gep, i64 2020 %invariant.gep92 = getelementptr i8, ptr %invariant.gep, i64 2424 %invariant.gep94 = getelementptr i8, ptr %invariant.gep, i64 2828 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, 404 %gep = getelementptr i8, ptr %invariant.gep, i64 %4 call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 404 %gep83 = getelementptr i8, ptr %invariant.gep82, i64 %5 call void @llvm.memset.p0.i64(ptr align 4 %gep83, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 404 %gep85 = getelementptr i8, ptr %invariant.gep84, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep85, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 404 %gep87 = getelementptr i8, ptr %invariant.gep86, i64 %7 call void @llvm.memset.p0.i64(ptr align 4 %gep87, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 404 %gep89 = getelementptr i8, ptr %invariant.gep88, i64 %8 call void @llvm.memset.p0.i64(ptr align 8 %gep89, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 404 %gep91 = getelementptr i8, ptr %invariant.gep90, i64 %9 call void @llvm.memset.p0.i64(ptr align 4 %gep91, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 404 %gep93 = getelementptr i8, ptr %invariant.gep92, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 404 %gep95 = getelementptr i8, ptr %invariant.gep94, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %gep95, 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, 404 %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %12 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 %cmp1069 = icmp sgt i32 %0, 0 br i1 %cmp1069, label %for.body11, label %for.end46 for.cond27.preheader: ; preds = %for.inc24 %cmp28.not73 = icmp slt i32 %17, 1 br i1 %cmp28.not73, label %for.end46, label %for.cond30.preheader for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.170 = phi i32 [ %inc25, %for.inc24 ], [ 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 %k, align 4, !tbaa !5 %cmp1467 = icmp sgt i32 %13, 0 br i1 %cmp1467, label %for.body15, label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %j.168 = phi i32 [ %inc22, %for.body15 ], [ 0, %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 [101 x [101 x i32]], ptr %M, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.168, 1 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %16 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !13 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.170, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc25, %17 br i1 %cmp10, label %for.body11, label %for.cond27.preheader, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond27.preheader, %for.end42 %18 = phi i32 [ %24, %for.end42 ], [ %17, %for.cond27.preheader ] %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.end42 ], [ 1, %for.cond27.preheader ] %cmp31.not71 = icmp slt i32 %18, 1 br i1 %cmp31.not71, label %for.end42, label %for.body32 for.body32: ; preds = %for.cond30.preheader, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %for.cond30.preheader ] %arrayidx36 = getelementptr inbounds [101 x [101 x i32]], ptr %M, i64 0, i64 %indvars.iv77, i64 %indvars.iv %19 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19) %20 = load i32, ptr %n, align 4, !tbaa !5 %21 = zext i32 %20 to i64 %cmp38 = icmp eq i64 %indvars.iv, %21 br i1 %cmp38, label %for.end42, label %if.end if.end: ; preds = %for.body32 %putchar = call i32 @putchar(i32 32) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp31.not.not = icmp slt i64 %indvars.iv, %23 br i1 %cmp31.not.not, label %for.body32, label %for.end42, !llvm.loop !15 for.end42: ; preds = %if.end, %for.body32, %for.cond30.preheader %putchar62 = call i32 @putchar(i32 10) %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp28.not.not = icmp slt i64 %indvars.iv77, %25 br i1 %cmp28.not.not, label %for.cond30.preheader, label %for.end46, !llvm.loop !16 for.end46: ; preds = %for.end42, %entry, %for.cond9.preheader, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %M) #5 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: 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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}
#include<stdio.h> static const int N = 100; int main(){ int M[N][N]; int n, u, k, v; 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); u--; for(int j=0;j<k;j++){ scanf(" %d",&v); v--; M[u][v]=1; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(j)printf(" "); printf("%d",M[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293403/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293403/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 [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 %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 %vla67 = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %cmp71 = icmp sgt i32 %0, 0 br i1 %cmp71, label %for.cond1.preheader.us.preheader, label %for.cond.cleanup36 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 %invariant.gep = getelementptr i8, ptr %vla67, i64 400 %invariant.gep89 = getelementptr i8, ptr %vla67, i64 800 %invariant.gep91 = getelementptr i8, ptr %vla67, i64 1200 %invariant.gep93 = getelementptr i8, ptr %vla67, i64 1600 %invariant.gep95 = getelementptr i8, ptr %vla67, i64 2000 %invariant.gep97 = getelementptr i8, ptr %vla67, i64 2400 %invariant.gep99 = getelementptr i8, ptr %vla67, i64 2800 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 %vla67, i64 %4 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep94, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep96 = getelementptr i8, ptr %invariant.gep95, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep96, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep98 = getelementptr i8, ptr %invariant.gep97, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep98, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep100 = getelementptr i8, ptr %invariant.gep99, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep100, 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 %vla67, i64 %12 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 %cmp71, label %for.body14, label %for.cond.cleanup36 for.cond34.preheader: ; preds = %for.cond.cleanup19 %cmp3579 = icmp sgt i32 %15, 0 br i1 %cmp3579, label %for.cond39.preheader, label %for.cond.cleanup36 for.body14: ; preds = %for.cond11.preheader, %for.cond.cleanup19 %i10.076 = 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) %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 %cmp1873 = icmp sgt i32 %14, 0 br i1 %cmp1873, label %for.body20, label %for.cond.cleanup19 for.cond.cleanup19: ; preds = %for.body20, %for.body14 %inc31 = add nuw nsw i32 %i10.076, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc31, %15 br i1 %cmp12, label %for.body14, label %for.cond34.preheader, !llvm.loop !13 for.body20: ; preds = %for.body14, %for.body20 %j16.074 = phi i32 [ %inc28, %for.body20 ], [ 0, %for.body14 ] %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %v) %16 = load i32, ptr %v, align 4, !tbaa !5 %dec22 = add nsw i32 %16, -1 store i32 %dec22, ptr %v, align 4, !tbaa !5 %17 = load i32, ptr %u, align 4, !tbaa !5 %idxprom23 = sext i32 %17 to i64 %18 = mul nsw i64 %idxprom23, 100 %arrayidx24 = getelementptr inbounds i32, ptr %vla67, i64 %18 %idxprom25 = sext i32 %dec22 to i64 %arrayidx26 = getelementptr inbounds i32, ptr %arrayidx24, i64 %idxprom25 store i32 1, ptr %arrayidx26, align 4, !tbaa !5 %inc28 = add nuw nsw i32 %j16.074, 1 %19 = load i32, ptr %k, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc28, %19 br i1 %cmp18, label %for.body20, label %for.cond.cleanup19, !llvm.loop !14 for.cond39.preheader: ; preds = %for.cond34.preheader, %for.cond.cleanup41 %20 = phi i32 [ %24, %for.cond.cleanup41 ], [ %15, %for.cond34.preheader ] %indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.cond.cleanup41 ], [ 0, %for.cond34.preheader ] %cmp4077 = icmp sgt i32 %20, 0 br i1 %cmp4077, label %if.end.peel, label %for.cond.cleanup41 if.end.peel: ; preds = %for.cond39.preheader %21 = mul nuw nsw i64 %indvars.iv85, 100 %arrayidx45 = getelementptr inbounds i32, ptr %vla67, i64 %21 %22 = load i32, ptr %arrayidx45, align 16, !tbaa !5 %call48.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp40.peel = icmp sgt i32 %23, 1 br i1 %cmp40.peel, label %if.end, label %for.cond.cleanup41 for.cond.cleanup36: ; preds = %for.cond.cleanup41, %entry, %for.cond11.preheader, %for.cond34.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 for.cond.cleanup41: ; preds = %if.end, %if.end.peel, %for.cond39.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp35 = icmp slt i64 %indvars.iv.next86, %25 br i1 %cmp35, label %for.cond39.preheader, label %for.cond.cleanup36, !llvm.loop !15 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar68 = call i32 @putchar(i32 32) %arrayidx47 = getelementptr inbounds i32, ptr %arrayidx45, i64 %indvars.iv %26 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %27 = load i32, ptr %n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp40 = icmp slt i64 %indvars.iv.next, %28 br i1 %cmp40, label %if.end, label %for.cond.cleanup41, !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 nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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} !17 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #define MAX_NUM 101 #define LOW_INF -2000000000 int main(){ int i,j,n,m,to,from,maxPoint=LOW_INF; int pass[MAX_NUM][MAX_NUM]; for(i=0; i<MAX_NUM; i++){ for(j=0; j<MAX_NUM; j++){ pass[i][j]=0; } } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&from,&m); if(from>maxPoint)maxPoint=from; for(j=1;j<=m;j++){ scanf("%d",&to); pass[from][to]=1; } } for(i=1; i<=maxPoint; i++){ for(j=1; j<=maxPoint; j++){ printf("%d",pass[i][j]); if(j!=maxPoint)printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293454/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293454/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"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %to = alloca i32, align 4 %from = alloca i32, align 4 %pass = alloca [101 x [101 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %to) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %from) #6 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %pass) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %pass, i8 0, i64 40804, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1073 = icmp sgt i32 %0, 0 br i1 %cmp1073, label %for.body11, label %for.end49 for.cond28.preheader: ; preds = %for.inc25 %cmp29.not78 = icmp slt i32 %spec.select, 1 br i1 %cmp29.not78, label %for.end49, label %for.cond31.preheader.preheader for.cond31.preheader.preheader: ; preds = %for.cond28.preheader %1 = zext i32 %spec.select to i64 %2 = add nuw i32 %spec.select, 1 %wide.trip.count86 = zext i32 %2 to i64 br label %for.cond31.preheader for.body11: ; preds = %entry, %for.inc25 %maxPoint.075 = phi i32 [ %spec.select, %for.inc25 ], [ -2000000000, %entry ] %i.174 = phi i32 [ %inc26, %for.inc25 ], [ 0, %entry ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %from, ptr noundef nonnull %m) %3 = load i32, ptr %from, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %3, i32 %maxPoint.075) %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp15.not71 = icmp slt i32 %4, 1 br i1 %cmp15.not71, label %for.inc25, label %for.body16 for.body16: ; preds = %for.body11, %for.body16 %j.172 = phi i32 [ %inc23, %for.body16 ], [ 1, %for.body11 ] %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %to) %5 = load i32, ptr %from, align 4, !tbaa !5 %idxprom18 = sext i32 %5 to i64 %6 = load i32, ptr %to, align 4, !tbaa !5 %idxprom20 = sext i32 %6 to i64 %arrayidx21 = getelementptr inbounds [101 x [101 x i32]], ptr %pass, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.172, 1 %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp15.not.not = icmp slt i32 %j.172, %7 br i1 %cmp15.not.not, label %for.body16, label %for.inc25, !llvm.loop !9 for.inc25: ; preds = %for.body16, %for.body11 %inc26 = add nuw nsw i32 %i.174, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %8 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !11 for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %for.cond31.for.end45_crit_edge %indvars.iv83 = phi i64 [ 1, %for.cond31.preheader.preheader ], [ %indvars.iv.next84, %for.cond31.for.end45_crit_edge ] br label %for.body33 for.body33: ; preds = %for.cond31.preheader, %for.inc43 %indvars.iv = phi i64 [ 1, %for.cond31.preheader ], [ %indvars.iv.next, %for.inc43 ] %arrayidx37 = getelementptr inbounds [101 x [101 x i32]], ptr %pass, i64 0, i64 %indvars.iv83, i64 %indvars.iv %9 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9) %cmp39.not = icmp eq i64 %indvars.iv, %1 br i1 %cmp39.not, label %for.inc43, label %if.then40 if.then40: ; preds = %for.body33 %putchar68 = call i32 @putchar(i32 32) br label %for.inc43 for.inc43: ; preds = %for.body33, %if.then40 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count86 br i1 %exitcond.not, label %for.cond31.for.end45_crit_edge, label %for.body33, !llvm.loop !12 for.cond31.for.end45_crit_edge: ; preds = %for.inc43 %putchar = call i32 @putchar(i32 10) %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86 br i1 %exitcond87.not, label %for.end49, label %for.cond31.preheader, !llvm.loop !13 for.end49: ; preds = %for.cond31.for.end45_crit_edge, %entry, %for.cond28.preheader call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %pass) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %from) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %to) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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, !10}
#include <stdio.h> #define N 100 int main() { int m[N][N]; int n,u,k,v; 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); u--; for(int j = 0; j < k; j++) { scanf("%d",&v); v--; m[u][v] = 1; } } for(int i = 0; i < n; i++) { for( int j = 0; j < n; j++) { if(j) printf(" "); printf("%d",m[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293498/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293498/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca [100 x [100 x i32]], align 16 %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 40000, ptr nonnull %m) #5 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 %cmp70 = icmp sgt i32 %0, 0 br i1 %cmp70, label %for.cond1.preheader.us.preheader, label %for.cond.cleanup36 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 %invariant.gep = getelementptr i8, ptr %m, i64 400 %invariant.gep88 = getelementptr i8, ptr %m, i64 800 %invariant.gep90 = getelementptr i8, ptr %m, i64 1200 %invariant.gep92 = getelementptr i8, ptr %m, i64 1600 %invariant.gep94 = getelementptr i8, ptr %m, i64 2000 %invariant.gep96 = getelementptr i8, ptr %m, i64 2400 %invariant.gep98 = getelementptr i8, ptr %m, i64 2800 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 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep89 = getelementptr i8, ptr %invariant.gep88, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep89, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep91 = getelementptr i8, ptr %invariant.gep90, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep91, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep93 = getelementptr i8, ptr %invariant.gep92, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep95 = getelementptr i8, ptr %invariant.gep94, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep95, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep97 = getelementptr i8, ptr %invariant.gep96, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep97, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep99 = getelementptr i8, ptr %invariant.gep98, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep99, 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 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 %cmp70, label %for.body14, label %for.cond.cleanup36 for.cond34.preheader: ; preds = %for.cond.cleanup19 %cmp3578 = icmp sgt i32 %15, 0 br i1 %cmp3578, label %for.cond39.preheader, label %for.cond.cleanup36 for.body14: ; preds = %for.cond11.preheader, %for.cond.cleanup19 %i10.075 = 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) %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 %cmp1872 = icmp sgt i32 %14, 0 br i1 %cmp1872, label %for.body20, label %for.cond.cleanup19 for.cond.cleanup19: ; preds = %for.body20, %for.body14 %inc31 = add nuw nsw i32 %i10.075, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc31, %15 br i1 %cmp12, label %for.body14, label %for.cond34.preheader, !llvm.loop !13 for.body20: ; preds = %for.body14, %for.body20 %j16.073 = phi i32 [ %inc28, %for.body20 ], [ 0, %for.body14 ] %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %16 = load i32, ptr %v, align 4, !tbaa !5 %dec22 = add nsw i32 %16, -1 store i32 %dec22, ptr %v, align 4, !tbaa !5 %17 = load i32, ptr %u, align 4, !tbaa !5 %idxprom23 = sext i32 %17 to i64 %idxprom25 = sext i32 %dec22 to i64 %arrayidx26 = getelementptr inbounds [100 x [100 x i32]], ptr %m, i64 0, i64 %idxprom23, i64 %idxprom25 store i32 1, ptr %arrayidx26, align 4, !tbaa !5 %inc28 = add nuw nsw i32 %j16.073, 1 %18 = load i32, ptr %k, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc28, %18 br i1 %cmp18, label %for.body20, label %for.cond.cleanup19, !llvm.loop !14 for.cond39.preheader: ; preds = %for.cond34.preheader, %for.cond.cleanup41 %19 = phi i32 [ %22, %for.cond.cleanup41 ], [ %15, %for.cond34.preheader ] %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.cond.cleanup41 ], [ 0, %for.cond34.preheader ] %cmp4076 = icmp sgt i32 %19, 0 br i1 %cmp4076, label %if.end.peel, label %for.cond.cleanup41 if.end.peel: ; preds = %for.cond39.preheader %arrayidx47.peel = getelementptr inbounds [100 x [100 x i32]], ptr %m, i64 0, i64 %indvars.iv84, i64 0 %20 = load i32, ptr %arrayidx47.peel, align 16, !tbaa !5 %call48.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp40.peel = icmp sgt i32 %21, 1 br i1 %cmp40.peel, label %if.end, label %for.cond.cleanup41 for.cond.cleanup36: ; preds = %for.cond.cleanup41, %entry, %for.cond11.preheader, %for.cond34.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 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %m) #5 ret i32 0 for.cond.cleanup41: ; preds = %if.end, %if.end.peel, %for.cond39.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp35 = icmp slt i64 %indvars.iv.next85, %23 br i1 %cmp35, label %for.cond39.preheader, label %for.cond.cleanup36, !llvm.loop !15 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar67 = call i32 @putchar(i32 32) %arrayidx47 = getelementptr inbounds [100 x [100 x i32]], ptr %m, i64 0, i64 %indvars.iv84, i64 %indvars.iv %24 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24) %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 %cmp40 = icmp slt i64 %indvars.iv.next, %26 br i1 %cmp40, label %if.end, label %for.cond.cleanup41, !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 nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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} !17 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #define MAX 100 int main(void){ int i,j; int M[MAX][MAX]; int n,m; int u,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",&u,&m); u--; for(j = 0;j < m;j++){ scanf("%d",&v); v--; M[u][v] = 1; } } for(i = 0;i < n;i++){ for(j = 0;j < n;j++){ if(j > 0){ printf(" "); } printf("%d",M[i][j]); } puts(""); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293540/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293540/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %M = alloca [100 x [100 x i32]], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 %u = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %M) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #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 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.cond1.preheader.us.preheader, label %for.end47 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 %invariant.gep = getelementptr i8, ptr %M, i64 400 %invariant.gep84 = getelementptr i8, ptr %M, i64 800 %invariant.gep86 = getelementptr i8, ptr %M, i64 1200 %invariant.gep88 = getelementptr i8, ptr %M, i64 1600 %invariant.gep90 = getelementptr i8, ptr %M, i64 2000 %invariant.gep92 = getelementptr i8, ptr %M, i64 2400 %invariant.gep94 = getelementptr i8, ptr %M, i64 2800 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 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep85 = getelementptr i8, ptr %invariant.gep84, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep85, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep87 = getelementptr i8, ptr %invariant.gep86, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep87, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep89 = getelementptr i8, ptr %invariant.gep88, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep89, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep91 = getelementptr i8, ptr %invariant.gep90, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep91, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep93 = getelementptr i8, ptr %invariant.gep92, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep95 = getelementptr i8, ptr %invariant.gep94, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep95, 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 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 %cmp66, label %for.body11, label %for.end47 for.cond28.preheader: ; preds = %for.inc25 %cmp2974 = icmp sgt i32 %18, 0 br i1 %cmp2974, label %for.cond31.preheader, label %for.end47 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.171 = 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 %m) %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 %m, align 4, !tbaa !5 %cmp1468 = icmp sgt i32 %14, 0 br i1 %cmp1468, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.169 = 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.169, 1 %17 = load i32, ptr %m, 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.171, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end43 %19 = phi i32 [ %25, %for.end43 ], [ %18, %for.cond28.preheader ] %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.end43 ], [ 0, %for.cond28.preheader ] %cmp3272 = icmp sgt i32 %19, 0 br i1 %cmp3272, label %if.end.peel, label %for.end43 if.end.peel: ; preds = %for.cond31.preheader %arrayidx39.peel = getelementptr inbounds [100 x [100 x i32]], ptr %M, i64 0, i64 %indvars.iv80, i64 0 %20 = load i32, ptr %arrayidx39.peel, align 16, !tbaa !5 %call40.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %21, 1 br i1 %cmp32.peel, label %if.end, label %for.end43 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar63 = call i32 @putchar(i32 32) %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %M, i64 0, i64 %indvars.iv80, i64 %indvars.iv %22 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp32, label %if.end, label %for.end43, !llvm.loop !15 for.end43: ; preds = %if.end, %if.end.peel, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp29 = icmp slt i64 %indvars.iv.next81, %26 br i1 %cmp29, label %for.cond31.preheader, label %for.end47, !llvm.loop !17 for.end47: ; preds = %for.end43, %entry, %for.cond9.preheader, %for.cond28.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 %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %M) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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.peeled.count", i32 1} !17 = distinct !{!17, !10}
#include <stdio.h> int main(){ int i,j,n,c,I,J; scanf("%d",&n); int C[n+1][n+1]; for(i=1; i <= n; i++){ for(j=1; j <= n; j++){ C[i][j] = 0; } } for(i=1; i <= n; i++){ scanf("%d",&I); scanf("%d",&c); for(j=1; j <= c; j++){ scanf("%d",&J); C[I][J] = 1; } } for(i=1; i <= n; i++){ for(j=1; j <= n; j++){ printf("%d",C[i][j]); if(j != n){ printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293591/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 %c = alloca i32, align 4 %I = alloca i32, align 4 %J = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %I) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %J) #6 %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 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %3 = mul nuw i64 %1, %1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not67 = icmp slt i32 %4, 1 br i1 %cmp.not67, label %for.end48, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %entry %5 = shl nuw nsw i64 %1, 2 %6 = zext i32 %4 to i64 %7 = shl nuw nsw i64 %6, 2 %8 = getelementptr i8, ptr %vla, i64 %5 %9 = getelementptr i8, ptr %8, i64 4 %xtraiter = and i64 %6, 7 %10 = icmp ult i32 %4, 8 br i1 %10, label %for.cond10.preheader.unr-lcssa, label %for.cond2.preheader.preheader.new for.cond2.preheader.preheader.new: ; preds = %for.cond2.preheader.preheader %unroll_iter = and i64 %6, 4294967288 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader, %for.cond2.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond2.preheader.preheader.new ], [ %indvar.next.7, %for.cond2.preheader ] %niter = phi i64 [ 0, %for.cond2.preheader.preheader.new ], [ %niter.next.7, %for.cond2.preheader ] %11 = mul i64 %5, %indvar %scevgep = getelementptr i8, ptr %9, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %12 = mul i64 %5, %indvar.next %scevgep.1 = getelementptr i8, ptr %9, i64 %12 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.1 = or i64 %indvar, 2 %13 = mul i64 %5, %indvar.next.1 %scevgep.2 = getelementptr i8, ptr %9, i64 %13 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.2, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.2 = or i64 %indvar, 3 %14 = mul i64 %5, %indvar.next.2 %scevgep.3 = getelementptr i8, ptr %9, i64 %14 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.3, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.3 = or i64 %indvar, 4 %15 = mul i64 %5, %indvar.next.3 %scevgep.4 = getelementptr i8, ptr %9, i64 %15 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.4, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.4 = or i64 %indvar, 5 %16 = mul i64 %5, %indvar.next.4 %scevgep.5 = getelementptr i8, ptr %9, i64 %16 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.5, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.5 = or i64 %indvar, 6 %17 = mul i64 %5, %indvar.next.5 %scevgep.6 = getelementptr i8, ptr %9, i64 %17 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.6, i8 0, i64 %7, i1 false), !tbaa !5 %indvar.next.6 = or i64 %indvar, 7 %18 = mul i64 %5, %indvar.next.6 %scevgep.7 = getelementptr i8, ptr %9, i64 %18 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.7, i8 0, i64 %7, 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.cond10.preheader.unr-lcssa, label %for.cond2.preheader, !llvm.loop !9 for.cond10.preheader.unr-lcssa: ; preds = %for.cond2.preheader, %for.cond2.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond2.preheader.preheader ], [ %indvar.next.7, %for.cond2.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond10.preheader, label %for.cond2.preheader.epil for.cond2.preheader.epil: ; preds = %for.cond10.preheader.unr-lcssa, %for.cond2.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond2.preheader.epil ], [ %indvar.unr, %for.cond10.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond2.preheader.epil ], [ 0, %for.cond10.preheader.unr-lcssa ] %19 = mul i64 %5, %indvar.epil %scevgep.epil = getelementptr i8, ptr %9, i64 %19 call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %7, 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.cond10.preheader, label %for.cond2.preheader.epil, !llvm.loop !11 for.cond10.preheader: ; preds = %for.cond2.preheader.epil, %for.cond10.preheader.unr-lcssa br i1 %cmp.not67, label %for.end48, label %for.body12 for.cond29.preheader: ; preds = %for.inc26 %cmp30.not75 = icmp slt i32 %25, 1 br i1 %cmp30.not75, label %for.end48, label %for.cond32.preheader for.body12: ; preds = %for.cond10.preheader, %for.inc26 %i.172 = phi i32 [ %inc27, %for.inc26 ], [ 1, %for.cond10.preheader ] %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %I) %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %20 = load i32, ptr %c, align 4, !tbaa !5 %cmp16.not69 = icmp slt i32 %20, 1 br i1 %cmp16.not69, label %for.inc26, label %for.body17 for.body17: ; preds = %for.body12, %for.body17 %j.170 = phi i32 [ %inc24, %for.body17 ], [ 1, %for.body12 ] %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %J) %21 = load i32, ptr %I, align 4, !tbaa !5 %idxprom19 = sext i32 %21 to i64 %22 = mul nsw i64 %idxprom19, %1 %arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %22 %23 = load i32, ptr %J, align 4, !tbaa !5 %idxprom21 = sext i32 %23 to i64 %arrayidx22 = getelementptr inbounds i32, ptr %arrayidx20, i64 %idxprom21 store i32 1, ptr %arrayidx22, align 4, !tbaa !5 %inc24 = add nuw nsw i32 %j.170, 1 %24 = load i32, ptr %c, align 4, !tbaa !5 %cmp16.not.not = icmp slt i32 %j.170, %24 br i1 %cmp16.not.not, label %for.body17, label %for.inc26, !llvm.loop !13 for.inc26: ; preds = %for.body17, %for.body12 %inc27 = add nuw nsw i32 %i.172, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %cmp11.not.not = icmp slt i32 %i.172, %25 br i1 %cmp11.not.not, label %for.body12, label %for.cond29.preheader, !llvm.loop !14 for.cond32.preheader: ; preds = %for.cond29.preheader, %for.end44 %26 = phi i32 [ %33, %for.end44 ], [ %25, %for.cond29.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end44 ], [ 1, %for.cond29.preheader ] %cmp33.not73 = icmp slt i32 %26, 1 br i1 %cmp33.not73, label %for.end44, label %for.body34.lr.ph for.body34.lr.ph: ; preds = %for.cond32.preheader %27 = mul nuw nsw i64 %indvars.iv79, %1 %arrayidx36 = getelementptr inbounds i32, ptr %vla, i64 %27 br label %for.body34 for.body34: ; preds = %for.body34.lr.ph, %for.inc42 %indvars.iv = phi i64 [ 1, %for.body34.lr.ph ], [ %indvars.iv.next, %for.inc42 ] %arrayidx38 = getelementptr inbounds i32, ptr %arrayidx36, i64 %indvars.iv %28 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28) %29 = load i32, ptr %n, align 4, !tbaa !5 %30 = zext i32 %29 to i64 %cmp40.not = icmp eq i64 %indvars.iv, %30 br i1 %cmp40.not, label %for.inc42, label %if.then if.then: ; preds = %for.body34 %putchar64 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body34, %if.then %31 = phi i32 [ %29, %for.body34 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %32 = sext i32 %31 to i64 %cmp33.not.not = icmp slt i64 %indvars.iv, %32 br i1 %cmp33.not.not, label %for.body34, label %for.end44, !llvm.loop !15 for.end44: ; preds = %for.inc42, %for.cond32.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %33 = load i32, ptr %n, align 4, !tbaa !5 %34 = sext i32 %33 to i64 %cmp30.not.not = icmp slt i64 %indvars.iv79, %34 br i1 %cmp30.not.not, label %for.cond32.preheader, label %for.end48, !llvm.loop !16 for.end48: ; preds = %for.end44, %entry, %for.cond10.preheader, %for.cond29.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %J) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %I) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 declare void @llvm.stackrestore.p0(ptr) #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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } 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}
#include<stdio.h> int main(){ int i, j, n, x[101][101] = {}, y[3]; scanf("%d", &n); for(i = 1; i <= n; i++){ scanf("%d %d", &y[0], &y[1]); for(j = 1; j <= y[1]; j++){ scanf("%d", &y[2]); x[i][y[2]] = 1; } } for(i = 1; i <= n; i++){ for(j = 1; j <= n; j++){ printf("%d", x[i][j]); if(j != n) printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293634/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [101 x [101 x i32]], align 16 %y = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %x) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %x, i8 0, i64 40804, i1 false) call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not49 = icmp slt i32 %0, 1 br i1 %cmp.not49, label %for.end35, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %arrayidx1 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 1 %arrayidx7 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 2 br label %for.body for.cond16.preheader: ; preds = %for.inc13 %cmp17.not53 = icmp slt i32 %4, 1 br i1 %cmp17.not53, label %for.end35, label %for.cond19.preheader for.body: ; preds = %for.body.lr.ph, %for.inc13 %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc13 ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx1) %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp5.not47 = icmp slt i32 %1, 1 br i1 %cmp5.not47, label %for.inc13, label %for.body6 for.body6: ; preds = %for.body, %for.body6 %j.048 = phi i32 [ %inc, %for.body6 ], [ 1, %for.body ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %2 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %idxprom11 = sext i32 %2 to i64 %arrayidx12 = getelementptr inbounds [101 x [101 x i32]], ptr %x, i64 0, i64 %indvars.iv, i64 %idxprom11 store i32 1, ptr %arrayidx12, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.048, 1 %3 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp5.not.not = icmp slt i32 %j.048, %3 br i1 %cmp5.not.not, label %for.body6, label %for.inc13, !llvm.loop !9 for.inc13: ; preds = %for.body6, %for.body %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.cond16.preheader, !llvm.loop !11 for.cond19.preheader: ; preds = %for.cond16.preheader, %for.end31 %6 = phi i32 [ %12, %for.end31 ], [ %4, %for.cond16.preheader ] %indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.end31 ], [ 1, %for.cond16.preheader ] %cmp20.not51 = icmp slt i32 %6, 1 br i1 %cmp20.not51, label %for.end31, label %for.body21 for.body21: ; preds = %for.cond19.preheader, %for.inc29 %indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.inc29 ], [ 1, %for.cond19.preheader ] %arrayidx25 = getelementptr inbounds [101 x [101 x i32]], ptr %x, i64 0, i64 %indvars.iv59, i64 %indvars.iv56 %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %cmp27.not = icmp eq i64 %indvars.iv56, %9 br i1 %cmp27.not, label %for.inc29, label %if.then if.then: ; preds = %for.body21 %putchar46 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc29 for.inc29: ; preds = %for.body21, %if.then %10 = phi i32 [ %8, %for.body21 ], [ %.pre, %if.then ] %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %11 = sext i32 %10 to i64 %cmp20.not.not = icmp slt i64 %indvars.iv56, %11 br i1 %cmp20.not.not, label %for.body21, label %for.end31, !llvm.loop !12 for.end31: ; preds = %for.inc29, %for.cond19.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp17.not.not = icmp slt i64 %indvars.iv59, %13 br i1 %cmp17.not.not, label %for.cond19.preheader, label %for.end35, !llvm.loop !13 for.end35: ; preds = %for.end31, %entry, %for.cond16.preheader call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int a[100][100]; //0オリジン int n,i,j,u,k,v; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ a[i][j]=0; //a[0][0]=0,a[1][1]=0, ... } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u=u-1; //0オリジンへ変換 for(j=0;j<k;j++){ scanf("%d",&v); v=v-1; //0オリジンへ変換 a[u][v] = 1; // 辺作成 } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(j!=0) printf(" "); printf("%d",a[i][j]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293678/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293678/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"%d%d\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 %u = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5 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 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.cond1.preheader.us.preheader, label %for.end47 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 %invariant.gep = getelementptr i8, ptr %a, i64 400 %invariant.gep84 = getelementptr i8, ptr %a, i64 800 %invariant.gep86 = getelementptr i8, ptr %a, i64 1200 %invariant.gep88 = getelementptr i8, ptr %a, i64 1600 %invariant.gep90 = getelementptr i8, ptr %a, i64 2000 %invariant.gep92 = getelementptr i8, ptr %a, i64 2400 %invariant.gep94 = getelementptr i8, ptr %a, i64 2800 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 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep85 = getelementptr i8, ptr %invariant.gep84, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep85, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep87 = getelementptr i8, ptr %invariant.gep86, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep87, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep89 = getelementptr i8, ptr %invariant.gep88, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep89, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep91 = getelementptr i8, ptr %invariant.gep90, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep91, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep93 = getelementptr i8, ptr %invariant.gep92, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep93, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep95 = getelementptr i8, ptr %invariant.gep94, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep95, 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 %a, i64 %12 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 %cmp66, label %for.body11, label %for.end47 for.cond28.preheader: ; preds = %for.inc25 %cmp2974 = icmp sgt i32 %18, 0 br i1 %cmp2974, label %for.cond31.preheader, label %for.end47 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.171 = 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 %sub = add nsw i32 %13, -1 store i32 %sub, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1468 = icmp sgt i32 %14, 0 br i1 %cmp1468, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.169 = 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 %sub17 = add nsw i32 %15, -1 store i32 %sub17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, 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 %a, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.169, 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.171, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end43 %19 = phi i32 [ %25, %for.end43 ], [ %18, %for.cond28.preheader ] %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.end43 ], [ 0, %for.cond28.preheader ] %cmp3272 = icmp sgt i32 %19, 0 br i1 %cmp3272, label %if.end.peel, label %for.end43 if.end.peel: ; preds = %for.cond31.preheader %arrayidx39.peel = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv80, i64 0 %20 = load i32, ptr %arrayidx39.peel, align 16, !tbaa !5 %call40.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %21, 1 br i1 %cmp32.peel, label %if.end, label %for.end43 if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar63 = call i32 @putchar(i32 32) %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv80, i64 %indvars.iv %22 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp32, label %if.end, label %for.end43, !llvm.loop !15 for.end43: ; preds = %if.end, %if.end.peel, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp29 = icmp slt i64 %indvars.iv.next81, %26 br i1 %cmp29, label %for.cond31.preheader, label %for.end47, !llvm.loop !17 for.end47: ; preds = %for.end43, %entry, %for.cond9.preheader, %for.cond28.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 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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.peeled.count", i32 1} !17 = distinct !{!17, !10}
#include <stdio.h> int main() { int a,b,i,j,n,k,x[500][500]; scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d%d",&a,&n); for(j=0;j<n;j++){ scanf("%d",&b); x[a][b]=1; } } for(i=1;i<=k;i++){ for(j=1;j<=k;j++){ printf("%d",x[i][j]); if(j!=k) printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293728/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293728/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"%d%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 %n = alloca i32, align 4 %k = alloca i32, align 4 %x = alloca [500 x [500 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.body, label %for.end30 for.cond11.preheader: ; preds = %for.inc8 %cmp12.not47 = icmp slt i32 %5, 1 br i1 %cmp12.not47, label %for.end30, label %for.cond14.preheader for.body: ; preds = %entry, %for.inc8 %i.044 = phi i32 [ %inc9, %for.inc8 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp341 = icmp sgt i32 %1, 0 br i1 %cmp341, label %for.body4, label %for.inc8 for.body4: ; preds = %for.body, %for.body4 %j.042 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 %3 = load i32, ptr %b, align 4, !tbaa !5 %idxprom6 = sext i32 %3 to i64 %arrayidx7 = getelementptr inbounds [500 x [500 x i32]], ptr %x, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.042, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body4, label %for.inc8, !llvm.loop !9 for.inc8: ; preds = %for.body4, %for.body %inc9 = add nuw nsw i32 %i.044, 1 %5 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %5 br i1 %cmp, label %for.body, label %for.cond11.preheader, !llvm.loop !11 for.cond14.preheader: ; preds = %for.cond11.preheader, %for.end26 %6 = phi i32 [ %12, %for.end26 ], [ %5, %for.cond11.preheader ] %indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.end26 ], [ 1, %for.cond11.preheader ] %cmp15.not45 = icmp slt i32 %6, 1 br i1 %cmp15.not45, label %for.end26, label %for.body16 for.body16: ; preds = %for.cond14.preheader, %for.inc24 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc24 ], [ 1, %for.cond14.preheader ] %arrayidx20 = getelementptr inbounds [500 x [500 x i32]], ptr %x, i64 0, i64 %indvars.iv50, i64 %indvars.iv %7 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %k, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %cmp22.not = icmp eq i64 %indvars.iv, %9 br i1 %cmp22.not, label %for.inc24, label %if.then if.then: ; preds = %for.body16 %putchar40 = call i32 @putchar(i32 32) %.pre = load i32, ptr %k, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.body16, %if.then %10 = phi i32 [ %8, %for.body16 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = sext i32 %10 to i64 %cmp15.not.not = icmp slt i64 %indvars.iv, %11 br i1 %cmp15.not.not, label %for.body16, label %for.end26, !llvm.loop !12 for.end26: ; preds = %for.inc24, %for.cond14.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %12 = load i32, ptr %k, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp12.not.not = icmp slt i64 %indvars.iv50, %13 br i1 %cmp12.not.not, label %for.cond14.preheader, label %for.end30, !llvm.loop !13 for.end30: ; preds = %for.end26, %entry, %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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: 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 = !{!"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}
#include<stdio.h> #define N 100 int main(){ int M[N][N]; int n, u, k, v, 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; } } for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ printf("%d", M[i][j]); if(j < n-1) printf(" "); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293771/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293771/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %M = alloca [100 x [100 x i32]], align 16 %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 40000, ptr nonnull %M) #5 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 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.cond1.preheader.us.preheader, label %for.end47 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 %invariant.gep = getelementptr i8, ptr %M, i64 400 %invariant.gep83 = getelementptr i8, ptr %M, i64 800 %invariant.gep85 = getelementptr i8, ptr %M, i64 1200 %invariant.gep87 = getelementptr i8, ptr %M, i64 1600 %invariant.gep89 = getelementptr i8, ptr %M, i64 2000 %invariant.gep91 = getelementptr i8, ptr %M, i64 2400 %invariant.gep93 = getelementptr i8, ptr %M, i64 2800 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 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 %invariant.gep, i64 %5 call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep84 = getelementptr i8, ptr %invariant.gep83, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %gep84, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep86 = getelementptr i8, ptr %invariant.gep85, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %gep86, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep88 = getelementptr i8, ptr %invariant.gep87, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %gep88, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep90 = getelementptr i8, ptr %invariant.gep89, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %gep90, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep92 = getelementptr i8, ptr %invariant.gep91, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %gep92, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep94 = getelementptr i8, ptr %invariant.gep93, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %gep94, 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 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 %cmp66, label %for.body11, label %for.end47 for.cond28.preheader: ; preds = %for.inc25 %cmp2974 = icmp sgt i32 %18, 0 br i1 %cmp2974, label %for.cond31.preheader, label %for.end47 for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.171 = 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 %cmp1468 = icmp sgt i32 %14, 0 br i1 %cmp1468, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.169 = 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.169, 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.171, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond28.preheader, %for.end43 %19 = phi i32 [ %25, %for.end43 ], [ %18, %for.cond28.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end43 ], [ 0, %for.cond28.preheader ] %cmp3272 = icmp sgt i32 %19, 0 br i1 %cmp3272, label %for.body33, label %for.end43 for.body33: ; preds = %for.cond31.preheader, %for.inc41 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc41 ], [ 0, %for.cond31.preheader ] %arrayidx37 = getelementptr inbounds [100 x [100 x i32]], ptr %M, i64 0, i64 %indvars.iv79, i64 %indvars.iv %20 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %21, -1 %22 = sext i32 %sub to i64 %cmp39 = icmp slt i64 %indvars.iv, %22 br i1 %cmp39, label %if.then, label %for.inc41 if.then: ; preds = %for.body33 %putchar63 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc41 for.inc41: ; preds = %for.body33, %if.then %23 = phi i32 [ %21, %for.body33 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %24 = sext i32 %23 to i64 %cmp32 = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp32, label %for.body33, label %for.end43, !llvm.loop !15 for.end43: ; preds = %for.inc41, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %25 = load i32, ptr %n, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp29 = icmp slt i64 %indvars.iv.next80, %26 br i1 %cmp29, label %for.cond31.preheader, label %for.end47, !llvm.loop !16 for.end47: ; preds = %for.end43, %entry, %for.cond9.preheader, %for.cond28.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 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %M) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !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}
#include<stdio.h> #define MAX 102 int main(){ int box[MAX][MAX]; int tmp[MAX][MAX]; int i,j,n,m,l; for(i=1;i<MAX;i++){ for(j=1;j<MAX;j++){ box[i][j]=0; tmp[i][j]=0; } } scanf("%d",&n);//頂点数の入力 //入力 for(i=1;i<=n;i++){ scanf("%d",&m); scanf("%d",&l); for(j=1;j<=l;j++){ scanf("%d",&tmp[i][j]);//隣接する頂点の番号の保持 } } //隣接の判定 for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ if(tmp[i][j]!=0){ box[i][tmp[i][j]]=1; } } } //出力 for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ if(j!=n){ printf("%d ",box[i][j]); } else { printf("%d\n",box[i][j]); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293814/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293814/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 \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %box = alloca [102 x [102 x i32]], align 16 %tmp = alloca [102 x [102 x i32]], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 41616, ptr nonnull %box) #4 call void @llvm.lifetime.start.p0(i64 41616, ptr nonnull %tmp) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.1, %entry %indvar = phi i64 [ 0, %entry ], [ %indvar.next.3, %for.cond1.preheader.1 ] %0 = mul nuw nsw i64 %indvar, 408 %1 = add nuw nsw i64 %0, 412 %scevgep129 = getelementptr i8, ptr %tmp, i64 %1 %scevgep = getelementptr i8, ptr %box, i64 %1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep, i8 0, i64 404, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep129, i8 0, i64 404, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %exitcond.not = icmp eq i64 %indvar.next, 101 br i1 %exitcond.not, label %for.end12, label %for.cond1.preheader.1, !llvm.loop !9 for.cond1.preheader.1: ; preds = %for.cond1.preheader %2 = mul nuw nsw i64 %indvar.next, 408 %3 = add nuw nsw i64 %2, 412 %scevgep129.1 = getelementptr i8, ptr %tmp, i64 %3 %scevgep.1 = getelementptr i8, ptr %box, i64 %3 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep.1, i8 0, i64 404, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep129.1, i8 0, i64 404, i1 false), !tbaa !5 %4 = mul nuw i64 %indvar, 408 %5 = add nuw i64 %4, 1228 %scevgep129.2 = getelementptr i8, ptr %tmp, i64 %5 %scevgep.2 = getelementptr i8, ptr %box, i64 %5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep.2, i8 0, i64 404, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep129.2, i8 0, i64 404, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 408 %7 = add nuw i64 %6, 1636 %scevgep129.3 = getelementptr i8, ptr %tmp, i64 %7 %scevgep.3 = getelementptr i8, ptr %box, i64 %7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep.3, i8 0, i64 404, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %scevgep129.3, i8 0, i64 404, i1 false), !tbaa !5 %indvar.next.3 = add nuw nsw i64 %indvar, 4 br label %for.cond1.preheader for.end12: ; preds = %for.cond1.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp14.not117 = icmp slt i32 %8, 1 br i1 %cmp14.not117, label %for.end81, label %for.body15 for.cond32.preheader: ; preds = %for.inc29 %cmp33.not121 = icmp slt i32 %14, 1 br i1 %cmp33.not121, label %for.end81, label %for.cond35.preheader.preheader for.cond35.preheader.preheader: ; preds = %for.cond32.preheader %9 = add i32 %14, 1 %wide.trip.count142 = zext i32 %9 to i64 %10 = add nsw i64 %wide.trip.count142, -1 %min.iters.check = icmp ult i64 %10, 8 %n.vec = and i64 %10, -8 %ind.end = or i64 %n.vec, 1 %cmp.n = icmp eq i64 %10, %n.vec br label %for.cond35.preheader for.body15: ; preds = %for.end12, %for.inc29 %indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.inc29 ], [ 1, %for.end12 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l) %11 = load i32, ptr %l, align 4, !tbaa !5 %cmp19.not115 = icmp slt i32 %11, 1 br i1 %cmp19.not115, label %for.inc29, label %for.body20 for.body20: ; preds = %for.body15, %for.body20 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body20 ], [ 1, %for.body15 ] %arrayidx24 = getelementptr inbounds [102 x [102 x i32]], ptr %tmp, i64 0, i64 %indvars.iv132, i64 %indvars.iv %call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx24) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = load i32, ptr %l, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp19.not.not = icmp slt i64 %indvars.iv, %13 br i1 %cmp19.not.not, label %for.body20, label %for.inc29, !llvm.loop !11 for.inc29: ; preds = %for.body20, %for.body15 %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp14.not.not = icmp slt i64 %indvars.iv132, %15 br i1 %cmp14.not.not, label %for.body15, label %for.cond32.preheader, !llvm.loop !12 for.cond35.preheader: ; preds = %for.cond35.preheader.preheader, %for.cond35.for.inc54_crit_edge %indvars.iv139 = phi i64 [ 1, %for.cond35.preheader.preheader ], [ %indvars.iv.next140, %for.cond35.for.inc54_crit_edge ] br i1 %min.iters.check, label %for.body37.preheader, label %vector.body vector.body: ; preds = %for.cond35.preheader, %pred.store.continue171 %index = phi i64 [ %index.next, %pred.store.continue171 ], [ 0, %for.cond35.preheader ] %offset.idx = or i64 %index, 1 %16 = getelementptr inbounds [102 x [102 x i32]], ptr %tmp, i64 0, i64 %indvars.iv139, i64 %offset.idx %wide.load = load <4 x i32>, ptr %16, align 4, !tbaa !5 %17 = getelementptr inbounds i32, ptr %16, i64 4 %wide.load157 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = icmp ne <4 x i32> %wide.load, zeroinitializer %19 = icmp ne <4 x i32> %wide.load157, zeroinitializer %20 = extractelement <4 x i1> %18, i64 0 br i1 %20, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %21 = extractelement <4 x i32> %wide.load, i64 0 %22 = sext i32 %21 to i64 %23 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %22 store i32 1, ptr %23, align 4, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %24 = extractelement <4 x i1> %18, i64 1 br i1 %24, label %pred.store.if158, label %pred.store.continue159 pred.store.if158: ; preds = %pred.store.continue %25 = extractelement <4 x i32> %wide.load, i64 1 %26 = sext i32 %25 to i64 %27 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %26 store i32 1, ptr %27, align 4, !tbaa !5 br label %pred.store.continue159 pred.store.continue159: ; preds = %pred.store.if158, %pred.store.continue %28 = extractelement <4 x i1> %18, i64 2 br i1 %28, label %pred.store.if160, label %pred.store.continue161 pred.store.if160: ; preds = %pred.store.continue159 %29 = extractelement <4 x i32> %wide.load, i64 2 %30 = sext i32 %29 to i64 %31 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %30 store i32 1, ptr %31, align 4, !tbaa !5 br label %pred.store.continue161 pred.store.continue161: ; preds = %pred.store.if160, %pred.store.continue159 %32 = extractelement <4 x i1> %18, i64 3 br i1 %32, label %pred.store.if162, label %pred.store.continue163 pred.store.if162: ; preds = %pred.store.continue161 %33 = extractelement <4 x i32> %wide.load, i64 3 %34 = sext i32 %33 to i64 %35 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %34 store i32 1, ptr %35, align 4, !tbaa !5 br label %pred.store.continue163 pred.store.continue163: ; preds = %pred.store.if162, %pred.store.continue161 %36 = extractelement <4 x i1> %19, i64 0 br i1 %36, label %pred.store.if164, label %pred.store.continue165 pred.store.if164: ; preds = %pred.store.continue163 %37 = extractelement <4 x i32> %wide.load157, i64 0 %38 = sext i32 %37 to i64 %39 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %38 store i32 1, ptr %39, align 4, !tbaa !5 br label %pred.store.continue165 pred.store.continue165: ; preds = %pred.store.if164, %pred.store.continue163 %40 = extractelement <4 x i1> %19, i64 1 br i1 %40, label %pred.store.if166, label %pred.store.continue167 pred.store.if166: ; preds = %pred.store.continue165 %41 = extractelement <4 x i32> %wide.load157, i64 1 %42 = sext i32 %41 to i64 %43 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %42 store i32 1, ptr %43, align 4, !tbaa !5 br label %pred.store.continue167 pred.store.continue167: ; preds = %pred.store.if166, %pred.store.continue165 %44 = extractelement <4 x i1> %19, i64 2 br i1 %44, label %pred.store.if168, label %pred.store.continue169 pred.store.if168: ; preds = %pred.store.continue167 %45 = extractelement <4 x i32> %wide.load157, i64 2 %46 = sext i32 %45 to i64 %47 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %46 store i32 1, ptr %47, align 4, !tbaa !5 br label %pred.store.continue169 pred.store.continue169: ; preds = %pred.store.if168, %pred.store.continue167 %48 = extractelement <4 x i1> %19, i64 3 br i1 %48, label %pred.store.if170, label %pred.store.continue171 pred.store.if170: ; preds = %pred.store.continue169 %49 = extractelement <4 x i32> %wide.load157, i64 3 %50 = sext i32 %49 to i64 %51 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %50 store i32 1, ptr %51, align 4, !tbaa !5 br label %pred.store.continue171 pred.store.continue171: ; preds = %pred.store.if170, %pred.store.continue169 %index.next = add nuw i64 %index, 8 %52 = icmp eq i64 %index.next, %n.vec br i1 %52, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %pred.store.continue171 br i1 %cmp.n, label %for.cond35.for.inc54_crit_edge, label %for.body37.preheader for.body37.preheader: ; preds = %for.cond35.preheader, %middle.block %indvars.iv135.ph = phi i64 [ 1, %for.cond35.preheader ], [ %ind.end, %middle.block ] br label %for.body37 for.cond57.preheader: ; preds = %for.cond35.for.inc54_crit_edge br i1 %cmp33.not121, label %for.end81, label %for.cond60.preheader for.body37: ; preds = %for.body37.preheader, %for.inc51 %indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc51 ], [ %indvars.iv135.ph, %for.body37.preheader ] %arrayidx41 = getelementptr inbounds [102 x [102 x i32]], ptr %tmp, i64 0, i64 %indvars.iv139, i64 %indvars.iv135 %53 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %cmp42.not = icmp eq i32 %53, 0 br i1 %cmp42.not, label %for.inc51, label %if.then if.then: ; preds = %for.body37 %idxprom49 = sext i32 %53 to i64 %arrayidx50 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv139, i64 %idxprom49 store i32 1, ptr %arrayidx50, align 4, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %for.body37, %if.then %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %exitcond138.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count142 br i1 %exitcond138.not, label %for.cond35.for.inc54_crit_edge, label %for.body37, !llvm.loop !16 for.cond35.for.inc54_crit_edge: ; preds = %for.inc51, %middle.block %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1 %exitcond143.not = icmp eq i64 %indvars.iv.next140, %wide.trip.count142 br i1 %exitcond143.not, label %for.cond57.preheader, label %for.cond35.preheader, !llvm.loop !17 for.cond60.preheader: ; preds = %for.cond57.preheader, %for.inc79 %54 = phi i32 [ %60, %for.inc79 ], [ %14, %for.cond57.preheader ] %indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.inc79 ], [ 1, %for.cond57.preheader ] %cmp61.not123 = icmp slt i32 %54, 1 br i1 %cmp61.not123, label %for.cond60.preheader.for.inc79_crit_edge, label %for.body62 for.cond60.preheader.for.inc79_crit_edge: ; preds = %for.cond60.preheader %.pre = sext i32 %54 to i64 br label %for.inc79 for.body62: ; preds = %for.cond60.preheader, %for.body62 %indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.body62 ], [ 1, %for.cond60.preheader ] %55 = phi i32 [ %58, %for.body62 ], [ %54, %for.cond60.preheader ] %56 = zext i32 %55 to i64 %cmp63.not = icmp eq i64 %indvars.iv144, %56 %arrayidx73 = getelementptr inbounds [102 x [102 x i32]], ptr %box, i64 0, i64 %indvars.iv147, i64 %indvars.iv144 %57 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %.str.2..str.1 = select i1 %cmp63.not, ptr @.str.2, ptr @.str.1 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1, i32 noundef %57) %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %58 = load i32, ptr %n, align 4, !tbaa !5 %59 = sext i32 %58 to i64 %cmp61.not.not = icmp slt i64 %indvars.iv144, %59 br i1 %cmp61.not.not, label %for.body62, label %for.inc79, !llvm.loop !18 for.inc79: ; preds = %for.body62, %for.cond60.preheader.for.inc79_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond60.preheader.for.inc79_crit_edge ], [ %59, %for.body62 ] %60 = phi i32 [ %54, %for.cond60.preheader.for.inc79_crit_edge ], [ %58, %for.body62 ] %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %cmp58.not.not = icmp slt i64 %indvars.iv147, %.pre-phi br i1 %cmp58.not.not, label %for.cond60.preheader, label %for.end81, !llvm.loop !19 for.end81: ; preds = %for.inc79, %for.end12, %for.cond32.preheader, %for.cond57.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 41616, ptr nonnull %tmp) #4 call void @llvm.lifetime.end.p0(i64 41616, ptr nonnull %box) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !20} !20 = !{!"llvm.loop.unswitch.partial.disable"}
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_SHIP_MAX 200000 // 最大定期便数 // 内部変数 static int si1Ship1[D_SHIP_MAX + 5]; // 定期便1 static int siS1Cnt; // 定期便1数 static int si1ShipN[D_SHIP_MAX + 5]; // 定期便N static int siSNCnt; // 定期便N数 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpT, *szpFpA; #endif // ソート関数 - int昇順 int fSortFnc( const void *pzpVal1 // <I> 値1 , const void *pzpVal2 // <I> 値2 ) { int *lipVal1 = (int *)pzpVal1; int *lipVal2 = (int *)pzpVal2; // 昇順 if (*lipVal1 > *lipVal2) { return(1); } else if (*lipVal1 < *lipVal2) { return(-1); } return 0; } // 実行メイン int fMain( int piTNo // <I> テスト番号 1~ ) { int i; char lc1Buf[1024], lc1Out[1024]; // データ初期化 siS1Cnt = 0; // 定期便1数 siSNCnt = 0; // 定期便N数 // テストファイルオープン #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo); szpFpT = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #endif // 目的地・定期便数取得 int liN, liSCnt; #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif sscanf(lc1Buf, "%d%d", &liN, &liSCnt); // 定期便取得 for (i = 0; i < liSCnt; i++) { int liFNo, liTNo; #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif sscanf(lc1Buf, "%d%d", &liFNo, &liTNo); if (liFNo == 1) { si1Ship1[siS1Cnt] = liTNo; siS1Cnt++; } else if (liTNo == 1) { si1Ship1[siS1Cnt] = liFNo; siS1Cnt++; } else if (liFNo == liN) { si1ShipN[siSNCnt] = liTNo; siSNCnt++; } else if (liTNo == liN) { si1ShipN[siSNCnt] = liFNo; siSNCnt++; } } // 定期便ソート qsort(si1Ship1, siS1Cnt, sizeof(int), fSortFnc); qsort(si1ShipN, siSNCnt, sizeof(int), fSortFnc); // マッチング int liRet = -1; int liS1No = 0; int liSNNo = 0; while (1) { // 終了チェック if (liS1No >= siS1Cnt) { break; } if (liSNNo >= siSNCnt) { break; } // 比較 if (si1Ship1[liS1No] < si1ShipN[liSNNo]) { liS1No++; } else if (si1Ship1[liS1No] == si1ShipN[liSNNo]) { // 一致 liRet = 0; break; } else { liSNNo++; } } // 結果セット if (liRet == 0) { sprintf(lc1Out, "POSSIBLE\n"); } else { sprintf(lc1Out, "IMPOSSIBLE\n"); } // 結果表示 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, lc1Out)) { siRes = -1; } #else printf("%s", lc1Out); #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpT); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", piTNo); } else { printf("NG %d\n", piTNo); } #endif return 0; } int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { fMain(i); } #else fMain(0); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293858/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293858/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" @siS1Cnt = internal unnamed_addr global i32 0, align 4 @siSNCnt = internal unnamed_addr global i32 0, align 4 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @si1Ship1 = internal global [200005 x i32] zeroinitializer, align 16 @si1ShipN = internal global [200005 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [10 x i8] c"POSSIBLE\0A\00", align 1 @.str.2 = private unnamed_addr constant [12 x i8] c"IMPOSSIBLE\0A\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @fSortFnc(ptr nocapture noundef readonly %pzpVal1, ptr nocapture noundef readonly %pzpVal2) #0 { entry: %0 = load i32, ptr %pzpVal1, align 4, !tbaa !5 %1 = load i32, ptr %pzpVal2, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp slt i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. 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: 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 @fMain(i32 %piTNo) local_unnamed_addr #2 { entry: %lc1Buf = alloca [1024 x i8], align 16 %lc1Out = alloca [1024 x i8], align 16 %liN = alloca i32, align 4 %liSCnt = alloca i32, align 4 %liFNo = alloca i32, align 4 %liTNo = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #6 store i32 0, ptr @siS1Cnt, align 4, !tbaa !5 store i32 0, ptr @siSNCnt, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liN) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liSCnt) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull %liN, ptr noundef nonnull %liSCnt) #6 %1 = load i32, ptr %liSCnt, align 4, !tbaa !5 %cmp80 = icmp sgt i32 %1, 0 br i1 %cmp80, label %for.body, label %for.end for.body: ; preds = %entry, %if.end27 %i.081 = phi i32 [ %inc28, %if.end27 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liFNo) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liTNo) #6 %2 = load ptr, ptr @stdin, align 8, !tbaa !9 %call4 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %2) %call6 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull %liFNo, ptr noundef nonnull %liTNo) #6 %3 = load i32, ptr %liFNo, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 %4 = load i32, ptr %liTNo, align 4, !tbaa !5 br i1 %cmp7, label %if.end27.sink.split, label %if.else if.else: ; preds = %for.body %cmp8 = icmp eq i32 %4, 1 br i1 %cmp8, label %if.end27.sink.split, label %if.else13 if.else13: ; preds = %if.else %5 = load i32, ptr %liN, align 4, !tbaa !5 %cmp14 = icmp eq i32 %3, %5 br i1 %cmp14, label %if.end27.sink.split, label %if.else19 if.else19: ; preds = %if.else13 %cmp20 = icmp eq i32 %4, %5 br i1 %cmp20, label %if.end27.sink.split, label %if.end27 if.end27.sink.split: ; preds = %if.else19, %if.else13, %if.else, %for.body %siS1Cnt.sink89 = phi ptr [ @siS1Cnt, %for.body ], [ @siS1Cnt, %if.else ], [ @siSNCnt, %if.else13 ], [ @siSNCnt, %if.else19 ] %si1Ship1.sink = phi ptr [ @si1Ship1, %for.body ], [ @si1Ship1, %if.else ], [ @si1ShipN, %if.else13 ], [ @si1ShipN, %if.else19 ] %.sink87 = phi i32 [ %4, %for.body ], [ %3, %if.else ], [ %4, %if.else13 ], [ %3, %if.else19 ] %6 = load i32, ptr %siS1Cnt.sink89, align 4, !tbaa !5 %idxprom10 = sext i32 %6 to i64 %arrayidx11 = getelementptr inbounds [200005 x i32], ptr %si1Ship1.sink, i64 0, i64 %idxprom10 store i32 %.sink87, ptr %arrayidx11, align 4, !tbaa !5 %inc12 = add nsw i32 %6, 1 store i32 %inc12, ptr %siS1Cnt.sink89, align 4, !tbaa !5 br label %if.end27 if.end27: ; preds = %if.end27.sink.split, %if.else19 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liTNo) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liFNo) #6 %inc28 = add nuw nsw i32 %i.081, 1 %7 = load i32, ptr %liSCnt, align 4, !tbaa !5 %cmp = icmp slt i32 %inc28, %7 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %if.end27, %entry %8 = load i32, ptr @siS1Cnt, align 4, !tbaa !5 %conv = sext i32 %8 to i64 call void @qsort(ptr noundef nonnull @si1Ship1, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @fSortFnc) #6 %9 = load i32, ptr @siSNCnt, align 4, !tbaa !5 %conv29 = sext i32 %9 to i64 call void @qsort(ptr noundef nonnull @si1ShipN, i64 noundef %conv29, i64 noundef 4, ptr noundef nonnull @fSortFnc) #6 %10 = load i32, ptr @siS1Cnt, align 4, !tbaa !5 %11 = load i32, ptr @siSNCnt, align 4 %cmp30.not82 = icmp sgt i32 %10, 0 %cmp34.not83 = icmp sgt i32 %11, 0 %or.cond84 = select i1 %cmp30.not82, i1 %cmp34.not83, i1 false br i1 %or.cond84, label %if.end37, label %if.else63 if.end37: ; preds = %for.end, %if.end57 %liSNNo.086 = phi i32 [ %liSNNo.1, %if.end57 ], [ 0, %for.end ] %liS1No.085 = phi i32 [ %liS1No.1, %if.end57 ], [ 0, %for.end ] %idxprom38 = sext i32 %liS1No.085 to i64 %arrayidx39 = getelementptr inbounds [200005 x i32], ptr @si1Ship1, i64 0, i64 %idxprom38 %12 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %idxprom40 = sext i32 %liSNNo.086 to i64 %arrayidx41 = getelementptr inbounds [200005 x i32], ptr @si1ShipN, i64 0, i64 %idxprom40 %13 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %cmp42 = icmp slt i32 %12, %13 br i1 %cmp42, label %if.then44, label %if.else46 if.then44: ; preds = %if.end37 %inc45 = add nsw i32 %liS1No.085, 1 br label %if.end57 if.else46: ; preds = %if.end37 %cmp51 = icmp eq i32 %12, %13 br i1 %cmp51, label %if.then60, label %if.else54 if.else54: ; preds = %if.else46 %inc55 = add nsw i32 %liSNNo.086, 1 br label %if.end57 if.end57: ; preds = %if.else54, %if.then44 %liS1No.1 = phi i32 [ %inc45, %if.then44 ], [ %liS1No.085, %if.else54 ] %liSNNo.1 = phi i32 [ %liSNNo.086, %if.then44 ], [ %inc55, %if.else54 ] %cmp30.not = icmp slt i32 %liS1No.1, %10 %cmp34.not = icmp slt i32 %liSNNo.1, %11 %or.cond = select i1 %cmp30.not, i1 %cmp34.not, i1 false br i1 %or.cond, label %if.end37, label %if.else63 if.then60: ; preds = %if.else46 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(10) %lc1Out, ptr noundef nonnull align 1 dereferenceable(10) @.str.1, i64 10, i1 false) br label %if.end66 if.else63: ; preds = %if.end57, %for.end call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %lc1Out, ptr noundef nonnull align 1 dereferenceable(12) @.str.2, i64 12, i1 false) br label %if.end66 if.end66: ; preds = %if.else63, %if.then60 %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %lc1Out) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liSCnt) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liN) #6 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #6 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %call = tail call i32 @fMain(i32 poison) ret i32 0 } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> //数组a和b存储连接线,数组c存储岛屿。 int a[200001],b[200001],c[200001]; int main(void) { int n,m,possible; scanf("%d %d",&n,&m); for(int i=0;i<n;i++) c[i]=0; //和1相连的岛屿都打上标记。 for(int i=0;i<m;i++) scanf("%d %d",&a[i],&b[i]); for(int i=0;i<m;i++){ if(a[i]==1) c[b[i]]=1; } //再次遍历m条线,起点打过标记同时终点是n,则为possible。 possible=0; for(int i=0;i<m;i++){ if(c[a[i]]==1&&b[i]==n){ possible=1; break; } } if(possible) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293900/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 @c = dso_local local_unnamed_addr global [200001 x i32] zeroinitializer, align 16 @a = dso_local global [200001 x i32] zeroinitializer, align 16 @b = dso_local global [200001 x i32] zeroinitializer, align 16 @str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1 @str.3 = private unnamed_addr constant [9 x i8] c"POSSIBLE\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body.preheader, label %for.cond2.preheader for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @c, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body.preheader, %entry %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp368 = icmp sgt i32 %3, 0 br i1 %cmp368, label %for.body5, label %if.end50 for.cond15.preheader: ; preds = %for.body5 %cmp1670 = icmp sgt i32 %5, 0 br i1 %cmp1670, label %for.body18.preheader, label %if.end50 for.body18.preheader: ; preds = %for.cond15.preheader %wide.trip.count = zext i32 %5 to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %5, 1 br i1 %4, label %for.cond30.preheader.unr-lcssa, label %for.body18.preheader.new for.body18.preheader.new: ; preds = %for.body18.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body18 for.body5: ; preds = %for.cond2.preheader, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond2.preheader ] %arrayidx7 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv %arrayidx9 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp3, label %for.body5, label %for.cond15.preheader, !llvm.loop !9 for.cond30.preheader.unr-lcssa: ; preds = %for.inc26.1, %for.body18.preheader %indvars.iv77.unr = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next78.1, %for.inc26.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond30.preheader, label %for.body18.epil for.body18.epil: ; preds = %for.cond30.preheader.unr-lcssa %arrayidx20.epil = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv77.unr %7 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %cmp21.epil = icmp eq i32 %7, 1 br i1 %cmp21.epil, label %if.then.epil, label %for.cond30.preheader if.then.epil: ; preds = %for.body18.epil %arrayidx23.epil = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv77.unr %8 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5 %idxprom24.epil = sext i32 %8 to i64 %arrayidx25.epil = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %idxprom24.epil store i32 1, ptr %arrayidx25.epil, align 4, !tbaa !5 br label %for.cond30.preheader for.cond30.preheader: ; preds = %for.body18.epil, %if.then.epil, %for.cond30.preheader.unr-lcssa br i1 %cmp1670, label %for.body33.lr.ph, label %if.end50 for.body33.lr.ph: ; preds = %for.cond30.preheader %9 = load i32, ptr %n, align 4 %wide.trip.count83 = zext i32 %5 to i64 br label %for.body33 for.body18: ; preds = %for.inc26.1, %for.body18.preheader.new %indvars.iv77 = phi i64 [ 0, %for.body18.preheader.new ], [ %indvars.iv.next78.1, %for.inc26.1 ] %niter = phi i64 [ 0, %for.body18.preheader.new ], [ %niter.next.1, %for.inc26.1 ] %arrayidx20 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv77 %10 = load i32, ptr %arrayidx20, align 8, !tbaa !5 %cmp21 = icmp eq i32 %10, 1 br i1 %cmp21, label %if.then, label %for.inc26 if.then: ; preds = %for.body18 %arrayidx23 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv77 %11 = load i32, ptr %arrayidx23, align 8, !tbaa !5 %idxprom24 = sext i32 %11 to i64 %arrayidx25 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %idxprom24 store i32 1, ptr %arrayidx25, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.body18, %if.then %indvars.iv.next78 = or i64 %indvars.iv77, 1 %arrayidx20.1 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv.next78 %12 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %cmp21.1 = icmp eq i32 %12, 1 br i1 %cmp21.1, label %if.then.1, label %for.inc26.1 if.then.1: ; preds = %for.inc26 %arrayidx23.1 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv.next78 %13 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %idxprom24.1 = sext i32 %13 to i64 %arrayidx25.1 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %idxprom24.1 store i32 1, ptr %arrayidx25.1, align 4, !tbaa !5 br label %for.inc26.1 for.inc26.1: ; preds = %if.then.1, %for.inc26 %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 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.cond30.preheader.unr-lcssa, label %for.body18, !llvm.loop !11 for.body33: ; preds = %for.body33.lr.ph, %for.inc44 %indvars.iv80 = phi i64 [ 0, %for.body33.lr.ph ], [ %indvars.iv.next81, %for.inc44 ] %arrayidx35 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv80 %14 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %idxprom36 = sext i32 %14 to i64 %arrayidx37 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %idxprom36 %15 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %cmp38 = icmp eq i32 %15, 1 br i1 %cmp38, label %land.lhs.true, label %for.inc44 land.lhs.true: ; preds = %for.body33 %arrayidx40 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv80 %16 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %16, %9 br i1 %cmp41, label %if.end50, label %for.inc44 for.inc44: ; preds = %for.body33, %land.lhs.true %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83 br i1 %exitcond84.not, label %if.end50, label %for.body33, !llvm.loop !12 if.end50: ; preds = %for.inc44, %land.lhs.true, %for.cond30.preheader, %for.cond15.preheader, %for.cond2.preheader %str.sink = phi ptr [ @str, %for.cond2.preheader ], [ @str, %for.cond15.preheader ], [ @str, %for.cond30.preheader ], [ @str.3, %land.lhs.true ], [ @str, %for.inc44 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> #define SQ(X) \ ( (X) * (X) ) static int k_operafan[ 300 ][ 18 ]; static int dpFSA ( int req, int abl ) { int i; if ( req < 0 ) return ( 0 ); else if ( req == 0 ) return ( 1 ); else if ( abl <= 0 ) return ( 0 ); else if ( ~k_operafan[ req ][ abl ] ) ; else { k_operafan[ req ][ abl ] = 0; for ( i = 0; req - i * SQ( abl ) >= 0; ++i ) { k_operafan[ req ][ abl ] += dpFSA ( req - i * SQ( abl ), abl - 1 ); } } return ( k_operafan[ req ][ abl ] ); } /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { memset ( k_operafan, -1, sizeof ( k_operafan ) ); for ( ; ; ) { int n; scanf ( "%d", &n ); if ( !( n ) ) break ; printf ( "%d\n", dpFSA ( n, 17 ) ); } return ( 0 ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293951/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293951/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" @k_operafan = internal unnamed_addr global [300 x [18 x i32]] zeroinitializer, align 16 @.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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %n = alloca i32, align 4 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21600) @k_operafan, i8 -1, i64 21600, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %for.end, label %cleanup cleanup: ; preds = %entry, %cleanup %1 = phi i32 [ %2, %cleanup ], [ %0, %entry ] %call1 = call fastcc i32 @dpFSA(i32 noundef %1, i32 noundef 17) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 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) %2 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %for.end, label %cleanup for.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 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) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define internal fastcc i32 @dpFSA(i32 noundef %req, i32 noundef %abl) unnamed_addr #4 { entry: %cmp = icmp slt i32 %req, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %entry %cmp1 = icmp eq i32 %req, 0 br i1 %cmp1, label %cleanup, label %if.else3 if.else3: ; preds = %if.else %cmp4 = icmp slt i32 %abl, 1 br i1 %cmp4, label %cleanup, label %if.else6 if.else6: ; preds = %if.else3 %idxprom = zext i32 %req to i64 %idxprom7 = zext i32 %abl to i64 %arrayidx8 = getelementptr inbounds [300 x [18 x i32]], ptr @k_operafan, i64 0, i64 %idxprom, i64 %idxprom7 %0 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %tobool.not = icmp eq i32 %0, -1 br i1 %tobool.not, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %if.else6 store i32 0, ptr %arrayidx8, align 4, !tbaa !5 %mul = mul nsw i32 %abl, %abl %sub20 = add nsw i32 %abl, -1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %sub52 = phi i32 [ %req, %for.body.lr.ph ], [ %sub, %for.body ] %i.051 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %call = tail call fastcc i32 @dpFSA(i32 noundef %sub52, i32 noundef %sub20) %1 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %add = add nsw i32 %1, %call store i32 %add, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.051, 1 %mul15 = mul nsw i32 %mul, %inc %sub = sub nsw i32 %req, %mul15 %cmp16 = icmp sgt i32 %sub, -1 br i1 %cmp16, label %for.body, label %cleanup, !llvm.loop !9 cleanup: ; preds = %for.body, %if.else6, %if.else3, %if.else, %entry %retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 0, %if.else3 ], [ %0, %if.else6 ], [ %add, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { nofree 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 nounwind willreturn memory(argmem: write) } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int h,r; scanf("%d %d",&h,&r); if(h>=0){ printf("1\n"); } else if(h<=-1&&h*-1==r){ printf("0\n"); } else{ printf("-1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_293995/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_293995/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 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 @str.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %r) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, -1 %mul = sub nsw i32 0, %0 %1 = load i32, ptr %r, align 4 %cmp3 = icmp eq i32 %1, %mul %str.4.str = select i1 %cmp3, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 i,a,max,s1,s2; char ans[6]="ABCDE"; while(scanf("%d%d",&s1,&s2)&&(s1+s2)!=0){ max=s1+s2; i=0; a=i; for(i++;i<5;i++){ scanf("%d%d",&s1,&s2); max<(s1+s2)?(max=(s1+s2),a=i):(max=max); } printf("%c %d\n",ans[a],max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294037/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294037/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.ans = private unnamed_addr constant [6 x i8] c"ABCDE\00", align 1 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s1 = alloca i32, align 4 %s2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s2) #4 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %tobool19 = icmp ne i32 %call18, 0 %0 = load i32, ptr %s1, align 4 %1 = load i32, ptr %s2, align 4 %add20 = add nsw i32 %1, %0 %cmp21 = icmp ne i32 %add20, 0 %2 = select i1 %tobool19, i1 %cmp21, i1 false br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.cond.preheader %add22 = phi i32 [ %add, %for.cond.preheader ], [ %add20, %entry ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %3 = load i32, ptr %s1, align 4, !tbaa !5 %4 = load i32, ptr %s2, align 4, !tbaa !5 %add4 = add nsw i32 %4, %3 %cmp5 = icmp slt i32 %add22, %add4 %i.0.a.0 = zext i1 %cmp5 to i64 %add4.max.0 = call i32 @llvm.smax.i32(i32 %add22, i32 %add4) %call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %5 = load i32, ptr %s1, align 4, !tbaa !5 %6 = load i32, ptr %s2, align 4, !tbaa !5 %add4.1 = add nsw i32 %6, %5 %cmp5.1 = icmp slt i32 %add4.max.0, %add4.1 %i.0.a.0.1 = select i1 %cmp5.1, i64 2, i64 %i.0.a.0 %add4.max.0.1 = call i32 @llvm.smax.i32(i32 %add4.max.0, i32 %add4.1) %call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %7 = load i32, ptr %s1, align 4, !tbaa !5 %8 = load i32, ptr %s2, align 4, !tbaa !5 %add4.2 = add nsw i32 %8, %7 %cmp5.2 = icmp slt i32 %add4.max.0.1, %add4.2 %i.0.a.0.2 = select i1 %cmp5.2, i64 3, i64 %i.0.a.0.1 %add4.max.0.2 = call i32 @llvm.smax.i32(i32 %add4.max.0.1, i32 %add4.2) %call3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %9 = load i32, ptr %s1, align 4, !tbaa !5 %10 = load i32, ptr %s2, align 4, !tbaa !5 %add4.3 = add nsw i32 %10, %9 %cmp5.3 = icmp slt i32 %add4.max.0.2, %add4.3 %i.0.a.0.3 = select i1 %cmp5.3, i64 4, i64 %i.0.a.0.2 %add4.max.0.3 = call i32 @llvm.smax.i32(i32 %add4.max.0.2, i32 %add4.3) %arrayidx = getelementptr inbounds [6 x i8], ptr @__const.main.ans, i64 0, i64 %i.0.a.0.3 %11 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %11 to i32 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %add4.max.0.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2) %tobool = icmp ne i32 %call, 0 %12 = load i32, ptr %s1, align 4 %13 = load i32, ptr %s2, align 4 %add = add nsw i32 %13, %12 %cmp = icmp ne i32 %add, 0 %14 = select i1 %tobool, i1 %cmp, i1 false br i1 %14, label %for.cond.preheader, label %while.end, !llvm.loop !10 while.end: ; preds = %for.cond.preheader, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int maxnum,max,in1,in2,i; while(scanf("%d %d",&in1,&in2) && in1 && in2){ max=in1+in2+(maxnum=0); for(i=1;i<=4;i++){ scanf("%d %d",&in1,&in2); if(in1+in2>max) max=in1+in2,maxnum=i; } printf("%c %d\n",'A'+maxnum,max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294080/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294080/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %in1 = alloca i32, align 4 %in2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in2) #4 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %tobool20 = icmp ne i32 %call19, 0 %0 = load i32, ptr %in1, align 4 %tobool121 = icmp ne i32 %0, 0 %or.cond22 = select i1 %tobool20, i1 %tobool121, i1 false %1 = load i32, ptr %in2, align 4 %tobool223 = icmp ne i32 %1, 0 %or.cond1024 = select i1 %or.cond22, i1 %tobool223, i1 false br i1 %or.cond1024, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %2 = phi i32 [ %16, %while.body ], [ %1, %entry ] %3 = phi i32 [ %15, %while.body ], [ %0, %entry ] %add = add nsw i32 %2, %3 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %4 = load i32, ptr %in1, align 4, !tbaa !5 %5 = load i32, ptr %in2, align 4, !tbaa !5 %add5 = add nsw i32 %5, %4 %cmp6 = icmp sgt i32 %add5, %add %spec.select15 = call i32 @llvm.smax.i32(i32 %add5, i32 %add) %call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %6 = load i32, ptr %in1, align 4, !tbaa !5 %7 = load i32, ptr %in2, align 4, !tbaa !5 %add5.1 = add nsw i32 %7, %6 %cmp6.1 = icmp sgt i32 %add5.1, %spec.select15 %8 = select i1 %cmp6, i32 66, i32 65 %spec.select15.1 = call i32 @llvm.smax.i32(i32 %add5.1, i32 %spec.select15) %call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %9 = load i32, ptr %in1, align 4, !tbaa !5 %10 = load i32, ptr %in2, align 4, !tbaa !5 %add5.2 = add nsw i32 %10, %9 %cmp6.2 = icmp sgt i32 %add5.2, %spec.select15.1 %11 = select i1 %cmp6.1, i32 67, i32 %8 %spec.select15.2 = call i32 @llvm.smax.i32(i32 %add5.2, i32 %spec.select15.1) %call4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %12 = load i32, ptr %in1, align 4, !tbaa !5 %13 = load i32, ptr %in2, align 4, !tbaa !5 %add5.3 = add nsw i32 %13, %12 %cmp6.3 = icmp sgt i32 %add5.3, %spec.select15.2 %14 = select i1 %cmp6.2, i32 68, i32 %11 %spec.select15.3 = call i32 @llvm.smax.i32(i32 %add5.3, i32 %spec.select15.2) %add8 = select i1 %cmp6.3, i32 69, i32 %14 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add8, i32 noundef %spec.select15.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in1, ptr noundef nonnull %in2) %tobool = icmp ne i32 %call, 0 %15 = load i32, ptr %in1, align 4 %tobool1 = icmp ne i32 %15, 0 %or.cond = select i1 %tobool, i1 %tobool1, i1 false %16 = load i32, ptr %in2, align 4 %tobool2 = icmp ne i32 %16, 0 %or.cond10 = select i1 %or.cond, i1 %tobool2, i1 false br i1 %or.cond10, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<math.h> int main() { int N,i,j; scanf("%d",&N); if(N%2==0){ printf("%d\n",N*(N-2)/2); for(i=1;i<=N-1;i++){ for(j=i+1;j<=N;j++){ if((i+j)!=(N+1)){ printf("%d %d\n",i,j); } } } } else { printf("%d\n",((N-1)*(N-3)/2 + (N-1))); for(i=1;i<=N-2;i++){ for(j=i+1;j<=N-1;j++){ if((i+j)!=N){ printf("%d %d\n",i,j); } } } for(i=1;i<=N-1;i++){ printf("%d %d\n",i,N); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294123/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294123/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 [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 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 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %sub = add nsw i32 %0, -2 %mul = mul nsw i32 %sub, %0 %div = sdiv i32 %mul, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %2 = load i32, ptr %N, align 4, !tbaa !5 %cmp3.not.not80 = icmp sgt i32 %2, 1 br i1 %cmp3.not.not80, label %for.body, label %if.end50 for.cond.loopexit: ; preds = %for.inc, %for.body %3 = phi i32 [ %4, %for.body ], [ %7, %for.inc ] %cmp3.not.not = icmp slt i32 %add, %3 br i1 %cmp3.not.not, label %for.body, label %if.end50, !llvm.loop !9 for.body: ; preds = %if.then, %for.cond.loopexit %4 = phi i32 [ %3, %for.cond.loopexit ], [ %2, %if.then ] %i.081 = phi i32 [ %add, %for.cond.loopexit ], [ 1, %if.then ] %add = add nuw nsw i32 %i.081, 1 %cmp5.not78.not = icmp slt i32 %i.081, %4 br i1 %cmp5.not78.not, label %for.body6, label %for.cond.loopexit for.body6: ; preds = %for.body, %for.inc %5 = phi i32 [ %7, %for.inc ], [ %4, %for.body ] %6 = phi i32 [ %8, %for.inc ], [ %4, %for.body ] %j.079 = phi i32 [ %inc, %for.inc ], [ %add, %for.body ] %add7 = add nuw nsw i32 %j.079, %i.081 %add8 = add nsw i32 %6, 1 %cmp9.not = icmp eq i32 %add7, %add8 br i1 %cmp9.not, label %for.inc, label %if.then10 if.then10: ; preds = %for.body6 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.081, i32 noundef %j.079) %.pre83 = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body6, %if.then10 %7 = phi i32 [ %5, %for.body6 ], [ %.pre83, %if.then10 ] %8 = phi i32 [ %6, %for.body6 ], [ %.pre83, %if.then10 ] %inc = add nuw nsw i32 %j.079, 1 %cmp5.not.not = icmp slt i32 %j.079, %8 br i1 %cmp5.not.not, label %for.body6, label %for.cond.loopexit, !llvm.loop !11 if.else: ; preds = %entry %sub15 = add nsw i32 %0, -1 %sub16 = add nsw i32 %0, -3 %mul17 = mul nsw i32 %sub15, %sub16 %div18 = sdiv i32 %mul17, 2 %add20 = add nsw i32 %div18, %sub15 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add20) %9 = load i32, ptr %N, align 4, !tbaa !5 %cmp24.not74 = icmp slt i32 %9, 3 br i1 %cmp24.not74, label %for.cond42.preheader, label %for.body25 for.cond22.loopexit: ; preds = %for.inc36, %for.body25 %10 = phi i32 [ %12, %for.body25 ], [ %15, %for.inc36 ] %sub23 = add nsw i32 %10, -2 %cmp24.not.not = icmp slt i32 %i.175, %sub23 br i1 %cmp24.not.not, label %for.body25, label %for.cond42.preheader, !llvm.loop !12 for.cond42.preheader: ; preds = %for.cond22.loopexit, %if.else %11 = phi i32 [ %9, %if.else ], [ %10, %for.cond22.loopexit ] %cmp44.not.not76 = icmp sgt i32 %11, 1 br i1 %cmp44.not.not76, label %for.body45, label %if.end50 for.body25: ; preds = %if.else, %for.cond22.loopexit %12 = phi i32 [ %10, %for.cond22.loopexit ], [ %9, %if.else ] %i.175 = phi i32 [ %add26, %for.cond22.loopexit ], [ 1, %if.else ] %add26 = add nuw nsw i32 %i.175, 1 %cmp29.not.not71 = icmp slt i32 %add26, %12 br i1 %cmp29.not.not71, label %for.body30, label %for.cond22.loopexit for.body30: ; preds = %for.body25, %for.inc36 %13 = phi i32 [ %15, %for.inc36 ], [ %12, %for.body25 ] %14 = phi i32 [ %16, %for.inc36 ], [ %12, %for.body25 ] %j.172 = phi i32 [ %inc37, %for.inc36 ], [ %add26, %for.body25 ] %add31 = add nuw nsw i32 %j.172, %i.175 %cmp32.not = icmp eq i32 %add31, %14 br i1 %cmp32.not, label %for.inc36, label %if.then33 if.then33: ; preds = %for.body30 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.175, i32 noundef %j.172) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc36 for.inc36: ; preds = %for.body30, %if.then33 %15 = phi i32 [ %13, %for.body30 ], [ %.pre, %if.then33 ] %16 = phi i32 [ %14, %for.body30 ], [ %.pre, %if.then33 ] %inc37 = add nuw nsw i32 %j.172, 1 %cmp29.not.not = icmp slt i32 %inc37, %16 br i1 %cmp29.not.not, label %for.body30, label %for.cond22.loopexit, !llvm.loop !13 for.body45: ; preds = %for.cond42.preheader, %for.body45 %17 = phi i32 [ %18, %for.body45 ], [ %11, %for.cond42.preheader ] %i.277 = phi i32 [ %inc48, %for.body45 ], [ 1, %for.cond42.preheader ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.277, i32 noundef %17) %inc48 = add nuw nsw i32 %i.277, 1 %18 = load i32, ptr %N, align 4, !tbaa !5 %cmp44.not.not = icmp slt i32 %inc48, %18 br i1 %cmp44.not.not, label %for.body45, label %if.end50, !llvm.loop !14 if.end50: ; preds = %for.body45, %for.cond.loopexit, %for.cond42.preheader, %if.then 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} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> /*以下便利なマクロを定義する。*/ #define rep(i, min, max) for(i=min; i<=max; i=i+1) #define if_forall(i, min, max, prop)\ bool if_forall_condition=1;\ \ for(i=min; i<=max; i=i+1)\ {\ if(!(prop))\ {\ if_forall_condition=0;\ break;\ }\ }\ \ if(if_forall_condition==1)\ #define if_exists(i, min, max, prop)\ bool if_exists_condition=0;\ \ for(i=min; i<=max; i=i+1)\ {\ if(prop)\ {\ if_exists_condition=1;\ break;\ }\ }\ \ if(if_exists_condition==1)\ /*以下便利な関数を定義する。*/ void ini_int(int array[], int num) { int i=0; for(i=0; i<=num; i=i+1) { array[i]=0; } } void ini_char(char array[], int num) { int i=0; for(i=0; i<=num; i=i+1) { array[i]='\0'; } } int powi(int base, unsigned int exponent) { int answer=1; answer=(int)pow((double)base, (double)exponent); return answer; } void swap_int(int* x, int* y) { int tmp; tmp = *x; *x = *y; *y = tmp; } void swap_int_array(int x[], int y[], int min, int max) { int i; for(i=min; i<=max; i=i+1) { swap_int(&x[i], &y[i]); } } void swap_char(char* x, char* y) { char tmp; tmp = *x; *x = *y; *y = tmp; } void swap_char_array(char x[], char y[], int min, int max) { int i; for(i=min; i<=max; i=i+1) { swap_char(&x[i], &y[i]); } } void sort_asc_int(int array[], int min, int max) { int i, j; int dumy; for(i=min; i<=max; i=i+1) { for(j=i+1; j<=max; j=j+1) { if(array[i]>array[j]) { dumy=array[i]; array[i]=array[j]; array[j]=dumy; } } } } void sort_des_int(int array[], int min, int max) { int i, j; int dumy; for(i=min; i<=max; i=i+1) { for(j=i+1; j<=max; j=j+1) { if(array[i]<array[j]) { dumy=array[i]; array[i]=array[j]; array[j]=dumy; } } } } int max_int(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { if(answer<array[i]) { answer=array[i]; } } return answer; } int min_int(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { if(answer>array[i]) { answer=array[i]; } } return answer; } int sum_array(int array[], int min, int max) { int i=min; int answer=0; for(i=min; i<=max; i=i+1) { answer=answer+array[i]; } return answer; } bool containelement_int(int array[], int min, int max, int element) { int i; bool answer=0; if_exists(i, min, max, array[i]==element) { answer=1; } return answer; } int count_differentelement_int(int array[], int min, int max) { int i=min; int pickup[max]; ini_int(pickup, max); int answer=0; for(i=min; i<=max; i=i+1) { if(containelement_int(pickup, 0, answer-1, array[i])==0) { pickup[answer]=array[i]; answer=answer+1; } } return answer; } int count_equalelement_int(int array[], int min, int max, int element) { int i; int answer=0; for(i=min; i<=max; i=i+1) { if(array[i]==element) { answer=answer+1; } } return answer; } int main() { int sx, sy, tx, ty; scanf("%d %d %d %d", &sx, &sy, &tx, &ty); int i; int ver=ty-sy; int hol=tx-sx; rep(i, 1, ver) { printf("%c", 'U'); } rep(i, 1, hol) { printf("%c", 'R'); } rep(i, 1, ver) { printf("%c", 'D'); } rep(i, 1, hol) { printf("%c", 'L'); } printf("%c", 'L'); rep(i, 1, ver+1) { printf("%c", 'U'); } rep(i, 1, hol+1) { printf("%c", 'R'); } printf("%c", 'D'); printf("%c", 'R'); rep(i, 1, ver+1) { printf("%c", 'D'); } rep(i, 1, hol+1) { printf("%c", 'L'); } printf("%c", 'U'); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294174/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294174/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 [12 x i8] c"%d %d %d %d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @ini_int(ptr nocapture noundef writeonly %array, i32 noundef %num) local_unnamed_addr #0 { entry: %cmp.not3 = icmp slt i32 %num, 0 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add nuw i32 %num, 1 %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %array, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @ini_char(ptr nocapture noundef writeonly %array, i32 noundef %num) local_unnamed_addr #0 { entry: %cmp.not3 = icmp slt i32 %num, 0 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add nuw i32 %num, 1 %1 = zext i32 %0 to i64 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %array, i8 0, i64 %1, i1 false), !tbaa !9 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable define dso_local i32 @powi(i32 noundef %base, i32 noundef %exponent) local_unnamed_addr #2 { entry: %conv = sitofp i32 %base to double %conv1 = uitofp i32 %exponent to double %call = tail call double @pow(double noundef %conv, double noundef %conv1) #13 %conv2 = fptosi double %call to i32 ret i32 %conv2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_int(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #4 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_int_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #5 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 15 br i1 %min.iters.check, label %for.body.preheader15, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %5 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %x, i64 %5 %6 = sub i32 %max, %min %7 = zext i32 %6 to i64 %8 = add nsw i64 %0, %7 %9 = shl nsw i64 %8, 2 %10 = add nsw i64 %9, 4 %scevgep9 = getelementptr i8, ptr %x, i64 %10 %scevgep10 = getelementptr i8, ptr %y, i64 %5 %scevgep11 = getelementptr i8, ptr %y, i64 %10 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %11 = getelementptr inbounds i32, ptr %x, i64 %offset.idx %12 = getelementptr inbounds i32, ptr %y, i64 %offset.idx %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5, !alias.scope !10, !noalias !13 %13 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load12 = load <4 x i32>, ptr %13, align 4, !tbaa !5, !alias.scope !10, !noalias !13 %wide.load13 = load <4 x i32>, ptr %12, align 4, !tbaa !5, !alias.scope !13 %14 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load14 = load <4 x i32>, ptr %14, align 4, !tbaa !5, !alias.scope !13 store <4 x i32> %wide.load13, ptr %11, align 4, !tbaa !5, !alias.scope !10, !noalias !13 store <4 x i32> %wide.load14, ptr %13, align 4, !tbaa !5, !alias.scope !10, !noalias !13 store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5, !alias.scope !13 store <4 x i32> %wide.load12, ptr %14, align 4, !tbaa !5, !alias.scope !13 %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 !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %16 = add i32 %max, 1 %17 = trunc i64 %indvars.iv.ph to i32 %18 = sub i32 %16, %17 %xtraiter = and i32 %18, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader15 %arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.ph %19 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5 store i32 %20, ptr %arrayidx.prol, align 4, !tbaa !5 store i32 %19, ptr %arrayidx2.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader15 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader15 ], [ %indvars.iv.next.prol, %for.body.prol ] %21 = icmp eq i32 %17, %max br i1 %21, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %22 = load i32, ptr %arrayidx, align 4, !tbaa !5 %23 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %23, ptr %arrayidx, align 4, !tbaa !5 store i32 %22, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %24 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %25 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 store i32 %25, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %24, ptr %arrayidx2.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !19 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_char(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #4 { entry: %0 = load i8, ptr %x, align 1, !tbaa !9 %1 = load i8, ptr %y, align 1, !tbaa !9 store i8 %1, ptr %x, align 1, !tbaa !9 store i8 %0, ptr %y, align 1, !tbaa !9 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_char_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #5 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %scevgep = getelementptr i8, ptr %x, i64 %0 %5 = sub i32 %max, %min %6 = zext i32 %5 to i64 %7 = add nsw i64 %0, %6 %8 = add nsw i64 %7, 1 %scevgep9 = getelementptr i8, ptr %x, i64 %8 %scevgep10 = getelementptr i8, ptr %y, i64 %0 %scevgep11 = getelementptr i8, ptr %y, i64 %8 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check12 = icmp ult i32 %2, 31 br i1 %min.iters.check12, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, 8589934560 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %9 = getelementptr inbounds i8, ptr %x, i64 %offset.idx %10 = getelementptr inbounds i8, ptr %y, i64 %offset.idx %wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !9, !alias.scope !20, !noalias !23 %11 = getelementptr inbounds i8, ptr %9, i64 16 %wide.load13 = load <16 x i8>, ptr %11, align 1, !tbaa !9, !alias.scope !20, !noalias !23 %wide.load14 = load <16 x i8>, ptr %10, align 1, !tbaa !9, !alias.scope !23 %12 = getelementptr inbounds i8, ptr %10, i64 16 %wide.load15 = load <16 x i8>, ptr %12, align 1, !tbaa !9, !alias.scope !23 store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !9, !alias.scope !20, !noalias !23 store <16 x i8> %wide.load15, ptr %11, align 1, !tbaa !9, !alias.scope !20, !noalias !23 store <16 x i8> %wide.load, ptr %10, align 1, !tbaa !9, !alias.scope !23 store <16 x i8> %wide.load13, ptr %12, align 1, !tbaa !9, !alias.scope !23 %index.next = add nuw i64 %index, 32 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !25 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end18 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %4, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec17 = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec17, %0 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index20 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ] %offset.idx21 = add i64 %index20, %0 %14 = getelementptr inbounds i8, ptr %x, i64 %offset.idx21 %15 = getelementptr inbounds i8, ptr %y, i64 %offset.idx21 %wide.load22 = load <8 x i8>, ptr %14, align 1, !tbaa !9, !alias.scope !26, !noalias !29 %wide.load23 = load <8 x i8>, ptr %15, align 1, !tbaa !9, !alias.scope !29 store <8 x i8> %wide.load23, ptr %14, align 1, !tbaa !9, !alias.scope !26, !noalias !29 store <8 x i8> %wide.load22, ptr %15, align 1, !tbaa !9, !alias.scope !29 %index.next24 = add nuw i64 %index20, 8 %16 = icmp eq i64 %index.next24, %n.vec17 br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !31 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n19 = icmp eq i64 %4, %n.vec17 br i1 %cmp.n19, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end18, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %17 = add i32 %max, 1 %18 = trunc i64 %indvars.iv.ph to i32 %19 = sub i32 %17, %18 %xtraiter = and i32 %19, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.ph %20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !9 %21 = load i8, ptr %arrayidx2.prol, align 1, !tbaa !9 store i8 %21, ptr %arrayidx.prol, align 1, !tbaa !9 store i8 %20, ptr %arrayidx2.prol, align 1, !tbaa !9 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %22 = icmp eq i32 %18, %max br i1 %22, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv %23 = load i8, ptr %arrayidx, align 1, !tbaa !9 %24 = load i8, ptr %arrayidx2, align 1, !tbaa !9 store i8 %24, ptr %arrayidx, align 1, !tbaa !9 store i8 %23, ptr %arrayidx2, align 1, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.next %25 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %26 = load i8, ptr %arrayidx2.1, align 1, !tbaa !9 store i8 %26, ptr %arrayidx.1, align 1, !tbaa !9 store i8 %25, ptr %arrayidx2.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !32 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #5 { entry: %cmp.not37 = icmp sgt i32 %min, %max br i1 %cmp.not37, label %for.end18, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next43 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end18, label %for.body, !llvm.loop !33 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv42 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next43, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next43 = add nsw i64 %indvars.iv42, 1 %cmp2.not35.not = icmp slt i64 %indvars.iv42, %0 br i1 %cmp2.not35.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv42 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv39 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next40, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv39 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next40 = add nsw i64 %indvars.iv39, 1 %cmp2.not.not = icmp slt i64 %indvars.iv39, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !34 for.end18: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #5 { entry: %cmp.not37 = icmp sgt i32 %min, %max br i1 %cmp.not37, label %for.end18, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next43 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end18, label %for.body, !llvm.loop !35 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv42 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next43, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next43 = add nsw i64 %indvars.iv42, 1 %cmp2.not35.not = icmp slt i64 %indvars.iv42, %0 br i1 %cmp2.not35.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv42 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv39 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next40, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv39 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp slt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next40 = add nsw i64 %indvars.iv39, 1 %cmp2.not.not = icmp slt i64 %indvars.iv39, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !36 for.end18: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @max_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #6 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not14 = icmp slt i32 %min, %max br i1 %cmp.not.not14, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi18 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load19 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi18, <4 x i32> %wide.load19) %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 !37 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader20 for.body.preheader20: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.016.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader20, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader20 ] %answer.016 = phi i32 [ %spec.select, %for.body ], [ %answer.016.ph, %for.body.preheader20 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select = tail call i32 @llvm.smax.i32(i32 %answer.016, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !38 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @min_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #6 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not14 = icmp slt i32 %min, %max br i1 %cmp.not.not14, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi18 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load19 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi18, <4 x i32> %wide.load19) %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 !39 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader20 for.body.preheader20: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.016.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader20, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader20 ] %answer.016 = phi i32 [ %spec.select, %for.body ], [ %answer.016.ph, %for.body.preheader20 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select = tail call i32 @llvm.smin.i32(i32 %answer.016, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !40 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @sum_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #7 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load11, %vec.phi10 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !41 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %add, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %10, %answer.08 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !42 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @containelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #7 { entry: %cmp.not.not9.not = icmp sgt i32 %min, %max br i1 %cmp.not.not9.not, label %if.end5, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = sext i32 %max to i64 %2 = add i32 %max, 1 %arrayidx13 = getelementptr inbounds i32, ptr %array, i64 %0 %3 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp114 = icmp eq i32 %3, %element br i1 %cmp114, label %if.end5, label %for.cond for.cond: ; preds = %for.body.preheader, %for.body %indvars.iv15 = phi i64 [ %indvars.iv.next, %for.body ], [ %0, %for.body.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv15, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %if.end5.loopexit, label %for.body, !llvm.loop !43 for.body: ; preds = %for.cond %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %4, %element br i1 %cmp1, label %if.end5.loopexit, label %for.cond, !llvm.loop !43 if.end5.loopexit: ; preds = %for.cond, %for.body %cmp.not.not.le = icmp slt i64 %indvars.iv15, %1 br label %if.end5 if.end5: ; preds = %if.end5.loopexit, %for.body.preheader, %entry %cmp.not.not.lcssa = phi i1 [ false, %entry ], [ true, %for.body.preheader ], [ %cmp.not.not.le, %if.end5.loopexit ] ret i1 %cmp.not.not.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_differentelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #6 { entry: %0 = zext i32 %max to i64 %vla = alloca i32, i64 %0, align 16 %cmp.not3.i = icmp slt i32 %max, 0 br i1 %cmp.not3.i, label %ini_int.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %1 = add nuw i32 %max, 1 %2 = zext i32 %1 to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !5 br label %ini_int.exit ini_int.exit: ; preds = %entry, %for.body.preheader.i %cmp.not23 = icmp sgt i32 %min, %max br i1 %cmp.not23, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %ini_int.exit %4 = sext i32 %min to i64 %5 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %answer.025 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not9.not.i = icmp slt i32 %answer.025, 1 br i1 %cmp.not.not9.not.i, label %if.then, label %for.body.preheader.i18 for.body.preheader.i18: ; preds = %for.body %sub = add nsw i32 %answer.025, -1 %7 = zext i32 %sub to i64 %8 = load i32, ptr %vla, align 16, !tbaa !5 %cmp1.i20 = icmp eq i32 %8, %6 br i1 %cmp1.i20, label %for.inc, label %for.cond.i.preheader for.cond.i.preheader: ; preds = %for.body.preheader.i18 %zext = zext i32 %answer.025 to i64 br label %for.cond.i for.cond.i: ; preds = %for.cond.i.preheader, %for.body.i %indvars.iv.i21 = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.cond.i.preheader ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i21, 1 %9 = icmp eq i64 %indvars.iv.next.i, %zext br i1 %9, label %containelement_int.exit, label %for.body.i, !llvm.loop !43 for.body.i: ; preds = %for.cond.i %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i %10 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i = icmp eq i32 %10, %6 br i1 %cmp1.i, label %containelement_int.exit, label %for.cond.i, !llvm.loop !43 containelement_int.exit: ; preds = %for.body.i, %for.cond.i %cmp.not.not.i.le = icmp ult i64 %indvars.iv.i21, %7 br i1 %cmp.not.not.i.le, label %for.inc, label %if.then if.then: ; preds = %for.body, %containelement_int.exit %idxprom5 = sext i32 %answer.025 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 store i32 %6, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %answer.025, 1 br label %for.inc for.inc: ; preds = %for.body.preheader.i18, %containelement_int.exit, %if.then %answer.1 = phi i32 [ %add, %if.then ], [ %answer.025, %containelement_int.exit ], [ %answer.025, %for.body.preheader.i18 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %5, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !44 for.end: ; preds = %for.inc, %ini_int.exit %answer.0.lcssa = phi i32 [ 0, %ini_int.exit ], [ %answer.1, %for.inc ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #7 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = icmp eq <4 x i32> %wide.load, %broadcast.splat %7 = icmp eq <4 x i32> %wide.load11, %broadcast.splat %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi10, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !45 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %spec.select, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %14 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %14, %element %add = zext i1 %cmp1 to i32 %spec.select = add nuw nsw i32 %answer.08, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !46 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #8 { entry: %sx = alloca i32, align 4 %sy = alloca i32, align 4 %tx = alloca i32, align 4 %ty = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sx) #13 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sy) #13 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tx) #13 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ty) #13 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sx, ptr noundef nonnull %sy, ptr noundef nonnull %tx, ptr noundef nonnull %ty) %0 = load i32, ptr %ty, align 4, !tbaa !5 %1 = load i32, ptr %sy, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %tx, align 4, !tbaa !5 %3 = load i32, ptr %sx, align 4, !tbaa !5 %sub1 = sub nsw i32 %2, %3 %cmp.not92 = icmp slt i32 %sub, 1 br i1 %cmp.not92, label %for.cond3.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %4 = add i32 %0, 1 %5 = sub i32 %4, %1 br label %for.body for.cond3.preheader: ; preds = %for.body, %entry %cmp4.not94 = icmp slt i32 %sub1, 1 br i1 %cmp4.not94, label %for.cond10.preheader, label %for.body5.preheader for.body5.preheader: ; preds = %for.cond3.preheader %6 = add i32 %2, 1 %7 = sub i32 %6, %3 br label %for.body5 for.body: ; preds = %for.body.preheader, %for.body %i.093 = phi i32 [ %add, %for.body ], [ 1, %for.body.preheader ] %putchar91 = call i32 @putchar(i32 85) %add = add nuw i32 %i.093, 1 %exitcond.not = icmp eq i32 %add, %5 br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !47 for.cond10.preheader: ; preds = %for.body5, %for.cond3.preheader br i1 %cmp.not92, label %for.cond17.preheader, label %for.body12.preheader for.body12.preheader: ; preds = %for.cond10.preheader %8 = add i32 %0, 1 %9 = sub i32 %8, %1 br label %for.body12 for.body5: ; preds = %for.body5.preheader, %for.body5 %i.195 = phi i32 [ %add8, %for.body5 ], [ 1, %for.body5.preheader ] %putchar90 = call i32 @putchar(i32 82) %add8 = add nuw i32 %i.195, 1 %exitcond109.not = icmp eq i32 %add8, %7 br i1 %exitcond109.not, label %for.cond10.preheader, label %for.body5, !llvm.loop !48 for.cond17.preheader: ; preds = %for.body12, %for.cond10.preheader br i1 %cmp4.not94, label %for.end23, label %for.body19.preheader for.body19.preheader: ; preds = %for.cond17.preheader %10 = add i32 %2, 1 %11 = sub i32 %10, %3 br label %for.body19 for.body12: ; preds = %for.body12.preheader, %for.body12 %i.297 = phi i32 [ %add15, %for.body12 ], [ 1, %for.body12.preheader ] %putchar89 = call i32 @putchar(i32 68) %add15 = add nuw i32 %i.297, 1 %exitcond110.not = icmp eq i32 %add15, %9 br i1 %exitcond110.not, label %for.cond17.preheader, label %for.body12, !llvm.loop !49 for.body19: ; preds = %for.body19.preheader, %for.body19 %i.399 = phi i32 [ %add22, %for.body19 ], [ 1, %for.body19.preheader ] %putchar88 = call i32 @putchar(i32 76) %add22 = add nuw i32 %i.399, 1 %exitcond111.not = icmp eq i32 %add22, %11 br i1 %exitcond111.not, label %for.end23, label %for.body19, !llvm.loop !50 for.end23: ; preds = %for.body19, %for.cond17.preheader %putchar = call i32 @putchar(i32 76) %cmp27.not100 = icmp slt i32 %sub, 0 br i1 %cmp27.not100, label %for.cond33.preheader, label %for.body28.preheader for.body28.preheader: ; preds = %for.end23 %12 = add i32 %0, 2 %13 = sub i32 %12, %1 br label %for.body28 for.cond33.preheader: ; preds = %for.body28, %for.end23 %cmp35.not102 = icmp slt i32 %sub1, 0 br i1 %cmp35.not102, label %for.end40, label %for.body36.preheader for.body36.preheader: ; preds = %for.cond33.preheader %14 = add i32 %2, 2 %15 = sub i32 %14, %3 br label %for.body36 for.body28: ; preds = %for.body28.preheader, %for.body28 %i.4101 = phi i32 [ %add31, %for.body28 ], [ 1, %for.body28.preheader ] %putchar87 = call i32 @putchar(i32 85) %add31 = add nuw i32 %i.4101, 1 %exitcond112 = icmp eq i32 %add31, %13 br i1 %exitcond112, label %for.cond33.preheader, label %for.body28, !llvm.loop !51 for.body36: ; preds = %for.body36.preheader, %for.body36 %i.5103 = phi i32 [ %add39, %for.body36 ], [ 1, %for.body36.preheader ] %putchar86 = call i32 @putchar(i32 82) %add39 = add nuw i32 %i.5103, 1 %exitcond113 = icmp eq i32 %add39, %15 br i1 %exitcond113, label %for.end40, label %for.body36, !llvm.loop !52 for.end40: ; preds = %for.body36, %for.cond33.preheader %putchar81 = call i32 @putchar(i32 68) %putchar82 = call i32 @putchar(i32 82) br i1 %cmp27.not100, label %for.cond51.preheader, label %for.body46.preheader for.body46.preheader: ; preds = %for.end40 %16 = add i32 %0, 2 %17 = sub i32 %16, %1 br label %for.body46 for.cond51.preheader: ; preds = %for.body46, %for.end40 br i1 %cmp35.not102, label %for.end58, label %for.body54.preheader for.body54.preheader: ; preds = %for.cond51.preheader %18 = add i32 %2, 2 %19 = sub i32 %18, %3 br label %for.body54 for.body46: ; preds = %for.body46.preheader, %for.body46 %i.6106 = phi i32 [ %add49, %for.body46 ], [ 1, %for.body46.preheader ] %putchar85 = call i32 @putchar(i32 68) %add49 = add nuw i32 %i.6106, 1 %exitcond114 = icmp eq i32 %add49, %17 br i1 %exitcond114, label %for.cond51.preheader, label %for.body46, !llvm.loop !53 for.body54: ; preds = %for.body54.preheader, %for.body54 %i.7108 = phi i32 [ %add57, %for.body54 ], [ 1, %for.body54.preheader ] %putchar84 = call i32 @putchar(i32 76) %add57 = add nuw i32 %i.7108, 1 %exitcond115 = icmp eq i32 %add57, %19 br i1 %exitcond115, label %for.end58, label %for.body54, !llvm.loop !54 for.end58: ; preds = %for.body54, %for.cond51.preheader %putchar83 = call i32 @putchar(i32 85) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ty) #13 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tx) #13 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sy) #13 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sx) #13 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #10 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #12 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 #6 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { 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 #10 = { nofree nounwind } attributes #11 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11} !11 = distinct !{!11, !12} !12 = distinct !{!12, !"LVerDomain"} !13 = !{!14} !14 = distinct !{!14, !12} !15 = distinct !{!15, !16, !17, !18} !16 = !{!"llvm.loop.mustprogress"} !17 = !{!"llvm.loop.isvectorized", i32 1} !18 = !{!"llvm.loop.unroll.runtime.disable"} !19 = distinct !{!19, !16, !17} !20 = !{!21} !21 = distinct !{!21, !22} !22 = distinct !{!22, !"LVerDomain"} !23 = !{!24} !24 = distinct !{!24, !22} !25 = distinct !{!25, !16, !17, !18} !26 = !{!27} !27 = distinct !{!27, !28} !28 = distinct !{!28, !"LVerDomain"} !29 = !{!30} !30 = distinct !{!30, !28} !31 = distinct !{!31, !16, !17, !18} !32 = distinct !{!32, !16, !17} !33 = distinct !{!33, !16} !34 = distinct !{!34, !16} !35 = distinct !{!35, !16} !36 = distinct !{!36, !16} !37 = distinct !{!37, !16, !17, !18} !38 = distinct !{!38, !16, !18, !17} !39 = distinct !{!39, !16, !17, !18} !40 = distinct !{!40, !16, !18, !17} !41 = distinct !{!41, !16, !17, !18} !42 = distinct !{!42, !16, !18, !17} !43 = distinct !{!43, !16} !44 = distinct !{!44, !16} !45 = distinct !{!45, !16, !17, !18} !46 = distinct !{!46, !16, !18, !17} !47 = distinct !{!47, !16} !48 = distinct !{!48, !16} !49 = distinct !{!49, !16} !50 = distinct !{!50, !16} !51 = distinct !{!51, !16} !52 = distinct !{!52, !16} !53 = distinct !{!53, !16} !54 = distinct !{!54, !16}
#include <stdio.h> #include <stdlib.h> void print_road1(int a,int b) { int i; for(i=1;i<=b;i++) { printf("U"); } for(i=1;i<=a;i++) { printf("R"); } } void print_road2(int a,int b) { int i; for(i=b;i>=1;i--) { printf("D"); } for(i=a;i>=1;i--) { printf("L"); } } int main() { int sx,sy,tx,ty,x,y; scanf("%d%d%d%d",&sx,&sy,&tx,&ty); x=tx-sx; y=ty-sy; print_road1(x,y); print_road2(x,y); printf("L"); x=x+1; y=y+1; print_road1(x,y); printf("D"); printf("R"); print_road2(x,y); printf("U"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294224/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294224/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.4 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print_road1(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp.not12 = icmp slt i32 %b, 1 br i1 %cmp.not12, label %for.cond1.preheader, label %for.body for.cond1.preheader: ; preds = %for.body, %entry %cmp2.not14 = icmp slt i32 %a, 1 br i1 %cmp2.not14, label %for.end7, label %for.body3 for.body: ; preds = %entry, %for.body %i.013 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %putchar11 = tail call i32 @putchar(i32 85) %inc = add nuw i32 %i.013, 1 %exitcond.not = icmp eq i32 %i.013, %b br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !5 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.115 = phi i32 [ %inc6, %for.body3 ], [ 1, %for.cond1.preheader ] %putchar = tail call i32 @putchar(i32 82) %inc6 = add nuw i32 %i.115, 1 %exitcond16.not = icmp eq i32 %i.115, %a br i1 %exitcond16.not, label %for.end7, label %for.body3, !llvm.loop !7 for.end7: ; preds = %for.body3, %for.cond1.preheader 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 @print_road2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp12 = icmp sgt i32 %b, 0 br i1 %cmp12, label %for.body, label %for.cond1.preheader for.cond1.preheader: ; preds = %for.body, %entry %cmp214 = icmp sgt i32 %a, 0 br i1 %cmp214, label %for.body3, label %for.end7 for.body: ; preds = %entry, %for.body %i.013 = phi i32 [ %dec, %for.body ], [ %b, %entry ] %putchar11 = tail call i32 @putchar(i32 68) %dec = add nsw i32 %i.013, -1 %cmp = icmp ugt i32 %i.013, 1 br i1 %cmp, label %for.body, label %for.cond1.preheader, !llvm.loop !8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.115 = phi i32 [ %dec6, %for.body3 ], [ %a, %for.cond1.preheader ] %putchar = tail call i32 @putchar(i32 76) %dec6 = add nsw i32 %i.115, -1 %cmp2 = icmp ugt i32 %i.115, 1 br i1 %cmp2, label %for.body3, label %for.end7, !llvm.loop !9 for.end7: ; preds = %for.body3, %for.cond1.preheader ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sx = alloca i32, align 4 %sy = alloca i32, align 4 %tx = alloca i32, align 4 %ty = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sx) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sy) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tx) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ty) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %sx, ptr noundef nonnull %sy, ptr noundef nonnull %tx, ptr noundef nonnull %ty) %0 = load i32, ptr %tx, align 4, !tbaa !10 %1 = load i32, ptr %sx, align 4, !tbaa !10 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %ty, align 4, !tbaa !10 %3 = load i32, ptr %sy, align 4, !tbaa !10 %sub1 = sub nsw i32 %2, %3 %cmp.not12.i = icmp slt i32 %sub1, 1 br i1 %cmp.not12.i, label %for.cond1.preheader.i, label %for.body.i for.cond1.preheader.i: ; preds = %for.body.i, %entry %cmp2.not14.i = icmp slt i32 %sub, 1 br i1 %cmp2.not14.i, label %print_road1.exit, label %for.body3.i for.body.i: ; preds = %entry, %for.body.i %i.013.i = phi i32 [ %inc.i, %for.body.i ], [ 1, %entry ] %putchar11.i = call i32 @putchar(i32 85) %inc.i = add nuw i32 %i.013.i, 1 %exitcond.not.i = icmp eq i32 %i.013.i, %sub1 br i1 %exitcond.not.i, label %for.cond1.preheader.i, label %for.body.i, !llvm.loop !5 for.body3.i: ; preds = %for.cond1.preheader.i, %for.body3.i %i.115.i = phi i32 [ %inc6.i, %for.body3.i ], [ 1, %for.cond1.preheader.i ] %putchar.i = call i32 @putchar(i32 82) %inc6.i = add nuw i32 %i.115.i, 1 %exitcond16.not.i = icmp eq i32 %i.115.i, %sub br i1 %exitcond16.not.i, label %print_road1.exit, label %for.body3.i, !llvm.loop !7 print_road1.exit: ; preds = %for.body3.i, %for.cond1.preheader.i %cmp12.i = icmp sgt i32 %sub1, 0 br i1 %cmp12.i, label %for.body.i22, label %for.cond1.preheader.i18 for.cond1.preheader.i18: ; preds = %for.body.i22, %print_road1.exit %cmp214.i = icmp sgt i32 %sub, 0 br i1 %cmp214.i, label %for.body3.i19, label %print_road2.exit for.body.i22: ; preds = %print_road1.exit, %for.body.i22 %i.013.i23 = phi i32 [ %dec.i, %for.body.i22 ], [ %sub1, %print_road1.exit ] %putchar11.i24 = call i32 @putchar(i32 68) %dec.i = add nsw i32 %i.013.i23, -1 %cmp.i = icmp ugt i32 %i.013.i23, 1 br i1 %cmp.i, label %for.body.i22, label %for.cond1.preheader.i18, !llvm.loop !8 for.body3.i19: ; preds = %for.cond1.preheader.i18, %for.body3.i19 %i.115.i20 = phi i32 [ %dec6.i, %for.body3.i19 ], [ %sub, %for.cond1.preheader.i18 ] %putchar.i21 = call i32 @putchar(i32 76) %dec6.i = add nsw i32 %i.115.i20, -1 %cmp2.i = icmp ugt i32 %i.115.i20, 1 br i1 %cmp2.i, label %for.body3.i19, label %print_road2.exit, !llvm.loop !9 print_road2.exit: ; preds = %for.body3.i19, %for.cond1.preheader.i18 %putchar = call i32 @putchar(i32 76) %add = add nsw i32 %sub, 1 %add3 = add nsw i32 %sub1, 1 %cmp.not12.i25 = icmp slt i32 %sub1, 0 br i1 %cmp.not12.i25, label %for.cond1.preheader.i31, label %for.body.i26 for.cond1.preheader.i31: ; preds = %for.body.i26, %print_road2.exit %cmp2.not14.i32 = icmp slt i32 %sub, 0 br i1 %cmp2.not14.i32, label %print_road1.exit38, label %for.body3.i33 for.body.i26: ; preds = %print_road2.exit, %for.body.i26 %i.013.i27 = phi i32 [ %inc.i29, %for.body.i26 ], [ 1, %print_road2.exit ] %putchar11.i28 = call i32 @putchar(i32 85) %inc.i29 = add nuw i32 %i.013.i27, 1 %exitcond.not.i30 = icmp eq i32 %i.013.i27, %add3 br i1 %exitcond.not.i30, label %for.cond1.preheader.i31, label %for.body.i26, !llvm.loop !5 for.body3.i33: ; preds = %for.cond1.preheader.i31, %for.body3.i33 %i.115.i34 = phi i32 [ %inc6.i36, %for.body3.i33 ], [ 1, %for.cond1.preheader.i31 ] %putchar.i35 = call i32 @putchar(i32 82) %inc6.i36 = add nuw i32 %i.115.i34, 1 %exitcond16.not.i37 = icmp eq i32 %i.115.i34, %add br i1 %exitcond16.not.i37, label %print_road1.exit38, label %for.body3.i33, !llvm.loop !7 print_road1.exit38: ; preds = %for.body3.i33, %for.cond1.preheader.i31 %putchar15 = call i32 @putchar(i32 68) %putchar16 = call i32 @putchar(i32 82) %cmp12.i39 = icmp sgt i32 %sub1, -1 br i1 %cmp12.i39, label %for.body.i47, label %for.cond1.preheader.i40 for.cond1.preheader.i40: ; preds = %for.body.i47, %print_road1.exit38 %cmp214.i41 = icmp sgt i32 %sub, -1 br i1 %cmp214.i41, label %for.body3.i42, label %print_road2.exit52 for.body.i47: ; preds = %print_road1.exit38, %for.body.i47 %i.013.i48 = phi i32 [ %dec.i50, %for.body.i47 ], [ %add3, %print_road1.exit38 ] %putchar11.i49 = call i32 @putchar(i32 68) %dec.i50 = add nsw i32 %i.013.i48, -1 %cmp.i51 = icmp ugt i32 %i.013.i48, 1 br i1 %cmp.i51, label %for.body.i47, label %for.cond1.preheader.i40, !llvm.loop !8 for.body3.i42: ; preds = %for.cond1.preheader.i40, %for.body3.i42 %i.115.i43 = phi i32 [ %dec6.i45, %for.body3.i42 ], [ %add, %for.cond1.preheader.i40 ] %putchar.i44 = call i32 @putchar(i32 76) %dec6.i45 = add nsw i32 %i.115.i43, -1 %cmp2.i46 = icmp ugt i32 %i.115.i43, 1 br i1 %cmp2.i46, label %for.body3.i42, label %print_road2.exit52, !llvm.loop !9 print_road2.exit52: ; preds = %for.body3.i42, %for.cond1.preheader.i40 %putchar17 = call i32 @putchar(i32 85) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ty) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tx) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sy) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sx) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6} !9 = distinct !{!9, !6} !10 = !{!11, !11, i64 0} !11 = !{!"int", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int sx, sy, tx, ty; int i; scanf("%d %d %d %d", &sx, &sy, &tx, &ty); for(i = 0; i < ty - sy; i++){ printf("U"); } for(i = 0; i < tx - sx; i++){ printf("R"); } for(i = 0; i < ty - sy; i++){ printf("D"); } for(i = 0; i < tx - sx + 1; i++){ printf("L"); } for(i = 0; i < ty - sy + 1; i++){ printf("U"); } for(i = 0; i < tx - sx + 1; i++){ printf("R"); } printf("D"); printf("R"); for(i = 0; i < ty - sy + 1; i++){ printf("D"); } for(i = 0; i < tx - sx + 1; i++){ printf("L"); } printf("U\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294268/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294268/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 [12 x i8] c"%d %d %d %d\00", align 1 @str = private unnamed_addr constant [2 x i8] c"U\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sx = alloca i32, align 4 %sy = alloca i32, align 4 %tx = alloca i32, align 4 %ty = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sx) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sy) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tx) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ty) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sx, ptr noundef nonnull %sy, ptr noundef nonnull %tx, ptr noundef nonnull %ty) %0 = load i32, ptr %ty, align 4, !tbaa !5 %1 = load i32, ptr %sy, align 4, !tbaa !5 %cmp90 = icmp sgt i32 %0, %1 br i1 %cmp90, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %2 = phi i32 [ %1, %entry ], [ %7, %for.body ] %3 = phi i32 [ %0, %entry ], [ %6, %for.body ] %4 = load i32, ptr %tx, align 4, !tbaa !5 %5 = load i32, ptr %sx, align 4, !tbaa !5 %cmp493 = icmp sgt i32 %4, %5 br i1 %cmp493, label %for.body5, label %for.cond10.preheader for.body: ; preds = %entry, %for.body %i.091 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %putchar88 = call i32 @putchar(i32 85) %inc = add nuw nsw i32 %i.091, 1 %6 = load i32, ptr %ty, align 4, !tbaa !5 %7 = load i32, ptr %sy, align 4, !tbaa !5 %sub = sub nsw i32 %6, %7 %cmp = icmp slt i32 %inc, %sub br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond10.preheader.loopexit: ; preds = %for.body5 %.pre = load i32, ptr %ty, align 4, !tbaa !5 %.pre113 = load i32, ptr %sy, align 4, !tbaa !5 br label %for.cond10.preheader for.cond10.preheader: ; preds = %for.cond10.preheader.loopexit, %for.cond2.preheader %8 = phi i32 [ %13, %for.cond10.preheader.loopexit ], [ %5, %for.cond2.preheader ] %9 = phi i32 [ %12, %for.cond10.preheader.loopexit ], [ %4, %for.cond2.preheader ] %10 = phi i32 [ %.pre113, %for.cond10.preheader.loopexit ], [ %2, %for.cond2.preheader ] %11 = phi i32 [ %.pre, %for.cond10.preheader.loopexit ], [ %3, %for.cond2.preheader ] %cmp1296 = icmp sgt i32 %11, %10 br i1 %cmp1296, label %for.body13, label %for.cond18.preheader for.body5: ; preds = %for.cond2.preheader, %for.body5 %i.194 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond2.preheader ] %putchar87 = call i32 @putchar(i32 82) %inc8 = add nuw nsw i32 %i.194, 1 %12 = load i32, ptr %tx, align 4, !tbaa !5 %13 = load i32, ptr %sx, align 4, !tbaa !5 %sub3 = sub nsw i32 %12, %13 %cmp4 = icmp slt i32 %inc8, %sub3 br i1 %cmp4, label %for.body5, label %for.cond10.preheader.loopexit, !llvm.loop !11 for.cond18.preheader.loopexit: ; preds = %for.body13 %.pre114 = load i32, ptr %tx, align 4, !tbaa !5 %.pre115 = load i32, ptr %sx, align 4, !tbaa !5 br label %for.cond18.preheader for.cond18.preheader: ; preds = %for.cond18.preheader.loopexit, %for.cond10.preheader %14 = phi i32 [ %19, %for.cond18.preheader.loopexit ], [ %10, %for.cond10.preheader ] %15 = phi i32 [ %18, %for.cond18.preheader.loopexit ], [ %11, %for.cond10.preheader ] %16 = phi i32 [ %.pre115, %for.cond18.preheader.loopexit ], [ %8, %for.cond10.preheader ] %17 = phi i32 [ %.pre114, %for.cond18.preheader.loopexit ], [ %9, %for.cond10.preheader ] %cmp20.not99 = icmp slt i32 %17, %16 br i1 %cmp20.not99, label %for.cond26.preheader, label %for.body21 for.body13: ; preds = %for.cond10.preheader, %for.body13 %i.297 = phi i32 [ %inc16, %for.body13 ], [ 0, %for.cond10.preheader ] %putchar86 = call i32 @putchar(i32 68) %inc16 = add nuw nsw i32 %i.297, 1 %18 = load i32, ptr %ty, align 4, !tbaa !5 %19 = load i32, ptr %sy, align 4, !tbaa !5 %sub11 = sub nsw i32 %18, %19 %cmp12 = icmp slt i32 %inc16, %sub11 br i1 %cmp12, label %for.body13, label %for.cond18.preheader.loopexit, !llvm.loop !12 for.cond26.preheader.loopexit: ; preds = %for.body21 %.pre116 = load i32, ptr %ty, align 4, !tbaa !5 %.pre117 = load i32, ptr %sy, align 4, !tbaa !5 br label %for.cond26.preheader for.cond26.preheader: ; preds = %for.cond26.preheader.loopexit, %for.cond18.preheader %20 = phi i32 [ %25, %for.cond26.preheader.loopexit ], [ %16, %for.cond18.preheader ] %21 = phi i32 [ %24, %for.cond26.preheader.loopexit ], [ %17, %for.cond18.preheader ] %22 = phi i32 [ %.pre117, %for.cond26.preheader.loopexit ], [ %14, %for.cond18.preheader ] %23 = phi i32 [ %.pre116, %for.cond26.preheader.loopexit ], [ %15, %for.cond18.preheader ] %cmp29.not102 = icmp slt i32 %23, %22 br i1 %cmp29.not102, label %for.cond35.preheader, label %for.body30 for.body21: ; preds = %for.cond18.preheader, %for.body21 %i.3100 = phi i32 [ %inc24, %for.body21 ], [ 0, %for.cond18.preheader ] %putchar85 = call i32 @putchar(i32 76) %inc24 = add nuw nsw i32 %i.3100, 1 %24 = load i32, ptr %tx, align 4, !tbaa !5 %25 = load i32, ptr %sx, align 4, !tbaa !5 %sub19 = sub nsw i32 %24, %25 %cmp20.not.not = icmp slt i32 %i.3100, %sub19 br i1 %cmp20.not.not, label %for.body21, label %for.cond26.preheader.loopexit, !llvm.loop !13 for.cond35.preheader.loopexit: ; preds = %for.body30 %.pre118 = load i32, ptr %tx, align 4, !tbaa !5 %.pre119 = load i32, ptr %sx, align 4, !tbaa !5 br label %for.cond35.preheader for.cond35.preheader: ; preds = %for.cond35.preheader.loopexit, %for.cond26.preheader %26 = phi i32 [ %.pre119, %for.cond35.preheader.loopexit ], [ %20, %for.cond26.preheader ] %27 = phi i32 [ %.pre118, %for.cond35.preheader.loopexit ], [ %21, %for.cond26.preheader ] %cmp38.not105 = icmp slt i32 %27, %26 br i1 %cmp38.not105, label %for.end43, label %for.body39 for.body30: ; preds = %for.cond26.preheader, %for.body30 %i.4103 = phi i32 [ %inc33, %for.body30 ], [ 0, %for.cond26.preheader ] %putchar84 = call i32 @putchar(i32 85) %inc33 = add nuw nsw i32 %i.4103, 1 %28 = load i32, ptr %ty, align 4, !tbaa !5 %29 = load i32, ptr %sy, align 4, !tbaa !5 %sub27 = sub nsw i32 %28, %29 %cmp29.not.not = icmp slt i32 %i.4103, %sub27 br i1 %cmp29.not.not, label %for.body30, label %for.cond35.preheader.loopexit, !llvm.loop !14 for.body39: ; preds = %for.cond35.preheader, %for.body39 %i.5106 = phi i32 [ %inc42, %for.body39 ], [ 0, %for.cond35.preheader ] %putchar83 = call i32 @putchar(i32 82) %inc42 = add nuw nsw i32 %i.5106, 1 %30 = load i32, ptr %tx, align 4, !tbaa !5 %31 = load i32, ptr %sx, align 4, !tbaa !5 %sub36 = sub nsw i32 %30, %31 %cmp38.not.not = icmp slt i32 %i.5106, %sub36 br i1 %cmp38.not.not, label %for.body39, label %for.end43, !llvm.loop !15 for.end43: ; preds = %for.body39, %for.cond35.preheader %putchar = call i32 @putchar(i32 68) %putchar80 = call i32 @putchar(i32 82) %32 = load i32, ptr %ty, align 4, !tbaa !5 %33 = load i32, ptr %sy, align 4, !tbaa !5 %cmp49.not108 = icmp slt i32 %32, %33 br i1 %cmp49.not108, label %for.cond55.preheader, label %for.body50 for.cond55.preheader: ; preds = %for.body50, %for.end43 %34 = load i32, ptr %tx, align 4, !tbaa !5 %35 = load i32, ptr %sx, align 4, !tbaa !5 %cmp58.not111 = icmp slt i32 %34, %35 br i1 %cmp58.not111, label %for.end63, label %for.body59 for.body50: ; preds = %for.end43, %for.body50 %i.6109 = phi i32 [ %inc53, %for.body50 ], [ 0, %for.end43 ] %putchar82 = call i32 @putchar(i32 68) %inc53 = add nuw nsw i32 %i.6109, 1 %36 = load i32, ptr %ty, align 4, !tbaa !5 %37 = load i32, ptr %sy, align 4, !tbaa !5 %sub47 = sub nsw i32 %36, %37 %cmp49.not.not = icmp slt i32 %i.6109, %sub47 br i1 %cmp49.not.not, label %for.body50, label %for.cond55.preheader, !llvm.loop !16 for.body59: ; preds = %for.cond55.preheader, %for.body59 %i.7112 = phi i32 [ %inc62, %for.body59 ], [ 0, %for.cond55.preheader ] %putchar81 = call i32 @putchar(i32 76) %inc62 = add nuw nsw i32 %i.7112, 1 %38 = load i32, ptr %tx, align 4, !tbaa !5 %39 = load i32, ptr %sx, align 4, !tbaa !5 %sub56 = sub nsw i32 %38, %39 %cmp58.not.not = icmp slt i32 %i.7112, %sub56 br i1 %cmp58.not.not, label %for.body59, label %for.end63, !llvm.loop !17 for.end63: ; preds = %for.body59, %for.cond55.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ty) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tx) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sy) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sx) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main(void){ int b, i, ans; long a; int h[100000]; scanf("%ld%d", &a, &b); for(i = 0; i < a; i++){ scanf("%d", &h[i]); } ans = 0; for(i = 0; i < a; i++){ if(h[i] >= b){ ans = ans + 1; } } printf("%d", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294310/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294310/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"%ld%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: %b = alloca i32, align 4 %a = alloca i64, align 8 %h = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %h) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %cmp22 = icmp sgt i64 %0, 0 br i1 %cmp22, label %for.body, label %for.end14 for.cond3.preheader: ; preds = %for.body %cmp525 = icmp sgt i64 %12, 0 br i1 %cmp525, label %for.body7.lr.ph, label %for.end14 for.body7.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %b, align 4, !tbaa !9 %min.iters.check = icmp ult i64 %12, 8 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.body7.lr.ph %n.vec = and i64 %12, -8 %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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %vec.phi37 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %2 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !9 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load38 = load <4 x i32>, ptr %3, align 16, !tbaa !9 %4 = icmp sge <4 x i32> %wide.load, %broadcast.splat %5 = icmp sge <4 x i32> %wide.load38, %broadcast.splat %6 = zext <4 x i1> %4 to <4 x i32> %7 = zext <4 x i1> %5 to <4 x i32> %8 = add <4 x i32> %vec.phi, %6 %9 = add <4 x i32> %vec.phi37, %7 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %for.end14, label %for.body7.preheader for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block %indvars.iv32.ph = phi i64 [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ] %ans.027.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %11, %middle.block ] br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = load i64, ptr %a, align 8, !tbaa !5 %cmp = icmp sgt i64 %12, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !15 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.body7 ], [ %indvars.iv32.ph, %for.body7.preheader ] %ans.027 = phi i32 [ %spec.select, %for.body7 ], [ %ans.027.ph, %for.body7.preheader ] %arrayidx9 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %indvars.iv32 %13 = load i32, ptr %arrayidx9, align 4, !tbaa !9 %cmp10.not = icmp sge i32 %13, %1 %add = zext i1 %cmp10.not to i32 %spec.select = add nuw nsw i32 %ans.027, %add %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 %exitcond.not = icmp eq i64 %indvars.iv.next33, %12 br i1 %exitcond.not, label %for.end14, label %for.body7, !llvm.loop !16 for.end14: ; preds = %for.body7, %middle.block, %entry, %for.cond3.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %11, %middle.block ], [ %spec.select, %for.body7 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12, !14, !13}
#include<stdio.h> int main() { int y,i,n,k,h; scanf("%d%d\n",&n,&k); y=0; for(i=1;i<=n;i++){ scanf("%d",&h); if(h>=k){ y++; } } printf("%d\n",y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294354/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294354/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\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\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 %h = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #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.not7 = icmp slt i32 %0, 1 br i1 %cmp.not7, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %i.09 = phi i32 [ %inc3, %for.body ], [ 1, %entry ] %y.08 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h) %1 = load i32, ptr %h, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp2.not = icmp sge i32 %1, %2 %inc = zext i1 %cmp2.not to i32 %spec.select = add nuw nsw i32 %y.08, %inc %inc3 = add nuw nsw i32 %i.09, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.09, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %y.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %y.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3 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,x,cnt=0; scanf("%d%d",&n,&k); for(int i=0;i<n;i++){ scanf("%d",&x); if(x>=k) cnt++; } printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294404/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294404/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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 %x = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #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 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 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 for.body: ; preds = %entry, %for.body %i.09 = phi i32 [ %inc3, %for.body ], [ 0, %entry ] %cnt.08 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %1 = load i32, ptr %x, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp2.not = icmp sge i32 %1, %2 %inc = zext i1 %cmp2.not to i32 %spec.select = add nuw nsw i32 %cnt.08, %inc %inc3 = add nuw nsw i32 %i.09, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc3, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; 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 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,i,count=0; scanf("%d%d",&n,&k); int h[n]; for(i=0;i<n;i++) { scanf("%d",&h[i]); } for(i=0;i<n;i++) { if(h[i]>=k) { count++; } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294448/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294448/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %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 %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 %cmp19 = icmp sgt i32 %3, 0 br i1 %cmp19, label %for.body, label %for.end11 for.cond2.preheader: ; preds = %for.body %cmp321 = icmp sgt i32 %15, 0 br i1 %cmp321, label %for.body4.lr.ph, label %for.end11 for.body4.lr.ph: ; preds = %for.cond2.preheader %4 = load i32, ptr %k, align 4, !tbaa !5 %wide.trip.count = zext i32 %15 to i64 %min.iters.check = icmp ult i32 %15, 8 br i1 %min.iters.check, label %for.body4.preheader, label %vector.ph vector.ph: ; preds = %for.body4.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, 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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi32 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %5 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load33 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = icmp sge <4 x i32> %wide.load, %broadcast.splat %8 = icmp sge <4 x i32> %wide.load33, %broadcast.splat %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi32, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end11, label %for.body4.preheader for.body4.preheader: ; preds = %for.body4.lr.ph, %middle.block %indvars.iv27.ph = phi i64 [ 0, %for.body4.lr.ph ], [ %n.vec, %middle.block ] %count.022.ph = phi i32 [ 0, %for.body4.lr.ph ], [ %14, %middle.block ] br label %for.body4 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.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.body4: ; preds = %for.body4.preheader, %for.body4 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body4 ], [ %indvars.iv27.ph, %for.body4.preheader ] %count.022 = phi i32 [ %spec.select, %for.body4 ], [ %count.022.ph, %for.body4.preheader ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv27 %17 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.not = icmp sge i32 %17, %4 %inc8 = zext i1 %cmp7.not to i32 %spec.select = add nuw nsw i32 %count.022, %inc8 %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1 %exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count br i1 %exitcond.not, label %for.end11, label %for.body4, !llvm.loop !14 for.end11: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader %count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %14, %middle.block ], [ %spec.select, %for.body4 ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 declare void @llvm.stackrestore.p0(ptr) #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: 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, !12, !11}
#include <stdio.h> int main(void) { int n, k, h[100100], count = 0; scanf("%d%d", &n, &k); for(int i = 0; i < n; i++) { scanf("%d", &h[i]); if(h[i] >= k) count++; } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294505/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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 %h = alloca [100100 x i32], align 16 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 void @llvm.lifetime.start.p0(i64 400400, ptr nonnull %h) #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 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 400400, ptr nonnull %h) #3 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 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %count.012 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100100 x i32], ptr %h, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp4.not = icmp sge i32 %1, %2 %inc = zext i1 %cmp4.not to i32 %spec.select = add nuw nsw i32 %count.012, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; 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 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,h,count=0; scanf("%d %d",&n,&k); for(int i = 0 ; i<n ; i++){ scanf("%d",&h); if(h >= k){ count = count + 1; } } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294549/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294549/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 %h = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #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 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call3 = 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 %h) #3 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 for.body: ; preds = %entry, %for.body %i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %count.07 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h) %1 = load i32, ptr %h, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp2.not = icmp sge i32 %1, %2 %add = zext i1 %cmp2.not to i32 %spec.select = add nuw nsw i32 %count.07, %add %inc = add nuw nsw i32 %i.08, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; 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 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 h[100000]; int count = 0; scanf("%d %d", &n, &k); for (int i = 0; i <= n; i++) { scanf("%d", &h[i]); } for (int i = 0; i <= n; i++) { if (h[i] >= k) { count++; } } printf("%d", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294592/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294592/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 %h = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %h) #4 %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.not20 = icmp slt i32 %0, 0 br i1 %cmp.not20, label %for.cond.cleanup5, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not22 = icmp slt i32 %13, 0 br i1 %cmp4.not22, label %for.cond.cleanup5, label %for.body6.lr.ph for.body6.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %k, align 4, !tbaa !5 %2 = add nuw i32 %13, 1 %wide.trip.count = zext i32 %2 to i64 %min.iters.check = icmp ult i32 %13, 7 br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph vector.ph: ; preds = %for.body6.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 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %3 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 %wide.load34 = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = icmp sge <4 x i32> %wide.load, %broadcast.splat %6 = icmp sge <4 x i32> %wide.load34, %broadcast.splat %7 = zext <4 x i1> %5 to <4 x i32> %8 = zext <4 x i1> %6 to <4 x i32> %9 = add <4 x i32> %vec.phi, %7 %10 = add <4 x i32> %vec.phi33, %8 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block %indvars.iv28.ph = phi i64 [ 0, %for.body6.lr.ph ], [ %n.vec, %middle.block ] %count.023.ph = phi i32 [ 0, %for.body6.lr.ph ], [ %12, %middle.block ] br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr %n, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %14 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !13 for.cond.cleanup5: ; preds = %for.body6, %middle.block, %entry, %for.cond3.preheader %count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body6 ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body6 ], [ %indvars.iv28.ph, %for.body6.preheader ] %count.023 = phi i32 [ %spec.select, %for.body6 ], [ %count.023.ph, %for.body6.preheader ] %arrayidx8 = getelementptr inbounds [100000 x i32], ptr %h, i64 0, i64 %indvars.iv28 %15 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not = icmp sge i32 %15, %1 %inc10 = zext i1 %cmp9.not to i32 %spec.select = add nuw nsw i32 %count.023, %inc10 %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 %exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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.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}
#include<stdio.h> int main(void){ int N,K; int i; scanf("%d%d",&N,&K); int h[N]; int count=0; for(i=0;i<N;i++){ scanf("%d",&h[i]); if(K<=h[i]){ count++; } } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294642/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294642/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = 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 %K) #4 %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 %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 %cmp11 = icmp sgt i32 %3, 0 br i1 %cmp11, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %count.013 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %K, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.not = icmp sle i32 %4, %5 %inc = zext i1 %cmp4.not to i32 %spec.select = add nuw nsw i32 %count.013, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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 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 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 = { 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"}
// AOJ 2883: Proof of Knowledge // 2018.7.11 bal4u #include <stdio.h> char tr['d'+1]; char *calc(int *ans, char *S, char *P) { int v1, v2; char op; if (*S == '[') { op = *(++S), S++; if (*S == '[') S = calc(&v1, S, P); else v1 = P[tr[*S++]]; if (*S == '[') S = calc(&v2, S, P); else v2 = P[tr[*S++]]; if (op == '+') *ans = v1 | v2; else if (op == '*') *ans = v1 & v2; else *ans = v1 ^ v2; } else *ans = P[tr[*S++]]; while (*S == ']') S++; return S; } char S[100]; char p[10000][4]; int main() { int i, k, val, cnt; char P[10]; for (i = 0; i < 4; i++) tr['a'+i] = i; for (i = 0; i < 10000; i++) { p[i][0] = i/1000; p[i][1] = (i/100)%10; p[i][2] = (i/10)%10; p[i][3] = i%10; } while (fgets(S, 100, stdin) && *S != '.') { fgets(P, 10, stdin); for (i = 0; i < 4; i++) P[i] &= 0xf; calc(&val, S, P), cnt = 0; for (i = 0; i < 10000; i++) { calc(&k, S, p[i]); if (k == val) cnt++; } printf("%d %d\n", val, cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294686/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294686/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" @tr = dso_local local_unnamed_addr global [101 x i8] zeroinitializer, align 16 @p = dso_local global [10000 x [4 x i8]] zeroinitializer, align 16 @S = dso_local global [100 x i8] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local nonnull ptr @calc(ptr nocapture noundef writeonly %ans, ptr noundef %S, ptr noundef %P) local_unnamed_addr #0 { entry: %v1 = alloca i32, align 4 %v2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v2) #4 %0 = load i8, ptr %S, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 91 %incdec.ptr = getelementptr inbounds i8, ptr %S, i64 1 br i1 %cmp, label %if.then, label %if.else36 if.then: ; preds = %entry %1 = load i8, ptr %incdec.ptr, align 1, !tbaa !5 %incdec.ptr2 = getelementptr inbounds i8, ptr %S, i64 2 %2 = load i8, ptr %incdec.ptr2, align 1, !tbaa !5 %cmp4 = icmp eq i8 %2, 91 br i1 %cmp4, label %if.then6, label %if.else if.then6: ; preds = %if.then %call = call ptr @calc(ptr noundef nonnull %v1, ptr noundef nonnull %incdec.ptr2, ptr noundef %P) br label %if.end if.else: ; preds = %if.then %incdec.ptr7 = getelementptr inbounds i8, ptr %S, i64 3 %idxprom = sext i8 %2 to i64 %arrayidx = getelementptr inbounds [101 x i8], ptr @tr, i64 0, i64 %idxprom %3 = load i8, ptr %arrayidx, align 1, !tbaa !5 %idxprom8 = sext i8 %3 to i64 %arrayidx9 = getelementptr inbounds i8, ptr %P, i64 %idxprom8 %4 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %conv10 = sext i8 %4 to i32 store i32 %conv10, ptr %v1, align 4, !tbaa !8 br label %if.end if.end: ; preds = %if.else, %if.then6 %S.addr.0 = phi ptr [ %call, %if.then6 ], [ %incdec.ptr7, %if.else ] %5 = load i8, ptr %S.addr.0, align 1, !tbaa !5 %cmp12 = icmp eq i8 %5, 91 br i1 %cmp12, label %if.then14, label %if.else16 if.then14: ; preds = %if.end %call15 = call ptr @calc(ptr noundef nonnull %v2, ptr noundef nonnull %S.addr.0, ptr noundef %P) br label %if.end23 if.else16: ; preds = %if.end %incdec.ptr17 = getelementptr inbounds i8, ptr %S.addr.0, i64 1 %idxprom18 = sext i8 %5 to i64 %arrayidx19 = getelementptr inbounds [101 x i8], ptr @tr, i64 0, i64 %idxprom18 %6 = load i8, ptr %arrayidx19, align 1, !tbaa !5 %idxprom20 = sext i8 %6 to i64 %arrayidx21 = getelementptr inbounds i8, ptr %P, i64 %idxprom20 %7 = load i8, ptr %arrayidx21, align 1, !tbaa !5 %conv22 = sext i8 %7 to i32 store i32 %conv22, ptr %v2, align 4, !tbaa !8 br label %if.end23 if.end23: ; preds = %if.else16, %if.then14 %S.addr.1 = phi ptr [ %call15, %if.then14 ], [ %incdec.ptr17, %if.else16 ] %8 = load i32, ptr %v1, align 4, !tbaa !8 %9 = load i32, ptr %v2, align 4, !tbaa !8 switch i8 %1, label %if.else33 [ i8 43, label %if.then27 i8 42, label %if.then32 ] if.then27: ; preds = %if.end23 %or = or i32 %9, %8 br label %if.end43 if.then32: ; preds = %if.end23 %and = and i32 %9, %8 br label %if.end43 if.else33: ; preds = %if.end23 %xor = xor i32 %9, %8 br label %if.end43 if.else36: ; preds = %entry %idxprom38 = sext i8 %0 to i64 %arrayidx39 = getelementptr inbounds [101 x i8], ptr @tr, i64 0, i64 %idxprom38 %10 = load i8, ptr %arrayidx39, align 1, !tbaa !5 %idxprom40 = sext i8 %10 to i64 %arrayidx41 = getelementptr inbounds i8, ptr %P, i64 %idxprom40 %11 = load i8, ptr %arrayidx41, align 1, !tbaa !5 %conv42 = sext i8 %11 to i32 br label %if.end43 if.end43: ; preds = %if.then27, %if.else33, %if.then32, %if.else36 %or.sink = phi i32 [ %or, %if.then27 ], [ %xor, %if.else33 ], [ %and, %if.then32 ], [ %conv42, %if.else36 ] %S.addr.2 = phi ptr [ %S.addr.1, %if.then27 ], [ %S.addr.1, %if.else33 ], [ %S.addr.1, %if.then32 ], [ %incdec.ptr, %if.else36 ] store i32 %or.sink, ptr %ans, align 4, !tbaa !8 br label %while.cond while.cond: ; preds = %while.cond, %if.end43 %S.addr.3 = phi ptr [ %S.addr.2, %if.end43 ], [ %incdec.ptr47, %while.cond ] %12 = load i8, ptr %S.addr.3, align 1, !tbaa !5 %cmp45 = icmp eq i8 %12, 93 %incdec.ptr47 = getelementptr inbounds i8, ptr %S.addr.3, i64 1 br i1 %cmp45, label %while.cond, label %while.end, !llvm.loop !10 while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v1) #4 ret ptr %S.addr.3 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 %val = alloca i32, align 4 %P = alloca [10 x i8], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %val) #4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %P) #4 store <4 x i8> <i8 0, i8 1, i8 2, i8 3>, ptr getelementptr inbounds ([101 x i8], ptr @tr, i64 0, i64 97), align 1, !tbaa !5 br label %for.body4 while.cond.preheader: ; preds = %for.body4 %0 = load ptr, ptr @stdin, align 8, !tbaa !12 %call91 = tail call ptr @fgets(ptr noundef nonnull @S, i32 noundef 100, ptr noundef %0) %tobool92 = icmp ne ptr %call91, null %1 = load i8, ptr @S, align 16 %cmp2993 = icmp ne i8 %1, 46 %2 = select i1 %tobool92, i1 %cmp2993, i1 false br i1 %2, label %while.body, label %while.end for.body4: ; preds = %entry, %for.body4 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body4 ] %div.lhs.trunc = trunc i64 %indvars.iv to i16 %div80 = udiv i16 %div.lhs.trunc, 1000 %conv5 = trunc i16 %div80 to i8 %arrayidx7 = getelementptr inbounds [10000 x [4 x i8]], ptr @p, i64 0, i64 %indvars.iv store i8 %conv5, ptr %arrayidx7, align 4, !tbaa !5 %div981 = udiv i16 %div.lhs.trunc, 100 %rem.lhs.trunc = trunc i16 %div981 to i8 %rem82 = urem i8 %rem.lhs.trunc, 10 %arrayidx13 = getelementptr inbounds [10000 x [4 x i8]], ptr @p, i64 0, i64 %indvars.iv, i64 1 store i8 %rem82, ptr %arrayidx13, align 1, !tbaa !5 %div1483 = udiv i16 %div.lhs.trunc, 10 %rem1584 = urem i16 %div1483, 10 %conv16 = trunc i16 %rem1584 to i8 %arrayidx19 = getelementptr inbounds [10000 x [4 x i8]], ptr @p, i64 0, i64 %indvars.iv, i64 2 store i8 %conv16, ptr %arrayidx19, align 2, !tbaa !5 %rem2085 = urem i16 %div.lhs.trunc, 10 %conv21 = trunc i16 %rem2085 to i8 %arrayidx24 = getelementptr inbounds [10000 x [4 x i8]], ptr @p, i64 0, i64 %indvars.iv, i64 3 store i8 %conv21, ptr %arrayidx24, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 10000 br i1 %exitcond.not, label %while.cond.preheader, label %for.body4, !llvm.loop !14 while.body: ; preds = %while.cond.preheader, %for.end58 %3 = load ptr, ptr @stdin, align 8, !tbaa !12 %call31 = call ptr @fgets(ptr noundef nonnull %P, i32 noundef 10, ptr noundef %3) %4 = load <4 x i8>, ptr %P, align 4, !tbaa !5 %5 = and <4 x i8> %4, <i8 15, i8 15, i8 15, i8 15> store <4 x i8> %5, ptr %P, align 4, !tbaa !5 %call44 = call ptr @calc(ptr noundef nonnull %val, ptr noundef nonnull @S, ptr noundef nonnull %P) %6 = load i32, ptr %val, align 4 br label %for.body48 for.body48: ; preds = %while.body, %for.body48 %indvars.iv101 = phi i64 [ 0, %while.body ], [ %indvars.iv.next102, %for.body48 ] %cnt.090 = phi i32 [ 0, %while.body ], [ %spec.select, %for.body48 ] %arrayidx50 = getelementptr inbounds [10000 x [4 x i8]], ptr @p, i64 0, i64 %indvars.iv101 %call52 = call ptr @calc(ptr noundef nonnull %k, ptr noundef nonnull @S, ptr noundef nonnull %arrayidx50) %7 = load i32, ptr %k, align 4, !tbaa !8 %cmp53 = icmp eq i32 %7, %6 %inc55 = zext i1 %cmp53 to i32 %spec.select = add nuw nsw i32 %cnt.090, %inc55 %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %exitcond104.not = icmp eq i64 %indvars.iv.next102, 10000 br i1 %exitcond104.not, label %for.end58, label %for.body48, !llvm.loop !15 for.end58: ; preds = %for.body48 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6, i32 noundef %spec.select) %8 = load ptr, ptr @stdin, align 8, !tbaa !12 %call = call ptr @fgets(ptr noundef nonnull @S, i32 noundef 100, ptr noundef %8) %tobool = icmp ne ptr %call, null %9 = load i8, ptr @S, align 16 %cmp29 = icmp ne i8 %9, 46 %10 = select i1 %tobool, i1 %cmp29, i1 false br i1 %10, label %while.body, label %while.end, !llvm.loop !16 while.end: ; preds = %for.end58, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %P) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %val) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !6, i64 0} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11}
#include<stdio.h> //小さい順にソート long long c[100002][2]; void merge(int i,int j,long long s[][2]){ if(i!=j){ merge(i,(i+j)/2,s); merge((i+j)/2+1,j,s); int a=i,b=(i+j)/2+1; int d; for(d=i;d<=j;d++){ if((i+j)/2<a){ c[d][0]=s[b][0]; c[d][1]=s[b][1]; b++; } else if(j<b){ c[d][0]=s[a][0]; c[d][1]=s[a][1]; a++; } else if(s[a][0]<s[b][0]){ c[d][0]=s[a][0]; c[d][1]=s[a][1]; a++; } else{ c[d][0]=s[b][0]; c[d][1]=s[b][1]; b++; } } for(d=i;d<=j;d++){ s[d][0]=c[d][0]; s[d][1]=c[d][1]; } } } int main(){ int n,i; long long m; scanf("%d%lld",&n,&m); long long a[n+1][2]; for(i=0;i<n;i++) scanf("%lld%lld",&a[i][0],&a[i][1]); merge(0,n-1,a); long long count=0,money=0; i=0; while(count!=m){ if(count+a[i][1]<m){ count+=a[i][1]; money+=a[i][0]*a[i][1]; i++; } else{ money+=a[i][0]*(m-count); count=m; } } printf("%lld\n",money); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294736/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294736/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" @c = dso_local local_unnamed_addr global [100002 x [2 x i64]] zeroinitializer, align 16 @.str = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @merge(i32 noundef %i, i32 noundef %j, ptr noundef %s) local_unnamed_addr #0 { entry: %cmp.not = icmp eq i32 %i, %j br i1 %cmp.not, label %if.end94, label %if.then if.then: ; preds = %entry %add = add nsw i32 %j, %i %div = sdiv i32 %add, 2 tail call void @merge(i32 noundef %i, i32 noundef %div, ptr noundef %s) %add3 = add nsw i32 %div, 1 tail call void @merge(i32 noundef %add3, i32 noundef %j, ptr noundef %s) %cmp7.not154 = icmp sgt i32 %i, %j br i1 %cmp7.not154, label %if.end94, label %for.body.preheader for.body.preheader: ; preds = %if.then %0 = sext i32 %i to i64 %1 = add i32 %j, 1 br label %for.body for.cond76.preheader: ; preds = %for.inc br i1 %cmp7.not154, label %if.end94, label %for.body78.preheader for.body78.preheader: ; preds = %for.cond76.preheader %2 = sext i32 %i to i64 %3 = add i32 %j, 1 %4 = sub i32 %3, %i %xtraiter = and i32 %4, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body78.prol.loopexit, label %for.body78.prol for.body78.prol: ; preds = %for.body78.preheader %arrayidx80.prol = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %2 %5 = load i64, ptr %arrayidx80.prol, align 16, !tbaa !5 %arrayidx83.prol = getelementptr inbounds [2 x i64], ptr %s, i64 %2 store i64 %5, ptr %arrayidx83.prol, align 8, !tbaa !5 %arrayidx87.prol = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %2, i64 1 %6 = load i64, ptr %arrayidx87.prol, align 8, !tbaa !5 %arrayidx90.prol = getelementptr inbounds [2 x i64], ptr %s, i64 %2, i64 1 store i64 %6, ptr %arrayidx90.prol, align 8, !tbaa !5 %indvars.iv.next162.prol = add nsw i64 %2, 1 br label %for.body78.prol.loopexit for.body78.prol.loopexit: ; preds = %for.body78.prol, %for.body78.preheader %indvars.iv161.unr = phi i64 [ %2, %for.body78.preheader ], [ %indvars.iv.next162.prol, %for.body78.prol ] %7 = icmp eq i32 %j, %i br i1 %7, label %if.end94, label %for.body78 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %b.0156 = phi i32 [ %add3, %for.body.preheader ], [ %b.1, %for.inc ] %a.0155 = phi i32 [ %i, %for.body.preheader ], [ %a.1, %for.inc ] %cmp10 = icmp slt i32 %div, %a.0155 br i1 %cmp10, label %if.then11, label %if.else if.then11: ; preds = %for.body %idxprom = sext i32 %b.0156 to i64 %arrayidx = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom %8 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx14 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv store i64 %8, ptr %arrayidx14, align 16, !tbaa !5 %arrayidx18 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom, i64 1 %9 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %arrayidx21 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv, i64 1 store i64 %9, ptr %arrayidx21, align 8, !tbaa !5 %inc = add nsw i32 %b.0156, 1 br label %for.inc if.else: ; preds = %for.body %cmp22 = icmp sgt i32 %b.0156, %j %idxprom24 = sext i32 %a.0155 to i64 %arrayidx25 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom24 %10 = load i64, ptr %arrayidx25, align 8, !tbaa !5 br i1 %cmp22, label %if.then23, label %if.else37 if.then23: ; preds = %if.else %arrayidx28 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv store i64 %10, ptr %arrayidx28, align 16, !tbaa !5 %arrayidx32 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom24, i64 1 %11 = load i64, ptr %arrayidx32, align 8, !tbaa !5 %arrayidx35 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv, i64 1 store i64 %11, ptr %arrayidx35, align 8, !tbaa !5 %inc36 = add nsw i32 %a.0155, 1 br label %for.inc if.else37: ; preds = %if.else %idxprom41 = sext i32 %b.0156 to i64 %arrayidx42 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom41 %12 = load i64, ptr %arrayidx42, align 8, !tbaa !5 %cmp44 = icmp slt i64 %10, %12 %arrayidx50 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv %arrayidx57 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv, i64 1 br i1 %cmp44, label %if.then45, label %if.else59 if.then45: ; preds = %if.else37 store i64 %10, ptr %arrayidx50, align 16, !tbaa !5 %arrayidx54 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom24, i64 1 %13 = load i64, ptr %arrayidx54, align 8, !tbaa !5 store i64 %13, ptr %arrayidx57, align 8, !tbaa !5 %inc58 = add nsw i32 %a.0155, 1 br label %for.inc if.else59: ; preds = %if.else37 store i64 %12, ptr %arrayidx50, align 16, !tbaa !5 %arrayidx68 = getelementptr inbounds [2 x i64], ptr %s, i64 %idxprom41, i64 1 %14 = load i64, ptr %arrayidx68, align 8, !tbaa !5 store i64 %14, ptr %arrayidx57, align 8, !tbaa !5 %inc72 = add nsw i32 %b.0156, 1 br label %for.inc for.inc: ; preds = %if.then11, %if.then45, %if.else59, %if.then23 %a.1 = phi i32 [ %a.0155, %if.then11 ], [ %inc36, %if.then23 ], [ %inc58, %if.then45 ], [ %a.0155, %if.else59 ] %b.1 = phi i32 [ %inc, %if.then11 ], [ %b.0156, %if.then23 ], [ %b.0156, %if.then45 ], [ %inc72, %if.else59 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.cond76.preheader, label %for.body, !llvm.loop !9 for.body78: ; preds = %for.body78.prol.loopexit, %for.body78 %indvars.iv161 = phi i64 [ %indvars.iv.next162.1, %for.body78 ], [ %indvars.iv161.unr, %for.body78.prol.loopexit ] %arrayidx80 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv161 %15 = load i64, ptr %arrayidx80, align 16, !tbaa !5 %arrayidx83 = getelementptr inbounds [2 x i64], ptr %s, i64 %indvars.iv161 store i64 %15, ptr %arrayidx83, align 8, !tbaa !5 %arrayidx87 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv161, i64 1 %16 = load i64, ptr %arrayidx87, align 8, !tbaa !5 %arrayidx90 = getelementptr inbounds [2 x i64], ptr %s, i64 %indvars.iv161, i64 1 store i64 %16, ptr %arrayidx90, align 8, !tbaa !5 %indvars.iv.next162 = add nsw i64 %indvars.iv161, 1 %arrayidx80.1 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv.next162 %17 = load i64, ptr %arrayidx80.1, align 16, !tbaa !5 %arrayidx83.1 = getelementptr inbounds [2 x i64], ptr %s, i64 %indvars.iv.next162 store i64 %17, ptr %arrayidx83.1, align 8, !tbaa !5 %arrayidx87.1 = getelementptr inbounds [100002 x [2 x i64]], ptr @c, i64 0, i64 %indvars.iv.next162, i64 1 %18 = load i64, ptr %arrayidx87.1, align 8, !tbaa !5 %arrayidx90.1 = getelementptr inbounds [2 x i64], ptr %s, i64 %indvars.iv.next162, i64 1 store i64 %18, ptr %arrayidx90.1, align 8, !tbaa !5 %indvars.iv.next162.1 = add nsw i64 %indvars.iv161, 2 %lftr.wideiv164.1 = trunc i64 %indvars.iv.next162.1 to i32 %exitcond165.not.1 = icmp eq i32 %3, %lftr.wideiv164.1 br i1 %exitcond165.not.1, label %if.end94, label %for.body78, !llvm.loop !11 if.end94: ; preds = %for.body78.prol.loopexit, %for.body78, %if.then, %for.cond76.preheader, %entry 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: %n = alloca i32, align 4 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !12 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca [2 x i64], i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !12 %cmp46 = icmp sgt i32 %3, 0 br i1 %cmp46, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2 x i64], ptr %vla, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [2 x i64], ptr %vla, i64 %indvars.iv, i64 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !12 %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 !14 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ] %sub = add nsw i32 %.lcssa, -1 call void @merge(i32 noundef 0, i32 noundef %sub, ptr noundef nonnull %vla) %6 = load i64, ptr %m, align 8, !tbaa !5 %cmp6.not48 = icmp eq i64 %6, 0 br i1 %cmp6.not48, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %for.end %arrayidx963 = getelementptr inbounds [2 x i64], ptr %vla, i64 0, i64 1 %7 = load i64, ptr %arrayidx963, align 8, !tbaa !5 %cmp1164 = icmp slt i64 %7, %6 br i1 %cmp1164, label %if.end, label %while.end.loopexit if.end: ; preds = %while.body.preheader, %if.end %add1068 = phi i64 [ %add10, %if.end ], [ %7, %while.body.preheader ] %8 = phi i64 [ %10, %if.end ], [ %7, %while.body.preheader ] %arrayidx867 = phi ptr [ %arrayidx8, %if.end ], [ %vla, %while.body.preheader ] %i.14966 = phi i32 [ %inc23, %if.end ], [ 0, %while.body.preheader ] %money.05165 = phi i64 [ %money.1, %if.end ], [ 0, %while.body.preheader ] %9 = load i64, ptr %arrayidx867, align 16, !tbaa !5 %mul = mul nsw i64 %9, %8 %inc23 = add nuw nsw i32 %i.14966, 1 %money.1 = add nsw i64 %mul, %money.05165 %idxprom7 = zext i32 %inc23 to i64 %arrayidx8 = getelementptr inbounds [2 x i64], ptr %vla, i64 %idxprom7 %arrayidx9 = getelementptr inbounds [2 x i64], ptr %vla, i64 %idxprom7, i64 1 %10 = load i64, ptr %arrayidx9, align 8, !tbaa !5 %add10 = add nsw i64 %10, %add1068 %cmp11 = icmp slt i64 %add10, %6 br i1 %cmp11, label %if.end, label %while.end.loopexit while.end.loopexit: ; preds = %if.end, %while.body.preheader %money.051.lcssa = phi i64 [ 0, %while.body.preheader ], [ %money.1, %if.end ] %count.050.lcssa = phi i64 [ 0, %while.body.preheader ], [ %add1068, %if.end ] %arrayidx8.lcssa = phi ptr [ %vla, %while.body.preheader ], [ %arrayidx8, %if.end ] %11 = load i64, ptr %arrayidx8.lcssa, align 16, !tbaa !5 %sub27 = sub nsw i64 %6, %count.050.lcssa %mul28 = mul nsw i64 %11, %sub27 %money.158 = add nsw i64 %mul28, %money.051.lcssa br label %while.end while.end: ; preds = %while.end.loopexit, %for.end %money.0.lcssa = phi i64 [ 0, %for.end ], [ %money.158, %while.end.loopexit ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %money.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0} !14 = distinct !{!14, !10}
#include <stdio.h> #include <stdlib.h> typedef struct{ long long price; long long number; } shop; long long Min(long long x,long long y){ return x<y?x:y; } shop a[100001]={0}; int compare(const void *x,const void *y){ if(((shop *)x)->price<((shop*)y)->price)return -1; return 1; } int main(){ int n,m; long long ans=0; scanf("%d%d",&n,&m); for(int i=0;i<n;i++){ scanf("%d%d",&a[i].price,&a[i].number); } qsort(a,n,sizeof(shop),compare); int i=0; while(m>0){ ans+=(Min(m,a[i].number)*a[i].price); m-=a[i].number; i++; } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294822/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.shop = type { i64, i64 } @a = dso_local global [100001 x %struct.shop] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @Min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #1 { entry: %0 = load i64, ptr %x, align 8, !tbaa !5 %1 = load i64, ptr %y, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %. = select i1 %cmp, i32 -1, i32 1 ret i32 %. } ; 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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp30 = icmp sgt i32 %0, 0 br i1 %cmp30, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %2, %for.body ] call void @qsort(ptr noundef nonnull @a, i64 noundef %conv.pre-phi, i64 noundef 16, ptr noundef nonnull @compare) #7 %.pr = load i32, ptr %m, align 4, !tbaa !10 %cmp532 = icmp sgt i32 %.pr, 0 br i1 %cmp532, label %while.body, label %while.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x %struct.shop], ptr @a, i64 0, i64 %indvars.iv %number = getelementptr inbounds [100001 x %struct.shop], ptr @a, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %number) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !10 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12 while.body: ; preds = %for.cond.cleanup, %while.body %indvars.iv38 = phi i64 [ %indvars.iv.next39, %while.body ], [ 0, %for.cond.cleanup ] %ans.033 = phi i64 [ %add, %while.body ], [ 0, %for.cond.cleanup ] %3 = phi i32 [ %conv19, %while.body ], [ %.pr, %for.cond.cleanup ] %conv7 = zext i32 %3 to i64 %arrayidx9 = getelementptr inbounds [100001 x %struct.shop], ptr @a, i64 0, i64 %indvars.iv38 %number10 = getelementptr inbounds [100001 x %struct.shop], ptr @a, i64 0, i64 %indvars.iv38, i32 1 %4 = load i64, ptr %number10, align 8, !tbaa !14 %cond.i = call i64 @llvm.smin.i64(i64 %conv7, i64 %4) %5 = load i64, ptr %arrayidx9, align 16, !tbaa !5 %mul = mul nsw i64 %cond.i, %5 %add = add nsw i64 %mul, %ans.033 %6 = trunc i64 %4 to i32 %conv19 = sub i32 %3, %6 %indvars.iv.next39 = add nuw i64 %indvars.iv38, 1 %cmp5 = icmp sgt i32 %conv19, 0 br i1 %cmp5, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !15 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %conv19, ptr %m, align 4, !tbaa !10 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %for.cond.cleanup %ans.0.lcssa = phi i64 [ %add, %while.cond.while.end_crit_edge ], [ 0, %for.cond.cleanup ] %call21 = 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 %m) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"", !7, i64 0, !7, i64 8} !7 = !{!"long long", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !8, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!6, !7, i64 8} !15 = distinct !{!15, !13}
#include<stdio.h> int main(void) { int a,b,i,j,x,y,n,masu[16+1][16+1]; scanf("%d %d",&b,&a); while(a!=0 && b!=0) { scanf("%d",&n); for(i=1;i<=a;i++) { for(j=1;j<=b;j++) { masu[i][j]=0; } } for(i=1;i<=n;i++) { scanf("%d %d",&x,&y); masu[y][x]=-1; } if(masu[1][1]!=-1) { masu[1][1]=1; for(i=1;i<=a;i++) { for(j=1;j<=b;j++) { if(masu[i][j]!=-1) { if(i-1>=1 && masu[i-1][j]!=-1){ masu[i][j]+=masu[i-1][j]; } if(j-1>=1 && masu[i][j-1]!=-1){ masu[i][j]+=masu[i][j-1]; } /*if(i==1) { masu[i][j]=masu[i][j-1]; } else if(j==1) { masu[i][j]=masu[i-1][j]; } else { masu[i][j]=masu[i][j-1]+masu[i-1][j]; }*/ } } } } /* for(i=1;i<=a;i++) { for(j=1;j<=b;j++) { printf("%d ",masu[i][j]); } printf("\n"); }*/ if((masu[a][b]!=-1)&&(masu[1][1]!=-1)) { printf("%d\n",masu[a][b]); } else { printf("0\n"); } scanf("%d %d",&b,&a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294880/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294880/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\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 %x = alloca i32, align 4 %y = alloca i32, align 4 %n = alloca i32, align 4 %masu = alloca [17 x [17 x i32]], align 16 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 %x) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 1156, ptr nonnull %masu) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp143 = icmp ne i32 %0, 0 %1 = load i32, ptr %b, align 4 %cmp1144 = icmp ne i32 %1, 0 %2 = select i1 %cmp143, i1 %cmp1144, i1 false br i1 %2, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %arrayidx24 = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 1, i64 1 %invariant.gep = getelementptr inbounds i8, ptr %masu, i64 72 %invariant.gep177 = getelementptr i8, ptr %invariant.gep, i64 68 %invariant.gep179 = getelementptr i8, ptr %invariant.gep, i64 136 %invariant.gep181 = getelementptr i8, ptr %invariant.gep, i64 204 %invariant.gep183 = getelementptr i8, ptr %invariant.gep, i64 272 %invariant.gep185 = getelementptr i8, ptr %invariant.gep, i64 340 %invariant.gep187 = getelementptr i8, ptr %invariant.gep, i64 408 %invariant.gep189 = getelementptr i8, ptr %invariant.gep, i64 476 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end102 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %3 = load i32, ptr %a, align 4, !tbaa !5 %cmp3.not135 = icmp slt i32 %3, 1 br i1 %cmp3.not135, label %for.cond12.preheader, label %for.cond4.preheader.lr.ph for.cond4.preheader.lr.ph: ; preds = %while.body %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp5.not133 = icmp slt i32 %4, 1 br i1 %cmp5.not133, label %for.cond12.preheader, label %for.cond4.preheader.preheader for.cond4.preheader.preheader: ; preds = %for.cond4.preheader.lr.ph %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 %wide.trip.count = zext i32 %3 to i64 %xtraiter = and i64 %wide.trip.count, 7 %7 = icmp ult i32 %3, 8 br i1 %7, label %for.cond12.preheader.loopexit.unr-lcssa, label %for.cond4.preheader.preheader.new for.cond4.preheader.preheader.new: ; preds = %for.cond4.preheader.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond4.preheader for.cond12.preheader.loopexit.unr-lcssa: ; preds = %for.cond4.preheader, %for.cond4.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond4.preheader.preheader ], [ %indvar.next.7, %for.cond4.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.cond4.preheader.epil for.cond4.preheader.epil: ; preds = %for.cond12.preheader.loopexit.unr-lcssa, %for.cond4.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond4.preheader.epil ], [ %indvar.unr, %for.cond12.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond4.preheader.epil ], [ 0, %for.cond12.preheader.loopexit.unr-lcssa ] %8 = mul nuw nsw i64 %indvar.epil, 68 %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %8 call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 0, i64 %6, 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.cond12.preheader, label %for.cond4.preheader.epil, !llvm.loop !9 for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit.unr-lcssa, %for.cond4.preheader.epil, %for.cond4.preheader.lr.ph, %while.body %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp13.not137 = icmp slt i32 %9, 1 br i1 %cmp13.not137, label %for.end22, label %for.body14 for.cond4.preheader: ; preds = %for.cond4.preheader, %for.cond4.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond4.preheader.preheader.new ], [ %indvar.next.7, %for.cond4.preheader ] %niter = phi i64 [ 0, %for.cond4.preheader.preheader.new ], [ %niter.next.7, %for.cond4.preheader ] %10 = mul nuw nsw i64 %indvar, 68 %gep = getelementptr i8, ptr %invariant.gep, i64 %10 call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %6, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 68 %gep178 = getelementptr i8, ptr %invariant.gep177, i64 %11 call void @llvm.memset.p0.i64(ptr align 4 %gep178, i8 0, i64 %6, i1 false), !tbaa !5 %12 = mul nuw i64 %indvar, 68 %gep180 = getelementptr i8, ptr %invariant.gep179, i64 %12 call void @llvm.memset.p0.i64(ptr align 16 %gep180, i8 0, i64 %6, i1 false), !tbaa !5 %13 = mul nuw i64 %indvar, 68 %gep182 = getelementptr i8, ptr %invariant.gep181, i64 %13 call void @llvm.memset.p0.i64(ptr align 4 %gep182, i8 0, i64 %6, i1 false), !tbaa !5 %14 = mul nuw i64 %indvar, 68 %gep184 = getelementptr i8, ptr %invariant.gep183, i64 %14 call void @llvm.memset.p0.i64(ptr align 8 %gep184, i8 0, i64 %6, i1 false), !tbaa !5 %15 = mul nuw i64 %indvar, 68 %gep186 = getelementptr i8, ptr %invariant.gep185, i64 %15 call void @llvm.memset.p0.i64(ptr align 4 %gep186, i8 0, i64 %6, i1 false), !tbaa !5 %16 = mul nuw i64 %indvar, 68 %gep188 = getelementptr i8, ptr %invariant.gep187, i64 %16 call void @llvm.memset.p0.i64(ptr align 16 %gep188, i8 0, i64 %6, i1 false), !tbaa !5 %17 = mul nuw i64 %indvar, 68 %gep190 = getelementptr i8, ptr %invariant.gep189, i64 %17 call void @llvm.memset.p0.i64(ptr align 4 %gep190, i8 0, i64 %6, 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.cond12.preheader.loopexit.unr-lcssa, label %for.cond4.preheader, !llvm.loop !11 for.body14: ; preds = %for.cond12.preheader, %for.body14 %i.1138 = phi i32 [ %inc21, %for.body14 ], [ 1, %for.cond12.preheader ] %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %18 = load i32, ptr %y, align 4, !tbaa !5 %idxprom16 = sext i32 %18 to i64 %19 = load i32, ptr %x, align 4, !tbaa !5 %idxprom18 = sext i32 %19 to i64 %arrayidx19 = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %idxprom16, i64 %idxprom18 store i32 -1, ptr %arrayidx19, align 4, !tbaa !5 %inc21 = add nuw nsw i32 %i.1138, 1 %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp13.not.not = icmp slt i32 %i.1138, %20 br i1 %cmp13.not.not, label %for.body14, label %for.end22.loopexit, !llvm.loop !13 for.end22.loopexit: ; preds = %for.body14 %.pre.pre = load i32, ptr %a, align 4, !tbaa !5 br label %for.end22 for.end22: ; preds = %for.end22.loopexit, %for.cond12.preheader %.pre = phi i32 [ %.pre.pre, %for.end22.loopexit ], [ %3, %for.cond12.preheader ] %21 = load i32, ptr %arrayidx24, align 8 %cmp25.not = icmp eq i32 %21, -1 br i1 %cmp25.not, label %for.end22.if.end85_crit_edge, label %if.then for.end22.if.end85_crit_edge: ; preds = %for.end22 %.pre167 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end85 if.then: ; preds = %for.end22 store i32 1, ptr %arrayidx24, align 8, !tbaa !5 %cmp29.not141 = icmp slt i32 %.pre, 1 %.pre168 = load i32, ptr %b, align 4, !tbaa !5 %cmp32.not139 = icmp slt i32 %.pre168, 1 %or.cond172 = select i1 %cmp29.not141, i1 true, i1 %cmp32.not139 br i1 %or.cond172, label %if.end85, label %for.cond31.preheader.preheader for.cond31.preheader.preheader: ; preds = %if.then %22 = add nuw i32 %.pre168, 1 %23 = add nuw i32 %.pre, 1 %smax = call i32 @llvm.smax.i32(i32 %23, i32 2) %wide.trip.count165 = zext i32 %smax to i64 %wide.trip.count152 = zext i32 %22 to i64 %wide.trip.count158 = zext i32 %22 to i64 %exitcond159.peel.not = icmp eq i32 %22, 2 br label %for.cond31.preheader for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %for.cond31.for.inc82_crit_edge %indvars.iv161 = phi i64 [ 1, %for.cond31.preheader.preheader ], [ %indvars.iv.next162, %for.cond31.for.inc82_crit_edge ] %cmp40 = icmp ugt i64 %indvars.iv161, 1 %24 = add nsw i64 %indvars.iv161, -1 br i1 %cmp40, label %for.body33.us.preheader, label %for.body33 for.body33.us.preheader: ; preds = %for.cond31.preheader %arrayidx37.us.peel = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %indvars.iv161, i64 1 %25 = load i32, ptr %arrayidx37.us.peel, align 4, !tbaa !5 %cmp38.not.us.peel = icmp eq i32 %25, -1 br i1 %cmp38.not.us.peel, label %for.inc79.us.peel, label %if.then39.us.peel if.then39.us.peel: ; preds = %for.body33.us.preheader %arrayidx45.us.peel = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %24, i64 1 %26 = load i32, ptr %arrayidx45.us.peel, align 4, !tbaa !5 %cmp46.not.us.peel = icmp eq i32 %26, -1 br i1 %cmp46.not.us.peel, label %for.inc79.us.peel, label %if.then47.us.peel if.then47.us.peel: ; preds = %if.then39.us.peel %add.us.peel = add nsw i32 %26, %25 store i32 %add.us.peel, ptr %arrayidx37.us.peel, align 4, !tbaa !5 br label %for.inc79.us.peel for.inc79.us.peel: ; preds = %if.then39.us.peel, %if.then47.us.peel, %for.body33.us.preheader br i1 %exitcond159.peel.not, label %for.cond31.for.inc82_crit_edge, label %for.body33.us for.body33.us: ; preds = %for.inc79.us.peel, %for.inc79.us %indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.inc79.us ], [ 2, %for.inc79.us.peel ] %arrayidx37.us = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %indvars.iv161, i64 %indvars.iv154 %27 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 %cmp38.not.us = icmp eq i32 %27, -1 br i1 %cmp38.not.us, label %for.inc79.us, label %if.then39.us if.then39.us: ; preds = %for.body33.us %arrayidx45.us = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %24, i64 %indvars.iv154 %28 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5 %cmp46.not.us = icmp eq i32 %28, -1 br i1 %cmp46.not.us, label %land.lhs.true59.us, label %if.then47.us if.then47.us: ; preds = %if.then39.us %add.us = add nsw i32 %28, %27 store i32 %add.us, ptr %arrayidx37.us, align 4, !tbaa !5 br label %land.lhs.true59.us land.lhs.true59.us: ; preds = %if.then39.us, %if.then47.us %29 = phi i32 [ %add.us, %if.then47.us ], [ %27, %if.then39.us ] %30 = add nsw i64 %indvars.iv154, -1 %arrayidx64.us = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %indvars.iv161, i64 %30 %31 = load i32, ptr %arrayidx64.us, align 4, !tbaa !5 %cmp65.not.us = icmp eq i32 %31, -1 br i1 %cmp65.not.us, label %for.inc79.us, label %if.then66.us if.then66.us: ; preds = %land.lhs.true59.us %add76.us = add nsw i32 %29, %31 store i32 %add76.us, ptr %arrayidx37.us, align 4, !tbaa !5 br label %for.inc79.us for.inc79.us: ; preds = %if.then66.us, %land.lhs.true59.us, %for.body33.us %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %exitcond159.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count158 br i1 %exitcond159.not, label %for.cond31.for.inc82_crit_edge, label %for.body33.us, !llvm.loop !14 for.body33: ; preds = %for.cond31.preheader, %for.inc79 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc79 ], [ 1, %for.cond31.preheader ] %arrayidx37 = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %indvars.iv161, i64 %indvars.iv %32 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %cmp38.not = icmp ne i32 %32, -1 %cmp58 = icmp ugt i64 %indvars.iv, 1 %or.cond145 = and i1 %cmp38.not, %cmp58 br i1 %or.cond145, label %land.lhs.true59, label %for.inc79 land.lhs.true59: ; preds = %for.body33 %33 = add nsw i64 %indvars.iv, -1 %arrayidx64 = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %indvars.iv161, i64 %33 %34 = load i32, ptr %arrayidx64, align 4, !tbaa !5 %cmp65.not = icmp eq i32 %34, -1 br i1 %cmp65.not, label %for.inc79, label %if.then66 if.then66: ; preds = %land.lhs.true59 %add76 = add nsw i32 %32, %34 store i32 %add76, ptr %arrayidx37, align 4, !tbaa !5 br label %for.inc79 for.inc79: ; preds = %for.body33, %if.then66, %land.lhs.true59 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond153.not = icmp eq i64 %indvars.iv.next, %wide.trip.count152 br i1 %exitcond153.not, label %for.cond31.for.inc82_crit_edge, label %for.body33, !llvm.loop !16 for.cond31.for.inc82_crit_edge: ; preds = %for.inc79, %for.inc79.us, %for.inc79.us.peel %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %exitcond166 = icmp eq i64 %indvars.iv.next162, %wide.trip.count165 br i1 %exitcond166, label %if.end85.loopexit147, label %for.cond31.preheader, !llvm.loop !17 if.end85.loopexit147: ; preds = %for.cond31.for.inc82_crit_edge %.pre169 = load i32, ptr %arrayidx24, align 8 br label %if.end85 if.end85: ; preds = %for.end22.if.end85_crit_edge, %if.end85.loopexit147, %if.then %35 = phi i32 [ -1, %for.end22.if.end85_crit_edge ], [ %.pre169, %if.end85.loopexit147 ], [ 1, %if.then ] %36 = phi i32 [ %.pre167, %for.end22.if.end85_crit_edge ], [ %.pre168, %if.end85.loopexit147 ], [ %.pre168, %if.then ] %idxprom86 = sext i32 %.pre to i64 %idxprom88 = sext i32 %36 to i64 %arrayidx89 = getelementptr inbounds [17 x [17 x i32]], ptr %masu, i64 0, i64 %idxprom86, i64 %idxprom88 %37 = load i32, ptr %arrayidx89, align 4, !tbaa !5 %cmp90 = icmp ne i32 %37, -1 %cmp94 = icmp ne i32 %35, -1 %or.cond = select i1 %cmp90, i1 %cmp94, i1 false br i1 %or.cond, label %if.then95, label %if.else if.then95: ; preds = %if.end85 %call100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37) br label %if.end102 if.else: ; preds = %if.end85 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end102 if.end102: ; preds = %if.else, %if.then95 %call103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %a) %38 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp ne i32 %38, 0 %39 = load i32, ptr %b, align 4 %cmp1 = icmp ne i32 %39, 0 %40 = select i1 %cmp, i1 %cmp1, i1 false br i1 %40, label %while.body, label %while.end, !llvm.loop !18 while.end: ; preds = %if.end102, %entry call void @llvm.lifetime.end.p0(i64 1156, ptr nonnull %masu) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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.unroll.disable"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15} !15 = !{!"llvm.loop.peeled.count", i32 1} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12}
#include <stdio.h> int main(){ int a,b,n,i,j,cross[16][16],x,y; while(1){ scanf("%d%d",&a,&b); if(a == 0 && b == 0) {break;} scanf("%d",&n); for(i=0;i<a;i++){ for(j=0;j<b;j++){ cross[i][j] = 0; } } for(i = 0;i < b;i++){ cross[0][i] = 1; } for(i = 0;i < a;i++){ cross[i][0] = 1; } for(i = 0;i < n;i++){ scanf("%d%d",&x,&y); cross[x-1][y-1] = -1; if(x == 1) {for(j=y-1;j<b;j++){ cross[0][j] = 0;}} if(y == 1) {for(j=x-1;j<a;j++){ cross[j][0] = 0; }} } for(i=1;i<a;i++){ for(j=1;j<b;j++){ if(cross[i][j] == -1) {cross[i][j] = 0;} else {cross[i][j] = cross[i][j-1] + cross[i-1][j];} } } printf("%d\n",cross[a-1][b-1]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294930/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294930/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %n = alloca i32, align 4 %cross = alloca [16 x [16 x i32]], align 16 %x = alloca i32, align 4 %y = 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 %n) #4 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %cross) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call165 = 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 %cmp166 = icmp eq i32 %0, 0 %1 = load i32, ptr %b, align 4 %cmp1167 = icmp eq i32 %1, 0 %or.cond168 = select i1 %cmp166, i1 %cmp1167, i1 false br i1 %or.cond168, label %while.end, label %if.end.preheader if.end.preheader: ; preds = %entry %scevgep181 = getelementptr i8, ptr %cross, i64 -4 br label %if.end if.end: ; preds = %if.end.preheader, %for.end104 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %2 = load i32, ptr %a, align 4, !tbaa !5 %cmp3147 = icmp sgt i32 %2, 0 %.pre = load i32, ptr %b, align 4, !tbaa !5 br i1 %cmp3147, label %for.cond4.preheader.lr.ph, label %for.cond12.preheader for.cond4.preheader.lr.ph: ; preds = %if.end %cmp5145 = icmp sgt i32 %.pre, 0 br i1 %cmp5145, label %for.cond4.preheader.us.preheader, label %for.body23.preheader for.cond4.preheader.us.preheader: ; preds = %for.cond4.preheader.lr.ph %3 = zext i32 %.pre to i64 %4 = shl nuw nsw i64 %3, 2 %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 7 %5 = icmp ult i32 %2, 8 br i1 %5, label %for.cond12.preheader.loopexit.unr-lcssa, label %for.cond4.preheader.us.preheader.new for.cond4.preheader.us.preheader.new: ; preds = %for.cond4.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond4.preheader.us for.cond4.preheader.us: ; preds = %for.cond4.preheader.us, %for.cond4.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond4.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond4.preheader.us ] %niter = phi i64 [ 0, %for.cond4.preheader.us.preheader.new ], [ %niter.next.7, %for.cond4.preheader.us ] %6 = shl nuw nsw i64 %indvar, 6 %scevgep = getelementptr i8, ptr %cross, i64 %6 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next = shl i64 %indvar, 6 %7 = or i64 %indvar.next, 64 %scevgep.1 = getelementptr i8, ptr %cross, i64 %7 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.1, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.1 = shl i64 %indvar, 6 %8 = or i64 %indvar.next.1, 128 %scevgep.2 = getelementptr i8, ptr %cross, i64 %8 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.2 = shl i64 %indvar, 6 %9 = or i64 %indvar.next.2, 192 %scevgep.3 = getelementptr i8, ptr %cross, i64 %9 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.3, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.3 = shl i64 %indvar, 6 %10 = or i64 %indvar.next.3, 256 %scevgep.4 = getelementptr i8, ptr %cross, i64 %10 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.4 = shl i64 %indvar, 6 %11 = or i64 %indvar.next.4, 320 %scevgep.5 = getelementptr i8, ptr %cross, i64 %11 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.5, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.5 = shl i64 %indvar, 6 %12 = or i64 %indvar.next.5, 384 %scevgep.6 = getelementptr i8, ptr %cross, i64 %12 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.6, i8 0, i64 %4, i1 false), !tbaa !5 %indvar.next.6 = shl i64 %indvar, 6 %13 = or i64 %indvar.next.6, 448 %scevgep.7 = getelementptr i8, ptr %cross, i64 %13 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.7, i8 0, i64 %4, 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.cond12.preheader.loopexit.unr-lcssa, label %for.cond4.preheader.us, !llvm.loop !9 for.cond12.preheader.loopexit.unr-lcssa: ; preds = %for.cond4.preheader.us, %for.cond4.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond4.preheader.us.preheader ], [ %indvar.next.7, %for.cond4.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.cond4.preheader.us.epil for.cond4.preheader.us.epil: ; preds = %for.cond12.preheader.loopexit.unr-lcssa, %for.cond4.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond4.preheader.us.epil ], [ %indvar.unr, %for.cond12.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond4.preheader.us.epil ], [ 0, %for.cond12.preheader.loopexit.unr-lcssa ] %14 = shl nuw nsw i64 %indvar.epil, 6 %scevgep.epil = getelementptr i8, ptr %cross, i64 %14 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %4, 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.cond12.preheader, label %for.cond4.preheader.us.epil, !llvm.loop !11 for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit.unr-lcssa, %for.cond4.preheader.us.epil, %if.end %cmp13149 = icmp sgt i32 %.pre, 0 br i1 %cmp13149, label %for.body14.preheader, label %for.cond21.preheader for.body14.preheader: ; preds = %for.cond12.preheader %wide.trip.count174 = zext i32 %.pre to i64 %min.iters.check = icmp ult i32 %.pre, 8 br i1 %min.iters.check, label %for.body14.preheader208, label %vector.ph vector.ph: ; preds = %for.body14.preheader %n.vec = and i64 %wide.trip.count174, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %15 = getelementptr inbounds [16 x i32], ptr %cross, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %15, align 16, !tbaa !5 %16 = getelementptr inbounds i32, ptr %15, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %16, align 16, !tbaa !5 %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 !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count174 br i1 %cmp.n, label %for.cond21.preheader, label %for.body14.preheader208 for.body14.preheader208: ; preds = %for.body14.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body14.preheader ], [ %n.vec, %middle.block ] br label %for.body14 for.cond21.preheader: ; preds = %for.body14, %middle.block, %for.cond12.preheader br i1 %cmp3147, label %for.body23.preheader, label %for.cond30.preheader for.body23.preheader: ; preds = %for.cond4.preheader.lr.ph, %for.cond21.preheader %wide.trip.count179 = zext i32 %2 to i64 %18 = add nsw i64 %wide.trip.count179, -1 %xtraiter209 = and i64 %wide.trip.count179, 3 %19 = icmp ult i64 %18, 3 br i1 %19, label %for.cond30.preheader.loopexit.unr-lcssa, label %for.body23.preheader.new for.body23.preheader.new: ; preds = %for.body23.preheader %unroll_iter212 = and i64 %wide.trip.count179, 4294967292 br label %for.body23 for.body14: ; preds = %for.body14.preheader208, %for.body14 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ %indvars.iv.ph, %for.body14.preheader208 ] %arrayidx17 = getelementptr inbounds [16 x i32], ptr %cross, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx17, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond175.not = icmp eq i64 %indvars.iv.next, %wide.trip.count174 br i1 %exitcond175.not, label %for.cond21.preheader, label %for.body14, !llvm.loop !16 for.cond30.preheader.loopexit.unr-lcssa: ; preds = %for.body23, %for.body23.preheader %indvars.iv176.unr = phi i64 [ 0, %for.body23.preheader ], [ %indvars.iv.next177.3, %for.body23 ] %lcmp.mod211.not = icmp eq i64 %xtraiter209, 0 br i1 %lcmp.mod211.not, label %for.cond30.preheader, label %for.body23.epil for.body23.epil: ; preds = %for.cond30.preheader.loopexit.unr-lcssa, %for.body23.epil %indvars.iv176.epil = phi i64 [ %indvars.iv.next177.epil, %for.body23.epil ], [ %indvars.iv176.unr, %for.cond30.preheader.loopexit.unr-lcssa ] %epil.iter210 = phi i64 [ %epil.iter210.next, %for.body23.epil ], [ 0, %for.cond30.preheader.loopexit.unr-lcssa ] %arrayidx25.epil = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv176.epil store i32 1, ptr %arrayidx25.epil, align 16, !tbaa !5 %indvars.iv.next177.epil = add nuw nsw i64 %indvars.iv176.epil, 1 %epil.iter210.next = add i64 %epil.iter210, 1 %epil.iter210.cmp.not = icmp eq i64 %epil.iter210.next, %xtraiter209 br i1 %epil.iter210.cmp.not, label %for.cond30.preheader, label %for.body23.epil, !llvm.loop !17 for.cond30.preheader: ; preds = %for.cond30.preheader.loopexit.unr-lcssa, %for.body23.epil, %for.cond21.preheader %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp31157 = icmp sgt i32 %20, 0 br i1 %cmp31157, label %for.body32, label %for.cond68.preheader for.body23: ; preds = %for.body23, %for.body23.preheader.new %indvars.iv176 = phi i64 [ 0, %for.body23.preheader.new ], [ %indvars.iv.next177.3, %for.body23 ] %niter213 = phi i64 [ 0, %for.body23.preheader.new ], [ %niter213.next.3, %for.body23 ] %arrayidx25 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv176 store i32 1, ptr %arrayidx25, align 16, !tbaa !5 %indvars.iv.next177 = or i64 %indvars.iv176, 1 %arrayidx25.1 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next177 store i32 1, ptr %arrayidx25.1, align 16, !tbaa !5 %indvars.iv.next177.1 = or i64 %indvars.iv176, 2 %arrayidx25.2 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next177.1 store i32 1, ptr %arrayidx25.2, align 16, !tbaa !5 %indvars.iv.next177.2 = or i64 %indvars.iv176, 3 %arrayidx25.3 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next177.2 store i32 1, ptr %arrayidx25.3, align 16, !tbaa !5 %indvars.iv.next177.3 = add nuw nsw i64 %indvars.iv176, 4 %niter213.next.3 = add i64 %niter213, 4 %niter213.ncmp.3 = icmp eq i64 %niter213.next.3, %unroll_iter212 br i1 %niter213.ncmp.3, label %for.cond30.preheader.loopexit.unr-lcssa, label %for.body23, !llvm.loop !18 for.cond68.preheader.loopexit: ; preds = %for.inc65 %.pre203 = load i32, ptr %a, align 4, !tbaa !5 %.pre204.pre = load i32, ptr %b, align 4, !tbaa !5 br label %for.cond68.preheader for.cond68.preheader: ; preds = %for.cond68.preheader.loopexit, %for.cond30.preheader %.pre204 = phi i32 [ %.pre204.pre, %for.cond68.preheader.loopexit ], [ %.pre, %for.cond30.preheader ] %21 = phi i32 [ %.pre203, %for.cond68.preheader.loopexit ], [ %2, %for.cond30.preheader ] %cmp69161 = icmp sgt i32 %21, 1 %cmp72159 = icmp sgt i32 %.pre204, 1 %or.cond207 = select i1 %cmp69161, i1 %cmp72159, i1 false br i1 %or.cond207, label %for.cond71.preheader.us.preheader, label %for.end104 for.cond71.preheader.us.preheader: ; preds = %for.cond68.preheader %wide.trip.count201 = zext i32 %21 to i64 %wide.trip.count195 = zext i32 %.pre204 to i64 br label %for.cond71.preheader.us for.cond71.preheader.us: ; preds = %for.cond71.preheader.us.preheader, %for.cond71.for.inc102_crit_edge.us %indvars.iv197 = phi i64 [ 1, %for.cond71.preheader.us.preheader ], [ %indvars.iv.next198, %for.cond71.for.inc102_crit_edge.us ] %22 = add nsw i64 %indvars.iv197, -1 br label %for.body73.us for.body73.us: ; preds = %for.cond71.preheader.us, %for.inc99.us %indvars.iv191 = phi i64 [ 1, %for.cond71.preheader.us ], [ %indvars.iv.next192, %for.inc99.us ] %arrayidx77.us = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv197, i64 %indvars.iv191 %23 = load i32, ptr %arrayidx77.us, align 4, !tbaa !5 %cmp78.us = icmp eq i32 %23, -1 br i1 %cmp78.us, label %for.inc99.us, label %if.else.us if.else.us: ; preds = %for.body73.us %24 = add nsw i64 %indvars.iv191, -1 %arrayidx88.us = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv197, i64 %24 %25 = load i32, ptr %arrayidx88.us, align 4, !tbaa !5 %arrayidx93.us = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %22, i64 %indvars.iv191 %26 = load i32, ptr %arrayidx93.us, align 4, !tbaa !5 %add.us = add nsw i32 %26, %25 br label %for.inc99.us for.inc99.us: ; preds = %if.else.us, %for.body73.us %storemerge.us = phi i32 [ %add.us, %if.else.us ], [ 0, %for.body73.us ] store i32 %storemerge.us, ptr %arrayidx77.us, align 4, !tbaa !5 %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1 %exitcond196.not = icmp eq i64 %indvars.iv.next192, %wide.trip.count195 br i1 %exitcond196.not, label %for.cond71.for.inc102_crit_edge.us, label %for.body73.us, !llvm.loop !19 for.cond71.for.inc102_crit_edge.us: ; preds = %for.inc99.us %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 %exitcond202.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count201 br i1 %exitcond202.not, label %for.end104, label %for.cond71.preheader.us, !llvm.loop !20 for.body32: ; preds = %for.cond30.preheader, %for.inc65 %i.3158 = phi i32 [ %inc66, %for.inc65 ], [ 0, %for.cond30.preheader ] %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %27 = load i32, ptr %x, align 4, !tbaa !5 %sub = add nsw i32 %27, -1 %idxprom34 = sext i32 %sub to i64 %28 = load i32, ptr %y, align 4, !tbaa !5 %sub36 = add nsw i32 %28, -1 %idxprom37 = sext i32 %sub36 to i64 %arrayidx38 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %idxprom34, i64 %idxprom37 store i32 -1, ptr %arrayidx38, align 4, !tbaa !5 %cmp39 = icmp eq i32 %27, 1 br i1 %cmp39, label %for.cond42.preheader, label %if.end51 for.cond42.preheader: ; preds = %for.body32 %29 = load i32, ptr %b, align 4, !tbaa !5 %cmp43153.not = icmp sgt i32 %28, %29 br i1 %cmp43153.not, label %if.end51, label %for.body44.preheader for.body44.preheader: ; preds = %for.cond42.preheader %30 = sext i32 %28 to i64 %31 = shl nsw i64 %30, 2 %scevgep182 = getelementptr i8, ptr %scevgep181, i64 %31 %32 = sub i32 %29, %28 %33 = zext i32 %32 to i64 %34 = shl nuw nsw i64 %33, 2 %35 = add nuw nsw i64 %34, 4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep182, i8 0, i64 %35, i1 false), !tbaa !5 br label %if.end51 if.end51: ; preds = %for.body44.preheader, %for.cond42.preheader, %for.body32 %cmp52 = icmp eq i32 %28, 1 br i1 %cmp52, label %for.cond55.preheader, label %for.inc65 for.cond55.preheader: ; preds = %if.end51 %36 = load i32, ptr %a, align 4, !tbaa !5 %cmp56155.not = icmp sgt i32 %27, %36 br i1 %cmp56155.not, label %for.inc65, label %for.body57.preheader for.body57.preheader: ; preds = %for.cond55.preheader %37 = sext i32 %27 to i64 %38 = add nsw i64 %37, -1 %wide.trip.count189 = sext i32 %36 to i64 %39 = add nsw i64 %wide.trip.count189, 1 %40 = sub nsw i64 %39, %37 %41 = sub nsw i64 %wide.trip.count189, %37 %xtraiter214 = and i64 %40, 3 %lcmp.mod215.not = icmp eq i64 %xtraiter214, 0 br i1 %lcmp.mod215.not, label %for.body57.prol.loopexit, label %for.body57.prol for.body57.prol: ; preds = %for.body57.preheader, %for.body57.prol %indvars.iv186.prol = phi i64 [ %indvars.iv.next187.prol, %for.body57.prol ], [ %38, %for.body57.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body57.prol ], [ 0, %for.body57.preheader ] %arrayidx59.prol = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv186.prol store i32 0, ptr %arrayidx59.prol, align 16, !tbaa !5 %indvars.iv.next187.prol = add nsw i64 %indvars.iv186.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter214 br i1 %prol.iter.cmp.not, label %for.body57.prol.loopexit, label %for.body57.prol, !llvm.loop !21 for.body57.prol.loopexit: ; preds = %for.body57.prol, %for.body57.preheader %indvars.iv186.unr = phi i64 [ %38, %for.body57.preheader ], [ %indvars.iv.next187.prol, %for.body57.prol ] %42 = icmp ult i64 %41, 3 br i1 %42, label %for.inc65, label %for.body57 for.body57: ; preds = %for.body57.prol.loopexit, %for.body57 %indvars.iv186 = phi i64 [ %indvars.iv.next187.3, %for.body57 ], [ %indvars.iv186.unr, %for.body57.prol.loopexit ] %arrayidx59 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv186 store i32 0, ptr %arrayidx59, align 16, !tbaa !5 %indvars.iv.next187 = add nsw i64 %indvars.iv186, 1 %arrayidx59.1 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next187 store i32 0, ptr %arrayidx59.1, align 16, !tbaa !5 %indvars.iv.next187.1 = add nsw i64 %indvars.iv186, 2 %arrayidx59.2 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next187.1 store i32 0, ptr %arrayidx59.2, align 16, !tbaa !5 %indvars.iv.next187.2 = add nsw i64 %indvars.iv186, 3 %arrayidx59.3 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %indvars.iv.next187.2 store i32 0, ptr %arrayidx59.3, align 16, !tbaa !5 %indvars.iv.next187.3 = add nsw i64 %indvars.iv186, 4 %exitcond190.not.3 = icmp eq i64 %indvars.iv.next187.3, %wide.trip.count189 br i1 %exitcond190.not.3, label %for.inc65, label %for.body57, !llvm.loop !22 for.inc65: ; preds = %for.body57.prol.loopexit, %for.body57, %for.cond55.preheader, %if.end51 %inc66 = add nuw nsw i32 %i.3158, 1 %43 = load i32, ptr %n, align 4, !tbaa !5 %cmp31 = icmp slt i32 %inc66, %43 br i1 %cmp31, label %for.body32, label %for.cond68.preheader.loopexit, !llvm.loop !23 for.end104: ; preds = %for.cond71.for.inc102_crit_edge.us, %for.cond68.preheader %sub105 = add nsw i32 %21, -1 %idxprom106 = sext i32 %sub105 to i64 %sub108 = add nsw i32 %.pre204, -1 %idxprom109 = sext i32 %sub108 to i64 %arrayidx110 = getelementptr inbounds [16 x [16 x i32]], ptr %cross, i64 0, i64 %idxprom106, i64 %idxprom109 %44 = load i32, ptr %arrayidx110, align 4, !tbaa !5 %call111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %45 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp eq i32 %45, 0 %46 = load i32, ptr %b, align 4 %cmp1 = icmp eq i32 %46, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %if.end while.end: ; preds = %for.end104, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %cross) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { 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, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !12} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !12} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10}
#include <stdio.h> int main(){ int i, x, n, ans, pp, p[102] = {}; scanf("%d %d", &x, &n); for (i = 1; i <= n; i++) { scanf("%d", &pp); p[pp] = 1; } for (i = 0; i <= 100; i++) { if (p[x-i] == 0) { ans=x - i; break; } else if (p[x+i] == 0) { ans=x + i; break; } } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_294981/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_294981/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: %x = alloca i32, align 4 %n = alloca i32, align 4 %pp = alloca i32, align 4 %p = alloca [102 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pp) #5 call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %p) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(408) %p, i8 0, i64 408, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not26 = icmp slt i32 %0, 1 br i1 %cmp.not26, label %for.cond2.preheader, label %for.body for.cond2.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %x, align 4, !tbaa !5 %idxprom528 = sext i32 %1 to i64 %arrayidx629 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %idxprom528 %2 = load i32, ptr %arrayidx629, align 4, !tbaa !5 %cmp730 = icmp eq i32 %2, 0 br i1 %cmp730, label %for.end17, label %if.else for.body: ; preds = %entry, %for.body %i.027 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %pp) %3 = load i32, ptr %pp, align 4, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.027, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.027, %4 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2: ; preds = %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp3 = icmp ult i64 %indvars.iv, 100 call void @llvm.assume(i1 %cmp3) %5 = sub nsw i64 %idxprom528, %indvars.iv.next %arrayidx6 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %5 %6 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %6, 0 br i1 %cmp7, label %for.end17.loopexit.split.loop.exit36, label %if.else, !llvm.loop !11 if.else: ; preds = %for.cond2.preheader, %for.cond2 %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond2 ], [ 0, %for.cond2.preheader ] %7 = add nsw i64 %indvars.iv, %idxprom528 %arrayidx10 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %7 %8 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %8, 0 br i1 %cmp11, label %for.end17.loopexit.split.loop.exit, label %for.cond2 for.end17.loopexit.split.loop.exit: ; preds = %if.else %9 = trunc i64 %7 to i32 br label %for.end17 for.end17.loopexit.split.loop.exit36: ; preds = %for.cond2 %indvars.le = trunc i64 %indvars.iv.next to i32 %sub.le = sub nsw i32 %1, %indvars.le br label %for.end17 for.end17: ; preds = %for.end17.loopexit.split.loop.exit, %for.end17.loopexit.split.loop.exit36, %for.cond2.preheader %ans.0 = phi i32 [ %1, %for.cond2.preheader ], [ %9, %for.end17.loopexit.split.loop.exit ], [ %sub.le, %for.end17.loopexit.split.loop.exit36 ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pp) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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}
#include<stdio.h> #include <stdlib.h> int main() { int x,n; scanf("%d %d",&x,&n); int p[102]; for(int i = 0; i <= 101; i++) { p[i] = 0; } for(int i = 0;i < n; i++) { int a; scanf("%d", &a); p[a] = 1; } int ans = 0; int min = 1000; for (int i = 0; i <= 101; i++) { if (p[i] == 0) { if (min > abs(x-i)) { min = abs(x-i); ans = i; } } } printf("%d\n",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295023/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295023/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %n = alloca i32, align 4 %p = alloca [102 x i32], align 16 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %p) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(408) %p, i8 0, i64 408, i1 false), !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp338 = icmp sgt i32 %0, 0 br i1 %cmp338, label %for.body5, label %for.cond13.preheader for.cond13.preheader: ; preds = %for.body5, %entry %1 = load i32, ptr %x, align 4 br label %for.body16 for.body5: ; preds = %entry, %for.body5 %i1.039 = phi i32 [ %inc10, %for.body5 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %idxprom7 = sext i32 %2 to i64 %arrayidx8 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 %inc10 = add nuw nsw i32 %i1.039, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc10, %3 br i1 %cmp3, label %for.body5, label %for.cond13.preheader, !llvm.loop !9 for.cond.cleanup15: ; preds = %for.inc24.1 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.1.1) call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6 ret i32 0 for.body16: ; preds = %for.inc24.1, %for.cond13.preheader %indvars.iv = phi i64 [ 0, %for.cond13.preheader ], [ %indvars.iv.next.1, %for.inc24.1 ] %min.041 = phi i32 [ 1000, %for.cond13.preheader ], [ %min.1.1, %for.inc24.1 ] %ans.040 = phi i32 [ 0, %for.cond13.preheader ], [ %ans.1.1, %for.inc24.1 ] %arrayidx18 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx18, align 8, !tbaa !5 %cmp19 = icmp eq i32 %4, 0 br i1 %cmp19, label %if.then, label %for.inc24 if.then: ; preds = %for.body16 %5 = trunc i64 %indvars.iv to i32 %sub = sub nsw i32 %1, %5 %6 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %cmp20 = icmp sgt i32 %min.041, %6 %spec.select = select i1 %cmp20, i32 %5, i32 %ans.040 %spec.select36 = call i32 @llvm.smin.i32(i32 %min.041, i32 %6) br label %for.inc24 for.inc24: ; preds = %if.then, %for.body16 %ans.1 = phi i32 [ %ans.040, %for.body16 ], [ %spec.select, %if.then ] %min.1 = phi i32 [ %min.041, %for.body16 ], [ %spec.select36, %if.then ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx18.1 = getelementptr inbounds [102 x i32], ptr %p, i64 0, i64 %indvars.iv.next %7 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %cmp19.1 = icmp eq i32 %7, 0 br i1 %cmp19.1, label %if.then.1, label %for.inc24.1 if.then.1: ; preds = %for.inc24 %8 = trunc i64 %indvars.iv.next to i32 %sub.1 = sub nsw i32 %1, %8 %9 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true) %cmp20.1 = icmp sgt i32 %min.1, %9 %spec.select.1 = select i1 %cmp20.1, i32 %8, i32 %ans.1 %spec.select36.1 = call i32 @llvm.smin.i32(i32 %min.1, i32 %9) br label %for.inc24.1 for.inc24.1: ; preds = %if.then.1, %for.inc24 %ans.1.1 = phi i32 [ %ans.1, %for.inc24 ], [ %spec.select.1, %if.then.1 ] %min.1.1 = phi i32 [ %min.1, %for.inc24 ], [ %spec.select36.1, %if.then.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 102 br i1 %exitcond.not.1, label %for.cond.cleanup15, label %for.body16, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main() { int x,y,z; int p[100]; int i; int a,b; scanf("%d %d", &x,&y); for(i = 0; i< 100; i++) p[i] = i+1; for(i = 0; i < y; i++) { if(i == y-1) { scanf("%d", &z); p[z-1] = 0; } else { scanf("%d ", &z); p[z-1] = 0; } } for(i=x-1;; i--) { if(p[i] != 0 || i < 0) { break; } } if(i >= 0) a = p[i]; else a = 0; for(i=x-1;; i++) { if(p[i] != 0 || i == 100) { break; } } if(i != 100) b = p[i]; else b = 101; if(abs(x-a) == abs(x-b)) { printf("%d\n",a); } else if(abs(x-a) > abs(x-b)) { printf("%d\n",b); } else if(abs(x-a) < abs(x-b)) { printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295067/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295067/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 %p = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %p, align 16, !tbaa !5 %0 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 4 store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, ptr %0, align 16, !tbaa !5 %1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 8 store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 12 store <4 x i32> <i32 13, i32 14, i32 15, i32 16>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 16 store <4 x i32> <i32 17, i32 18, i32 19, i32 20>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 20 store <4 x i32> <i32 21, i32 22, i32 23, i32 24>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 24 store <4 x i32> <i32 25, i32 26, i32 27, i32 28>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 28 store <4 x i32> <i32 29, i32 30, i32 31, i32 32>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 32 store <4 x i32> <i32 33, i32 34, i32 35, i32 36>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 36 store <4 x i32> <i32 37, i32 38, i32 39, i32 40>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 40 store <4 x i32> <i32 41, i32 42, i32 43, i32 44>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 44 store <4 x i32> <i32 45, i32 46, i32 47, i32 48>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 48 store <4 x i32> <i32 49, i32 50, i32 51, i32 52>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 52 store <4 x i32> <i32 53, i32 54, i32 55, i32 56>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 56 store <4 x i32> <i32 57, i32 58, i32 59, i32 60>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 60 store <4 x i32> <i32 61, i32 62, i32 63, i32 64>, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 64 store <4 x i32> <i32 65, i32 66, i32 67, i32 68>, ptr %15, align 16, !tbaa !5 %16 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 68 store <4 x i32> <i32 69, i32 70, i32 71, i32 72>, ptr %16, align 16, !tbaa !5 %17 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 72 store <4 x i32> <i32 73, i32 74, i32 75, i32 76>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 76 store <4 x i32> <i32 77, i32 78, i32 79, i32 80>, ptr %18, align 16, !tbaa !5 %19 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 80 store <4 x i32> <i32 81, i32 82, i32 83, i32 84>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 84 store <4 x i32> <i32 85, i32 86, i32 87, i32 88>, ptr %20, align 16, !tbaa !5 %21 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 88 store <4 x i32> <i32 89, i32 90, i32 91, i32 92>, ptr %21, align 16, !tbaa !5 %22 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 92 store <4 x i32> <i32 93, i32 94, i32 95, i32 96>, ptr %22, align 16, !tbaa !5 %23 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 96 store <4 x i32> <i32 97, i32 98, i32 99, i32 100>, ptr %23, align 16, !tbaa !5 %24 = load i32, ptr %y, align 4, !tbaa !5 %cmp299 = icmp sgt i32 %24, 0 br i1 %cmp299, label %for.body3, label %for.end15 for.body3: ; preds = %entry, %for.body3 %25 = phi i32 [ %26, %for.body3 ], [ %24, %entry ] %i.1100 = phi i32 [ %inc14, %for.body3 ], [ 0, %entry ] %sub = add nsw i32 %25, -1 %cmp4 = icmp eq i32 %i.1100, %sub %.str.1..str.2 = select i1 %cmp4, ptr @.str.1, ptr @.str.2 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull %.str.1..str.2, ptr noundef nonnull %z) %.sink = load i32, ptr %z, align 4, !tbaa !5 %sub6 = add nsw i32 %.sink, -1 %idxprom7 = sext i32 %sub6 to i64 %arrayidx8 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %idxprom7 store i32 0, ptr %arrayidx8, align 4, !tbaa !5 %inc14 = add nuw nsw i32 %i.1100, 1 %26 = load i32, ptr %y, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc14, %26 br i1 %cmp2, label %for.body3, label %for.end15, !llvm.loop !9 for.end15: ; preds = %for.body3, %entry %27 = load i32, ptr %x, align 4, !tbaa !5 %28 = sext i32 %27 to i64 br label %for.cond17 for.cond17: ; preds = %for.cond17, %for.end15 %indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.cond17 ], [ %28, %for.end15 ] %indvars.iv.next104 = add nsw i64 %indvars.iv103, -1 %arrayidx19 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next104 %29 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp ne i32 %29, 0 %cmp21 = icmp slt i64 %indvars.iv103, 1 %or.cond = or i1 %cmp21, %cmp20 br i1 %or.cond, label %for.end25, label %for.cond17 for.end25: ; preds = %for.cond17 %30 = trunc i64 %indvars.iv103 to i32 %cmp26 = icmp sgt i32 %30, 0 %31 = add nsw i64 %28, -1 br label %for.cond33 for.cond33: ; preds = %for.cond33, %for.end25 %indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.cond33 ], [ %31, %for.end25 ] %arrayidx35 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv106 %32 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %cmp36 = icmp ne i32 %32, 0 %33 = icmp eq i64 %indvars.iv106, 100 %or.cond70 = or i1 %33, %cmp36 %indvars.iv.next107 = add nsw i64 %indvars.iv106, 1 br i1 %or.cond70, label %for.end43, label %for.cond33 for.end43: ; preds = %for.cond33 %. = select i1 %cmp26, i32 %29, i32 0 %.96 = select i1 %33, i32 101, i32 %32 %sub50 = sub nsw i32 %27, %. %34 = call i32 @llvm.abs.i32(i32 %sub50, i1 true) %sub51 = sub nsw i32 %27, %.96 %35 = call i32 @llvm.abs.i32(i32 %sub51, i1 true) %cmp52 = icmp eq i32 %34, %35 br i1 %cmp52, label %if.end69.sink.split, label %if.else55 if.else55: ; preds = %for.end43 %cmp58 = icmp ugt i32 %34, %35 br i1 %cmp58, label %if.end69.sink.split, label %if.else61 if.else61: ; preds = %if.else55 %cmp64 = icmp ult i32 %34, %35 br i1 %cmp64, label %if.end69.sink.split, label %if.end69 if.end69.sink.split: ; preds = %if.else61, %if.else55, %for.end43 %.96.sink = phi i32 [ %., %for.end43 ], [ %.96, %if.else55 ], [ %., %if.else61 ] %call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.96.sink) br label %if.end69 if.end69: ; preds = %if.end69.sink.split, %if.else61 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #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 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"}
#include<stdio.h> int up[100000]; int dw[100000]; int x,y; int g; int s=1; int main(){ int A,B; scanf("%d %d",&A,&B); if (A==0){ g=B; while(y<=B){ dw[y]=g+1; --g; ++y; } y=0; while(y<=B){ printf("%d ",dw[y]); y++; } return 0; } else { x=2; up[0]=1; up[1]=2+B; g=up[1]; s=1+B; while(x<=A){ up[x]=g+1; ++g; ++x; } while (y<B){ dw[y]=s; s--; y++; } x=0; y=0; while (x<=A){ printf("%d ",up[x]); x++; } while (y<B){ printf("%d ",dw[y]); y++; } return 0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_29511/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_29511/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" @s = dso_local local_unnamed_addr global i32 1, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @g = dso_local local_unnamed_addr global i32 0, align 4 @y = dso_local local_unnamed_addr global i32 0, align 4 @dw = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @x = dso_local local_unnamed_addr global i32 0, align 4 @up = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 ; 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 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %1 = load i32, ptr %B, align 4, !tbaa !5 store i32 %1, ptr @g, align 4, !tbaa !5 %y.promoted64 = load i32, ptr @y, align 4, !tbaa !5 %cmp1.not68 = icmp sgt i32 %y.promoted64, %1 br i1 %cmp1.not68, label %while.cond2.preheader, label %while.body.preheader while.body.preheader: ; preds = %if.then %2 = sext i32 %y.promoted64 to i64 %3 = add i32 %1, 1 %4 = sub i32 %1, %y.promoted64 %5 = zext i32 %4 to i64 %6 = add nuw nsw i64 %5, 1 %min.iters.check115 = icmp ult i32 %4, 7 br i1 %min.iters.check115, label %while.body.preheader136, label %vector.ph116 vector.ph116: ; preds = %while.body.preheader %n.vec118 = and i64 %6, 8589934584 %ind.end119 = add nsw i64 %n.vec118, %2 %.cast121 = trunc i64 %n.vec118 to i32 %ind.end122 = sub i32 %1, %.cast121 %.splatinsert127 = insertelement <4 x i32> poison, i32 %1, i64 0 %.splat128 = shufflevector <4 x i32> %.splatinsert127, <4 x i32> poison, <4 x i32> zeroinitializer %induction129 = add <4 x i32> %.splat128, <i32 0, i32 -1, i32 -2, i32 -3> br label %vector.body125 vector.body125: ; preds = %vector.body125, %vector.ph116 %index126 = phi i64 [ 0, %vector.ph116 ], [ %index.next135, %vector.body125 ] %vec.ind130 = phi <4 x i32> [ %induction129, %vector.ph116 ], [ %vec.ind.next133, %vector.body125 ] %offset.idx134 = add i64 %index126, %2 %7 = add nsw <4 x i32> %vec.ind130, <i32 1, i32 1, i32 1, i32 1> %8 = add <4 x i32> %vec.ind130, <i32 -3, i32 -3, i32 -3, i32 -3> %9 = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %offset.idx134 store <4 x i32> %7, ptr %9, align 4, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> %8, ptr %10, align 4, !tbaa !5 %index.next135 = add nuw i64 %index126, 8 %vec.ind.next133 = add <4 x i32> %vec.ind130, <i32 -8, i32 -8, i32 -8, i32 -8> %11 = icmp eq i64 %index.next135, %n.vec118 br i1 %11, label %middle.block113, label %vector.body125, !llvm.loop !9 middle.block113: ; preds = %vector.body125 %cmp.n124 = icmp eq i64 %6, %n.vec118 br i1 %cmp.n124, label %while.cond.while.cond2.preheader_crit_edge, label %while.body.preheader136 while.body.preheader136: ; preds = %while.body.preheader, %middle.block113 %indvars.iv79.ph = phi i64 [ %2, %while.body.preheader ], [ %ind.end119, %middle.block113 ] %dec6769.ph = phi i32 [ %1, %while.body.preheader ], [ %ind.end122, %middle.block113 ] br label %while.body while.cond.while.cond2.preheader_crit_edge: ; preds = %while.body, %middle.block113 %dec.lcssa = phi i32 [ %ind.end122, %middle.block113 ], [ %dec, %while.body ] store i32 %dec.lcssa, ptr @g, align 4, !tbaa !5 br label %while.cond2.preheader while.cond2.preheader: ; preds = %while.cond.while.cond2.preheader_crit_edge, %if.then store i32 0, ptr @y, align 4, !tbaa !5 %cmp3.not71 = icmp slt i32 %1, 0 br i1 %cmp3.not71, label %cleanup, label %while.body4 while.body: ; preds = %while.body.preheader136, %while.body %indvars.iv79 = phi i64 [ %indvars.iv.next80, %while.body ], [ %indvars.iv79.ph, %while.body.preheader136 ] %dec6769 = phi i32 [ %dec, %while.body ], [ %dec6769.ph, %while.body.preheader136 ] %add = add nsw i32 %dec6769, 1 %arrayidx = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %indvars.iv79 store i32 %add, ptr %arrayidx, align 4, !tbaa !5 %dec = add nsw i32 %dec6769, -1 %indvars.iv.next80 = add nsw i64 %indvars.iv79, 1 %lftr.wideiv82 = trunc i64 %indvars.iv.next80 to i32 %exitcond83.not = icmp eq i32 %3, %lftr.wideiv82 br i1 %exitcond83.not, label %while.cond.while.cond2.preheader_crit_edge, label %while.body, !llvm.loop !13 while.body4: ; preds = %while.cond2.preheader, %while.body4 %storemerge72 = phi i32 [ %inc8, %while.body4 ], [ 0, %while.cond2.preheader ] %idxprom5 = sext i32 %storemerge72 to i64 %arrayidx6 = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %idxprom5 %12 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %13 = load i32, ptr @y, align 4, !tbaa !5 %inc8 = add nsw i32 %13, 1 store i32 %inc8, ptr @y, align 4, !tbaa !5 %14 = load i32, ptr %B, align 4, !tbaa !5 %cmp3.not.not = icmp slt i32 %13, %14 br i1 %cmp3.not.not, label %while.body4, label %cleanup, !llvm.loop !14 if.else: ; preds = %entry store i32 1, ptr @up, align 16, !tbaa !5 %15 = load i32, ptr %B, align 4, !tbaa !5 %add10 = add nsw i32 %15, 2 store i32 %add10, ptr getelementptr inbounds ([100000 x i32], ptr @up, i64 0, i64 1), align 4, !tbaa !5 store i32 %add10, ptr @g, align 4, !tbaa !5 %add11 = add nsw i32 %15, 1 store i32 %add11, ptr @s, align 4, !tbaa !5 %cmp13.not54 = icmp slt i32 %0, 2 br i1 %cmp13.not54, label %while.cond21.preheader, label %while.body14.preheader while.body14.preheader: ; preds = %if.else %16 = add nuw i32 %0, 1 %17 = add i32 %0, -1 %18 = zext i32 %17 to i64 %min.iters.check = icmp ult i32 %0, 9 br i1 %min.iters.check, label %while.body14.preheader141, label %vector.ph vector.ph: ; preds = %while.body14.preheader %n.vec = and i64 %18, 4294967288 %ind.end = or i64 %n.vec, 2 %.cast = trunc i64 %n.vec to i32 %ind.end87 = add i32 %add10, %.cast %.splatinsert = insertelement <4 x i32> poison, i32 %add10, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %offset.idx = or i64 %index, 2 %19 = add nsw <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %20 = add <4 x i32> %vec.ind, <i32 5, i32 5, i32 5, i32 5> %21 = getelementptr inbounds [100000 x i32], ptr @up, i64 0, i64 %offset.idx store <4 x i32> %19, ptr %21, align 8, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 store <4 x i32> %20, ptr %22, align 8, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %23 = icmp eq i64 %index.next, %n.vec br i1 %23, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %18 br i1 %cmp.n, label %while.cond12.while.cond21.preheader_crit_edge, label %while.body14.preheader141 while.body14.preheader141: ; preds = %while.body14.preheader, %middle.block %indvars.iv.ph = phi i64 [ 2, %while.body14.preheader ], [ %ind.end, %middle.block ] %add155355.ph = phi i32 [ %add10, %while.body14.preheader ], [ %ind.end87, %middle.block ] br label %while.body14 while.cond12.while.cond21.preheader_crit_edge: ; preds = %while.body14, %middle.block %add15.lcssa = phi i32 [ %ind.end87, %middle.block ], [ %add15, %while.body14 ] store i32 %add15.lcssa, ptr @g, align 4, !tbaa !5 br label %while.cond21.preheader while.cond21.preheader: ; preds = %while.cond12.while.cond21.preheader_crit_edge, %if.else %y.promoted = load i32, ptr @y, align 4, !tbaa !5 %cmp2259 = icmp slt i32 %y.promoted, %15 br i1 %cmp2259, label %while.body23.preheader, label %while.end28 while.body23.preheader: ; preds = %while.cond21.preheader %24 = sext i32 %y.promoted to i64 %wide.trip.count = sext i32 %15 to i64 %25 = sub nsw i64 %wide.trip.count, %24 %min.iters.check92 = icmp ult i64 %25, 8 br i1 %min.iters.check92, label %while.body23.preheader139, label %vector.ph93 vector.ph93: ; preds = %while.body23.preheader %n.vec95 = and i64 %25, -8 %ind.end96 = add nsw i64 %n.vec95, %24 %.cast98 = trunc i64 %n.vec95 to i32 %ind.end99 = sub i32 %add11, %.cast98 %.splatinsert104 = insertelement <4 x i32> poison, i32 %add11, i64 0 %.splat105 = shufflevector <4 x i32> %.splatinsert104, <4 x i32> poison, <4 x i32> zeroinitializer %induction106 = add <4 x i32> %.splat105, <i32 0, i32 -1, i32 -2, i32 -3> br label %vector.body102 vector.body102: ; preds = %vector.body102, %vector.ph93 %index103 = phi i64 [ 0, %vector.ph93 ], [ %index.next112, %vector.body102 ] %vec.ind107 = phi <4 x i32> [ %induction106, %vector.ph93 ], [ %vec.ind.next110, %vector.body102 ] %step.add108 = add <4 x i32> %vec.ind107, <i32 -4, i32 -4, i32 -4, i32 -4> %offset.idx111 = add i64 %index103, %24 %26 = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %offset.idx111 store <4 x i32> %vec.ind107, ptr %26, align 4, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 store <4 x i32> %step.add108, ptr %27, align 4, !tbaa !5 %index.next112 = add nuw i64 %index103, 8 %vec.ind.next110 = add <4 x i32> %vec.ind107, <i32 -8, i32 -8, i32 -8, i32 -8> %28 = icmp eq i64 %index.next112, %n.vec95 br i1 %28, label %middle.block90, label %vector.body102, !llvm.loop !16 middle.block90: ; preds = %vector.body102 %cmp.n101 = icmp eq i64 %25, %n.vec95 br i1 %cmp.n101, label %while.cond21.while.end28_crit_edge, label %while.body23.preheader139 while.body23.preheader139: ; preds = %while.body23.preheader, %middle.block90 %indvars.iv75.ph = phi i64 [ %24, %while.body23.preheader ], [ %ind.end96, %middle.block90 ] %dec265860.ph = phi i32 [ %add11, %while.body23.preheader ], [ %ind.end99, %middle.block90 ] br label %while.body23 while.body14: ; preds = %while.body14.preheader141, %while.body14 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body14 ], [ %indvars.iv.ph, %while.body14.preheader141 ] %add155355 = phi i32 [ %add15, %while.body14 ], [ %add155355.ph, %while.body14.preheader141 ] %add15 = add nsw i32 %add155355, 1 %arrayidx17 = getelementptr inbounds [100000 x i32], ptr @up, i64 0, i64 %indvars.iv store i32 %add15, ptr %arrayidx17, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %16, %lftr.wideiv br i1 %exitcond.not, label %while.cond12.while.cond21.preheader_crit_edge, label %while.body14, !llvm.loop !17 while.body23: ; preds = %while.body23.preheader139, %while.body23 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %while.body23 ], [ %indvars.iv75.ph, %while.body23.preheader139 ] %dec265860 = phi i32 [ %dec26, %while.body23 ], [ %dec265860.ph, %while.body23.preheader139 ] %arrayidx25 = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %indvars.iv75 store i32 %dec265860, ptr %arrayidx25, align 4, !tbaa !5 %dec26 = add nsw i32 %dec265860, -1 %indvars.iv.next76 = add nsw i64 %indvars.iv75, 1 %exitcond78.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count br i1 %exitcond78.not, label %while.cond21.while.end28_crit_edge, label %while.body23, !llvm.loop !18 while.cond21.while.end28_crit_edge: ; preds = %while.body23, %middle.block90 %dec26.lcssa = phi i32 [ %ind.end99, %middle.block90 ], [ %dec26, %while.body23 ] store i32 %dec26.lcssa, ptr @s, align 4, !tbaa !5 br label %while.end28 while.end28: ; preds = %while.cond21.while.end28_crit_edge, %while.cond21.preheader store i32 0, ptr @x, align 4, !tbaa !5 store i32 0, ptr @y, align 4, !tbaa !5 %cmp30.not62 = icmp slt i32 %0, 0 br i1 %cmp30.not62, label %while.cond37.preheader, label %while.body31 while.cond37.preheader.loopexit: ; preds = %while.body31 %.pre = load i32, ptr @y, align 4, !tbaa !5 %.pre84 = load i32, ptr %B, align 4, !tbaa !5 br label %while.cond37.preheader while.cond37.preheader: ; preds = %while.cond37.preheader.loopexit, %while.end28 %29 = phi i32 [ %.pre84, %while.cond37.preheader.loopexit ], [ %15, %while.end28 ] %30 = phi i32 [ %.pre, %while.cond37.preheader.loopexit ], [ 0, %while.end28 ] %cmp3863 = icmp slt i32 %30, %29 br i1 %cmp3863, label %while.body39, label %cleanup while.body31: ; preds = %while.end28, %while.body31 %31 = phi i32 [ %inc35, %while.body31 ], [ 0, %while.end28 ] %idxprom32 = sext i32 %31 to i64 %arrayidx33 = getelementptr inbounds [100000 x i32], ptr @up, i64 0, i64 %idxprom32 %32 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %32) %33 = load i32, ptr @x, align 4, !tbaa !5 %inc35 = add nsw i32 %33, 1 store i32 %inc35, ptr @x, align 4, !tbaa !5 %34 = load i32, ptr %A, align 4, !tbaa !5 %cmp30.not.not = icmp slt i32 %33, %34 br i1 %cmp30.not.not, label %while.body31, label %while.cond37.preheader.loopexit, !llvm.loop !19 while.body39: ; preds = %while.cond37.preheader, %while.body39 %35 = phi i32 [ %inc43, %while.body39 ], [ %30, %while.cond37.preheader ] %idxprom40 = sext i32 %35 to i64 %arrayidx41 = getelementptr inbounds [100000 x i32], ptr @dw, i64 0, i64 %idxprom40 %36 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %36) %37 = load i32, ptr @y, align 4, !tbaa !5 %inc43 = add nsw i32 %37, 1 store i32 %inc43, ptr @y, align 4, !tbaa !5 %38 = load i32, ptr %B, align 4, !tbaa !5 %cmp38 = icmp slt i32 %inc43, %38 br i1 %cmp38, label %while.body39, label %cleanup, !llvm.loop !20 cleanup: ; preds = %while.body39, %while.body4, %while.cond37.preheader, %while.cond2.preheader 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, !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, !11, !12} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include <stdio.h> int main() { int a; int b; int n[101]; int deta[101]; scanf("%d", &a); scanf("%d", &b); for (int i = 0; i <= 100; i++) { deta[i] = 0;//で初期化 } for (int i = 0; i < b; i++) { scanf("%d", &n[i]); deta[n[i]] = 1; } for (int i = 0; i <= 100; i++) { if(a-i>=0){//0よりでかい if(deta[a-i]==0){ printf("%d", a - i); break; } } if(a+i==101){ printf("%d", 101); break; } if (a + i <= 100) { //100より if (deta[a + i] == 0) { printf("%d", a + i); break; } } } printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295153/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295153/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %n = alloca [101 x i32], align 16 %deta = alloca [101 x i32], align 16 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 404, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %deta) #5 %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) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %deta, i8 0, i64 404, i1 false), !tbaa !5 %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp468 = icmp sgt i32 %0, 0 br i1 %cmp468, label %for.body6, label %for.cond18.preheader for.cond18.preheader: ; preds = %for.body6, %entry %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %3 = sub i32 101, %1 %wide.trip.count = zext i32 %3 to i64 br label %for.body21 for.body6: ; preds = %entry, %for.body6 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 0, %entry ] %arrayidx8 = getelementptr inbounds [101 x i32], ptr %n, i64 0, i64 %indvars.iv %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8) %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %idxprom12 = sext i32 %4 to i64 %arrayidx13 = getelementptr inbounds [101 x i32], ptr %deta, i64 0, i64 %idxprom12 store i32 1, ptr %arrayidx13, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %b, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp4, label %for.body6, label %for.cond18.preheader, !llvm.loop !9 for.body21: ; preds = %for.cond18.preheader, %for.inc47 %indvars.iv78 = phi i64 [ 0, %for.cond18.preheader ], [ %indvars.iv.next79, %for.inc47 ] %7 = sub nsw i64 %2, %indvars.iv78 %cmp22 = icmp sgt i64 %7, -1 br i1 %cmp22, label %if.then, label %if.end30 if.then: ; preds = %for.body21 %idxprom24 = and i64 %7, 4294967295 %arrayidx25 = getelementptr inbounds [101 x i32], ptr %deta, i64 0, i64 %idxprom24 %8 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %cmp26 = icmp eq i32 %8, 0 br i1 %cmp26, label %if.then27, label %if.end30 if.then27: ; preds = %if.then %9 = trunc i64 %7 to i32 br label %cleanup.sink.split if.end30: ; preds = %if.then, %for.body21 %10 = add nsw i64 %indvars.iv78, %2 %exitcond = icmp eq i64 %indvars.iv78, %wide.trip.count br i1 %exitcond, label %cleanup.sink.split, label %if.end34 if.end34: ; preds = %if.end30 %cmp36 = icmp slt i64 %10, 101 br i1 %cmp36, label %if.then37, label %for.inc47 if.then37: ; preds = %if.end34 %arrayidx40 = getelementptr inbounds [101 x i32], ptr %deta, i64 0, i64 %10 %11 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %11, 0 br i1 %cmp41, label %if.then42, label %for.inc47 if.then42: ; preds = %if.then37 %12 = trunc i64 %10 to i32 br label %cleanup.sink.split for.inc47: ; preds = %if.end34, %if.then37 %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond83.not = icmp eq i64 %indvars.iv.next79, 101 br i1 %exitcond83.not, label %cleanup, label %for.body21, !llvm.loop !11 cleanup.sink.split: ; preds = %if.end30, %if.then27, %if.then42 %.sink = phi i32 [ %12, %if.then42 ], [ %9, %if.then27 ], [ 101, %if.end30 ] %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.sink) br label %cleanup cleanup: ; preds = %for.inc47, %cleanup.sink.split %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %deta) #5 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %n) #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 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: 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ long long n,k,x; scanf("%lld %lld",&n,&k); x=n%k; if(x>k-x)x=k-x; printf("%lld\n",x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295197/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295197/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 [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 i64, 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 i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %k, align 8, !tbaa !5 %rem = srem i64 %0, %1 %sub = sub nsw i64 %1, %rem %spec.select = call i64 @llvm.smin.i64(i64 %rem, i64 %sub) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ long int n,k; scanf("%ld%ld",&n,&k); if(n%k<(k-n%k)) printf("%ld",n%k); else printf("%ld",k-n%k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295247/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295247/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"%ld%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\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 i64, 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 i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %k, align 8, !tbaa !5 %rem = srem i64 %0, %1 %sub = sub nsw i64 %1, %rem %rem.sub = call i64 @llvm.smin.i64(i64 %rem, i64 %sub) %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem.sub) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { long long int n,k; scanf("%lld %lld",&n,&k); if(n>=k){ if(n%k<=k/2){ n=n%k; } else if(n%k>k/2){ n=k-(n%k); } } if(n<k){ if(k<2*n){ n=k-n; } } printf("%lld",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295290/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295290/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 [5 x i8] c"%lld\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 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 %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %k, align 8, !tbaa !5 %cmp.not = icmp slt i64 %0, %1 br i1 %cmp.not, label %if.end10, label %if.then if.then: ; preds = %entry %rem = srem i64 %0, %1 %div = sdiv i64 %1, 2 %cmp1.not = icmp sgt i64 %rem, %div br i1 %cmp1.not, label %if.then7, label %if.then2 if.then2: ; preds = %if.then store i64 %rem, ptr %n, align 8, !tbaa !5 br label %if.end10 if.then7: ; preds = %if.then %sub = sub nsw i64 %1, %rem store i64 %sub, ptr %n, align 8, !tbaa !5 br label %if.end10 if.end10: ; preds = %if.then2, %if.then7, %entry %2 = phi i64 [ %rem, %if.then2 ], [ %sub, %if.then7 ], [ %0, %entry ] %cmp11 = icmp slt i64 %2, %1 %mul = shl nsw i64 %2, 1 %cmp13 = icmp slt i64 %1, %mul %or.cond = select i1 %cmp11, i1 %cmp13, i1 false br i1 %or.cond, label %if.then14, label %if.end17 if.then14: ; preds = %if.end10 %sub15 = sub nsw i64 %1, %2 store i64 %sub15, ptr %n, align 8, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.then14, %if.end10 %3 = phi i64 [ %sub15, %if.then14 ], [ %2, %if.end10 ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3) call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include<string.h> #include<stdlib.h> int main() { long long n,k; scanf("%lld%lld",&n,&k); long long tmp=n%k; if(tmp<llabs(tmp-k)) { printf("%lld\n",tmp); } else { printf("%lld\n",llabs(k-tmp)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295340/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295340/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %k = alloca i64, 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 i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %k, align 8, !tbaa !5 %rem = srem i64 %0, %1 %sub = sub nsw i64 %rem, %1 %2 = call i64 @llvm.abs.i64(i64 %sub, i1 true) %cmp = icmp slt i64 %rem, %2 br i1 %cmp, label %if.end, label %if.else if.else: ; preds = %entry %sub2 = sub nsw i64 %1, %rem %3 = call i64 @llvm.abs.i64(i64 %sub2, i1 true) br label %if.end if.end: ; preds = %entry, %if.else %.sink = phi i64 [ %3, %if.else ], [ %rem, %entry ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.sink) 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #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 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <math.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; ull absol(ll number) { if (number < 0) return((-1) * number); else return(number); } int main(void) { int scan; // scanf result ull n; // to input ull k; // to input scan = scanf("%llu", &n); scan = scanf("%llu", &k); if (k == 1) printf("0"); else if (n == k) printf("0"); else if (n < k) { if (absol(n - k) > n) printf("%llu", n); else printf("%llu", absol(n - k)); } else if (n % k < k) { if (n % k - k < n % k) printf("%llu", n % k); else printf("%llu", absol(n % k - k)); } else printf("%llu", absol(n % (n - k))); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295391/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"%llu\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @absol(i64 noundef %number) local_unnamed_addr #0 { entry: %retval.0 = tail call i64 @llvm.abs.i64(i64 %number, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i64, align 8 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i64, ptr %k, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %putchar44 = call i32 @putchar(i32 48) br label %if.end41 if.else: ; preds = %entry %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp3 = icmp eq i64 %1, %0 br i1 %cmp3, label %if.then4, label %if.else6 if.then4: ; preds = %if.else %putchar = call i32 @putchar(i32 48) br label %if.end41 if.else6: ; preds = %if.else %cmp7 = icmp ult i64 %1, %0 br i1 %cmp7, label %if.then8, label %if.else17 if.then8: ; preds = %if.else6 %sub = sub i64 %1, %0 %retval.0.i = call i64 @llvm.abs.i64(i64 %sub, i1 true) %cmp10 = icmp ugt i64 %retval.0.i, %1 br i1 %cmp10, label %if.then11, label %if.else13 if.then11: ; preds = %if.then8 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %1) br label %if.end41 if.else13: ; preds = %if.then8 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %retval.0.i) br label %if.end41 if.else17: ; preds = %if.else6 %rem = urem i64 %1, %0 %sub21 = sub i64 %rem, %0 %cmp23 = icmp ult i64 %sub21, %rem br i1 %cmp23, label %if.then24, label %if.else27 if.then24: ; preds = %if.else17 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem) br label %if.end41 if.else27: ; preds = %if.else17 %retval.0.i46 = call i64 @llvm.abs.i64(i64 %sub21, i1 true) %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %retval.0.i46) br label %if.end41 if.end41: ; preds = %if.then4, %if.else27, %if.then24, %if.then11, %if.else13, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ long long int N,K; scanf("%lld%lld",&N,&K); if(N%K>K/2)printf("%lld",K-N%K); else printf("%lld",N%K); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295441/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295441/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\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 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 %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = load i64, ptr %K, align 8, !tbaa !5 %rem = srem i64 %0, %1 %div = sdiv i64 %1, 2 %cmp = icmp sgt i64 %rem, %div %sub = sub nsw i64 %1, %rem %rem.sink = select i1 %cmp, i64 %sub, i64 %rem %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem.sink) call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int max(int a,int b){return a>b ? a:b;} int main(){ int n,k,i,ans=1; scanf("%d%d",&n,&k); char s[n+1]; scanf("%s",s); for(i=1;i<n;i++) if(s[i]!=s[i-1]) ans++; printf("%d\n",n-max(ans-k*2,1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295492/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295492/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"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %1, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %3, 1 br i1 %cmp16, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %3 to i64 %.pre = load i8, ptr %vla, align 16, !tbaa !9 %4 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %3, 9 br i1 %min.iters.check, label %for.body.preheader24, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, -8 %ind.end = or i64 %n.vec, 1 %vector.recur.init = insertelement <4 x i8> poison, i8 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load23, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 0, i32 0, i32 0>, %vector.ph ], [ %13, %vector.body ] %vec.phi22 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %offset.idx = or i64 %index, 1 %5 = getelementptr inbounds i8, ptr %vla, i64 %offset.idx %wide.load = load <4 x i8>, ptr %5, align 1, !tbaa !9 %6 = getelementptr inbounds i8, ptr %5, i64 4 %wide.load23 = load <4 x i8>, ptr %6, align 1, !tbaa !9 %7 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %8 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load23, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %9 = icmp ne <4 x i8> %wide.load, %7 %10 = icmp ne <4 x i8> %wide.load23, %8 %11 = zext <4 x i1> %9 to <4 x i32> %12 = zext <4 x i1> %10 to <4 x i32> %13 = add <4 x i32> %vec.phi, %11 %14 = add <4 x i32> %vec.phi22, %12 %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 !10 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %14, %13 %16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec %vector.recur.extract = extractelement <4 x i8> %wide.load23, i64 3 br i1 %cmp.n, label %for.end, label %for.body.preheader24 for.body.preheader24: ; preds = %for.body.preheader, %middle.block %scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body.preheader ] %indvars.iv.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.preheader ] %ans.017.ph = phi i32 [ %16, %middle.block ], [ 1, %for.body.preheader ] br label %for.body for.body: ; preds = %for.body.preheader24, %for.body %scalar.recur = phi i8 [ %17, %for.body ], [ %scalar.recur.ph, %for.body.preheader24 ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader24 ] %ans.017 = phi i32 [ %spec.select, %for.body ], [ %ans.017.ph, %for.body.preheader24 ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %17 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp5.not = icmp ne i8 %17, %scalar.recur %inc = zext i1 %cmp5.not to i32 %spec.select = add nuw nsw i32 %ans.017, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %16, %middle.block ], [ %spec.select, %for.body ] %18 = load i32, ptr %k, align 4, !tbaa !5 %mul = shl nsw i32 %18, 1 %sub8 = sub nsw i32 %ans.0.lcssa, %mul %cond.i = call i32 @llvm.smax.i32(i32 %sub8, i32 1) %sub10 = sub nsw i32 %3, %cond.i %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub10) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12}
#include<stdio.h> int MAX(int a,int b){return a<b?b:a;} int main(){ int n,m,c=0,i; char s[100010]; scanf("%d %d %s",&n,&m,s); for(i=1;i<n;i++){ if(s[i-1]-s[i])c++; }//printf("%d\n",c); printf("%d\n",n-MAX(0,c-m*2)-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295535/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295535/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 %s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @MAX(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %s = alloca [100010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 1 br i1 %cmp15, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %.pre = load i8, ptr %s, align 16, !tbaa !9 %1 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %0, 9 br i1 %min.iters.check, label %for.body.preheader23, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = or i64 %n.vec, 1 %vector.recur.init = insertelement <4 x i8> poison, i8 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load22, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi21 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %offset.idx = or i64 %index, 1 %2 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %offset.idx %wide.load = load <4 x i8>, ptr %2, align 1, !tbaa !9 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load22 = load <4 x i8>, ptr %3, align 1, !tbaa !9 %4 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %5 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load22, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %6 = icmp ne <4 x i8> %4, %wide.load %7 = icmp ne <4 x i8> %5, %wide.load22 %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi21, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %1, %n.vec %vector.recur.extract = extractelement <4 x i8> %wide.load22, i64 3 br i1 %cmp.n, label %for.end, label %for.body.preheader23 for.body.preheader23: ; preds = %for.body.preheader, %middle.block %scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body.preheader ] %indvars.iv.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.preheader ] %c.016.ph = phi i32 [ %13, %middle.block ], [ 0, %for.body.preheader ] br label %for.body for.body: ; preds = %for.body.preheader23, %for.body %scalar.recur = phi i8 [ %14, %for.body ], [ %scalar.recur.ph, %for.body.preheader23 ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader23 ] %c.016 = phi i32 [ %spec.select, %for.body ], [ %c.016.ph, %for.body.preheader23 ] %arrayidx2 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv %14 = load i8, ptr %arrayidx2, align 1, !tbaa !9 %tobool.not = icmp ne i8 %scalar.recur, %14 %inc = zext i1 %tobool.not to i32 %spec.select = add nuw nsw i32 %c.016, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] %15 = load i32, ptr %m, align 4, !tbaa !5 %mul = shl nsw i32 %15, 1 %sub6 = sub nsw i32 %c.0.lcssa, %mul %cond.i = call i32 @llvm.smax.i32(i32 %sub6, i32 0) %16 = xor i32 %cond.i, -1 %sub9 = add i32 %0, %16 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub9) call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12}
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct d{int r,h;}d; d ds[200]; int n,m,i,j,t,dp[201]; int c(const void *a,const void *b) { d x=*(d*)a,y=*(d*)b; if(x.r==y.r) return x.h-y.h; else return x.r-y.r; } int main() { for(;scanf("%d",&n),n;) { memset(dp,0,sizeof(dp)); for(i=0;i<n;i++) scanf("%d%d",&ds[i].h,&ds[i].r); for(scanf("%d",&m);i-n<m;i++) scanf("%d%d",&ds[i].h,&ds[i].r); qsort(ds,n+m,sizeof(d),c); for(i=t=0;i<n+m;i++) { for(j=0,dp[i]=1;j<i;j++) if(ds[j].r<ds[i].r&&ds[j].h<ds[i].h) dp[i]=dp[i]<dp[j]+1?dp[j]+1:dp[i]; t=t<dp[i]?dp[i]:t; } printf("%d\n",t); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295579/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.d = type { i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @dp = dso_local local_unnamed_addr global [201 x i32] zeroinitializer, align 16 @i = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @ds = dso_local global [200 x %struct.d] zeroinitializer, align 16 @m = dso_local global i32 0, align 4 @t = dso_local local_unnamed_addr global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @c(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %x.sroa.0.0.copyload = load i32, ptr %a, align 4, !tbaa.struct !5 %y.sroa.0.0.copyload = load i32, ptr %b, align 4, !tbaa.struct !5 %cmp = icmp eq i32 %x.sroa.0.0.copyload, %y.sroa.0.0.copyload br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %y.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %b, i64 4 %y.sroa.5.0.copyload = load i32, ptr %y.sroa.5.0..sroa_idx, align 4, !tbaa.struct !10 %x.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %a, i64 4 %x.sroa.5.0.copyload = load i32, ptr %x.sroa.5.0..sroa_idx, align 4, !tbaa.struct !10 %sub = sub nsw i32 %x.sroa.5.0.copyload, %y.sroa.5.0.copyload br label %cleanup if.else: ; preds = %entry %sub5 = sub nsw i32 %x.sroa.0.0.copyload, %y.sroa.0.0.copyload br label %cleanup cleanup: ; preds = %if.else, %if.then %retval.0 = phi i32 [ %sub, %if.then ], [ %sub5, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call102 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !6 %tobool.not103 = icmp eq i32 %0, 0 br i1 %tobool.not103, label %for.end78, label %for.body for.body: ; preds = %entry, %for.end76 %1 = phi i32 [ %23, %for.end76 ], [ %0, %entry ] tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(804) @dp, i8 0, i64 804, i1 false) store i32 0, ptr @i, align 4, !tbaa !6 %cmp87 = icmp sgt i32 %1, 0 br i1 %cmp87, label %for.body2, label %for.end for.body2: ; preds = %for.body, %for.body2 %storemerge88 = phi i32 [ %inc, %for.body2 ], [ 0, %for.body ] %idxprom = sext i32 %storemerge88 to i64 %arrayidx = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %idxprom %h = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %idxprom, i32 1 %call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %arrayidx) %2 = load i32, ptr @i, align 4, !tbaa !6 %inc = add nsw i32 %2, 1 store i32 %inc, ptr @i, align 4, !tbaa !6 %3 = load i32, ptr @n, align 4, !tbaa !6 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body2, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body2, %for.body %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m) %4 = load i32, ptr @i, align 4, !tbaa !6 %5 = load i32, ptr @n, align 4, !tbaa !6 %sub89 = sub nsw i32 %4, %5 %6 = load i32, ptr @m, align 4, !tbaa !6 %cmp890 = icmp slt i32 %sub89, %6 br i1 %cmp890, label %for.body9, label %for.end19 for.body9: ; preds = %for.end, %for.body9 %7 = phi i32 [ %inc18, %for.body9 ], [ %4, %for.end ] %idxprom10 = sext i32 %7 to i64 %arrayidx11 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %idxprom10 %h12 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %idxprom10, i32 1 %call16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h12, ptr noundef nonnull %arrayidx11) %8 = load i32, ptr @i, align 4, !tbaa !6 %inc18 = add nsw i32 %8, 1 store i32 %inc18, ptr @i, align 4, !tbaa !6 %9 = load i32, ptr @n, align 4, !tbaa !6 %sub = sub nsw i32 %inc18, %9 %10 = load i32, ptr @m, align 4, !tbaa !6 %cmp8 = icmp slt i32 %sub, %10 br i1 %cmp8, label %for.body9, label %for.end19, !llvm.loop !13 for.end19: ; preds = %for.body9, %for.end %.lcssa86 = phi i32 [ %5, %for.end ], [ %9, %for.body9 ] %.lcssa = phi i32 [ %6, %for.end ], [ %10, %for.body9 ] %add = add nsw i32 %.lcssa, %.lcssa86 %conv = sext i32 %add to i64 tail call void @qsort(ptr noundef nonnull @ds, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @c) #6 store i32 0, ptr @t, align 4, !tbaa !6 %11 = load i32, ptr @n, align 4, !tbaa !6 %12 = load i32, ptr @m, align 4, !tbaa !6 %add21 = add nsw i32 %12, %11 %cmp2297 = icmp sgt i32 %add21, 0 br i1 %cmp2297, label %for.body24.preheader, label %for.end76 for.body24.preheader: ; preds = %for.end19 %wide.trip.count110 = zext i32 %add21 to i64 br label %for.body24 for.body24: ; preds = %for.body24.preheader, %for.end63 %indvars.iv107 = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next108, %for.end63 ] %.9698 = phi i32 [ 0, %for.body24.preheader ], [ %., %for.end63 ] %arrayidx26 = getelementptr inbounds [201 x i32], ptr @dp, i64 0, i64 %indvars.iv107 store i32 1, ptr %arrayidx26, align 4, !tbaa !6 %cmp2893.not = icmp eq i64 %indvars.iv107, 0 br i1 %cmp2893.not, label %for.end63, label %for.body30.lr.ph for.body30.lr.ph: ; preds = %for.body24 %arrayidx35 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %indvars.iv107 %13 = load i32, ptr %arrayidx35, align 8, !tbaa !14 %h44 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %indvars.iv107, i32 1 br label %for.body30 for.body30: ; preds = %for.body30.lr.ph, %for.inc61 %14 = phi i32 [ 1, %for.body30.lr.ph ], [ %19, %for.inc61 ] %indvars.iv = phi i64 [ 0, %for.body30.lr.ph ], [ %indvars.iv.next, %for.inc61 ] %arrayidx32 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %indvars.iv %15 = load i32, ptr %arrayidx32, align 8, !tbaa !14 %cmp37 = icmp slt i32 %15, %13 br i1 %cmp37, label %land.lhs.true, label %for.inc61 land.lhs.true: ; preds = %for.body30 %h41 = getelementptr inbounds [200 x %struct.d], ptr @ds, i64 0, i64 %indvars.iv, i32 1 %16 = load i32, ptr %h41, align 4, !tbaa !16 %17 = load i32, ptr %h44, align 4, !tbaa !16 %cmp45 = icmp slt i32 %16, %17 br i1 %cmp45, label %if.then, label %for.inc61 if.then: ; preds = %land.lhs.true %arrayidx50 = getelementptr inbounds [201 x i32], ptr @dp, i64 0, i64 %indvars.iv %18 = load i32, ptr %arrayidx50, align 4, !tbaa !6 %cmp52.not = icmp sgt i32 %14, %18 %add51 = add nsw i32 %18, 1 %cond = select i1 %cmp52.not, i32 %14, i32 %add51 store i32 %cond, ptr %arrayidx26, align 4, !tbaa !6 br label %for.inc61 for.inc61: ; preds = %for.body30, %land.lhs.true, %if.then %19 = phi i32 [ %14, %for.body30 ], [ %14, %land.lhs.true ], [ %cond, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv107 br i1 %exitcond.not, label %for.end63.loopexit, label %for.body30, !llvm.loop !17 for.end63.loopexit: ; preds = %for.inc61 %20 = trunc i64 %indvars.iv107 to i32 br label %for.end63 for.end63: ; preds = %for.end63.loopexit, %for.body24 %21 = phi i32 [ 1, %for.body24 ], [ %19, %for.end63.loopexit ] %inc62.lcssa101 = phi i32 [ 0, %for.body24 ], [ %20, %for.end63.loopexit ] %. = tail call i32 @llvm.smax.i32(i32 %.9698, i32 %21) %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110 br i1 %exitcond111.not, label %for.cond20.for.end76_crit_edge, label %for.body24, !llvm.loop !18 for.cond20.for.end76_crit_edge: ; preds = %for.end63 store i32 %inc62.lcssa101, ptr @j, align 4, !tbaa !6 store i32 %., ptr @t, align 4, !tbaa !6 br label %for.end76 for.end76: ; preds = %for.cond20.for.end76_crit_edge, %for.end19 %22 = phi i32 [ %., %for.cond20.for.end76_crit_edge ], [ 0, %for.end19 ] %storemerge85.lcssa = phi i32 [ %add21, %for.cond20.for.end76_crit_edge ], [ 0, %for.end19 ] store i32 %storemerge85.lcssa, ptr @i, align 4, !tbaa !6 %call77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %23 = load i32, ptr @n, align 4, !tbaa !6 %tobool.not = icmp eq i32 %23, 0 br i1 %tobool.not, label %for.end78, label %for.body, !llvm.loop !19 for.end78: ; preds = %for.end76, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i64 0, i64 4, !6, i64 4, i64 4, !6} !6 = !{!7, !7, i64 0} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{i64 0, i64 4, !6} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = !{!15, !7, i64 0} !15 = !{!"d", !7, i64 0, !7, i64 4} !16 = !{!15, !7, i64 4} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12}
#include <stdio.h> #include <math.h> #include <stdlib.h> int main(void) { long int n; long int fk=0; int mc=0,i,j,k,tl=0,x; int a[100]; scanf("%lu",&n); //3141592653589793 //printf("n%lu\n",n); k=floor(log10(n))+1; //printf("k%d\n",k); for(i=k;i>=1;i--){ a[i]=floor((n-fk)/pow(10,i-1)); //printf("ai%d\n",a[i]); x=tl+a[i]-1+9*(i-1); if (x>mc) mc=x; tl+=a[i]; fk+=a[i]*pow(10,i-1); } if(tl>mc){mc=tl;} printf("%d\n",mc); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295643/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295643/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%lu\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 i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %conv = sitofp i64 %0 to double %call1 = call double @log10(double noundef %conv) #6 %1 = call double @llvm.floor.f64(double %call1) %add = fadd double %1, 1.000000e+00 %conv2 = fptosi double %add to i32 %cmp50 = icmp sgt i32 %conv2, 0 br i1 %cmp50, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %fk.054 = phi i64 [ %conv28, %for.body ], [ 0, %entry ] %tl.053 = phi i32 [ %add11, %for.body ], [ 0, %entry ] %mc.052 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %i.051 = phi i32 [ %sub5, %for.body ], [ %conv2, %entry ] %2 = load i64, ptr %n, align 8, !tbaa !5 %sub = sub nsw i64 %2, %fk.054 %conv4 = sitofp i64 %sub to double %sub5 = add nsw i32 %i.051, -1 %conv6 = sitofp i32 %sub5 to double %call7 = call double @pow(double noundef 1.000000e+01, double noundef %conv6) #6 %div = fdiv double %conv4, %call7 %3 = call double @llvm.floor.f64(double %div) %conv8 = fptosi double %3 to i32 %add11 = add nsw i32 %tl.053, %conv8 %mul = mul nsw i32 %sub5, 9 %sub12 = add i32 %mul, -1 %add14 = add i32 %sub12, %add11 %spec.select = call i32 @llvm.smax.i32(i32 %add14, i32 %mc.052) %conv22 = sitofp i32 %conv8 to double %call25 = call double @pow(double noundef 1.000000e+01, double noundef %conv6) #6 %conv27 = sitofp i64 %fk.054 to double %4 = call double @llvm.fmuladd.f64(double %conv22, double %call25, double %conv27) %conv28 = fptosi double %4 to i64 %cmp = icmp ugt i32 %i.051, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %mc.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %tl.0.lcssa = phi i32 [ 0, %entry ], [ %add11, %for.body ] %spec.select49 = call i32 @llvm.smax.i32(i32 %tl.0.lcssa, i32 %mc.0.lcssa) %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select49) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @log10(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.floor.f64(double) #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<string.h> int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int main(void) { int k,n[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}; scanf("%d",&k); printf("%d",n[k-1]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_295687/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_295687/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.n = private unnamed_addr constant [32 x i32] [i32 1, i32 1, i32 1, i32 2, i32 1, i32 2, i32 1, i32 5, i32 2, i32 2, i32 1, i32 5, i32 1, i32 2, i32 1, i32 14, i32 1, i32 5, i32 1, i32 5, i32 2, i32 2, i32 1, i32 15, i32 2, i32 2, i32 5, i32 4, i32 1, i32 4, i32 1, i32 51], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [32 x i32], ptr @__const.main.n, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { 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,w; int i,j; while (1){ scanf("%d %d", &h, &w); if(h==0 && w==0){ break; } for(i=0;i<h;i++){ for(j=0;j<w;j++){ if(j==0 || j==w-1 || i==0 || i==h-1){ printf("#"); } else{ printf("."); } } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100017/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp39 = icmp eq i32 %0, 0 %1 = load i32, ptr %w, align 4 %cmp140 = icmp eq i32 %1, 0 %or.cond41 = select i1 %cmp39, i1 %cmp140, i1 false br i1 %or.cond41, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %10, %for.end20 ], [ %0, %entry ] %cmp235 = icmp sgt i32 %2, 0 br i1 %cmp235, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.036 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp432 = icmp sgt i32 %3, 0 br i1 %cmp432, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp9 = icmp eq i32 %i.036, 0 br i1 %cmp9, label %for.body5.us, label %for.inc.peel for.inc.peel: ; preds = %for.body5.lr.ph %putchar31.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %w, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %.pre, 1 br i1 %cmp4.peel, label %for.body5, label %for.end for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.033.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.033.us, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.inc.peel, %for.body5 %5 = phi i32 [ %8, %for.body5 ], [ %.pre, %for.inc.peel ] %j.033 = phi i32 [ %inc, %for.body5 ], [ 1, %for.inc.peel ] %sub = add nsw i32 %5, -1 %cmp7 = icmp eq i32 %j.033, %sub %6 = load i32, ptr %h, align 4 %sub11 = add nsw i32 %6, -1 %cmp12 = icmp eq i32 %i.036, %sub11 %7 = select i1 %cmp7, i1 true, i1 %cmp12 %.sink = select i1 %7, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.033, 1 %8 = load i32, ptr %w, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %8 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body5, %for.body5.us, %for.inc.peel, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.036, 1 %9 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %9 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !13 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %10 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 %11 = load i32, ptr %w, align 4 %cmp1 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void) { int h, w, i, j; int a = 0; while(a == 0){ scanf("%d", &h); scanf("%d", &w); if(h == 0) break; for(i = 0; i < h; i++){ for(j = 0; j < w; j++){ if(i == 0 || i == h-1 || j == 0 || j == w-1) printf("#"); else printf("."); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100060/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: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %call140 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp241 = icmp eq i32 %0, 0 br i1 %cmp241, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end21 %1 = phi i32 [ %8, %for.end21 ], [ %0, %entry ] %cmp336 = icmp sgt i32 %1, 0 br i1 %cmp336, label %for.cond4.preheader, label %for.end21 for.cond4.preheader: ; preds = %for.cond.preheader, %for.end %i.037 = phi i32 [ %inc20, %for.end ], [ 0, %for.cond.preheader ] %2 = load i32, ptr %w, align 4, !tbaa !5 %cmp533 = icmp sgt i32 %2, 0 br i1 %cmp533, label %for.body6.lr.ph, label %for.end for.body6.lr.ph: ; preds = %for.cond4.preheader %cmp7 = icmp eq i32 %i.037, 0 br i1 %cmp7, label %for.body6.us, label %for.body6 for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %j.034.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp5.us = icmp slt i32 %inc.us, %3 br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9 for.body6: ; preds = %for.body6.lr.ph, %for.body6 %4 = phi i32 [ %6, %for.body6 ], [ %2, %for.body6.lr.ph ] %j.034 = phi i32 [ %inc, %for.body6 ], [ 0, %for.body6.lr.ph ] %5 = load i32, ptr %h, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %cmp8 = icmp eq i32 %i.037, %sub %cmp10 = icmp eq i32 %j.034, 0 %or.cond = or i1 %cmp10, %cmp8 %sub12 = add nsw i32 %4, -1 %cmp13 = icmp eq i32 %j.034, %sub12 %or.cond32 = select i1 %or.cond, i1 true, i1 %cmp13 %. = select i1 %or.cond32, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.034, 1 %6 = load i32, ptr %w, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %6 br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body6, %for.body6.us, %for.cond4.preheader %putchar29 = call i32 @putchar(i32 10) %inc20 = add nuw nsw i32 %i.037, 1 %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc20, %7 br i1 %cmp3, label %for.cond4.preheader, label %for.end21, !llvm.loop !11 for.end21: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %8 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp eq i32 %8, 0 br i1 %cmp2, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void){ int height,width; while(1){ int i,j; scanf("%d %d",&height,&width); if(!height&&!width) break; for(i=0;i<height;i++){ for(j=0;j<width;j++){ if(i==0||i==height-1||j==0||j==width-1) printf("#"); else printf("."); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100110/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100110/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %height = alloca i32, align 4 %width = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #4 %call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width) %0 = load i32, ptr %height, align 4, !tbaa !5 %tobool44 = icmp ne i32 %0, 0 %1 = load i32, ptr %width, align 4 %tobool145 = icmp ne i32 %1, 0 %or.cond46 = select i1 %tobool44, i1 true, i1 %tobool145 br i1 %or.cond46, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %cleanup %2 = phi i32 [ %9, %cleanup ], [ %0, %entry ] %cmp40 = icmp sgt i32 %2, 0 br i1 %cmp40, label %for.cond2.preheader, label %cleanup for.cond2.preheader: ; preds = %for.cond.preheader, %for.end %i.041 = phi i32 [ %inc18, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %width, align 4, !tbaa !5 %cmp337 = icmp sgt i32 %3, 0 br i1 %cmp337, label %for.body4.lr.ph, label %for.end for.body4.lr.ph: ; preds = %for.cond2.preheader %cmp5 = icmp eq i32 %i.041, 0 br i1 %cmp5, label %for.body4.us, label %for.body4 for.body4.us: ; preds = %for.body4.lr.ph, %for.body4.us %j.038.us = phi i32 [ %inc.us, %for.body4.us ], [ 0, %for.body4.lr.ph ] %putchar33.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.038.us, 1 %4 = load i32, ptr %width, align 4, !tbaa !5 %cmp3.us = icmp slt i32 %inc.us, %4 br i1 %cmp3.us, label %for.body4.us, label %for.end, !llvm.loop !9 for.body4: ; preds = %for.body4.lr.ph, %for.body4 %5 = phi i32 [ %7, %for.body4 ], [ %3, %for.body4.lr.ph ] %j.038 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body4.lr.ph ] %6 = load i32, ptr %height, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp6 = icmp eq i32 %i.041, %sub %cmp8 = icmp eq i32 %j.038, 0 %or.cond24 = or i1 %cmp8, %cmp6 %sub10 = add nsw i32 %5, -1 %cmp11 = icmp eq i32 %j.038, %sub10 %or.cond34 = select i1 %or.cond24, i1 true, i1 %cmp11 %. = select i1 %or.cond34, i32 35, i32 46 %putchar33 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.038, 1 %7 = load i32, ptr %width, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %7 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body4, %for.body4.us, %for.cond2.preheader %putchar31 = call i32 @putchar(i32 10) %inc18 = add nuw nsw i32 %i.041, 1 %8 = load i32, ptr %height, align 4, !tbaa !5 %cmp = icmp slt i32 %inc18, %8 br i1 %cmp, label %for.cond2.preheader, label %cleanup, !llvm.loop !11 cleanup: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width) %9 = load i32, ptr %height, align 4, !tbaa !5 %tobool = icmp ne i32 %9, 0 %10 = load i32, ptr %width, align 4 %tobool1 = icmp ne i32 %10, 0 %or.cond = select i1 %tobool, i1 true, i1 %tobool1 br i1 %or.cond, label %for.cond.preheader, label %while.end while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(){ int H,W,i,j; while(1){ scanf("%d %d",&H,&W); if(H==0&&W==0){ break; } for(i=0; i<H; i++){ for(j=0; j<W; j++){ if(i==0||j==0||j==W-1||i==H-1) printf("#"); else printf("."); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100161/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp39 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp140 = icmp eq i32 %1, 0 %or.cond41 = select i1 %cmp39, i1 %cmp140, i1 false br i1 %or.cond41, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %10, %for.end20 ], [ %0, %entry ] %cmp235 = icmp sgt i32 %2, 0 br i1 %cmp235, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.036 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %3, 0 br i1 %cmp433, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.036, 0 br i1 %cmp6, label %for.body5.us, label %for.inc.peel for.inc.peel: ; preds = %for.body5.lr.ph %putchar31.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %W, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %.pre, 1 br i1 %cmp4.peel, label %for.body5, label %for.end for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.inc.peel, %for.body5 %5 = phi i32 [ %8, %for.body5 ], [ %.pre, %for.inc.peel ] %j.034 = phi i32 [ %inc, %for.body5 ], [ 1, %for.inc.peel ] %sub = add nsw i32 %5, -1 %cmp9 = icmp eq i32 %j.034, %sub %6 = load i32, ptr %H, align 4 %sub11 = add nsw i32 %6, -1 %cmp12 = icmp eq i32 %i.036, %sub11 %7 = select i1 %cmp9, i1 true, i1 %cmp12 %.sink = select i1 %7, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.034, 1 %8 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %8 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body5, %for.body5.us, %for.inc.peel, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.036, 1 %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %9 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !13 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %10 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 %11 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include <stdio.h> #include <math.h> int main(){ int w, h; int i, j; while (1){ scanf("%d %d", &h ,&w); if (w == 0 && h == 0) break; for (i = 0;i < h; i++){ printf("#"); for (j = 0; j < w-2; j++){ if (i == 0 || i == h - 1){ printf("#"); }else{ printf("."); } } printf("#\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100204/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100204/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 = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca i32, align 4 %h = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %cmp33 = icmp eq i32 %0, 0 %1 = load i32, ptr %h, align 4 %cmp134 = icmp eq i32 %1, 0 %or.cond35 = select i1 %cmp33, i1 %cmp134, i1 false br i1 %or.cond35, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end17 %2 = phi i32 [ %9, %for.end17 ], [ %1, %entry ] %cmp229 = icmp sgt i32 %2, 0 br i1 %cmp229, label %for.body, label %for.end17 for.body: ; preds = %for.cond.preheader, %for.end %i.030 = phi i32 [ %inc16, %for.end ], [ 0, %for.cond.preheader ] %putchar23 = call i32 @putchar(i32 35) %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp527 = icmp sgt i32 %3, 2 br i1 %cmp527, label %for.body6.lr.ph, label %for.end for.body6.lr.ph: ; preds = %for.body %cmp7 = icmp eq i32 %i.030, 0 br i1 %cmp7, label %for.body6.us, label %for.body6 for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %j.028.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar25.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.028.us, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %sub.us = add nsw i32 %4, -2 %cmp5.us = icmp slt i32 %inc.us, %sub.us br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9 for.body6: ; preds = %for.body6.lr.ph, %for.body6 %j.028 = phi i32 [ %inc, %for.body6 ], [ 0, %for.body6.lr.ph ] %5 = load i32, ptr %h, align 4, !tbaa !5 %sub8 = add nsw i32 %5, -1 %cmp9 = icmp eq i32 %i.030, %sub8 %. = select i1 %cmp9, i32 35, i32 46 %putchar25 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.028, 1 %6 = load i32, ptr %w, align 4, !tbaa !5 %sub = add nsw i32 %6, -2 %cmp5 = icmp slt i32 %inc, %sub br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body6, %for.body6.us, %for.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %inc16 = add nuw nsw i32 %i.030, 1 %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc16, %7 br i1 %cmp2, label %for.body, label %for.end17, !llvm.loop !11 for.end17: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %8 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp eq i32 %8, 0 %9 = load i32, ptr %h, align 4 %cmp1 = icmp eq i32 %9, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end17, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> int main(){ int H,W,i,j; while(1){ scanf("%d %d",&H,&W); if(H ==0 && W==0){ break; } for (i = 0; i < H; i++) { for (j = 0; j < W; j++) { if((i == 0 || i==H-1) || (j ==0 || j == W-1) ){ printf("#"); }else{ printf("."); } } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100248/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100248/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp40 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp141 = icmp eq i32 %1, 0 %or.cond42 = select i1 %cmp40, i1 %cmp141, i1 false br i1 %or.cond42, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %9, %for.end20 ], [ %0, %entry ] %cmp236 = icmp sgt i32 %2, 0 br i1 %cmp236, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.037 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %3, 0 br i1 %cmp433, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.037, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.034 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp7 = icmp eq i32 %i.037, %sub %cmp9 = icmp eq i32 %j.034, 0 %or.cond22 = or i1 %cmp9, %cmp7 %sub11 = add nsw i32 %5, -1 %cmp12 = icmp eq i32 %j.034, %sub11 %or.cond32 = select i1 %or.cond22, i1 true, i1 %cmp12 %. = select i1 %or.cond32, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.034, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.037, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !11 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int H,W,x,y; while(1){ scanf("%d %d",&H,&W); if(H == 0 && W ==0) break; for(y=0; y<H;y++){ for(x=0; x<W; x++){ if(x ==0 || y == 0 || x == W-1 ||y == H-1){ printf("#"); }else{ printf("."); } } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100291/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100291/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp39 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp140 = icmp eq i32 %1, 0 %or.cond41 = select i1 %cmp39, i1 %cmp140, i1 false br i1 %or.cond41, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %10, %for.end20 ], [ %0, %entry ] %cmp235 = icmp sgt i32 %2, 0 br i1 %cmp235, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %y.036 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %3, 0 br i1 %cmp433, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp7 = icmp eq i32 %y.036, 0 br i1 %cmp7, label %for.body5.us, label %for.inc.peel for.inc.peel: ; preds = %for.body5.lr.ph %putchar31.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %W, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %.pre, 1 br i1 %cmp4.peel, label %for.body5, label %for.end for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %x.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %x.034.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.inc.peel, %for.body5 %5 = phi i32 [ %8, %for.body5 ], [ %.pre, %for.inc.peel ] %x.034 = phi i32 [ %inc, %for.body5 ], [ 1, %for.inc.peel ] %sub = add nsw i32 %5, -1 %cmp9 = icmp eq i32 %x.034, %sub %6 = load i32, ptr %H, align 4 %sub11 = add nsw i32 %6, -1 %cmp12 = icmp eq i32 %y.036, %sub11 %7 = select i1 %cmp9, i1 true, i1 %cmp12 %.sink = select i1 %7, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %x.034, 1 %8 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %8 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body5, %for.body5.us, %for.inc.peel, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %y.036, 1 %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %9 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !13 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %10 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 %11 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int H, W, i, j; while(1) { scanf("%d %d", &H, &W); if(H == 0 && W == 0)break; for(i=0; i<H; i++) { for(j=0; j<W; j++) { if(i == 0 || i == H-1 || j == 0 || j == W-1) { printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100341/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp40 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp141 = icmp eq i32 %1, 0 %or.cond42 = select i1 %cmp40, i1 %cmp141, i1 false br i1 %or.cond42, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %9, %for.end20 ], [ %0, %entry ] %cmp236 = icmp sgt i32 %2, 0 br i1 %cmp236, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.037 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %3, 0 br i1 %cmp433, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.037, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.034 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp7 = icmp eq i32 %i.037, %sub %cmp9 = icmp eq i32 %j.034, 0 %or.cond22 = or i1 %cmp9, %cmp7 %sub11 = add nsw i32 %5, -1 %cmp12 = icmp eq i32 %j.034, %sub11 %or.cond32 = select i1 %or.cond22, i1 true, i1 %cmp12 %. = select i1 %or.cond32, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.034, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.037, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !11 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { for (;;) { int w, h; scanf("%d %d", &h, &w); if (w == 0 && h == 0) break; int x, y; int is_edge; for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { is_edge = x == 0 || x == w-1 || y == 0 || y ==h-1; printf("%c", is_edge ? '#' : '.'); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100385/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca i32, align 4 %h = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %cmp40 = icmp eq i32 %0, 0 %1 = load i32, ptr %h, align 4 %cmp141 = icmp eq i32 %1, 0 %or.cond42 = select i1 %cmp40, i1 %cmp141, i1 false br i1 %or.cond42, label %for.end20, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %cleanup %2 = phi i32 [ %12, %cleanup ], [ %1, %entry ] %cmp336 = icmp sgt i32 %2, 0 br i1 %cmp336, label %for.cond4.preheader, label %cleanup for.cond4.preheader: ; preds = %for.cond2.preheader, %for.end %y.037 = phi i32 [ %inc16, %for.end ], [ 0, %for.cond2.preheader ] %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp533 = icmp sgt i32 %3, 0 br i1 %cmp533, label %for.body6.lr.ph, label %for.end for.body6.lr.ph: ; preds = %for.cond4.preheader %cmp10 = icmp eq i32 %y.037, 0 br i1 %cmp10, label %for.body6.us, label %for.cond4.peel for.cond4.peel: ; preds = %for.body6.lr.ph %putchar29.peel = call i32 @putchar(i32 35) %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp5.peel = icmp sgt i32 %4, 1 br i1 %cmp5.peel, label %for.body6, label %for.end for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %x.034.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar29.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %x.034.us, 1 %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp5.us = icmp slt i32 %inc.us, %5 br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9 for.body6: ; preds = %for.cond4.peel, %for.cond4 %6 = phi i32 [ %9, %for.cond4 ], [ %4, %for.cond4.peel ] %x.034 = phi i32 [ %inc, %for.cond4 ], [ 1, %for.cond4.peel ] %sub = add nsw i32 %6, -1 %cmp8 = icmp eq i32 %x.034, %sub br i1 %cmp8, label %lor.end.thread, label %lor.end lor.end: ; preds = %for.body6 %7 = load i32, ptr %h, align 4, !tbaa !5 %sub11 = add nsw i32 %7, -1 %cmp12 = icmp eq i32 %y.037, %sub11 %cond.fr = freeze i1 %cmp12 br i1 %cond.fr, label %lor.end.thread, label %for.cond4 lor.end.thread: ; preds = %for.body6, %lor.end br label %for.cond4 for.cond4: ; preds = %lor.end, %lor.end.thread %8 = phi i32 [ 35, %lor.end.thread ], [ 46, %lor.end ] %putchar29 = call i32 @putchar(i32 %8) %inc = add nuw nsw i32 %x.034, 1 %9 = load i32, ptr %w, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %9 br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !11 for.end: ; preds = %for.cond4, %for.body6.us, %for.cond4.peel, %for.cond4.preheader %putchar28 = call i32 @putchar(i32 10) %inc16 = add nuw nsw i32 %y.037, 1 %10 = load i32, ptr %h, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc16, %10 br i1 %cmp3, label %for.cond4.preheader, label %cleanup, !llvm.loop !13 cleanup: ; preds = %for.end, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %11 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp eq i32 %11, 0 %12 = load i32, ptr %h, align 4 %cmp1 = icmp eq i32 %12, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %for.end20, label %for.cond2.preheader for.end20: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int H, W, i, j; while (1) { scanf("%d %d", &H, &W); if (H == 0 && W == 0) { break; } for (i = 0;i < H;i++) { for (j = 0;j < W;j++) { if (i==0||i==(H-1)||j==0||j==(W-1)){ printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100428/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp40 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp141 = icmp eq i32 %1, 0 %or.cond42 = select i1 %cmp40, i1 %cmp141, i1 false br i1 %or.cond42, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end20 %2 = phi i32 [ %9, %for.end20 ], [ %0, %entry ] %cmp236 = icmp sgt i32 %2, 0 br i1 %cmp236, label %for.cond3.preheader, label %for.end20 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.037 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %3, 0 br i1 %cmp433, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.037, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.034.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar31.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.034 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp7 = icmp eq i32 %i.037, %sub %cmp9 = icmp eq i32 %j.034, 0 %or.cond22 = or i1 %cmp9, %cmp7 %sub11 = add nsw i32 %5, -1 %cmp12 = icmp eq i32 %j.034, %sub11 %or.cond32 = select i1 %or.cond22, i1 true, i1 %cmp12 %. = select i1 %or.cond32, i32 35, i32 46 %putchar31 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.034, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar29 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.037, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.end20, !llvm.loop !11 for.end20: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> void mkwall(int x, int y, int h, int w); int main() { for (;;) { int h, w, x, y; scanf("%d %d", &h, &w); if (h == 0 & w == 0) { return 0; } for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { mkwall(x + 1, y + 1, h, w); } printf("\n"); } printf("\n"); } } void mkwall(int x, int y, int h, int w) { if (x == 1 | x == w | y == 1 | y == h) { printf("#"); } else { printf("."); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100514/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100514/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %2 = or i32 %1, %0 %and23.not31 = icmp eq i32 %2, 0 br i1 %and23.not31, label %cleanup.thread, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry, %cleanup %3 = phi i32 [ %10, %cleanup ], [ %0, %entry ] %cmp428 = icmp sgt i32 %3, 0 br i1 %cmp428, label %for.cond6.preheader, label %cleanup cleanup.thread: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 for.cond6.preheader: ; preds = %for.cond3.preheader, %for.end %y.029 = phi i32 [ %add10, %for.end ], [ 0, %for.cond3.preheader ] %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp726 = icmp sgt i32 %4, 0 %add10 = add nuw nsw i32 %y.029, 1 br i1 %cmp726, label %for.body9.lr.ph, label %for.end for.body9.lr.ph: ; preds = %for.cond6.preheader %cmp3.i = icmp eq i32 %y.029, 0 br i1 %cmp3.i, label %for.body9.us, label %for.body9 for.body9.us: ; preds = %for.body9.lr.ph, %for.body9.us %x.027.us = phi i32 [ %add.us, %for.body9.us ], [ 0, %for.body9.lr.ph ] %add.us = add nuw nsw i32 %x.027.us, 1 %putchar.i.us = call i32 @putchar(i32 35) %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp7.us = icmp slt i32 %add.us, %5 br i1 %cmp7.us, label %for.body9.us, label %for.end, !llvm.loop !9 for.body9: ; preds = %for.body9.lr.ph, %for.body9 %6 = phi i32 [ %8, %for.body9 ], [ %4, %for.body9.lr.ph ] %x.027 = phi i32 [ %add, %for.body9 ], [ 0, %for.body9.lr.ph ] %add = add nuw nsw i32 %x.027, 1 %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp.i = icmp eq i32 %x.027, 0 %cmp1.i = icmp eq i32 %add, %6 %or12.i = or i1 %cmp.i, %cmp1.i %cmp6.i = icmp eq i32 %add10, %7 %or814.i = or i1 %or12.i, %cmp6.i %spec.select = select i1 %or814.i, i32 35, i32 46 %putchar.i = call i32 @putchar(i32 %spec.select) %8 = load i32, ptr %w, align 4, !tbaa !5 %cmp7 = icmp slt i32 %add, %8 br i1 %cmp7, label %for.body9, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body9, %for.body9.us, %for.cond6.preheader %putchar24 = call i32 @putchar(i32 10) %9 = load i32, ptr %h, align 4, !tbaa !5 %cmp4 = icmp slt i32 %add10, %9 br i1 %cmp4, label %for.cond6.preheader, label %cleanup, !llvm.loop !11 cleanup: ; preds = %for.end, %for.cond3.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %10 = load i32, ptr %h, align 4, !tbaa !5 %11 = load i32, ptr %w, align 4, !tbaa !5 %12 = or i32 %11, %10 %and23.not = icmp eq i32 %12, 0 br i1 %and23.not, label %cleanup.thread, label %for.cond3.preheader } ; 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 uwtable define dso_local void @mkwall(i32 noundef %x, i32 noundef %y, i32 noundef %h, i32 noundef %w) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %x, 1 %cmp1 = icmp eq i32 %x, %w %or12 = or i1 %cmp, %cmp1 %cmp3 = icmp eq i32 %y, 1 %or513 = or i1 %cmp3, %or12 %cmp6 = icmp eq i32 %y, %h %or814 = or i1 %cmp6, %or513 %. = select i1 %or814, i32 35, i32 46 %putchar = tail call i32 @putchar(i32 %.) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int H=0,W=0,i,j; for (; ; ) { scanf("%d %d",&H,&W); if (H==0&&W==0) break; for (i=0; i<H; i++) { for (j=0; j<W; j++) { if (i==0) printf("#"); else if (j==0) printf("#"); else if(i==(H-1)) printf("#"); else if (j==(W-1)) printf("#"); else printf("."); }printf("\n"); }printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100558/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100558/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 store i32 0, ptr %H, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 store i32 0, ptr %W, align 4, !tbaa !5 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp52 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp153 = icmp eq i32 %1, 0 %or.cond54 = select i1 %cmp52, i1 %cmp153, i1 false br i1 %or.cond54, label %for.end33, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.end31 %2 = phi i32 [ %10, %for.end31 ], [ %0, %entry ] %cmp348 = icmp sgt i32 %2, 0 br i1 %cmp348, label %for.cond4.preheader, label %for.end31 for.cond4.preheader: ; preds = %for.cond2.preheader, %for.end %i.049 = phi i32 [ %inc30, %for.end ], [ 0, %for.cond2.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp546 = icmp sgt i32 %3, 0 br i1 %cmp546, label %for.body6.lr.ph, label %for.end for.body6.lr.ph: ; preds = %for.cond4.preheader %cmp7 = icmp eq i32 %i.049, 0 br i1 %cmp7, label %for.body6.us, label %for.inc.peel for.inc.peel: ; preds = %for.body6.lr.ph %putchar44.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %W, align 4, !tbaa !5 %cmp5.peel = icmp sgt i32 %.pre, 1 br i1 %cmp5.peel, label %if.else13, label %for.end for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %j.047.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar45.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.047.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp5.us = icmp slt i32 %inc.us, %4 br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9 if.else13: ; preds = %for.inc.peel, %if.else13 %5 = phi i32 [ %8, %if.else13 ], [ %.pre, %for.inc.peel ] %j.047 = phi i32 [ %inc, %if.else13 ], [ 1, %for.inc.peel ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp14 = icmp eq i32 %i.049, %sub %sub18 = add nsw i32 %5, -1 %cmp19 = icmp eq i32 %j.047, %sub18 %7 = select i1 %cmp14, i1 true, i1 %cmp19 %.sink = select i1 %7, i32 35, i32 46 %putchar43 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.047, 1 %8 = load i32, ptr %W, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %8 br i1 %cmp5, label %if.else13, label %for.end, !llvm.loop !11 for.end: ; preds = %if.else13, %for.body6.us, %for.inc.peel, %for.cond4.preheader %putchar40 = call i32 @putchar(i32 10) %inc30 = add nuw nsw i32 %i.049, 1 %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc30, %9 br i1 %cmp3, label %for.cond4.preheader, label %for.end31, !llvm.loop !13 for.end31: ; preds = %for.end, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %10 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 %11 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %for.end33, label %for.cond2.preheader for.end33: ; preds = %for.end31, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void){ int H,W,i,j,k,l; while(1){ scanf("%d %d",&H,&W); if(H == 0 && W == 0) break; for(i=0;i<W;i++){ printf("#"); } printf("\n"); for(j=0;j < H-2;j++){ printf("#"); for(k=0;k < W-2;k++){ printf("."); } printf("#"); printf("\n"); } for(l=0;l<W;l++){ printf("#"); } printf("\n\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100608/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100608/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 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp51 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp152 = icmp eq i32 %1, 0 %or.cond53 = select i1 %cmp51, i1 %cmp152, i1 false br i1 %or.cond53, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end28 %2 = phi i32 [ %11, %for.end28 ], [ %1, %entry ] %cmp240 = icmp sgt i32 %2, 0 br i1 %cmp240, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %i.041 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %putchar39 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %i.041, 1 %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %3 br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %4 = load i32, ptr %H, align 4, !tbaa !5 %cmp646 = icmp sgt i32 %4, 2 br i1 %cmp646, label %for.body7, label %for.cond22.preheader for.cond22.preheader: ; preds = %for.end16, %for.end %5 = load i32, ptr %W, align 4, !tbaa !5 %cmp2348 = icmp sgt i32 %5, 0 br i1 %cmp2348, label %for.body24, label %for.end28 for.body7: ; preds = %for.end, %for.end16 %j.047 = phi i32 [ %inc20, %for.end16 ], [ 0, %for.end ] %putchar35 = call i32 @putchar(i32 35) %6 = load i32, ptr %W, align 4, !tbaa !5 %cmp1143 = icmp sgt i32 %6, 2 br i1 %cmp1143, label %for.body12, label %for.end16 for.body12: ; preds = %for.body7, %for.body12 %k.044 = phi i32 [ %inc15, %for.body12 ], [ 0, %for.body7 ] %putchar38 = call i32 @putchar(i32 46) %inc15 = add nuw nsw i32 %k.044, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %sub10 = add nsw i32 %7, -2 %cmp11 = icmp slt i32 %inc15, %sub10 br i1 %cmp11, label %for.body12, label %for.end16, !llvm.loop !11 for.end16: ; preds = %for.body12, %for.body7 %putchar36 = call i32 @putchar(i32 35) %putchar37 = call i32 @putchar(i32 10) %inc20 = add nuw nsw i32 %j.047, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %8, -2 %cmp6 = icmp slt i32 %inc20, %sub br i1 %cmp6, label %for.body7, label %for.cond22.preheader, !llvm.loop !12 for.body24: ; preds = %for.cond22.preheader, %for.body24 %l.049 = phi i32 [ %inc27, %for.body24 ], [ 0, %for.cond22.preheader ] %putchar34 = call i32 @putchar(i32 35) %inc27 = add nuw nsw i32 %l.049, 1 %9 = load i32, ptr %W, align 4, !tbaa !5 %cmp23 = icmp slt i32 %inc27, %9 br i1 %cmp23, label %for.body24, label %for.end28, !llvm.loop !13 for.end28: ; preds = %for.body24, %for.cond22.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %10 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 %11 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end28, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void) { // ??°????????\???????????° int height, width; // ??????????????? while(1) { scanf("%d %d", &height, &width); if(height == 0 && width == 0) break; for(int line = 1; line <= height; line++) { if(line == 1 || line == height) { for(int column = 1; column <= width; column++) { if(column == width) { printf("#\n"); } else { printf("#"); } } } else { printf("#"); for(int column = 1; column <= width-2; column++) { printf("."); } printf("#\n"); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100673/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.5 = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %height = alloca i32, align 4 %width = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #4 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width) %0 = load i32, ptr %height, align 4, !tbaa !5 %cmp52 = icmp eq i32 %0, 0 %1 = load i32, ptr %width, align 4 %cmp153 = icmp eq i32 %1, 0 %or.cond54 = select i1 %cmp52, i1 %cmp153, i1 false br i1 %or.cond54, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %2 = phi i32 [ %3, %for.cond.cleanup ], [ %0, %entry ] %cmp2.not49 = icmp slt i32 %2, 1 br i1 %cmp2.not49, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.inc28, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width) %3 = load i32, ptr %height, align 4, !tbaa !5 %cmp = icmp eq i32 %3, 0 %4 = load i32, ptr %width, align 4 %cmp1 = icmp eq i32 %4, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader for.body: ; preds = %for.cond.preheader, %for.inc28 %5 = phi i32 [ %11, %for.inc28 ], [ %2, %for.cond.preheader ] %line.050 = phi i32 [ %inc29, %for.inc28 ], [ 1, %for.cond.preheader ] %cmp3 = icmp eq i32 %line.050, 1 %cmp4 = icmp eq i32 %line.050, %5 %or.cond43 = or i1 %cmp3, %cmp4 br i1 %or.cond43, label %for.cond6.preheader, label %if.else15 for.cond6.preheader: ; preds = %for.body %6 = load i32, ptr %width, align 4, !tbaa !5 %cmp7.not47 = icmp slt i32 %6, 1 br i1 %cmp7.not47, label %for.inc28, label %for.body9 for.body9: ; preds = %for.cond6.preheader, %for.inc %7 = phi i32 [ %8, %for.inc ], [ %6, %for.cond6.preheader ] %column.048 = phi i32 [ %inc, %for.inc ], [ 1, %for.cond6.preheader ] %cmp10 = icmp eq i32 %column.048, %7 br i1 %cmp10, label %if.then11, label %if.else if.then11: ; preds = %for.body9 %puts42 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %for.inc if.else: ; preds = %for.body9 %putchar41 = call i32 @putchar(i32 35) br label %for.inc for.inc: ; preds = %if.then11, %if.else %inc = add nuw nsw i32 %column.048, 1 %8 = load i32, ptr %width, align 4, !tbaa !5 %cmp7.not.not = icmp slt i32 %column.048, %8 br i1 %cmp7.not.not, label %for.body9, label %for.inc28, !llvm.loop !9 if.else15: ; preds = %for.body %putchar39 = call i32 @putchar(i32 35) %9 = load i32, ptr %width, align 4, !tbaa !5 %cmp19.not45 = icmp slt i32 %9, 3 br i1 %cmp19.not45, label %for.cond.cleanup20, label %for.body21 for.cond.cleanup20: ; preds = %for.body21, %if.else15 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %for.inc28 for.body21: ; preds = %if.else15, %for.body21 %column17.046 = phi i32 [ %inc24, %for.body21 ], [ 1, %if.else15 ] %putchar40 = call i32 @putchar(i32 46) %inc24 = add nuw nsw i32 %column17.046, 1 %10 = load i32, ptr %width, align 4, !tbaa !5 %sub = add nsw i32 %10, -2 %cmp19.not.not = icmp slt i32 %column17.046, %sub br i1 %cmp19.not.not, label %for.body21, label %for.cond.cleanup20, !llvm.loop !11 for.inc28: ; preds = %for.inc, %for.cond6.preheader, %for.cond.cleanup20 %inc29 = add nuw nsw i32 %line.050, 1 %11 = load i32, ptr %height, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %line.050, %11 br i1 %cmp2.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int h[1000]; int w[1000]; int num=0; int i,j,k; //input while(1){ scanf("%d %d",&h[num],&w[num]); // printf("%d %d\n",h[num],w[num]); if(h[num]==0&&w[num]==0) break; num++; } //output for(i=0;i<num;i++){ for(k=0;k<w[i];k++) printf("#"); printf("\n"); for(j=1;j<h[i]-1;j++){ printf("#"); for(k=1;k<w[i]-1;k++) printf("."); printf("#"); printf("\n"); } for(k=0;k<w[i];k++) printf("#"); printf("\n"); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100716/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca [1000 x i32], align 16 %w = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %w) #4 br label %while.cond while.cond: ; preds = %if.end, %entry %indvars.iv94 = phi i32 [ %indvars.iv.next95, %if.end ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %h, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1000 x i32], ptr %w, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %while.cond %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp7 = icmp eq i32 %1, 0 br i1 %cmp7, label %for.cond.preheader, label %if.end for.cond.preheader: ; preds = %land.lhs.true %2 = and i64 %indvars.iv, 4294967295 %cmp888.not = icmp eq i64 %2, 0 br i1 %cmp888.not, label %for.end51, label %for.cond9.preheader.preheader for.cond9.preheader.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv94 to i64 br label %for.cond9.preheader if.end: ; preds = %land.lhs.true, %while.cond %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next95 = add nuw i32 %indvars.iv94, 1 br label %while.cond for.cond9.preheader: ; preds = %for.cond9.preheader.preheader, %for.end46 %indvars.iv91 = phi i64 [ 0, %for.cond9.preheader.preheader ], [ %indvars.iv.next92, %for.end46 ] %arrayidx11 = getelementptr inbounds [1000 x i32], ptr %w, i64 0, i64 %indvars.iv91 %3 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp1277 = icmp sgt i32 %3, 0 br i1 %cmp1277, label %for.body13, label %for.end for.body13: ; preds = %for.cond9.preheader, %for.body13 %k.078 = phi i32 [ %inc15, %for.body13 ], [ 0, %for.cond9.preheader ] %putchar75 = call i32 @putchar(i32 35) %inc15 = add nuw nsw i32 %k.078, 1 %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc15, %4 br i1 %cmp12, label %for.body13, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body13, %for.cond9.preheader %putchar = call i32 @putchar(i32 10) %arrayidx19 = getelementptr inbounds [1000 x i32], ptr %h, i64 0, i64 %indvars.iv91 %5 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp2084 = icmp sgt i32 %5, 2 br i1 %cmp2084, label %for.body21, label %for.cond38.preheader for.cond38.preheader: ; preds = %for.end32, %for.end %6 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp4186 = icmp sgt i32 %6, 0 br i1 %cmp4186, label %for.body42, label %for.end46 for.body21: ; preds = %for.end, %for.end32 %j.085 = phi i32 [ %inc36, %for.end32 ], [ 1, %for.end ] %putchar71 = call i32 @putchar(i32 35) %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp2781 = icmp sgt i32 %7, 2 br i1 %cmp2781, label %for.body28, label %for.end32 for.body28: ; preds = %for.body21, %for.body28 %k.182 = phi i32 [ %inc31, %for.body28 ], [ 1, %for.body21 ] %putchar74 = call i32 @putchar(i32 46) %inc31 = add nuw nsw i32 %k.182, 1 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub26 = add nsw i32 %8, -1 %cmp27 = icmp slt i32 %inc31, %sub26 br i1 %cmp27, label %for.body28, label %for.end32, !llvm.loop !11 for.end32: ; preds = %for.body28, %for.body21 %putchar72 = call i32 @putchar(i32 35) %putchar73 = call i32 @putchar(i32 10) %inc36 = add nuw nsw i32 %j.085, 1 %9 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %sub = add nsw i32 %9, -1 %cmp20 = icmp slt i32 %inc36, %sub br i1 %cmp20, label %for.body21, label %for.cond38.preheader, !llvm.loop !12 for.body42: ; preds = %for.cond38.preheader, %for.body42 %k.287 = phi i32 [ %inc45, %for.body42 ], [ 0, %for.cond38.preheader ] %putchar70 = call i32 @putchar(i32 35) %inc45 = add nuw nsw i32 %k.287, 1 %10 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp41 = icmp slt i32 %inc45, %10 br i1 %cmp41, label %for.body42, label %for.end46, !llvm.loop !13 for.end46: ; preds = %for.body42, %for.cond38.preheader %putchar68 = call i32 @putchar(i32 10) %putchar69 = call i32 @putchar(i32 10) %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count br i1 %exitcond.not, label %for.end51, label %for.cond9.preheader, !llvm.loop !14 for.end51: ; preds = %for.end46, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main() { long long int a,b,c,c1,s1,s; scanf("%lld %lld %lld",&a,&b,&c); c1 = c*2; if(a==b) { s=a+b; } else if(b>a) { s=a+a+1; } else if(a>b) { s=b+b+1; } s1 = s+c1; printf("%lld",s1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10076/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 [15 x i8] c"%lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, 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 i64, ptr %c, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %2 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp eq i64 %1, %2 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i64 %1, 1 br label %if.end11 if.else: ; preds = %entry %cmp1 = icmp sgt i64 %2, %1 br i1 %cmp1, label %if.then2, label %if.else5 if.then2: ; preds = %if.else %add3 = shl nsw i64 %1, 1 %add4 = or i64 %add3, 1 br label %if.end11 if.else5: ; preds = %if.else %cmp6 = icmp sgt i64 %1, %2 br i1 %cmp6, label %if.then7, label %if.end11 if.then7: ; preds = %if.else5 %add8 = shl nsw i64 %2, 1 %add9 = or i64 %add8, 1 br label %if.end11 if.end11: ; preds = %if.then2, %if.then7, %if.else5, %if.then %s.0 = phi i64 [ %add, %if.then ], [ %add4, %if.then2 ], [ %add9, %if.then7 ], [ undef, %if.else5 ] %mul = shl nsw i64 %0, 1 %add12 = add nsw i64 %s.0, %mul %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add12) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,i,j; while(1){ scanf("%d %d",&a,&b); if(a==b && a==0) break; for(i=0;i<a;i++){ for(j=0;j<b;j++){ if(i==0 || i==a-1){ printf("#"); }else{ if(j==0 || j==b-1){ printf("#"); }else{ printf("."); } } } printf("\n"); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100802/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = or i32 %1, %0 %or.cond43 = icmp eq i32 %2, 0 br i1 %or.cond43, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end23 %3 = phi i32 [ %12, %for.end23 ], [ %0, %entry ] %cmp239 = icmp sgt i32 %3, 0 br i1 %cmp239, label %for.cond3.preheader, label %for.end23 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.040 = phi i32 [ %inc22, %for.end ], [ 0, %for.cond.preheader ] %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp436 = icmp sgt i32 %4, 0 br i1 %cmp436, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.040, 0 br i1 %cmp6, label %for.body5.us, label %for.body5.preheader for.body5.preheader: ; preds = %for.body5.lr.ph %putchar34.peel = call i32 @putchar(i32 35) %5 = load i32, ptr %b, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %5, 1 br i1 %cmp4.peel, label %for.body5, label %for.end for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.037.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar34.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.037.us, 1 %6 = load i32, ptr %b, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %6 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.preheader, %for.body5 %7 = phi i32 [ %10, %for.body5 ], [ %5, %for.body5.preheader ] %j.037 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.preheader ] %8 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %cmp7 = icmp eq i32 %i.040, %sub %sub12 = add nsw i32 %7, -1 %cmp13 = icmp eq i32 %j.037, %sub12 %9 = select i1 %cmp7, i1 true, i1 %cmp13 %.sink = select i1 %9, i32 35, i32 46 %putchar34 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.037, 1 %10 = load i32, ptr %b, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %10 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body5, %for.body5.us, %for.body5.preheader, %for.cond3.preheader %putchar31 = call i32 @putchar(i32 10) %inc22 = add nuw nsw i32 %i.040, 1 %11 = load i32, ptr %a, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc22, %11 br i1 %cmp2, label %for.cond3.preheader, label %for.end23, !llvm.loop !13 for.end23: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %12 = load i32, ptr %a, align 4 %13 = load i32, ptr %b, align 4, !tbaa !5 %14 = or i32 %13, %12 %or.cond = icmp eq i32 %14, 0 br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end23, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void){ int i, j,H,W; while(scanf("%d %d",&H,&W)!=EOF){ if(H==0&&W==0){ break; } for ( i = 0; i < H; i++ ){ for ( j = 0; j < W; j++ ){ if(j==0||j==W-1||i==0||i==H-1){ printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return(0);// Your code here! }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100846/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100846/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %cmp.not40 = icmp eq i32 %call39, -1 br i1 %cmp.not40, label %while.end, label %while.body while.body: ; preds = %entry, %for.end21 %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp2 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %while.body %cmp336 = icmp sgt i32 %0, 0 br i1 %cmp336, label %for.cond4.preheader, label %for.end21 for.cond4.preheader: ; preds = %for.cond.preheader, %for.end %i.037 = phi i32 [ %inc20, %for.end ], [ 0, %for.cond.preheader ] %2 = load i32, ptr %W, align 4, !tbaa !5 %cmp533 = icmp sgt i32 %2, 0 br i1 %cmp533, label %for.body6.lr.ph, label %for.end for.body6.lr.ph: ; preds = %for.cond4.preheader %cmp10 = icmp eq i32 %i.037, 0 br i1 %cmp10, label %for.body6.us, label %for.inc.peel for.inc.peel: ; preds = %for.body6.lr.ph %putchar32.peel = call i32 @putchar(i32 35) %.pre = load i32, ptr %W, align 4, !tbaa !5 %cmp5.peel = icmp sgt i32 %.pre, 1 br i1 %cmp5.peel, label %for.body6, label %for.end for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %j.034.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar32.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.034.us, 1 %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp5.us = icmp slt i32 %inc.us, %3 br i1 %cmp5.us, label %for.body6.us, label %for.end, !llvm.loop !9 for.body6: ; preds = %for.inc.peel, %for.body6 %4 = phi i32 [ %7, %for.body6 ], [ %.pre, %for.inc.peel ] %j.034 = phi i32 [ %inc, %for.body6 ], [ 1, %for.inc.peel ] %sub = add nsw i32 %4, -1 %cmp8 = icmp eq i32 %j.034, %sub %5 = load i32, ptr %H, align 4 %sub12 = add nsw i32 %5, -1 %cmp13 = icmp eq i32 %i.037, %sub12 %6 = select i1 %cmp8, i1 true, i1 %cmp13 %.sink = select i1 %6, i32 35, i32 46 %putchar32 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.034, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %7 br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body6, %for.body6.us, %for.inc.peel, %for.cond4.preheader %putchar30 = call i32 @putchar(i32 10) %inc20 = add nuw nsw i32 %i.037, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc20, %8 br i1 %cmp3, label %for.cond4.preheader, label %for.end21, !llvm.loop !13 for.end21: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %for.end21, %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> int main(void) { int H; int W; int i,j = 0; while(1){ scanf("%d %d",&H,&W); if ((H==0)||(W==0))break; for(i=0;i<H;i++){ for(j=0;j<W;j++){ if((i==0)||(i==H-1)||(j==0)||(j==W-1)){ printf("#"); }else{ printf("."); } } printf("\n"); } printf("\n"); i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100897/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp43 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp144 = icmp eq i32 %1, 0 %or.cond45 = select i1 %cmp43, i1 true, i1 %cmp144 br i1 %or.cond45, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end21 %2 = phi i32 [ %9, %for.end21 ], [ %0, %entry ] %cmp239 = icmp sgt i32 %2, 0 br i1 %cmp239, label %for.cond3.preheader, label %for.end21 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.040 = phi i32 [ %inc20, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp436 = icmp sgt i32 %3, 0 br i1 %cmp436, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.040, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.037.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar34.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.037.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.037 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp8 = icmp eq i32 %i.040, %sub %cmp10 = icmp eq i32 %j.037, 0 %or.cond24 = or i1 %cmp10, %cmp8 %sub12 = add nsw i32 %5, -1 %cmp13 = icmp eq i32 %j.037, %sub12 %or.cond35 = select i1 %or.cond24, i1 true, i1 %cmp13 %. = select i1 %or.cond35, i32 35, i32 46 %putchar34 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.037, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar32 = call i32 @putchar(i32 10) %inc20 = add nuw nsw i32 %i.040, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc20, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.end21, !llvm.loop !11 for.end21: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<math.h> int main(){ unsigned long int a,b,c; scanf("%u",&a); scanf("%u",&b); scanf("%u",&c); unsigned long int max_len = 0; int temp_a=a, temp_b=b, temp_c=c; if(temp_c!=0) { max_len = temp_c*2; } if(temp_a==temp_b){ max_len += 2*temp_a; } else if(temp_b>temp_a){ max_len += temp_a*2+1; } else if(temp_a>temp_b){ max_len += temp_b*2+1; } printf("%u",max_len); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_10094/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_10094/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"%u\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i64, ptr %a, align 8, !tbaa !5 %conv = trunc i64 %0 to i32 %1 = load i64, ptr %b, align 8, !tbaa !5 %conv3 = trunc i64 %1 to i32 %2 = load i64, ptr %c, align 8, !tbaa !5 %conv4 = trunc i64 %2 to i32 %mul = shl i32 %conv4, 1 %conv6 = sext i32 %mul to i64 %cmp7 = icmp eq i32 %conv, %conv3 br i1 %cmp7, label %if.then9, label %if.else if.then9: ; preds = %entry %mul10 = shl nsw i32 %conv, 1 %conv11 = sext i32 %mul10 to i64 %add = add nsw i64 %conv6, %conv11 br label %if.end29 if.else: ; preds = %entry %cmp12 = icmp sgt i32 %conv3, %conv br i1 %cmp12, label %if.then14, label %if.else19 if.then14: ; preds = %if.else %mul15 = shl nsw i32 %conv, 1 %add16 = or i32 %mul15, 1 %conv17 = sext i32 %add16 to i64 %add18 = add nsw i64 %conv6, %conv17 br label %if.end29 if.else19: ; preds = %if.else %cmp20 = icmp sgt i32 %conv, %conv3 br i1 %cmp20, label %if.then22, label %if.end29 if.then22: ; preds = %if.else19 %mul23 = shl nsw i32 %conv3, 1 %add24 = or i32 %mul23, 1 %conv25 = sext i32 %add24 to i64 %add26 = add nsw i64 %conv6, %conv25 br label %if.end29 if.end29: ; preds = %if.then14, %if.then22, %if.else19, %if.then9 %max_len.1 = phi i64 [ %add, %if.then9 ], [ %add18, %if.then14 ], [ %add26, %if.then22 ], [ %conv6, %if.else19 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %max_len.1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int H, W, h, w, flag = 0; while (flag == 0) { scanf("%d %d", &H, &W); if ((H == 0) && (W == 0)) break; for (w = 0; w < W; w++) { printf("#"); } printf("\n"); for(h = 0; h < (H - 2); h++) { printf("#"); for (w = 0; w < (W - 2); w++) { printf("."); } printf("#\n"); } for (w = 0; w < W; w++) { printf("#"); } printf("\n\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_100990/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_100990/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 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp152 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp253 = icmp eq i32 %1, 0 %or.cond54 = select i1 %cmp152, i1 %cmp253, i1 false br i1 %or.cond54, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end28 %2 = phi i32 [ %11, %for.end28 ], [ %1, %entry ] %cmp341 = icmp sgt i32 %2, 0 br i1 %cmp341, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %w.042 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %putchar40 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %w.042, 1 %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %3 br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %4 = load i32, ptr %H, align 4, !tbaa !5 %cmp747 = icmp sgt i32 %4, 2 br i1 %cmp747, label %for.body8, label %for.cond22.preheader for.cond22.preheader: ; preds = %for.end17, %for.end %5 = load i32, ptr %W, align 4, !tbaa !5 %cmp2349 = icmp sgt i32 %5, 0 br i1 %cmp2349, label %for.body24, label %for.end28 for.body8: ; preds = %for.end, %for.end17 %h.048 = phi i32 [ %inc20, %for.end17 ], [ 0, %for.end ] %putchar37 = call i32 @putchar(i32 35) %6 = load i32, ptr %W, align 4, !tbaa !5 %cmp1244 = icmp sgt i32 %6, 2 br i1 %cmp1244, label %for.body13, label %for.end17 for.body13: ; preds = %for.body8, %for.body13 %w.145 = phi i32 [ %inc16, %for.body13 ], [ 0, %for.body8 ] %putchar39 = call i32 @putchar(i32 46) %inc16 = add nuw nsw i32 %w.145, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %sub11 = add nsw i32 %7, -2 %cmp12 = icmp slt i32 %inc16, %sub11 br i1 %cmp12, label %for.body13, label %for.end17, !llvm.loop !11 for.end17: ; preds = %for.body13, %for.body8 %puts38 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %inc20 = add nuw nsw i32 %h.048, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %8, -2 %cmp7 = icmp slt i32 %inc20, %sub br i1 %cmp7, label %for.body8, label %for.cond22.preheader, !llvm.loop !12 for.body24: ; preds = %for.cond22.preheader, %for.body24 %w.250 = phi i32 [ %inc27, %for.body24 ], [ 0, %for.cond22.preheader ] %putchar36 = call i32 @putchar(i32 35) %inc27 = add nuw nsw i32 %w.250, 1 %9 = load i32, ptr %W, align 4, !tbaa !5 %cmp23 = icmp slt i32 %inc27, %9 br i1 %cmp23, label %for.body24, label %for.end28, !llvm.loop !13 for.end28: ; preds = %for.body24, %for.cond22.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %10 = load i32, ptr %H, align 4, !tbaa !5 %cmp1 = icmp eq i32 %10, 0 %11 = load i32, ptr %W, align 4 %cmp2 = icmp eq i32 %11, 0 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !14 while.end: ; preds = %for.end28, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(void){ int high, width; int i, j; while (1) { scanf("%d %d", &high, &width); if(high == 0 && width == 0){ break; } for (i = 0; i < high;i++){ for (j = 0; j < width;j++){ if(i == 0 || i == high - 1 || j==0 || j==width-1){ printf("#"); }else{ printf("."); } if(j == width - 1){ printf("\n"); } } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_101076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_101076/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %high = alloca i32, align 4 %width = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %high) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #4 %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %high, ptr noundef nonnull %width) %0 = load i32, ptr %high, align 4, !tbaa !5 %cmp45 = icmp eq i32 %0, 0 %1 = load i32, ptr %width, align 4 %cmp146 = icmp eq i32 %1, 0 %or.cond47 = select i1 %cmp45, i1 %cmp146, i1 false br i1 %or.cond47, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end24 %2 = phi i32 [ %15, %for.end24 ], [ %1, %entry ] %3 = phi i32 [ %14, %for.end24 ], [ %0, %entry ] %cmp241 = icmp sgt i32 %3, 0 %4 = icmp sgt i32 %2, 0 %or.cond53 = select i1 %cmp241, i1 %4, i1 false br i1 %or.cond53, label %for.cond3.preheader, label %for.end24 for.cond3.preheader: ; preds = %for.cond.preheader, %for.inc22 %5 = phi i32 [ %12, %for.inc22 ], [ %2, %for.cond.preheader ] %i.042 = phi i32 [ %inc23, %for.inc22 ], [ 0, %for.cond.preheader ] %cmp438 = icmp sgt i32 %5, 0 br i1 %cmp438, label %for.body5.lr.ph, label %for.inc22 for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.042, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.inc.us %j.039.us = phi i32 [ %inc.us, %for.inc.us ], [ 0, %for.body5.lr.ph ] %putchar35.us = call i32 @putchar(i32 35) %6 = load i32, ptr %width, align 4, !tbaa !5 %sub17.us = add nsw i32 %6, -1 %cmp18.us = icmp eq i32 %j.039.us, %sub17.us br i1 %cmp18.us, label %if.then19.us, label %for.inc.us if.then19.us: ; preds = %for.body5.us %putchar36.us = call i32 @putchar(i32 10) %.pre50 = load i32, ptr %width, align 4, !tbaa !5 br label %for.inc.us for.inc.us: ; preds = %if.then19.us, %for.body5.us %7 = phi i32 [ %.pre50, %if.then19.us ], [ %6, %for.body5.us ] %inc.us = add nuw nsw i32 %j.039.us, 1 %cmp4.us = icmp slt i32 %inc.us, %7 br i1 %cmp4.us, label %for.body5.us, label %for.inc22, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.inc %8 = phi i32 [ %11, %for.inc ], [ %5, %for.body5.lr.ph ] %j.039 = phi i32 [ %inc, %for.inc ], [ 0, %for.body5.lr.ph ] %9 = load i32, ptr %high, align 4, !tbaa !5 %sub = add nsw i32 %9, -1 %cmp7 = icmp eq i32 %i.042, %sub %cmp9 = icmp eq i32 %j.039, 0 %or.cond26 = or i1 %cmp9, %cmp7 %sub11 = add nsw i32 %8, -1 %cmp12 = icmp eq i32 %j.039, %sub11 %or.cond37 = select i1 %or.cond26, i1 true, i1 %cmp12 %. = select i1 %or.cond37, i32 35, i32 46 %putchar34 = call i32 @putchar(i32 %.) %10 = load i32, ptr %width, align 4, !tbaa !5 %sub17 = add nsw i32 %10, -1 %cmp18 = icmp eq i32 %j.039, %sub17 br i1 %cmp18, label %if.then19, label %for.inc if.then19: ; preds = %for.body5 %putchar36 = call i32 @putchar(i32 10) %.pre = load i32, ptr %width, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body5, %if.then19 %11 = phi i32 [ %10, %for.body5 ], [ %.pre, %if.then19 ] %inc = add nuw nsw i32 %j.039, 1 %cmp4 = icmp slt i32 %inc, %11 br i1 %cmp4, label %for.body5, label %for.inc22, !llvm.loop !9 for.inc22: ; preds = %for.inc, %for.inc.us, %for.cond3.preheader %12 = phi i32 [ %5, %for.cond3.preheader ], [ %7, %for.inc.us ], [ %11, %for.inc ] %inc23 = add nuw nsw i32 %i.042, 1 %13 = load i32, ptr %high, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc23, %13 br i1 %cmp2, label %for.cond3.preheader, label %for.end24, !llvm.loop !11 for.end24: ; preds = %for.inc22, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %high, ptr noundef nonnull %width) %14 = load i32, ptr %high, align 4, !tbaa !5 %cmp = icmp eq i32 %14, 0 %15 = load i32, ptr %width, align 4 %cmp1 = icmp eq i32 %15, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end24, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %high) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> int main(void) { int H, W; int i, j; while (1){ scanf("%d%d", &H, &W); if (H == 0 && W == 0){ break; } for (i = 1; i <= H; i++){ for (j = 1; j <= W; j++){ if (i == 1 || i == H || j == 1 || j == W){ printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_101119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_101119/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp39 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp140 = icmp eq i32 %1, 0 %or.cond41 = select i1 %cmp39, i1 %cmp140, i1 false br i1 %or.cond41, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end19 %2 = phi i32 [ %9, %for.end19 ], [ %0, %entry ] %cmp2.not35 = icmp slt i32 %2, 1 br i1 %cmp2.not35, label %for.end19, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.036 = phi i32 [ %inc18, %for.end ], [ 1, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.not32 = icmp slt i32 %3, 1 br i1 %cmp4.not32, label %for.end, label %for.body5.lr.ph for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.036, 1 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.033.us = phi i32 [ %inc.us, %for.body5.us ], [ 1, %for.body5.lr.ph ] %putchar30.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.033.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.not.us.not = icmp slt i32 %j.033.us, %4 br i1 %cmp4.not.us.not, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.033 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %cmp7 = icmp eq i32 %i.036, %6 %cmp9 = icmp eq i32 %j.033, 1 %or.cond21 = or i1 %cmp9, %cmp7 %cmp11 = icmp eq i32 %j.033, %5 %or.cond31 = or i1 %cmp11, %or.cond21 %. = select i1 %or.cond31, i32 35, i32 46 %putchar30 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.033, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.not.not = icmp slt i32 %j.033, %7 br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar28 = call i32 @putchar(i32 10) %inc18 = add nuw nsw i32 %i.036, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %i.036, %8 br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end19, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int H , W ; while(1){ scanf("%d %d" , &H , &W); if(H == 0 && W == 0){break;} for(int i = 1 ; i <= 1 ; i++){ for(int j = 1 ; j <= W ; j++){ printf("#"); } printf("\n"); } for(int x = 2 ; x <= H-1 ; x++){ printf("#"); for(int y = 1 ; y <= W - 2 ; y++){ printf("."); } printf("#\n"); } for(int a = 1 ; a <= 1 ; a++){ for(int b = 1 ; b <= W ; b++){ printf("#"); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_101162/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_101162/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 = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp69 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp170 = icmp eq i32 %1, 0 %or.cond71 = select i1 %cmp69, i1 %cmp170, i1 false br i1 %or.cond71, label %while.end, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry, %for.cond.cleanup36 %2 = phi i32 [ %10, %for.cond.cleanup36 ], [ %1, %entry ] %cmp4.not59 = icmp slt i32 %2, 1 br i1 %cmp4.not59, label %for.cond.cleanup5, label %for.body6 for.cond.cleanup5: ; preds = %for.body6, %for.cond3.preheader %putchar57 = call i32 @putchar(i32 10) %3 = load i32, ptr %H, align 4, !tbaa !5 %cmp13.not.not64 = icmp sgt i32 %3, 2 br i1 %cmp13.not.not64, label %for.body15, label %for.cond34.preheader for.body6: ; preds = %for.cond3.preheader, %for.body6 %j.060 = phi i32 [ %inc, %for.body6 ], [ 1, %for.cond3.preheader ] %putchar58 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %j.060, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.not.not = icmp slt i32 %j.060, %4 br i1 %cmp4.not.not, label %for.body6, label %for.cond.cleanup5, !llvm.loop !9 for.cond34.preheader: ; preds = %for.cond.cleanup20, %for.cond.cleanup5 %5 = load i32, ptr %W, align 4, !tbaa !5 %cmp35.not66 = icmp slt i32 %5, 1 br i1 %cmp35.not66, label %for.cond.cleanup36, label %for.body37 for.body15: ; preds = %for.cond.cleanup5, %for.cond.cleanup20 %x.065 = phi i32 [ %inc28, %for.cond.cleanup20 ], [ 2, %for.cond.cleanup5 ] %putchar55 = call i32 @putchar(i32 35) %6 = load i32, ptr %W, align 4, !tbaa !5 %cmp19.not62 = icmp slt i32 %6, 3 br i1 %cmp19.not62, label %for.cond.cleanup20, label %for.body21 for.cond.cleanup20: ; preds = %for.body21, %for.body15 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %inc28 = add nuw nsw i32 %x.065, 1 %7 = load i32, ptr %H, align 4, !tbaa !5 %cmp13.not.not = icmp slt i32 %inc28, %7 br i1 %cmp13.not.not, label %for.body15, label %for.cond34.preheader, !llvm.loop !11 for.body21: ; preds = %for.body15, %for.body21 %y.063 = phi i32 [ %inc24, %for.body21 ], [ 1, %for.body15 ] %putchar56 = call i32 @putchar(i32 46) %inc24 = add nuw nsw i32 %y.063, 1 %8 = load i32, ptr %W, align 4, !tbaa !5 %sub18 = add nsw i32 %8, -2 %cmp19.not.not = icmp slt i32 %y.063, %sub18 br i1 %cmp19.not.not, label %for.body21, label %for.cond.cleanup20, !llvm.loop !12 for.cond.cleanup36: ; preds = %for.body37, %for.cond34.preheader %putchar53 = call i32 @putchar(i32 10) %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond3.preheader for.body37: ; preds = %for.cond34.preheader, %for.body37 %b.067 = phi i32 [ %inc40, %for.body37 ], [ 1, %for.cond34.preheader ] %putchar54 = call i32 @putchar(i32 35) %inc40 = add nuw nsw i32 %b.067, 1 %11 = load i32, ptr %W, align 4, !tbaa !5 %cmp35.not.not = icmp slt i32 %b.067, %11 br i1 %cmp35.not.not, label %for.body37, label %for.cond.cleanup36, !llvm.loop !13 while.end: ; preds = %for.cond.cleanup36, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void){ int H,W; while(1){ scanf("%d %d",&H,&W); if(H==0 && W==0)break; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(i==0 || i==H-1){ printf("#"); }else if(j==0 || j==W-1){ printf("#"); }else printf("."); } printf("\n"); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_101205/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_101205/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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp44 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp145 = icmp eq i32 %1, 0 %or.cond46 = select i1 %cmp44, i1 %cmp145, i1 false br i1 %or.cond46, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %2 = phi i32 [ %6, %for.cond.cleanup ], [ %0, %entry ] %cmp240 = icmp sgt i32 %2, 0 br i1 %cmp240, label %for.cond3.preheader, label %for.cond.cleanup for.cond3.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup5 %i.041 = phi i32 [ %inc23, %for.cond.cleanup5 ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp437 = icmp sgt i32 %3, 0 br i1 %cmp437, label %for.body6.lr.ph, label %for.cond.cleanup5 for.body6.lr.ph: ; preds = %for.cond3.preheader %cmp7 = icmp eq i32 %i.041, 0 br i1 %cmp7, label %for.body6.us, label %for.body6.preheader for.body6.preheader: ; preds = %for.body6.lr.ph %putchar35.peel = call i32 @putchar(i32 35) %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %4, 1 br i1 %cmp4.peel, label %for.body6, label %for.cond.cleanup5 for.body6.us: ; preds = %for.body6.lr.ph, %for.body6.us %j.038.us = phi i32 [ %inc.us, %for.body6.us ], [ 0, %for.body6.lr.ph ] %putchar35.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.038.us, 1 %5 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %5 br i1 %cmp4.us, label %for.body6.us, label %for.cond.cleanup5, !llvm.loop !9 for.cond.cleanup: ; preds = %for.cond.cleanup5, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %6 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader for.cond.cleanup5: ; preds = %for.body6, %for.body6.us, %for.body6.preheader, %for.cond3.preheader %putchar32 = call i32 @putchar(i32 10) %inc23 = add nuw nsw i32 %i.041, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc23, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.cond.cleanup, !llvm.loop !11 for.body6: ; preds = %for.body6.preheader, %for.body6 %9 = phi i32 [ %12, %for.body6 ], [ %4, %for.body6.preheader ] %j.038 = phi i32 [ %inc, %for.body6 ], [ 1, %for.body6.preheader ] %10 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %10, -1 %cmp8 = icmp eq i32 %i.041, %sub %sub13 = add nsw i32 %9, -1 %cmp14 = icmp eq i32 %j.038, %sub13 %11 = select i1 %cmp8, i1 true, i1 %cmp14 %.sink = select i1 %11, i32 35, i32 46 %putchar35 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.038, 1 %12 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %12 br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main(){ while(1){ int H,W,i,j; scanf("%d%d",&H,&W); if(H==0&&W==0) break; for(i=0;i<H;i++) { for(j=0;j<W;j++) { if(i == 0||i == H - 1||j == 0||j == W - 1) printf("#"); else printf("."); } printf("\n"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_101263/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_101263/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp45 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp146 = icmp eq i32 %1, 0 %or.cond47 = select i1 %cmp45, i1 %cmp146, i1 false br i1 %or.cond47, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %cleanup %2 = phi i32 [ %9, %cleanup ], [ %0, %entry ] %cmp241 = icmp sgt i32 %2, 0 br i1 %cmp241, label %for.cond3.preheader, label %cleanup for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.042 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp438 = icmp sgt i32 %3, 0 br i1 %cmp438, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %cmp6 = icmp eq i32 %i.042, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.039.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %putchar34.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.039.us, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %5 = phi i32 [ %7, %for.body5 ], [ %3, %for.body5.lr.ph ] %j.039 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %6 = load i32, ptr %H, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp7 = icmp eq i32 %i.042, %sub %cmp9 = icmp eq i32 %j.039, 0 %or.cond25 = or i1 %cmp9, %cmp7 %sub11 = add nsw i32 %5, -1 %cmp12 = icmp eq i32 %j.039, %sub11 %or.cond35 = select i1 %or.cond25, i1 true, i1 %cmp12 %. = select i1 %or.cond35, i32 35, i32 46 %putchar34 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.039, 1 %7 = load i32, ptr %W, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar32 = call i32 @putchar(i32 10) %inc19 = add nuw nsw i32 %i.042, 1 %8 = load i32, ptr %H, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc19, %8 br i1 %cmp2, label %for.cond3.preheader, label %cleanup, !llvm.loop !11 cleanup: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %9 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %9, 0 %10 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %10, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}