Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> void InsertionSort(int n, int nums[]) { int i, j, k; int v; for (k = 0; k < n; k++) { printf("%d", nums[k]); if (k == n-1) { putchar ('\n'); break; } putchar(' '); } for (i = 1; i < n; i++) { v = nums[i]; j = i-1; while (0 <= j && v < nums[j]) { nums[j+1] = nums[j]; j--; } nums[j+1] = v; for (k = 0; k < n; k++) { printf("%d", nums[k]); if (k == n-1) { putchar ('\n'); break; } putchar(' '); } } } int main() { int n; int nums[100]; scanf("%d", &n); int i; for (i = 0; i < n; i++) { scanf("%d", &nums[i]); } InsertionSort(n, nums); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116153/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116153/source.c" target datalayout = "e-m:e-p270: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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local void @InsertionSort(i32 noundef %n, ptr nocapture noundef %nums) local_unnamed_addr #0 { entry: %cmp68 = icmp sgt i32 %n, 0 br i1 %cmp68, label %for.body.lr.ph, label %for.end38 for.body.lr.ph: ; preds = %entry %sub = add nsw i32 %n, -1 %0 = zext i32 %sub to i64 %1 = load i32, ptr %nums, align 4, !tbaa !5 %call92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) %cmp193 = icmp eq i32 %sub, 0 %2 = load ptr, ptr @stdout, align 8, !tbaa !9 br i1 %cmp193, label %for.end, label %if.end if.end: ; preds = %for.body.lr.ph, %if.end %3 = phi ptr [ %5, %if.end ], [ %2, %for.body.lr.ph ] %indvars.iv94 = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %for.body.lr.ph ] %call.i65 = tail call i32 @putc(i32 noundef 32, ptr noundef %3) %indvars.iv.next = add nuw nsw i64 %indvars.iv94, 1 %arrayidx = getelementptr inbounds i32, ptr %nums, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %cmp1 = icmp eq i64 %indvars.iv.next, %0 %5 = load ptr, ptr @stdout, align 8, !tbaa !9 br i1 %cmp1, label %for.end, label %if.end for.end: ; preds = %if.end, %for.body.lr.ph %.lcssa91 = phi ptr [ %2, %for.body.lr.ph ], [ %5, %if.end ] %call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %.lcssa91) %cmp575 = icmp sgt i32 %n, 1 br i1 %cmp575, label %for.body6.us.preheader, label %for.end38 for.body6.us.preheader: ; preds = %for.end %sub27 = add nsw i32 %n, -1 %6 = zext i32 %sub27 to i64 %wide.trip.count = zext i32 %n to i64 %cmp28.us96 = icmp eq i32 %sub27, 0 br label %for.body6.us for.body6.us: ; preds = %for.body6.us.preheader, %for.inc36.us %indvars.iv79 = phi i64 [ 1, %for.body6.us.preheader ], [ %indvars.iv.next80, %for.inc36.us ] %arrayidx8.us = getelementptr inbounds i32, ptr %nums, i64 %indvars.iv79 %7 = load i32, ptr %arrayidx8.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body6.us %indvars.iv81 = phi i64 [ %indvars.iv.next82, %while.body.us ], [ %indvars.iv79, %for.body6.us ] %indvars.iv.next82 = add nsw i64 %indvars.iv81, -1 %idxprom11.us = and i64 %indvars.iv.next82, 4294967295 %arrayidx12.us = getelementptr inbounds i32, ptr %nums, i64 %idxprom11.us %8 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.us = icmp slt i32 %7, %8 br i1 %cmp13.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv81, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom19.us = ashr exact i64 %sext, 32 %arrayidx20.us = getelementptr inbounds i32, ptr %nums, i64 %idxprom19.us store i32 %7, ptr %arrayidx20.us, align 4, !tbaa !5 %9 = load i32, ptr %nums, align 4, !tbaa !5 %call26.us95 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9) %10 = load ptr, ptr @stdout, align 8, !tbaa !9 br i1 %cmp28.us96, label %for.inc36.us, label %if.end31.us if.end31.us: ; preds = %while.end.us, %if.end31.us %11 = phi ptr [ %13, %if.end31.us ], [ %10, %while.end.us ] %indvars.iv8497 = phi i64 [ %indvars.iv.next85, %if.end31.us ], [ 0, %while.end.us ] %call.i67.us = tail call i32 @putc(i32 noundef 32, ptr noundef %11) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv8497, 1 %arrayidx25.us = getelementptr inbounds i32, ptr %nums, i64 %indvars.iv.next85 %12 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %call26.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12) %cmp28.us = icmp eq i64 %indvars.iv.next85, %6 %13 = load ptr, ptr @stdout, align 8, !tbaa !9 br i1 %cmp28.us, label %for.inc36.us, label %if.end31.us for.inc36.us: ; preds = %if.end31.us, %while.end.us %.lcssa = phi ptr [ %10, %while.end.us ], [ %13, %if.end31.us ] %call.i66.us = tail call i32 @putc(i32 noundef 10, ptr noundef %.lcssa) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count br i1 %exitcond.not, label %for.end38, label %for.body6.us, !llvm.loop !11 while.body.us: ; preds = %land.rhs.us %arrayidx17.us = getelementptr inbounds i32, ptr %nums, i64 %indvars.iv81 store i32 %8, ptr %arrayidx17.us, align 4, !tbaa !5 %14 = icmp sgt i64 %indvars.iv81, 1 br i1 %14, label %land.rhs.us, label %while.end.us, !llvm.loop !13 for.end38: ; preds = %for.inc36.us, %entry, %for.end ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %nums = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %nums) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, 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 [100 x i32], ptr %nums, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @InsertionSort(i32 noundef %.lcssa, ptr noundef nonnull %nums) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %nums) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 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 @putc(i32 noundef, ptr nocapture noundef) 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 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include<stdio.h> void trace(int A[],int N) { int i ; for(i = 0 ;i <N;i++) { if(i>0)printf(" "); printf("%d",A[i]); } printf("\n"); } void insertionSort(int A[],int N) { int j,i,v; for(i = 1;i<N;i++) { v=A[i]; j = i-1; while(j>=0 && A[j]>v) { A[j+1] =A[j]; j--; } A[j+1] =v; trace(A,N); } } int main() { int N,i,j; int A[100]; scanf("%d",&N); for(i = 0 ;i<N;i++){ scanf("%d",&A[i]); } trace(A,N); insertionSort(A,N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116203/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i32 %N, 0 br i1 %cmp8, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %.pre = load i32, ptr %A, align 4, !tbaa !5 %call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %N, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar7 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %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 %if.end, !llvm.loop !9 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 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: 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 uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp30 = icmp sgt i32 %N, 1 br i1 %cmp30, label %for.body.us.preheader, label %for.end for.body.us.preheader: ; preds = %entry %wide.trip.count.i = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us %indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ] %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body.us %indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next35 = add nsw i64 %indvars.iv34, -1 %idxprom2.us = and i64 %indvars.iv.next35, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp sgt i32 %1, %0 br i1 %cmp4.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5 %.pre.i.us = load i32, ptr %A, align 4, !tbaa !5 %call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us) br label %if.end.i.us if.end.i.us: ; preds = %while.end.us, %if.end.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ] %putchar7.i.us = tail call i32 @putchar(i32 32) %arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us %2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9 while.body.us: ; preds = %land.rhs.us %arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34 store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5 %3 = icmp sgt i64 %indvars.iv34, 1 br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12 trace.exit.loopexit.us: ; preds = %if.end.i.us %putchar.i.us = tail call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13 for.end: ; preds = %trace.exit.loopexit.us, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %trace.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body %cmp8.i = icmp sgt i32 %1, 0 br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit if.end.peel.i: ; preds = %for.end %wide.trip.count.i = zext i32 %1 to i64 %.pre.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i) %exitcond.peel.not.i = icmp eq i32 %1, 1 br i1 %exitcond.peel.not.i, label %trace.exit, label %if.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 ] %putchar7.i = call i32 @putchar(i32 32) %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %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 %trace.exit, label %if.end.i, !llvm.loop !9 trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp30.i = icmp sgt i32 %4, 1 br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit for.body.us.preheader.i: ; preds = %trace.exit %wide.trip.count.i.i = zext i32 %4 to i64 br label %for.body.us.i for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i %indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5 %5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 br label %land.rhs.us.i land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i %indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ] %indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1 %idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i %6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp sgt i32 %6, %5 br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i %j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5 %.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i) br label %if.end.i.us.i if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ] %putchar7.i.us.i = call i32 @putchar(i32 32) %arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i %7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5 %8 = icmp sgt i64 %indvars.iv34.i, 1 br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12 trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i %putchar.i.us.i = call i32 @putchar(i32 10) %indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1 %exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13 insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include "stdio.h" void insertionSort(int A[],int N){ for(int i=0;i<N;++i){ if(i==0) printf("%d",A[i]); else printf(" %d",A[i]); } printf("\n"); for(int i=1;i<N;++i){ int v=A[i]; int j=i-1; while(j>=0&&A[j]>v){ A[j+1]=A[j]; j--; } A[j+1]=v; for(int j=0;j<N;++j){ if(j==0) printf("%d",A[j]); else printf(" %d",A[j]); } printf("\n"); } } int main(){ int N; scanf("%d",&N); int A[100]; for(int i=0;i<N;++i) scanf("%d",&A[i]); insertionSort(A,N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116247/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116247/source.c" target datalayout = "e-m:e-p270: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 ; Function Attrs: nofree nounwind uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp74 = icmp sgt i32 %N, 0 br i1 %cmp74, label %for.inc.peel, label %for.cond.cleanup.thread for.inc.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %0 = load i32, ptr %A, align 4, !tbaa !5 %call.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %exitcond.peel.not = icmp eq i32 %N, 1 br i1 %exitcond.peel.not, label %for.cond.cleanup.thread, label %for.inc for.cond.cleanup.thread: ; preds = %for.inc.peel, %entry %putchar102 = tail call i32 @putchar(i32 10) br label %for.cond.cleanup9 for.cond.cleanup: ; preds = %for.inc %putchar = tail call i32 @putchar(i32 10) %cmp881 = icmp sgt i32 %N, 1 br i1 %cmp881, label %for.body10.us.preheader, label %for.cond.cleanup9 for.body10.us.preheader: ; preds = %for.cond.cleanup %wide.trip.count100 = zext i32 %N to i64 br label %for.body10.us for.body10.us: ; preds = %for.body10.us.preheader, %for.cond25.for.cond.cleanup27_crit_edge.us %indvars.iv86 = phi i64 [ 1, %for.body10.us.preheader ], [ %indvars.iv.next87, %for.cond25.for.cond.cleanup27_crit_edge.us ] %arrayidx12.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv86 %1 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body10.us %indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.body.us ], [ %indvars.iv86, %for.body10.us ] %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1 %idxprom14.us = and i64 %indvars.iv.next89, 4294967295 %arrayidx15.us = getelementptr inbounds i32, ptr %A, i64 %idxprom14.us %2 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %cmp16.us = icmp sgt i32 %2, %1 br i1 %cmp16.us, label %while.body.us, label %for.inc39.us.peel for.inc39.us.peel: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv88, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom22.us = ashr exact i64 %sext, 32 %arrayidx23.us = getelementptr inbounds i32, ptr %A, i64 %idxprom22.us store i32 %1, ptr %arrayidx23.us, align 4, !tbaa !5 %3 = load i32, ptr %A, align 4, !tbaa !5 %call33.us.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) br label %for.inc39.us for.inc39.us: ; preds = %for.inc39.us.peel, %for.inc39.us %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc39.us ], [ 1, %for.inc39.us.peel ] %arrayidx36.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv91 %4 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %call37.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond96.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count100 br i1 %exitcond96.not, label %for.cond25.for.cond.cleanup27_crit_edge.us, label %for.inc39.us, !llvm.loop !9 while.body.us: ; preds = %land.rhs.us %arrayidx20.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv88 store i32 %2, ptr %arrayidx20.us, align 4, !tbaa !5 %5 = icmp sgt i64 %indvars.iv88, 1 br i1 %5, label %land.rhs.us, label %for.inc39.us.peel, !llvm.loop !12 for.cond25.for.cond.cleanup27_crit_edge.us: ; preds = %for.inc39.us %putchar73.us = tail call i32 @putchar(i32 10) %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond101.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count100 br i1 %exitcond101.not, label %for.cond.cleanup9, label %for.body10.us, !llvm.loop !13 for.inc: ; preds = %for.inc.peel, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ] %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %6 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.inc, !llvm.loop !14 for.cond.cleanup9: ; preds = %for.cond25.for.cond.cleanup27_crit_edge.us, %for.cond.cleanup.thread, %for.cond.cleanup ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @insertionSort(ptr noundef nonnull %A, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15 } ; 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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !11} !15 = distinct !{!15, !10}
#include<stdio.h> //#define N 100 int main(void) { int i,t,j,v,N; int A[100]; scanf("%d", &N); for(i=0; i<N; i++){ scanf("%d", &A[i]); } for(i=0; i<N; i++){ if(i==N-1){printf("%d\n", A[i]); }else{printf("%d ", A[i]); } } for(i=1; i<=N-1; i++){ v = A[i]; j = i -1; while(j>=0 && A[j]>v){ A[j+1] = A[j]; j--; } A[j+1] = v; for(t=0; t<N; t++){ if(t==N-1){printf("%d\n", A[t]); }else if(i==N-1){ printf("%d ", A[t]); }else if(i==N-1 && t==N-1){ printf("%d", A[t]); }else{printf("%d ", A[t]); } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116290/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116290/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp99 = icmp sgt i32 %0, 0 br i1 %cmp99, label %for.body, label %for.end70 for.cond2.preheader: ; preds = %for.body %cmp3101 = icmp sgt i32 %1, 0 br i1 %cmp3101, label %for.body4, label %for.end70 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond15.preheader: ; preds = %for.body4 %cmp17.not.not108 = icmp sgt i32 %6, 1 br i1 %cmp17.not.not108, label %for.body18, label %for.end70 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body4 ], [ 0, %for.cond2.preheader ] %3 = phi i32 [ %6, %for.body4 ], [ %1, %for.cond2.preheader ] %sub = add nsw i32 %3, -1 %4 = zext i32 %sub to i64 %cmp5 = icmp eq i64 %indvars.iv111, %4 %arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv111 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %5) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp3 = icmp slt i64 %indvars.iv.next112, %7 br i1 %cmp3, label %for.body4, label %for.cond15.preheader, !llvm.loop !11 for.body18: ; preds = %for.cond15.preheader, %for.inc68 %8 = phi i32 [ %17, %for.inc68 ], [ %6, %for.cond15.preheader ] %indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc68 ], [ 1, %for.cond15.preheader ] %arrayidx20 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv114 %9 = load i32, ptr %arrayidx20, align 4, !tbaa !5 br label %land.rhs land.rhs: ; preds = %for.body18, %while.body %indvars.iv116 = phi i64 [ %indvars.iv114, %for.body18 ], [ %indvars.iv.next117, %while.body ] %indvars.iv.next117 = add nsw i64 %indvars.iv116, -1 %idxprom23 = and i64 %indvars.iv.next117, 4294967295 %arrayidx24 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom23 %10 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %10, %9 br i1 %cmp25, label %while.body, label %while.end while.body: ; preds = %land.rhs %arrayidx29 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv116 store i32 %10, ptr %arrayidx29, align 4, !tbaa !5 %11 = icmp sgt i64 %indvars.iv116, 1 br i1 %11, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %land.rhs %j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv116, %land.rhs ] %sext = shl i64 %j.0.in.lcssa, 32 %idxprom31 = ashr exact i64 %sext, 32 %arrayidx32 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom31 store i32 %9, ptr %arrayidx32, align 4, !tbaa !5 %cmp34106 = icmp sgt i32 %8, 0 br i1 %cmp34106, label %for.body35, label %while.end.for.inc68_crit_edge while.end.for.inc68_crit_edge: ; preds = %while.end %.pre = sext i32 %8 to i64 br label %for.inc68 for.body35: ; preds = %while.end, %for.body35 %indvars.iv119 = phi i64 [ %indvars.iv.next120, %for.body35 ], [ 0, %while.end ] %12 = phi i32 [ %15, %for.body35 ], [ %8, %while.end ] %sub36 = add nsw i32 %12, -1 %13 = zext i32 %sub36 to i64 %cmp37 = icmp eq i64 %indvars.iv119, %13 %.str.1..str.2130 = select i1 %cmp37, ptr @.str.1, ptr @.str.2 %arrayidx47 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv119 %14 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2130, i32 noundef %14) %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1 %15 = load i32, ptr %N, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp34 = icmp slt i64 %indvars.iv.next120, %16 br i1 %cmp34, label %for.body35, label %for.inc68, !llvm.loop !13 for.inc68: ; preds = %for.body35, %while.end.for.inc68_crit_edge %.pre-phi = phi i64 [ %.pre, %while.end.for.inc68_crit_edge ], [ %16, %for.body35 ] %17 = phi i32 [ %8, %while.end.for.inc68_crit_edge ], [ %15, %for.body35 ] %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %cmp17.not.not = icmp slt i64 %indvars.iv.next115, %.pre-phi br i1 %cmp17.not.not, label %for.body18, label %for.end70, !llvm.loop !14 for.end70: ; preds = %for.inc68, %entry, %for.cond2.preheader, %for.cond15.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> void trace(int*,int); void insertionSort(int*,int); int main() { int hiroshi,mika,takuro,i,j,k; int takeshi[1000]; scanf("%d",&k); for(i=0;i<k;i++) scanf("%d",&takeshi[i]); trace(takeshi,k); insertionSort(takeshi,k); return 0; } void trace(int takeshi[],int k){ int i; for(i=0;i<k;i++){ if(i>0)printf(" "); printf("%d",takeshi[i]); } printf("\n"); } void insertionSort(int takeshi[],int k){ int j,mika,takuro; for(j=1;j<k;j++){ takuro=takeshi[j]; mika=j-1; while(mika>=0 && takeshi[mika]>takuro){ takeshi[mika+1]=takeshi[mika]; mika--; } takeshi[mika+1]=takuro; trace(takeshi,k); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116333/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116333/source.c" target datalayout = "e-m:e-p270: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: %k = alloca i32, align 4 %takeshi = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %takeshi) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %trace.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %takeshi, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %k, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp8.i = icmp sgt i32 %1, 0 br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit if.end.peel.i: ; preds = %for.end %wide.trip.count.i = zext i32 %1 to i64 %.pre.i = load i32, ptr %takeshi, align 16, !tbaa !5 %call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i) %exitcond.peel.not.i = icmp eq i32 %1, 1 br i1 %exitcond.peel.not.i, label %trace.exit, label %if.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 ] %putchar7.i = call i32 @putchar(i32 32) %arrayidx.i = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %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 %trace.exit, label %if.end.i, !llvm.loop !11 trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp30.i = icmp sgt i32 %4, 1 br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit for.body.us.preheader.i: ; preds = %trace.exit %wide.trip.count.i.i = zext i32 %4 to i64 br label %for.body.us.i for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i %indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv.i5 %5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 br label %land.rhs.us.i land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i %indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ] %indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1 %idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %takeshi, i64 %idxprom2.us.i %6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp sgt i32 %6, %5 br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i %mika.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ] %sext.i = shl i64 %mika.0.in.lcssa.us.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %takeshi, i64 %idxprom10.us.i store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5 %.pre.i.us.i = load i32, ptr %takeshi, align 16, !tbaa !5 %call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i.us.i) br label %if.end.i.us.i if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ] %putchar7.i.us.i = call i32 @putchar(i32 32) %arrayidx.i.us.i = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv.i.us.i %7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !11 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx8.us.i = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv34.i store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5 %8 = icmp sgt i64 %indvars.iv34.i, 1 br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !13 trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i %putchar.i.us.i = call i32 @putchar(i32 10) %indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1 %exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !14 insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %takeshi) #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 uwtable define dso_local void @trace(ptr nocapture noundef readonly %takeshi, i32 noundef %k) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i32 %k, 0 br i1 %cmp8, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %k to i64 %.pre = load i32, ptr %takeshi, align 4, !tbaa !5 %call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %k, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar7 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %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 %if.end, !llvm.loop !11 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @insertionSort(ptr nocapture noundef %takeshi, i32 noundef %k) local_unnamed_addr #0 { entry: %cmp30 = icmp sgt i32 %k, 1 br i1 %cmp30, label %for.body.us.preheader, label %for.end for.body.us.preheader: ; preds = %entry %wide.trip.count.i = zext i32 %k to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us %indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ] %arrayidx.us = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv %0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body.us %indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next35 = add nsw i64 %indvars.iv34, -1 %idxprom2.us = and i64 %indvars.iv.next35, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %takeshi, i64 %idxprom2.us %1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp sgt i32 %1, %0 br i1 %cmp4.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %mika.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ] %sext = shl i64 %mika.0.in.lcssa.us, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %takeshi, i64 %idxprom10.us store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5 %.pre.i.us = load i32, ptr %takeshi, align 4, !tbaa !5 %call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i.us) br label %if.end.i.us if.end.i.us: ; preds = %while.end.us, %if.end.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ] %putchar7.i.us = tail call i32 @putchar(i32 32) %arrayidx.i.us = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv.i.us %2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !11 while.body.us: ; preds = %land.rhs.us %arrayidx8.us = getelementptr inbounds i32, ptr %takeshi, i64 %indvars.iv34 store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5 %3 = icmp sgt i64 %indvars.iv34, 1 br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !13 trace.exit.loopexit.us: ; preds = %if.end.i.us %putchar.i.us = tail call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !14 for.end: ; preds = %trace.exit.loopexit.us, %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 #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 = !{!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> #define NMAX 100 int insertionSort(int,int *); int main(void){ int i,N,A[NMAX]; scanf("%d",&N); for(i = 0;i < N;i++){ scanf("%d",&A[i]); } insertionSort(N,A); return 0; } int insertionSort(int N,int *A){ int i,j,key,k; for(i = 0;i < N;i++){ key = A[i]; j = i - 1; while((j >= 0) && (A[j] > key)){ A[j+1] = A[j]; j--; } A[j+1] = key; for(k = 0;k < N;k++){ if(k == N-1) printf("%d\n",A[k]); else printf("%d ",A[k]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116377/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116377/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %0, 0 br i1 %cmp5, label %for.body, label %insertionSort.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp53.i = icmp sgt i32 %1, 0 br i1 %cmp53.i, label %for.body.lr.ph.i, label %insertionSort.exit for.body.lr.ph.i: ; preds = %for.end %sub15.i = add nsw i32 %1, -1 %3 = zext i32 %sub15.i to i64 %wide.trip.count64.i = zext i32 %1 to i64 br label %for.body.us.i for.body.us.i: ; preds = %for.cond12.for.inc22_crit_edge.us.i, %for.body.lr.ph.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond12.for.inc22_crit_edge.us.i ], [ 0, %for.body.lr.ph.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %4 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 %cmp147.us.not.i = icmp eq i64 %indvars.iv.i, 0 br i1 %cmp147.us.not.i, label %while.end.us.i, label %land.rhs.us.i land.rhs.us.i: ; preds = %for.body.us.i, %while.body.us.i %indvars.iv55.i = phi i64 [ %indvars.iv.next56.i, %while.body.us.i ], [ %indvars.iv.i, %for.body.us.i ] %indvars.iv.next56.i = add nsw i64 %indvars.iv55.i, -1 %idxprom2.us.i = and i64 %indvars.iv.next56.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i %5 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp sgt i32 %5, %4 br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i, %for.body.us.i %j.0.in.lcssa.us.i = phi i64 [ 0, %for.body.us.i ], [ %indvars.iv55.i, %land.rhs.us.i ], [ 0, %while.body.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i store i32 %4, ptr %arrayidx11.us.i, align 4, !tbaa !5 br label %for.body14.us.i for.body14.us.i: ; preds = %for.body14.us.i, %while.end.us.i %indvars.iv58.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next59.i, %for.body14.us.i ] %cmp16.us.i = icmp eq i64 %indvars.iv58.i, %3 %arrayidx18.us.sink.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv58.i %.str.1.sink.i = select i1 %cmp16.us.i, ptr @.str.1, ptr @.str.2 %6 = load i32, ptr %arrayidx18.us.sink.i, align 4, !tbaa !5 %call.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i, i32 noundef %6) %indvars.iv.next59.i = add nuw nsw i64 %indvars.iv58.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next59.i, %wide.trip.count64.i br i1 %exitcond.not.i, label %for.cond12.for.inc22_crit_edge.us.i, label %for.body14.us.i, !llvm.loop !11 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv55.i store i32 %5, ptr %arrayidx8.us.i, align 4, !tbaa !5 %7 = icmp sgt i64 %indvars.iv55.i, 1 br i1 %7, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12 for.cond12.for.inc22_crit_edge.us.i: ; preds = %for.body14.us.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond65.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count64.i br i1 %exitcond65.not.i, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13 insertionSort.exit: ; preds = %for.cond12.for.inc22_crit_edge.us.i, %entry, %for.end call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #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 uwtable define dso_local i32 @insertionSort(i32 noundef %N, ptr nocapture noundef %A) local_unnamed_addr #0 { entry: %cmp53 = icmp sgt i32 %N, 0 br i1 %cmp53, label %for.body.lr.ph, label %for.end24 for.body.lr.ph: ; preds = %entry %sub15 = add nsw i32 %N, -1 %0 = zext i32 %sub15 to i64 %wide.trip.count64 = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.cond12.for.inc22_crit_edge.us, %for.body.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond12.for.inc22_crit_edge.us ], [ 0, %for.body.lr.ph ] %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %cmp147.us.not = icmp eq i64 %indvars.iv, 0 br i1 %cmp147.us.not, label %while.end.us, label %land.rhs.us land.rhs.us: ; preds = %for.body.us, %while.body.us %indvars.iv55 = phi i64 [ %indvars.iv.next56, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next56 = add nsw i64 %indvars.iv55, -1 %idxprom2.us = and i64 %indvars.iv.next56, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp sgt i32 %2, %1 br i1 %cmp4.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %land.rhs.us, %while.body.us, %for.body.us %j.0.in.lcssa.us = phi i64 [ 0, %for.body.us ], [ 0, %while.body.us ], [ %indvars.iv55, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us store i32 %1, ptr %arrayidx11.us, align 4, !tbaa !5 br label %for.body14.us for.body14.us: ; preds = %while.end.us, %for.body14.us %indvars.iv58 = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next59, %for.body14.us ] %cmp16.us = icmp eq i64 %indvars.iv58, %0 %arrayidx18.us.sink = getelementptr inbounds i32, ptr %A, i64 %indvars.iv58 %.str.1.sink = select i1 %cmp16.us, ptr @.str.1, ptr @.str.2 %3 = load i32, ptr %arrayidx18.us.sink, align 4, !tbaa !5 %call.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %3) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count64 br i1 %exitcond.not, label %for.cond12.for.inc22_crit_edge.us, label %for.body14.us, !llvm.loop !11 while.body.us: ; preds = %land.rhs.us %arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv55 store i32 %2, ptr %arrayidx8.us, align 4, !tbaa !5 %4 = icmp sgt i64 %indvars.iv55, 1 br i1 %4, label %land.rhs.us, label %while.end.us, !llvm.loop !12 for.cond12.for.inc22_crit_edge.us: ; preds = %for.body14.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond65.not = icmp eq i64 %indvars.iv.next, %wide.trip.count64 br i1 %exitcond65.not, label %for.end24, label %for.body.us, !llvm.loop !13 for.end24: ; preds = %for.cond12.for.inc22_crit_edge.us, %entry ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <math.h> #include <stdio.h> int main() { long long b; scanf("%I64d", &b); int sq = ceil(sqrt(b)), res = 0; for (int i = 1; i <= sq; ++i) { if (b % i == 0) { if ((b / i) > (long long)i) res += 2; else if ((b / i) == (long long)i) res++; } } printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11642/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11642/source.c" target datalayout = "e-m:e-p270: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"%I64d\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: %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i64, ptr %b, align 8, !tbaa !5 %conv = sitofp i64 %0 to double %call1 = call double @sqrt(double noundef %conv) #5 %1 = call double @llvm.ceil.f64(double %call1) %conv2 = fptosi double %1 to i32 %cmp.not30 = icmp slt i32 %conv2, 1 br i1 %cmp.not30, label %for.cond.cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i64, ptr %b, align 8, !tbaa !5 %3 = add nuw i32 %conv2, 1 %wide.trip.count = zext i32 %3 to i64 br label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %res.0.lcssa = phi i32 [ 0, %entry ], [ %res.1, %for.inc ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 ret i32 0 for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %res.031 = phi i32 [ 0, %for.body.lr.ph ], [ %res.1, %for.inc ] %rem = srem i64 %2, %indvars.iv %div = sdiv i64 %2, %indvars.iv %cmp5 = icmp eq i64 %rem, 0 br i1 %cmp5, label %if.then, label %for.inc if.then: ; preds = %for.body %cmp9 = icmp sgt i64 %div, %indvars.iv br i1 %cmp9, label %if.then11, label %if.else if.then11: ; preds = %if.then %add = add nsw i32 %res.031, 2 br label %for.inc if.else: ; preds = %if.then %cmp15 = icmp eq i64 %div, %indvars.iv %inc = zext i1 %cmp15 to i32 %spec.select = add nsw i32 %res.031, %inc br label %for.inc for.inc: ; preds = %if.else, %for.body, %if.then11 %res.1 = phi i32 [ %add, %if.then11 ], [ %res.031, %for.body ], [ %spec.select, %if.else ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !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 nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int N,i,j,k,A[1000],v; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(i=1;i<=N;i++){ v = A[i]; j = i-1; for(k=0;k<N-1;k++)printf("%d ",A[k]); printf("%d",A[N-1]); printf("\n"); while(j>=0&&A[j]>v){ A[j+1] = A[j]; j--; } A[j+1] = v; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116463/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116463/source.c" target datalayout = "e-m:e-p270: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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4000, 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 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.end35 for.cond2.preheader: ; preds = %for.body %cmp3.not58 = icmp slt i32 %1, 1 br i1 %cmp3.not58, label %for.end35, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %while.end %3 = phi i32 [ %11, %while.end ], [ %1, %for.cond2.preheader ] %indvars.iv65 = phi i64 [ %indvars.iv.next66, %while.end ], [ 1, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv65 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp953 = icmp sgt i32 %3, 1 br i1 %cmp953, label %for.body10, label %for.body4.for.end16_crit_edge for.body4.for.end16_crit_edge: ; preds = %for.body4 %sub852 = add nsw i32 %3, -1 %.pre = sext i32 %sub852 to i64 br label %for.end16 for.body10: ; preds = %for.body4, %for.body10 %indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body10 ], [ 0, %for.body4 ] %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv62 %5 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %sub8 = add nsw i32 %6, -1 %7 = sext i32 %sub8 to i64 %cmp9 = icmp slt i64 %indvars.iv.next63, %7 br i1 %cmp9, label %for.body10, label %for.end16, !llvm.loop !11 for.end16: ; preds = %for.body10, %for.body4.for.end16_crit_edge %idxprom18.pre-phi = phi i64 [ %.pre, %for.body4.for.end16_crit_edge ], [ %7, %for.body10 ] %arrayidx19 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom18.pre-phi %8 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %putchar = call i32 @putchar(i32 10) br label %land.rhs land.rhs: ; preds = %for.end16, %while.body %indvars.iv67 = phi i64 [ %indvars.iv65, %for.end16 ], [ %indvars.iv.next68, %while.body ] %indvars.iv.next68 = add nsw i64 %indvars.iv67, -1 %idxprom23 = and i64 %indvars.iv.next68, 4294967295 %arrayidx24 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom23 %9 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %9, %4 br i1 %cmp25, label %while.body, label %while.end while.body: ; preds = %land.rhs %arrayidx29 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv67 store i32 %9, ptr %arrayidx29, align 4, !tbaa !5 %10 = icmp sgt i64 %indvars.iv67, 1 br i1 %10, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %land.rhs %j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv67, %land.rhs ] %sext = shl i64 %j.0.in.lcssa, 32 %idxprom31 = ashr exact i64 %sext, 32 %arrayidx32 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom31 store i32 %4, ptr %arrayidx32, align 4, !tbaa !5 %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %11 = load i32, ptr %N, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv65, %12 br i1 %cmp3.not.not, label %for.body4, label %for.end35, !llvm.loop !13 for.end35: ; preds = %while.end, %entry, %for.cond2.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #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(void){ int n, v, t; scanf("%d",&n); int a[n],i,j; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(t=0;t<n;t++){ printf("%d",a[t]); if(t<n-1){ printf(" "); } } printf("\n"); for(i=1;i<n;i++){ v=a[i]; j=i-1; while(j>=0&&v<a[j]){ a[j+1]=a[j]; j--; } a[j+1]=v; for(t=0;t<n;t++){ printf("%d",a[t]); if(t<n-1){ printf(" "); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116506/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp71 = icmp sgt i32 %3, 0 br i1 %cmp71, label %for.body, label %for.end12 for.cond2.preheader: ; preds = %for.body %4 = icmp sgt i32 %5, 0 br i1 %4, label %for.body4, label %for.end12 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc10 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.inc10 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp8 = icmp slt i64 %indvars.iv83, %9 br i1 %cmp8, label %if.then, label %for.inc10 if.then: ; preds = %for.body4 %putchar70 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc10 for.inc10: ; preds = %for.body4, %if.then %10 = phi i32 [ %8, %for.body4 ], [ %.pre, %if.then ] %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %11 = sext i32 %10 to i64 %cmp3 = icmp slt i64 %indvars.iv.next84, %11 br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.inc10, %entry, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp1580 = icmp sgt i32 %12, 1 br i1 %cmp1580, label %for.body16, label %for.end48 for.body16: ; preds = %for.end12, %for.end44 %13 = phi i32 [ %22, %for.end44 ], [ %12, %for.end12 ] %indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end44 ], [ 1, %for.end12 ] %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv86 %14 = load i32, ptr %arrayidx18, align 4, !tbaa !5 br label %land.rhs land.rhs: ; preds = %for.body16, %while.body %indvars.iv88 = phi i64 [ %indvars.iv86, %for.body16 ], [ %indvars.iv.next89, %while.body ] %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1 %idxprom21 = and i64 %indvars.iv.next89, 4294967295 %arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21 %15 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp slt i32 %14, %15 br i1 %cmp23, label %while.body, label %while.end while.body: ; preds = %land.rhs %arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88 store i32 %15, ptr %arrayidx27, align 4, !tbaa !5 %16 = icmp sgt i64 %indvars.iv88, 1 br i1 %16, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %land.rhs %j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv88, %land.rhs ] %sext = shl i64 %j.0.in.lcssa, 32 %idxprom29 = ashr exact i64 %sext, 32 %arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 %idxprom29 store i32 %14, ptr %arrayidx30, align 4, !tbaa !5 %cmp3278 = icmp sgt i32 %13, 0 br i1 %cmp3278, label %for.body33, label %for.end44 for.body33: ; preds = %while.end, %for.inc42 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc42 ], [ 0, %while.end ] %arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv91 %17 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17) %18 = load i32, ptr %n, align 4, !tbaa !5 %sub37 = add nsw i32 %18, -1 %19 = sext i32 %sub37 to i64 %cmp38 = icmp slt i64 %indvars.iv91, %19 br i1 %cmp38, label %if.then39, label %for.inc42 if.then39: ; preds = %for.body33 %putchar69 = call i32 @putchar(i32 32) %.pre97 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body33, %if.then39 %20 = phi i32 [ %18, %for.body33 ], [ %.pre97, %if.then39 ] %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %21 = sext i32 %20 to i64 %cmp32 = icmp slt i64 %indvars.iv.next92, %21 br i1 %cmp32, label %for.body33, label %for.end44, !llvm.loop !13 for.end44: ; preds = %for.inc42, %while.end %putchar68 = call i32 @putchar(i32 10) %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp15 = icmp slt i64 %indvars.iv.next87, %23 br i1 %cmp15, label %for.body16, label %for.end48, !llvm.loop !14 for.end48: ; preds = %for.end44, %for.end12 call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> void trace(int A[], int N) { int i; for (i = 0; i < N; i++) { if (i > 0) printf(" "); printf("%d", A[i]); } printf("\n"); } void InsertionSort(int A[], int N) { int i, j; int v; for (i = 1; i < N; i++) { v = A[i]; j = i - 1; while (v < A[j] && j >= 0) { A[j + 1] = A[j]; j--; } A[j + 1] = v; trace(A, N); } } int main() { int N, i; int A[100]; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } trace(A, N); InsertionSort(A, N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116557/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116557/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i32 %N, 0 br i1 %cmp8, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %.pre = load i32, ptr %A, align 4, !tbaa !5 %call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %N, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar7 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %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 %if.end, !llvm.loop !9 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 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: 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 uwtable define dso_local void @InsertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp33 = icmp sgt i32 %N, 1 br i1 %cmp33, label %for.body.us.preheader, label %for.end for.body.us.preheader: ; preds = %entry %wide.trip.count.i = zext i32 %N to i64 %0 = add nsw i32 %N, -1 %wide.trip.count = zext i32 %0 to i64 %invariant.gep = getelementptr i32, ptr %A, i64 -1 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us %indvars.iv39 = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next40, %trace.exit.loopexit.us ] %indvars.iv = phi i64 [ 0, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ] %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv39 %1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv39 %2 = load i32, ptr %gep, align 4, !tbaa !5 %cmp330.us = icmp slt i32 %1, %2 br i1 %cmp330.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %for.body.us %j.0.in.lcssa.us.in = phi i64 [ %indvars.iv39, %for.body.us ], [ %indvars.iv37, %while.body.us ] %sext = shl i64 %j.0.in.lcssa.us.in, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us store i32 %1, ptr %arrayidx11.us, align 4, !tbaa !5 %.pre.i.us = load i32, ptr %A, align 4, !tbaa !5 %call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us) br label %if.end.i.us if.end.i.us: ; preds = %while.end.us, %if.end.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ] %putchar7.i.us = tail call i32 @putchar(i32 32) %arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us %3 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9 while.body.us: ; preds = %for.body.us, %while.body.us %indvars.iv41 = phi i64 [ %indvars.iv.next42, %while.body.us ], [ %indvars.iv39, %for.body.us ] %indvars.iv37 = phi i64 [ %indvars.iv.next38, %while.body.us ], [ %indvars.iv, %for.body.us ] %4 = phi i32 [ %5, %while.body.us ], [ %2, %for.body.us ] %indvars.iv.next42 = add nsw i64 %indvars.iv41, -1 %arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv41 store i32 %4, ptr %arrayidx8.us, align 4, !tbaa !5 %indvars.iv.next38 = add nsw i64 %indvars.iv37, -1 %arrayidx2.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next38 %5 = load i32, ptr %arrayidx2.us, align 4, !tbaa !5 %cmp3.us = icmp slt i32 %1, %5 %cmp4.us = icmp sgt i64 %indvars.iv37, 0 %6 = and i1 %cmp4.us, %cmp3.us br i1 %6, label %while.body.us, label %while.end.us, !llvm.loop !12 trace.exit.loopexit.us: ; preds = %if.end.i.us %putchar.i.us = tail call i32 @putchar(i32 10) %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %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.us, !llvm.loop !13 for.end: ; preds = %trace.exit.loopexit.us, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %trace.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body %cmp8.i = icmp sgt i32 %1, 0 br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit if.end.peel.i: ; preds = %for.end %wide.trip.count.i = zext i32 %1 to i64 %.pre.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i) %exitcond.peel.not.i = icmp eq i32 %1, 1 br i1 %exitcond.peel.not.i, label %trace.exit, label %if.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 ] %putchar7.i = call i32 @putchar(i32 32) %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %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 %trace.exit, label %if.end.i, !llvm.loop !9 trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp33.i = icmp sgt i32 %4, 1 br i1 %cmp33.i, label %for.body.us.preheader.i, label %InsertionSort.exit for.body.us.preheader.i: ; preds = %trace.exit %wide.trip.count.i.i = zext i32 %4 to i64 %5 = add nsw i32 %4, -1 %wide.trip.count.i5 = zext i32 %5 to i64 %invariant.gep.i = getelementptr i32, ptr %A, i64 -1 br label %for.body.us.i for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i %indvars.iv39.i = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next40.i, %trace.exit.loopexit.us.i ] %indvars.iv.i6 = phi i64 [ 0, %for.body.us.preheader.i ], [ %indvars.iv.next.i7, %trace.exit.loopexit.us.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv39.i %6 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv39.i %7 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp330.us.i = icmp slt i32 %6, %7 br i1 %cmp330.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %for.body.us.i %j.0.in.lcssa.us.in.i = phi i64 [ %indvars.iv39.i, %for.body.us.i ], [ %indvars.iv37.i, %while.body.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.in.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i store i32 %6, ptr %arrayidx11.us.i, align 4, !tbaa !5 %.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i) br label %if.end.i.us.i if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ] %putchar7.i.us.i = call i32 @putchar(i32 32) %arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i %8 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9 while.body.us.i: ; preds = %for.body.us.i, %while.body.us.i %indvars.iv41.i = phi i64 [ %indvars.iv.next42.i, %while.body.us.i ], [ %indvars.iv39.i, %for.body.us.i ] %indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %while.body.us.i ], [ %indvars.iv.i6, %for.body.us.i ] %9 = phi i32 [ %10, %while.body.us.i ], [ %7, %for.body.us.i ] %indvars.iv.next42.i = add nsw i64 %indvars.iv41.i, -1 %arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv41.i store i32 %9, ptr %arrayidx8.us.i, align 4, !tbaa !5 %indvars.iv.next38.i = add nsw i64 %indvars.iv37.i, -1 %arrayidx2.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next38.i %10 = load i32, ptr %arrayidx2.us.i, align 4, !tbaa !5 %cmp3.us.i = icmp slt i32 %6, %10 %cmp4.us.i = icmp sgt i64 %indvars.iv37.i, 0 %11 = and i1 %cmp4.us.i, %cmp3.us.i br i1 %11, label %while.body.us.i, label %while.end.us.i, !llvm.loop !12 trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i %putchar.i.us.i = call i32 @putchar(i32 10) %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1 %exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %wide.trip.count.i5 br i1 %exitcond.not.i8, label %InsertionSort.exit, label %for.body.us.i, !llvm.loop !13 InsertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define CL while (getchar() != '\n') /*clear line*/ #define FOR(a, b, c) \ for (int(a) = (b); \ (b) < (c) ? (a) <= (c) : (a) >= (c); \ (b) < (c) ? (a)++ : (a)--) #define FN(x) /*input x and run x times*/ \ int x; \ scanf("%d", &x); \ while (x--) #define min(a, b) (a > b ? b : a) #define max(a, b) (a < b ? b : a) #define LL long long #define eps 0.000001 #define pf printf #define sf scanf #define vp const void* int cmp(vp a,vp b){ int k1=*(int*)(a),k2=*(int*)(b); return (k1>k2)*2-1; } int main() { FN(q) { int n,k; scanf("%d%d",&n,&k); if(k!=n-1&&k!=0){ printf("%d %d\n",n-1,k); printf("%d %d\n",0,n-1-k); if(n>1)FOR(i,1,n/2-1){ if(i!=k&&i!=n-1-k)printf("%d %d\n",i,n-1-i); } } else if(k==0){ FOR(i,0,n/2-1){ printf("%d %d\n",i,n-1-i); } } else{ if(n<5)printf("-1\n"); else{ printf("%d %d\n",n-1,n-2); printf("%d %d\n",1,n-3); printf("%d %d\n",0,2); FOR(i,3,n/2-1)printf("%d %d\n",i,n-1-i); } } } return 0; } /* 2:0 4:0 1 2 8:0 */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11660/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"%d %d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %sub = select i1 %cmp, i32 1, i32 -1 ret i32 %sub } ; 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: %q = alloca i32, align 4 %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %dec173 = add nsw i32 %0, -1 store i32 %dec173, ptr %q, align 4, !tbaa !5 %tobool.not174 = icmp eq i32 %0, 0 br i1 %tobool.not174, label %while.end, label %while.body while.body: ; preds = %entry, %if.end130 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k) %1 = load i32, ptr %k, align 4 %2 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %cmp = icmp ne i32 %1, %sub %cmp2 = icmp ne i32 %1, 0 %or.cond = and i1 %cmp2, %cmp br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.body %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %1) %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = load i32, ptr %k, align 4, !tbaa !5 %5 = xor i32 %4, -1 %sub6 = add i32 %3, %5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0, i32 noundef %sub6) %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %6, 1 br i1 %cmp8, label %for.cond.preheader, label %if.end130 for.cond.preheader: ; preds = %if.then %cmp11167 = icmp ugt i32 %6, 5 %cmp14168 = icmp ugt i32 %6, 3 %cmp17170 = icmp ult i32 %6, 6 %cond.in171 = select i1 %cmp11167, i1 %cmp14168, i1 %cmp17170 br i1 %cond.in171, label %for.body, label %if.end130 for.body: ; preds = %for.cond.preheader, %for.inc %7 = phi i32 [ %9, %for.inc ], [ %6, %for.cond.preheader ] %i.0172 = phi i32 [ %i.1, %for.inc ], [ 1, %for.cond.preheader ] %8 = load i32, ptr %k, align 4, !tbaa !5 %cmp20.not = icmp eq i32 %i.0172, %8 br i1 %cmp20.not, label %for.inc, label %land.lhs.true22 land.lhs.true22: ; preds = %for.body %sub23 = add nsw i32 %7, -1 %sub24 = sub nsw i32 %sub23, %8 %cmp25.not = icmp eq i32 %i.0172, %sub24 br i1 %cmp25.not, label %for.inc, label %if.then27 if.then27: ; preds = %land.lhs.true22 %sub29 = sub nsw i32 %sub23, %i.0172 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.0172, i32 noundef %sub29) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true22, %if.then27 %9 = phi i32 [ %7, %for.body ], [ %7, %land.lhs.true22 ], [ %.pre, %if.then27 ] %cmp33 = icmp sgt i32 %9, 5 %i.1.v = select i1 %cmp33, i32 1, i32 -1 %i.1 = add nsw i32 %i.1.v, %i.0172 %div = sdiv i32 %9, 2 %cmp14 = icmp slt i32 %i.1, %div %sub10 = add nsw i32 %div, -1 %cmp17 = icmp sge i32 %i.1, %sub10 %cond.in = select i1 %cmp33, i1 %cmp14, i1 %cmp17 br i1 %cond.in, label %for.body, label %if.end130, !llvm.loop !9 if.else: ; preds = %while.body %cmp41 = icmp eq i32 %1, 0 br i1 %cmp41, label %for.cond45.preheader, label %if.else80 for.cond45.preheader: ; preds = %if.else %cmp48160 = icmp sgt i32 %2, 3 %cmp53161 = icmp sgt i32 %2, 1 %cmp58163 = icmp slt i32 %2, 4 %cond61.in164 = select i1 %cmp48160, i1 %cmp53161, i1 %cmp58163 br i1 %cond61.in164, label %for.body64, label %if.end130 for.body64: ; preds = %for.cond45.preheader, %for.body64 %10 = phi i32 [ %12, %for.body64 ], [ %2, %for.cond45.preheader ] %i44.0165 = phi i32 [ %i44.1, %for.body64 ], [ 0, %for.cond45.preheader ] %11 = xor i32 %i44.0165, -1 %sub66 = add i32 %10, %11 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i44.0165, i32 noundef %sub66) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp71 = icmp sgt i32 %12, 3 %i44.1.v = select i1 %cmp71, i32 1, i32 -1 %i44.1 = add nsw i32 %i44.1.v, %i44.0165 %div46 = sdiv i32 %12, 2 %cmp53 = icmp slt i32 %i44.1, %div46 %sub47 = add nsw i32 %div46, -1 %cmp58 = icmp sge i32 %i44.1, %sub47 %cond61.in = select i1 %cmp71, i1 %cmp53, i1 %cmp58 br i1 %cond61.in, label %for.body64, label %if.end130, !llvm.loop !11 if.else80: ; preds = %if.else %cmp81 = icmp slt i32 %2, 5 br i1 %cmp81, label %if.then83, label %if.else85 if.then83: ; preds = %if.else80 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end130 if.else85: ; preds = %if.else80 %sub87 = add nsw i32 %2, -2 %call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub87) %13 = load i32, ptr %n, align 4, !tbaa !5 %sub89 = add nsw i32 %13, -3 %call90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1, i32 noundef %sub89) %call91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0, i32 noundef 2) %14 = load i32, ptr %n, align 4, !tbaa !5 %cmp96153 = icmp sgt i32 %14, 9 %cmp101154 = icmp sgt i32 %14, 7 %cmp106156 = icmp slt i32 %14, 10 %cond109.in157 = select i1 %cmp96153, i1 %cmp101154, i1 %cmp106156 br i1 %cond109.in157, label %for.body112, label %if.end130 for.body112: ; preds = %if.else85, %for.body112 %15 = phi i32 [ %17, %for.body112 ], [ %14, %if.else85 ] %i92.0158 = phi i32 [ %i92.1, %for.body112 ], [ 3, %if.else85 ] %16 = xor i32 %i92.0158, -1 %sub114 = add i32 %15, %16 %call115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i92.0158, i32 noundef %sub114) %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp119 = icmp sgt i32 %17, 9 %i92.1.v = select i1 %cmp119, i32 1, i32 -1 %i92.1 = add nsw i32 %i92.1.v, %i92.0158 %div94 = sdiv i32 %17, 2 %cmp101 = icmp slt i32 %i92.1, %div94 %sub95 = add nsw i32 %div94, -1 %cmp106 = icmp sge i32 %i92.1, %sub95 %cond109.in = select i1 %cmp119, i1 %cmp101, i1 %cmp106 br i1 %cond109.in, label %for.body112, label %if.end130, !llvm.loop !12 if.end130: ; preds = %for.body112, %for.body64, %for.inc, %if.else85, %for.cond45.preheader, %for.cond.preheader, %if.then83, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %18 = load i32, ptr %q, align 4, !tbaa !5 %dec = add nsw i32 %18, -1 store i32 %dec, ptr %q, align 4, !tbaa !5 %tobool.not = icmp eq i32 %18, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end130, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 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 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(void){ int i,j,k,v,N,A[100]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(i=1;i<=N-1;i++){ for(k=0;k<N;k++){ printf("%d",A[k]); if(k<N-1){ printf(" "); }else{ printf("\n"); } } v=A[i]; j=i-1; while(j>=0&&A[j]>v){ A[j+1]=A[j]; j--; } A[j+1]=v; } for(k=0;k<N;k++){ printf("%d",A[k]); if(k<N-1){ printf(" "); }else{ printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116643/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116643/source.c" target datalayout = "e-m:e-p270: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 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %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 %cmp73 = icmp sgt i32 %0, 0 br i1 %cmp73, label %for.body, label %for.end50 for.cond2.preheader: ; preds = %for.body %cmp3.not.not80 = icmp sgt i32 %1, 1 br i1 %cmp3.not.not80, label %for.cond5.preheader, label %for.cond35.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond2.preheader, %while.end %3 = phi i32 [ %10, %while.end ], [ %1, %for.cond2.preheader ] %indvars.iv97 = phi i64 [ %indvars.iv.next98, %while.end ], [ 1, %for.cond2.preheader ] %cmp675 = icmp sgt i32 %3, 0 br i1 %cmp675, label %for.body7, label %for.end17 for.cond35.preheader: ; preds = %while.end, %for.cond2.preheader %4 = phi i32 [ %1, %for.cond2.preheader ], [ %10, %while.end ] %cmp3682 = icmp sgt i32 %4, 0 br i1 %cmp3682, label %for.body37, label %for.end50 for.body7: ; preds = %for.cond5.preheader, %for.body7 %indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body7 ], [ 0, %for.cond5.preheader ] %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv93 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5) %6 = load i32, ptr %N, align 4, !tbaa !5 %sub11 = add nsw i32 %6, -1 %7 = sext i32 %sub11 to i64 %cmp12 = icmp slt i64 %indvars.iv93, %7 %. = select i1 %cmp12, i32 32, i32 10 %putchar72 = call i32 @putchar(i32 %.) %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp6 = icmp slt i64 %indvars.iv.next94, %9 br i1 %cmp6, label %for.body7, label %for.end17, !llvm.loop !11 for.end17: ; preds = %for.body7, %for.cond5.preheader %10 = phi i32 [ %3, %for.cond5.preheader ], [ %8, %for.body7 ] %arrayidx19 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv97 %11 = load i32, ptr %arrayidx19, align 4, !tbaa !5 br label %land.rhs land.rhs: ; preds = %for.end17, %while.body %indvars.iv99 = phi i64 [ %indvars.iv97, %for.end17 ], [ %indvars.iv.next100, %while.body ] %indvars.iv.next100 = add nsw i64 %indvars.iv99, -1 %idxprom22 = and i64 %indvars.iv.next100, 4294967295 %arrayidx23 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom22 %12 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %12, %11 br i1 %cmp24, label %while.body, label %while.end while.body: ; preds = %land.rhs %arrayidx28 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv99 store i32 %12, ptr %arrayidx28, align 4, !tbaa !5 %13 = icmp sgt i64 %indvars.iv99, 1 br i1 %13, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %land.rhs %j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv99, %land.rhs ] %sext = shl i64 %j.0.in.lcssa, 32 %idxprom30 = ashr exact i64 %sext, 32 %arrayidx31 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom30 store i32 %11, ptr %arrayidx31, align 4, !tbaa !5 %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1 %14 = sext i32 %10 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv.next98, %14 br i1 %cmp3.not.not, label %for.cond5.preheader, label %for.cond35.preheader, !llvm.loop !13 for.body37: ; preds = %for.cond35.preheader, %for.body37 %indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body37 ], [ 0, %for.cond35.preheader ] %arrayidx39 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv106 %15 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15) %16 = load i32, ptr %N, align 4, !tbaa !5 %sub41 = add nsw i32 %16, -1 %17 = sext i32 %sub41 to i64 %cmp42 = icmp slt i64 %indvars.iv106, %17 %.115 = select i1 %cmp42, i32 32, i32 10 %putchar70 = call i32 @putchar(i32 %.115) %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1 %18 = load i32, ptr %N, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp36 = icmp slt i64 %indvars.iv.next107, %19 br i1 %cmp36, label %for.body37, label %for.end50, !llvm.loop !15 for.end50: ; preds = %for.body37, %entry, %for.cond35.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #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, !14} !14 = !{!"llvm.loop.unswitch.partial.disable"} !15 = distinct !{!15, !10}
#include <stdio.h> void trace(int a[],int N) { int i; for(i=0;i<N;i++) { if(i>0) printf(" "); printf("%d",a[i]); } printf("\n"); } void insertionSort(int a[],int N) { int i,j,v; for(i=1;i<=N-1;i++) { v=a[i]; j=i-1; while(j>=0&&a[j]>v) { a[j+1]=a[j]; j--; } a[j+1]=v; trace(a,N); } } int main() { int i,j,N; int a[100]; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",&a[i]); trace(a,N); insertionSort(a,N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116687/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116687/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @trace(ptr nocapture noundef readonly %a, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i32 %N, 0 br i1 %cmp8, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %.pre = load i32, ptr %a, align 4, !tbaa !5 %call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %N, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar7 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %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 %if.end, !llvm.loop !9 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 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: 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 uwtable define dso_local void @insertionSort(ptr nocapture noundef %a, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp.not.not31 = icmp sgt i32 %N, 1 br i1 %cmp.not.not31, label %for.body.us.preheader, label %for.end for.body.us.preheader: ; preds = %entry %wide.trip.count.i = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us %indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ] %arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body.us %indvars.iv35 = phi i64 [ %indvars.iv.next36, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next36 = add nsw i64 %indvars.iv35, -1 %idxprom3.us = and i64 %indvars.iv.next36, 4294967295 %arrayidx4.us = getelementptr inbounds i32, ptr %a, i64 %idxprom3.us %1 = load i32, ptr %arrayidx4.us, align 4, !tbaa !5 %cmp5.us = icmp sgt i32 %1, %0 br i1 %cmp5.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv35, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom11.us = ashr exact i64 %sext, 32 %arrayidx12.us = getelementptr inbounds i32, ptr %a, i64 %idxprom11.us store i32 %0, ptr %arrayidx12.us, align 4, !tbaa !5 %.pre.i.us = load i32, ptr %a, align 4, !tbaa !5 %call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us) br label %if.end.i.us if.end.i.us: ; preds = %while.end.us, %if.end.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ] %putchar7.i.us = tail call i32 @putchar(i32 32) %arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us %2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9 while.body.us: ; preds = %land.rhs.us %arrayidx9.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv35 store i32 %1, ptr %arrayidx9.us, align 4, !tbaa !5 %3 = icmp sgt i64 %indvars.iv35, 1 br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12 trace.exit.loopexit.us: ; preds = %if.end.i.us %putchar.i.us = tail call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13 for.end: ; preds = %trace.exit.loopexit.us, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %trace.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body %cmp8.i = icmp sgt i32 %1, 0 br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit if.end.peel.i: ; preds = %for.end %wide.trip.count.i = zext i32 %1 to i64 %.pre.i = load i32, ptr %a, align 16, !tbaa !5 %call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i) %exitcond.peel.not.i = icmp eq i32 %1, 1 br i1 %exitcond.peel.not.i, label %trace.exit, label %if.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 ] %putchar7.i = call i32 @putchar(i32 32) %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %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 %trace.exit, label %if.end.i, !llvm.loop !9 trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not.not31.i = icmp sgt i32 %4, 1 br i1 %cmp.not.not31.i, label %for.body.us.preheader.i, label %insertionSort.exit for.body.us.preheader.i: ; preds = %trace.exit %wide.trip.count.i.i = zext i32 %4 to i64 br label %for.body.us.i for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i %indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i5 %5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 br label %land.rhs.us.i land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i %indvars.iv35.i = phi i64 [ %indvars.iv.next36.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ] %indvars.iv.next36.i = add nsw i64 %indvars.iv35.i, -1 %idxprom3.us.i = and i64 %indvars.iv.next36.i, 4294967295 %arrayidx4.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom3.us.i %6 = load i32, ptr %arrayidx4.us.i, align 4, !tbaa !5 %cmp5.us.i = icmp sgt i32 %6, %5 br i1 %cmp5.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i %j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv35.i, %land.rhs.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.i, 32 %idxprom11.us.i = ashr exact i64 %sext.i, 32 %arrayidx12.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom11.us.i store i32 %5, ptr %arrayidx12.us.i, align 4, !tbaa !5 %.pre.i.us.i = load i32, ptr %a, align 16, !tbaa !5 %call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i) br label %if.end.i.us.i if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ] %putchar7.i.us.i = call i32 @putchar(i32 32) %arrayidx.i.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us.i %7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx9.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv35.i store i32 %6, ptr %arrayidx9.us.i, align 4, !tbaa !5 %8 = icmp sgt i64 %indvars.iv35.i, 1 br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12 trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i %putchar.i.us.i = call i32 @putchar(i32 10) %indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1 %exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13 insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #define N 100 void output(int *,int); void insertionSort(int *,int); int main() { int n,i; int a[N]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } output(a,n); insertionSort(a,n); return 0; } void output(int *a,int n) { int i; for(i=0;i<n-1;i++){ printf("%d ",a[i]); } printf("%d\n",a[n-1]); } void insertionSort(int *a,int n) { int i,j,v; for(i=1;i<n;i++){ v = a[i]; j = i - 1; while( j >= 0 && a[j] > v ){ a[j+1] = a[j]; j--; } a[j+1] = v; output(a,n); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116773/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116773/source.c" target datalayout = "e-m:e-p270: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: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry %sub.i14 = add i32 %0, -1 br label %output.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %sub.i = add i32 %1, -1 %cmp9.i = icmp sgt i32 %1, 1 br i1 %cmp9.i, label %for.body.preheader.i, label %output.exit for.body.preheader.i: ; preds = %for.end %wide.trip.count.i = zext i32 %sub.i to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %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 %output.exit, label %for.body.i, !llvm.loop !11 output.exit: ; preds = %for.body.i, %for.end.thread, %for.end %sub.i16 = phi i32 [ %sub.i14, %for.end.thread ], [ %sub.i, %for.end ], [ %sub.i, %for.body.i ] %idxprom2.i = sext i32 %sub.i16 to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i %4 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %call4.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4) %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp30.i = icmp sgt i32 %5, 1 br i1 %cmp30.i, label %for.body.lr.ph.i, label %insertionSort.exit for.body.lr.ph.i: ; preds = %output.exit %sub.i.i = add nsw i32 %5, -1 %wide.trip.count.i.i = zext i32 %sub.i.i to i64 %arrayidx3.i.i = getelementptr inbounds i32, ptr %a, i64 %wide.trip.count.i.i %wide.trip.count.i5 = zext i32 %5 to i64 br label %for.body.us.i for.body.us.i: ; preds = %output.exit.loopexit.us.i, %for.body.lr.ph.i %indvars.iv.i6 = phi i64 [ %indvars.iv.next.i7, %output.exit.loopexit.us.i ], [ 1, %for.body.lr.ph.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i6 %6 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 br label %land.rhs.us.i land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i %indvars.iv32.i = phi i64 [ %indvars.iv.next33.i, %while.body.us.i ], [ %indvars.iv.i6, %for.body.us.i ] %indvars.iv.next33.i = add nsw i64 %indvars.iv32.i, -1 %idxprom2.us.i = and i64 %indvars.iv.next33.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us.i %7 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp sgt i32 %7, %6 br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i %j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv32.i, %land.rhs.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom10.us.i store i32 %6, ptr %arrayidx11.us.i, align 4, !tbaa !5 br label %for.body.i.us.i for.body.i.us.i: ; preds = %for.body.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next.i.us.i, %for.body.i.us.i ] %arrayidx.i.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us.i %8 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %output.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !11 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx8.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv32.i store i32 %7, ptr %arrayidx8.us.i, align 4, !tbaa !5 %9 = icmp sgt i64 %indvars.iv32.i, 1 br i1 %9, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12 output.exit.loopexit.us.i: ; preds = %for.body.i.us.i %10 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5 %call4.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1 %exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %wide.trip.count.i5 br i1 %exitcond.not.i8, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13 insertionSort.exit: ; preds = %output.exit.loopexit.us.i, %output.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #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 uwtable define dso_local void @output(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 { entry: %sub = add i32 %n, -1 %cmp9 = icmp sgt i32 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %sub to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %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 !11 for.end: ; preds = %for.body, %entry %idxprom2 = sext i32 %sub to i64 %arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2 %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @insertionSort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp30 = icmp sgt i32 %n, 1 br i1 %cmp30, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %sub.i = add nsw i32 %n, -1 %wide.trip.count.i = zext i32 %sub.i to i64 %idxprom2.i = zext i32 %sub.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i %wide.trip.count = zext i32 %n to i64 br label %for.body.us for.body.us: ; preds = %output.exit.loopexit.us, %for.body.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %output.exit.loopexit.us ], [ 1, %for.body.lr.ph ] %arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body.us %indvars.iv32 = phi i64 [ %indvars.iv.next33, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next33 = add nsw i64 %indvars.iv32, -1 %idxprom2.us = and i64 %indvars.iv.next33, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us %1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp sgt i32 %1, %0 br i1 %cmp4.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv32, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %a, i64 %idxprom10.us store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5 br label %for.body.i.us for.body.i.us: ; preds = %for.body.i.us, %while.end.us %indvars.iv.i.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i.us, %for.body.i.us ] %arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us %2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %output.exit.loopexit.us, label %for.body.i.us, !llvm.loop !11 while.body.us: ; preds = %land.rhs.us %arrayidx8.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv32 store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5 %3 = icmp sgt i64 %indvars.iv32, 1 br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12 output.exit.loopexit.us: ; preds = %for.body.i.us %4 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %call4.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13 for.end: ; preds = %output.exit.loopexit.us, %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 #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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int A[100],N,i,j,key; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",&A[i]); for(j=0;j<N;j++){ printf("%d",A[j]); if(j<N-1) printf(" "); } printf("\n"); for(i=1;i<N;i++){ key=A[i]; j=i-1; while(j>=0 && A[j]>key){ A[j+1]=A[j]; j--; } A[j+1]=key; for(j=0;j<N;j++){ printf("%d",A[j]); if(j<N-1) printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116816/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116816/source.c" target datalayout = "e-m:e-p270: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 [100 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp72 = icmp sgt i32 %0, 0 br i1 %cmp72, label %for.body, label %for.end12 for.cond2.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body4, label %for.end12 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc10 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.inc10 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv84 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %5 = load i32, ptr %N, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %6 = sext i32 %sub to i64 %cmp8 = icmp slt i64 %indvars.iv84, %6 br i1 %cmp8, label %if.then, label %for.inc10 if.then: ; preds = %for.body4 %putchar71 = call i32 @putchar(i32 32) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc10 for.inc10: ; preds = %for.body4, %if.then %7 = phi i32 [ %5, %for.body4 ], [ %.pre, %if.then ] %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %8 = sext i32 %7 to i64 %cmp3 = icmp slt i64 %indvars.iv.next85, %8 br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.inc10, %entry, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) %9 = load i32, ptr %N, align 4, !tbaa !5 %cmp1581 = icmp sgt i32 %9, 1 br i1 %cmp1581, label %for.body16, label %for.end48 for.body16: ; preds = %for.end12, %for.end44 %10 = phi i32 [ %19, %for.end44 ], [ %9, %for.end12 ] %indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end44 ], [ 1, %for.end12 ] %arrayidx18 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv87 %11 = load i32, ptr %arrayidx18, align 4, !tbaa !5 br label %land.rhs land.rhs: ; preds = %for.body16, %while.body %indvars.iv89 = phi i64 [ %indvars.iv87, %for.body16 ], [ %indvars.iv.next90, %while.body ] %indvars.iv.next90 = add nsw i64 %indvars.iv89, -1 %idxprom21 = and i64 %indvars.iv.next90, 4294967295 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom21 %12 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %12, %11 br i1 %cmp23, label %while.body, label %while.end while.body: ; preds = %land.rhs %arrayidx27 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv89 store i32 %12, ptr %arrayidx27, align 4, !tbaa !5 %13 = icmp sgt i64 %indvars.iv89, 1 br i1 %13, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %while.body, %land.rhs %j.1.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv89, %land.rhs ] %sext = shl i64 %j.1.in.lcssa, 32 %idxprom29 = ashr exact i64 %sext, 32 %arrayidx30 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom29 store i32 %11, ptr %arrayidx30, align 4, !tbaa !5 %cmp3279 = icmp sgt i32 %10, 0 br i1 %cmp3279, label %for.body33, label %for.end44 for.body33: ; preds = %while.end, %for.inc42 %indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.inc42 ], [ 0, %while.end ] %arrayidx35 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv92 %14 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %15 = load i32, ptr %N, align 4, !tbaa !5 %sub37 = add nsw i32 %15, -1 %16 = sext i32 %sub37 to i64 %cmp38 = icmp slt i64 %indvars.iv92, %16 br i1 %cmp38, label %if.then39, label %for.inc42 if.then39: ; preds = %for.body33 %putchar70 = call i32 @putchar(i32 32) %.pre98 = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body33, %if.then39 %17 = phi i32 [ %15, %for.body33 ], [ %.pre98, %if.then39 ] %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %18 = sext i32 %17 to i64 %cmp32 = icmp slt i64 %indvars.iv.next93, %18 br i1 %cmp32, label %for.body33, label %for.end44, !llvm.loop !13 for.end44: ; preds = %for.inc42, %while.end %putchar69 = call i32 @putchar(i32 10) %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %19 = load i32, ptr %N, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp15 = icmp slt i64 %indvars.iv.next88, %20 br i1 %cmp15, label %for.body16, label %for.end48, !llvm.loop !14 for.end48: ; preds = %for.end44, %for.end12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 400, 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} !14 = distinct !{!14, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { int x, y, z, i, j, k, a, b, c, n, m, t, mat[210210]; scanf("%d",&t); while(t--) { c = 0; scanf("%d", &n); for(x = 0; x < n; x++) scanf("%d", &mat[x]); i = n - 1; while(i > 0 && mat[i] == mat[i - 1]) i--; k = n - i; while(k < n) { k *= 2; c++; while(k < n && mat[n - 1] == mat[n - k - 1]) k++; } printf("%d\n", c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11686/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11686/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %t = alloca i32, align 4 %mat = alloca [210210 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 %t) #3 call void @llvm.lifetime.start.p0(i64 840840, ptr nonnull %mat) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec58 = add nsw i32 %0, -1 store i32 %dec58, ptr %t, align 4, !tbaa !5 %tobool.not59 = icmp eq i32 %0, 0 br i1 %tobool.not59, label %while.end35, label %while.body while.body: ; preds = %entry, %while.end33 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp48 = icmp sgt i32 %1, 0 br i1 %cmp48, label %for.body, label %while.cond3.preheader while.cond3.preheader: ; preds = %for.body, %while.body %.lcssa = phi i32 [ %1, %while.body ], [ %3, %for.body ] %2 = zext i32 %.lcssa to i64 br label %while.cond3 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [210210 x i32], ptr %mat, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %while.cond3.preheader, !llvm.loop !9 while.cond3: ; preds = %while.cond3.preheader, %land.rhs %indvars.iv62 = phi i64 [ %2, %while.cond3.preheader ], [ %indvars.iv.next63, %land.rhs ] %5 = trunc i64 %indvars.iv62 to i32 %cmp4 = icmp sgt i32 %5, 1 br i1 %cmp4, label %land.rhs, label %while.end33 land.rhs: ; preds = %while.cond3 %indvars.iv.next63 = add nsw i64 %indvars.iv62, -1 %idxprom5 = and i64 %indvars.iv.next63, 4294967295 %arrayidx6 = getelementptr inbounds [210210 x i32], ptr %mat, i64 0, i64 %idxprom5 %6 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %sub7 = add i64 %indvars.iv62, 4294967294 %idxprom8 = and i64 %sub7, 4294967295 %arrayidx9 = getelementptr inbounds [210210 x i32], ptr %mat, i64 0, i64 %idxprom8 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %6, %7 br i1 %cmp10, label %while.cond3, label %while.body16.lr.ph, !llvm.loop !11 while.body16.lr.ph: ; preds = %land.rhs %indvars.le = trunc i64 %indvars.iv.next63 to i32 %sub13 = sub nsw i32 %.lcssa, %indvars.le %sub21 = add nsw i32 %.lcssa, -1 %idxprom22 = sext i32 %sub21 to i64 %arrayidx23 = getelementptr inbounds [210210 x i32], ptr %mat, i64 0, i64 %idxprom22 %8 = sext i32 %.lcssa to i64 br label %while.body16 while.body16: ; preds = %while.body16.lr.ph, %while.end32 %c.056 = phi i32 [ 0, %while.body16.lr.ph ], [ %inc17, %while.end32 ] %k.055 = phi i32 [ %sub13, %while.body16.lr.ph ], [ %k.1.lcssa, %while.end32 ] %mul = shl nsw i32 %k.055, 1 %inc17 = add nuw nsw i32 %c.056, 1 %cmp1950 = icmp slt i32 %mul, %.lcssa br i1 %cmp1950, label %land.rhs20.lr.ph, label %while.end32 land.rhs20.lr.ph: ; preds = %while.body16 %9 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %10 = sext i32 %mul to i64 br label %land.rhs20 land.rhs20: ; preds = %land.rhs20.lr.ph, %while.body30 %indvars.iv65 = phi i64 [ %10, %land.rhs20.lr.ph ], [ %indvars.iv.next66, %while.body30 ] %11 = trunc i64 %indvars.iv65 to i32 %12 = xor i32 %11, -1 %sub25 = add i32 %.lcssa, %12 %idxprom26 = sext i32 %sub25 to i64 %arrayidx27 = getelementptr inbounds [210210 x i32], ptr %mat, i64 0, i64 %idxprom26 %13 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp eq i32 %9, %13 br i1 %cmp28, label %while.body30, label %while.end32 while.body30: ; preds = %land.rhs20 %indvars.iv.next66 = add nsw i64 %indvars.iv65, 1 %exitcond.not = icmp eq i64 %indvars.iv.next66, %8 br i1 %exitcond.not, label %while.end33, label %land.rhs20, !llvm.loop !12 while.end32: ; preds = %land.rhs20, %while.body16 %k.1.lcssa = phi i32 [ %mul, %while.body16 ], [ %11, %land.rhs20 ] %cmp15 = icmp slt i32 %k.1.lcssa, %.lcssa br i1 %cmp15, label %while.body16, label %while.end33, !llvm.loop !13 while.end33: ; preds = %while.cond3, %while.end32, %while.body30 %c.0.lcssa = phi i32 [ %inc17, %while.body30 ], [ %inc17, %while.end32 ], [ 0, %while.cond3 ] %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) %14 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %14, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %14, 0 br i1 %tobool.not, label %while.end35, label %while.body, !llvm.loop !14 while.end35: ; preds = %while.end33, %entry call void @llvm.lifetime.end.p0(i64 840840, ptr nonnull %mat) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #define N 100 int main(){ int i, j, k, key, n, A[N]; scanf("%d", &n); for(i = 0; i < n ; i++)scanf("%d", &A[i]); for(i = 1; i <= n; i++){ key = A[i]; j = i - 1; for(k=0; k < n; k++){ printf("%d", A[k]); if(k < n-1)printf(" "); } printf("\n"); while(j >= 0 && A[j] > key){ A[j+1] = A[j]; j--; A[j+1] = key; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116902/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116902/source.c" target datalayout = "e-m:e-p270: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 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %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 %cmp51 = icmp sgt i32 %0, 0 br i1 %cmp51, label %for.body, label %for.end33 for.cond2.preheader: ; preds = %for.body %cmp3.not58 = icmp slt i32 %1, 1 br i1 %cmp3.not58, label %for.end33, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc31 %3 = phi i32 [ %12, %for.inc31 ], [ %1, %for.cond2.preheader ] %indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.inc31 ], [ 1, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv64 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp853 = icmp sgt i32 %3, 0 br i1 %cmp853, label %for.body9, label %for.end18 for.body9: ; preds = %for.body4, %for.inc16 %indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.inc16 ], [ 0, %for.body4 ] %arrayidx11 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv61 %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5) %6 = load i32, ptr %n, align 4, !tbaa !5 %sub13 = add nsw i32 %6, -1 %7 = sext i32 %sub13 to i64 %cmp14 = icmp slt i64 %indvars.iv61, %7 br i1 %cmp14, label %if.then, label %for.inc16 if.then: ; preds = %for.body9 %putchar50 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc16 for.inc16: ; preds = %for.body9, %if.then %8 = phi i32 [ %6, %for.body9 ], [ %.pre, %if.then ] %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %9 = sext i32 %8 to i64 %cmp8 = icmp slt i64 %indvars.iv.next62, %9 br i1 %cmp8, label %for.body9, label %for.end18, !llvm.loop !11 for.end18: ; preds = %for.inc16, %for.body4 %putchar = call i32 @putchar(i32 10) br label %land.rhs land.rhs: ; preds = %for.end18, %while.body %indvars.iv66 = phi i64 [ %indvars.iv64, %for.end18 ], [ %indvars.iv.next67, %while.body ] %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1 %idxprom21 = and i64 %indvars.iv.next67, 4294967295 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom21 %10 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %10, %4 br i1 %cmp23, label %while.body, label %for.inc31 while.body: ; preds = %land.rhs %arrayidx27 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv66 store i32 %10, ptr %arrayidx27, align 4, !tbaa !5 store i32 %4, ptr %arrayidx22, align 4, !tbaa !5 %11 = icmp sgt i64 %indvars.iv66, 1 br i1 %11, label %land.rhs, label %for.inc31, !llvm.loop !12 for.inc31: ; preds = %land.rhs, %while.body %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv64, %13 br i1 %cmp3.not.not, label %for.body4, label %for.end33, !llvm.loop !13 for.end33: ; preds = %for.inc31, %entry, %for.cond2.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #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> void trace(int A[], int N){ int i; for (i=0;i<N;i++){ if (i>0) printf(" "); printf("%d",A[i]); } printf("\n"); } void insertionSort(int A[], int N){ int j, i, v; for (i=1;i<N;i++){ v = A[i]; j = i-1; while (j >= 0 && A[j] > v){ A[j+1] =A[j]; j--; } A[j+1] = v; trace(A,N); } } int main(){ int N, i, j; int A[100]; scanf("%d", &N); for (i=0;i<N;i++) scanf("%d", &A[i]); trace(A,N); insertionSort(A,N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116946/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116946/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i32 %N, 0 br i1 %cmp8, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %.pre = load i32, ptr %A, align 4, !tbaa !5 %call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %N, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar7 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %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 %if.end, !llvm.loop !9 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 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: 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 uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp30 = icmp sgt i32 %N, 1 br i1 %cmp30, label %for.body.us.preheader, label %for.end for.body.us.preheader: ; preds = %entry %wide.trip.count.i = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us %indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ] %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %for.body.us %indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ] %indvars.iv.next35 = add nsw i64 %indvars.iv34, -1 %idxprom2.us = and i64 %indvars.iv.next35, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp sgt i32 %1, %0 br i1 %cmp4.us, label %while.body.us, label %while.end.us while.end.us: ; preds = %while.body.us, %land.rhs.us %j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ] %sext = shl i64 %j.0.in.lcssa.us, 32 %idxprom10.us = ashr exact i64 %sext, 32 %arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5 %.pre.i.us = load i32, ptr %A, align 4, !tbaa !5 %call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us) br label %if.end.i.us if.end.i.us: ; preds = %while.end.us, %if.end.i.us %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ] %putchar7.i.us = tail call i32 @putchar(i32 32) %arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us %2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9 while.body.us: ; preds = %land.rhs.us %arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34 store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5 %3 = icmp sgt i64 %indvars.iv34, 1 br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12 trace.exit.loopexit.us: ; preds = %if.end.i.us %putchar.i.us = tail call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13 for.end: ; preds = %trace.exit.loopexit.us, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %trace.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body %cmp8.i = icmp sgt i32 %1, 0 br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit if.end.peel.i: ; preds = %for.end %wide.trip.count.i = zext i32 %1 to i64 %.pre.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i) %exitcond.peel.not.i = icmp eq i32 %1, 1 br i1 %exitcond.peel.not.i, label %trace.exit, label %if.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 ] %putchar7.i = call i32 @putchar(i32 32) %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %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 %trace.exit, label %if.end.i, !llvm.loop !9 trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i %putchar.i = call i32 @putchar(i32 10) %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp30.i = icmp sgt i32 %4, 1 br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit for.body.us.preheader.i: ; preds = %trace.exit %wide.trip.count.i.i = zext i32 %4 to i64 br label %for.body.us.i for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i %indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ] %arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5 %5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 br label %land.rhs.us.i land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i %indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ] %indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1 %idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i %6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp sgt i32 %6, %5 br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i %j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ] %sext.i = shl i64 %j.0.in.lcssa.us.i, 32 %idxprom10.us.i = ashr exact i64 %sext.i, 32 %arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5 %.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5 %call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i) br label %if.end.i.us.i if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i %indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ] %putchar7.i.us.i = call i32 @putchar(i32 32) %arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i %7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5 %call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9 while.body.us.i: ; preds = %land.rhs.us.i %arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5 %8 = icmp sgt i64 %indvars.iv34.i, 1 br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12 trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i %putchar.i.us.i = call i32 @putchar(i32 10) %indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1 %exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13 insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> long max(long arr[],long n) { long m=0; for(long a=0;a<n;a++) { if(arr[a]>m) m=arr[a]; } return m; } int main() { long t; scanf("%ld",&t); while(t--) { long n; scanf("%ld",&n); long arr[2][n]; for(long a=0;a<2*n;a++) scanf("%*c%ld",&arr[a/n][a%n]); long ma=max(arr[0],n),mb=max(arr[1],n); long x=ma<mb?1:0; long y=(x+1)%2; for(long a=0;a<n;a++) { if(arr[y][a]>arr[x][a]) { long temp=arr[y][a]; arr[y][a]=arr[x][a]; arr[x][a]=temp; } } printf("%ld\n",max(arr[x],n)*max(arr[y],n)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11699/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11699/source.c" target datalayout = "e-m:e-p270: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"%ld\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%*c%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @max(ptr nocapture noundef readonly %arr, i64 noundef %n) local_unnamed_addr #0 { entry: %cmp8 = icmp sgt i64 %n, 0 br i1 %cmp8, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader13, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ] %vec.phi11 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %arr, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load12 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %vec.phi) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load12, <2 x i64> %vec.phi11) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader13 for.body.preheader13: ; preds = %for.body.preheader, %middle.block %a.010.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %m.09.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %m.0.lcssa = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %spec.select, %for.body ] ret i64 %m.0.lcssa for.body: ; preds = %for.body.preheader13, %for.body %a.010 = phi i64 [ %inc, %for.body ], [ %a.010.ph, %for.body.preheader13 ] %m.09 = phi i64 [ %spec.select, %for.body ], [ %m.09.ph, %for.body.preheader13 ] %arrayidx = getelementptr inbounds i64, ptr %arr, i64 %a.010 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %spec.select = tail call i64 @llvm.smax.i64(i64 %6, i64 %m.09) %inc = add nuw nsw i64 %a.010, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: %t = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec99 = add nsw i64 %0, -1 store i64 %dec99, ptr %t, align 8, !tbaa !5 %tobool.not100 = icmp eq i64 %0, 0 br i1 %tobool.not100, label %while.end, label %while.body while.body: ; preds = %entry, %max.exit87 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i64, ptr %n, align 8, !tbaa !5 %2 = call ptr @llvm.stacksave.p0() %3 = shl nuw i64 %1, 1 %vla = alloca i64, i64 %3, align 16 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp95 = icmp sgt i64 %4, 0 br i1 %cmp95, label %for.body, label %max.exit87 for.cond.cleanup: ; preds = %for.body %cmp8.i = icmp sgt i64 %24, 0 br i1 %cmp8.i, label %for.body.i.preheader, label %max.exit87 for.body.i.preheader: ; preds = %for.cond.cleanup %min.iters.check167 = icmp ult i64 %24, 4 br i1 %min.iters.check167, label %for.body.i.preheader184, label %vector.ph168 vector.ph168: ; preds = %for.body.i.preheader %n.vec170 = and i64 %24, -4 br label %vector.body173 vector.body173: ; preds = %vector.body173, %vector.ph168 %index174 = phi i64 [ 0, %vector.ph168 ], [ %index.next179, %vector.body173 ] %vec.phi175 = phi <2 x i64> [ zeroinitializer, %vector.ph168 ], [ %7, %vector.body173 ] %vec.phi176 = phi <2 x i64> [ zeroinitializer, %vector.ph168 ], [ %8, %vector.body173 ] %5 = getelementptr inbounds i64, ptr %vla, i64 %index174 %wide.load177 = load <2 x i64>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i64, ptr %5, i64 2 %wide.load178 = load <2 x i64>, ptr %6, align 16, !tbaa !5 %7 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load177, <2 x i64> %vec.phi175) %8 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load178, <2 x i64> %vec.phi176) %index.next179 = add nuw i64 %index174, 4 %9 = icmp eq i64 %index.next179, %n.vec170 br i1 %9, label %middle.block165, label %vector.body173, !llvm.loop !14 middle.block165: ; preds = %vector.body173 %rdx.minmax180 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %7, <2 x i64> %8) %10 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax180) %cmp.n172 = icmp eq i64 %24, %n.vec170 br i1 %cmp.n172, label %max.exit, label %for.body.i.preheader184 for.body.i.preheader184: ; preds = %for.body.i.preheader, %middle.block165 %a.010.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec170, %middle.block165 ] %m.09.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %10, %middle.block165 ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader184, %for.body.i %a.010.i = phi i64 [ %inc.i, %for.body.i ], [ %a.010.i.ph, %for.body.i.preheader184 ] %m.09.i = phi i64 [ %spec.select.i, %for.body.i ], [ %m.09.i.ph, %for.body.i.preheader184 ] %arrayidx.i = getelementptr inbounds i64, ptr %vla, i64 %a.010.i %11 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %spec.select.i = call i64 @llvm.smax.i64(i64 %11, i64 %m.09.i) %inc.i = add nuw nsw i64 %a.010.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %24 br i1 %exitcond.not.i, label %max.exit, label %for.body.i, !llvm.loop !15 max.exit: ; preds = %for.body.i, %middle.block165 %spec.select.i.lcssa = phi i64 [ %10, %middle.block165 ], [ %spec.select.i, %for.body.i ] %arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %1 %min.iters.check150 = icmp ult i64 %24, 4 br i1 %min.iters.check150, label %for.body.i60.preheader, label %vector.ph151 vector.ph151: ; preds = %max.exit %n.vec153 = and i64 %24, -4 br label %vector.body156 vector.body156: ; preds = %vector.body156, %vector.ph151 %index157 = phi i64 [ 0, %vector.ph151 ], [ %index.next162, %vector.body156 ] %vec.phi158 = phi <2 x i64> [ zeroinitializer, %vector.ph151 ], [ %14, %vector.body156 ] %vec.phi159 = phi <2 x i64> [ zeroinitializer, %vector.ph151 ], [ %15, %vector.body156 ] %12 = getelementptr inbounds i64, ptr %arrayidx6, i64 %index157 %wide.load160 = load <2 x i64>, ptr %12, align 8, !tbaa !5 %13 = getelementptr inbounds i64, ptr %12, i64 2 %wide.load161 = load <2 x i64>, ptr %13, align 8, !tbaa !5 %14 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load160, <2 x i64> %vec.phi158) %15 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load161, <2 x i64> %vec.phi159) %index.next162 = add nuw i64 %index157, 4 %16 = icmp eq i64 %index.next162, %n.vec153 br i1 %16, label %middle.block148, label %vector.body156, !llvm.loop !16 middle.block148: ; preds = %vector.body156 %rdx.minmax163 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %14, <2 x i64> %15) %17 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax163) %cmp.n155 = icmp eq i64 %24, %n.vec153 br i1 %cmp.n155, label %max.exit67, label %for.body.i60.preheader for.body.i60.preheader: ; preds = %max.exit, %middle.block148 %a.010.i61.ph = phi i64 [ 0, %max.exit ], [ %n.vec153, %middle.block148 ] %m.09.i62.ph = phi i64 [ 0, %max.exit ], [ %17, %middle.block148 ] br label %for.body.i60 for.body.i60: ; preds = %for.body.i60.preheader, %for.body.i60 %a.010.i61 = phi i64 [ %inc.i65, %for.body.i60 ], [ %a.010.i61.ph, %for.body.i60.preheader ] %m.09.i62 = phi i64 [ %spec.select.i64, %for.body.i60 ], [ %m.09.i62.ph, %for.body.i60.preheader ] %arrayidx.i63 = getelementptr inbounds i64, ptr %arrayidx6, i64 %a.010.i61 %18 = load i64, ptr %arrayidx.i63, align 8, !tbaa !5 %spec.select.i64 = call i64 @llvm.smax.i64(i64 %18, i64 %m.09.i62) %inc.i65 = add nuw nsw i64 %a.010.i61, 1 %exitcond.not.i66 = icmp eq i64 %inc.i65, %24 br i1 %exitcond.not.i66, label %max.exit67, label %for.body.i60, !llvm.loop !17 max.exit67: ; preds = %for.body.i60, %middle.block148 %spec.select.i64.lcssa = phi i64 [ %17, %middle.block148 ], [ %spec.select.i64, %for.body.i60 ] %cmp8 = icmp ult i64 %spec.select.i.lcssa, %spec.select.i64.lcssa br i1 %cmp8.i, label %for.body15.lr.ph, label %max.exit87 for.body15.lr.ph: ; preds = %max.exit67 %19 = select i1 %cmp8, i64 0, i64 %1 %arrayidx16 = getelementptr inbounds i64, ptr %vla, i64 %19 %20 = select i1 %cmp8, i64 %1, i64 0 %arrayidx18 = getelementptr inbounds i64, ptr %vla, i64 %20 %xtraiter = and i64 %24, 1 %21 = icmp eq i64 %24, 1 br i1 %21, label %for.cond.cleanup14.unr-lcssa, label %for.body15.lr.ph.new for.body15.lr.ph.new: ; preds = %for.body15.lr.ph %unroll_iter = and i64 %24, -2 br label %for.body15 for.body: ; preds = %while.body, %for.body %22 = phi i64 [ %24, %for.body ], [ %4, %while.body ] %a.096 = phi i64 [ %inc, %for.body ], [ 0, %while.body ] %div = sdiv i64 %a.096, %22 %23 = mul nsw i64 %div, %1 %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %23 %rem = srem i64 %a.096, %22 %arrayidx2 = getelementptr inbounds i64, ptr %arrayidx, i64 %rem %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2) %inc = add nuw nsw i64 %a.096, 1 %24 = load i64, ptr %n, align 8, !tbaa !5 %mul = shl nsw i64 %24, 1 %cmp = icmp slt i64 %inc, %mul br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !18 for.cond.cleanup14.unr-lcssa: ; preds = %for.inc30.1, %for.body15.lr.ph %a10.098.unr = phi i64 [ 0, %for.body15.lr.ph ], [ %inc31.1, %for.inc30.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup14, label %for.body15.epil for.body15.epil: ; preds = %for.cond.cleanup14.unr-lcssa %arrayidx17.epil = getelementptr inbounds i64, ptr %arrayidx16, i64 %a10.098.unr %25 = load i64, ptr %arrayidx17.epil, align 8, !tbaa !5 %arrayidx19.epil = getelementptr inbounds i64, ptr %arrayidx18, i64 %a10.098.unr %26 = load i64, ptr %arrayidx19.epil, align 8, !tbaa !5 %cmp20.epil = icmp sgt i64 %25, %26 br i1 %cmp20.epil, label %if.then.epil, label %for.cond.cleanup14 if.then.epil: ; preds = %for.body15.epil store i64 %26, ptr %arrayidx17.epil, align 8, !tbaa !5 store i64 %25, ptr %arrayidx19.epil, align 8, !tbaa !5 br label %for.cond.cleanup14 for.cond.cleanup14: ; preds = %for.body15.epil, %if.then.epil, %for.cond.cleanup14.unr-lcssa %arrayidx33 = getelementptr inbounds i64, ptr %vla, i64 %20 br i1 %cmp8.i, label %for.body.i70.preheader, label %max.exit87 for.body.i70.preheader: ; preds = %for.cond.cleanup14 %min.iters.check133 = icmp ult i64 %24, 4 br i1 %min.iters.check133, label %for.body.i70.preheader183, label %vector.ph134 vector.ph134: ; preds = %for.body.i70.preheader %n.vec136 = and i64 %24, -4 br label %vector.body139 vector.body139: ; preds = %vector.body139, %vector.ph134 %index140 = phi i64 [ 0, %vector.ph134 ], [ %index.next145, %vector.body139 ] %vec.phi141 = phi <2 x i64> [ zeroinitializer, %vector.ph134 ], [ %29, %vector.body139 ] %vec.phi142 = phi <2 x i64> [ zeroinitializer, %vector.ph134 ], [ %30, %vector.body139 ] %27 = getelementptr inbounds i64, ptr %arrayidx33, i64 %index140 %wide.load143 = load <2 x i64>, ptr %27, align 8, !tbaa !5 %28 = getelementptr inbounds i64, ptr %27, i64 2 %wide.load144 = load <2 x i64>, ptr %28, align 8, !tbaa !5 %29 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load143, <2 x i64> %vec.phi141) %30 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load144, <2 x i64> %vec.phi142) %index.next145 = add nuw i64 %index140, 4 %31 = icmp eq i64 %index.next145, %n.vec136 br i1 %31, label %middle.block131, label %vector.body139, !llvm.loop !19 middle.block131: ; preds = %vector.body139 %rdx.minmax146 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %29, <2 x i64> %30) %32 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax146) %cmp.n138 = icmp eq i64 %24, %n.vec136 br i1 %cmp.n138, label %max.exit77, label %for.body.i70.preheader183 for.body.i70.preheader183: ; preds = %for.body.i70.preheader, %middle.block131 %a.010.i71.ph = phi i64 [ 0, %for.body.i70.preheader ], [ %n.vec136, %middle.block131 ] %m.09.i72.ph = phi i64 [ 0, %for.body.i70.preheader ], [ %32, %middle.block131 ] br label %for.body.i70 for.body.i70: ; preds = %for.body.i70.preheader183, %for.body.i70 %a.010.i71 = phi i64 [ %inc.i75, %for.body.i70 ], [ %a.010.i71.ph, %for.body.i70.preheader183 ] %m.09.i72 = phi i64 [ %spec.select.i74, %for.body.i70 ], [ %m.09.i72.ph, %for.body.i70.preheader183 ] %arrayidx.i73 = getelementptr inbounds i64, ptr %arrayidx33, i64 %a.010.i71 %33 = load i64, ptr %arrayidx.i73, align 8, !tbaa !5 %spec.select.i74 = call i64 @llvm.smax.i64(i64 %33, i64 %m.09.i72) %inc.i75 = add nuw nsw i64 %a.010.i71, 1 %exitcond.not.i76 = icmp eq i64 %inc.i75, %24 br i1 %exitcond.not.i76, label %max.exit77, label %for.body.i70, !llvm.loop !20 max.exit77: ; preds = %for.body.i70, %middle.block131 %spec.select.i74.lcssa = phi i64 [ %32, %middle.block131 ], [ %spec.select.i74, %for.body.i70 ] %34 = select i1 %cmp8, i64 0, i64 %1 %arrayidx35 = getelementptr inbounds i64, ptr %vla, i64 %34 %min.iters.check = icmp ult i64 %24, 4 br i1 %min.iters.check, label %for.body.i80.preheader, label %vector.ph vector.ph: ; preds = %max.exit77 %n.vec = and i64 %24, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ] %vec.phi129 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ] %35 = getelementptr inbounds i64, ptr %arrayidx35, i64 %index %wide.load = load <2 x i64>, ptr %35, align 8, !tbaa !5 %36 = getelementptr inbounds i64, ptr %35, i64 2 %wide.load130 = load <2 x i64>, ptr %36, align 8, !tbaa !5 %37 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %vec.phi) %38 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load130, <2 x i64> %vec.phi129) %index.next = add nuw i64 %index, 4 %39 = icmp eq i64 %index.next, %n.vec br i1 %39, label %middle.block, label %vector.body, !llvm.loop !21 middle.block: ; preds = %vector.body %rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %37, <2 x i64> %38) %40 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %24, %n.vec br i1 %cmp.n, label %max.exit87.loopexit, label %for.body.i80.preheader for.body.i80.preheader: ; preds = %max.exit77, %middle.block %a.010.i81.ph = phi i64 [ 0, %max.exit77 ], [ %n.vec, %middle.block ] %m.09.i82.ph = phi i64 [ 0, %max.exit77 ], [ %40, %middle.block ] br label %for.body.i80 for.body.i80: ; preds = %for.body.i80.preheader, %for.body.i80 %a.010.i81 = phi i64 [ %inc.i85, %for.body.i80 ], [ %a.010.i81.ph, %for.body.i80.preheader ] %m.09.i82 = phi i64 [ %spec.select.i84, %for.body.i80 ], [ %m.09.i82.ph, %for.body.i80.preheader ] %arrayidx.i83 = getelementptr inbounds i64, ptr %arrayidx35, i64 %a.010.i81 %41 = load i64, ptr %arrayidx.i83, align 8, !tbaa !5 %spec.select.i84 = call i64 @llvm.smax.i64(i64 %41, i64 %m.09.i82) %inc.i85 = add nuw nsw i64 %a.010.i81, 1 %exitcond.not.i86 = icmp eq i64 %inc.i85, %24 br i1 %exitcond.not.i86, label %max.exit87.loopexit, label %for.body.i80, !llvm.loop !22 max.exit87.loopexit: ; preds = %for.body.i80, %middle.block %spec.select.i84.lcssa = phi i64 [ %40, %middle.block ], [ %spec.select.i84, %for.body.i80 ] %42 = mul nsw i64 %spec.select.i84.lcssa, %spec.select.i74.lcssa br label %max.exit87 max.exit87: ; preds = %max.exit67, %for.cond.cleanup, %while.body, %max.exit87.loopexit, %for.cond.cleanup14 %mul37 = phi i64 [ 0, %for.cond.cleanup14 ], [ %42, %max.exit87.loopexit ], [ 0, %while.body ], [ 0, %for.cond.cleanup ], [ 0, %max.exit67 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul37) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6 %43 = load i64, ptr %t, align 8, !tbaa !5 %dec = add nsw i64 %43, -1 store i64 %dec, ptr %t, align 8, !tbaa !5 %tobool.not = icmp eq i64 %43, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 for.body15: ; preds = %for.inc30.1, %for.body15.lr.ph.new %a10.098 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %inc31.1, %for.inc30.1 ] %niter = phi i64 [ 0, %for.body15.lr.ph.new ], [ %niter.next.1, %for.inc30.1 ] %arrayidx17 = getelementptr inbounds i64, ptr %arrayidx16, i64 %a10.098 %44 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %arrayidx19 = getelementptr inbounds i64, ptr %arrayidx18, i64 %a10.098 %45 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %44, %45 br i1 %cmp20, label %if.then, label %for.inc30 if.then: ; preds = %for.body15 store i64 %45, ptr %arrayidx17, align 8, !tbaa !5 store i64 %44, ptr %arrayidx19, align 8, !tbaa !5 br label %for.inc30 for.inc30: ; preds = %for.body15, %if.then %inc31 = or i64 %a10.098, 1 %arrayidx17.1 = getelementptr inbounds i64, ptr %arrayidx16, i64 %inc31 %46 = load i64, ptr %arrayidx17.1, align 8, !tbaa !5 %arrayidx19.1 = getelementptr inbounds i64, ptr %arrayidx18, i64 %inc31 %47 = load i64, ptr %arrayidx19.1, align 8, !tbaa !5 %cmp20.1 = icmp sgt i64 %46, %47 br i1 %cmp20.1, label %if.then.1, label %for.inc30.1 if.then.1: ; preds = %for.inc30 store i64 %47, ptr %arrayidx17.1, align 8, !tbaa !5 store i64 %46, ptr %arrayidx19.1, align 8, !tbaa !5 br label %for.inc30.1 for.inc30.1: ; preds = %if.then.1, %for.inc30 %inc31.1 = add nuw nsw i64 %a10.098, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup14.unr-lcssa, label %for.body15, !llvm.loop !24 while.end: ; preds = %max.exit87, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #5 attributes #0 = { 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 #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 = { 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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11} !21 = distinct !{!21, !10, !11, !12} !22 = distinct !{!22, !10, !12, !11} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include <stdio.h> typedef struct { int cur; int n; int s; int e; int w; } Dice; typedef enum { POSITIVE, NEGATIVE } ROLL_DIR; int num1[6], num2[6]; void dice_init(Dice * dice) { dice->cur = 1; dice->n = 5; dice->s = 2; dice->e = 3; dice->w = 4; } void v_index_change(int *cur, int *a, int *b) { int tmp = *cur; *cur = *a; *b = tmp; *a = 7 - tmp; } void h_index_change(int *p1, int *p2, int *p3, int *p4) { int tmp = *p1; *p1 = *p4; *p4 = *p3; *p3 = *p2; *p2 = tmp; } void v_roll(int num, char dir, Dice *dice) { int i; for (i = 0; i < num; i++) { if (dir == 'N') { v_index_change(&dice->cur, &dice->s, &dice->n); } else if (dir == 'S') { v_index_change(&dice->cur, &dice->n, &dice->s); } else if (dir == 'E') { v_index_change(&dice->cur, &dice->w, &dice->e); } else if (dir == 'W') { v_index_change(&dice->cur, &dice->e, &dice->w); } } } void h_roll(char sp, int num, ROLL_DIR dir, Dice *dice) { int i; for (i = 0; i < num; i++) { if (sp == 'N') { if (dir == POSITIVE) { h_index_change(&dice->n, &dice->w, &dice->s, &dice->e); } else if (dir == NEGATIVE) { h_index_change(&dice->n, &dice->e, &dice->s, &dice->w); } } else if (sp == 'S') { if (dir == POSITIVE) { h_index_change(&dice->s, &dice->e, &dice->n, &dice->w); } else if (dir == NEGATIVE) { h_index_change(&dice->s, &dice->w, &dice->n, &dice->e); } } else if (sp == 'E') { if (dir == POSITIVE) { h_index_change(&dice->e, &dice->n, &dice->w, &dice->s); } else if (dir == NEGATIVE) { h_index_change(&dice->e, &dice->s, &dice->w, &dice->n); } } else if (sp == 'W') { if (dir == POSITIVE) { h_index_change(&dice->w, &dice->s, &dice->e, &dice->n); } else if (dir == NEGATIVE) { h_index_change(&dice->w, &dice->n, &dice->e, &dice->s); } } } } int check(int index, Dice *dice1, Dice *dice2) { int i, isMatch = 0; if (index == dice2->cur) { } else if (index == dice2->n) { v_roll(1, 'S', dice2); } else if (index == dice2->s) { v_roll(1, 'N', dice2); } else if (index == dice2->e) { v_roll(1, 'W', dice2); } else if (index == dice2->w) { v_roll(1, 'E', dice2); } else { v_roll(2, 'S', dice2); } for (i = 0; i < 4; i++) { h_roll('S', 1, POSITIVE, dice2); if (num1[dice1->cur - 1] == num2[dice2->cur - 1] && num1[dice1->n - 1] == num2[dice2->n - 1] && num1[dice1->s - 1] == num2[dice2->s - 1] && num1[dice1->w - 1] == num2[dice2->w - 1] && num1[dice1->e - 1] == num2[dice2->e - 1] && num1[7 - dice1->cur - 1] == num2[7 - dice2->cur - 1]) { isMatch = 1; break; } } return isMatch; } int main(int argc, char** argv) { Dice dice1, dice2; int i; for (i = 0; i < 6; i++) { scanf("%d", &num1[i]); } for (i = 0; i < 6; i++) { scanf("%d", &num2[i]); } dice_init(&dice1); dice_init(&dice2); int isMatch = 0; for (i = 0; i < 6; i++) { if (check(i+1, &dice1, &dice2)) { isMatch = 1; break; } } if (isMatch) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117031/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117031/source.c" target datalayout = "e-m:e-p270: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.Dice = type { i32, i32, i32, i32, i32 } @num1 = dso_local global [6 x i32] zeroinitializer, align 16 @num2 = dso_local global [6 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @dice_init(ptr nocapture noundef writeonly %dice) local_unnamed_addr #0 { entry: store <4 x i32> <i32 1, i32 5, i32 2, i32 3>, ptr %dice, align 4, !tbaa !5 %w = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 4 store i32 4, ptr %w, align 4, !tbaa !9 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @v_index_change(ptr nocapture noundef %cur, ptr nocapture noundef %a, ptr nocapture noundef writeonly %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr %cur, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %cur, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 7, %0 store i32 %sub, ptr %a, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @h_index_change(ptr nocapture noundef %p1, ptr nocapture noundef %p2, ptr nocapture noundef %p3, ptr nocapture noundef %p4) local_unnamed_addr #1 { entry: %0 = load i32, ptr %p1, align 4, !tbaa !5 %1 = load i32, ptr %p4, align 4, !tbaa !5 store i32 %1, ptr %p1, align 4, !tbaa !5 %2 = load i32, ptr %p3, align 4, !tbaa !5 store i32 %2, ptr %p4, align 4, !tbaa !5 %3 = load i32, ptr %p2, align 4, !tbaa !5 store i32 %3, ptr %p3, align 4, !tbaa !5 store i32 %0, ptr %p2, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @v_roll(i32 noundef %num, i8 noundef signext %dir, ptr nocapture noundef %dice) local_unnamed_addr #3 { entry: %cmp45 = icmp sgt i32 %num, 0 br i1 %cmp45, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %e22 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 3 %w23 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 4 %n8 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 1 %s9 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 2 switch i8 %dir, label %for.end [ i8 78, label %for.body.lr.ph.split.us i8 83, label %for.body.lr.ph.split.us47 i8 69, label %for.body.lr.ph.split.us53 i8 87, label %for.body.lr.ph.split.us59 ] for.body.lr.ph.split.us: ; preds = %for.body.lr.ph %dice.promoted = load i32, ptr %dice, align 4, !tbaa !5 %s.promoted = load i32, ptr %s9, align 4, !tbaa !5 %xtraiter115 = and i32 %num, 7 %0 = icmp ult i32 %num, 8 br i1 %0, label %for.cond.for.end_crit_edge.split.us.unr-lcssa, label %for.body.lr.ph.split.us.new for.body.lr.ph.split.us.new: ; preds = %for.body.lr.ph.split.us %unroll_iter122 = and i32 %num, -8 br label %for.body.us for.body.us: ; preds = %for.body.us, %for.body.lr.ph.split.us.new %niter123 = phi i32 [ 0, %for.body.lr.ph.split.us.new ], [ %niter123.next.7, %for.body.us ] %niter123.next.7 = add i32 %niter123, 8 %niter123.ncmp.7 = icmp eq i32 %niter123.next.7, %unroll_iter122 br i1 %niter123.ncmp.7, label %for.cond.for.end_crit_edge.split.us.unr-lcssa.loopexit, label %for.body.us, !llvm.loop !11 for.cond.for.end_crit_edge.split.us.unr-lcssa.loopexit: ; preds = %for.body.us %sub.i.us.5 = sub nsw i32 7, %s.promoted br label %for.cond.for.end_crit_edge.split.us.unr-lcssa for.cond.for.end_crit_edge.split.us.unr-lcssa: ; preds = %for.cond.for.end_crit_edge.split.us.unr-lcssa.loopexit, %for.body.lr.ph.split.us %.lcssa.ph = phi i32 [ undef, %for.body.lr.ph.split.us ], [ %sub.i.us.5, %for.cond.for.end_crit_edge.split.us.unr-lcssa.loopexit ] %lcmp.mod118.not = icmp eq i32 %xtraiter115, 0 br i1 %lcmp.mod118.not, label %for.cond.for.end_crit_edge.split.us, label %for.body.us.epil for.body.us.epil: ; preds = %for.cond.for.end_crit_edge.split.us.unr-lcssa, %for.body.us.epil %sub.i.us65.epil = phi i32 [ %sub.i.us.epil, %for.body.us.epil ], [ %s.promoted, %for.cond.for.end_crit_edge.split.us.unr-lcssa ] %1 = phi i32 [ %sub.i.us65.epil, %for.body.us.epil ], [ %dice.promoted, %for.cond.for.end_crit_edge.split.us.unr-lcssa ] %epil.iter116 = phi i32 [ %epil.iter116.next, %for.body.us.epil ], [ 0, %for.cond.for.end_crit_edge.split.us.unr-lcssa ] %sub.i.us.epil = sub nsw i32 7, %1 %epil.iter116.next = add i32 %epil.iter116, 1 %epil.iter116.cmp.not = icmp eq i32 %epil.iter116.next, %xtraiter115 br i1 %epil.iter116.cmp.not, label %for.cond.for.end_crit_edge.split.us, label %for.body.us.epil, !llvm.loop !13 for.cond.for.end_crit_edge.split.us: ; preds = %for.body.us.epil, %for.cond.for.end_crit_edge.split.us.unr-lcssa %sub.i.us65.lcssa = phi i32 [ %dice.promoted, %for.cond.for.end_crit_edge.split.us.unr-lcssa ], [ %sub.i.us65.epil, %for.body.us.epil ] %.lcssa = phi i32 [ %.lcssa.ph, %for.cond.for.end_crit_edge.split.us.unr-lcssa ], [ %1, %for.body.us.epil ] %sub.i.us.lcssa = phi i32 [ %s.promoted, %for.cond.for.end_crit_edge.split.us.unr-lcssa ], [ %sub.i.us.epil, %for.body.us.epil ] store i32 %sub.i.us65.lcssa, ptr %dice, align 4, !tbaa !5 store i32 %sub.i.us.lcssa, ptr %s9, align 4, !tbaa !5 store i32 %.lcssa, ptr %n8, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us47: ; preds = %for.body.lr.ph %dice.promoted67 = load i32, ptr %dice, align 4, !tbaa !5 %n8.promoted = load i32, ptr %n8, align 4, !tbaa !5 %xtraiter106 = and i32 %num, 7 %2 = icmp ult i32 %num, 8 br i1 %2, label %for.cond.for.end_crit_edge.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us47.new for.body.lr.ph.split.us47.new: ; preds = %for.body.lr.ph.split.us47 %unroll_iter113 = and i32 %num, -8 br label %for.body.us48 for.body.us48: ; preds = %for.body.us48, %for.body.lr.ph.split.us47.new %niter114 = phi i32 [ 0, %for.body.lr.ph.split.us47.new ], [ %niter114.next.7, %for.body.us48 ] %niter114.next.7 = add i32 %niter114, 8 %niter114.ncmp.7 = icmp eq i32 %niter114.next.7, %unroll_iter113 br i1 %niter114.ncmp.7, label %for.cond.for.end_crit_edge.split.split.us.unr-lcssa.loopexit, label %for.body.us48, !llvm.loop !11 for.cond.for.end_crit_edge.split.split.us.unr-lcssa.loopexit: ; preds = %for.body.us48 %sub.i42.us.5 = sub nsw i32 7, %n8.promoted br label %for.cond.for.end_crit_edge.split.split.us.unr-lcssa for.cond.for.end_crit_edge.split.split.us.unr-lcssa: ; preds = %for.cond.for.end_crit_edge.split.split.us.unr-lcssa.loopexit, %for.body.lr.ph.split.us47 %.lcssa91.ph = phi i32 [ undef, %for.body.lr.ph.split.us47 ], [ %sub.i42.us.5, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa.loopexit ] %lcmp.mod109.not = icmp eq i32 %xtraiter106, 0 br i1 %lcmp.mod109.not, label %for.cond.for.end_crit_edge.split.split.us, label %for.body.us48.epil for.body.us48.epil: ; preds = %for.cond.for.end_crit_edge.split.split.us.unr-lcssa, %for.body.us48.epil %sub.i42.us69.epil = phi i32 [ %sub.i42.us.epil, %for.body.us48.epil ], [ %n8.promoted, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ] %3 = phi i32 [ %sub.i42.us69.epil, %for.body.us48.epil ], [ %dice.promoted67, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ] %epil.iter107 = phi i32 [ %epil.iter107.next, %for.body.us48.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ] %sub.i42.us.epil = sub nsw i32 7, %3 %epil.iter107.next = add i32 %epil.iter107, 1 %epil.iter107.cmp.not = icmp eq i32 %epil.iter107.next, %xtraiter106 br i1 %epil.iter107.cmp.not, label %for.cond.for.end_crit_edge.split.split.us, label %for.body.us48.epil, !llvm.loop !15 for.cond.for.end_crit_edge.split.split.us: ; preds = %for.body.us48.epil, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa %sub.i42.us69.lcssa = phi i32 [ %dice.promoted67, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ], [ %sub.i42.us69.epil, %for.body.us48.epil ] %.lcssa91 = phi i32 [ %.lcssa91.ph, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ], [ %3, %for.body.us48.epil ] %sub.i42.us.lcssa = phi i32 [ %n8.promoted, %for.cond.for.end_crit_edge.split.split.us.unr-lcssa ], [ %sub.i42.us.epil, %for.body.us48.epil ] store i32 %sub.i42.us69.lcssa, ptr %dice, align 4, !tbaa !5 store i32 %sub.i42.us.lcssa, ptr %n8, align 4, !tbaa !5 store i32 %.lcssa91, ptr %s9, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us53: ; preds = %for.body.lr.ph %dice.promoted71 = load i32, ptr %dice, align 4, !tbaa !5 %w.promoted = load i32, ptr %w23, align 4, !tbaa !5 %xtraiter97 = and i32 %num, 7 %4 = icmp ult i32 %num, 8 br i1 %4, label %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us53.new for.body.lr.ph.split.us53.new: ; preds = %for.body.lr.ph.split.us53 %unroll_iter104 = and i32 %num, -8 br label %for.body.us54 for.body.us54: ; preds = %for.body.us54, %for.body.lr.ph.split.us53.new %niter105 = phi i32 [ 0, %for.body.lr.ph.split.us53.new ], [ %niter105.next.7, %for.body.us54 ] %niter105.next.7 = add i32 %niter105, 8 %niter105.ncmp.7 = icmp eq i32 %niter105.next.7, %unroll_iter104 br i1 %niter105.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa.loopexit, label %for.body.us54, !llvm.loop !11 for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa.loopexit: ; preds = %for.body.us54 %sub.i43.us.5 = sub nsw i32 7, %w.promoted br label %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa: ; preds = %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa.loopexit, %for.body.lr.ph.split.us53 %.lcssa92.ph = phi i32 [ undef, %for.body.lr.ph.split.us53 ], [ %sub.i43.us.5, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa.loopexit ] %lcmp.mod100.not = icmp eq i32 %xtraiter97, 0 br i1 %lcmp.mod100.not, label %for.cond.for.end_crit_edge.split.split.split.us, label %for.body.us54.epil for.body.us54.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa, %for.body.us54.epil %sub.i43.us73.epil = phi i32 [ %sub.i43.us.epil, %for.body.us54.epil ], [ %w.promoted, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ] %5 = phi i32 [ %sub.i43.us73.epil, %for.body.us54.epil ], [ %dice.promoted71, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ] %epil.iter98 = phi i32 [ %epil.iter98.next, %for.body.us54.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ] %sub.i43.us.epil = sub nsw i32 7, %5 %epil.iter98.next = add i32 %epil.iter98, 1 %epil.iter98.cmp.not = icmp eq i32 %epil.iter98.next, %xtraiter97 br i1 %epil.iter98.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.us, label %for.body.us54.epil, !llvm.loop !16 for.cond.for.end_crit_edge.split.split.split.us: ; preds = %for.body.us54.epil, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa %sub.i43.us73.lcssa = phi i32 [ %dice.promoted71, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ], [ %sub.i43.us73.epil, %for.body.us54.epil ] %.lcssa92 = phi i32 [ %.lcssa92.ph, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ], [ %5, %for.body.us54.epil ] %sub.i43.us.lcssa = phi i32 [ %w.promoted, %for.cond.for.end_crit_edge.split.split.split.us.unr-lcssa ], [ %sub.i43.us.epil, %for.body.us54.epil ] store i32 %sub.i43.us73.lcssa, ptr %dice, align 4, !tbaa !5 store i32 %sub.i43.us.lcssa, ptr %w23, align 4, !tbaa !5 store i32 %.lcssa92, ptr %e22, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us59: ; preds = %for.body.lr.ph %dice.promoted75 = load i32, ptr %dice, align 4, !tbaa !5 %e22.promoted = load i32, ptr %e22, align 4, !tbaa !5 %xtraiter = and i32 %num, 7 %6 = icmp ult i32 %num, 8 br i1 %6, label %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us59.new for.body.lr.ph.split.us59.new: ; preds = %for.body.lr.ph.split.us59 %unroll_iter = and i32 %num, -8 br label %for.body.us60 for.body.us60: ; preds = %for.body.us60, %for.body.lr.ph.split.us59.new %niter = phi i32 [ 0, %for.body.lr.ph.split.us59.new ], [ %niter.next.7, %for.body.us60 ] %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa.loopexit, label %for.body.us60, !llvm.loop !11 for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa.loopexit: ; preds = %for.body.us60 %sub.i44.us.5 = sub nsw i32 7, %e22.promoted br label %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa: ; preds = %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa.loopexit, %for.body.lr.ph.split.us59 %.lcssa93.ph = phi i32 [ undef, %for.body.lr.ph.split.us59 ], [ %sub.i44.us.5, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge.split.split.split.split.us, label %for.body.us60.epil for.body.us60.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa, %for.body.us60.epil %sub.i44.us77.epil = phi i32 [ %sub.i44.us.epil, %for.body.us60.epil ], [ %e22.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ] %7 = phi i32 [ %sub.i44.us77.epil, %for.body.us60.epil ], [ %dice.promoted75, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.us60.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ] %sub.i44.us.epil = sub nsw i32 7, %7 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.split.us, label %for.body.us60.epil, !llvm.loop !17 for.cond.for.end_crit_edge.split.split.split.split.us: ; preds = %for.body.us60.epil, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa %sub.i44.us77.lcssa = phi i32 [ %dice.promoted75, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ], [ %sub.i44.us77.epil, %for.body.us60.epil ] %.lcssa93 = phi i32 [ %.lcssa93.ph, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ], [ %7, %for.body.us60.epil ] %sub.i44.us.lcssa = phi i32 [ %e22.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.unr-lcssa ], [ %sub.i44.us.epil, %for.body.us60.epil ] store i32 %sub.i44.us77.lcssa, ptr %dice, align 4, !tbaa !5 store i32 %sub.i44.us.lcssa, ptr %e22, align 4, !tbaa !5 store i32 %.lcssa93, ptr %w23, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.body.lr.ph, %for.cond.for.end_crit_edge.split.us, %for.cond.for.end_crit_edge.split.split.split.us, %for.cond.for.end_crit_edge.split.split.split.split.us, %for.cond.for.end_crit_edge.split.split.us, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @h_roll(i8 noundef signext %sp, i32 noundef %num, i32 noundef %dir, ptr nocapture noundef %dice) local_unnamed_addr #3 { entry: %cmp126 = icmp sgt i32 %num, 0 br i1 %cmp126, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %w74 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 4 %n75 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 1 %e76 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 3 %s77 = getelementptr inbounds %struct.Dice, ptr %dice, i64 0, i32 2 switch i8 %sp, label %for.end [ i8 78, label %for.body.lr.ph.split.us i8 83, label %for.body.lr.ph.split.us128 i8 69, label %for.body.lr.ph.split.us134 i8 87, label %for.body.lr.ph.split.us140 ] for.body.lr.ph.split.us: ; preds = %for.body.lr.ph switch i32 %dir, label %for.end [ i32 0, label %for.body.lr.ph.split.us.split.us i32 1, label %for.body.lr.ph.split.us.split.us146 ] for.body.lr.ph.split.us.split.us: ; preds = %for.body.lr.ph.split.us %n.promoted = load i32, ptr %n75, align 4, !tbaa !5 %e.promoted = load i32, ptr %e76, align 4, !tbaa !5 %s.promoted = load i32, ptr %s77, align 4, !tbaa !5 %w.promoted = load i32, ptr %w74, align 4, !tbaa !5 %0 = add i32 %num, -1 %xtraiter421 = and i32 %num, 7 %1 = icmp ult i32 %0, 7 br i1 %1, label %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa, label %for.body.lr.ph.split.us.split.us.new for.body.lr.ph.split.us.split.us.new: ; preds = %for.body.lr.ph.split.us.split.us %unroll_iter432 = and i32 %num, -8 br label %for.body.us.us for.body.us.us: ; preds = %for.body.us.us, %for.body.lr.ph.split.us.split.us.new %niter433 = phi i32 [ 0, %for.body.lr.ph.split.us.split.us.new ], [ %niter433.next.7, %for.body.us.us ] %niter433.next.7 = add i32 %niter433, 8 %niter433.ncmp.7 = icmp eq i32 %niter433.next.7, %unroll_iter432 br i1 %niter433.ncmp.7, label %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa, label %for.body.us.us, !llvm.loop !18 for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa: ; preds = %for.body.us.us, %for.body.lr.ph.split.us.split.us %lcmp.mod427.not = icmp eq i32 %xtraiter421, 0 br i1 %lcmp.mod427.not, label %for.cond.for.end_crit_edge.split.us.split.us, label %for.body.us.us.epil for.body.us.us.epil: ; preds = %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa, %for.body.us.us.epil %2 = phi i32 [ %5, %for.body.us.us.epil ], [ %w.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ] %3 = phi i32 [ %2, %for.body.us.us.epil ], [ %s.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ] %4 = phi i32 [ %3, %for.body.us.us.epil ], [ %e.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ] %5 = phi i32 [ %4, %for.body.us.us.epil ], [ %n.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ] %epil.iter422 = phi i32 [ %epil.iter422.next, %for.body.us.us.epil ], [ 0, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ] %epil.iter422.next = add i32 %epil.iter422, 1 %epil.iter422.cmp.not = icmp eq i32 %epil.iter422.next, %xtraiter421 br i1 %epil.iter422.cmp.not, label %for.cond.for.end_crit_edge.split.us.split.us, label %for.body.us.us.epil, !llvm.loop !19 for.cond.for.end_crit_edge.split.us.split.us: ; preds = %for.body.us.us.epil, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa %.lcssa307 = phi i32 [ %s.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ], [ %2, %for.body.us.us.epil ] %.lcssa306 = phi i32 [ %e.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ], [ %3, %for.body.us.us.epil ] %.lcssa305 = phi i32 [ %n.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ], [ %4, %for.body.us.us.epil ] %.lcssa = phi i32 [ %w.promoted, %for.cond.for.end_crit_edge.split.us.split.us.unr-lcssa ], [ %5, %for.body.us.us.epil ] store i32 %.lcssa305, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa306, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa307, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa, ptr %w74, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us.split.us146: ; preds = %for.body.lr.ph.split.us %n9.promoted = load i32, ptr %n75, align 4, !tbaa !5 %w12.promoted = load i32, ptr %w74, align 4, !tbaa !5 %s11.promoted = load i32, ptr %s77, align 4, !tbaa !5 %e10.promoted = load i32, ptr %e76, align 4, !tbaa !5 %6 = add i32 %num, -1 %xtraiter408 = and i32 %num, 7 %7 = icmp ult i32 %6, 7 br i1 %7, label %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us.split.us146.new for.body.lr.ph.split.us.split.us146.new: ; preds = %for.body.lr.ph.split.us.split.us146 %unroll_iter419 = and i32 %num, -8 br label %for.body.us.us147 for.body.us.us147: ; preds = %for.body.us.us147, %for.body.lr.ph.split.us.split.us146.new %niter420 = phi i32 [ 0, %for.body.lr.ph.split.us.split.us146.new ], [ %niter420.next.7, %for.body.us.us147 ] %niter420.next.7 = add i32 %niter420, 8 %niter420.ncmp.7 = icmp eq i32 %niter420.next.7, %unroll_iter419 br i1 %niter420.ncmp.7, label %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa, label %for.body.us.us147, !llvm.loop !18 for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa: ; preds = %for.body.us.us147, %for.body.lr.ph.split.us.split.us146 %lcmp.mod414.not = icmp eq i32 %xtraiter408, 0 br i1 %lcmp.mod414.not, label %for.cond.for.end_crit_edge.split.us.split.split.us, label %for.body.us.us147.epil for.body.us.us147.epil: ; preds = %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa, %for.body.us.us147.epil %8 = phi i32 [ %11, %for.body.us.us147.epil ], [ %e10.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ] %9 = phi i32 [ %8, %for.body.us.us147.epil ], [ %s11.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ] %10 = phi i32 [ %9, %for.body.us.us147.epil ], [ %w12.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ] %11 = phi i32 [ %10, %for.body.us.us147.epil ], [ %n9.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ] %epil.iter409 = phi i32 [ %epil.iter409.next, %for.body.us.us147.epil ], [ 0, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ] %epil.iter409.next = add i32 %epil.iter409, 1 %epil.iter409.cmp.not = icmp eq i32 %epil.iter409.next, %xtraiter408 br i1 %epil.iter409.cmp.not, label %for.cond.for.end_crit_edge.split.us.split.split.us, label %for.body.us.us147.epil, !llvm.loop !20 for.cond.for.end_crit_edge.split.us.split.split.us: ; preds = %for.body.us.us147.epil, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa %.lcssa311 = phi i32 [ %s11.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ], [ %8, %for.body.us.us147.epil ] %.lcssa310 = phi i32 [ %w12.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ], [ %9, %for.body.us.us147.epil ] %.lcssa309 = phi i32 [ %n9.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ], [ %10, %for.body.us.us147.epil ] %.lcssa308 = phi i32 [ %e10.promoted, %for.cond.for.end_crit_edge.split.us.split.split.us.unr-lcssa ], [ %11, %for.body.us.us147.epil ] store i32 %.lcssa309, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa310, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa311, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa308, ptr %e76, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us128: ; preds = %for.body.lr.ph switch i32 %dir, label %for.end [ i32 0, label %for.body.lr.ph.split.us128.split.us i32 1, label %for.body.lr.ph.split.us128.split.us159 ] for.body.lr.ph.split.us128.split.us: ; preds = %for.body.lr.ph.split.us128 %s22.promoted = load i32, ptr %s77, align 4, !tbaa !5 %w25.promoted = load i32, ptr %w74, align 4, !tbaa !5 %n24.promoted = load i32, ptr %n75, align 4, !tbaa !5 %e23.promoted = load i32, ptr %e76, align 4, !tbaa !5 %12 = add i32 %num, -1 %xtraiter395 = and i32 %num, 7 %13 = icmp ult i32 %12, 7 br i1 %13, label %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa, label %for.body.lr.ph.split.us128.split.us.new for.body.lr.ph.split.us128.split.us.new: ; preds = %for.body.lr.ph.split.us128.split.us %unroll_iter406 = and i32 %num, -8 br label %for.body.us129.us for.body.us129.us: ; preds = %for.body.us129.us, %for.body.lr.ph.split.us128.split.us.new %niter407 = phi i32 [ 0, %for.body.lr.ph.split.us128.split.us.new ], [ %niter407.next.7, %for.body.us129.us ] %niter407.next.7 = add i32 %niter407, 8 %niter407.ncmp.7 = icmp eq i32 %niter407.next.7, %unroll_iter406 br i1 %niter407.ncmp.7, label %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa, label %for.body.us129.us, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa: ; preds = %for.body.us129.us, %for.body.lr.ph.split.us128.split.us %lcmp.mod401.not = icmp eq i32 %xtraiter395, 0 br i1 %lcmp.mod401.not, label %for.cond.for.end_crit_edge.split.split.us.split.us, label %for.body.us129.us.epil for.body.us129.us.epil: ; preds = %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa, %for.body.us129.us.epil %14 = phi i32 [ %17, %for.body.us129.us.epil ], [ %e23.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ] %15 = phi i32 [ %14, %for.body.us129.us.epil ], [ %n24.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ] %16 = phi i32 [ %15, %for.body.us129.us.epil ], [ %w25.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ] %17 = phi i32 [ %16, %for.body.us129.us.epil ], [ %s22.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ] %epil.iter396 = phi i32 [ %epil.iter396.next, %for.body.us129.us.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ] %epil.iter396.next = add i32 %epil.iter396, 1 %epil.iter396.cmp.not = icmp eq i32 %epil.iter396.next, %xtraiter395 br i1 %epil.iter396.cmp.not, label %for.cond.for.end_crit_edge.split.split.us.split.us, label %for.body.us129.us.epil, !llvm.loop !21 for.cond.for.end_crit_edge.split.split.us.split.us: ; preds = %for.body.us129.us.epil, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa %.lcssa315 = phi i32 [ %n24.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ], [ %14, %for.body.us129.us.epil ] %.lcssa314 = phi i32 [ %w25.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ], [ %15, %for.body.us129.us.epil ] %.lcssa313 = phi i32 [ %s22.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ], [ %16, %for.body.us129.us.epil ] %.lcssa312 = phi i32 [ %e23.promoted, %for.cond.for.end_crit_edge.split.split.us.split.us.unr-lcssa ], [ %17, %for.body.us129.us.epil ] store i32 %.lcssa313, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa314, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa315, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa312, ptr %e76, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us128.split.us159: ; preds = %for.body.lr.ph.split.us128 %s30.promoted = load i32, ptr %s77, align 4, !tbaa !5 %e33.promoted = load i32, ptr %e76, align 4, !tbaa !5 %n32.promoted = load i32, ptr %n75, align 4, !tbaa !5 %w31.promoted = load i32, ptr %w74, align 4, !tbaa !5 %18 = add i32 %num, -1 %xtraiter382 = and i32 %num, 7 %19 = icmp ult i32 %18, 7 br i1 %19, label %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us128.split.us159.new for.body.lr.ph.split.us128.split.us159.new: ; preds = %for.body.lr.ph.split.us128.split.us159 %unroll_iter393 = and i32 %num, -8 br label %for.body.us129.us160 for.body.us129.us160: ; preds = %for.body.us129.us160, %for.body.lr.ph.split.us128.split.us159.new %niter394 = phi i32 [ 0, %for.body.lr.ph.split.us128.split.us159.new ], [ %niter394.next.7, %for.body.us129.us160 ] %niter394.next.7 = add i32 %niter394, 8 %niter394.ncmp.7 = icmp eq i32 %niter394.next.7, %unroll_iter393 br i1 %niter394.ncmp.7, label %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa, label %for.body.us129.us160, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa: ; preds = %for.body.us129.us160, %for.body.lr.ph.split.us128.split.us159 %lcmp.mod388.not = icmp eq i32 %xtraiter382, 0 br i1 %lcmp.mod388.not, label %for.cond.for.end_crit_edge.split.split.us.split.split.us, label %for.body.us129.us160.epil for.body.us129.us160.epil: ; preds = %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa, %for.body.us129.us160.epil %20 = phi i32 [ %23, %for.body.us129.us160.epil ], [ %w31.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ] %21 = phi i32 [ %20, %for.body.us129.us160.epil ], [ %n32.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ] %22 = phi i32 [ %21, %for.body.us129.us160.epil ], [ %e33.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ] %23 = phi i32 [ %22, %for.body.us129.us160.epil ], [ %s30.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ] %epil.iter383 = phi i32 [ %epil.iter383.next, %for.body.us129.us160.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ] %epil.iter383.next = add i32 %epil.iter383, 1 %epil.iter383.cmp.not = icmp eq i32 %epil.iter383.next, %xtraiter382 br i1 %epil.iter383.cmp.not, label %for.cond.for.end_crit_edge.split.split.us.split.split.us, label %for.body.us129.us160.epil, !llvm.loop !22 for.cond.for.end_crit_edge.split.split.us.split.split.us: ; preds = %for.body.us129.us160.epil, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa %.lcssa319 = phi i32 [ %n32.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ], [ %20, %for.body.us129.us160.epil ] %.lcssa318 = phi i32 [ %e33.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ], [ %21, %for.body.us129.us160.epil ] %.lcssa317 = phi i32 [ %s30.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ], [ %22, %for.body.us129.us160.epil ] %.lcssa316 = phi i32 [ %w31.promoted, %for.cond.for.end_crit_edge.split.split.us.split.split.us.unr-lcssa ], [ %23, %for.body.us129.us160.epil ] store i32 %.lcssa317, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa318, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa319, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa316, ptr %w74, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us134: ; preds = %for.body.lr.ph switch i32 %dir, label %for.end [ i32 0, label %for.body.lr.ph.split.us134.split.us i32 1, label %for.body.lr.ph.split.us134.split.us173 ] for.body.lr.ph.split.us134.split.us: ; preds = %for.body.lr.ph.split.us134 %e44.promoted = load i32, ptr %e76, align 4, !tbaa !5 %s47.promoted = load i32, ptr %s77, align 4, !tbaa !5 %w46.promoted = load i32, ptr %w74, align 4, !tbaa !5 %n45.promoted = load i32, ptr %n75, align 4, !tbaa !5 %24 = add i32 %num, -1 %xtraiter369 = and i32 %num, 7 %25 = icmp ult i32 %24, 7 br i1 %25, label %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa, label %for.body.lr.ph.split.us134.split.us.new for.body.lr.ph.split.us134.split.us.new: ; preds = %for.body.lr.ph.split.us134.split.us %unroll_iter380 = and i32 %num, -8 br label %for.body.us135.us for.body.us135.us: ; preds = %for.body.us135.us, %for.body.lr.ph.split.us134.split.us.new %niter381 = phi i32 [ 0, %for.body.lr.ph.split.us134.split.us.new ], [ %niter381.next.7, %for.body.us135.us ] %niter381.next.7 = add i32 %niter381, 8 %niter381.ncmp.7 = icmp eq i32 %niter381.next.7, %unroll_iter380 br i1 %niter381.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa, label %for.body.us135.us, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa: ; preds = %for.body.us135.us, %for.body.lr.ph.split.us134.split.us %lcmp.mod375.not = icmp eq i32 %xtraiter369, 0 br i1 %lcmp.mod375.not, label %for.cond.for.end_crit_edge.split.split.split.us.split.us, label %for.body.us135.us.epil for.body.us135.us.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa, %for.body.us135.us.epil %26 = phi i32 [ %29, %for.body.us135.us.epil ], [ %n45.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ] %27 = phi i32 [ %26, %for.body.us135.us.epil ], [ %w46.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ] %28 = phi i32 [ %27, %for.body.us135.us.epil ], [ %s47.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ] %29 = phi i32 [ %28, %for.body.us135.us.epil ], [ %e44.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ] %epil.iter370 = phi i32 [ %epil.iter370.next, %for.body.us135.us.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ] %epil.iter370.next = add i32 %epil.iter370, 1 %epil.iter370.cmp.not = icmp eq i32 %epil.iter370.next, %xtraiter369 br i1 %epil.iter370.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.us.split.us, label %for.body.us135.us.epil, !llvm.loop !23 for.cond.for.end_crit_edge.split.split.split.us.split.us: ; preds = %for.body.us135.us.epil, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa %.lcssa323 = phi i32 [ %w46.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ], [ %26, %for.body.us135.us.epil ] %.lcssa322 = phi i32 [ %s47.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ], [ %27, %for.body.us135.us.epil ] %.lcssa321 = phi i32 [ %e44.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ], [ %28, %for.body.us135.us.epil ] %.lcssa320 = phi i32 [ %n45.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.us.unr-lcssa ], [ %29, %for.body.us135.us.epil ] store i32 %.lcssa321, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa322, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa323, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa320, ptr %n75, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us134.split.us173: ; preds = %for.body.lr.ph.split.us134 %e52.promoted = load i32, ptr %e76, align 4, !tbaa !5 %n55.promoted = load i32, ptr %n75, align 4, !tbaa !5 %w54.promoted = load i32, ptr %w74, align 4, !tbaa !5 %s53.promoted = load i32, ptr %s77, align 4, !tbaa !5 %30 = add i32 %num, -1 %xtraiter356 = and i32 %num, 7 %31 = icmp ult i32 %30, 7 br i1 %31, label %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us134.split.us173.new for.body.lr.ph.split.us134.split.us173.new: ; preds = %for.body.lr.ph.split.us134.split.us173 %unroll_iter367 = and i32 %num, -8 br label %for.body.us135.us174 for.body.us135.us174: ; preds = %for.body.us135.us174, %for.body.lr.ph.split.us134.split.us173.new %niter368 = phi i32 [ 0, %for.body.lr.ph.split.us134.split.us173.new ], [ %niter368.next.7, %for.body.us135.us174 ] %niter368.next.7 = add i32 %niter368, 8 %niter368.ncmp.7 = icmp eq i32 %niter368.next.7, %unroll_iter367 br i1 %niter368.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa, label %for.body.us135.us174, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa: ; preds = %for.body.us135.us174, %for.body.lr.ph.split.us134.split.us173 %lcmp.mod362.not = icmp eq i32 %xtraiter356, 0 br i1 %lcmp.mod362.not, label %for.cond.for.end_crit_edge.split.split.split.us.split.split.us, label %for.body.us135.us174.epil for.body.us135.us174.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa, %for.body.us135.us174.epil %32 = phi i32 [ %35, %for.body.us135.us174.epil ], [ %s53.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ] %33 = phi i32 [ %32, %for.body.us135.us174.epil ], [ %w54.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ] %34 = phi i32 [ %33, %for.body.us135.us174.epil ], [ %n55.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ] %35 = phi i32 [ %34, %for.body.us135.us174.epil ], [ %e52.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ] %epil.iter357 = phi i32 [ %epil.iter357.next, %for.body.us135.us174.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ] %epil.iter357.next = add i32 %epil.iter357, 1 %epil.iter357.cmp.not = icmp eq i32 %epil.iter357.next, %xtraiter356 br i1 %epil.iter357.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.us.split.split.us, label %for.body.us135.us174.epil, !llvm.loop !24 for.cond.for.end_crit_edge.split.split.split.us.split.split.us: ; preds = %for.body.us135.us174.epil, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa %.lcssa327 = phi i32 [ %w54.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ], [ %32, %for.body.us135.us174.epil ] %.lcssa326 = phi i32 [ %n55.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ], [ %33, %for.body.us135.us174.epil ] %.lcssa325 = phi i32 [ %e52.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ], [ %34, %for.body.us135.us174.epil ] %.lcssa324 = phi i32 [ %s53.promoted, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us.unr-lcssa ], [ %35, %for.body.us135.us174.epil ] store i32 %.lcssa325, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa326, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa327, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa324, ptr %s77, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us140: ; preds = %for.body.lr.ph switch i32 %dir, label %for.end [ i32 0, label %for.body.lr.ph.split.us140.split.us i32 1, label %for.body.lr.ph.split.us140.split.us187 ] for.body.lr.ph.split.us140.split.us: ; preds = %for.body.lr.ph.split.us140 %w66.promoted = load i32, ptr %w74, align 4, !tbaa !5 %n69.promoted = load i32, ptr %n75, align 4, !tbaa !5 %e68.promoted = load i32, ptr %e76, align 4, !tbaa !5 %s67.promoted = load i32, ptr %s77, align 4, !tbaa !5 %36 = add i32 %num, -1 %xtraiter343 = and i32 %num, 7 %37 = icmp ult i32 %36, 7 br i1 %37, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa, label %for.body.lr.ph.split.us140.split.us.new for.body.lr.ph.split.us140.split.us.new: ; preds = %for.body.lr.ph.split.us140.split.us %unroll_iter354 = and i32 %num, -8 br label %for.body.us141.us for.body.us141.us: ; preds = %for.body.us141.us, %for.body.lr.ph.split.us140.split.us.new %niter355 = phi i32 [ 0, %for.body.lr.ph.split.us140.split.us.new ], [ %niter355.next.7, %for.body.us141.us ] %niter355.next.7 = add i32 %niter355, 8 %niter355.ncmp.7 = icmp eq i32 %niter355.next.7, %unroll_iter354 br i1 %niter355.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa, label %for.body.us141.us, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa: ; preds = %for.body.us141.us, %for.body.lr.ph.split.us140.split.us %lcmp.mod349.not = icmp eq i32 %xtraiter343, 0 br i1 %lcmp.mod349.not, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.us, label %for.body.us141.us.epil for.body.us141.us.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa, %for.body.us141.us.epil %38 = phi i32 [ %41, %for.body.us141.us.epil ], [ %s67.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ] %39 = phi i32 [ %38, %for.body.us141.us.epil ], [ %e68.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ] %40 = phi i32 [ %39, %for.body.us141.us.epil ], [ %n69.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ] %41 = phi i32 [ %40, %for.body.us141.us.epil ], [ %w66.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ] %epil.iter344 = phi i32 [ %epil.iter344.next, %for.body.us141.us.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ] %epil.iter344.next = add i32 %epil.iter344, 1 %epil.iter344.cmp.not = icmp eq i32 %epil.iter344.next, %xtraiter343 br i1 %epil.iter344.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.us, label %for.body.us141.us.epil, !llvm.loop !25 for.cond.for.end_crit_edge.split.split.split.split.us.split.us: ; preds = %for.body.us141.us.epil, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa %.lcssa331 = phi i32 [ %e68.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ], [ %38, %for.body.us141.us.epil ] %.lcssa330 = phi i32 [ %n69.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ], [ %39, %for.body.us141.us.epil ] %.lcssa329 = phi i32 [ %w66.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ], [ %40, %for.body.us141.us.epil ] %.lcssa328 = phi i32 [ %s67.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us.unr-lcssa ], [ %41, %for.body.us141.us.epil ] store i32 %.lcssa329, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa330, ptr %n75, align 4, !tbaa !5 store i32 %.lcssa331, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa328, ptr %s77, align 4, !tbaa !5 br label %for.end for.body.lr.ph.split.us140.split.us187: ; preds = %for.body.lr.ph.split.us140 %w74.promoted = load i32, ptr %w74, align 4, !tbaa !5 %s77.promoted = load i32, ptr %s77, align 4, !tbaa !5 %e76.promoted = load i32, ptr %e76, align 4, !tbaa !5 %n75.promoted = load i32, ptr %n75, align 4, !tbaa !5 %42 = add i32 %num, -1 %xtraiter = and i32 %num, 7 %43 = icmp ult i32 %42, 7 br i1 %43, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa, label %for.body.lr.ph.split.us140.split.us187.new for.body.lr.ph.split.us140.split.us187.new: ; preds = %for.body.lr.ph.split.us140.split.us187 %unroll_iter = and i32 %num, -8 br label %for.body.us141.us188 for.body.us141.us188: ; preds = %for.body.us141.us188, %for.body.lr.ph.split.us140.split.us187.new %niter = phi i32 [ 0, %for.body.lr.ph.split.us140.split.us187.new ], [ %niter.next.7, %for.body.us141.us188 ] %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa, label %for.body.us141.us188, !llvm.loop !18 for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa: ; preds = %for.body.us141.us188, %for.body.lr.ph.split.us140.split.us187 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us, label %for.body.us141.us188.epil for.body.us141.us188.epil: ; preds = %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa, %for.body.us141.us188.epil %44 = phi i32 [ %47, %for.body.us141.us188.epil ], [ %n75.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ] %45 = phi i32 [ %44, %for.body.us141.us188.epil ], [ %e76.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ] %46 = phi i32 [ %45, %for.body.us141.us188.epil ], [ %s77.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ] %47 = phi i32 [ %46, %for.body.us141.us188.epil ], [ %w74.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.us141.us188.epil ], [ 0, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ] %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us, label %for.body.us141.us188.epil, !llvm.loop !26 for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us: ; preds = %for.body.us141.us188.epil, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa %.lcssa335 = phi i32 [ %e76.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ], [ %44, %for.body.us141.us188.epil ] %.lcssa334 = phi i32 [ %s77.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ], [ %45, %for.body.us141.us188.epil ] %.lcssa333 = phi i32 [ %w74.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ], [ %46, %for.body.us141.us188.epil ] %.lcssa332 = phi i32 [ %n75.promoted, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us.unr-lcssa ], [ %47, %for.body.us141.us188.epil ] store i32 %.lcssa333, ptr %w74, align 4, !tbaa !5 store i32 %.lcssa334, ptr %s77, align 4, !tbaa !5 store i32 %.lcssa335, ptr %e76, align 4, !tbaa !5 store i32 %.lcssa332, ptr %n75, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.body.lr.ph.split.us140, %for.body.lr.ph.split.us134, %for.body.lr.ph.split.us128, %for.body.lr.ph.split.us, %for.body.lr.ph, %for.cond.for.end_crit_edge.split.us.split.split.us, %for.cond.for.end_crit_edge.split.us.split.us, %for.cond.for.end_crit_edge.split.split.split.us.split.split.us, %for.cond.for.end_crit_edge.split.split.split.us.split.us, %for.cond.for.end_crit_edge.split.split.split.split.us.split.us, %for.cond.for.end_crit_edge.split.split.split.split.us.split.split.us, %for.cond.for.end_crit_edge.split.split.us.split.us, %for.cond.for.end_crit_edge.split.split.us.split.split.us, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @check(i32 noundef %index, ptr nocapture noundef readonly %dice1, ptr nocapture noundef %dice2) local_unnamed_addr #4 { entry: %0 = load i32, ptr %dice2, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %index br i1 %cmp, label %entry.if.end16_crit_edge, label %if.else entry.if.end16_crit_edge: ; preds = %entry %s77.i.phi.trans.insert = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 2 %s22.promoted.i.pre = load i32, ptr %s77.i.phi.trans.insert, align 4, !tbaa !5 %n75.i.phi.trans.insert = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 1 %n24.promoted.i.pre = load i32, ptr %n75.i.phi.trans.insert, align 4, !tbaa !5 br label %if.end16 if.else: ; preds = %entry %n = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp eq i32 %1, %index br i1 %cmp1, label %if.then2, label %if.else3 if.then2: ; preds = %if.else %2 = sub i32 7, %0 store i32 %index, ptr %dice2, align 4, !tbaa !5 br label %if.end16 if.else3: ; preds = %if.else %s = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 2 %3 = load i32, ptr %s, align 4, !tbaa !5 %cmp4 = icmp eq i32 %3, %index br i1 %cmp4, label %for.body.us.i.preheader, label %if.else6 for.body.us.i.preheader: ; preds = %if.else3 %4 = sub i32 7, %0 store i32 %index, ptr %dice2, align 4, !tbaa !5 br label %if.end16 if.else6: ; preds = %if.else3 %e = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 3 %5 = load i32, ptr %e, align 4, !tbaa !5 %cmp7 = icmp eq i32 %5, %index %w23.i109 = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 4 br i1 %cmp7, label %if.then8, label %if.else9 if.then8: ; preds = %if.else6 %6 = sub i32 7, %0 store i32 %index, ptr %dice2, align 4, !tbaa !5 store i32 %6, ptr %e, align 4, !tbaa !5 store i32 %0, ptr %w23.i109, align 4, !tbaa !5 br label %if.end16 if.else9: ; preds = %if.else6 %7 = load i32, ptr %w23.i109, align 4, !tbaa !5 %cmp10 = icmp eq i32 %7, %index %8 = sub i32 7, %0 br i1 %cmp10, label %for.body.us54.i.preheader, label %for.body.us48.i124.preheader for.body.us48.i124.preheader: ; preds = %if.else9 %sub.i42.us.i127.1 = sub nsw i32 7, %1 store i32 %8, ptr %dice2, align 4, !tbaa !5 br label %if.end16 for.body.us54.i.preheader: ; preds = %if.else9 store i32 %index, ptr %dice2, align 4, !tbaa !5 store i32 %8, ptr %w23.i109, align 4, !tbaa !5 store i32 %0, ptr %e, align 4, !tbaa !5 br label %if.end16 if.end16: ; preds = %entry.if.end16_crit_edge, %if.then2, %if.then8, %for.body.us48.i124.preheader, %for.body.us54.i.preheader, %for.body.us.i.preheader %e23.promoted.i.3 = phi i32 [ %2, %if.then2 ], [ %1, %if.then8 ], [ %sub.i42.us.i127.1, %for.body.us48.i124.preheader ], [ %1, %for.body.us54.i.preheader ], [ %0, %for.body.us.i.preheader ], [ %n24.promoted.i.pre, %entry.if.end16_crit_edge ] %w25.promoted.i.3 = phi i32 [ %0, %if.then2 ], [ %3, %if.then8 ], [ %1, %for.body.us48.i124.preheader ], [ %3, %for.body.us54.i.preheader ], [ %4, %for.body.us.i.preheader ], [ %s22.promoted.i.pre, %entry.if.end16_crit_edge ] %9 = phi i32 [ %index, %if.then2 ], [ %index, %if.then8 ], [ %8, %for.body.us48.i124.preheader ], [ %index, %for.body.us54.i.preheader ], [ %index, %for.body.us.i.preheader ], [ %index, %entry.if.end16_crit_edge ] %w74.i = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 4 %n75.i = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 1 %e76.i = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 3 %s77.i = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 2 %sub20 = add nsw i32 %9, -1 %idxprom21 = sext i32 %sub20 to i64 %arrayidx22 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom21 %n24 = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 1 %s34 = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 2 %w44 = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 4 %e54 = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 3 %sub71 = sub i32 6, %9 %idxprom72 = sext i32 %sub71 to i64 %arrayidx73 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom72 %w25.promoted.i = load i32, ptr %w74.i, align 4, !tbaa !5 %e23.promoted.i = load i32, ptr %e76.i, align 4, !tbaa !5 store i32 %w25.promoted.i, ptr %s77.i, align 4, !tbaa !5 store i32 %e23.promoted.i.3, ptr %w74.i, align 4, !tbaa !5 store i32 %e23.promoted.i, ptr %n75.i, align 4, !tbaa !5 store i32 %w25.promoted.i.3, ptr %e76.i, align 4, !tbaa !5 %10 = load i32, ptr %dice1, align 4, !tbaa !27 %sub = add nsw i32 %10, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom %11 = load i32, ptr %arrayidx, align 4, !tbaa !5 %12 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp eq i32 %11, %12 br i1 %cmp23, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %if.end16 %13 = load i32, ptr %n24, align 4, !tbaa !28 %sub25 = add nsw i32 %13, -1 %idxprom26 = sext i32 %sub25 to i64 %arrayidx27 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom26 %14 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %sub29 = add nsw i32 %e23.promoted.i, -1 %idxprom30 = sext i32 %sub29 to i64 %arrayidx31 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom30 %15 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %cmp32 = icmp eq i32 %14, %15 br i1 %cmp32, label %land.lhs.true33, label %for.inc land.lhs.true33: ; preds = %land.lhs.true %16 = load i32, ptr %s34, align 4, !tbaa !29 %sub35 = add nsw i32 %16, -1 %idxprom36 = sext i32 %sub35 to i64 %arrayidx37 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom36 %17 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %sub39 = add nsw i32 %w25.promoted.i, -1 %idxprom40 = sext i32 %sub39 to i64 %arrayidx41 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom40 %18 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %cmp42 = icmp eq i32 %17, %18 br i1 %cmp42, label %land.lhs.true43, label %for.inc land.lhs.true43: ; preds = %land.lhs.true33 %19 = load i32, ptr %w44, align 4, !tbaa !9 %sub45 = add nsw i32 %19, -1 %idxprom46 = sext i32 %sub45 to i64 %arrayidx47 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom46 %20 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %sub49 = add nsw i32 %e23.promoted.i.3, -1 %idxprom50 = sext i32 %sub49 to i64 %arrayidx51 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom50 %21 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %cmp52 = icmp eq i32 %20, %21 br i1 %cmp52, label %land.lhs.true53, label %for.inc land.lhs.true53: ; preds = %land.lhs.true43 %22 = load i32, ptr %e54, align 4, !tbaa !30 %sub55 = add nsw i32 %22, -1 %idxprom56 = sext i32 %sub55 to i64 %arrayidx57 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom56 %23 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %sub59 = add nsw i32 %w25.promoted.i.3, -1 %idxprom60 = sext i32 %sub59 to i64 %arrayidx61 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom60 %24 = load i32, ptr %arrayidx61, align 4, !tbaa !5 %cmp62 = icmp eq i32 %23, %24 br i1 %cmp62, label %land.lhs.true63, label %for.inc land.lhs.true63: ; preds = %land.lhs.true53 %sub66 = sub i32 6, %10 %idxprom67 = sext i32 %sub66 to i64 %arrayidx68 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom67 %25 = load i32, ptr %arrayidx68, align 4, !tbaa !5 %26 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %cmp74 = icmp eq i32 %25, %26 br i1 %cmp74, label %for.end, label %for.inc for.inc: ; preds = %if.end16, %land.lhs.true, %land.lhs.true33, %land.lhs.true43, %land.lhs.true53, %land.lhs.true63 store i32 %e23.promoted.i.3, ptr %s77.i, align 4, !tbaa !5 store i32 %e23.promoted.i, ptr %w74.i, align 4, !tbaa !5 store i32 %w25.promoted.i.3, ptr %n75.i, align 4, !tbaa !5 store i32 %w25.promoted.i, ptr %e76.i, align 4, !tbaa !5 %27 = load i32, ptr %dice1, align 4, !tbaa !27 %sub.1 = add nsw i32 %27, -1 %idxprom.1 = sext i32 %sub.1 to i64 %arrayidx.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom.1 %28 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %29 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.1 = icmp eq i32 %28, %29 br i1 %cmp23.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %30 = load i32, ptr %n24, align 4, !tbaa !28 %sub25.1 = add nsw i32 %30, -1 %idxprom26.1 = sext i32 %sub25.1 to i64 %arrayidx27.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom26.1 %31 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %sub29.1 = add nsw i32 %w25.promoted.i.3, -1 %idxprom30.1 = sext i32 %sub29.1 to i64 %arrayidx31.1 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom30.1 %32 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5 %cmp32.1 = icmp eq i32 %31, %32 br i1 %cmp32.1, label %land.lhs.true33.1, label %for.inc.1 land.lhs.true33.1: ; preds = %land.lhs.true.1 %33 = load i32, ptr %s34, align 4, !tbaa !29 %sub35.1 = add nsw i32 %33, -1 %idxprom36.1 = sext i32 %sub35.1 to i64 %arrayidx37.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom36.1 %34 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5 %sub39.1 = add nsw i32 %e23.promoted.i.3, -1 %idxprom40.1 = sext i32 %sub39.1 to i64 %arrayidx41.1 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom40.1 %35 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %cmp42.1 = icmp eq i32 %34, %35 br i1 %cmp42.1, label %land.lhs.true43.1, label %for.inc.1 land.lhs.true43.1: ; preds = %land.lhs.true33.1 %36 = load i32, ptr %w44, align 4, !tbaa !9 %sub45.1 = add nsw i32 %36, -1 %idxprom46.1 = sext i32 %sub45.1 to i64 %arrayidx47.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom46.1 %37 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5 %sub49.1 = add nsw i32 %e23.promoted.i, -1 %idxprom50.1 = sext i32 %sub49.1 to i64 %arrayidx51.1 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom50.1 %38 = load i32, ptr %arrayidx51.1, align 4, !tbaa !5 %cmp52.1 = icmp eq i32 %37, %38 br i1 %cmp52.1, label %land.lhs.true53.1, label %for.inc.1 land.lhs.true53.1: ; preds = %land.lhs.true43.1 %39 = load i32, ptr %e54, align 4, !tbaa !30 %sub55.1 = add nsw i32 %39, -1 %idxprom56.1 = sext i32 %sub55.1 to i64 %arrayidx57.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom56.1 %40 = load i32, ptr %arrayidx57.1, align 4, !tbaa !5 %sub59.1 = add nsw i32 %w25.promoted.i, -1 %idxprom60.1 = sext i32 %sub59.1 to i64 %arrayidx61.1 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom60.1 %41 = load i32, ptr %arrayidx61.1, align 4, !tbaa !5 %cmp62.1 = icmp eq i32 %40, %41 br i1 %cmp62.1, label %land.lhs.true63.1, label %for.inc.1 land.lhs.true63.1: ; preds = %land.lhs.true53.1 %sub66.1 = sub i32 6, %27 %idxprom67.1 = sext i32 %sub66.1 to i64 %arrayidx68.1 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom67.1 %42 = load i32, ptr %arrayidx68.1, align 4, !tbaa !5 %43 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %cmp74.1 = icmp eq i32 %42, %43 br i1 %cmp74.1, label %for.end, label %for.inc.1 for.inc.1: ; preds = %land.lhs.true63.1, %land.lhs.true53.1, %land.lhs.true43.1, %land.lhs.true33.1, %land.lhs.true.1, %for.inc store i32 %e23.promoted.i, ptr %s77.i, align 4, !tbaa !5 store i32 %w25.promoted.i.3, ptr %w74.i, align 4, !tbaa !5 store i32 %w25.promoted.i, ptr %n75.i, align 4, !tbaa !5 store i32 %e23.promoted.i.3, ptr %e76.i, align 4, !tbaa !5 %44 = load i32, ptr %dice1, align 4, !tbaa !27 %sub.2 = add nsw i32 %44, -1 %idxprom.2 = sext i32 %sub.2 to i64 %arrayidx.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom.2 %45 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %46 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.2 = icmp eq i32 %45, %46 br i1 %cmp23.2, label %land.lhs.true.2, label %for.inc.2 land.lhs.true.2: ; preds = %for.inc.1 %47 = load i32, ptr %n24, align 4, !tbaa !28 %sub25.2 = add nsw i32 %47, -1 %idxprom26.2 = sext i32 %sub25.2 to i64 %arrayidx27.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom26.2 %48 = load i32, ptr %arrayidx27.2, align 4, !tbaa !5 %sub29.2 = add nsw i32 %w25.promoted.i, -1 %idxprom30.2 = sext i32 %sub29.2 to i64 %arrayidx31.2 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom30.2 %49 = load i32, ptr %arrayidx31.2, align 4, !tbaa !5 %cmp32.2 = icmp eq i32 %48, %49 br i1 %cmp32.2, label %land.lhs.true33.2, label %for.inc.2 land.lhs.true33.2: ; preds = %land.lhs.true.2 %50 = load i32, ptr %s34, align 4, !tbaa !29 %sub35.2 = add nsw i32 %50, -1 %idxprom36.2 = sext i32 %sub35.2 to i64 %arrayidx37.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom36.2 %51 = load i32, ptr %arrayidx37.2, align 4, !tbaa !5 %sub39.2 = add nsw i32 %e23.promoted.i, -1 %idxprom40.2 = sext i32 %sub39.2 to i64 %arrayidx41.2 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom40.2 %52 = load i32, ptr %arrayidx41.2, align 4, !tbaa !5 %cmp42.2 = icmp eq i32 %51, %52 br i1 %cmp42.2, label %land.lhs.true43.2, label %for.inc.2 land.lhs.true43.2: ; preds = %land.lhs.true33.2 %53 = load i32, ptr %w44, align 4, !tbaa !9 %sub45.2 = add nsw i32 %53, -1 %idxprom46.2 = sext i32 %sub45.2 to i64 %arrayidx47.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom46.2 %54 = load i32, ptr %arrayidx47.2, align 4, !tbaa !5 %sub49.2 = add nsw i32 %w25.promoted.i.3, -1 %idxprom50.2 = sext i32 %sub49.2 to i64 %arrayidx51.2 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom50.2 %55 = load i32, ptr %arrayidx51.2, align 4, !tbaa !5 %cmp52.2 = icmp eq i32 %54, %55 br i1 %cmp52.2, label %land.lhs.true53.2, label %for.inc.2 land.lhs.true53.2: ; preds = %land.lhs.true43.2 %56 = load i32, ptr %e54, align 4, !tbaa !30 %sub55.2 = add nsw i32 %56, -1 %idxprom56.2 = sext i32 %sub55.2 to i64 %arrayidx57.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom56.2 %57 = load i32, ptr %arrayidx57.2, align 4, !tbaa !5 %sub59.2 = add nsw i32 %e23.promoted.i.3, -1 %idxprom60.2 = sext i32 %sub59.2 to i64 %arrayidx61.2 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom60.2 %58 = load i32, ptr %arrayidx61.2, align 4, !tbaa !5 %cmp62.2 = icmp eq i32 %57, %58 br i1 %cmp62.2, label %land.lhs.true63.2, label %for.inc.2 land.lhs.true63.2: ; preds = %land.lhs.true53.2 %sub66.2 = sub i32 6, %44 %idxprom67.2 = sext i32 %sub66.2 to i64 %arrayidx68.2 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom67.2 %59 = load i32, ptr %arrayidx68.2, align 4, !tbaa !5 %60 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %cmp74.2 = icmp eq i32 %59, %60 br i1 %cmp74.2, label %for.end, label %for.inc.2 for.inc.2: ; preds = %land.lhs.true63.2, %land.lhs.true53.2, %land.lhs.true43.2, %land.lhs.true33.2, %land.lhs.true.2, %for.inc.1 store i32 %w25.promoted.i.3, ptr %s77.i, align 4, !tbaa !5 store i32 %w25.promoted.i, ptr %w74.i, align 4, !tbaa !5 store i32 %e23.promoted.i.3, ptr %n75.i, align 4, !tbaa !5 store i32 %e23.promoted.i, ptr %e76.i, align 4, !tbaa !5 %61 = load i32, ptr %dice1, align 4, !tbaa !27 %sub.3 = add nsw i32 %61, -1 %idxprom.3 = sext i32 %sub.3 to i64 %arrayidx.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom.3 %62 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %63 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.3 = icmp eq i32 %62, %63 br i1 %cmp23.3, label %land.lhs.true.3, label %for.inc.3 land.lhs.true.3: ; preds = %for.inc.2 %64 = load i32, ptr %n24, align 4, !tbaa !28 %sub25.3 = add nsw i32 %64, -1 %idxprom26.3 = sext i32 %sub25.3 to i64 %arrayidx27.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom26.3 %65 = load i32, ptr %arrayidx27.3, align 4, !tbaa !5 %sub29.3 = add nsw i32 %e23.promoted.i.3, -1 %idxprom30.3 = sext i32 %sub29.3 to i64 %arrayidx31.3 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom30.3 %66 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5 %cmp32.3 = icmp eq i32 %65, %66 br i1 %cmp32.3, label %land.lhs.true33.3, label %for.inc.3 land.lhs.true33.3: ; preds = %land.lhs.true.3 %67 = load i32, ptr %s34, align 4, !tbaa !29 %sub35.3 = add nsw i32 %67, -1 %idxprom36.3 = sext i32 %sub35.3 to i64 %arrayidx37.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom36.3 %68 = load i32, ptr %arrayidx37.3, align 4, !tbaa !5 %sub39.3 = add nsw i32 %w25.promoted.i.3, -1 %idxprom40.3 = sext i32 %sub39.3 to i64 %arrayidx41.3 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom40.3 %69 = load i32, ptr %arrayidx41.3, align 4, !tbaa !5 %cmp42.3 = icmp eq i32 %68, %69 br i1 %cmp42.3, label %land.lhs.true43.3, label %for.inc.3 land.lhs.true43.3: ; preds = %land.lhs.true33.3 %70 = load i32, ptr %w44, align 4, !tbaa !9 %sub45.3 = add nsw i32 %70, -1 %idxprom46.3 = sext i32 %sub45.3 to i64 %arrayidx47.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom46.3 %71 = load i32, ptr %arrayidx47.3, align 4, !tbaa !5 %sub49.3 = add nsw i32 %w25.promoted.i, -1 %idxprom50.3 = sext i32 %sub49.3 to i64 %arrayidx51.3 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom50.3 %72 = load i32, ptr %arrayidx51.3, align 4, !tbaa !5 %cmp52.3 = icmp eq i32 %71, %72 br i1 %cmp52.3, label %land.lhs.true53.3, label %for.inc.3 land.lhs.true53.3: ; preds = %land.lhs.true43.3 %73 = load i32, ptr %e54, align 4, !tbaa !30 %sub55.3 = add nsw i32 %73, -1 %idxprom56.3 = sext i32 %sub55.3 to i64 %arrayidx57.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom56.3 %74 = load i32, ptr %arrayidx57.3, align 4, !tbaa !5 %sub59.3 = add nsw i32 %e23.promoted.i, -1 %idxprom60.3 = sext i32 %sub59.3 to i64 %arrayidx61.3 = getelementptr inbounds [6 x i32], ptr @num2, i64 0, i64 %idxprom60.3 %75 = load i32, ptr %arrayidx61.3, align 4, !tbaa !5 %cmp62.3 = icmp eq i32 %74, %75 br i1 %cmp62.3, label %land.lhs.true63.3, label %for.inc.3 land.lhs.true63.3: ; preds = %land.lhs.true53.3 %sub66.3 = sub i32 6, %61 %idxprom67.3 = sext i32 %sub66.3 to i64 %arrayidx68.3 = getelementptr inbounds [6 x i32], ptr @num1, i64 0, i64 %idxprom67.3 %76 = load i32, ptr %arrayidx68.3, align 4, !tbaa !5 %77 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %cmp74.3 = icmp eq i32 %76, %77 br i1 %cmp74.3, label %for.end, label %for.inc.3 for.inc.3: ; preds = %land.lhs.true63.3, %land.lhs.true53.3, %land.lhs.true43.3, %land.lhs.true33.3, %land.lhs.true.3, %for.inc.2 br label %for.end for.end: ; preds = %for.inc.3, %land.lhs.true63.3, %land.lhs.true63.2, %land.lhs.true63.1, %land.lhs.true63 %isMatch.0 = phi i32 [ 1, %land.lhs.true63 ], [ 1, %land.lhs.true63.1 ], [ 1, %land.lhs.true63.2 ], [ 1, %land.lhs.true63.3 ], [ 0, %for.inc.3 ] ret i32 %isMatch.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #5 { entry: %dice1 = alloca %struct.Dice, align 16 %dice2 = alloca %struct.Dice, align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %dice1) #8 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %dice2) #8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num1) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num1, i64 0, i64 1)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num1, i64 0, i64 2)) %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num1, i64 0, i64 3)) %call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num1, i64 0, i64 4)) %call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num1, i64 0, i64 5)) %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num2) %call6.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num2, i64 0, i64 1)) %call6.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num2, i64 0, i64 2)) %call6.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num2, i64 0, i64 3)) %call6.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num2, i64 0, i64 4)) %call6.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @num2, i64 0, i64 5)) store <4 x i32> <i32 1, i32 5, i32 2, i32 3>, ptr %dice1, align 16, !tbaa !5 %w.i = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 4 store i32 4, ptr %w.i, align 16, !tbaa !9 store <4 x i32> <i32 1, i32 5, i32 2, i32 3>, ptr %dice2, align 16, !tbaa !5 %w.i34 = getelementptr inbounds %struct.Dice, ptr %dice2, i64 0, i32 4 store i32 4, ptr %w.i34, align 16, !tbaa !9 %call13 = call i32 @check(i32 noundef 1, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %for.cond10.1, label %if.end21, !llvm.loop !32 for.cond10.1: ; preds = %entry %call13.1 = call i32 @check(i32 noundef 2, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not.1 = icmp eq i32 %call13.1, 0 br i1 %tobool.not.1, label %for.cond10.2, label %if.end21, !llvm.loop !32 for.cond10.2: ; preds = %for.cond10.1 %call13.2 = call i32 @check(i32 noundef 3, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not.2 = icmp eq i32 %call13.2, 0 br i1 %tobool.not.2, label %for.cond10.3, label %if.end21, !llvm.loop !32 for.cond10.3: ; preds = %for.cond10.2 %call13.3 = call i32 @check(i32 noundef 4, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not.3 = icmp eq i32 %call13.3, 0 br i1 %tobool.not.3, label %for.cond10.4, label %if.end21, !llvm.loop !32 for.cond10.4: ; preds = %for.cond10.3 %call13.4 = call i32 @check(i32 noundef 5, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not.4 = icmp eq i32 %call13.4, 0 br i1 %tobool.not.4, label %for.cond10.5, label %if.end21, !llvm.loop !32 for.cond10.5: ; preds = %for.cond10.4 %call13.5 = call i32 @check(i32 noundef 6, ptr noundef nonnull %dice1, ptr noundef nonnull %dice2), !range !31 %tobool.not.5 = icmp eq i32 %call13.5, 0 %spec.select = select i1 %tobool.not.5, ptr @str, ptr @str.3 br label %if.end21, !llvm.loop !32 if.end21: ; preds = %for.cond10.5, %entry, %for.cond10.1, %for.cond10.2, %for.cond10.3, %for.cond10.4 %str.sink = phi ptr [ @str.3, %for.cond10.4 ], [ @str.3, %for.cond10.3 ], [ @str.3, %for.cond10.2 ], [ @str.3, %for.cond10.1 ], [ @str.3, %entry ], [ %spec.select, %for.cond10.5 ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %dice2) #8 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %dice1) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 attributes #0 = { mustprogress nofree norecurse 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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { 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 #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-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 } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 16} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14} !17 = distinct !{!17, !14} !18 = distinct !{!18, !12} !19 = distinct !{!19, !14} !20 = distinct !{!20, !14} !21 = distinct !{!21, !14} !22 = distinct !{!22, !14} !23 = distinct !{!23, !14} !24 = distinct !{!24, !14} !25 = distinct !{!25, !14} !26 = distinct !{!26, !14} !27 = !{!10, !6, i64 0} !28 = !{!10, !6, i64 4} !29 = !{!10, !6, i64 8} !30 = !{!10, !6, i64 12} !31 = !{i32 0, i32 2} !32 = distinct !{!32, !12}
#include<stdio.h> #include<ctype.h> #include<string.h> #include <math.h> int main(void){ int a=0,b,d[2][6],i,j,k,n,x,y; char c; for(i=0;i<6;i++){ scanf("%d%*c",&d[0][i] ); } for(i=0;i<6;i++){ scanf("%d%*c",&d[1][i] ); } for(i=0;i<4;i++){ n=d[1][0]; d[1][0]=d[1][2]; d[1][2]=d[1][5]; d[1][5]=d[1][3]; d[1][3]=n; for(j=0;j<4;j++){ n=d[1][0]; d[1][0]=d[1][1]; d[1][1]=d[1][5]; d[1][5]=d[1][4]; d[1][4]=n; for(k=0;k<4;k++){ n=d[1][1]; d[1][1]=d[1][3]; d[1][3]=d[1][4]; d[1][4]=d[1][2]; d[1][2]=n; for(a=0,b=0;a<6;a++){ if(d[1][a]==d[0][a])b++; } if(b==6){ printf("Yes\n" ); return 0; } } } }printf("No\n" ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117075/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117075/source.c" target datalayout = "e-m:e-p270: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%*c\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca [2 x [6 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %arrayidx1.1 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.1) %arrayidx1.2 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.2) %arrayidx1.3 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.3) %arrayidx1.4 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.4) %arrayidx1.5 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.5) %arrayidx7 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 0 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %arrayidx7.1 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 1 %call8.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.1) %arrayidx7.2 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 2 %call8.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.2) %arrayidx7.3 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 3 %call8.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.3) %arrayidx7.4 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 4 %call8.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.4) %arrayidx7.5 = getelementptr inbounds [2 x [6 x i32]], ptr %d, i64 0, i64 1, i64 5 %call8.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.5) %arrayidx15.promoted147 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %arrayidx18.promoted = load i32, ptr %arrayidx7.2, align 16, !tbaa !5 %arrayidx22.promoted150 = load i32, ptr %arrayidx7.5, align 4, !tbaa !5 %arrayidx26.promoted = load i32, ptr %arrayidx7.3, align 4, !tbaa !5 %arrayidx37.promoted = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %arrayidx45.promoted = load i32, ptr %arrayidx7.4, align 8, !tbaa !5 %.pre.pre = load i32, ptr %d, align 16, !tbaa !5 %.pre194.pre = load i32, ptr %arrayidx1.1, align 4, !tbaa !5 %.pre195.pre = load i32, ptr %arrayidx1.2, align 8, !tbaa !5 %.pre196.pre = load i32, ptr %arrayidx1.3, align 4, !tbaa !5 %.pre197.pre = load i32, ptr %arrayidx1.4, align 16, !tbaa !5 %.pre198.pre = load i32, ptr %arrayidx1.5, align 4, !tbaa !5 %cmp78 = icmp eq i32 %arrayidx37.promoted, %.pre.pre %inc79 = zext i1 %cmp78 to i32 %cmp78.5 = icmp eq i32 %arrayidx45.promoted, %.pre198.pre %inc79.5 = zext i1 %cmp78.5 to i32 %cmp78.2.1230 = icmp eq i32 %arrayidx45.promoted, %.pre195.pre %inc79.2.1231 = zext i1 %cmp78.2.1230 to i32 %cmp78.3.1233 = icmp eq i32 %arrayidx37.promoted, %.pre196.pre %inc79.3.1234 = zext i1 %cmp78.3.1233 to i32 %cmp78.1.1.1 = icmp eq i32 %arrayidx37.promoted, %.pre194.pre %inc79.1.1.1 = zext i1 %cmp78.1.1.1 to i32 %cmp78.4.1.1 = icmp eq i32 %arrayidx45.promoted, %.pre197.pre %inc79.4.1.1 = zext i1 %cmp78.4.1.1 to i32 %cmp78.2.2.1 = icmp eq i32 %arrayidx37.promoted, %.pre195.pre %inc79.2.2.1 = zext i1 %cmp78.2.2.1 to i32 %cmp78.3.2.1 = icmp eq i32 %arrayidx45.promoted, %.pre196.pre %inc79.3.2.1 = zext i1 %cmp78.3.2.1 to i32 %cmp78.1.3.1 = icmp eq i32 %arrayidx45.promoted, %.pre194.pre %inc79.1.3.1 = zext i1 %cmp78.1.3.1 to i32 %cmp78.4.3.1 = icmp eq i32 %arrayidx37.promoted, %.pre197.pre %inc79.4.3.1 = zext i1 %cmp78.4.3.1 to i32 %cmp78.2240 = icmp eq i32 %arrayidx45.promoted, %.pre.pre %inc79.2241 = zext i1 %cmp78.2240 to i32 %cmp78.5.2 = icmp eq i32 %arrayidx37.promoted, %.pre198.pre %inc79.5.2 = zext i1 %cmp78.5.2 to i32 %cmp78.2.3256 = icmp eq i32 %arrayidx37.promoted, %.pre195.pre %inc79.2.3257 = zext i1 %cmp78.2.3256 to i32 %cmp78.3.3259 = icmp eq i32 %arrayidx45.promoted, %.pre196.pre %inc79.3.3260 = zext i1 %cmp78.3.3259 to i32 %cmp78.1.1.3 = icmp eq i32 %arrayidx45.promoted, %.pre194.pre %inc79.1.1.3 = zext i1 %cmp78.1.1.3 to i32 %cmp78.4.1.3 = icmp eq i32 %arrayidx37.promoted, %.pre197.pre %inc79.4.1.3 = zext i1 %cmp78.4.1.3 to i32 %cmp78.2.2.3 = icmp eq i32 %arrayidx45.promoted, %.pre195.pre %inc79.2.2.3 = zext i1 %cmp78.2.2.3 to i32 %cmp78.3.2.3 = icmp eq i32 %arrayidx37.promoted, %.pre196.pre %inc79.3.2.3 = zext i1 %cmp78.3.2.3 to i32 %cmp78.1.3.3 = icmp eq i32 %arrayidx37.promoted, %.pre194.pre %inc79.1.3.3 = zext i1 %cmp78.1.3.3 to i32 %cmp78.4.3.3 = icmp eq i32 %arrayidx45.promoted, %.pre197.pre %inc79.4.3.3 = zext i1 %cmp78.4.3.3 to i32 br label %for.body14 for.body14: ; preds = %entry, %for.cond50.3.3 %i.2171 = phi i32 [ 0, %entry ], [ %inc94, %for.cond50.3.3 ] %arrayidx15.promoted148170 = phi i32 [ %arrayidx15.promoted147, %entry ], [ %arrayidx18.promoted133149169, %for.cond50.3.3 ] %arrayidx18.promoted133149169 = phi i32 [ %arrayidx18.promoted, %entry ], [ %arrayidx22.promoted151168, %for.cond50.3.3 ] %arrayidx22.promoted151168 = phi i32 [ %arrayidx22.promoted150, %entry ], [ %arrayidx26.promoted131152167, %for.cond50.3.3 ] %arrayidx26.promoted131152167 = phi i32 [ %arrayidx26.promoted, %entry ], [ %arrayidx15.promoted148170, %for.cond50.3.3 ] %cmp78.1 = icmp eq i32 %arrayidx15.promoted148170, %.pre194.pre %inc79.1 = zext i1 %cmp78.1 to i32 %cmp78.4 = icmp eq i32 %arrayidx22.promoted151168, %.pre197.pre %inc79.4 = zext i1 %cmp78.4 to i32 %cmp78.2.1 = icmp eq i32 %arrayidx15.promoted148170, %.pre195.pre %inc79.2.1 = zext i1 %cmp78.2.1 to i32 %cmp78.3.1 = icmp eq i32 %arrayidx22.promoted151168, %.pre196.pre %inc79.3.1 = zext i1 %cmp78.3.1 to i32 %cmp78.1.2 = icmp eq i32 %arrayidx22.promoted151168, %.pre194.pre %inc79.1.2 = zext i1 %cmp78.1.2 to i32 %cmp78.4.2 = icmp eq i32 %arrayidx15.promoted148170, %.pre197.pre %inc79.4.2 = zext i1 %cmp78.4.2 to i32 %cmp78.2.3 = icmp eq i32 %arrayidx22.promoted151168, %.pre195.pre %inc79.2.3 = zext i1 %cmp78.2.3 to i32 %cmp78.3.3 = icmp eq i32 %arrayidx15.promoted148170, %.pre196.pre %inc79.3.3 = zext i1 %cmp78.3.3 to i32 %spec.select.1 = add nuw nsw i32 %inc79, %inc79.1 %cmp78.2 = icmp eq i32 %arrayidx26.promoted131152167, %.pre195.pre %inc79.2 = zext i1 %cmp78.2 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc79.2 %cmp78.3 = icmp eq i32 %arrayidx18.promoted133149169, %.pre196.pre %inc79.3 = zext i1 %cmp78.3 to i32 %spec.select.3 = add nuw nsw i32 %spec.select.2, %inc79.3 %spec.select.4 = add nuw nsw i32 %spec.select.3, %inc79.4 %spec.select.5 = add nuw nsw i32 %spec.select.4, %inc79.5 %cmp83 = icmp eq i32 %spec.select.5, 6 br i1 %cmp83, label %if.then84, label %for.cond50 for.cond50: ; preds = %for.body14 %cmp78.1.1 = icmp eq i32 %arrayidx18.promoted133149169, %.pre194.pre %inc79.1.1 = zext i1 %cmp78.1.1 to i32 %spec.select.1.1 = add nuw nsw i32 %inc79, %inc79.1.1 %spec.select.2.1 = add nuw nsw i32 %spec.select.1.1, %inc79.2.1 %spec.select.3.1 = add nuw nsw i32 %spec.select.2.1, %inc79.3.1 %cmp78.4.1 = icmp eq i32 %arrayidx26.promoted131152167, %.pre197.pre %inc79.4.1 = zext i1 %cmp78.4.1 to i32 %spec.select.4.1 = add nuw nsw i32 %spec.select.3.1, %inc79.4.1 %spec.select.5.1 = add nuw nsw i32 %spec.select.4.1, %inc79.5 %cmp83.1 = icmp eq i32 %spec.select.5.1, 6 br i1 %cmp83.1, label %if.then84, label %for.cond50.1 for.cond50.1: ; preds = %for.cond50 %spec.select.1.2 = add nuw nsw i32 %inc79, %inc79.1.2 %cmp78.2.2 = icmp eq i32 %arrayidx18.promoted133149169, %.pre195.pre %inc79.2.2 = zext i1 %cmp78.2.2 to i32 %spec.select.2.2 = add nuw nsw i32 %spec.select.1.2, %inc79.2.2 %cmp78.3.2 = icmp eq i32 %arrayidx26.promoted131152167, %.pre196.pre %inc79.3.2 = zext i1 %cmp78.3.2 to i32 %spec.select.3.2 = add nuw nsw i32 %spec.select.2.2, %inc79.3.2 %spec.select.4.2 = add nuw nsw i32 %spec.select.3.2, %inc79.4.2 %spec.select.5.2 = add nuw nsw i32 %spec.select.4.2, %inc79.5 %cmp83.2 = icmp eq i32 %spec.select.5.2, 6 br i1 %cmp83.2, label %if.then84, label %for.cond50.2 for.cond50.2: ; preds = %for.cond50.1 %cmp78.1.3 = icmp eq i32 %arrayidx26.promoted131152167, %.pre194.pre %inc79.1.3 = zext i1 %cmp78.1.3 to i32 %spec.select.1.3 = add nuw nsw i32 %inc79, %inc79.1.3 %spec.select.2.3 = add nuw nsw i32 %spec.select.1.3, %inc79.2.3 %spec.select.3.3 = add nuw nsw i32 %spec.select.2.3, %inc79.3.3 %cmp78.4.3 = icmp eq i32 %arrayidx18.promoted133149169, %.pre197.pre %inc79.4.3 = zext i1 %cmp78.4.3 to i32 %spec.select.4.3 = add nuw nsw i32 %spec.select.3.3, %inc79.4.3 %spec.select.5.3 = add nuw nsw i32 %spec.select.4.3, %inc79.5 %cmp83.3 = icmp eq i32 %spec.select.5.3, 6 br i1 %cmp83.3, label %if.then84, label %for.cond50.3 for.cond50.3: ; preds = %for.cond50.2 %cmp78.1227 = icmp eq i32 %arrayidx26.promoted131152167, %.pre.pre %inc79.1228 = zext i1 %cmp78.1227 to i32 %spec.select.1.1229 = add nuw nsw i32 %inc79.1228, %inc79.1 %spec.select.2.1232 = add nuw nsw i32 %spec.select.1.1229, %inc79.2.1231 %spec.select.3.1235 = add nuw nsw i32 %spec.select.2.1232, %inc79.3.1234 %spec.select.4.1236 = add nuw nsw i32 %spec.select.3.1235, %inc79.4 %cmp78.5.1 = icmp eq i32 %arrayidx18.promoted133149169, %.pre198.pre %inc79.5.1 = zext i1 %cmp78.5.1 to i32 %spec.select.5.1237 = add nuw nsw i32 %spec.select.4.1236, %inc79.5.1 %cmp83.1238 = icmp eq i32 %spec.select.5.1237, 6 br i1 %cmp83.1238, label %if.then84, label %for.cond50.1239 for.cond50.1239: ; preds = %for.cond50.3 %spec.select.1.1.1 = add nuw nsw i32 %inc79.1228, %inc79.1.1.1 %spec.select.2.1.1 = add nuw nsw i32 %spec.select.1.1.1, %inc79.2.1 %spec.select.3.1.1 = add nuw nsw i32 %spec.select.2.1.1, %inc79.3.1 %spec.select.4.1.1 = add nuw nsw i32 %spec.select.3.1.1, %inc79.4.1.1 %spec.select.5.1.1 = add nuw nsw i32 %spec.select.4.1.1, %inc79.5.1 %cmp83.1.1 = icmp eq i32 %spec.select.5.1.1, 6 br i1 %cmp83.1.1, label %if.then84, label %for.cond50.1.1 for.cond50.1.1: ; preds = %for.cond50.1239 %spec.select.1.2.1 = add nuw nsw i32 %inc79.1228, %inc79.1.2 %spec.select.2.2.1 = add nuw nsw i32 %spec.select.1.2.1, %inc79.2.2.1 %spec.select.3.2.1 = add nuw nsw i32 %spec.select.2.2.1, %inc79.3.2.1 %spec.select.4.2.1 = add nuw nsw i32 %spec.select.3.2.1, %inc79.4.2 %spec.select.5.2.1 = add nuw nsw i32 %spec.select.4.2.1, %inc79.5.1 %cmp83.2.1 = icmp eq i32 %spec.select.5.2.1, 6 br i1 %cmp83.2.1, label %if.then84, label %for.cond50.2.1 for.cond50.2.1: ; preds = %for.cond50.1.1 %spec.select.1.3.1 = add nuw nsw i32 %inc79.1228, %inc79.1.3.1 %spec.select.2.3.1 = add nuw nsw i32 %spec.select.1.3.1, %inc79.2.3 %spec.select.3.3.1 = add nuw nsw i32 %spec.select.2.3.1, %inc79.3.3 %spec.select.4.3.1 = add nuw nsw i32 %spec.select.3.3.1, %inc79.4.3.1 %spec.select.5.3.1 = add nuw nsw i32 %spec.select.4.3.1, %inc79.5.1 %cmp83.3.1 = icmp eq i32 %spec.select.5.3.1, 6 br i1 %cmp83.3.1, label %if.then84, label %for.cond50.3.1 for.cond50.3.1: ; preds = %for.cond50.2.1 %spec.select.1.2242 = add nuw nsw i32 %inc79.2241, %inc79.1 %cmp78.2.2243 = icmp eq i32 %arrayidx18.promoted133149169, %.pre195.pre %inc79.2.2244 = zext i1 %cmp78.2.2243 to i32 %spec.select.2.2245 = add nuw nsw i32 %spec.select.1.2242, %inc79.2.2244 %cmp78.3.2246 = icmp eq i32 %arrayidx26.promoted131152167, %.pre196.pre %inc79.3.2247 = zext i1 %cmp78.3.2246 to i32 %spec.select.3.2248 = add nuw nsw i32 %spec.select.2.2245, %inc79.3.2247 %spec.select.4.2249 = add nuw nsw i32 %spec.select.3.2248, %inc79.4 %spec.select.5.2250 = add nuw nsw i32 %spec.select.4.2249, %inc79.5.2 %cmp83.2251 = icmp eq i32 %spec.select.5.2250, 6 br i1 %cmp83.2251, label %if.then84, label %for.cond50.2252 for.cond50.2252: ; preds = %for.cond50.3.1 %cmp78.1.1.2 = icmp eq i32 %arrayidx26.promoted131152167, %.pre194.pre %inc79.1.1.2 = zext i1 %cmp78.1.1.2 to i32 %spec.select.1.1.2 = add nuw nsw i32 %inc79.2241, %inc79.1.1.2 %spec.select.2.1.2 = add nuw nsw i32 %spec.select.1.1.2, %inc79.2.1 %spec.select.3.1.2 = add nuw nsw i32 %spec.select.2.1.2, %inc79.3.1 %cmp78.4.1.2 = icmp eq i32 %arrayidx18.promoted133149169, %.pre197.pre %inc79.4.1.2 = zext i1 %cmp78.4.1.2 to i32 %spec.select.4.1.2 = add nuw nsw i32 %spec.select.3.1.2, %inc79.4.1.2 %spec.select.5.1.2 = add nuw nsw i32 %spec.select.4.1.2, %inc79.5.2 %cmp83.1.2 = icmp eq i32 %spec.select.5.1.2, 6 br i1 %cmp83.1.2, label %if.then84, label %for.cond50.1.2 for.cond50.1.2: ; preds = %for.cond50.2252 %spec.select.1.2.2 = add nuw nsw i32 %inc79.2241, %inc79.1.2 %cmp78.2.2.2 = icmp eq i32 %arrayidx26.promoted131152167, %.pre195.pre %inc79.2.2.2 = zext i1 %cmp78.2.2.2 to i32 %spec.select.2.2.2 = add nuw nsw i32 %spec.select.1.2.2, %inc79.2.2.2 %cmp78.3.2.2 = icmp eq i32 %arrayidx18.promoted133149169, %.pre196.pre %inc79.3.2.2 = zext i1 %cmp78.3.2.2 to i32 %spec.select.3.2.2 = add nuw nsw i32 %spec.select.2.2.2, %inc79.3.2.2 %spec.select.4.2.2 = add nuw nsw i32 %spec.select.3.2.2, %inc79.4.2 %spec.select.5.2.2 = add nuw nsw i32 %spec.select.4.2.2, %inc79.5.2 %cmp83.2.2 = icmp eq i32 %spec.select.5.2.2, 6 br i1 %cmp83.2.2, label %if.then84, label %for.cond50.2.2 for.cond50.2.2: ; preds = %for.cond50.1.2 %cmp78.1.3.2 = icmp eq i32 %arrayidx18.promoted133149169, %.pre194.pre %inc79.1.3.2 = zext i1 %cmp78.1.3.2 to i32 %spec.select.1.3.2 = add nuw nsw i32 %inc79.2241, %inc79.1.3.2 %spec.select.2.3.2 = add nuw nsw i32 %spec.select.1.3.2, %inc79.2.3 %spec.select.3.3.2 = add nuw nsw i32 %spec.select.2.3.2, %inc79.3.3 %cmp78.4.3.2 = icmp eq i32 %arrayidx26.promoted131152167, %.pre197.pre %inc79.4.3.2 = zext i1 %cmp78.4.3.2 to i32 %spec.select.4.3.2 = add nuw nsw i32 %spec.select.3.3.2, %inc79.4.3.2 %spec.select.5.3.2 = add nuw nsw i32 %spec.select.4.3.2, %inc79.5.2 %cmp83.3.2 = icmp eq i32 %spec.select.5.3.2, 6 br i1 %cmp83.3.2, label %if.then84, label %for.cond50.3.2 for.cond50.3.2: ; preds = %for.cond50.2.2 %cmp78.3253 = icmp eq i32 %arrayidx18.promoted133149169, %.pre.pre %inc79.3254 = zext i1 %cmp78.3253 to i32 %spec.select.1.3255 = add nuw nsw i32 %inc79.3254, %inc79.1 %spec.select.2.3258 = add nuw nsw i32 %spec.select.1.3255, %inc79.2.3257 %spec.select.3.3261 = add nuw nsw i32 %spec.select.2.3258, %inc79.3.3260 %spec.select.4.3262 = add nuw nsw i32 %spec.select.3.3261, %inc79.4 %cmp78.5.3 = icmp eq i32 %arrayidx26.promoted131152167, %.pre198.pre %inc79.5.3 = zext i1 %cmp78.5.3 to i32 %spec.select.5.3263 = add nuw nsw i32 %spec.select.4.3262, %inc79.5.3 %cmp83.3264 = icmp eq i32 %spec.select.5.3263, 6 br i1 %cmp83.3264, label %if.then84, label %for.cond50.3265 for.cond50.3265: ; preds = %for.cond50.3.2 %spec.select.1.1.3 = add nuw nsw i32 %inc79.3254, %inc79.1.1.3 %spec.select.2.1.3 = add nuw nsw i32 %spec.select.1.1.3, %inc79.2.1 %spec.select.3.1.3 = add nuw nsw i32 %spec.select.2.1.3, %inc79.3.1 %spec.select.4.1.3 = add nuw nsw i32 %spec.select.3.1.3, %inc79.4.1.3 %spec.select.5.1.3 = add nuw nsw i32 %spec.select.4.1.3, %inc79.5.3 %cmp83.1.3 = icmp eq i32 %spec.select.5.1.3, 6 br i1 %cmp83.1.3, label %if.then84, label %for.cond50.1.3 for.cond50.1.3: ; preds = %for.cond50.3265 %spec.select.1.2.3 = add nuw nsw i32 %inc79.3254, %inc79.1.2 %spec.select.2.2.3 = add nuw nsw i32 %spec.select.1.2.3, %inc79.2.2.3 %spec.select.3.2.3 = add nuw nsw i32 %spec.select.2.2.3, %inc79.3.2.3 %spec.select.4.2.3 = add nuw nsw i32 %spec.select.3.2.3, %inc79.4.2 %spec.select.5.2.3 = add nuw nsw i32 %spec.select.4.2.3, %inc79.5.3 %cmp83.2.3 = icmp eq i32 %spec.select.5.2.3, 6 br i1 %cmp83.2.3, label %if.then84, label %for.cond50.2.3 for.cond50.2.3: ; preds = %for.cond50.1.3 %spec.select.1.3.3 = add nuw nsw i32 %inc79.3254, %inc79.1.3.3 %spec.select.2.3.3 = add nuw nsw i32 %spec.select.1.3.3, %inc79.2.3 %spec.select.3.3.3 = add nuw nsw i32 %spec.select.2.3.3, %inc79.3.3 %spec.select.4.3.3 = add nuw nsw i32 %spec.select.3.3.3, %inc79.4.3.3 %spec.select.5.3.3 = add nuw nsw i32 %spec.select.4.3.3, %inc79.5.3 %cmp83.3.3 = icmp eq i32 %spec.select.5.3.3, 6 br i1 %cmp83.3.3, label %if.then84, label %for.cond50.3.3 for.cond50.3.3: ; preds = %for.cond50.2.3 store i32 %arrayidx18.promoted133149169, ptr %arrayidx7, align 8, !tbaa !5 store i32 %arrayidx26.promoted131152167, ptr %arrayidx7.5, align 4, !tbaa !5 store i32 %arrayidx37.promoted, ptr %arrayidx7.1, align 4, !tbaa !5 store i32 %arrayidx15.promoted148170, ptr %arrayidx7.3, align 4, !tbaa !5 store i32 %arrayidx45.promoted, ptr %arrayidx7.4, align 8, !tbaa !5 store i32 %arrayidx22.promoted151168, ptr %arrayidx7.2, align 16, !tbaa !5 %inc94 = add nuw nsw i32 %i.2171, 1 %exitcond193.not = icmp eq i32 %inc94, 4 br i1 %exitcond193.not, label %cleanup, label %for.body14, !llvm.loop !9 if.then84: ; preds = %for.cond50.2.3, %for.cond50.1.3, %for.cond50.3265, %for.cond50.3.2, %for.cond50.2.2, %for.cond50.1.2, %for.cond50.2252, %for.cond50.3.1, %for.cond50.2.1, %for.cond50.1.1, %for.cond50.1239, %for.cond50.3, %for.cond50.2, %for.cond50.1, %for.cond50, %for.body14 %.lcssa223 = phi i32 [ %arrayidx37.promoted, %for.cond50.2 ], [ %arrayidx37.promoted, %for.cond50.1 ], [ %arrayidx37.promoted, %for.cond50 ], [ %arrayidx37.promoted, %for.body14 ], [ %arrayidx26.promoted131152167, %for.cond50.3 ], [ %arrayidx26.promoted131152167, %for.cond50.1239 ], [ %arrayidx26.promoted131152167, %for.cond50.1.1 ], [ %arrayidx26.promoted131152167, %for.cond50.2.1 ], [ %arrayidx45.promoted, %for.cond50.3.1 ], [ %arrayidx45.promoted, %for.cond50.2252 ], [ %arrayidx45.promoted, %for.cond50.1.2 ], [ %arrayidx45.promoted, %for.cond50.2.2 ], [ %arrayidx18.promoted133149169, %for.cond50.3.2 ], [ %arrayidx18.promoted133149169, %for.cond50.3265 ], [ %arrayidx18.promoted133149169, %for.cond50.1.3 ], [ %arrayidx18.promoted133149169, %for.cond50.2.3 ] %.lcssa = phi i32 [ %arrayidx45.promoted, %for.cond50.2 ], [ %arrayidx45.promoted, %for.cond50.1 ], [ %arrayidx45.promoted, %for.cond50 ], [ %arrayidx45.promoted, %for.body14 ], [ %arrayidx18.promoted133149169, %for.cond50.3 ], [ %arrayidx18.promoted133149169, %for.cond50.1239 ], [ %arrayidx18.promoted133149169, %for.cond50.1.1 ], [ %arrayidx18.promoted133149169, %for.cond50.2.1 ], [ %arrayidx37.promoted, %for.cond50.3.1 ], [ %arrayidx37.promoted, %for.cond50.2252 ], [ %arrayidx37.promoted, %for.cond50.1.2 ], [ %arrayidx37.promoted, %for.cond50.2.2 ], [ %arrayidx26.promoted131152167, %for.cond50.3.2 ], [ %arrayidx26.promoted131152167, %for.cond50.3265 ], [ %arrayidx26.promoted131152167, %for.cond50.1.3 ], [ %arrayidx26.promoted131152167, %for.cond50.2.3 ] %0 = phi i32 [ %arrayidx22.promoted151168, %for.cond50.2 ], [ %arrayidx18.promoted133149169, %for.cond50.1 ], [ %arrayidx15.promoted148170, %for.cond50 ], [ %arrayidx26.promoted131152167, %for.body14 ], [ %arrayidx45.promoted, %for.cond50.3 ], [ %arrayidx15.promoted148170, %for.cond50.1239 ], [ %arrayidx37.promoted, %for.cond50.1.1 ], [ %arrayidx22.promoted151168, %for.cond50.2.1 ], [ %arrayidx18.promoted133149169, %for.cond50.3.1 ], [ %arrayidx15.promoted148170, %for.cond50.2252 ], [ %arrayidx26.promoted131152167, %for.cond50.1.2 ], [ %arrayidx22.promoted151168, %for.cond50.2.2 ], [ %arrayidx37.promoted, %for.cond50.3.2 ], [ %arrayidx15.promoted148170, %for.cond50.3265 ], [ %arrayidx45.promoted, %for.cond50.1.3 ], [ %arrayidx22.promoted151168, %for.cond50.2.3 ] %arrayidx22.promoted151168211 = phi i32 [ %arrayidx18.promoted133149169, %for.cond50.2 ], [ %arrayidx15.promoted148170, %for.cond50.1 ], [ %arrayidx26.promoted131152167, %for.cond50 ], [ %arrayidx22.promoted151168, %for.body14 ], [ %arrayidx22.promoted151168, %for.cond50.3 ], [ %arrayidx45.promoted, %for.cond50.1239 ], [ %arrayidx15.promoted148170, %for.cond50.1.1 ], [ %arrayidx37.promoted, %for.cond50.2.1 ], [ %arrayidx22.promoted151168, %for.cond50.3.1 ], [ %arrayidx18.promoted133149169, %for.cond50.2252 ], [ %arrayidx15.promoted148170, %for.cond50.1.2 ], [ %arrayidx26.promoted131152167, %for.cond50.2.2 ], [ %arrayidx22.promoted151168, %for.cond50.3.2 ], [ %arrayidx37.promoted, %for.cond50.3265 ], [ %arrayidx15.promoted148170, %for.cond50.1.3 ], [ %arrayidx45.promoted, %for.cond50.2.3 ] %1 = phi i32 [ %arrayidx15.promoted148170, %for.cond50.2 ], [ %arrayidx26.promoted131152167, %for.cond50.1 ], [ %arrayidx22.promoted151168, %for.cond50 ], [ %arrayidx18.promoted133149169, %for.body14 ], [ %arrayidx37.promoted, %for.cond50.3 ], [ %arrayidx22.promoted151168, %for.cond50.1239 ], [ %arrayidx45.promoted, %for.cond50.1.1 ], [ %arrayidx15.promoted148170, %for.cond50.2.1 ], [ %arrayidx26.promoted131152167, %for.cond50.3.1 ], [ %arrayidx22.promoted151168, %for.cond50.2252 ], [ %arrayidx18.promoted133149169, %for.cond50.1.2 ], [ %arrayidx15.promoted148170, %for.cond50.2.2 ], [ %arrayidx45.promoted, %for.cond50.3.2 ], [ %arrayidx22.promoted151168, %for.cond50.3265 ], [ %arrayidx37.promoted, %for.cond50.1.3 ], [ %arrayidx15.promoted148170, %for.cond50.2.3 ] %arrayidx15.promoted148170209 = phi i32 [ %arrayidx26.promoted131152167, %for.cond50.2 ], [ %arrayidx22.promoted151168, %for.cond50.1 ], [ %arrayidx18.promoted133149169, %for.cond50 ], [ %arrayidx15.promoted148170, %for.body14 ], [ %arrayidx15.promoted148170, %for.cond50.3 ], [ %arrayidx37.promoted, %for.cond50.1239 ], [ %arrayidx22.promoted151168, %for.cond50.1.1 ], [ %arrayidx45.promoted, %for.cond50.2.1 ], [ %arrayidx15.promoted148170, %for.cond50.3.1 ], [ %arrayidx26.promoted131152167, %for.cond50.2252 ], [ %arrayidx22.promoted151168, %for.cond50.1.2 ], [ %arrayidx18.promoted133149169, %for.cond50.2.2 ], [ %arrayidx15.promoted148170, %for.cond50.3.2 ], [ %arrayidx45.promoted, %for.cond50.3265 ], [ %arrayidx22.promoted151168, %for.cond50.1.3 ], [ %arrayidx37.promoted, %for.cond50.2.3 ] store i32 %.lcssa223, ptr %arrayidx7, align 8, !tbaa !5 store i32 %.lcssa, ptr %arrayidx7.5, align 4, !tbaa !5 store i32 %arrayidx15.promoted148170209, ptr %arrayidx7.1, align 4, !tbaa !5 store i32 %1, ptr %arrayidx7.3, align 4, !tbaa !5 store i32 %arrayidx22.promoted151168211, ptr %arrayidx7.4, align 8, !tbaa !5 store i32 %0, ptr %arrayidx7.2, align 16, !tbaa !5 br label %cleanup cleanup: ; preds = %for.cond50.3.3, %if.then84 %str.sink = phi ptr [ @str.3, %if.then84 ], [ @str, %for.cond50.3.3 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int l0[7], l[7], l1[7], s=1, c=0; void dice(int num){ l[0] = l[1]; l[1] = l[num]; l[num] = l[6]; l[6] = l[7-num]; l[7-num] = l[0]; } int same(void){ s = (l0[1]==l[1]&&l0[3]==l[3]&&l0[4]==l[4]&&l0[5]==l[5]&&l0[6]==l[6])?0:1; return s; } void reset(void){ for(int i=0; i<6; i++) l[i+1] = l1[i+1]; c = 0; } int main(void){ for(int i=0; i<6; i++) scanf("%d", &l0[i+1]); for(int i=0; i<6; i++) scanf("%d", &l[i+1]); for(int i=0; i<6; i++) l1[i+1] = l[i+1]; if(s){ dice(5); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 1 if(s){ reset(); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 2 if(s){ reset(); dice(3); dice(5); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 3 if(s){ reset(); dice(4); dice(5); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 4 if(s){ reset(); dice(5); dice(5); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 5 if(s){ reset(); dice(2); if(l0[2]==l[2]) while(same() && c++<4) dice(4); } // 6 if(s) printf("No\n"); else printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117118/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117118/source.c" target datalayout = "e-m:e-p270: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 @c = dso_local local_unnamed_addr global i32 0, align 4 @l = dso_local global [7 x i32] zeroinitializer, align 16 @l0 = dso_local global [7 x i32] zeroinitializer, align 16 @l1 = dso_local local_unnamed_addr global [7 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dice(i32 noundef %num) local_unnamed_addr #0 { entry: %0 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %0, ptr @l, align 16, !tbaa !5 %idxprom = sext i32 %num to i64 %arrayidx = getelementptr inbounds [7 x i32], ptr @l, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 store i32 %1, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %2 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 %sub = sub nsw i32 7, %num %idxprom3 = sext i32 %sub to i64 %arrayidx4 = getelementptr inbounds [7 x i32], ptr @l, i64 0, i64 %idxprom3 %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 store i32 %3, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %4 = load i32, ptr @l, align 16, !tbaa !5 store i32 %4, ptr %arrayidx4, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @same() local_unnamed_addr #0 { entry: %0 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %1 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %land.lhs.true, label %land.end land.lhs.true: ; preds = %entry %2 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4, !tbaa !5 %3 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, %3 br i1 %cmp1, label %land.lhs.true2, label %land.end land.lhs.true2: ; preds = %land.lhs.true %4 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16, !tbaa !5 %5 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %cmp3 = icmp eq i32 %4, %5 br i1 %cmp3, label %land.lhs.true4, label %land.end land.lhs.true4: ; preds = %land.lhs.true2 %6 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4, !tbaa !5 %7 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %cmp5 = icmp eq i32 %6, %7 br i1 %cmp5, label %land.rhs, label %land.end land.rhs: ; preds = %land.lhs.true4 %8 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8, !tbaa !5 %9 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %cmp6 = icmp ne i32 %8, %9 %10 = zext i1 %cmp6 to i32 br label %land.end land.end: ; preds = %land.rhs, %land.lhs.true4, %land.lhs.true2, %land.lhs.true, %entry %not. = phi i32 [ 1, %land.lhs.true4 ], [ 1, %land.lhs.true2 ], [ 1, %land.lhs.true ], [ 1, %entry ], [ %10, %land.rhs ] store i32 %not., ptr @s, align 4, !tbaa !5 ret i32 %not. } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @reset() local_unnamed_addr #1 { entry: tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1)) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 2)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3)) %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4)) %call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5)) %call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6)) %call9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1)) %call9.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2)) %call9.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3)) %call9.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4)) %call9.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5)) %call9.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6)) tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), i64 24, i1 false), !tbaa !5 %0 = load i32, ptr @s, align 4, !tbaa !5 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %if.end113, label %if.then if.then: ; preds = %entry %1 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %1, ptr @l, align 16, !tbaa !5 %2 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 store i32 %2, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %3 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %3, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %4 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 store i32 %4, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %1, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %5 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 2), align 8, !tbaa !5 %cmp27 = icmp eq i32 %5, %1 br i1 %cmp27, label %while.cond.preheader, label %if.then35 while.cond.preheader: ; preds = %if.then %6 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %.promoted252 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %.promoted253 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %c.promoted = load i32, ptr @c, align 4, !tbaa !5 %7 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %8 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %9 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %cmp5.i = icmp eq i32 %9, %3 %10 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %smax = tail call i32 @llvm.smax.i32(i32 %c.promoted, i32 4) br label %while.cond while.cond: ; preds = %while.cond.preheader, %while.body %inc31255 = phi i32 [ %c.promoted, %while.cond.preheader ], [ %inc31, %while.body ] %11 = phi i32 [ %4, %while.cond.preheader ], [ %13, %while.body ] %12 = phi i32 [ %.promoted253, %while.cond.preheader ], [ %11, %while.body ] %13 = phi i32 [ %.promoted252, %while.cond.preheader ], [ %14, %while.body ] %14 = phi i32 [ %2, %while.cond.preheader ], [ %12, %while.body ] %cmp.i = icmp eq i32 %6, %14 %cmp1.i = icmp eq i32 %7, %13 %or.cond286 = select i1 %cmp.i, i1 %cmp1.i, i1 false %cmp3.i = icmp eq i32 %8, %12 %15 = select i1 %or.cond286, i1 %cmp3.i, i1 false %or.cond287 = select i1 %15, i1 %cmp5.i, i1 false br i1 %or.cond287, label %same.exit, label %same.exit.thread same.exit.thread: ; preds = %while.cond store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs same.exit: ; preds = %while.cond %cmp6.i = icmp ne i32 %10, %11 %16 = zext i1 %cmp6.i to i32 store i32 %16, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i, label %land.rhs, label %if.end113 land.rhs: ; preds = %same.exit.thread, %same.exit %inc31 = add i32 %inc31255, 1 store i32 %inc31, ptr @c, align 4, !tbaa !5 %exitcond.not = icmp eq i32 %inc31255, %smax br i1 %exitcond.not, label %if.then35, label %while.body while.body: ; preds = %land.rhs store i32 %14, ptr @l, align 16, !tbaa !5 store i32 %12, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %11, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %13, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %14, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 br label %while.cond, !llvm.loop !9 if.then35: ; preds = %land.rhs, %if.then tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 %17 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %cmp36 = icmp eq i32 %5, %17 br i1 %cmp36, label %while.cond38.preheader, label %if.then50 while.cond38.preheader: ; preds = %if.then35 %18 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %.promoted256 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %.promoted257 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %.promoted258 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %.promoted259 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %19 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %20 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %21 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %22 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4 %cmp5.i129 = icmp ne i32 %21, %22 %23 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %cmp.i122 = icmp ne i32 %18, %.promoted256 %cmp1.i125 = icmp ne i32 %19, %.promoted257 %or.cond288.not = select i1 %cmp.i122, i1 true, i1 %cmp1.i125 %cmp3.i127 = icmp ne i32 %20, %.promoted258 %or.cond289 = select i1 %or.cond288.not, i1 true, i1 %cmp3.i127 %brmerge = select i1 %or.cond289, i1 true, i1 %cmp5.i129 br i1 %brmerge, label %same.exit132.thread, label %same.exit132 same.exit132.thread: ; preds = %while.cond38.preheader store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs41 same.exit132: ; preds = %while.cond38.preheader %cmp6.i131 = icmp ne i32 %23, %.promoted259 %24 = zext i1 %cmp6.i131 to i32 store i32 %24, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i131, label %land.rhs41, label %if.end113 land.rhs41: ; preds = %same.exit132.thread, %same.exit132 store i32 1, ptr @c, align 4, !tbaa !5 store i32 %.promoted256, ptr @l, align 16, !tbaa !5 store i32 %.promoted258, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted259, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted257, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted256, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i122.1 = icmp ne i32 %18, %.promoted258 %cmp1.i125.1 = icmp ne i32 %19, %.promoted256 %or.cond288.not.1 = select i1 %cmp.i122.1, i1 true, i1 %cmp1.i125.1 %cmp3.i127.1 = icmp ne i32 %20, %.promoted259 %or.cond289.1 = select i1 %or.cond288.not.1, i1 true, i1 %cmp3.i127.1 %brmerge.1 = select i1 %or.cond289.1, i1 true, i1 %cmp5.i129 br i1 %brmerge.1, label %same.exit132.thread.1, label %same.exit132.1 same.exit132.1: ; preds = %land.rhs41 %cmp6.i131.1 = icmp ne i32 %23, %.promoted257 %25 = zext i1 %cmp6.i131.1 to i32 store i32 %25, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i131.1, label %land.rhs41.1, label %if.end113 same.exit132.thread.1: ; preds = %land.rhs41 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs41.1 land.rhs41.1: ; preds = %same.exit132.thread.1, %same.exit132.1 store i32 2, ptr @c, align 4, !tbaa !5 store i32 %.promoted258, ptr @l, align 16, !tbaa !5 store i32 %.promoted259, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted257, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted256, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted258, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i122.2 = icmp ne i32 %18, %.promoted259 %cmp1.i125.2 = icmp ne i32 %19, %.promoted258 %or.cond288.not.2 = select i1 %cmp.i122.2, i1 true, i1 %cmp1.i125.2 %cmp3.i127.2 = icmp ne i32 %20, %.promoted257 %or.cond289.2 = select i1 %or.cond288.not.2, i1 true, i1 %cmp3.i127.2 %brmerge.2 = select i1 %or.cond289.2, i1 true, i1 %cmp5.i129 br i1 %brmerge.2, label %same.exit132.thread.2, label %same.exit132.2 same.exit132.2: ; preds = %land.rhs41.1 %cmp6.i131.2 = icmp ne i32 %23, %.promoted256 %26 = zext i1 %cmp6.i131.2 to i32 store i32 %26, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i131.2, label %land.rhs41.2, label %if.end113 same.exit132.thread.2: ; preds = %land.rhs41.1 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs41.2 land.rhs41.2: ; preds = %same.exit132.thread.2, %same.exit132.2 store i32 3, ptr @c, align 4, !tbaa !5 store i32 %.promoted259, ptr @l, align 16, !tbaa !5 store i32 %.promoted257, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted256, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted258, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted259, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i122.3 = icmp ne i32 %18, %.promoted257 %cmp1.i125.3 = icmp ne i32 %19, %.promoted259 %or.cond288.not.3 = select i1 %cmp.i122.3, i1 true, i1 %cmp1.i125.3 %cmp3.i127.3 = icmp ne i32 %20, %.promoted256 %or.cond289.3 = select i1 %or.cond288.not.3, i1 true, i1 %cmp3.i127.3 %brmerge.3 = select i1 %or.cond289.3, i1 true, i1 %cmp5.i129 br i1 %brmerge.3, label %same.exit132.thread.3, label %same.exit132.3 same.exit132.3: ; preds = %land.rhs41.2 %cmp6.i131.3 = icmp ne i32 %23, %.promoted258 %27 = zext i1 %cmp6.i131.3 to i32 store i32 %27, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i131.3, label %land.rhs41.3, label %if.end113 same.exit132.thread.3: ; preds = %land.rhs41.2 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs41.3 land.rhs41.3: ; preds = %same.exit132.thread.3, %same.exit132.3 store i32 4, ptr @c, align 4, !tbaa !5 store i32 %.promoted257, ptr @l, align 16, !tbaa !5 store i32 %.promoted256, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted258, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted259, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted257, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i122.4 = icmp ne i32 %18, %.promoted256 %cmp1.i125.4 = icmp ne i32 %19, %.promoted257 %or.cond288.not.4 = select i1 %cmp.i122.4, i1 true, i1 %cmp1.i125.4 %cmp3.i127.4 = icmp ne i32 %20, %.promoted258 %or.cond289.4 = select i1 %or.cond288.not.4, i1 true, i1 %cmp3.i127.4 %brmerge.4 = select i1 %or.cond289.4, i1 true, i1 %cmp5.i129 br i1 %brmerge.4, label %same.exit132.thread.4, label %same.exit132.4 same.exit132.4: ; preds = %land.rhs41.3 %cmp6.i131.4 = icmp ne i32 %23, %.promoted259 %28 = zext i1 %cmp6.i131.4 to i32 store i32 %28, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i131.4, label %land.rhs41.4, label %if.end113 same.exit132.thread.4: ; preds = %land.rhs41.3 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs41.4 land.rhs41.4: ; preds = %same.exit132.thread.4, %same.exit132.4 store i32 5, ptr @c, align 4, !tbaa !5 br label %if.then50 if.then50: ; preds = %land.rhs41.4, %if.then35 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 %29 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %30 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %31 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %31, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %32 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %29, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %30, ptr @l, align 16, !tbaa !5 %33 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 store i32 %33, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %34 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 store i32 %34, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %30, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %cmp51 = icmp eq i32 %5, %30 br i1 %cmp51, label %while.cond53.preheader, label %if.then65 while.cond53.preheader: ; preds = %if.then50 %35 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %36 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %37 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %38 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %cmp5.i140 = icmp eq i32 %38, %32 %39 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %cmp.i133 = icmp eq i32 %35, %33 %cmp1.i136 = icmp eq i32 %36, %31 %or.cond290 = select i1 %cmp.i133, i1 %cmp1.i136, i1 false %cmp3.i138 = icmp eq i32 %37, %29 %40 = select i1 %or.cond290, i1 %cmp3.i138, i1 false %or.cond291 = select i1 %40, i1 %cmp5.i140, i1 false br i1 %or.cond291, label %same.exit143, label %same.exit143.thread same.exit143.thread: ; preds = %while.cond53.preheader store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs56 same.exit143: ; preds = %while.cond53.preheader %cmp6.i142 = icmp ne i32 %39, %34 %41 = zext i1 %cmp6.i142 to i32 store i32 %41, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i142, label %land.rhs56, label %if.end113 land.rhs56: ; preds = %same.exit143.thread, %same.exit143 store i32 1, ptr @c, align 4, !tbaa !5 store i32 %33, ptr @l, align 16, !tbaa !5 store i32 %29, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %34, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %31, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %33, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i133.1 = icmp eq i32 %35, %29 %cmp1.i136.1 = icmp eq i32 %36, %33 %or.cond290.1 = select i1 %cmp.i133.1, i1 %cmp1.i136.1, i1 false %cmp3.i138.1 = icmp eq i32 %37, %34 %42 = select i1 %or.cond290.1, i1 %cmp3.i138.1, i1 false %or.cond291.1 = select i1 %42, i1 %cmp5.i140, i1 false br i1 %or.cond291.1, label %same.exit143.1, label %same.exit143.thread.1 same.exit143.thread.1: ; preds = %land.rhs56 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs56.1 same.exit143.1: ; preds = %land.rhs56 %cmp6.i142.1 = icmp ne i32 %39, %31 %43 = zext i1 %cmp6.i142.1 to i32 store i32 %43, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i142.1, label %land.rhs56.1, label %if.end113 land.rhs56.1: ; preds = %same.exit143.1, %same.exit143.thread.1 store i32 2, ptr @c, align 4, !tbaa !5 store i32 %29, ptr @l, align 16, !tbaa !5 store i32 %34, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %31, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %33, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %29, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i133.2 = icmp eq i32 %35, %34 %cmp1.i136.2 = icmp eq i32 %36, %29 %or.cond290.2 = select i1 %cmp.i133.2, i1 %cmp1.i136.2, i1 false %cmp3.i138.2 = icmp eq i32 %37, %31 %44 = select i1 %or.cond290.2, i1 %cmp3.i138.2, i1 false %or.cond291.2 = select i1 %44, i1 %cmp5.i140, i1 false br i1 %or.cond291.2, label %same.exit143.2, label %same.exit143.thread.2 same.exit143.thread.2: ; preds = %land.rhs56.1 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs56.2 same.exit143.2: ; preds = %land.rhs56.1 %cmp6.i142.2 = icmp ne i32 %39, %33 %45 = zext i1 %cmp6.i142.2 to i32 store i32 %45, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i142.2, label %land.rhs56.2, label %if.end113 land.rhs56.2: ; preds = %same.exit143.2, %same.exit143.thread.2 store i32 3, ptr @c, align 4, !tbaa !5 store i32 %34, ptr @l, align 16, !tbaa !5 store i32 %31, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %33, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %29, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %34, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i133.3 = icmp eq i32 %35, %31 %cmp1.i136.3 = icmp eq i32 %36, %34 %or.cond290.3 = select i1 %cmp.i133.3, i1 %cmp1.i136.3, i1 false %cmp3.i138.3 = icmp eq i32 %37, %33 %46 = select i1 %or.cond290.3, i1 %cmp3.i138.3, i1 false %or.cond291.3 = select i1 %46, i1 %cmp5.i140, i1 false br i1 %or.cond291.3, label %same.exit143.3, label %same.exit143.thread.3 same.exit143.thread.3: ; preds = %land.rhs56.2 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs56.3 same.exit143.3: ; preds = %land.rhs56.2 %cmp6.i142.3 = icmp ne i32 %39, %29 %47 = zext i1 %cmp6.i142.3 to i32 store i32 %47, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i142.3, label %land.rhs56.3, label %if.end113 land.rhs56.3: ; preds = %same.exit143.3, %same.exit143.thread.3 store i32 4, ptr @c, align 4, !tbaa !5 store i32 %31, ptr @l, align 16, !tbaa !5 store i32 %33, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %29, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %34, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %31, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i133.4 = icmp eq i32 %35, %33 %cmp1.i136.4 = icmp eq i32 %36, %31 %or.cond290.4 = select i1 %cmp.i133.4, i1 %cmp1.i136.4, i1 false %cmp3.i138.4 = icmp eq i32 %37, %29 %48 = select i1 %or.cond290.4, i1 %cmp3.i138.4, i1 false %or.cond291.4 = select i1 %48, i1 %cmp5.i140, i1 false br i1 %or.cond291.4, label %same.exit143.4, label %same.exit143.thread.4 same.exit143.thread.4: ; preds = %land.rhs56.3 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs56.4 same.exit143.4: ; preds = %land.rhs56.3 %cmp6.i142.4 = icmp ne i32 %39, %34 %49 = zext i1 %cmp6.i142.4 to i32 store i32 %49, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i142.4, label %land.rhs56.4, label %if.end113 land.rhs56.4: ; preds = %same.exit143.4, %same.exit143.thread.4 store i32 5, ptr @c, align 4, !tbaa !5 br label %if.then65 if.then65: ; preds = %land.rhs56.4, %if.then50 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 %50 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %51 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %52 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %53 = load <2 x i32>, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %51, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %52, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %54 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 store i32 %54, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %55 = shufflevector <2 x i32> %53, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison> %56 = insertelement <4 x i32> %55, i32 %50, i64 3 %57 = shufflevector <4 x i32> %56, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 3> store <4 x i32> %57, ptr @l, align 16, !tbaa !5 %58 = extractelement <2 x i32> %53, i64 0 %cmp66 = icmp eq i32 %5, %58 br i1 %cmp66, label %while.cond68.preheader, label %if.then80 while.cond68.preheader: ; preds = %if.then65 %59 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %60 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %61 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %62 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %cmp5.i151 = icmp eq i32 %62, %52 %63 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %64 = extractelement <2 x i32> %53, i64 1 %cmp.i144 = icmp eq i32 %59, %64 %cmp1.i147 = icmp eq i32 %60, %50 %or.cond292 = select i1 %cmp.i144, i1 %cmp1.i147, i1 false %cmp3.i149 = icmp eq i32 %61, %51 %65 = select i1 %or.cond292, i1 %cmp3.i149, i1 false %or.cond293 = select i1 %65, i1 %cmp5.i151, i1 false br i1 %or.cond293, label %same.exit154, label %same.exit154.thread same.exit154.thread: ; preds = %while.cond68.preheader store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs71 same.exit154: ; preds = %while.cond68.preheader %cmp6.i153 = icmp ne i32 %63, %54 %66 = zext i1 %cmp6.i153 to i32 store i32 %66, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i153, label %land.rhs71, label %if.end113 land.rhs71: ; preds = %same.exit154.thread, %same.exit154 store i32 1, ptr @c, align 4, !tbaa !5 store i32 %64, ptr @l, align 16, !tbaa !5 store i32 %51, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %54, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %50, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %64, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i144.1 = icmp eq i32 %59, %51 %cmp1.i147.1 = icmp eq i32 %60, %64 %or.cond292.1 = select i1 %cmp.i144.1, i1 %cmp1.i147.1, i1 false %cmp3.i149.1 = icmp eq i32 %61, %54 %67 = select i1 %or.cond292.1, i1 %cmp3.i149.1, i1 false %or.cond293.1 = select i1 %67, i1 %cmp5.i151, i1 false br i1 %or.cond293.1, label %same.exit154.1, label %same.exit154.thread.1 same.exit154.thread.1: ; preds = %land.rhs71 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs71.1 same.exit154.1: ; preds = %land.rhs71 %cmp6.i153.1 = icmp ne i32 %63, %50 %68 = zext i1 %cmp6.i153.1 to i32 store i32 %68, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i153.1, label %land.rhs71.1, label %if.end113 land.rhs71.1: ; preds = %same.exit154.1, %same.exit154.thread.1 store i32 2, ptr @c, align 4, !tbaa !5 store i32 %51, ptr @l, align 16, !tbaa !5 store i32 %54, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %50, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %64, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %51, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i144.2 = icmp eq i32 %59, %54 %cmp1.i147.2 = icmp eq i32 %60, %51 %or.cond292.2 = select i1 %cmp.i144.2, i1 %cmp1.i147.2, i1 false %cmp3.i149.2 = icmp eq i32 %61, %50 %69 = select i1 %or.cond292.2, i1 %cmp3.i149.2, i1 false %or.cond293.2 = select i1 %69, i1 %cmp5.i151, i1 false br i1 %or.cond293.2, label %same.exit154.2, label %same.exit154.thread.2 same.exit154.thread.2: ; preds = %land.rhs71.1 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs71.2 same.exit154.2: ; preds = %land.rhs71.1 %cmp6.i153.2 = icmp ne i32 %63, %64 %70 = zext i1 %cmp6.i153.2 to i32 store i32 %70, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i153.2, label %land.rhs71.2, label %if.end113 land.rhs71.2: ; preds = %same.exit154.2, %same.exit154.thread.2 store i32 3, ptr @c, align 4, !tbaa !5 store i32 %54, ptr @l, align 16, !tbaa !5 store i32 %50, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %64, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %51, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %54, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i144.3 = icmp eq i32 %59, %50 %cmp1.i147.3 = icmp eq i32 %60, %54 %or.cond292.3 = select i1 %cmp.i144.3, i1 %cmp1.i147.3, i1 false %cmp3.i149.3 = icmp eq i32 %61, %64 %71 = select i1 %or.cond292.3, i1 %cmp3.i149.3, i1 false %or.cond293.3 = select i1 %71, i1 %cmp5.i151, i1 false br i1 %or.cond293.3, label %same.exit154.3, label %same.exit154.thread.3 same.exit154.thread.3: ; preds = %land.rhs71.2 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs71.3 same.exit154.3: ; preds = %land.rhs71.2 %cmp6.i153.3 = icmp ne i32 %63, %51 %72 = zext i1 %cmp6.i153.3 to i32 store i32 %72, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i153.3, label %land.rhs71.3, label %if.end113 land.rhs71.3: ; preds = %same.exit154.3, %same.exit154.thread.3 store i32 4, ptr @c, align 4, !tbaa !5 store i32 %50, ptr @l, align 16, !tbaa !5 store i32 %64, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %51, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %54, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %50, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i144.4 = icmp eq i32 %59, %64 %cmp1.i147.4 = icmp eq i32 %60, %50 %or.cond292.4 = select i1 %cmp.i144.4, i1 %cmp1.i147.4, i1 false %cmp3.i149.4 = icmp eq i32 %61, %51 %73 = select i1 %or.cond292.4, i1 %cmp3.i149.4, i1 false %or.cond293.4 = select i1 %73, i1 %cmp5.i151, i1 false br i1 %or.cond293.4, label %same.exit154.4, label %same.exit154.thread.4 same.exit154.thread.4: ; preds = %land.rhs71.3 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs71.4 same.exit154.4: ; preds = %land.rhs71.3 %cmp6.i153.4 = icmp ne i32 %63, %54 %74 = zext i1 %cmp6.i153.4 to i32 store i32 %74, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i153.4, label %land.rhs71.4, label %if.end113 land.rhs71.4: ; preds = %same.exit154.4, %same.exit154.thread.4 store i32 5, ptr @c, align 4, !tbaa !5 br label %if.then80 if.then80: ; preds = %land.rhs71.4, %if.then65 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 %75 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %76 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %77 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %78 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 store i32 %76, ptr @l, align 16, !tbaa !5 store i32 %77, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %78, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 store i32 %75, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %76, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %cmp81 = icmp eq i32 %5, %76 br i1 %cmp81, label %while.cond83.preheader, label %if.then95 while.cond83.preheader: ; preds = %if.then80 %79 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %.promoted275 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %.promoted276 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %80 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %81 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %82 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %cmp5.i162 = icmp eq i32 %82, %78 %83 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %cmp.i155 = icmp eq i32 %79, %77 %cmp1.i158 = icmp eq i32 %80, %.promoted275 %or.cond294 = select i1 %cmp.i155, i1 %cmp1.i158, i1 false %cmp3.i160 = icmp eq i32 %81, %.promoted276 %84 = select i1 %or.cond294, i1 %cmp3.i160, i1 false %or.cond295 = select i1 %84, i1 %cmp5.i162, i1 false br i1 %or.cond295, label %same.exit165, label %same.exit165.thread same.exit165.thread: ; preds = %while.cond83.preheader store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs86 same.exit165: ; preds = %while.cond83.preheader %cmp6.i164 = icmp ne i32 %83, %75 %85 = zext i1 %cmp6.i164 to i32 store i32 %85, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i164, label %land.rhs86, label %if.end113 land.rhs86: ; preds = %same.exit165.thread, %same.exit165 store i32 1, ptr @c, align 4, !tbaa !5 store i32 %77, ptr @l, align 16, !tbaa !5 store i32 %.promoted276, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %75, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted275, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %77, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i155.1 = icmp eq i32 %79, %.promoted276 %cmp1.i158.1 = icmp eq i32 %80, %77 %or.cond294.1 = select i1 %cmp.i155.1, i1 %cmp1.i158.1, i1 false %cmp3.i160.1 = icmp eq i32 %81, %75 %86 = select i1 %or.cond294.1, i1 %cmp3.i160.1, i1 false %or.cond295.1 = select i1 %86, i1 %cmp5.i162, i1 false br i1 %or.cond295.1, label %same.exit165.1, label %same.exit165.thread.1 same.exit165.thread.1: ; preds = %land.rhs86 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs86.1 same.exit165.1: ; preds = %land.rhs86 %cmp6.i164.1 = icmp ne i32 %83, %.promoted275 %87 = zext i1 %cmp6.i164.1 to i32 store i32 %87, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i164.1, label %land.rhs86.1, label %if.end113 land.rhs86.1: ; preds = %same.exit165.1, %same.exit165.thread.1 store i32 2, ptr @c, align 4, !tbaa !5 store i32 %.promoted276, ptr @l, align 16, !tbaa !5 store i32 %75, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted275, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %77, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted276, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i155.2 = icmp eq i32 %79, %75 %cmp1.i158.2 = icmp eq i32 %80, %.promoted276 %or.cond294.2 = select i1 %cmp.i155.2, i1 %cmp1.i158.2, i1 false %cmp3.i160.2 = icmp eq i32 %81, %.promoted275 %88 = select i1 %or.cond294.2, i1 %cmp3.i160.2, i1 false %or.cond295.2 = select i1 %88, i1 %cmp5.i162, i1 false br i1 %or.cond295.2, label %same.exit165.2, label %same.exit165.thread.2 same.exit165.thread.2: ; preds = %land.rhs86.1 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs86.2 same.exit165.2: ; preds = %land.rhs86.1 %cmp6.i164.2 = icmp ne i32 %83, %77 %89 = zext i1 %cmp6.i164.2 to i32 store i32 %89, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i164.2, label %land.rhs86.2, label %if.end113 land.rhs86.2: ; preds = %same.exit165.2, %same.exit165.thread.2 store i32 3, ptr @c, align 4, !tbaa !5 store i32 %75, ptr @l, align 16, !tbaa !5 store i32 %.promoted275, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %77, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted276, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %75, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i155.3 = icmp eq i32 %79, %.promoted275 %cmp1.i158.3 = icmp eq i32 %80, %75 %or.cond294.3 = select i1 %cmp.i155.3, i1 %cmp1.i158.3, i1 false %cmp3.i160.3 = icmp eq i32 %81, %77 %90 = select i1 %or.cond294.3, i1 %cmp3.i160.3, i1 false %or.cond295.3 = select i1 %90, i1 %cmp5.i162, i1 false br i1 %or.cond295.3, label %same.exit165.3, label %same.exit165.thread.3 same.exit165.thread.3: ; preds = %land.rhs86.2 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs86.3 same.exit165.3: ; preds = %land.rhs86.2 %cmp6.i164.3 = icmp ne i32 %83, %.promoted276 %91 = zext i1 %cmp6.i164.3 to i32 store i32 %91, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i164.3, label %land.rhs86.3, label %if.end113 land.rhs86.3: ; preds = %same.exit165.3, %same.exit165.thread.3 store i32 4, ptr @c, align 4, !tbaa !5 store i32 %.promoted275, ptr @l, align 16, !tbaa !5 store i32 %77, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted276, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %75, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted275, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i155.4 = icmp eq i32 %79, %77 %cmp1.i158.4 = icmp eq i32 %80, %.promoted275 %or.cond294.4 = select i1 %cmp.i155.4, i1 %cmp1.i158.4, i1 false %cmp3.i160.4 = icmp eq i32 %81, %.promoted276 %92 = select i1 %or.cond294.4, i1 %cmp3.i160.4, i1 false %or.cond295.4 = select i1 %92, i1 %cmp5.i162, i1 false br i1 %or.cond295.4, label %same.exit165.4, label %same.exit165.thread.4 same.exit165.thread.4: ; preds = %land.rhs86.3 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs86.4 same.exit165.4: ; preds = %land.rhs86.3 %cmp6.i164.4 = icmp ne i32 %83, %75 %93 = zext i1 %cmp6.i164.4 to i32 store i32 %93, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i164.4, label %land.rhs86.4, label %if.end113 land.rhs86.4: ; preds = %same.exit165.4, %same.exit165.thread.4 store i32 5, ptr @c, align 4, !tbaa !5 br label %if.then95 if.then95: ; preds = %land.rhs86.4, %if.then80 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([7 x i32], ptr @l1, i64 0, i64 1), i64 24, i1 false), !tbaa !5 store i32 0, ptr @c, align 4, !tbaa !5 %94 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %94, ptr @l, align 16, !tbaa !5 %95 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 store i32 %95, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %96 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %96, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %97 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 store i32 %97, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %94, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %cmp96 = icmp eq i32 %5, %96 br i1 %cmp96, label %while.cond98.preheader, label %if.end113 while.cond98.preheader: ; preds = %if.then95 %98 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 1), align 4, !tbaa !5 %.promoted281 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %.promoted282 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %99 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 3), align 4 %100 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 4), align 16 %101 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 5), align 4 %cmp5.i173 = icmp eq i32 %101, %94 %102 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @l0, i64 0, i64 6), align 8 %cmp.i166 = icmp eq i32 %98, %95 %cmp1.i169 = icmp eq i32 %99, %.promoted281 %or.cond296 = select i1 %cmp.i166, i1 %cmp1.i169, i1 false %cmp3.i171 = icmp eq i32 %100, %.promoted282 %103 = select i1 %or.cond296, i1 %cmp3.i171, i1 false %or.cond297 = select i1 %103, i1 %cmp5.i173, i1 false br i1 %or.cond297, label %same.exit176, label %same.exit176.thread same.exit176.thread: ; preds = %while.cond98.preheader store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs101 same.exit176: ; preds = %while.cond98.preheader %cmp6.i175 = icmp ne i32 %102, %97 %104 = zext i1 %cmp6.i175 to i32 store i32 %104, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i175, label %land.rhs101, label %if.end113 land.rhs101: ; preds = %same.exit176.thread, %same.exit176 store i32 1, ptr @c, align 4, !tbaa !5 store i32 %95, ptr @l, align 16, !tbaa !5 store i32 %.promoted282, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %97, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted281, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %95, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i166.1 = icmp eq i32 %98, %.promoted282 %cmp1.i169.1 = icmp eq i32 %99, %95 %or.cond296.1 = select i1 %cmp.i166.1, i1 %cmp1.i169.1, i1 false %cmp3.i171.1 = icmp eq i32 %100, %97 %105 = select i1 %or.cond296.1, i1 %cmp3.i171.1, i1 false %or.cond297.1 = select i1 %105, i1 %cmp5.i173, i1 false br i1 %or.cond297.1, label %same.exit176.1, label %same.exit176.thread.1 same.exit176.thread.1: ; preds = %land.rhs101 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs101.1 same.exit176.1: ; preds = %land.rhs101 %cmp6.i175.1 = icmp ne i32 %102, %.promoted281 %106 = zext i1 %cmp6.i175.1 to i32 store i32 %106, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i175.1, label %land.rhs101.1, label %if.end113 land.rhs101.1: ; preds = %same.exit176.1, %same.exit176.thread.1 store i32 2, ptr @c, align 4, !tbaa !5 store i32 %.promoted282, ptr @l, align 16, !tbaa !5 store i32 %97, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted281, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %95, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted282, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i166.2 = icmp eq i32 %98, %97 %cmp1.i169.2 = icmp eq i32 %99, %.promoted282 %or.cond296.2 = select i1 %cmp.i166.2, i1 %cmp1.i169.2, i1 false %cmp3.i171.2 = icmp eq i32 %100, %.promoted281 %107 = select i1 %or.cond296.2, i1 %cmp3.i171.2, i1 false %or.cond297.2 = select i1 %107, i1 %cmp5.i173, i1 false br i1 %or.cond297.2, label %same.exit176.2, label %same.exit176.thread.2 same.exit176.thread.2: ; preds = %land.rhs101.1 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs101.2 same.exit176.2: ; preds = %land.rhs101.1 %cmp6.i175.2 = icmp ne i32 %102, %95 %108 = zext i1 %cmp6.i175.2 to i32 store i32 %108, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i175.2, label %land.rhs101.2, label %if.end113 land.rhs101.2: ; preds = %same.exit176.2, %same.exit176.thread.2 store i32 3, ptr @c, align 4, !tbaa !5 store i32 %97, ptr @l, align 16, !tbaa !5 store i32 %.promoted281, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %95, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %.promoted282, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %97, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i166.3 = icmp eq i32 %98, %.promoted281 %cmp1.i169.3 = icmp eq i32 %99, %97 %or.cond296.3 = select i1 %cmp.i166.3, i1 %cmp1.i169.3, i1 false %cmp3.i171.3 = icmp eq i32 %100, %95 %109 = select i1 %or.cond296.3, i1 %cmp3.i171.3, i1 false %or.cond297.3 = select i1 %109, i1 %cmp5.i173, i1 false br i1 %or.cond297.3, label %same.exit176.3, label %same.exit176.thread.3 same.exit176.thread.3: ; preds = %land.rhs101.2 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs101.3 same.exit176.3: ; preds = %land.rhs101.2 %cmp6.i175.3 = icmp ne i32 %102, %.promoted282 %110 = zext i1 %cmp6.i175.3 to i32 store i32 %110, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i175.3, label %land.rhs101.3, label %if.end113 land.rhs101.3: ; preds = %same.exit176.3, %same.exit176.thread.3 store i32 4, ptr @c, align 4, !tbaa !5 store i32 %.promoted281, ptr @l, align 16, !tbaa !5 store i32 %95, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 store i32 %.promoted282, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 store i32 %97, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 store i32 %.promoted281, ptr getelementptr inbounds ([7 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %cmp.i166.4 = icmp eq i32 %98, %95 %cmp1.i169.4 = icmp eq i32 %99, %.promoted281 %or.cond296.4 = select i1 %cmp.i166.4, i1 %cmp1.i169.4, i1 false %cmp3.i171.4 = icmp eq i32 %100, %.promoted282 %111 = select i1 %or.cond296.4, i1 %cmp3.i171.4, i1 false %or.cond297.4 = select i1 %111, i1 %cmp5.i173, i1 false br i1 %or.cond297.4, label %same.exit176.4, label %same.exit176.thread.4 same.exit176.thread.4: ; preds = %land.rhs101.3 store i32 1, ptr @s, align 4, !tbaa !5 br label %land.rhs101.4 same.exit176.4: ; preds = %land.rhs101.3 %cmp6.i175.4 = icmp ne i32 %102, %97 %112 = zext i1 %cmp6.i175.4 to i32 store i32 %112, ptr @s, align 4, !tbaa !5 br i1 %cmp6.i175.4, label %land.rhs101.4, label %if.end113 land.rhs101.4: ; preds = %same.exit176.4, %same.exit176.thread.4 store i32 5, ptr @c, align 4, !tbaa !5 br label %if.end113 if.end113: ; preds = %same.exit, %same.exit132, %same.exit132.1, %same.exit132.2, %same.exit132.3, %same.exit132.4, %same.exit143, %same.exit143.1, %same.exit143.2, %same.exit143.3, %same.exit143.4, %same.exit154, %same.exit154.1, %same.exit154.2, %same.exit154.3, %same.exit154.4, %same.exit165, %same.exit165.1, %same.exit165.2, %same.exit165.3, %same.exit165.4, %same.exit176, %same.exit176.1, %same.exit176.2, %same.exit176.3, %same.exit176.4, %land.rhs101.4, %entry, %if.then95 %str.sink = phi ptr [ @str.3, %if.then95 ], [ @str, %entry ], [ @str, %same.exit176 ], [ @str, %same.exit176.1 ], [ @str, %same.exit176.2 ], [ @str, %same.exit176.3 ], [ @str, %same.exit176.4 ], [ @str.3, %land.rhs101.4 ], [ @str, %same.exit165.4 ], [ @str, %same.exit165.3 ], [ @str, %same.exit165.2 ], [ @str, %same.exit165.1 ], [ @str, %same.exit165 ], [ @str, %same.exit154.4 ], [ @str, %same.exit154.3 ], [ @str, %same.exit154.2 ], [ @str, %same.exit154.1 ], [ @str, %same.exit154 ], [ @str, %same.exit143.4 ], [ @str, %same.exit143.3 ], [ @str, %same.exit143.2 ], [ @str, %same.exit143.1 ], [ @str, %same.exit143 ], [ @str, %same.exit132.4 ], [ @str, %same.exit132.3 ], [ @str, %same.exit132.2 ], [ @str, %same.exit132.1 ], [ @str, %same.exit132 ], [ @str, %same.exit ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #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: readwrite) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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> #define DICE_EYES 6 #define DICE_TOP 1 #define DICE_FRONT 2 #define DICE_RIGHT 3 #define DICE_LEFT 4 #define DICE_BUCK 5 #define DICE_UNDER 6 /* サイコロの展開図 .1 4235 .6 */ // サイコロ用の型を宣言 typedef struct { int iDiceNum[DICE_EYES + 1]; } DICE; // プロトタイプ宣言 int iMatchTop(DICE* pstDice1, DICE* pstDice2); int iMatchDice(DICE stDice1, DICE stDice2); void vdRollE(DICE* pstDice); void vdRollN(DICE* pstDice); void vdRotationL(DICE* pstDice); // 展開図から得られるサイコロシミュレーションを行う int main() { DICE stDice1; // ダイス1の整数 DICE stDice2; // ダイス2の整数 DICE stDiceTmp; // ダイスを保持 int iCount; // counter int iCount2; // counter2 // 各面が上になったときのサイコロの目 int iDicePettern[DICE_EYES][DICE_EYES + 1] = { {0, 1, 2, 3, 4, 5, 6}, {0, 2, 1, 4, 3, 6, 5}, {0, 3, 1, 2, 5, 6, 4}, {0, 4, 1, 5, 2, 6, 4}, {0, 5, 1, 3, 4, 6, 2}, {0, 6, 2, 4, 3, 5, 1} }; // In: ダイスにかかれた整数 for (iCount = 1; iCount <= DICE_EYES; iCount++) { scanf("%d", &stDice1.iDiceNum[iCount]); } for (iCount = 1; iCount <= DICE_EYES; iCount++) { scanf("%d", &stDice2.iDiceNum[iCount]); } // ダイス1の上面を1~6に変えながらダイス2を転がし、一致しているかを調べる for (iCount = 0; iCount < DICE_EYES; iCount++) { // ダイス1をiDicePettern[iCount]と一致させる stDiceTmp = stDice1; for (iCount2 = 1; iCount2 <= DICE_EYES; iCount2++) { stDice1.iDiceNum[iCount2] = stDiceTmp.iDiceNum[iDicePettern[iCount][iCount2]]; } // ダイス2を上面が一致するまで転がす // 上面が一致したらほかの面も一致しているか判定 if (iMatchTop(&stDice1, &stDice2)) { // 一致したら終了 if (iMatchDice(stDice1, stDice2)) { printf("Yes\n"); return 0; } } } // 一度も一致しなければ違うサイコロ printf("No\n"); return 0; } // ダイス2つの上面が一致するまで転がす関数 // 一致していれば1を返す int iMatchTop(DICE* pstDice1, DICE* pstDice2) { int iCount; // counter // サイコロを7回転がせばすべての面を見られる for (iCount = 0; iCount <= DICE_EYES; iCount++) { // 最初の4回は左に転がす // 次の3回は奥に転がす if (iCount < 4) { vdRollE(pstDice2); } else { vdRollN(pstDice2); } // 上面が一致したら終了 if (pstDice1->iDiceNum[DICE_TOP] == pstDice2->iDiceNum[DICE_TOP]) { return 1; } } return 0; } // ダイス2つの上面以外が一致しているかを判定する関数 // 一致していれば1を返す int iMatchDice(DICE stDice1, DICE stDice2) { int iDiceEye; // ダイスの目 int iCount; // counter // 上面が一致しているダイスに関し、横面が一致しているかを回しながら判定 for (iCount = 0; iCount < 4; iCount++) { // ダイスの目を一つずつ比較し、一つでも違えば次のループ for (iDiceEye = 2; iDiceEye <= DICE_EYES; iDiceEye++) { if (stDice1.iDiceNum[iDiceEye] != stDice2.iDiceNum[iDiceEye]) { break; } } // 6つの目が一致していたらダイス一致と判定 if (iDiceEye > DICE_EYES) { return 1; } // 横面を一つずらしてもう一度判定 vdRotationL(&stDice2); } return 0; } // 正面から見て左にダイスを転がす関数 void vdRollE(DICE* pstDice) { int iSwapTmp; // 転がした際に目を変更するためのテンポラリ iSwapTmp = pstDice->iDiceNum[DICE_TOP]; // 上面を退避 pstDice->iDiceNum[DICE_TOP] = pstDice->iDiceNum[DICE_LEFT]; // 左面->上面 pstDice->iDiceNum[DICE_LEFT] = pstDice->iDiceNum[DICE_UNDER]; // 下面->左面 pstDice->iDiceNum[DICE_UNDER] = pstDice->iDiceNum[DICE_RIGHT]; // 右面->下面 pstDice->iDiceNum[DICE_RIGHT] = iSwapTmp; // 上面->右面 return; } // 正面から見て奥にダイスを転がす関数 void vdRollN(DICE *pstDice) { int iSwapTmp; // 転がした際に目を変更するためのテンポラリ iSwapTmp = pstDice->iDiceNum[DICE_TOP]; // 上面を退避 pstDice->iDiceNum[DICE_TOP] = pstDice->iDiceNum[DICE_FRONT]; // 手前->上 pstDice->iDiceNum[DICE_FRONT] = pstDice->iDiceNum[DICE_UNDER]; // 下->手前 pstDice->iDiceNum[DICE_UNDER] = pstDice->iDiceNum[DICE_BUCK]; // 奥->下 pstDice->iDiceNum[DICE_BUCK] = iSwapTmp; // 上->奥 return; } // 正面から見て左にダイスを回転させる関数 void vdRotationL(DICE *pstDice) { int iSwapTmp; // 転がした際に目を変更するためのテンポラリ iSwapTmp = pstDice->iDiceNum[DICE_FRONT]; // 前を退避 pstDice->iDiceNum[DICE_FRONT] = pstDice->iDiceNum[DICE_RIGHT]; // 右->前 pstDice->iDiceNum[DICE_RIGHT] = pstDice->iDiceNum[DICE_BUCK]; // 奥->右 pstDice->iDiceNum[DICE_BUCK] = pstDice->iDiceNum[DICE_LEFT]; // 左->奥 pstDice->iDiceNum[DICE_LEFT] = iSwapTmp; // 前->左 return; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117161/source.c" target datalayout = "e-m:e-p270: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.DICE = type { [7 x i32] } @__const.main.iDicePettern = private unnamed_addr constant [6 x [7 x i32]] [[7 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6], [7 x i32] [i32 0, i32 2, i32 1, i32 4, i32 3, i32 6, i32 5], [7 x i32] [i32 0, i32 3, i32 1, i32 2, i32 5, i32 6, i32 4], [7 x i32] [i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 4], [7 x i32] [i32 0, i32 5, i32 1, i32 3, i32 4, i32 6, i32 2], [7 x i32] [i32 0, i32 6, i32 2, i32 4, i32 3, i32 5, i32 1]], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %stDice1 = alloca %struct.DICE, align 8 %stDice2 = alloca %struct.DICE, align 8 %stDiceTmp = alloca %struct.DICE, align 4 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %stDice1) #7 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %stDice2) #7 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %stDiceTmp) #7 %arrayidx = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx.1 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 2 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 3 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 4 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 5 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 6 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %arrayidx6 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 1 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %arrayidx6.1 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 2 %call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1) %arrayidx6.2 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 3 %call7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2) %arrayidx6.3 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 4 %call7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.3) %arrayidx6.4 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 5 %call7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.4) %arrayidx6.5 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 6 %call7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.5) %arrayidx.i11.i.promoted = load i32, ptr %arrayidx6, align 4, !tbaa !5 %arrayidx2.i.i.promoted = load i32, ptr %arrayidx6.3, align 8, !tbaa !5 %arrayidx6.i13.i.promoted = load i32, ptr %arrayidx6.5, align 8, !tbaa !5 %arrayidx10.i.i.promoted = load i32, ptr %arrayidx6.2, align 4, !tbaa !5 %arrayidx2.i12.i.promoted = load i32, ptr %arrayidx6.1, align 8, !tbaa !5 %arrayidx10.i14.i.promoted = load i32, ptr %arrayidx6.4, align 4, !tbaa !5 br label %for.body13 for.body13: ; preds = %entry, %for.inc36 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc36 ] %0 = phi i32 [ %arrayidx.i11.i.promoted, %entry ], [ %17, %for.inc36 ] %arrayidx10.i.promoted.i7086 = phi i32 [ %arrayidx2.i.i.promoted, %entry ], [ %arrayidx10.i.promoted.i71, %for.inc36 ] %1 = phi i32 [ %arrayidx6.i13.i.promoted, %entry ], [ %16, %for.inc36 ] %arrayidx2.i.promoted.i7585 = phi i32 [ %arrayidx10.i.i.promoted, %entry ], [ %arrayidx2.i.promoted.i76, %for.inc36 ] %arrayidx.i.promoted.i7784 = phi i32 [ %arrayidx2.i12.i.promoted, %entry ], [ %arrayidx.i.promoted.i78, %for.inc36 ] %arrayidx6.i.promoted.i8083 = phi i32 [ %arrayidx10.i14.i.promoted, %entry ], [ %arrayidx6.i.promoted.i81, %for.inc36 ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %stDiceTmp, ptr noundef nonnull align 8 dereferenceable(28) %stDice1, i64 28, i1 false), !tbaa.struct !9 %arrayidx21 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %idxprom22 = sext i32 %2 to i64 %arrayidx23 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22 %3 = load i32, ptr %arrayidx23, align 4, !tbaa !5 store i32 %3, ptr %arrayidx, align 4, !tbaa !5 %arrayidx21.1 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 2 %4 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5 %idxprom22.1 = sext i32 %4 to i64 %arrayidx23.1 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22.1 %5 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.1, align 8, !tbaa !5 %arrayidx21.2 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 3 %6 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5 %idxprom22.2 = sext i32 %6 to i64 %arrayidx23.2 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22.2 %7 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5 store i32 %7, ptr %arrayidx.2, align 4, !tbaa !5 %arrayidx21.3 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5 %idxprom22.3 = sext i32 %8 to i64 %arrayidx23.3 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22.3 %9 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 store i32 %9, ptr %arrayidx.3, align 8, !tbaa !5 %arrayidx21.4 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 5 %10 = load i32, ptr %arrayidx21.4, align 4, !tbaa !5 %idxprom22.4 = sext i32 %10 to i64 %arrayidx23.4 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22.4 %11 = load i32, ptr %arrayidx23.4, align 4, !tbaa !5 store i32 %11, ptr %arrayidx.4, align 4, !tbaa !5 %arrayidx21.5 = getelementptr inbounds [6 x [7 x i32]], ptr @__const.main.iDicePettern, i64 0, i64 %indvars.iv, i64 6 %12 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5 %idxprom22.5 = sext i32 %12 to i64 %arrayidx23.5 = getelementptr inbounds [7 x i32], ptr %stDiceTmp, i64 0, i64 %idxprom22.5 %13 = load i32, ptr %arrayidx23.5, align 4, !tbaa !5 store i32 %13, ptr %arrayidx.5, align 8, !tbaa !5 %cmp4.i = icmp eq i32 %3, %arrayidx10.i.promoted.i7086 br i1 %cmp4.i, label %if.then, label %if.end.1.i if.end.1.i: ; preds = %for.body13 %cmp4.1.i = icmp eq i32 %3, %1 br i1 %cmp4.1.i, label %if.then, label %if.end.2.i if.end.2.i: ; preds = %if.end.1.i %cmp4.2.i = icmp eq i32 %3, %arrayidx2.i.promoted.i7585 br i1 %cmp4.2.i, label %if.then, label %if.end.3.i if.end.3.i: ; preds = %if.end.2.i %cmp4.3.i = icmp eq i32 %3, %0 br i1 %cmp4.3.i, label %if.then, label %if.end.4.i if.end.4.i: ; preds = %if.end.3.i store i32 %1, ptr %arrayidx6.1, align 8, !tbaa !5 store i32 %0, ptr %arrayidx6.4, align 4, !tbaa !5 %cmp4.4.i = icmp eq i32 %3, %arrayidx.i.promoted.i7784 br i1 %cmp4.4.i, label %if.then, label %iMatchTop.exit iMatchTop.exit: ; preds = %if.end.4.i store i32 %0, ptr %arrayidx6.1, align 8, !tbaa !5 store i32 %1, ptr %arrayidx6.4, align 4, !tbaa !5 %cmp4.6.i.not = icmp eq i32 %3, %arrayidx6.i.promoted.i8083 br i1 %cmp4.6.i.not, label %if.then, label %for.inc36 if.then: ; preds = %if.end.4.i, %if.end.3.i, %if.end.2.i, %if.end.1.i, %for.body13, %iMatchTop.exit %arrayidx6.i.promoted.i82 = phi i32 [ %0, %if.end.4.i ], [ %arrayidx6.i.promoted.i8083, %if.end.3.i ], [ %arrayidx6.i.promoted.i8083, %if.end.2.i ], [ %arrayidx6.i.promoted.i8083, %if.end.1.i ], [ %arrayidx6.i.promoted.i8083, %for.body13 ], [ %1, %iMatchTop.exit ] %arrayidx.i.promoted.i79 = phi i32 [ %1, %if.end.4.i ], [ %arrayidx.i.promoted.i7784, %if.end.3.i ], [ %arrayidx.i.promoted.i7784, %if.end.2.i ], [ %arrayidx.i.promoted.i7784, %if.end.1.i ], [ %arrayidx.i.promoted.i7784, %for.body13 ], [ %0, %iMatchTop.exit ] %arrayidx2.i.promoted.i74 = phi i32 [ %arrayidx2.i.promoted.i7585, %if.end.4.i ], [ %arrayidx2.i.promoted.i7585, %if.end.3.i ], [ %1, %if.end.2.i ], [ %arrayidx10.i.promoted.i7086, %if.end.1.i ], [ %0, %for.body13 ], [ %arrayidx2.i.promoted.i7585, %iMatchTop.exit ] %14 = phi i32 [ %arrayidx6.i.promoted.i8083, %if.end.4.i ], [ %1, %if.end.3.i ], [ %arrayidx10.i.promoted.i7086, %if.end.2.i ], [ %0, %if.end.1.i ], [ %arrayidx2.i.promoted.i7585, %for.body13 ], [ %arrayidx.i.promoted.i7784, %iMatchTop.exit ] %arrayidx10.i.promoted.i69 = phi i32 [ %arrayidx10.i.promoted.i7086, %if.end.4.i ], [ %arrayidx10.i.promoted.i7086, %if.end.3.i ], [ %0, %if.end.2.i ], [ %arrayidx2.i.promoted.i7585, %if.end.1.i ], [ %1, %for.body13 ], [ %arrayidx10.i.promoted.i7086, %iMatchTop.exit ] %15 = phi i32 [ %arrayidx.i.promoted.i7784, %if.end.4.i ], [ %0, %if.end.3.i ], [ %arrayidx2.i.promoted.i7585, %if.end.2.i ], [ %1, %if.end.1.i ], [ %arrayidx10.i.promoted.i7086, %for.body13 ], [ %arrayidx6.i.promoted.i8083, %iMatchTop.exit ] %cmp7.not.i = icmp eq i32 %5, %arrayidx.i.promoted.i79 %cmp7.not.1.i = icmp eq i32 %7, %arrayidx2.i.promoted.i74 %or.cond.i = select i1 %cmp7.not.i, i1 %cmp7.not.1.i, i1 false %cmp7.not.2.i = icmp eq i32 %9, %arrayidx10.i.promoted.i69 %or.cond38.i = select i1 %or.cond.i, i1 %cmp7.not.2.i, i1 false %cmp7.not.3.i = icmp eq i32 %11, %arrayidx6.i.promoted.i82 %or.cond39.i = select i1 %or.cond38.i, i1 %cmp7.not.3.i, i1 false %cmp7.not.4.i = icmp eq i32 %13, %14 %or.cond = select i1 %or.cond39.i, i1 %cmp7.not.4.i, i1 false br i1 %or.cond, label %cleanup, label %if.end10.i if.end10.i: ; preds = %if.then %cmp7.not.128.i = icmp eq i32 %5, %arrayidx2.i.promoted.i74 %cmp7.not.1.1.i = icmp eq i32 %7, %arrayidx6.i.promoted.i82 %or.cond40.i = select i1 %cmp7.not.128.i, i1 %cmp7.not.1.1.i, i1 false %cmp7.not.2.1.i = icmp eq i32 %9, %arrayidx.i.promoted.i79 %or.cond41.i = select i1 %or.cond40.i, i1 %cmp7.not.2.1.i, i1 false %cmp7.not.3.1.i = icmp eq i32 %11, %arrayidx10.i.promoted.i69 %or.cond42.i = select i1 %or.cond41.i, i1 %cmp7.not.3.1.i, i1 false %or.cond88 = select i1 %or.cond42.i, i1 %cmp7.not.4.i, i1 false br i1 %or.cond88, label %cleanup, label %if.end10.1.i if.end10.1.i: ; preds = %if.end10.i %cmp7.not.232.i = icmp eq i32 %5, %arrayidx6.i.promoted.i82 %cmp7.not.1.2.i = icmp eq i32 %7, %arrayidx10.i.promoted.i69 %or.cond43.i = select i1 %cmp7.not.232.i, i1 %cmp7.not.1.2.i, i1 false %cmp7.not.2.2.i = icmp eq i32 %9, %arrayidx2.i.promoted.i74 %or.cond44.i = select i1 %or.cond43.i, i1 %cmp7.not.2.2.i, i1 false %cmp7.not.3.2.i = icmp eq i32 %11, %arrayidx.i.promoted.i79 %or.cond45.i = select i1 %or.cond44.i, i1 %cmp7.not.3.2.i, i1 false %or.cond89 = select i1 %or.cond45.i, i1 %cmp7.not.4.i, i1 false br i1 %or.cond89, label %cleanup, label %if.end10.2.i if.end10.2.i: ; preds = %if.end10.1.i %cmp7.not.336.i = icmp eq i32 %5, %arrayidx10.i.promoted.i69 %cmp7.not.1.3.i = icmp eq i32 %7, %arrayidx.i.promoted.i79 %or.cond46.i = select i1 %cmp7.not.336.i, i1 %cmp7.not.1.3.i, i1 false %cmp7.not.2.3.i = icmp eq i32 %9, %arrayidx6.i.promoted.i82 %or.cond47.i = select i1 %or.cond46.i, i1 %cmp7.not.2.3.i, i1 false %cmp7.not.3.3.i = icmp eq i32 %11, %arrayidx2.i.promoted.i74 %or.cond48.i = select i1 %or.cond47.i, i1 %cmp7.not.3.3.i, i1 false %or.cond90 = select i1 %or.cond48.i, i1 %cmp7.not.4.i, i1 false br i1 %or.cond90, label %cleanup, label %for.inc36 for.inc36: ; preds = %if.end10.2.i, %iMatchTop.exit %arrayidx6.i.promoted.i81 = phi i32 [ %arrayidx6.i.promoted.i82, %if.end10.2.i ], [ %1, %iMatchTop.exit ] %arrayidx.i.promoted.i78 = phi i32 [ %arrayidx.i.promoted.i79, %if.end10.2.i ], [ %0, %iMatchTop.exit ] %arrayidx2.i.promoted.i76 = phi i32 [ %arrayidx2.i.promoted.i74, %if.end10.2.i ], [ %arrayidx2.i.promoted.i7585, %iMatchTop.exit ] %16 = phi i32 [ %14, %if.end10.2.i ], [ %arrayidx.i.promoted.i7784, %iMatchTop.exit ] %arrayidx10.i.promoted.i71 = phi i32 [ %arrayidx10.i.promoted.i69, %if.end10.2.i ], [ %arrayidx10.i.promoted.i7086, %iMatchTop.exit ] %17 = phi i32 [ %15, %if.end10.2.i ], [ %arrayidx6.i.promoted.i8083, %iMatchTop.exit ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 6 br i1 %exitcond.not, label %cleanup, label %for.body13, !llvm.loop !11 cleanup: ; preds = %for.inc36, %if.then, %if.end10.i, %if.end10.1.i, %if.end10.2.i %.lcssa100.sink = phi i32 [ %15, %if.end10.2.i ], [ %15, %if.end10.1.i ], [ %15, %if.end10.i ], [ %15, %if.then ], [ %17, %for.inc36 ] %arrayidx10.i.promoted.i71.lcssa.sink = phi i32 [ %5, %if.end10.2.i ], [ %7, %if.end10.1.i ], [ %11, %if.end10.i ], [ %9, %if.then ], [ %arrayidx10.i.promoted.i71, %for.inc36 ] %.lcssa101.sink = phi i32 [ %13, %if.end10.2.i ], [ %13, %if.end10.1.i ], [ %13, %if.end10.i ], [ %13, %if.then ], [ %16, %for.inc36 ] %arrayidx2.i.promoted.i76.lcssa.sink = phi i32 [ %11, %if.end10.2.i ], [ %9, %if.end10.1.i ], [ %5, %if.end10.i ], [ %7, %if.then ], [ %arrayidx2.i.promoted.i76, %for.inc36 ] %str.sink = phi ptr [ @str.3, %if.end10.2.i ], [ @str.3, %if.end10.1.i ], [ @str.3, %if.end10.i ], [ @str.3, %if.then ], [ @str, %for.inc36 ] store i32 %.lcssa100.sink, ptr %arrayidx6, align 4, !tbaa !5 store i32 %arrayidx10.i.promoted.i71.lcssa.sink, ptr %arrayidx6.3, align 8, !tbaa !5 store i32 %.lcssa101.sink, ptr %arrayidx6.5, align 8, !tbaa !5 store i32 %arrayidx2.i.promoted.i76.lcssa.sink, ptr %arrayidx6.2, align 4, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %stDiceTmp) #7 call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %stDice2) #7 call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %stDice1) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @iMatchTop(ptr nocapture noundef readonly %pstDice1, ptr nocapture noundef %pstDice2) local_unnamed_addr #4 { if.end: %arrayidx.i11 = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 1 %arrayidx2.i12 = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 2 %arrayidx6.i13 = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 6 %arrayidx10.i14 = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 5 %arrayidx2.i = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 4 %arrayidx10.i = getelementptr inbounds [7 x i32], ptr %pstDice2, i64 0, i64 3 %arrayidx = getelementptr inbounds [7 x i32], ptr %pstDice1, i64 0, i64 1 %0 = load i32, ptr %arrayidx.i11, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %1, ptr %arrayidx.i11, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %2, ptr %arrayidx2.i, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 store i32 %3, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %0, ptr %arrayidx10.i, align 4, !tbaa !5 %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp eq i32 %.pre, %1 br i1 %cmp4, label %cleanup, label %if.end.1 if.end.1: ; preds = %if.end %4 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %4, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %3, ptr %arrayidx2.i, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 store i32 %5, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %1, ptr %arrayidx10.i, align 4, !tbaa !5 %.pre16 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.1 = icmp eq i32 %.pre16, %4 br i1 %cmp4.1, label %cleanup, label %if.end.2 if.end.2: ; preds = %if.end.1 %6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %6, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %5, ptr %arrayidx2.i, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 store i32 %7, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %4, ptr %arrayidx10.i, align 4, !tbaa !5 %.pre17 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.2 = icmp eq i32 %.pre17, %6 br i1 %cmp4.2, label %cleanup, label %if.end.3 if.end.3: ; preds = %if.end.2 %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 store i32 %9, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %6, ptr %arrayidx10.i, align 4, !tbaa !5 %.pre18 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.3 = icmp eq i32 %.pre18, %8 br i1 %cmp4.3, label %cleanup, label %if.end.4 if.end.4: ; preds = %if.end.3 %10 = load i32, ptr %arrayidx2.i12, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %9, ptr %arrayidx2.i12, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx10.i14, align 4, !tbaa !5 store i32 %11, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %8, ptr %arrayidx10.i14, align 4, !tbaa !5 %.pre19 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.4 = icmp eq i32 %.pre19, %10 br i1 %cmp4.4, label %cleanup, label %if.end.5 if.end.5: ; preds = %if.end.4 %12 = load i32, ptr %arrayidx2.i12, align 4, !tbaa !5 store i32 %12, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %11, ptr %arrayidx2.i12, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx10.i14, align 4, !tbaa !5 store i32 %13, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %10, ptr %arrayidx10.i14, align 4, !tbaa !5 %.pre20 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.5 = icmp eq i32 %.pre20, %12 br i1 %cmp4.5, label %cleanup, label %if.end.6 if.end.6: ; preds = %if.end.5 %14 = load i32, ptr %arrayidx2.i12, align 4, !tbaa !5 store i32 %14, ptr %arrayidx.i11, align 4, !tbaa !5 store i32 %13, ptr %arrayidx2.i12, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx10.i14, align 4, !tbaa !5 store i32 %15, ptr %arrayidx6.i13, align 4, !tbaa !5 store i32 %12, ptr %arrayidx10.i14, align 4, !tbaa !5 %.pre21 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.6 = icmp eq i32 %.pre21, %14 %spec.select = zext i1 %cmp4.6 to i32 br label %cleanup cleanup: ; preds = %if.end.6, %if.end.5, %if.end.4, %if.end.3, %if.end.2, %if.end.1, %if.end %retval.0 = phi i32 [ 1, %if.end ], [ 1, %if.end.1 ], [ 1, %if.end.2 ], [ 1, %if.end.3 ], [ 1, %if.end.4 ], [ 1, %if.end.5 ], [ %spec.select, %if.end.6 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @iMatchDice(ptr nocapture noundef readonly byval(%struct.DICE) align 8 %stDice1, ptr nocapture noundef readonly byval(%struct.DICE) align 8 %stDice2) local_unnamed_addr #5 { entry: %arrayidx.i = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 2 %arrayidx = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 2 %0 = load <4 x i32>, ptr %arrayidx.i, align 8, !tbaa !5 %1 = load <4 x i32>, ptr %arrayidx, align 8 %2 = icmp eq <4 x i32> %1, %0 %3 = freeze <4 x i1> %2 %4 = bitcast <4 x i1> %3 to i4 %5 = icmp eq i4 %4, -1 br i1 %5, label %for.cond1.3, label %if.end10 for.cond1.3: ; preds = %entry %arrayidx.4 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 6 %6 = load i32, ptr %arrayidx.4, align 8, !tbaa !5 %arrayidx6.4 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 6 %7 = load i32, ptr %arrayidx6.4, align 8, !tbaa !5 %cmp7.not.4 = icmp eq i32 %6, %7 br i1 %cmp7.not.4, label %cleanup, label %if.end10 if.end10: ; preds = %for.cond1.3, %entry %8 = extractelement <4 x i32> %1, i64 0 %9 = extractelement <4 x i32> %0, i64 1 %cmp7.not.128 = icmp eq i32 %8, %9 %arrayidx.1.1 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 3 %10 = load i32, ptr %arrayidx.1.1, align 4 %11 = extractelement <4 x i32> %0, i64 3 %cmp7.not.1.1 = icmp eq i32 %10, %11 %or.cond40 = select i1 %cmp7.not.128, i1 %cmp7.not.1.1, i1 false %arrayidx.2.1 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 4 %12 = load i32, ptr %arrayidx.2.1, align 8 %13 = extractelement <4 x i32> %0, i64 0 %cmp7.not.2.1 = icmp eq i32 %12, %13 %or.cond41 = select i1 %or.cond40, i1 %cmp7.not.2.1, i1 false %arrayidx.3.1 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 5 %14 = load i32, ptr %arrayidx.3.1, align 4 %15 = extractelement <4 x i32> %0, i64 2 %cmp7.not.3.1 = icmp eq i32 %14, %15 %or.cond42 = select i1 %or.cond41, i1 %cmp7.not.3.1, i1 false br i1 %or.cond42, label %for.cond1.3.1, label %if.end10.1 for.cond1.3.1: ; preds = %if.end10 %arrayidx.4.1 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 6 %16 = load i32, ptr %arrayidx.4.1, align 8, !tbaa !5 %arrayidx6.4.1 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 6 %17 = load i32, ptr %arrayidx6.4.1, align 8, !tbaa !5 %cmp7.not.4.1 = icmp eq i32 %16, %17 br i1 %cmp7.not.4.1, label %cleanup, label %if.end10.1 if.end10.1: ; preds = %for.cond1.3.1, %if.end10 %cmp7.not.232 = icmp eq i32 %8, %11 %arrayidx.1.2 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 3 %18 = load i32, ptr %arrayidx.1.2, align 4 %cmp7.not.1.2 = icmp eq i32 %18, %15 %or.cond43 = select i1 %cmp7.not.232, i1 %cmp7.not.1.2, i1 false %arrayidx.2.2 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 4 %19 = load i32, ptr %arrayidx.2.2, align 8 %cmp7.not.2.2 = icmp eq i32 %19, %9 %or.cond44 = select i1 %or.cond43, i1 %cmp7.not.2.2, i1 false %arrayidx.3.2 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 5 %20 = load i32, ptr %arrayidx.3.2, align 4 %cmp7.not.3.2 = icmp eq i32 %20, %13 %or.cond45 = select i1 %or.cond44, i1 %cmp7.not.3.2, i1 false br i1 %or.cond45, label %for.cond1.3.2, label %if.end10.2 for.cond1.3.2: ; preds = %if.end10.1 %arrayidx.4.2 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 6 %21 = load i32, ptr %arrayidx.4.2, align 8, !tbaa !5 %arrayidx6.4.2 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 6 %22 = load i32, ptr %arrayidx6.4.2, align 8, !tbaa !5 %cmp7.not.4.2 = icmp eq i32 %21, %22 br i1 %cmp7.not.4.2, label %cleanup, label %if.end10.2 if.end10.2: ; preds = %for.cond1.3.2, %if.end10.1 %cmp7.not.336 = icmp eq i32 %8, %15 %arrayidx.1.3 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 3 %23 = load i32, ptr %arrayidx.1.3, align 4 %cmp7.not.1.3 = icmp eq i32 %23, %13 %or.cond46 = select i1 %cmp7.not.336, i1 %cmp7.not.1.3, i1 false %arrayidx.2.3 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 4 %24 = load i32, ptr %arrayidx.2.3, align 8 %cmp7.not.2.3 = icmp eq i32 %24, %11 %or.cond47 = select i1 %or.cond46, i1 %cmp7.not.2.3, i1 false %arrayidx.3.3 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 5 %25 = load i32, ptr %arrayidx.3.3, align 4 %cmp7.not.3.3 = icmp eq i32 %25, %9 %or.cond48 = select i1 %or.cond47, i1 %cmp7.not.3.3, i1 false br i1 %or.cond48, label %for.cond1.3.3, label %if.end10.3 for.cond1.3.3: ; preds = %if.end10.2 %arrayidx.4.3 = getelementptr inbounds [7 x i32], ptr %stDice1, i64 0, i64 6 %26 = load i32, ptr %arrayidx.4.3, align 8, !tbaa !5 %arrayidx6.4.3 = getelementptr inbounds [7 x i32], ptr %stDice2, i64 0, i64 6 %27 = load i32, ptr %arrayidx6.4.3, align 8, !tbaa !5 %cmp7.not.4.3 = icmp eq i32 %26, %27 br i1 %cmp7.not.4.3, label %cleanup, label %if.end10.3 if.end10.3: ; preds = %for.cond1.3.3, %if.end10.2 br label %cleanup cleanup: ; preds = %for.cond1.3, %for.cond1.3.1, %for.cond1.3.2, %for.cond1.3.3, %if.end10.3 %retval.0 = phi i32 [ 0, %if.end10.3 ], [ 1, %for.cond1.3.3 ], [ 1, %for.cond1.3.2 ], [ 1, %for.cond1.3.1 ], [ 1, %for.cond1.3 ] 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) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @vdRollE(ptr nocapture noundef %pstDice) local_unnamed_addr #4 { entry: %arrayidx = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 1 %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 4 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %1, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 6 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 store i32 %2, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 3 %3 = load i32, ptr %arrayidx10, align 4, !tbaa !5 store i32 %3, ptr %arrayidx6, align 4, !tbaa !5 store i32 %0, ptr %arrayidx10, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @vdRollN(ptr nocapture noundef %pstDice) local_unnamed_addr #4 { entry: %arrayidx = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 1 %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 2 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %1, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 6 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 store i32 %2, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 5 %3 = load i32, ptr %arrayidx10, align 4, !tbaa !5 store i32 %3, ptr %arrayidx6, align 4, !tbaa !5 store i32 %0, ptr %arrayidx10, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @vdRotationL(ptr nocapture noundef %pstDice) local_unnamed_addr #4 { entry: %arrayidx = getelementptr inbounds [7 x i32], ptr %pstDice, i64 0, i64 2 %0 = load <4 x i32>, ptr %arrayidx, align 4, !tbaa !5 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2> store <4 x i32> %1, ptr %arrayidx, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree 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 = { 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 #6 = { nofree nounwind } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 28, !10} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int d1[6],d2[6],i,j,blank; for(i = 0; i < 6; i++){ scanf("%d",&d1[i]); } for(i = 0; i < 6; i++){ scanf("%d",&d2[i]); } for(i = 0; d1[1] != d2[1] && i < 3; i++){ //3S blank=d2[0]; d2[0]=d2[4]; d2[4]=d2[5]; d2[5]=d2[1]; d2[1]=blank; } if(d1[1] != d2[1]){ //1E blank=d2[0]; d2[0]=d2[3]; d2[3]=d2[5]; d2[5]=d2[2]; d2[2]=blank; for(i = 0; d1[1] != d2[1] && i < 3; i++){ //3S blank=d2[0]; d2[0]=d2[4]; d2[4]=d2[5]; d2[5]=d2[1]; d2[1]=blank; } } if(d1[1] != d2[1]){ printf("No\n"); return 0; } for(i = 0; d1[0] != d2[0]; i++){ //3E blank=d2[0]; d2[0]=d2[3]; d2[3]=d2[5]; d2[5]=d2[2]; d2[2]=blank; } if(d1[0] != d2[0]){ printf("No\n"); return 0; } if(d1[2] == d2[2] && d1[3] == d2[3] && d1[4] == d2[4] && d1[5] == d2[5]){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117204/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117204/source.c" target datalayout = "e-m:e-p270: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.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d1 = alloca [6 x i32], align 16 %d2 = alloca [6 x i32], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d1) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %d1, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [6 x i32], ptr %d1, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [6 x i32], ptr %d1, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [6 x i32], ptr %d1, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [6 x i32], ptr %d1, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d2) %arrayidx5.1 = getelementptr inbounds [6 x i32], ptr %d2, i64 0, i64 1 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %arrayidx5.2 = getelementptr inbounds [6 x i32], ptr %d2, i64 0, i64 2 %call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2) %arrayidx5.3 = getelementptr inbounds [6 x i32], ptr %d2, i64 0, i64 3 %call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3) %arrayidx5.4 = getelementptr inbounds [6 x i32], ptr %d2, i64 0, i64 4 %call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4) %arrayidx5.5 = getelementptr inbounds [6 x i32], ptr %d2, i64 0, i64 5 %call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5) %0 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx12.promoted = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %cmp13124.not = icmp eq i32 %0, %arrayidx12.promoted br i1 %cmp13124.not, label %for.cond63.preheader, label %for.body15.lr.ph for.body15.lr.ph: ; preds = %entry %d2.promoted = load i32, ptr %d2, align 16, !tbaa !5 %arrayidx17.promoted = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %arrayidx19.promoted = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %cmp13 = icmp ne i32 %0, %d2.promoted br i1 %cmp13, label %for.body15.1, label %for.end26, !llvm.loop !9 for.body15.1: ; preds = %for.body15.lr.ph %cmp13.1 = icmp ne i32 %0, %arrayidx17.promoted br i1 %cmp13.1, label %for.body15.2, label %for.end26, !llvm.loop !9 for.body15.2: ; preds = %for.body15.1 %cmp13.2 = icmp ne i32 %0, %arrayidx19.promoted br label %for.end26 for.end26: ; preds = %for.body15.2, %for.body15.1, %for.body15.lr.ph %.lcssa183 = phi i32 [ %arrayidx19.promoted, %for.body15.lr.ph ], [ %arrayidx12.promoted, %for.body15.1 ], [ %d2.promoted, %for.body15.2 ] %.lcssa182 = phi i32 [ %arrayidx17.promoted, %for.body15.lr.ph ], [ %arrayidx19.promoted, %for.body15.1 ], [ %arrayidx12.promoted, %for.body15.2 ] %.lcssa181 = phi i32 [ %arrayidx12.promoted, %for.body15.lr.ph ], [ %d2.promoted, %for.body15.1 ], [ %arrayidx17.promoted, %for.body15.2 ] %.lcssa180 = phi i32 [ %d2.promoted, %for.body15.lr.ph ], [ %arrayidx17.promoted, %for.body15.1 ], [ %arrayidx19.promoted, %for.body15.2 ] %cmp13.lcssa = phi i1 [ %cmp13, %for.body15.lr.ph ], [ %cmp13.1, %for.body15.1 ], [ %cmp13.2, %for.body15.2 ] store i32 %.lcssa183, ptr %arrayidx5.4, align 16, !tbaa !5 store i32 %.lcssa182, ptr %d2, align 16, !tbaa !5 store i32 %.lcssa181, ptr %arrayidx5.5, align 4, !tbaa !5 store i32 %.lcssa180, ptr %arrayidx5.1, align 4, !tbaa !5 br i1 %cmp13.lcssa, label %for.body45.lr.ph, label %if.end for.body45.lr.ph: ; preds = %for.end26 %1 = load i32, ptr %d2, align 16, !tbaa !5 %2 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 store i32 %3, ptr %arrayidx5.3, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 store i32 %1, ptr %arrayidx5.2, align 8, !tbaa !5 %.pre = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %cmp41.not = icmp eq i32 %0, %2 br i1 %cmp41.not, label %if.end.loopexit, label %for.body45.1, !llvm.loop !11 for.body45.1: ; preds = %for.body45.lr.ph %cmp41.1.not = icmp eq i32 %0, %.pre br i1 %cmp41.1.not, label %if.end.loopexit, label %for.body45.2, !llvm.loop !11 for.body45.2: ; preds = %for.body45.1 br label %if.end.loopexit if.end.loopexit: ; preds = %for.body45.2, %for.body45.1, %for.body45.lr.ph %.lcssa179 = phi i32 [ %4, %for.body45.lr.ph ], [ %.lcssa180, %for.body45.1 ], [ %2, %for.body45.2 ] %.lcssa178 = phi i32 [ %.pre, %for.body45.lr.ph ], [ %4, %for.body45.1 ], [ %.lcssa180, %for.body45.2 ] %.lcssa177 = phi i32 [ %2, %for.body45.lr.ph ], [ %.pre, %for.body45.1 ], [ %4, %for.body45.2 ] %.lcssa176 = phi i32 [ %.lcssa180, %for.body45.lr.ph ], [ %2, %for.body45.1 ], [ %.pre, %for.body45.2 ] store i32 %.lcssa178, ptr %d2, align 16, !tbaa !5 store i32 %.lcssa179, ptr %arrayidx5.4, align 16, !tbaa !5 store i32 %.lcssa176, ptr %arrayidx5.5, align 4, !tbaa !5 store i32 %.lcssa177, ptr %arrayidx5.1, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.end.loopexit, %for.end26 %5 = phi i32 [ %.lcssa180, %for.end26 ], [ %.lcssa177, %if.end.loopexit ] %cmp59.not = icmp eq i32 %0, %5 br i1 %cmp59.not, label %for.cond63.preheader, label %cleanup for.cond63.preheader: ; preds = %entry, %if.end %6 = load i32, ptr %d1, align 16, !tbaa !5 %d2.promoted134 = load i32, ptr %d2, align 16, !tbaa !5 %cmp66.not135 = icmp eq i32 %6, %d2.promoted134 %.pre150 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 br i1 %cmp66.not135, label %if.end84, label %for.body67.lr.ph for.body67.lr.ph: ; preds = %for.cond63.preheader %arrayidx69.promoted = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %arrayidx71.promoted = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 br label %for.body67 for.body67: ; preds = %for.body67.lr.ph, %for.body67 %7 = phi i32 [ %.pre150, %for.body67.lr.ph ], [ %10, %for.body67 ] %8 = phi i32 [ %arrayidx71.promoted, %for.body67.lr.ph ], [ %7, %for.body67 ] %9 = phi i32 [ %arrayidx69.promoted, %for.body67.lr.ph ], [ %8, %for.body67 ] %10 = phi i32 [ %d2.promoted134, %for.body67.lr.ph ], [ %9, %for.body67 ] %cmp66.not = icmp eq i32 %6, %9 br i1 %cmp66.not, label %for.cond63.if.end84_crit_edge, label %for.body67, !llvm.loop !12 for.cond63.if.end84_crit_edge: ; preds = %for.body67 store i32 %8, ptr %arrayidx5.3, align 4, !tbaa !5 store i32 %6, ptr %d2, align 16, !tbaa !5 store i32 %7, ptr %arrayidx5.5, align 4, !tbaa !5 store i32 %10, ptr %arrayidx5.2, align 8, !tbaa !5 br label %if.end84 if.end84: ; preds = %for.cond63.if.end84_crit_edge, %for.cond63.preheader %11 = phi i32 [ %10, %for.cond63.if.end84_crit_edge ], [ %.pre150, %for.cond63.preheader ] %12 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %cmp87 = icmp eq i32 %12, %11 br i1 %cmp87, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %if.end84 %13 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %cmp90 = icmp eq i32 %13, %14 br i1 %cmp90, label %land.lhs.true91, label %if.else land.lhs.true91: ; preds = %land.lhs.true %15 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %16 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %cmp94 = icmp eq i32 %15, %16 br i1 %cmp94, label %land.lhs.true95, label %if.else land.lhs.true95: ; preds = %land.lhs.true91 %17 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %18 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %cmp98 = icmp eq i32 %17, %18 br i1 %cmp98, label %cleanup, label %if.else if.else: ; preds = %land.lhs.true95, %land.lhs.true91, %land.lhs.true, %if.end84 br label %cleanup cleanup: ; preds = %land.lhs.true95, %if.end, %if.else %str.3.sink = phi ptr [ @str.4, %if.else ], [ @str.4, %if.end ], [ @str.3, %land.lhs.true95 ] %puts120 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> struct dice{ int a[6]; }; struct dice dice1; struct dice dice2; void tate(){ int cmp=dice2.a[0]; dice2.a[0]=dice2.a[4]; dice2.a[4]=dice2.a[5]; dice2.a[5]=dice2.a[1]; dice2.a[1]=cmp; } void yoko(){ int cmp=dice2.a[1]; dice2.a[1]=dice2.a[2]; dice2.a[2]=dice2.a[4]; dice2.a[4]=dice2.a[3]; dice2.a[3]=cmp; } int main(){ int i,j; for(i=0;i<6;i++){ scanf("%d",&dice1.a[i]); } for(i=0;i<6;i++){ scanf("%d",&dice2.a[i]); } for(i=0;i<5;i++){ for(j=0;j<5;j++){ if(dice1.a[0]==dice2.a[0])break; tate(); } for(j=0;j<5;j++){ if(dice1.a[1]==dice2.a[1])break; yoko(); } } if(dice1.a[0]==dice2.a[0]&&dice1.a[1]==dice2.a[1]&&dice1.a[2]==dice2.a[2])printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117248/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117248/source.c" target datalayout = "e-m:e-p270: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.dice = type { [6 x i32] } @dice2 = dso_local global %struct.dice zeroinitializer, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @dice1 = dso_local global %struct.dice zeroinitializer, align 4 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @tate() local_unnamed_addr #0 { entry: %0 = load i32, ptr @dice2, align 4, !tbaa !5 %1 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %1, ptr @dice2, align 4, !tbaa !5 %2 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 %3 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %0, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @yoko() local_unnamed_addr #0 { entry: %0 = load <4 x i32>, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2> store <4 x i32> %1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @dice1) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 1)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 2)) %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 3)) %call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 4)) %call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 5)) %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @dice2) %call6.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1)) %call6.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2)) %call6.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3)) %call6.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4)) %call6.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5)) %0 = load i32, ptr @dice1, align 4, !tbaa !5 %1 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 1), align 4, !tbaa !5 %dice2.promoted61 = load i32, ptr @dice2, align 4, !tbaa !5 %.promoted65 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 %.promoted = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 %.promoted74 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %.promoted80 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 %.promoted84 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp16 = icmp eq i32 %0, %dice2.promoted61 br i1 %cmp16, label %for.end19, label %if.end if.end: ; preds = %entry store i32 %.promoted65, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.1 = icmp eq i32 %0, %.promoted65 br i1 %cmp16.1, label %for.end19, label %if.end.1 if.end.1: ; preds = %if.end store i32 %.promoted, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted65, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.2 = icmp eq i32 %0, %.promoted br i1 %cmp16.2, label %for.end19, label %if.end.2 if.end.2: ; preds = %if.end.1 store i32 %.promoted74, ptr @dice2, align 4, !tbaa !5 store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted65, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.3 = icmp eq i32 %0, %.promoted74 br i1 %cmp16.3, label %for.end19, label %if.end.4 if.end.4: ; preds = %if.end.2 store i32 %.promoted65, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 br label %for.end19 for.end19: ; preds = %if.end.4, %if.end.2, %if.end.1, %if.end, %entry %.promoted5678 = phi i32 [ %.promoted74, %entry ], [ %dice2.promoted61, %if.end ], [ %.promoted65, %if.end.1 ], [ %.promoted, %if.end.2 ], [ %dice2.promoted61, %if.end.4 ] %.promoted5371 = phi i32 [ %.promoted, %entry ], [ %.promoted74, %if.end ], [ %dice2.promoted61, %if.end.1 ], [ %.promoted65, %if.end.2 ], [ %.promoted74, %if.end.4 ] %.promoted5869 = phi i32 [ %.promoted65, %entry ], [ %.promoted, %if.end ], [ %.promoted74, %if.end.1 ], [ %dice2.promoted61, %if.end.2 ], [ %.promoted, %if.end.4 ] %dice2.promoted62 = phi i32 [ %0, %entry ], [ %0, %if.end ], [ %0, %if.end.1 ], [ %0, %if.end.2 ], [ %.promoted65, %if.end.4 ] %cmp23 = icmp eq i32 %1, %.promoted5678 br i1 %cmp23, label %for.inc29, label %if.end25 if.end25: ; preds = %for.end19 store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.1 = icmp eq i32 %1, %.promoted80 br i1 %cmp23.1, label %for.inc29, label %if.end25.1 if.end25.1: ; preds = %if.end25 store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.2 = icmp eq i32 %1, %.promoted5869 br i1 %cmp23.2, label %for.inc29, label %if.end25.2 if.end25.2: ; preds = %if.end25.1 store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.3 = icmp eq i32 %1, %.promoted84 br i1 %cmp23.3, label %for.inc29, label %if.end25.4 if.end25.4: ; preds = %if.end25.2 store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 br label %for.inc29 for.inc29: ; preds = %if.end25.4, %if.end25.2, %if.end25.1, %if.end25, %for.end19 %2 = phi i32 [ %.promoted5678, %for.end19 ], [ %1, %if.end25 ], [ %1, %if.end25.1 ], [ %1, %if.end25.2 ], [ %.promoted80, %if.end25.4 ] %.promoted5985 = phi i32 [ %.promoted84, %for.end19 ], [ %.promoted5678, %if.end25 ], [ %.promoted80, %if.end25.1 ], [ %.promoted5869, %if.end25.2 ], [ %.promoted5678, %if.end25.4 ] %.promoted5781 = phi i32 [ %.promoted80, %for.end19 ], [ %.promoted5869, %if.end25 ], [ %.promoted84, %if.end25.1 ], [ %.promoted5678, %if.end25.2 ], [ %.promoted5869, %if.end25.4 ] %.promoted5676 = phi i32 [ %1, %for.end19 ], [ %1, %if.end25 ], [ %1, %if.end25.1 ], [ %1, %if.end25.2 ], [ %.promoted80, %if.end25.4 ] %.promoted5867 = phi i32 [ %.promoted5869, %for.end19 ], [ %.promoted84, %if.end25 ], [ %.promoted5678, %if.end25.1 ], [ %.promoted80, %if.end25.2 ], [ %.promoted84, %if.end25.4 ] %cmp16.197 = icmp eq i32 %0, %dice2.promoted62 br i1 %cmp16.197, label %for.end19.1, label %if.end.198 if.end.198: ; preds = %for.inc29 store i32 %.promoted5867, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.1.1 = icmp eq i32 %0, %.promoted5867 br i1 %cmp16.1.1, label %for.end19.1, label %if.end.1.1 if.end.1.1: ; preds = %if.end.198 store i32 %.promoted5371, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5867, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.2.1 = icmp eq i32 %0, %.promoted5371 br i1 %cmp16.2.1, label %for.end19.1, label %if.end.2.1 if.end.2.1: ; preds = %if.end.1.1 store i32 %.promoted5676, ptr @dice2, align 4, !tbaa !5 store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5867, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.3.1 = icmp eq i32 %0, %.promoted5676 br i1 %cmp16.3.1, label %for.end19.1, label %if.end.4.1 if.end.4.1: ; preds = %if.end.2.1 store i32 %.promoted5867, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 br label %for.end19.1 for.end19.1: ; preds = %if.end.4.1, %if.end.2.1, %if.end.1.1, %if.end.198, %for.inc29 %3 = phi i32 [ %2, %for.inc29 ], [ %dice2.promoted62, %if.end.198 ], [ %.promoted5867, %if.end.1.1 ], [ %.promoted5371, %if.end.2.1 ], [ %dice2.promoted62, %if.end.4.1 ] %4 = phi i32 [ %dice2.promoted62, %for.inc29 ], [ %0, %if.end.198 ], [ %0, %if.end.1.1 ], [ %0, %if.end.2.1 ], [ %.promoted5867, %if.end.4.1 ] %.promoted5678.1 = phi i32 [ %.promoted5676, %for.inc29 ], [ %dice2.promoted62, %if.end.198 ], [ %.promoted5867, %if.end.1.1 ], [ %.promoted5371, %if.end.2.1 ], [ %dice2.promoted62, %if.end.4.1 ] %.promoted5371.1 = phi i32 [ %.promoted5371, %for.inc29 ], [ %.promoted5676, %if.end.198 ], [ %dice2.promoted62, %if.end.1.1 ], [ %.promoted5867, %if.end.2.1 ], [ %.promoted5676, %if.end.4.1 ] %.promoted5869.1 = phi i32 [ %.promoted5867, %for.inc29 ], [ %.promoted5371, %if.end.198 ], [ %.promoted5676, %if.end.1.1 ], [ %dice2.promoted62, %if.end.2.1 ], [ %.promoted5371, %if.end.4.1 ] %dice2.promoted62.1 = phi i32 [ %0, %for.inc29 ], [ %0, %if.end.198 ], [ %0, %if.end.1.1 ], [ %0, %if.end.2.1 ], [ %.promoted5867, %if.end.4.1 ] %cmp23.199 = icmp eq i32 %1, %.promoted5678.1 br i1 %cmp23.199, label %for.inc29.1, label %if.end25.1100 if.end25.1100: ; preds = %for.end19.1 store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.1.1 = icmp eq i32 %1, %.promoted5781 br i1 %cmp23.1.1, label %for.inc29.1, label %if.end25.1.1 if.end25.1.1: ; preds = %if.end25.1100 store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.2.1 = icmp eq i32 %1, %.promoted5869.1 br i1 %cmp23.2.1, label %for.inc29.1, label %if.end25.2.1 if.end25.2.1: ; preds = %if.end25.1.1 store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.3.1 = icmp eq i32 %1, %.promoted5985 br i1 %cmp23.3.1, label %for.inc29.1, label %if.end25.4.1 if.end25.4.1: ; preds = %if.end25.2.1 store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 br label %for.inc29.1 for.inc29.1: ; preds = %if.end25.4.1, %if.end25.2.1, %if.end25.1.1, %if.end25.1100, %for.end19.1 %5 = phi i32 [ %3, %for.end19.1 ], [ %1, %if.end25.1100 ], [ %1, %if.end25.1.1 ], [ %1, %if.end25.2.1 ], [ %.promoted5781, %if.end25.4.1 ] %.promoted5985.1 = phi i32 [ %.promoted5985, %for.end19.1 ], [ %.promoted5678.1, %if.end25.1100 ], [ %.promoted5781, %if.end25.1.1 ], [ %.promoted5869.1, %if.end25.2.1 ], [ %.promoted5678.1, %if.end25.4.1 ] %.promoted5781.1 = phi i32 [ %.promoted5781, %for.end19.1 ], [ %.promoted5869.1, %if.end25.1100 ], [ %.promoted5985, %if.end25.1.1 ], [ %.promoted5678.1, %if.end25.2.1 ], [ %.promoted5869.1, %if.end25.4.1 ] %.promoted5676.1 = phi i32 [ %1, %for.end19.1 ], [ %1, %if.end25.1100 ], [ %1, %if.end25.1.1 ], [ %1, %if.end25.2.1 ], [ %.promoted5781, %if.end25.4.1 ] %.promoted5867.1 = phi i32 [ %.promoted5869.1, %for.end19.1 ], [ %.promoted5985, %if.end25.1100 ], [ %.promoted5678.1, %if.end25.1.1 ], [ %.promoted5781, %if.end25.2.1 ], [ %.promoted5985, %if.end25.4.1 ] %cmp16.2101 = icmp eq i32 %0, %dice2.promoted62.1 br i1 %cmp16.2101, label %for.end19.2, label %if.end.2102 if.end.2102: ; preds = %for.inc29.1 store i32 %.promoted5867.1, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.1.2 = icmp eq i32 %0, %.promoted5867.1 br i1 %cmp16.1.2, label %for.end19.2, label %if.end.1.2 if.end.1.2: ; preds = %if.end.2102 store i32 %.promoted5371.1, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5867.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.2.2 = icmp eq i32 %0, %.promoted5371.1 br i1 %cmp16.2.2, label %for.end19.2, label %if.end.2.2 if.end.2.2: ; preds = %if.end.1.2 store i32 %.promoted5676.1, ptr @dice2, align 4, !tbaa !5 store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5867.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.3.2 = icmp eq i32 %0, %.promoted5676.1 br i1 %cmp16.3.2, label %for.end19.2, label %if.end.4.2 if.end.4.2: ; preds = %if.end.2.2 store i32 %.promoted5867.1, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 br label %for.end19.2 for.end19.2: ; preds = %if.end.4.2, %if.end.2.2, %if.end.1.2, %if.end.2102, %for.inc29.1 %6 = phi i32 [ %5, %for.inc29.1 ], [ %dice2.promoted62.1, %if.end.2102 ], [ %.promoted5867.1, %if.end.1.2 ], [ %.promoted5371.1, %if.end.2.2 ], [ %dice2.promoted62.1, %if.end.4.2 ] %7 = phi i32 [ %4, %for.inc29.1 ], [ %0, %if.end.2102 ], [ %0, %if.end.1.2 ], [ %0, %if.end.2.2 ], [ %.promoted5867.1, %if.end.4.2 ] %.promoted5678.2 = phi i32 [ %.promoted5676.1, %for.inc29.1 ], [ %dice2.promoted62.1, %if.end.2102 ], [ %.promoted5867.1, %if.end.1.2 ], [ %.promoted5371.1, %if.end.2.2 ], [ %dice2.promoted62.1, %if.end.4.2 ] %.promoted5371.2 = phi i32 [ %.promoted5371.1, %for.inc29.1 ], [ %.promoted5676.1, %if.end.2102 ], [ %dice2.promoted62.1, %if.end.1.2 ], [ %.promoted5867.1, %if.end.2.2 ], [ %.promoted5676.1, %if.end.4.2 ] %.promoted5869.2 = phi i32 [ %.promoted5867.1, %for.inc29.1 ], [ %.promoted5371.1, %if.end.2102 ], [ %.promoted5676.1, %if.end.1.2 ], [ %dice2.promoted62.1, %if.end.2.2 ], [ %.promoted5371.1, %if.end.4.2 ] %dice2.promoted62.2 = phi i32 [ %0, %for.inc29.1 ], [ %0, %if.end.2102 ], [ %0, %if.end.1.2 ], [ %0, %if.end.2.2 ], [ %.promoted5867.1, %if.end.4.2 ] %cmp23.2103 = icmp eq i32 %1, %.promoted5678.2 br i1 %cmp23.2103, label %for.inc29.2, label %if.end25.2104 if.end25.2104: ; preds = %for.end19.2 store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.1.2 = icmp eq i32 %1, %.promoted5781.1 br i1 %cmp23.1.2, label %for.inc29.2, label %if.end25.1.2 if.end25.1.2: ; preds = %if.end25.2104 store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.2.2 = icmp eq i32 %1, %.promoted5869.2 br i1 %cmp23.2.2, label %for.inc29.2, label %if.end25.2.2 if.end25.2.2: ; preds = %if.end25.1.2 store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.3.2 = icmp eq i32 %1, %.promoted5985.1 br i1 %cmp23.3.2, label %for.inc29.2, label %if.end25.4.2 if.end25.4.2: ; preds = %if.end25.2.2 store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 br label %for.inc29.2 for.inc29.2: ; preds = %if.end25.4.2, %if.end25.2.2, %if.end25.1.2, %if.end25.2104, %for.end19.2 %8 = phi i32 [ %6, %for.end19.2 ], [ %1, %if.end25.2104 ], [ %1, %if.end25.1.2 ], [ %1, %if.end25.2.2 ], [ %.promoted5781.1, %if.end25.4.2 ] %.promoted5985.2 = phi i32 [ %.promoted5985.1, %for.end19.2 ], [ %.promoted5678.2, %if.end25.2104 ], [ %.promoted5781.1, %if.end25.1.2 ], [ %.promoted5869.2, %if.end25.2.2 ], [ %.promoted5678.2, %if.end25.4.2 ] %.promoted5781.2 = phi i32 [ %.promoted5781.1, %for.end19.2 ], [ %.promoted5869.2, %if.end25.2104 ], [ %.promoted5985.1, %if.end25.1.2 ], [ %.promoted5678.2, %if.end25.2.2 ], [ %.promoted5869.2, %if.end25.4.2 ] %.promoted5676.2 = phi i32 [ %1, %for.end19.2 ], [ %1, %if.end25.2104 ], [ %1, %if.end25.1.2 ], [ %1, %if.end25.2.2 ], [ %.promoted5781.1, %if.end25.4.2 ] %.promoted5867.2 = phi i32 [ %.promoted5869.2, %for.end19.2 ], [ %.promoted5985.1, %if.end25.2104 ], [ %.promoted5678.2, %if.end25.1.2 ], [ %.promoted5781.1, %if.end25.2.2 ], [ %.promoted5985.1, %if.end25.4.2 ] %cmp16.3105 = icmp eq i32 %0, %dice2.promoted62.2 br i1 %cmp16.3105, label %for.end19.3, label %if.end.3106 if.end.3106: ; preds = %for.inc29.2 store i32 %.promoted5867.2, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.1.3 = icmp eq i32 %0, %.promoted5867.2 br i1 %cmp16.1.3, label %for.end19.3, label %if.end.1.3 if.end.1.3: ; preds = %if.end.3106 store i32 %.promoted5371.2, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5867.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.2.3 = icmp eq i32 %0, %.promoted5371.2 br i1 %cmp16.2.3, label %for.end19.3, label %if.end.2.3 if.end.2.3: ; preds = %if.end.1.3 store i32 %.promoted5676.2, ptr @dice2, align 4, !tbaa !5 store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5867.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.3.3 = icmp eq i32 %0, %.promoted5676.2 br i1 %cmp16.3.3, label %for.end19.3, label %if.end.4.3 if.end.4.3: ; preds = %if.end.2.3 store i32 %.promoted5867.2, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 br label %for.end19.3 for.end19.3: ; preds = %if.end.4.3, %if.end.2.3, %if.end.1.3, %if.end.3106, %for.inc29.2 %9 = phi i32 [ %8, %for.inc29.2 ], [ %dice2.promoted62.2, %if.end.3106 ], [ %.promoted5867.2, %if.end.1.3 ], [ %.promoted5371.2, %if.end.2.3 ], [ %dice2.promoted62.2, %if.end.4.3 ] %10 = phi i32 [ %7, %for.inc29.2 ], [ %0, %if.end.3106 ], [ %0, %if.end.1.3 ], [ %0, %if.end.2.3 ], [ %.promoted5867.2, %if.end.4.3 ] %.promoted5678.3 = phi i32 [ %.promoted5676.2, %for.inc29.2 ], [ %dice2.promoted62.2, %if.end.3106 ], [ %.promoted5867.2, %if.end.1.3 ], [ %.promoted5371.2, %if.end.2.3 ], [ %dice2.promoted62.2, %if.end.4.3 ] %.promoted5371.3 = phi i32 [ %.promoted5371.2, %for.inc29.2 ], [ %.promoted5676.2, %if.end.3106 ], [ %dice2.promoted62.2, %if.end.1.3 ], [ %.promoted5867.2, %if.end.2.3 ], [ %.promoted5676.2, %if.end.4.3 ] %.promoted5869.3 = phi i32 [ %.promoted5867.2, %for.inc29.2 ], [ %.promoted5371.2, %if.end.3106 ], [ %.promoted5676.2, %if.end.1.3 ], [ %dice2.promoted62.2, %if.end.2.3 ], [ %.promoted5371.2, %if.end.4.3 ] %dice2.promoted62.3 = phi i32 [ %0, %for.inc29.2 ], [ %0, %if.end.3106 ], [ %0, %if.end.1.3 ], [ %0, %if.end.2.3 ], [ %.promoted5867.2, %if.end.4.3 ] %cmp23.3107 = icmp eq i32 %1, %.promoted5678.3 br i1 %cmp23.3107, label %for.inc29.3, label %if.end25.3108 if.end25.3108: ; preds = %for.end19.3 store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.1.3 = icmp eq i32 %1, %.promoted5781.2 br i1 %cmp23.1.3, label %for.inc29.3, label %if.end25.1.3 if.end25.1.3: ; preds = %if.end25.3108 store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.2.3 = icmp eq i32 %1, %.promoted5869.3 br i1 %cmp23.2.3, label %for.inc29.3, label %if.end25.2.3 if.end25.2.3: ; preds = %if.end25.1.3 store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.3.3 = icmp eq i32 %1, %.promoted5985.2 br i1 %cmp23.3.3, label %for.inc29.3, label %if.end25.4.3 if.end25.4.3: ; preds = %if.end25.2.3 store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 br label %for.inc29.3 for.inc29.3: ; preds = %if.end25.4.3, %if.end25.2.3, %if.end25.1.3, %if.end25.3108, %for.end19.3 %11 = phi i32 [ %9, %for.end19.3 ], [ %1, %if.end25.3108 ], [ %1, %if.end25.1.3 ], [ %1, %if.end25.2.3 ], [ %.promoted5781.2, %if.end25.4.3 ] %.promoted5985.3 = phi i32 [ %.promoted5985.2, %for.end19.3 ], [ %.promoted5678.3, %if.end25.3108 ], [ %.promoted5781.2, %if.end25.1.3 ], [ %.promoted5869.3, %if.end25.2.3 ], [ %.promoted5678.3, %if.end25.4.3 ] %.promoted5781.3 = phi i32 [ %.promoted5781.2, %for.end19.3 ], [ %.promoted5869.3, %if.end25.3108 ], [ %.promoted5985.2, %if.end25.1.3 ], [ %.promoted5678.3, %if.end25.2.3 ], [ %.promoted5869.3, %if.end25.4.3 ] %.promoted5676.3 = phi i32 [ %1, %for.end19.3 ], [ %1, %if.end25.3108 ], [ %1, %if.end25.1.3 ], [ %1, %if.end25.2.3 ], [ %.promoted5781.2, %if.end25.4.3 ] %.promoted5867.3 = phi i32 [ %.promoted5869.3, %for.end19.3 ], [ %.promoted5985.2, %if.end25.3108 ], [ %.promoted5678.3, %if.end25.1.3 ], [ %.promoted5781.2, %if.end25.2.3 ], [ %.promoted5985.2, %if.end25.4.3 ] %cmp16.4 = icmp eq i32 %0, %dice2.promoted62.3 br i1 %cmp16.4, label %for.end19.4, label %if.end.4109 if.end.4109: ; preds = %for.inc29.3 store i32 %.promoted5867.3, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.1.4 = icmp eq i32 %0, %.promoted5867.3 br i1 %cmp16.1.4, label %for.end19.4, label %if.end.1.4 if.end.1.4: ; preds = %if.end.4109 store i32 %.promoted5371.3, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5867.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.2.4 = icmp eq i32 %0, %.promoted5371.3 br i1 %cmp16.2.4, label %for.end19.4, label %if.end.2.4 if.end.2.4: ; preds = %if.end.1.4 store i32 %.promoted5676.3, ptr @dice2, align 4, !tbaa !5 store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5867.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 %cmp16.3.4 = icmp eq i32 %0, %.promoted5676.3 br i1 %cmp16.3.4, label %for.end19.4, label %if.end.4.4 if.end.4.4: ; preds = %if.end.2.4 store i32 %.promoted5867.3, ptr @dice2, align 4, !tbaa !5 store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5 store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 br label %for.end19.4 for.end19.4: ; preds = %if.end.4.4, %if.end.2.4, %if.end.1.4, %if.end.4109, %for.inc29.3 %12 = phi i32 [ %11, %for.inc29.3 ], [ %dice2.promoted62.3, %if.end.4109 ], [ %.promoted5867.3, %if.end.1.4 ], [ %.promoted5371.3, %if.end.2.4 ], [ %dice2.promoted62.3, %if.end.4.4 ] %13 = phi i32 [ %10, %for.inc29.3 ], [ %0, %if.end.4109 ], [ %0, %if.end.1.4 ], [ %0, %if.end.2.4 ], [ %.promoted5867.3, %if.end.4.4 ] %.promoted5678.4 = phi i32 [ %.promoted5676.3, %for.inc29.3 ], [ %dice2.promoted62.3, %if.end.4109 ], [ %.promoted5867.3, %if.end.1.4 ], [ %.promoted5371.3, %if.end.2.4 ], [ %dice2.promoted62.3, %if.end.4.4 ] %.promoted5869.4 = phi i32 [ %.promoted5867.3, %for.inc29.3 ], [ %.promoted5371.3, %if.end.4109 ], [ %.promoted5676.3, %if.end.1.4 ], [ %dice2.promoted62.3, %if.end.2.4 ], [ %.promoted5371.3, %if.end.4.4 ] %cmp23.4110 = icmp eq i32 %1, %.promoted5678.4 br i1 %cmp23.4110, label %for.inc29.4, label %if.end25.4111 if.end25.4111: ; preds = %for.end19.4 store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.1.4 = icmp eq i32 %1, %.promoted5781.3 br i1 %cmp23.1.4, label %for.inc29.4, label %if.end25.1.4 if.end25.1.4: ; preds = %if.end25.4111 store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.2.4 = icmp eq i32 %1, %.promoted5869.4 br i1 %cmp23.2.4, label %for.inc29.4, label %if.end25.2.4 if.end25.2.4: ; preds = %if.end25.1.4 store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 %cmp23.3.4 = icmp eq i32 %1, %.promoted5985.3 br i1 %cmp23.3.4, label %for.inc29.4, label %if.end25.4.4 if.end25.4.4: ; preds = %if.end25.2.4 store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5 store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5 store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5 store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5 br label %for.inc29.4 for.inc29.4: ; preds = %if.end25.4.4, %if.end25.2.4, %if.end25.1.4, %if.end25.4111, %for.end19.4 %14 = phi i32 [ %.promoted5869.4, %if.end25.4.4 ], [ %.promoted5678.4, %if.end25.2.4 ], [ %.promoted5985.3, %if.end25.1.4 ], [ %.promoted5869.4, %if.end25.4111 ], [ %.promoted5781.3, %for.end19.4 ] %15 = phi i32 [ %.promoted5781.3, %if.end25.4.4 ], [ %1, %if.end25.2.4 ], [ %1, %if.end25.1.4 ], [ %1, %if.end25.4111 ], [ %12, %for.end19.4 ] %cmp32 = icmp eq i32 %0, %13 %cmp33 = icmp eq i32 %1, %15 %or.cond = select i1 %cmp32, i1 %cmp33, i1 false %16 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 2), align 4 %cmp35 = icmp eq i32 %16, %14 %or.cond112 = select i1 %or.cond, i1 %cmp35, i1 false %str.3.str = select i1 %or.cond112, ptr @str.3, ptr @str %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int N, M, T; int i; int answer = 0; int a, pa = -1; if (scanf("%d%d%d", &N, &M, &T) != 3) return 1; for (i = 0; i < N; i++) { if (scanf("%d", &a) != 1) return 1; if (i == 0) { if (a >= M) answer += a - M; } else { if (a - pa >= M + M) answer += (a - pa) - (M + M); } pa = a; } if ((T - pa) >= M) answer += (T - pa) - M; printf("%d\n", answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117291/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117291/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [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 %M = alloca i32, align 4 %T = alloca i32, align 4 %a = 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 %M) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M, ptr noundef nonnull %T) %cmp.not = icmp eq i32 %call, 3 br i1 %cmp.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp147 = icmp sgt i32 %0, 0 br i1 %cmp147, label %for.body.preheader, label %for.cond.preheader.for.end_crit_edge for.cond.preheader.for.end_crit_edge: ; preds = %for.cond.preheader %.pre = load i32, ptr %M, align 4, !tbaa !5 br label %for.end for.body.preheader: ; preds = %for.cond.preheader %call2.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %cmp3.not.peel = icmp eq i32 %call2.peel, 1 br i1 %cmp3.not.peel, label %if.then7.peel, label %cleanup if.then7.peel: ; preds = %for.body.preheader %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %M, align 4, !tbaa !5 %cmp8.not.peel = icmp slt i32 %1, %2 %add.peel = sub i32 %1, %2 %spec.select = select i1 %cmp8.not.peel, i32 0, i32 %add.peel %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp1.peel = icmp sgt i32 %3, 1 br i1 %cmp1.peel, label %for.body, label %for.end for.body: ; preds = %if.then7.peel, %if.else %pa.050 = phi i32 [ %4, %if.else ], [ %1, %if.then7.peel ] %answer.049 = phi i32 [ %answer.1, %if.else ], [ %spec.select, %if.then7.peel ] %i.048 = phi i32 [ %inc, %if.else ], [ 1, %if.then7.peel ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %cmp3.not = icmp eq i32 %call2, 1 br i1 %cmp3.not, label %if.else, label %cleanup if.else: ; preds = %for.body %4 = load i32, ptr %a, align 4, !tbaa !5 %sub11 = sub nsw i32 %4, %pa.050 %5 = load i32, ptr %M, align 4, !tbaa !5 %add12 = shl nsw i32 %5, 1 %cmp13.not = icmp slt i32 %sub11, %add12 %sub17 = add i32 %sub11, %answer.049 %add18 = sub i32 %sub17, %add12 %answer.1 = select i1 %cmp13.not, i32 %answer.049, i32 %add18 %inc = add nuw nsw i32 %i.048, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %6 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.else, %if.then7.peel, %for.cond.preheader.for.end_crit_edge %7 = phi i32 [ %.pre, %for.cond.preheader.for.end_crit_edge ], [ %2, %if.then7.peel ], [ %5, %if.else ] %answer.0.lcssa = phi i32 [ 0, %for.cond.preheader.for.end_crit_edge ], [ %spec.select, %if.then7.peel ], [ %answer.1, %if.else ] %pa.0.lcssa = phi i32 [ -1, %for.cond.preheader.for.end_crit_edge ], [ %1, %if.then7.peel ], [ %4, %if.else ] %8 = load i32, ptr %T, align 4, !tbaa !5 %sub21 = sub nsw i32 %8, %pa.0.lcssa %cmp22.not = icmp slt i32 %sub21, %7 %sub25 = sub nsw i32 %sub21, %7 %add26 = select i1 %cmp22.not, i32 0, i32 %sub25 %answer.2 = add nsw i32 %add26, %answer.0.lcssa %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %answer.2) br label %cleanup cleanup: ; preds = %for.body, %for.body.preheader, %entry, %for.end %retval.0 = phi i32 [ 0, %for.end ], [ 1, %entry ], [ 1, %for.body.preheader ], [ 1, %for.body ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef 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} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> #define ll long long int int main(void){ ll A,B,C,ans=0; scanf("%lld%lld%lld",&A,&B,&C); while(1){ if(A%2==1 || B%2==1 || C%2==1)break; if(A==B && B==C){ ans = -1; break; } ans++; ll a=A,b=B,c=C; A = (b+c)/2; B = (a+c)/2; C = (a+b)/2; } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117334/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117334/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%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) %A.promoted = load i64, ptr %A, align 8, !tbaa !5 %0 = and i64 %A.promoted, -9223372036854775807 %cmp22 = icmp eq i64 %0, 1 br i1 %cmp22, label %while.end, label %lor.lhs.false.preheader lor.lhs.false.preheader: ; preds = %entry %C.promoted = load i64, ptr %C, align 8, !tbaa !5 %B.promoted = load i64, ptr %B, align 8, !tbaa !5 br label %lor.lhs.false lor.lhs.false: ; preds = %lor.lhs.false.preheader, %if.end9 %ans.026 = phi i64 [ %inc, %if.end9 ], [ 0, %lor.lhs.false.preheader ] %div1925 = phi i64 [ %div, %if.end9 ], [ %A.promoted, %lor.lhs.false.preheader ] %div112024 = phi i64 [ %div11, %if.end9 ], [ %B.promoted, %lor.lhs.false.preheader ] %div132123 = phi i64 [ %div13, %if.end9 ], [ %C.promoted, %lor.lhs.false.preheader ] %1 = and i64 %div112024, -9223372036854775807 %cmp2 = icmp eq i64 %1, 1 %2 = and i64 %div132123, -9223372036854775807 %cmp5 = icmp eq i64 %2, 1 %or.cond30 = select i1 %cmp2, i1 true, i1 %cmp5 br i1 %or.cond30, label %while.end, label %if.end if.end: ; preds = %lor.lhs.false %cmp6 = icmp eq i64 %div1925, %div112024 %cmp7 = icmp eq i64 %div112024, %div132123 %or.cond = and i1 %cmp6, %cmp7 br i1 %or.cond, label %while.end, label %if.end9 if.end9: ; preds = %if.end %inc = add nuw nsw i64 %ans.026, 1 %add = add nsw i64 %div132123, %div112024 %div = sdiv i64 %add, 2 store i64 %div, ptr %A, align 8, !tbaa !5 %add10 = add nsw i64 %div132123, %div1925 %div11 = sdiv i64 %add10, 2 store i64 %div11, ptr %B, align 8, !tbaa !5 %add12 = add nsw i64 %div112024, %div1925 %div13 = sdiv i64 %add12, 2 store i64 %div13, ptr %C, align 8, !tbaa !5 %3 = and i64 %div, -9223372036854775807 %cmp = icmp eq i64 %3, 1 br i1 %cmp, label %while.end, label %lor.lhs.false while.end: ; preds = %lor.lhs.false, %if.end9, %if.end, %entry %ans.1 = phi i64 [ 0, %entry ], [ -1, %if.end ], [ %inc, %if.end9 ], [ %ans.026, %lor.lhs.false ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.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: 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(int argc, char const *argv[]){ long a,b,c,ans=0,sum; scanf("%ld %ld %ld",&a,&b,&c); if(a%2==0 && b%2==0 && c%2==0){ if(a==b && b==c) ans=-1; else{ sum=a+b+c; c=c-b; b=b-a; while(c%2==0 && b%2==0 && a%2==0){ ans++; a=(sum-a)/2; b/=2; c/=2; } } } printf("%ld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117378/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117378/source.c" target datalayout = "e-m:e-p270: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"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\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: %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 %a, align 8, !tbaa !5 %1 = and i64 %0, 1 %cmp = icmp eq i64 %1, 0 br i1 %cmp, label %land.lhs.true, label %if.end22 land.lhs.true: ; preds = %entry %2 = load i64, ptr %b, align 8, !tbaa !5 %3 = and i64 %2, 1 %cmp2 = icmp eq i64 %3, 0 br i1 %cmp2, label %land.lhs.true3, label %if.end22 land.lhs.true3: ; preds = %land.lhs.true %4 = load i64, ptr %c, align 8, !tbaa !5 %5 = and i64 %4, 1 %cmp5 = icmp eq i64 %5, 0 br i1 %cmp5, label %if.then, label %if.end22 if.then: ; preds = %land.lhs.true3 %cmp6 = icmp eq i64 %0, %2 %cmp8 = icmp eq i64 %2, %4 %or.cond = and i1 %cmp6, %cmp8 br i1 %or.cond, label %if.end22, label %if.else if.else: ; preds = %if.then %add = add nsw i64 %2, %0 %add10 = add nsw i64 %add, %4 %sub = sub nsw i64 %4, %2 store i64 %sub, ptr %c, align 8, !tbaa !5 %sub11 = sub nsw i64 %2, %0 store i64 %sub11, ptr %b, align 8, !tbaa !5 %6 = and i64 %sub, 1 %cmp1328 = icmp eq i64 %6, 0 br i1 %cmp1328, label %land.lhs.true14, label %if.end22 land.lhs.true14: ; preds = %if.else, %while.body %ans.032 = phi i64 [ %inc, %while.body ], [ 0, %if.else ] %div212531 = phi i64 [ %div21, %while.body ], [ %sub, %if.else ] %div202630 = phi i64 [ %div20, %while.body ], [ %sub11, %if.else ] %div2729 = phi i64 [ %div, %while.body ], [ %0, %if.else ] %7 = and i64 %div202630, 1 %cmp16 = icmp eq i64 %7, 0 %8 = and i64 %div2729, 1 %cmp18 = icmp eq i64 %8, 0 %or.cond35 = select i1 %cmp16, i1 %cmp18, i1 false br i1 %or.cond35, label %while.body, label %if.end22 while.body: ; preds = %land.lhs.true14 %inc = add nuw nsw i64 %ans.032, 1 %sub19 = sub i64 %add10, %div2729 %div = sdiv i64 %sub19, 2 store i64 %div, ptr %a, align 8, !tbaa !5 %div20 = sdiv i64 %div202630, 2 store i64 %div20, ptr %b, align 8, !tbaa !5 %div21 = sdiv i64 %div212531, 2 store i64 %div21, ptr %c, align 8, !tbaa !5 %9 = and i64 %div21, 1 %cmp13 = icmp eq i64 %9, 0 br i1 %cmp13, label %land.lhs.true14, label %if.end22, !llvm.loop !9 if.end22: ; preds = %while.body, %land.lhs.true14, %if.else, %if.then, %land.lhs.true3, %land.lhs.true, %entry %ans.1 = phi i64 [ 0, %land.lhs.true3 ], [ 0, %land.lhs.true ], [ 0, %entry ], [ -1, %if.then ], [ 0, %if.else ], [ %inc, %while.body ], [ %ans.032, %land.lhs.true14 ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #define PI 3.141592653589793 #define MOD 1000000007 int main(){ int n, m; scanf("%d%d", &n, &m); int au[50][50], bi[50][50]; char ai[50]; for(int i=0; i<n; i++){ scanf("%s", ai); for(int j=0; j<n; j++){ if(ai[j] == '.') au[i][j] = -1; else if(ai[j] == '#') au[i][j] = 1; else au[i][j] = 0; } } for(int i=0; i<m; i++){ scanf("%s", ai); for(int j=0; j<m; j++){ if(ai[j] == '.') bi[i][j] = -1; else bi[i][j] = 1; } } /* for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ printf("%d ", au[i][j]); } printf("\n"); } printf("\n"); for(int i=0; i<m; i++){ for(int j=0; j<m; j++){ printf("%d ", bi[i][j]); } printf("\n"); } */ int judge = m*m, answer=0;; for(int i=0; i<=n-m; i++){ for(int j=0; j<=n-m; j++){ if(bi[0][0] == au[i][j]){ int count = 0; for(int k=0; k<m; k++){ for(int l=0; l<m; l++){ if(bi[k][l] == au[i+k][j+l]) count++; } } if(count == judge) answer = 1; } } } if(answer == 1) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117420/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117420/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %au = alloca [50 x [50 x i32]], align 16 %bi = alloca [50 x [50 x i32]], align 16 %ai = alloca [50 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %au) #5 call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %bi) #5 call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %ai) #5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp171 = icmp sgt i32 %0, 0 br i1 %cmp171, label %for.body, label %for.cond32.preheader for.cond32.preheader: ; preds = %for.cond.cleanup4, %entry %1 = phi i32 [ %0, %entry ], [ %3, %for.cond.cleanup4 ] %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp33175 = icmp sgt i32 %2, 0 br i1 %cmp33175, label %for.body36, label %for.cond.cleanup35 for.body: ; preds = %entry, %for.cond.cleanup4 %indvars.iv227 = phi i64 [ %indvars.iv.next228, %for.cond.cleanup4 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ai) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp3169 = icmp sgt i32 %3, 0 br i1 %cmp3169, label %for.body5.lr.ph, label %for.cond.cleanup4 for.body5.lr.ph: ; preds = %for.body %wide.trip.count = zext i32 %3 to i64 %min.iters.check = icmp ult i32 %3, 8 br i1 %min.iters.check, label %for.body5.preheader, label %vector.ph vector.ph: ; preds = %for.body5.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = getelementptr inbounds [50 x i8], ptr %ai, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %4, align 8, !tbaa !9 %5 = getelementptr inbounds i8, ptr %4, i64 4 %wide.load282 = load <4 x i8>, ptr %5, align 4, !tbaa !9 %6 = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %indvars.iv227, i64 %index %7 = icmp eq <4 x i8> %wide.load, <i8 35, i8 35, i8 35, i8 35> %8 = icmp eq <4 x i8> %wide.load282, <i8 35, i8 35, i8 35, i8 35> %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = icmp eq <4 x i8> %wide.load, <i8 46, i8 46, i8 46, i8 46> %12 = icmp eq <4 x i8> %wide.load282, <i8 46, i8 46, i8 46, i8 46> %13 = select <4 x i1> %11, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> %9 %14 = select <4 x i1> %12, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> %10 store <4 x i32> %13, ptr %6, align 8, !tbaa !5 %15 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %14, ptr %15, align 8, !tbaa !5 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup4, label %for.body5.preheader for.body5.preheader: ; preds = %for.body5.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body5.lr.ph ], [ %n.vec, %middle.block ] br label %for.body5 for.cond.cleanup4: ; preds = %for.body5, %middle.block, %for.body %indvars.iv.next228 = add nuw nsw i64 %indvars.iv227, 1 %17 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next228, %17 br i1 %cmp, label %for.body, label %for.cond32.preheader, !llvm.loop !14 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ %indvars.iv.ph, %for.body5.preheader ] %arrayidx = getelementptr inbounds [50 x i8], ptr %ai, i64 0, i64 %indvars.iv %18 = load i8, ptr %arrayidx, align 1, !tbaa !9 %arrayidx26 = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %indvars.iv227, i64 %indvars.iv %switch.selectcmp = icmp eq i8 %18, 35 %switch.select = zext i1 %switch.selectcmp to i32 %switch.selectcmp277 = icmp eq i8 %18, 46 %switch.select278 = select i1 %switch.selectcmp277, i32 -1, i32 %switch.select store i32 %switch.select278, ptr %arrayidx26, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !15 for.cond.cleanup35.loopexit: ; preds = %for.cond.cleanup43 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup35 for.cond.cleanup35: ; preds = %for.cond.cleanup35.loopexit, %for.cond32.preheader %19 = phi i32 [ %1, %for.cond32.preheader ], [ %.pre, %for.cond.cleanup35.loopexit ] %.lcssa = phi i32 [ %2, %for.cond32.preheader ], [ %52, %for.cond.cleanup35.loopexit ] %.lcssa.fr = freeze i32 %.lcssa %mul = mul nsw i32 %.lcssa.fr, %.lcssa.fr %cmp69.not203 = icmp slt i32 %19, %.lcssa.fr br i1 %cmp69.not203, label %if.else134, label %for.cond74.preheader.lr.ph for.cond74.preheader.lr.ph: ; preds = %for.cond.cleanup35 %20 = load i32, ptr %bi, align 16 %cmp90181 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp90181, label %for.cond74.preheader.us209.preheader, label %for.cond74.preheader.lr.ph.split.split for.cond74.preheader.us209.preheader: ; preds = %for.cond74.preheader.lr.ph %21 = add i32 %19, 1 %22 = sub i32 %21, %.lcssa.fr %wide.trip.count268 = zext i32 %22 to i64 %wide.trip.count258 = zext i32 %.lcssa.fr to i64 %min.iters.check316 = icmp ult i32 %.lcssa.fr, 8 %n.vec319 = and i64 %wide.trip.count258, 4294967288 %cmp.n321 = icmp eq i64 %n.vec319, %wide.trip.count258 br label %for.cond74.preheader.us209 for.cond74.preheader.us209: ; preds = %for.cond74.preheader.us209.preheader, %for.cond74.for.cond.cleanup78_crit_edge.split.us.us %indvars.iv265 = phi i64 [ 0, %for.cond74.preheader.us209.preheader ], [ %indvars.iv.next266, %for.cond74.for.cond.cleanup78_crit_edge.split.us.us ] %answer.0204.us211 = phi i32 [ 0, %for.cond74.preheader.us209.preheader ], [ %answer.3.us.us, %for.cond74.for.cond.cleanup78_crit_edge.split.us.us ] br label %for.body79.us.us for.body79.us.us: ; preds = %for.inc124.us.us, %for.cond74.preheader.us209 %indvars.iv260 = phi i64 [ %indvars.iv.next261, %for.inc124.us.us ], [ 0, %for.cond74.preheader.us209 ] %answer.1186.us.us = phi i32 [ %answer.3.us.us, %for.inc124.us.us ], [ %answer.0204.us211, %for.cond74.preheader.us209 ] %arrayidx85.us.us = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %indvars.iv265, i64 %indvars.iv260 %23 = load i32, ptr %arrayidx85.us.us, align 4, !tbaa !5 %cmp86.us.us = icmp eq i32 %20, %23 br i1 %cmp86.us.us, label %for.cond94.preheader.us.us.us, label %for.inc124.us.us for.inc124.us.us: ; preds = %for.cond89.for.cond.cleanup92_crit_edge.split.us.us.us, %for.body79.us.us %answer.3.us.us = phi i32 [ %spec.select.us.us, %for.cond89.for.cond.cleanup92_crit_edge.split.us.us.us ], [ %answer.1186.us.us, %for.body79.us.us ] %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1 %exitcond264.not = icmp eq i64 %indvars.iv.next261, %wide.trip.count268 br i1 %exitcond264.not, label %for.cond74.for.cond.cleanup78_crit_edge.split.us.us, label %for.body79.us.us, !llvm.loop !16 for.cond94.preheader.us.us.us: ; preds = %for.body79.us.us, %for.cond94.for.cond.cleanup97_crit_edge.us.us.us %indvars.iv254 = phi i64 [ %indvars.iv.next255, %for.cond94.for.cond.cleanup97_crit_edge.us.us.us ], [ 0, %for.body79.us.us ] %count.0182.us.us.us = phi i32 [ %spec.select168.us.us.us.lcssa, %for.cond94.for.cond.cleanup97_crit_edge.us.us.us ], [ 0, %for.body79.us.us ] %24 = add nuw nsw i64 %indvars.iv254, %indvars.iv265 br i1 %min.iters.check316, label %for.body98.us.us.us.preheader, label %vector.ph317 vector.ph317: ; preds = %for.cond94.preheader.us.us.us %25 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.0182.us.us.us, i64 0 br label %vector.body322 vector.body322: ; preds = %vector.body322, %vector.ph317 %index323 = phi i64 [ 0, %vector.ph317 ], [ %index.next330, %vector.body322 ] %vec.phi324 = phi <4 x i32> [ %25, %vector.ph317 ], [ %35, %vector.body322 ] %vec.phi325 = phi <4 x i32> [ zeroinitializer, %vector.ph317 ], [ %36, %vector.body322 ] %26 = getelementptr inbounds [50 x [50 x i32]], ptr %bi, i64 0, i64 %indvars.iv254, i64 %index323 %wide.load326 = load <4 x i32>, ptr %26, align 8, !tbaa !5 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load327 = load <4 x i32>, ptr %27, align 8, !tbaa !5 %28 = add nuw nsw i64 %index323, %indvars.iv260 %29 = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %24, i64 %28 %wide.load328 = load <4 x i32>, ptr %29, align 4, !tbaa !5 %30 = getelementptr inbounds i32, ptr %29, i64 4 %wide.load329 = load <4 x i32>, ptr %30, align 4, !tbaa !5 %31 = icmp eq <4 x i32> %wide.load326, %wide.load328 %32 = icmp eq <4 x i32> %wide.load327, %wide.load329 %33 = zext <4 x i1> %31 to <4 x i32> %34 = zext <4 x i1> %32 to <4 x i32> %35 = add <4 x i32> %vec.phi324, %33 %36 = add <4 x i32> %vec.phi325, %34 %index.next330 = add nuw i64 %index323, 8 %37 = icmp eq i64 %index.next330, %n.vec319 br i1 %37, label %middle.block314, label %vector.body322, !llvm.loop !17 middle.block314: ; preds = %vector.body322 %bin.rdx = add <4 x i32> %36, %35 %38 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n321, label %for.cond94.for.cond.cleanup97_crit_edge.us.us.us, label %for.body98.us.us.us.preheader for.body98.us.us.us.preheader: ; preds = %for.cond94.preheader.us.us.us, %middle.block314 %indvars.iv248.ph = phi i64 [ 0, %for.cond94.preheader.us.us.us ], [ %n.vec319, %middle.block314 ] %count.1178.us.us.us.ph = phi i32 [ %count.0182.us.us.us, %for.cond94.preheader.us.us.us ], [ %38, %middle.block314 ] br label %for.body98.us.us.us for.body98.us.us.us: ; preds = %for.body98.us.us.us.preheader, %for.body98.us.us.us %indvars.iv248 = phi i64 [ %indvars.iv.next249, %for.body98.us.us.us ], [ %indvars.iv248.ph, %for.body98.us.us.us.preheader ] %count.1178.us.us.us = phi i32 [ %spec.select168.us.us.us, %for.body98.us.us.us ], [ %count.1178.us.us.us.ph, %for.body98.us.us.us.preheader ] %arrayidx102.us.us.us = getelementptr inbounds [50 x [50 x i32]], ptr %bi, i64 0, i64 %indvars.iv254, i64 %indvars.iv248 %39 = load i32, ptr %arrayidx102.us.us.us, align 4, !tbaa !5 %40 = add nuw nsw i64 %indvars.iv248, %indvars.iv260 %arrayidx107.us.us.us = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %24, i64 %40 %41 = load i32, ptr %arrayidx107.us.us.us, align 4, !tbaa !5 %cmp108.us.us.us = icmp eq i32 %39, %41 %inc111.us.us.us = zext i1 %cmp108.us.us.us to i32 %spec.select168.us.us.us = add nsw i32 %count.1178.us.us.us, %inc111.us.us.us %indvars.iv.next249 = add nuw nsw i64 %indvars.iv248, 1 %exitcond253.not = icmp eq i64 %indvars.iv.next249, %wide.trip.count258 br i1 %exitcond253.not, label %for.cond94.for.cond.cleanup97_crit_edge.us.us.us, label %for.body98.us.us.us, !llvm.loop !18 for.cond94.for.cond.cleanup97_crit_edge.us.us.us: ; preds = %for.body98.us.us.us, %middle.block314 %spec.select168.us.us.us.lcssa = phi i32 [ %38, %middle.block314 ], [ %spec.select168.us.us.us, %for.body98.us.us.us ] %indvars.iv.next255 = add nuw nsw i64 %indvars.iv254, 1 %exitcond259.not = icmp eq i64 %indvars.iv.next255, %wide.trip.count258 br i1 %exitcond259.not, label %for.cond89.for.cond.cleanup92_crit_edge.split.us.us.us, label %for.cond94.preheader.us.us.us, !llvm.loop !19 for.cond89.for.cond.cleanup92_crit_edge.split.us.us.us: ; preds = %for.cond94.for.cond.cleanup97_crit_edge.us.us.us %cmp119.us.us = icmp eq i32 %spec.select168.us.us.us.lcssa, %mul %spec.select.us.us = select i1 %cmp119.us.us, i32 1, i32 %answer.1186.us.us br label %for.inc124.us.us for.cond74.for.cond.cleanup78_crit_edge.split.us.us: ; preds = %for.inc124.us.us %indvars.iv.next266 = add nuw nsw i64 %indvars.iv265, 1 %exitcond269.not = icmp eq i64 %indvars.iv.next266, %wide.trip.count268 br i1 %exitcond269.not, label %for.cond.cleanup71, label %for.cond74.preheader.us209, !llvm.loop !20 for.cond74.preheader.lr.ph.split.split: ; preds = %for.cond74.preheader.lr.ph %cmp119 = icmp eq i32 %.lcssa.fr, 0 br i1 %cmp119, label %for.cond74.preheader.us216.preheader, label %if.else134 for.cond74.preheader.us216.preheader: ; preds = %for.cond74.preheader.lr.ph.split.split %42 = add i32 %19, 1 %wide.trip.count246 = zext i32 %42 to i64 %min.iters.check298 = icmp ult i32 %42, 8 %n.vec301 = and i64 %wide.trip.count246, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %20, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n303 = icmp eq i64 %n.vec301, %wide.trip.count246 br label %for.cond74.preheader.us216 for.cond74.preheader.us216: ; preds = %for.cond74.preheader.us216.preheader, %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us %indvars.iv243 = phi i64 [ 0, %for.cond74.preheader.us216.preheader ], [ %indvars.iv.next244, %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us ] %answer.0204.us218 = phi i32 [ 0, %for.cond74.preheader.us216.preheader ], [ %spec.select.lcssa, %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us ] br i1 %min.iters.check298, label %for.body79.us190.us.preheader, label %vector.ph299 vector.ph299: ; preds = %for.cond74.preheader.us216 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %answer.0204.us218, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body304 vector.body304: ; preds = %vector.body304, %vector.ph299 %index305 = phi i64 [ 0, %vector.ph299 ], [ %index.next309, %vector.body304 ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph299 ], [ %47, %vector.body304 ] %vec.phi306 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph299 ], [ %48, %vector.body304 ] %43 = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %indvars.iv243, i64 %index305 %wide.load307 = load <4 x i32>, ptr %43, align 8, !tbaa !5 %44 = getelementptr inbounds i32, ptr %43, i64 4 %wide.load308 = load <4 x i32>, ptr %44, align 8, !tbaa !5 %45 = icmp eq <4 x i32> %broadcast.splat, %wide.load307 %46 = icmp eq <4 x i32> %broadcast.splat, %wide.load308 %47 = select <4 x i1> %45, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi %48 = select <4 x i1> %46, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi306 %index.next309 = add nuw i64 %index305, 8 %49 = icmp eq i64 %index.next309, %n.vec301 br i1 %49, label %middle.block296, label %vector.body304, !llvm.loop !21 middle.block296: ; preds = %vector.body304 %.splatinsert = insertelement <4 x i32> poison, i32 %answer.0204.us218, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %rdx.select.cmp.not = icmp eq <4 x i32> %47, %.splat %rdx.select = select <4 x i1> %rdx.select.cmp.not, <4 x i32> %48, <4 x i32> %47 %.splatinsert310 = insertelement <4 x i32> poison, i32 %answer.0204.us218, i64 0 %.splat311 = shufflevector <4 x i32> %.splatinsert310, <4 x i32> poison, <4 x i32> zeroinitializer %rdx.select.cmp312 = icmp ne <4 x i32> %rdx.select, %.splat311 %50 = bitcast <4 x i1> %rdx.select.cmp312 to i4 %.not = icmp eq i4 %50, 0 %rdx.select313 = select i1 %.not, i32 %answer.0204.us218, i32 1 br i1 %cmp.n303, label %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us, label %for.body79.us190.us.preheader for.body79.us190.us.preheader: ; preds = %for.cond74.preheader.us216, %middle.block296 %indvars.iv238.ph = phi i64 [ 0, %for.cond74.preheader.us216 ], [ %n.vec301, %middle.block296 ] %answer.1186.us192.us.ph = phi i32 [ %answer.0204.us218, %for.cond74.preheader.us216 ], [ %rdx.select313, %middle.block296 ] br label %for.body79.us190.us for.body79.us190.us: ; preds = %for.body79.us190.us.preheader, %for.body79.us190.us %indvars.iv238 = phi i64 [ %indvars.iv.next239, %for.body79.us190.us ], [ %indvars.iv238.ph, %for.body79.us190.us.preheader ] %answer.1186.us192.us = phi i32 [ %spec.select, %for.body79.us190.us ], [ %answer.1186.us192.us.ph, %for.body79.us190.us.preheader ] %arrayidx85.us194.us = getelementptr inbounds [50 x [50 x i32]], ptr %au, i64 0, i64 %indvars.iv243, i64 %indvars.iv238 %51 = load i32, ptr %arrayidx85.us194.us, align 4, !tbaa !5 %cmp86.us195.us = icmp eq i32 %20, %51 %spec.select = select i1 %cmp86.us195.us, i32 1, i32 %answer.1186.us192.us %indvars.iv.next239 = add nuw nsw i64 %indvars.iv238, 1 %exitcond242.not = icmp eq i64 %indvars.iv.next239, %wide.trip.count246 br i1 %exitcond242.not, label %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us, label %for.body79.us190.us, !llvm.loop !22 for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us: ; preds = %for.body79.us190.us, %middle.block296 %spec.select.lcssa = phi i32 [ %rdx.select313, %middle.block296 ], [ %spec.select, %for.body79.us190.us ] %indvars.iv.next244 = add nuw nsw i64 %indvars.iv243, 1 %exitcond247.not = icmp eq i64 %indvars.iv.next244, %wide.trip.count246 br i1 %exitcond247.not, label %for.cond.cleanup71, label %for.cond74.preheader.us216, !llvm.loop !20 for.body36: ; preds = %for.cond32.preheader, %for.cond.cleanup43 %indvars.iv235 = phi i64 [ %indvars.iv.next236, %for.cond.cleanup43 ], [ 0, %for.cond32.preheader ] %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ai) %52 = load i32, ptr %m, align 4, !tbaa !5 %cmp41173 = icmp sgt i32 %52, 0 br i1 %cmp41173, label %for.body44.lr.ph, label %for.cond.cleanup43 for.body44.lr.ph: ; preds = %for.body36 %wide.trip.count233 = zext i32 %52 to i64 %min.iters.check285 = icmp ult i32 %52, 8 br i1 %min.iters.check285, label %for.body44.preheader, label %vector.ph286 vector.ph286: ; preds = %for.body44.lr.ph %n.vec288 = and i64 %wide.trip.count233, 4294967288 br label %vector.body291 vector.body291: ; preds = %vector.body291, %vector.ph286 %index292 = phi i64 [ 0, %vector.ph286 ], [ %index.next295, %vector.body291 ] %53 = getelementptr inbounds [50 x i8], ptr %ai, i64 0, i64 %index292 %wide.load293 = load <4 x i8>, ptr %53, align 8, !tbaa !9 %54 = getelementptr inbounds i8, ptr %53, i64 4 %wide.load294 = load <4 x i8>, ptr %54, align 4, !tbaa !9 %55 = icmp eq <4 x i8> %wide.load293, <i8 46, i8 46, i8 46, i8 46> %56 = icmp eq <4 x i8> %wide.load294, <i8 46, i8 46, i8 46, i8 46> %57 = select <4 x i1> %55, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> %58 = select <4 x i1> %56, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> %59 = getelementptr inbounds [50 x [50 x i32]], ptr %bi, i64 0, i64 %indvars.iv235, i64 %index292 store <4 x i32> %57, ptr %59, align 8 %60 = getelementptr inbounds i32, ptr %59, i64 4 store <4 x i32> %58, ptr %60, align 8 %index.next295 = add nuw i64 %index292, 8 %61 = icmp eq i64 %index.next295, %n.vec288 br i1 %61, label %middle.block283, label %vector.body291, !llvm.loop !23 middle.block283: ; preds = %vector.body291 %cmp.n290 = icmp eq i64 %n.vec288, %wide.trip.count233 br i1 %cmp.n290, label %for.cond.cleanup43, label %for.body44.preheader for.body44.preheader: ; preds = %for.body44.lr.ph, %middle.block283 %indvars.iv230.ph = phi i64 [ 0, %for.body44.lr.ph ], [ %n.vec288, %middle.block283 ] br label %for.body44 for.cond.cleanup43: ; preds = %for.body44, %middle.block283, %for.body36 %indvars.iv.next236 = add nuw nsw i64 %indvars.iv235, 1 %62 = sext i32 %52 to i64 %cmp33 = icmp slt i64 %indvars.iv.next236, %62 br i1 %cmp33, label %for.body36, label %for.cond.cleanup35.loopexit, !llvm.loop !24 for.body44: ; preds = %for.body44.preheader, %for.body44 %indvars.iv230 = phi i64 [ %indvars.iv.next231, %for.body44 ], [ %indvars.iv230.ph, %for.body44.preheader ] %arrayidx46 = getelementptr inbounds [50 x i8], ptr %ai, i64 0, i64 %indvars.iv230 %63 = load i8, ptr %arrayidx46, align 1, !tbaa !9 %cmp48 = icmp eq i8 %63, 46 %spec.select276 = select i1 %cmp48, i32 -1, i32 1 %64 = getelementptr inbounds [50 x [50 x i32]], ptr %bi, i64 0, i64 %indvars.iv235, i64 %indvars.iv230 store i32 %spec.select276, ptr %64, align 4 %indvars.iv.next231 = add nuw nsw i64 %indvars.iv230, 1 %exitcond234.not = icmp eq i64 %indvars.iv.next231, %wide.trip.count233 br i1 %exitcond234.not, label %for.cond.cleanup43, label %for.body44, !llvm.loop !25 for.cond.cleanup71: ; preds = %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us, %for.cond74.for.cond.cleanup78_crit_edge.split.us.us %answer.0.lcssa = phi i32 [ %answer.3.us.us, %for.cond74.for.cond.cleanup78_crit_edge.split.us.us ], [ %spec.select.lcssa, %for.cond74.for.cond.cleanup78_crit_edge.split.split.us.us ] %cmp130 = icmp eq i32 %answer.0.lcssa, 1 br i1 %cmp130, label %if.end136, label %if.else134 if.else134: ; preds = %for.cond74.preheader.lr.ph.split.split, %for.cond.cleanup35, %for.cond.cleanup71 br label %if.end136 if.end136: ; preds = %for.cond.cleanup71, %if.else134 %str.sink = phi ptr [ @str, %if.else134 ], [ @str.4, %for.cond.cleanup71 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %ai) #5 call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %bi) #5 call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %au) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree 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 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 = { nofree nounwind } 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} !15 = distinct !{!15, !11, !13, !12} !16 = distinct !{!16, !11} !17 = distinct !{!17, !11, !12, !13} !18 = distinct !{!18, !11, !13, !12} !19 = distinct !{!19, !11} !20 = distinct !{!20, !11} !21 = distinct !{!21, !11, !12, !13} !22 = distinct !{!22, !11, !13, !12} !23 = distinct !{!23, !11, !12, !13} !24 = distinct !{!24, !11} !25 = distinct !{!25, !11, !13, !12}
#include<stdio.h> #include<string.h> char a[51][51]; char b[51][51]; int main(void) { int i, j, k, l; int n, m; int flag = 0; char c; scanf("%d%d%c", &n, &m, &c); //行列のnまたはm成分には改行文字が含まれていることに注意// for (i = 0; i < n; i++) { scanf("%s", a[i], 51); } for (i = 0; i < m; i++) { scanf("%s", b[i], 51); } //同じ行列が含まれるか判定// //まず大きいほうの各行列成分について// for (i = 0; i <= n - m; i++) { for (j = 0; j <= n - m; j++) { //小さいほうの各行列成分が等しいか確認// for (k = 0; k < m; k++) { for (l = 0; l < m; l++) { if (a[i + k][j + l] != b[k][l]) { flag = 1; break; } } if (flag == 1) { break; } } if (flag == 0) { printf("Yes\n"); return 0; } flag = 0; } } printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117464/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117464/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%c\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @a = dso_local global [51 x [51 x i8]] zeroinitializer, align 16 @b = dso_local global [51 x [51 x i8]] zeroinitializer, align 16 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i8, align 1 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 1, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp85 = icmp sgt i32 %0, 0 br i1 %cmp85, 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 !5 %cmp387 = icmp sgt i32 %2, 0 br i1 %cmp387, label %for.body4, label %for.cond12.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, i32 noundef 51) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond12.preheader.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !5 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 ] %.lcssa = phi i32 [ %2, %for.cond2.preheader ], [ %8, %for.cond12.preheader.loopexit ] %cmp13.not95 = icmp slt i32 %5, %.lcssa br i1 %cmp13.not95, label %cleanup, label %for.cond15.preheader.lr.ph for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader %cmp20.not91 = icmp sgt i32 %.lcssa, 0 br i1 %cmp20.not91, label %for.cond15.preheader.preheader, label %cleanup for.cond15.preheader.preheader: ; preds = %for.cond15.preheader.lr.ph %6 = add i32 %5, 1 %7 = sub i32 %6, %.lcssa %wide.trip.count120 = zext i32 %7 to i64 %wide.trip.count110 = zext i32 %.lcssa to i64 br label %for.cond15.preheader for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [51 x [51 x i8]], ptr @b, i64 0, i64 %indvars.iv99 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6, i32 noundef 51) %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp3 = icmp slt i64 %indvars.iv.next100, %9 br i1 %cmp3, label %for.body4, label %for.cond12.preheader.loopexit, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond15.preheader.preheader, %for.cond15.for.inc55_crit_edge %indvars.iv117 = phi i64 [ 0, %for.cond15.preheader.preheader ], [ %indvars.iv.next118, %for.cond15.for.inc55_crit_edge ] br label %for.cond19.preheader for.cond19.preheader: ; preds = %for.cond15.preheader, %for.end46.split.us %indvars.iv112 = phi i64 [ 0, %for.cond15.preheader ], [ %indvars.iv.next113, %for.end46.split.us ] br label %for.cond22.preheader.us for.cond22.preheader.us: ; preds = %for.cond22.for.inc44_crit_edge.us, %for.cond19.preheader %indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.cond22.for.inc44_crit_edge.us ], [ 0, %for.cond19.preheader ] %10 = add nuw nsw i64 %indvars.iv106, %indvars.iv117 br label %for.body24.us for.cond22.us: ; preds = %for.body24.us %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count110 br i1 %exitcond.not, label %for.cond22.for.inc44_crit_edge.us, label %for.body24.us, !llvm.loop !12 for.body24.us: ; preds = %for.cond22.preheader.us, %for.cond22.us %indvars.iv102 = phi i64 [ 0, %for.cond22.preheader.us ], [ %indvars.iv.next103, %for.cond22.us ] %11 = add nuw nsw i64 %indvars.iv102, %indvars.iv112 %arrayidx29.us = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %10, i64 %11 %12 = load i8, ptr %arrayidx29.us, align 1, !tbaa !13 %arrayidx33.us = getelementptr inbounds [51 x [51 x i8]], ptr @b, i64 0, i64 %indvars.iv106, i64 %indvars.iv102 %13 = load i8, ptr %arrayidx33.us, align 1, !tbaa !13 %cmp35.not.us = icmp eq i8 %12, %13 br i1 %cmp35.not.us, label %for.cond22.us, label %for.end46.split.us for.cond22.for.inc44_crit_edge.us: ; preds = %for.cond22.us %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1 %exitcond111.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count110 br i1 %exitcond111.not, label %cleanup, label %for.cond22.preheader.us, !llvm.loop !14 for.end46.split.us: ; preds = %for.body24.us %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count120 br i1 %exitcond116.not, label %for.cond15.for.inc55_crit_edge, label %for.cond19.preheader, !llvm.loop !15 for.cond15.for.inc55_crit_edge: ; preds = %for.end46.split.us %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120 br i1 %exitcond121.not, label %cleanup, label %for.cond15.preheader, !llvm.loop !16 cleanup: ; preds = %for.cond15.for.inc55_crit_edge, %for.cond22.for.inc44_crit_edge.us, %for.cond12.preheader, %for.cond15.preheader.lr.ph %str.sink = phi ptr [ @str.4, %for.cond15.preheader.lr.ph ], [ @str, %for.cond12.preheader ], [ @str.4, %for.cond22.for.inc44_crit_edge.us ], [ @str, %for.cond15.for.inc55_crit_edge ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> char a[51][51]; char b[51][51]; int main(void){ int n, m; int i, j, k, l, f = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; i++){ scanf("%s", a[i]); } for (i = 0; i < m; i++){ scanf("%s", b[i]); } /*printf("a\n"); for (i = 0; i < n; i++){ printf("%s\n", a[i]); } printf("b\n"); for (i = 0; i < m; i++){ printf("%s\n", b[i]); }*/ //printf("%d\n", n-m); for (i = 0; i <= n-m; i++){ for (j = 0; j <= n-m; j++){ if (a[i][j] == b[0][0]){ f = 1; //printf("%d %d\n", i, j); for (k = 0; k < m; k++){ for (l = 0; l < m; l++){ if (a[i+k][j+l] != b[k][l]){ f = 0; //printf("%d %d\n", i+k, j+l); break; } } if (f == 0) break; } } if (f == 1) break; } if (f == 1) break; } if (f) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117507/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117507/source.c" target datalayout = "e-m:e-p270: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"%s\00", align 1 @a = dso_local global [51 x [51 x i8]] zeroinitializer, align 16 @b = dso_local global [51 x [51 x i8]] zeroinitializer, align 16 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp99 = icmp sgt i32 %0, 0 br i1 %cmp99, 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 !5 %cmp3101 = icmp sgt i32 %2, 0 br i1 %cmp3101, label %for.body4, label %for.cond12.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond12.preheader.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !5 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 ] %.lcssa = phi i32 [ %2, %for.cond2.preheader ], [ %14, %for.cond12.preheader.loopexit ] %.lcssa.fr = freeze i32 %.lcssa %cmp13.not109 = icmp slt i32 %5, %.lcssa.fr br i1 %cmp13.not109, label %if.end76, label %for.cond15.preheader.lr.ph for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader %6 = load i8, ptr @b, align 16 %cmp27105 = icmp sgt i32 %.lcssa.fr, 0 %7 = add i32 %5, 1 %8 = sub i32 %7, %.lcssa.fr %wide.trip.count151 = zext i32 %8 to i64 br i1 %cmp27105, label %for.cond15.preheader.us112.preheader, label %for.cond15.preheader for.cond15.preheader.us112.preheader: ; preds = %for.cond15.preheader.lr.ph %wide.trip.count141 = zext i32 %.lcssa.fr to i64 br label %for.cond15.preheader.us112 for.cond15.preheader.us112: ; preds = %for.cond15.preheader.us112.preheader, %for.cond15.for.inc70_crit_edge.split.us.us %indvars.iv148 = phi i64 [ 0, %for.cond15.preheader.us112.preheader ], [ %indvars.iv.next149, %for.cond15.for.inc70_crit_edge.split.us.us ] br label %for.body18.us.us for.body18.us.us: ; preds = %for.inc63.critedge.us.us, %for.cond15.preheader.us112 %indvars.iv143 = phi i64 [ %indvars.iv.next144, %for.inc63.critedge.us.us ], [ 0, %for.cond15.preheader.us112 ] %arrayidx22.us.us = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %indvars.iv148, i64 %indvars.iv143 %9 = load i8, ptr %arrayidx22.us.us, align 1, !tbaa !11 %cmp24.us.us = icmp eq i8 %9, %6 br i1 %cmp24.us.us, label %for.cond30.preheader.us.us.us, label %for.inc63.critedge.us.us for.inc63.critedge.us.us: ; preds = %for.body33.us.us.us, %for.body18.us.us %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1 %exitcond147.not = icmp eq i64 %indvars.iv.next144, %wide.trip.count151 br i1 %exitcond147.not, label %for.cond15.for.inc70_crit_edge.split.us.us, label %for.body18.us.us, !llvm.loop !12 for.cond30.preheader.us.us.us: ; preds = %for.body18.us.us, %for.cond30.for.inc55_crit_edge.us.us.us %indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.cond30.for.inc55_crit_edge.us.us.us ], [ 0, %for.body18.us.us ] %10 = add nuw nsw i64 %indvars.iv137, %indvars.iv148 br label %for.body33.us.us.us for.cond30.us.us.us: ; preds = %for.body33.us.us.us %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count141 br i1 %exitcond136.not, label %for.cond30.for.inc55_crit_edge.us.us.us, label %for.body33.us.us.us, !llvm.loop !13 for.body33.us.us.us: ; preds = %for.cond30.us.us.us, %for.cond30.preheader.us.us.us %indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.cond30.us.us.us ], [ 0, %for.cond30.preheader.us.us.us ] %11 = add nuw nsw i64 %indvars.iv131, %indvars.iv143 %arrayidx38.us.us.us = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %10, i64 %11 %12 = load i8, ptr %arrayidx38.us.us.us, align 1, !tbaa !11 %arrayidx43.us.us.us = getelementptr inbounds [51 x [51 x i8]], ptr @b, i64 0, i64 %indvars.iv137, i64 %indvars.iv131 %13 = load i8, ptr %arrayidx43.us.us.us, align 1, !tbaa !11 %cmp45.not.us.us.us = icmp eq i8 %12, %13 br i1 %cmp45.not.us.us.us, label %for.cond30.us.us.us, label %for.inc63.critedge.us.us for.cond30.for.inc55_crit_edge.us.us.us: ; preds = %for.cond30.us.us.us %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %exitcond142.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count141 br i1 %exitcond142.not, label %if.end76, label %for.cond30.preheader.us.us.us, !llvm.loop !14 for.cond15.for.inc70_crit_edge.split.us.us: ; preds = %for.inc63.critedge.us.us %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151 br i1 %exitcond152.not, label %if.end76, label %for.cond15.preheader.us112, !llvm.loop !15 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [51 x [51 x i8]], ptr @b, i64 0, i64 %indvars.iv120 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %14 = load i32, ptr %m, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp3 = icmp slt i64 %indvars.iv.next121, %15 br i1 %cmp3, label %for.body4, label %for.cond12.preheader.loopexit, !llvm.loop !16 for.cond15.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.cond15.for.inc70_crit_edge.split %indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.cond15.for.inc70_crit_edge.split ], [ 0, %for.cond15.preheader.lr.ph ] br label %for.body18 for.body18: ; preds = %for.cond15.preheader, %for.inc63.critedge %indvars.iv123 = phi i64 [ 0, %for.cond15.preheader ], [ %indvars.iv.next124, %for.inc63.critedge ] %arrayidx22 = getelementptr inbounds [51 x [51 x i8]], ptr @a, i64 0, i64 %indvars.iv126, i64 %indvars.iv123 %16 = load i8, ptr %arrayidx22, align 1, !tbaa !11 %cmp24 = icmp eq i8 %16, %6 br i1 %cmp24, label %if.end76, label %for.inc63.critedge for.inc63.critedge: ; preds = %for.body18 %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %exitcond.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count151 br i1 %exitcond.not, label %for.cond15.for.inc70_crit_edge.split, label %for.body18, !llvm.loop !12 for.cond15.for.inc70_crit_edge.split: ; preds = %for.inc63.critedge %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1 %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count151 br i1 %exitcond130.not, label %if.end76, label %for.cond15.preheader, !llvm.loop !15 if.end76: ; preds = %for.cond15.for.inc70_crit_edge.split, %for.body18, %for.cond15.for.inc70_crit_edge.split.us.us, %for.cond30.for.inc55_crit_edge.us.us.us, %for.cond12.preheader %str.sink = phi ptr [ @str, %for.cond12.preheader ], [ @str.4, %for.cond30.for.inc55_crit_edge.us.us.us ], [ @str, %for.cond15.for.inc70_crit_edge.split.us.us ], [ @str.4, %for.body18 ], [ @str, %for.cond15.for.inc70_crit_edge.split ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> #include<string.h> int main() { int s,w; scanf("%d %d",&s,&w); if(w>=s) { printf("unsafe"); } else printf("safe"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117558/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117558/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int s,w; scanf("%d",&s); scanf("%d",&w); if(s>w){ printf("safe"); }else{ printf("unsafe"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117600/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117600/source.c" target datalayout = "e-m:e-p270: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"safe\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(a<=b){ printf("unsafe"); } else{ printf("safe"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117644/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117644/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void) { int s,w; scanf("%d %d",&s,&w); if(w >= s){printf("unsafe\n");} else{printf("safe\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117688/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117688/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 S, W; scanf("%d %d", &S, &W); if(S > W) { printf("safe"); }else{ printf("unsafe"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117730/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117730/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W) %0 = load i32, ptr %S, align 4, !tbaa !5 %1 = load i32, ptr %W, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #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 S,W; scanf("%d %d", &S, &W); if( W >= S ){ printf("unsafe"); } else { printf("safe"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117781/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117781/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W) %0 = load i32, ptr %W, align 4, !tbaa !5 %1 = load i32, ptr %S, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main(){ int S,W; scanf("%d %d",&S,&W); if(S<=W){ printf("unsafe"); } else{ printf("safe"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117824/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W) %0 = load i32, ptr %S, align 4, !tbaa !5 %1 = load i32, ptr %W, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #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> void main() { int s, w; scanf("%d %d" , &s, &w); if (s > w) { printf("safe\n"); } else { printf("unsafe\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117875/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"unsafe\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); if(a<=b)printf("unsafe\n"); else printf("safe\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117925/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117925/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int w,s; scanf("%d%d",&s,&w); if(w>=s)printf("unsafe\n"); else printf("safe\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117969/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117969/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"safe\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca i32, align 4 %s = 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 %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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 @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 S; int W; scanf("%d %d",&S,&W); if((1<=S)&&(S<=100)&&(1<=W)&&(W<=100)){ if(W>=S){ printf("unsafe"); }else{ printf("safe"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118010/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118010/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W) %0 = load i32, ptr %S, align 4 %1 = add i32 %0, -1 %or.cond = icmp ult i32 %1, 100 %2 = load i32, ptr %W, align 4 %cmp3 = icmp sgt i32 %2, 0 %or.cond11 = select i1 %or.cond, i1 %cmp3, i1 false %cmp5 = icmp slt i32 %2, 101 %or.cond12 = select i1 %or.cond11, i1 %cmp5, i1 false br i1 %or.cond12, label %if.then, label %if.end10 if.then: ; preds = %entry %cmp6.not = icmp ult i32 %2, %0 %.str.2..str.1 = select i1 %cmp6.not, ptr @.str.2, ptr @.str.1 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) br label %if.end10 if.end10: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include<stdio.h> int main(void){ int s,w; scanf("%d %d",&s,&w); if(s>w){ printf("safe\n"); }else{ printf("unsafe\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118054/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118054/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"unsafe\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 S, W; scanf("%d %d", &S, &W); if(S <= W) { printf("unsafe\n"); } else { printf("safe\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118098/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118098/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W) %0 = load i32, ptr %S, align 4, !tbaa !5 %1 = load i32, ptr %W, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int s,w; scanf("%d %d",&s,&w); if(s<=w){ printf("unsafe"); }else{ printf("safe"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118148/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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 s, w; scanf("%d %d", &s, &w); (s > w) ? printf("safe") : printf("unsafe"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118191/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118191/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); if(a>b) printf("safe"); else printf("unsafe"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118234/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118234/source.c" target datalayout = "e-m:e-p270: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 [5 x i8] c"safe\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int s,w; scanf("%d %d", &s, &w); if(s > w) printf("safe\n"); else printf("unsafe\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118278/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118278/source.c" target datalayout = "e-m:e-p270: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 [7 x i8] c"unsafe\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int s,w; scanf("%d %d", &s,&w); if(w>=s) printf("unsafe"); else printf("safe"); printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118320/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118320/source.c" target datalayout = "e-m:e-p270: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"unsafe\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %cmp.not = icmp slt i32 %0, %1 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) %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 %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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"}
#include<stdio.h> int main(){ int n,i; scanf("%d",&n); long int x,y; scanf("%li%li",&x,&y); long int sum=x+y, dif=x-y, maxsum=sum,minsum=sum,maxdif=dif,mindif=dif; for (i=1;i<n;i++){ scanf("%li%li",&x,&y); sum=x+y; dif=x-y; if (sum>maxsum) maxsum=sum; else if(sum<minsum) minsum = sum; if (dif>maxdif) maxdif=dif; else if(dif<mindif) mindif=dif; } sum=maxsum-minsum; dif=maxdif-mindif; if(sum>dif) printf("%li\n", sum); else printf("%li\n", dif); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118364/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118364/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%li%li\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%li\0A\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 i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i64, ptr %x, align 8, !tbaa !5 %1 = load i64, ptr %y, align 8, !tbaa !5 %add = add nsw i64 %1, %0 %sub = sub nsw i64 %0, %1 %2 = load i32, ptr %n, align 4, !tbaa !9 %cmp44 = icmp sgt i32 %2, 1 br i1 %cmp44, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %mindif.049 = phi i64 [ %mindif.1, %for.body ], [ %sub, %entry ] %maxdif.048 = phi i64 [ %maxdif.1, %for.body ], [ %sub, %entry ] %minsum.047 = phi i64 [ %minsum.1, %for.body ], [ %add, %entry ] %maxsum.046 = phi i64 [ %maxsum.1, %for.body ], [ %add, %entry ] %i.045 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %3 = load i64, ptr %x, align 8, !tbaa !5 %4 = load i64, ptr %y, align 8, !tbaa !5 %add3 = add nsw i64 %4, %3 %sub4 = sub nsw i64 %3, %4 %cmp5 = icmp sgt i64 %add3, %maxsum.046 %spec.select = call i64 @llvm.smin.i64(i64 %add3, i64 %minsum.047) %maxsum.1 = call i64 @llvm.smax.i64(i64 %add3, i64 %maxsum.046) %minsum.1 = select i1 %cmp5, i64 %minsum.047, i64 %spec.select %cmp9 = icmp sgt i64 %sub4, %maxdif.048 %spec.select43 = call i64 @llvm.smin.i64(i64 %sub4, i64 %mindif.049) %maxdif.1 = call i64 @llvm.smax.i64(i64 %sub4, i64 %maxdif.048) %mindif.1 = select i1 %cmp9, i64 %mindif.049, i64 %spec.select43 %inc = add nuw nsw i32 %i.045, 1 %5 = load i32, ptr %n, align 4, !tbaa !9 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %maxsum.0.lcssa = phi i64 [ %add, %entry ], [ %maxsum.1, %for.body ] %minsum.0.lcssa = phi i64 [ %add, %entry ], [ %minsum.1, %for.body ] %maxdif.0.lcssa = phi i64 [ %sub, %entry ], [ %maxdif.1, %for.body ] %mindif.0.lcssa = phi i64 [ %sub, %entry ], [ %mindif.1, %for.body ] %sub16 = sub nsw i64 %maxsum.0.lcssa, %minsum.0.lcssa %sub17 = sub nsw i64 %maxdif.0.lcssa, %mindif.0.lcssa %sub16.sub17 = call i64 @llvm.smax.i64(i64 %sub16, i64 %sub17) %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub16.sub17) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.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"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int N,M,i; scanf("%d %d",&N,&M); int A[N]; int cnt=0; double sum=0.0; for(i=0;i<N;i++){ scanf("%d",&A[i]); sum+=A[i]; } for(i=0;i<N;i++){ if(sum/(4*M)<=A[i])cnt++; } if(cnt>=M)printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118414/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118414/source.c" target datalayout = "e-m:e-p270: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"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %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 %cmp32 = icmp sgt i32 %3, 0 br i1 %cmp32, label %for.body, label %for.cond4.preheader.thread for.cond4.preheader.thread: ; preds = %entry %.pre48 = load i32, ptr %M, align 4, !tbaa !5 br label %for.end17 for.cond4.preheader: ; preds = %for.body %cmp536 = icmp sgt i32 %17, 0 %.pre = load i32, ptr %M, align 4, !tbaa !5 br i1 %cmp536, label %for.body7.lr.ph, label %for.end17 for.body7.lr.ph: ; preds = %for.cond4.preheader %mul = shl nsw i32 %.pre, 2 %conv8 = sitofp i32 %mul to double %div = fdiv double %add, %conv8 %wide.trip.count = zext i32 %17 to i64 %min.iters.check = icmp ult i32 %17, 8 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.body7.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0 %broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> 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 ], [ %12, %vector.body ] %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %4 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load51 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = sitofp <4 x i32> %wide.load to <4 x double> %7 = sitofp <4 x i32> %wide.load51 to <4 x double> %8 = fcmp ole <4 x double> %broadcast.splat, %6 %9 = fcmp ole <4 x double> %broadcast.splat, %7 %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi50, %11 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end17, label %for.body7.preheader for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block %indvars.iv42.ph = phi i64 [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ] %cnt.038.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %15, %middle.block ] br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.034 = phi double [ %add, %for.body ], [ 0.000000e+00, %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) %16 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv = sitofp i32 %16 to double %add = fadd double %sum.034, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body7 ], [ %indvars.iv42.ph, %for.body7.preheader ] %cnt.038 = phi i32 [ %cnt.1, %for.body7 ], [ %cnt.038.ph, %for.body7.preheader ] %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv42 %19 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %conv11 = sitofp i32 %19 to double %cmp12 = fcmp ole double %div, %conv11 %inc14 = zext i1 %cmp12 to i32 %cnt.1 = add nuw nsw i32 %cnt.038, %inc14 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %for.body7, !llvm.loop !14 for.end17: ; preds = %for.body7, %middle.block, %for.cond4.preheader.thread, %for.cond4.preheader %.pre49 = phi i32 [ %.pre, %for.cond4.preheader ], [ %.pre48, %for.cond4.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ] %cnt.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond4.preheader.thread ], [ %15, %middle.block ], [ %cnt.1, %for.body7 ] %cmp18.not = icmp slt i32 %cnt.0.lcssa, %.pre49 %.str.3..str.2 = select i1 %cmp18.not, ptr @.str.3, ptr @.str.2 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <string.h> #include <stdio.h> int main(void){ double n=0; double m=0; double a[1000]; int i; int t=0; double total=0; while(n<1 || n>100){scanf("%lf",&n);} while(m<1 || m>n){scanf("%lf",&m);} for(i=0;i<n;i++){ while(a[i]<1 || a[i]>1000){scanf("%lf",&a[i]);} total=total+a[i]; } for(i=0;i<n;i++){if(a[i]>=total/(4*m))t++;} if(t>=m)printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118458/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118458/source.c" target datalayout = "e-m:e-p270: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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { while.body.preheader: %n = alloca double, align 8 %m = alloca double, align 8 %a = alloca [1000 x double], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 store double 0.000000e+00, ptr %n, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3 store double 0.000000e+00, ptr %m, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #3 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load double, ptr %n, align 8 %cmp = fcmp olt double %0, 1.000000e+00 %cmp1 = fcmp ogt double %0, 1.000000e+02 %1 = or i1 %cmp, %cmp1 br i1 %1, label %while.body, label %while.body7, !llvm.loop !9 for.cond.preheader: ; preds = %while.body7 %cmp1066 = fcmp ogt double %3, 0.000000e+00 br i1 %cmp1066, label %while.cond12.preheader, label %for.cond28.preheader while.body7: ; preds = %while.body, %while.body7 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load double, ptr %m, align 8 %cmp3 = fcmp olt double %2, 1.000000e+00 %3 = load double, ptr %n, align 8 %cmp5 = fcmp ogt double %2, %3 %4 = select i1 %cmp3, i1 true, i1 %cmp5 br i1 %4, label %while.body7, label %for.cond.preheader, !llvm.loop !11 while.cond12.preheader: ; preds = %for.cond.preheader, %while.end25 %5 = phi double [ %8, %while.end25 ], [ %3, %for.cond.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.end25 ], [ 0, %for.cond.preheader ] %total.068 = phi double [ %add, %while.end25 ], [ 0.000000e+00, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv %6 = load double, ptr %arrayidx, align 8, !tbaa !5 %cmp1363 = fcmp olt double %6, 1.000000e+00 %cmp1864 = fcmp ogt double %6, 1.000000e+03 %or.cond65 = or i1 %cmp1363, %cmp1864 br i1 %or.cond65, label %while.body21, label %while.end25 for.cond28.preheader.loopexit: ; preds = %while.end25 %.pre81.pre = load double, ptr %m, align 8, !tbaa !5 br label %for.cond28.preheader for.cond28.preheader: ; preds = %for.cond28.preheader.loopexit, %for.cond.preheader %.pre81 = phi double [ %2, %for.cond.preheader ], [ %.pre81.pre, %for.cond28.preheader.loopexit ] %total.0.lcssa = phi double [ 0.000000e+00, %for.cond.preheader ], [ %add, %for.cond28.preheader.loopexit ] %.lcssa58 = phi double [ %3, %for.cond.preheader ], [ %8, %for.cond28.preheader.loopexit ] %cmp3071 = fcmp ogt double %.lcssa58, 0.000000e+00 br i1 %cmp3071, label %for.body32.lr.ph, label %for.end40 for.body32.lr.ph: ; preds = %for.cond28.preheader %mul = fmul double %.pre81, 4.000000e+00 %div = fdiv double %total.0.lcssa, %mul br label %for.body32 while.body21: ; preds = %while.cond12.preheader, %while.body21 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %7 = load double, ptr %arrayidx, align 8, !tbaa !5 %cmp13 = fcmp olt double %7, 1.000000e+00 %cmp18 = fcmp ogt double %7, 1.000000e+03 %or.cond = or i1 %cmp13, %cmp18 br i1 %or.cond, label %while.body21, label %while.end25.loopexit, !llvm.loop !12 while.end25.loopexit: ; preds = %while.body21 %.pre = load double, ptr %n, align 8, !tbaa !5 br label %while.end25 while.end25: ; preds = %while.end25.loopexit, %while.cond12.preheader %8 = phi double [ %5, %while.cond12.preheader ], [ %.pre, %while.end25.loopexit ] %.lcssa = phi double [ %6, %while.cond12.preheader ], [ %7, %while.end25.loopexit ] %add = fadd double %total.068, %.lcssa %indvars.iv.next = add nuw i64 %indvars.iv, 1 %9 = trunc i64 %indvars.iv.next to i32 %conv = sitofp i32 %9 to double %cmp10 = fcmp ogt double %8, %conv br i1 %cmp10, label %while.cond12.preheader, label %for.cond28.preheader.loopexit, !llvm.loop !13 for.body32: ; preds = %for.body32.lr.ph, %for.body32 %indvars.iv78 = phi i64 [ 0, %for.body32.lr.ph ], [ %indvars.iv.next79, %for.body32 ] %t.073 = phi i32 [ 0, %for.body32.lr.ph ], [ %t.1, %for.body32 ] %arrayidx34 = getelementptr inbounds [1000 x double], ptr %a, i64 0, i64 %indvars.iv78 %10 = load double, ptr %arrayidx34, align 8, !tbaa !5 %cmp35 = fcmp oge double %10, %div %inc37 = zext i1 %cmp35 to i32 %t.1 = add nuw nsw i32 %t.073, %inc37 %indvars.iv.next79 = add nuw i64 %indvars.iv78, 1 %11 = trunc i64 %indvars.iv.next79 to i32 %conv29 = sitofp i32 %11 to double %cmp30 = fcmp ogt double %.lcssa58, %conv29 br i1 %cmp30, label %for.body32, label %for.end40.loopexit, !llvm.loop !14 for.end40.loopexit: ; preds = %for.body32 %12 = sitofp i32 %t.1 to double br label %for.end40 for.end40: ; preds = %for.end40.loopexit, %for.cond28.preheader %t.0.lcssa = phi double [ 0.000000e+00, %for.cond28.preheader ], [ %12, %for.end40.loopexit ] %cmp42 = fcmp ugt double %.pre81, %t.0.lcssa %.str.2..str.1 = select i1 %cmp42, ptr @.str.2, ptr @.str.1 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !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 n,m,i,count=0; double sum=0; scanf("%d %d",&n,&m); int c[n]; for(i=0;i<n;i++){ scanf("%d",&c[i]); sum+=c[i];} for(i=0;i<n;i++){ if(sum/(4*m)<=c[i]) count++; } if(m<=count) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118500/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118500/source.c" target datalayout = "e-m:e-p270: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"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %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 %cmp32 = icmp sgt i32 %3, 0 br i1 %cmp32, label %for.body, label %for.cond4.preheader.thread for.cond4.preheader.thread: ; preds = %entry %.pre48 = load i32, ptr %m, align 4, !tbaa !5 br label %for.end17 for.cond4.preheader: ; preds = %for.body %cmp536 = icmp sgt i32 %17, 0 %.pre = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp536, label %for.body7.lr.ph, label %for.end17 for.body7.lr.ph: ; preds = %for.cond4.preheader %mul = shl nsw i32 %.pre, 2 %conv8 = sitofp i32 %mul to double %div = fdiv double %add, %conv8 %wide.trip.count = zext i32 %17 to i64 %min.iters.check = icmp ult i32 %17, 8 br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph vector.ph: ; preds = %for.body7.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0 %broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> 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 ], [ %12, %vector.body ] %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %4 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load51 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = sitofp <4 x i32> %wide.load to <4 x double> %7 = sitofp <4 x i32> %wide.load51 to <4 x double> %8 = fcmp ole <4 x double> %broadcast.splat, %6 %9 = fcmp ole <4 x double> %broadcast.splat, %7 %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi50, %11 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end17, label %for.body7.preheader for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block %indvars.iv42.ph = phi i64 [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ] %count.037.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %15, %middle.block ] br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.033 = phi double [ %add, %for.body ], [ 0.000000e+00, %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) %16 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv = sitofp i32 %16 to double %add = fadd double %sum.033, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13 for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body7 ], [ %indvars.iv42.ph, %for.body7.preheader ] %count.037 = phi i32 [ %count.1, %for.body7 ], [ %count.037.ph, %for.body7.preheader ] %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv42 %19 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %conv11 = sitofp i32 %19 to double %cmp12 = fcmp ole double %div, %conv11 %inc14 = zext i1 %cmp12 to i32 %count.1 = add nuw nsw i32 %count.037, %inc14 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %for.body7, !llvm.loop !14 for.end17: ; preds = %for.body7, %middle.block, %for.cond4.preheader.thread, %for.cond4.preheader %.pre49 = phi i32 [ %.pre, %for.cond4.preheader ], [ %.pre48, %for.cond4.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ] %count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond4.preheader.thread ], [ %15, %middle.block ], [ %count.1, %for.body7 ] %cmp18.not = icmp sgt i32 %.pre49, %count.0.lcssa %.str.3..str.2 = select i1 %cmp18.not, ptr @.str.3, ptr @.str.2 %call22 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3..str.2) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; 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 @puts(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> #include <stdlib.h> #include <stdbool.h> #include <math.h> #define LINE_BUF_SIZE 1024 int main(void) { int i; int N,M; int A[1000]; int count = 0; int sum = 0; scanf("%d %d",&N,&M); for(i = 0; i < N; i++){ A[i] = 0; } for(i = 0; i < N; i++){ scanf("%d",&A[i]); sum += A[i]; } for(i = 0; i < N; i++){ if(A[i] >= (float)((float)sum/(float)(4*M))){ count++; } } if(count < M){ printf("No"); }else{ printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118544/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118544/source.c" target datalayout = "e-m:e-p270: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 [3 x i8] c"No\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %A = alloca [1000 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 %M) #5 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %A) #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 %cmp42 = icmp sgt i32 %0, 0 br i1 %cmp42, label %for.body3.preheader, label %for.cond12.preheader.thread for.cond12.preheader.thread: ; preds = %entry %.pre61 = load i32, ptr %M, align 4, !tbaa !5 br label %for.end24 for.body3.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 %A, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body3 for.cond12.preheader: ; preds = %for.body3 %cmp1348 = icmp sgt i32 %17, 0 %.pre = load i32, ptr %M, align 4, !tbaa !5 br i1 %cmp1348, label %for.body14.lr.ph, label %for.end24 for.body14.lr.ph: ; preds = %for.cond12.preheader %3 = sitofp i32 %add to float %mul = shl nsw i32 %.pre, 2 %conv18 = sitofp i32 %mul to float %div = fdiv float %3, %conv18 %wide.trip.count = zext i32 %17 to i64 %min.iters.check = icmp ult i32 %17, 8 br i1 %min.iters.check, label %for.body14.preheader, label %vector.ph vector.ph: ; preds = %for.body14.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x float> poison, float %div, i64 0 %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> 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 ], [ %12, %vector.body ] %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %4 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load64 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = sitofp <4 x i32> %wide.load to <4 x float> %7 = sitofp <4 x i32> %wide.load64 to <4 x float> %8 = fcmp ole <4 x float> %broadcast.splat, %6 %9 = fcmp ole <4 x float> %broadcast.splat, %7 %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi63, %11 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end24, label %for.body14.preheader for.body14.preheader: ; preds = %for.body14.lr.ph, %middle.block %indvars.iv55.ph = phi i64 [ 0, %for.body14.lr.ph ], [ %n.vec, %middle.block ] %count.050.ph = phi i32 [ 0, %for.body14.lr.ph ], [ %15, %middle.block ] br label %for.body14 for.body3: ; preds = %for.body3.preheader, %for.body3 %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ] %sum.046 = phi i32 [ 0, %for.body3.preheader ], [ %add, %for.body3 ] %arrayidx5 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %16 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %add = add nsw i32 %16, %sum.046 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp2, label %for.body3, label %for.cond12.preheader, !llvm.loop !13 for.body14: ; preds = %for.body14.preheader, %for.body14 %indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.body14 ], [ %indvars.iv55.ph, %for.body14.preheader ] %count.050 = phi i32 [ %count.1, %for.body14 ], [ %count.050.ph, %for.body14.preheader ] %arrayidx16 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv55 %19 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %conv = sitofp i32 %19 to float %cmp19 = fcmp ole float %div, %conv %inc21 = zext i1 %cmp19 to i32 %count.1 = add nuw nsw i32 %count.050, %inc21 %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count br i1 %exitcond.not, label %for.end24, label %for.body14, !llvm.loop !14 for.end24: ; preds = %for.body14, %middle.block, %for.cond12.preheader.thread, %for.cond12.preheader %.pre62 = phi i32 [ %.pre, %for.cond12.preheader ], [ %.pre61, %for.cond12.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body14 ] %count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond12.preheader.thread ], [ %15, %middle.block ], [ %count.1, %for.body14 ] %cmp25 = icmp slt i32 %count.0.lcssa, %.pre62 %.str.2..str.3 = select i1 %cmp25, ptr @.str.2, ptr @.str.3 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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> #include <stdlib.h> int main(void); char* func(int n, int m, int a[]); char* func(int n, int m, int a[]){ int ii1, count, sum=0; double line; char *s; count = 0; for(ii1=0; ii1<n; ii1++) sum+=a[ii1]; line = (double)sum/(4.0*(double)m); for(ii1=0; ii1<n; ii1++){ if((double)a[ii1] >= line) count++; } if(count >= m) s="Yes"; else s="No"; return s; } int main(void){ int n, m, ii1; scanf("%d %d", &n, &m); int a[n]; char *s; for(ii1=0; ii1<n; ii1++){ scanf("%d", &a[ii1]); } s = func(n, m, a); printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118588/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118588/source.c" target datalayout = "e-m:e-p270: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"Yes\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local nonnull ptr @func(i32 noundef %n, i32 noundef %m, ptr nocapture noundef readonly %a) local_unnamed_addr #0 { entry: %cmp29 = icmp sgt i32 %n, 0 br i1 %cmp29, label %for.body.preheader, label %for.end14 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader67, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ] %vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i32, ptr %a, i64 %index %wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 %wide.load47 = load <4 x i32>, ptr %1, align 4, !tbaa !5 %2 = add <4 x i32> %wide.load, %vec.phi %3 = add <4 x i32> %wide.load47, %vec.phi46 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %3, %2 %5 = tail 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.end, label %for.body.preheader67 for.body.preheader67: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.030.ph = phi i32 [ 0, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader67, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader67 ] %sum.030 = phi i32 [ %add, %for.body ], [ %sum.030.ph, %for.body.preheader67 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %6, %sum.030 %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 !13 for.end: ; preds = %for.body, %middle.block %add.lcssa = phi i32 [ %5, %middle.block ], [ %add, %for.body ] %7 = sitofp i32 %add.lcssa to double %conv1 = sitofp i32 %m to double %mul = fmul double %conv1, 4.000000e+00 %div = fdiv double %7, %mul br i1 %cmp29, label %for.body5.preheader, label %for.end14 for.body5.preheader: ; preds = %for.end %wide.trip.count40 = zext i32 %n to i64 %min.iters.check50 = icmp ult i32 %n, 8 br i1 %min.iters.check50, label %for.body5.preheader65, label %vector.ph51 vector.ph51: ; preds = %for.body5.preheader %n.vec53 = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0 %broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer br label %vector.body56 vector.body56: ; preds = %vector.body56, %vector.ph51 %index57 = phi i64 [ 0, %vector.ph51 ], [ %index.next62, %vector.body56 ] %vec.phi58 = phi <4 x i32> [ zeroinitializer, %vector.ph51 ], [ %16, %vector.body56 ] %vec.phi59 = phi <4 x i32> [ zeroinitializer, %vector.ph51 ], [ %17, %vector.body56 ] %8 = getelementptr inbounds i32, ptr %a, i64 %index57 %wide.load60 = load <4 x i32>, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load61 = load <4 x i32>, ptr %9, align 4, !tbaa !5 %10 = sitofp <4 x i32> %wide.load60 to <4 x double> %11 = sitofp <4 x i32> %wide.load61 to <4 x double> %12 = fcmp ole <4 x double> %broadcast.splat, %10 %13 = fcmp ole <4 x double> %broadcast.splat, %11 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi58, %14 %17 = add <4 x i32> %vec.phi59, %15 %index.next62 = add nuw i64 %index57, 8 %18 = icmp eq i64 %index.next62, %n.vec53 br i1 %18, label %middle.block48, label %vector.body56, !llvm.loop !14 middle.block48: ; preds = %vector.body56 %bin.rdx63 = add <4 x i32> %17, %16 %19 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx63) %cmp.n55 = icmp eq i64 %n.vec53, %wide.trip.count br i1 %cmp.n55, label %for.end14, label %for.body5.preheader65 for.body5.preheader65: ; preds = %for.body5.preheader, %middle.block48 %indvars.iv37.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec53, %middle.block48 ] %count.033.ph = phi i32 [ 0, %for.body5.preheader ], [ %19, %middle.block48 ] br label %for.body5 for.body5: ; preds = %for.body5.preheader65, %for.body5 %indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body5 ], [ %indvars.iv37.ph, %for.body5.preheader65 ] %count.033 = phi i32 [ %count.1, %for.body5 ], [ %count.033.ph, %for.body5.preheader65 ] %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv37 %20 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %conv8 = sitofp i32 %20 to double %cmp9 = fcmp ole double %div, %conv8 %inc11 = zext i1 %cmp9 to i32 %count.1 = add nuw nsw i32 %count.033, %inc11 %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1 %exitcond41.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count40 br i1 %exitcond41.not, label %for.end14, label %for.body5, !llvm.loop !15 for.end14: ; preds = %for.body5, %middle.block48, %entry, %for.end %count.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %entry ], [ %19, %middle.block48 ], [ %count.1, %for.body5 ] %cmp15.not = icmp slt i32 %count.0.lcssa, %m %.str.1..str = select i1 %cmp15.not, ptr @.str.1, ptr @.str ret ptr %.str.1..str } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 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.2, ptr noundef nonnull %n, ptr noundef nonnull %m) %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 %cmp6 = icmp sgt i32 %3, 0 br i1 %cmp6, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry %4 = load i32, ptr %m, align 4, !tbaa !5 br label %func.exit 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.3, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16 for.end: ; preds = %for.body %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp29.i = icmp sgt i32 %5, 0 br i1 %cmp29.i, label %for.body.preheader.i, label %func.exit for.body.preheader.i: ; preds = %for.end %wide.trip.count.i = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %5, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %wide.trip.count.i, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %8 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load13 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = add <4 x i32> %wide.load, %vec.phi %11 = add <4 x i32> %wide.load13, %vec.phi12 %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 !17 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 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.body5.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] %sum.030.i.ph = phi i32 [ 0, %for.body.preheader.i ], [ %13, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %sum.030.i = phi i32 [ %add.i, %for.body.i ], [ %sum.030.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i %14 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %add.i = add nsw i32 %14, %sum.030.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.body5.preheader.i, label %for.body.i, !llvm.loop !18 for.body5.preheader.i: ; preds = %for.body.i, %middle.block %add.i.lcssa = phi i32 [ %13, %middle.block ], [ %add.i, %for.body.i ] %15 = sitofp i32 %add.i.lcssa to double %conv1.i = sitofp i32 %7 to double %mul.i = fmul double %conv1.i, 4.000000e+00 %div.i = fdiv double %15, %mul.i %min.iters.check16 = icmp ult i32 %5, 8 br i1 %min.iters.check16, label %for.body5.i.preheader, label %vector.ph17 vector.ph17: ; preds = %for.body5.preheader.i %n.vec19 = and i64 %wide.trip.count.i, 4294967288 %broadcast.splatinsert = insertelement <4 x double> poison, double %div.i, i64 0 %broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer br label %vector.body22 vector.body22: ; preds = %vector.body22, %vector.ph17 %index23 = phi i64 [ 0, %vector.ph17 ], [ %index.next28, %vector.body22 ] %vec.phi24 = phi <4 x i32> [ zeroinitializer, %vector.ph17 ], [ %24, %vector.body22 ] %vec.phi25 = phi <4 x i32> [ zeroinitializer, %vector.ph17 ], [ %25, %vector.body22 ] %16 = getelementptr inbounds i32, ptr %vla, i64 %index23 %wide.load26 = load <4 x i32>, ptr %16, align 16, !tbaa !5 %17 = getelementptr inbounds i32, ptr %16, i64 4 %wide.load27 = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = sitofp <4 x i32> %wide.load26 to <4 x double> %19 = sitofp <4 x i32> %wide.load27 to <4 x double> %20 = fcmp ole <4 x double> %broadcast.splat, %18 %21 = fcmp ole <4 x double> %broadcast.splat, %19 %22 = zext <4 x i1> %20 to <4 x i32> %23 = zext <4 x i1> %21 to <4 x i32> %24 = add <4 x i32> %vec.phi24, %22 %25 = add <4 x i32> %vec.phi25, %23 %index.next28 = add nuw i64 %index23, 8 %26 = icmp eq i64 %index.next28, %n.vec19 br i1 %26, label %middle.block14, label %vector.body22, !llvm.loop !19 middle.block14: ; preds = %vector.body22 %bin.rdx29 = add <4 x i32> %25, %24 %27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx29) %cmp.n21 = icmp eq i64 %n.vec19, %wide.trip.count.i br i1 %cmp.n21, label %func.exit, label %for.body5.i.preheader for.body5.i.preheader: ; preds = %for.body5.preheader.i, %middle.block14 %indvars.iv37.i.ph = phi i64 [ 0, %for.body5.preheader.i ], [ %n.vec19, %middle.block14 ] %count.033.i.ph = phi i32 [ 0, %for.body5.preheader.i ], [ %27, %middle.block14 ] br label %for.body5.i for.body5.i: ; preds = %for.body5.i.preheader, %for.body5.i %indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %for.body5.i ], [ %indvars.iv37.i.ph, %for.body5.i.preheader ] %count.033.i = phi i32 [ %count.1.i, %for.body5.i ], [ %count.033.i.ph, %for.body5.i.preheader ] %arrayidx7.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv37.i %28 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5 %conv8.i = sitofp i32 %28 to double %cmp9.i = fcmp ole double %div.i, %conv8.i %inc11.i = zext i1 %cmp9.i to i32 %count.1.i = add nuw nsw i32 %count.033.i, %inc11.i %indvars.iv.next38.i = add nuw nsw i64 %indvars.iv37.i, 1 %exitcond41.not.i = icmp eq i64 %indvars.iv.next38.i, %wide.trip.count.i br i1 %exitcond41.not.i, label %func.exit, label %for.body5.i, !llvm.loop !20 func.exit: ; preds = %for.body5.i, %middle.block14, %for.end.thread, %for.end %29 = phi i32 [ %7, %for.end ], [ %4, %for.end.thread ], [ %7, %middle.block14 ], [ %7, %for.body5.i ] %count.0.lcssa.i = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %27, %middle.block14 ], [ %count.1.i, %for.body5.i ] %cmp15.not.i = icmp slt i32 %count.0.lcssa.i, %29 %.str.1..str.i = select i1 %cmp15.not.i, ptr @.str.1, ptr @.str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %.str.1..str.i) call void @llvm.stackrestore.p0(ptr %2) 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 #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree 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 #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 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !11, !12} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include <stdio.h> #include <stdlib.h> #include <math.h> int desc(const void *a,const void *b){ return *(int*)b-*(int*)a; } int main(void){ int n,m,i,sum=0; scanf("%d%d",&n,&m); int a[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); sum+=a[i]; } qsort(a,n,sizeof(int),desc); double v = ceil(sum/(4.0*m)); if(a[m-1]>=v) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118630/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118630/source.c" target datalayout = "e-m:e-p270: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"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { 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 !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 %cmp17 = icmp sgt i32 %3, 0 br i1 %cmp17, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.018 = phi i32 [ %add, %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 %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %sum.018 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %7 = sitofp i32 %add to double br label %for.end for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.end.loopexit ] %sum.0.lcssa = phi double [ 0.000000e+00, %entry.for.end_crit_edge ], [ %7, %for.end.loopexit ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @desc) #7 %8 = load i32, ptr %m, align 4, !tbaa !5 %conv5 = sitofp i32 %8 to double %mul = fmul double %conv5, 4.000000e+00 %div = fdiv double %sum.0.lcssa, %mul %9 = call double @llvm.ceil.f64(double %div) %sub = add nsw i32 %8, -1 %idxprom6 = sext i32 %sub to i64 %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %idxprom6 %10 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %conv8 = sitofp i32 %10 to double %cmp9 = fcmp ugt double %9, %conv8 %.str.3..str.2 = select i1 %cmp9, ptr @.str.3, ptr @.str.2 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2) call void @llvm.stackrestore.p0(ptr %2) 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #6 ; 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: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { long int a, b; long int A[100]; long int sum = 0; long int i; long int check = 0; scanf("%ld %ld", &a, &b); for (i = 0; a > i; i++) { scanf("%ld", &(A[i])); sum = sum + A[i]; } for (i = 0; a > i; i++) { if (sum <= 4 * b * A[i]) { check++; } } if (b > check) { printf("No"); } else { printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118681/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %A = alloca [100 x i64], align 16 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 800, ptr nonnull %A) #3 %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 %cmp26 = icmp sgt i64 %0, 0 br i1 %cmp26, label %for.body, label %for.cond3.preheader.thread for.cond3.preheader.thread: ; preds = %entry %.pre38 = load i64, ptr %b, align 8, !tbaa !5 br label %for.end12 for.cond3.preheader: ; preds = %for.body %cmp430 = icmp sgt i64 %3, 0 %.pre = load i64, ptr %b, align 8, !tbaa !5 br i1 %cmp430, label %for.body5.lr.ph, label %for.end12 for.body5.lr.ph: ; preds = %for.cond3.preheader %mul = shl nsw i64 %.pre, 2 %xtraiter = and i64 %3, 3 %1 = icmp ult i64 %3, 4 br i1 %1, label %for.end12.loopexit.unr-lcssa, label %for.body5.lr.ph.new for.body5.lr.ph.new: ; preds = %for.body5.lr.ph %unroll_iter = and i64 %3, -4 br label %for.body5 for.body: ; preds = %entry, %for.body %i.028 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %sum.027 = phi i64 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %i.028 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %add = add nsw i64 %2, %sum.027 %inc = add nuw nsw i64 %i.028, 1 %3 = load i64, ptr %a, align 8, !tbaa !5 %cmp = icmp sgt i64 %3, %inc br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.body5, %for.body5.lr.ph.new %check.032 = phi i64 [ 0, %for.body5.lr.ph.new ], [ %spec.select.3, %for.body5 ] %i.131 = phi i64 [ 0, %for.body5.lr.ph.new ], [ %inc11.3, %for.body5 ] %niter = phi i64 [ 0, %for.body5.lr.ph.new ], [ %niter.next.3, %for.body5 ] %arrayidx6 = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %i.131 %4 = load i64, ptr %arrayidx6, align 16, !tbaa !5 %mul7 = mul nsw i64 %mul, %4 %cmp8.not = icmp sle i64 %add, %mul7 %inc9 = zext i1 %cmp8.not to i64 %spec.select = add nuw nsw i64 %check.032, %inc9 %inc11 = or i64 %i.131, 1 %arrayidx6.1 = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %inc11 %5 = load i64, ptr %arrayidx6.1, align 8, !tbaa !5 %mul7.1 = mul nsw i64 %mul, %5 %cmp8.not.1 = icmp sle i64 %add, %mul7.1 %inc9.1 = zext i1 %cmp8.not.1 to i64 %spec.select.1 = add nuw nsw i64 %spec.select, %inc9.1 %inc11.1 = or i64 %i.131, 2 %arrayidx6.2 = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %inc11.1 %6 = load i64, ptr %arrayidx6.2, align 16, !tbaa !5 %mul7.2 = mul nsw i64 %mul, %6 %cmp8.not.2 = icmp sle i64 %add, %mul7.2 %inc9.2 = zext i1 %cmp8.not.2 to i64 %spec.select.2 = add nuw nsw i64 %spec.select.1, %inc9.2 %inc11.2 = or i64 %i.131, 3 %arrayidx6.3 = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %inc11.2 %7 = load i64, ptr %arrayidx6.3, align 8, !tbaa !5 %mul7.3 = mul nsw i64 %mul, %7 %cmp8.not.3 = icmp sle i64 %add, %mul7.3 %inc9.3 = zext i1 %cmp8.not.3 to i64 %spec.select.3 = add nuw nsw i64 %spec.select.2, %inc9.3 %inc11.3 = add nuw nsw i64 %i.131, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end12.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11 for.end12.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.lr.ph %spec.select.lcssa.ph = phi i64 [ undef, %for.body5.lr.ph ], [ %spec.select.3, %for.body5 ] %check.032.unr = phi i64 [ 0, %for.body5.lr.ph ], [ %spec.select.3, %for.body5 ] %i.131.unr = phi i64 [ 0, %for.body5.lr.ph ], [ %inc11.3, %for.body5 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end12, label %for.body5.epil for.body5.epil: ; preds = %for.end12.loopexit.unr-lcssa, %for.body5.epil %check.032.epil = phi i64 [ %spec.select.epil, %for.body5.epil ], [ %check.032.unr, %for.end12.loopexit.unr-lcssa ] %i.131.epil = phi i64 [ %inc11.epil, %for.body5.epil ], [ %i.131.unr, %for.end12.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body5.epil ], [ 0, %for.end12.loopexit.unr-lcssa ] %arrayidx6.epil = getelementptr inbounds [100 x i64], ptr %A, i64 0, i64 %i.131.epil %8 = load i64, ptr %arrayidx6.epil, align 8, !tbaa !5 %mul7.epil = mul nsw i64 %mul, %8 %cmp8.not.epil = icmp sle i64 %add, %mul7.epil %inc9.epil = zext i1 %cmp8.not.epil to i64 %spec.select.epil = add nuw nsw i64 %check.032.epil, %inc9.epil %inc11.epil = add nuw nsw i64 %i.131.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.end12, label %for.body5.epil, !llvm.loop !12 for.end12: ; preds = %for.end12.loopexit.unr-lcssa, %for.body5.epil, %for.cond3.preheader.thread, %for.cond3.preheader %.pre39 = phi i64 [ %.pre, %for.cond3.preheader ], [ %.pre38, %for.cond3.preheader.thread ], [ %.pre, %for.body5.epil ], [ %.pre, %for.end12.loopexit.unr-lcssa ] %check.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ 0, %for.cond3.preheader.thread ], [ %spec.select.lcssa.ph, %for.end12.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body5.epil ] %cmp13 = icmp sgt i64 %.pre39, %check.0.lcssa %.str.2..str.3 = select i1 %cmp13, ptr @.str.2, ptr @.str.3 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3) call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %A) #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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main(void) { int N=0, M=0; int vote[100]; scanf("%d%d",&N,&M); int count = 0; int sum = 0; for (int i = 0; i < N; ++i) { scanf("%d",&vote[i]); sum += vote[i]; } for (int i = 0; i < N; ++i){ if (vote[i] >= (double)sum/(4*M)) count++; } if (count >= M) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118724/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118724/source.c" target datalayout = "e-m:e-p270: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"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %vote = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 store i32 0, ptr %N, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4 store i32 0, ptr %M, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vote) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %for.cond5.preheader.thread for.cond5.preheader.thread: ; preds = %entry %.pre48 = load i32, ptr %M, align 4, !tbaa !5 br label %for.cond.cleanup7 for.cond5.preheader: ; preds = %for.body %cmp636 = icmp sgt i32 %15, 0 %.pre = load i32, ptr %M, align 4, !tbaa !5 br i1 %cmp636, label %for.body8.lr.ph, label %for.cond.cleanup7 for.body8.lr.ph: ; preds = %for.cond5.preheader %1 = sitofp i32 %add to double %mul = shl nsw i32 %.pre, 2 %conv12 = sitofp i32 %mul to double %div = fdiv double %1, %conv12 %wide.trip.count = zext i32 %15 to i64 %min.iters.check = icmp ult i32 %15, 8 br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph vector.ph: ; preds = %for.body8.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0 %broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> 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 ], [ %10, %vector.body ] %vec.phi50 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %2 = getelementptr inbounds [100 x i32], ptr %vote, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load51 = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = sitofp <4 x i32> %wide.load to <4 x double> %5 = sitofp <4 x i32> %wide.load51 to <4 x double> %6 = fcmp ole <4 x double> %broadcast.splat, %4 %7 = fcmp ole <4 x double> %broadcast.splat, %5 %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.phi50, %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 !9 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 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block %indvars.iv42.ph = phi i64 [ 0, %for.body8.lr.ph ], [ %n.vec, %middle.block ] %count.037.ph = phi i32 [ 0, %for.body8.lr.ph ], [ %13, %middle.block ] br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.033 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %vote, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %14 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.033 %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.cond5.preheader, !llvm.loop !13 for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond5.preheader.thread, %for.cond5.preheader %.pre49 = phi i32 [ %.pre, %for.cond5.preheader ], [ %.pre48, %for.cond5.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body8 ] %count.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %for.cond5.preheader.thread ], [ %13, %middle.block ], [ %count.1, %for.body8 ] %cmp19.not = icmp slt i32 %count.0.lcssa, %.pre49 %.str.3..str.2 = select i1 %cmp19.not, ptr @.str.3, ptr @.str.2 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vote) #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 ret i32 0 for.body8: ; preds = %for.body8.preheader, %for.body8 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body8 ], [ %indvars.iv42.ph, %for.body8.preheader ] %count.037 = phi i32 [ %count.1, %for.body8 ], [ %count.037.ph, %for.body8.preheader ] %arrayidx10 = getelementptr inbounds [100 x i32], ptr %vote, i64 0, i64 %indvars.iv42 %17 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %conv = sitofp i32 %17 to double %cmp13 = fcmp ole double %div, %conv %inc15 = zext i1 %cmp13 to i32 %count.1 = add nuw nsw i32 %count.037, %inc15 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !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 <math.h> #include <stdio.h> #include <stdlib.h> int comp_int (const void *a, const void *b) { return *(int*)b - *(int*)a; } int main (void) { int i; int n, m; scanf("%d%d", &n, &m); int a[n]; int sum = 0; for ( i=0; i<n; i++ ) { scanf("%d", &a[i]); sum += a[i]; } qsort(a, n, sizeof(int), comp_int); int limits; if ( sum % (m * 4) == 0 ) limits = sum / (m * 4); else limits = ceil((double)sum / (m * 4)); for ( i=0; i<m; i++ ) { if ( a[i] < limits ) { printf("No\n"); return EXIT_SUCCESS; } } printf("Yes\n"); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118768/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8 %call = 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 %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 %cmp42 = icmp sgt i32 %3, 0 br i1 %cmp42, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.044 = phi i32 [ %add, %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 %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %sum.044 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry.for.end_crit_edge ], [ %add, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comp_int) #8 %7 = load i32, ptr %m, align 4, !tbaa !5 %mul = shl nsw i32 %7, 2 %rem = srem i32 %sum.0.lcssa, %mul %div = sdiv i32 %sum.0.lcssa, %mul %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %if.end, label %if.else if.else: ; preds = %for.end %conv7 = sitofp i32 %sum.0.lcssa to double %conv9 = sitofp i32 %mul to double %div10 = fdiv double %conv7, %conv9 %8 = call double @llvm.ceil.f64(double %div10) %conv11 = fptosi double %8 to i32 br label %if.end if.end: ; preds = %for.end, %if.else %limits.0 = phi i32 [ %conv11, %if.else ], [ %div, %for.end ] %cmp1346 = icmp sgt i32 %7, 0 br i1 %cmp1346, label %for.body15.preheader, label %cleanup for.body15.preheader: ; preds = %if.end %wide.trip.count = zext i32 %7 to i64 br label %for.body15 for.cond12: ; preds = %for.body15 %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body15, !llvm.loop !11 for.body15: ; preds = %for.body15.preheader, %for.cond12 %indvars.iv50 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next51, %for.cond12 ] %arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv50 %9 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18 = icmp slt i32 %9, %limits.0 br i1 %cmp18, label %cleanup, label %for.cond12 cleanup: ; preds = %for.cond12, %for.body15, %if.end %str.sink = phi ptr [ @str, %if.end ], [ @str.4, %for.body15 ], [ @str, %for.cond12 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #6 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nofree nounwind } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int i; int a[102]; for (i = 0; i < n; i++) scanf("%d", &a[i]); int sum = 0; for (i = 0; i < n; i++) sum += a[i]; int cnt = 0; for (i = 0; i < n; i++) if (a[i] * 4 * m >= sum) cnt++; if (cnt < m) printf("No\n"); else printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118818/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118818/source.c" target datalayout = "e-m:e-p270: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 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [102 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 %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %a) #5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %0, 0 br i1 %cmp37, label %for.body, label %for.cond10.preheader.thread for.cond2.preheader: ; preds = %for.body %cmp339 = icmp sgt i32 %7, 0 br i1 %cmp339, label %for.body4.preheader, label %for.cond10.preheader.thread for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %7 to i64 %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body4.preheader88, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 %wide.load67 = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = add <4 x i32> %wide.load, %vec.phi %4 = add <4 x i32> %wide.load67, %vec.phi66 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %4, %3 %6 = 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.cond10.preheader, label %for.body4.preheader88 for.body4.preheader88: ; preds = %for.body4.preheader, %middle.block %indvars.iv49.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] %sum.041.ph = phi i32 [ 0, %for.body4.preheader ], [ %6, %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 [102 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.cond10.preheader.thread: ; preds = %for.cond2.preheader, %entry %.pre64 = load i32, ptr %m, align 4, !tbaa !5 br label %for.end20 for.cond10.preheader: ; preds = %for.body4, %middle.block %add.lcssa = phi i32 [ %6, %middle.block ], [ %add, %for.body4 ] %.pre = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp339, label %for.body12.lr.ph, label %for.end20 for.body12.lr.ph: ; preds = %for.cond10.preheader %wide.trip.count55 = zext i32 %7 to i64 %min.iters.check70 = icmp ult i32 %7, 8 br i1 %min.iters.check70, label %for.body12.preheader, label %vector.ph71 vector.ph71: ; preds = %for.body12.lr.ph %n.vec73 = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert82 = insertelement <4 x i32> poison, i32 %add.lcssa, i64 0 %broadcast.splat83 = shufflevector <4 x i32> %broadcast.splatinsert82, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body76 vector.body76: ; preds = %vector.body76, %vector.ph71 %index77 = phi i64 [ 0, %vector.ph71 ], [ %index.next84, %vector.body76 ] %vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph71 ], [ %19, %vector.body76 ] %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph71 ], [ %20, %vector.body76 ] %9 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %index77 %wide.load80 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load81 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = shl nsw <4 x i32> %wide.load80, <i32 2, i32 2, i32 2, i32 2> %12 = shl nsw <4 x i32> %wide.load81, <i32 2, i32 2, i32 2, i32 2> %13 = mul nsw <4 x i32> %11, %broadcast.splat %14 = mul nsw <4 x i32> %12, %broadcast.splat %15 = icmp sge <4 x i32> %13, %broadcast.splat83 %16 = icmp sge <4 x i32> %14, %broadcast.splat83 %17 = zext <4 x i1> %15 to <4 x i32> %18 = zext <4 x i1> %16 to <4 x i32> %19 = add <4 x i32> %vec.phi78, %17 %20 = add <4 x i32> %vec.phi79, %18 %index.next84 = add nuw i64 %index77, 8 %21 = icmp eq i64 %index.next84, %n.vec73 br i1 %21, label %middle.block68, label %vector.body76, !llvm.loop !14 middle.block68: ; preds = %vector.body76 %bin.rdx85 = add <4 x i32> %20, %19 %22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx85) %cmp.n75 = icmp eq i64 %n.vec73, %wide.trip.count br i1 %cmp.n75, label %for.end20, label %for.body12.preheader for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block68 %indvars.iv52.ph = phi i64 [ 0, %for.body12.lr.ph ], [ %n.vec73, %middle.block68 ] %cnt.045.ph = phi i32 [ 0, %for.body12.lr.ph ], [ %22, %middle.block68 ] br label %for.body12 for.body4: ; preds = %for.body4.preheader88, %for.body4 %indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body4 ], [ %indvars.iv49.ph, %for.body4.preheader88 ] %sum.041 = phi i32 [ %add, %for.body4 ], [ %sum.041.ph, %for.body4.preheader88 ] %arrayidx6 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv49 %23 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %23, %sum.041 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %exitcond.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count br i1 %exitcond.not, label %for.cond10.preheader, label %for.body4, !llvm.loop !15 for.body12: ; preds = %for.body12.preheader, %for.body12 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body12 ], [ %indvars.iv52.ph, %for.body12.preheader ] %cnt.045 = phi i32 [ %spec.select, %for.body12 ], [ %cnt.045.ph, %for.body12.preheader ] %arrayidx14 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv52 %24 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %mul = shl nsw i32 %24, 2 %mul15 = mul nsw i32 %mul, %.pre %cmp16.not = icmp sge i32 %mul15, %add.lcssa %inc17 = zext i1 %cmp16.not to i32 %spec.select = add nuw nsw i32 %cnt.045, %inc17 %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count55 br i1 %exitcond56.not, label %for.end20, label %for.body12, !llvm.loop !16 for.end20: ; preds = %for.body12, %middle.block68, %for.cond10.preheader.thread, %for.cond10.preheader %.pre65 = phi i32 [ %.pre, %for.cond10.preheader ], [ %.pre64, %for.cond10.preheader.thread ], [ %.pre, %middle.block68 ], [ %.pre, %for.body12 ] %cnt.0.lcssa = phi i32 [ 0, %for.cond10.preheader ], [ 0, %for.cond10.preheader.thread ], [ %22, %middle.block68 ], [ %spec.select, %for.body12 ] %cmp21 = icmp slt i32 %cnt.0.lcssa, %.pre65 %str.4.str = select i1 %cmp21, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree 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 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 = { nofree nounwind } 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, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10, !12, !11}
#pragma region kyopuro_templates #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> #include<time.h> #include<ctype.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<62) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 20) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } ll digits(ll a, ll b){return a/b?1+digits(a/b,b):1;} ll base(ll n, ll a, ll i){return i==1?n%a:base(n/a,a,i-1);} ll is_inArr1(ll x, ll n){ return ( x<0 || x>=n ) ? 0 : 1 ; } ll is_inArr2(ll y, ll x, ll h, ll w){ return ( y<0 || y>=h || x<0 || x>=w ) ? 0 : 1 ; } void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } ll *factors[2] , fac_cnt=0 , is_factor_prepared=0; ll factor_pre(){ rep(i,0,1){ if(is_factor_prepared++) return 0; } ll tmp=(1e6)/2+1, fac_tmp[tmp]; rep(i,0,tmp){fac_tmp[i]=i?2*i+1:2;} rep(i,1,tmp){if(fac_tmp[i]){ repp(j,3,tmp/(2*i+1)+1,2 ){ if( j*(2*i+1)<tmp ) fac_tmp[ (j*(2*i+1)-1)/2 ]=0; } }else continue;} rep(i,0,tmp){if(fac_tmp[i]){ rep(j,0,2){ factors[j] = realloc( factors[j] , sizeof(ll)*( fac_cnt +1 ) ); factors[j][j?fac_cnt++:fac_cnt]=j?0:fac_tmp[i]; } } } return 0; } ll factor(ll n, ll new_common_plus){ factor_pre(); rep(i,0,fac_cnt){ ll cnt=0; rep(j,0,1){ while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue; } factors[1][i]= new_common_plus==1 ? cnt : new_common_plus==2 ? max2(factors[1][i],cnt) : factors[1][i]+cnt ; if( factors[0][i]> n ) break; } return n; } ll judge_prime(ll n){ factor_pre(); rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; } ll *mf_arr,*inv_arr,*finv_arr,is_minv_made=0,is_mf_made=0,num_of_inv=2*1e6+10; ll makeinv(ll n , ll mod){ rep(i,0,1){if(is_minv_made++) return 0;} inv_arr = realloc(inv_arr, sizeof(ll)*2 ); finv_arr = realloc(finv_arr, sizeof(ll)*2 ); inv_arr[1]=1;finv_arr[0]=finv_arr[1]=1; rep(i,2,n+1){ inv_arr = realloc(inv_arr, sizeof(ll)*(i+1) ); finv_arr = realloc(finv_arr, sizeof(ll)*(i+1) ); inv_arr[i]= mod - inv_arr[mod%i] * (mod / i) % mod; finv_arr[i] = finv_arr[i - 1] * inv_arr[i] % mod; } return 0; } ll make_mf(ll n, ll mod){ rep(i,0,1){ if(is_mf_made++) return 0; } mf_arr = realloc(mf_arr, sizeof(ll)*2 ); ll x=1; mf_arr[0]=mf_arr[1]=x; rep(i,2,n+1){ x=x*i%mod; mf_arr = realloc(mf_arr, sizeof(ll)*(i+1) ); mf_arr[i]=x; } return 0; } ll m_inv(ll x, ll mod, ll is_fac ){ makeinv(num_of_inv,mod); return is_fac?finv_arr[x]:inv_arr[x]; } ll m_f(ll x, ll mod){ make_mf(num_of_inv,mod); return mf_arr[x]; } ll mod_nck(ll n, ll k, ll mod){ return m_f(n,mod)*m_inv(k,mod,1)%mod*m_inv(n-k,mod,1)%mod; } ll m_p(ll r,ll n,ll mod){ ll t=1,s=r; while(n>0){ t = (n&1) ? t*s%mod : t; s=s*s%mod; n>>=1; } return r?t:0; } ll m_mul2(ll a, ll b, ll mod){ return a*b%mod; } ll m_mul3(ll a, ll b, ll c, ll mod){ return m_mul2(a*b%mod,c,mod); } ll m_mul4(ll a, ll b, ll c, ll d, ll mod){ return m_mul3(a*b%mod,c,d,mod); } ll m_mul5(ll a, ll b, ll c, ll d, ll e, ll mod){ return m_mul4(a*b%mod,c,d,e,mod); } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} #pragma region AVL /*---------------------------AVL start--------------------------------*/ //https://qiita.com/mikecat_mixc/items/e9f8248de2ae7f7a0a29 typedef struct node_AVL_set{ ll val; int diff; int cnt; struct node_AVL_set *child[2]; }AVL_set; void AVL_set_inside_rotate(AVL_set **node, int is_right){ int l = is_right==false , r = is_right==true , sign = is_right ? 1 : -1; if((*node)->child[l] != NULL){ AVL_set* left = (*node)->child[l]; int a= (*node)->diff * sign , b= left->diff * sign ,na,nb; if(b+1){ na=a-1-b; nb= (a-b) ? b-1 : a-2; }else{ na=a-1; nb= a ? b-1 : a+b-2; } (*node)->diff = na * sign; left->diff = nb * sign; /* rotate-> */ (*node)->child[l] = (*node)->child[l]->child[r]; left->child[r] = *node; *node = left; } } int AVL_set_inside_update(AVL_set **node, ll data, int add){ if(*node == NULL){ if(add==2){ *node = malloc(sizeof(AVL_set)); (*node)->val = data; (*node)->cnt = 1; (*node)->diff = 0; (*node)->child[0] = NULL; (*node)->child[1] = NULL; } return add==2 ? *node != NULL : 0; }else{ int l, delta, delta_sign; AVL_set *next_node; if(data == (*node)->val){ if(add==2){ (*node)->cnt++; return 0; }else{ if( add && (*node)->cnt > 1 ){ (*node)->cnt--; return 0; }else{ if((*node)->child[1] == NULL){ next_node = (*node)->child[0]; free(*node); *node = next_node; return -1; }else if((*node)->child[0] == NULL){ next_node = (*node)->child[1]; free(*node); *node = next_node; return -1; }else{ for(next_node = (*node)->child[0]; next_node->child[1] != NULL; next_node = next_node->child[1]); (*node)->val = next_node->val; l=0; delta_sign=1; delta = AVL_set_inside_update(&(*node)->child[l], next_node->val, add); } } } }else{ l = data >= (*node)->val ? 1 : 0; delta_sign = data < (*node)->val ? 1 : -1; delta = AVL_set_inside_update(&(*node)->child[l], data, add); } if( delta ){ int orig_diff = (*node)->diff; int do_rotate = 0, rotate_l , diff_sign , rotate_right; (*node)->diff += delta * delta_sign; if((*node)->diff > 1){ do_rotate = 1; rotate_l = 0; diff_sign = 1; rotate_right = 1; }else if((*node)->diff < -1){ do_rotate = 1; rotate_l = 1; diff_sign = -1; rotate_right = 0; } if(do_rotate){ int child_diff = (*node)->child[rotate_l]->diff; if((*node)->child[rotate_l]->diff * diff_sign < 0){ AVL_set_inside_rotate(&(*node)->child[rotate_l], !rotate_right); } AVL_set_inside_rotate(node, rotate_right); return delta < 0 && child_diff != 0 ? -1 : 0; } if (delta > 0 && orig_diff == 0) return 1; else if(delta < 0 && orig_diff != 0) return -1; else return 0; }else{ return 0; } } } void AVL_set_inside_print(const AVL_set *node, int depth){ if(node == NULL) return; AVL_set_inside_print(node->child[1], depth + 1); printf("%lld %d\n", node->val,node->cnt); AVL_set_inside_print(node->child[0], depth + 1); } void AVL_set_inside_free(AVL_set *node){ if(node == NULL) return; AVL_set_inside_free(node->child[0]); AVL_set_inside_free(node->child[1]); free(node); } ll AVL_set_inside_count(AVL_set *root, ll val){ AVL_set *node; node = root; while(node){ if (val < node->val) node = node->child[0]; else if(val > node->val) node = node->child[1]; else return node->cnt; } return 0; } ll AVL_set_inside_minmax(AVL_set *root, int type){ while(root->child[type] !=NULL) root= root->child[type]; return root->val; } void AVL_set_inside_swap(AVL_set **node1, AVL_set **node2){ AVL_set *tmp; tmp=*node1; *node1=*node2; *node2=tmp; } #define set_MAX_SIZE 514511 ll set_main( int command , int set_num , ll val ){ static bool set_is_init=false; static AVL_set *set_pointer[set_MAX_SIZE]; static ll set_siz[set_MAX_SIZE]; if(!set_is_init){ set_is_init=true; rep(i,0,set_MAX_SIZE){ *(set_pointer+i) = NULL; set_siz[i]=0; } } if(command==-1){ AVL_set_inside_print( set_pointer[set_num] ,0); } if(command==1){ AVL_set_inside_count(set_pointer[set_num],val) ? 1 : set_siz[set_num]++; AVL_set_inside_update( &set_pointer[set_num] , val , 2 ); } if(command==2){ return AVL_set_inside_count(set_pointer[set_num],val); } if(command==3){ ( AVL_set_inside_count(set_pointer[set_num],val) > 1 ) ? 1 : set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val,1); } if(command==4){ set_siz[set_num]--; AVL_set_inside_update( &set_pointer[set_num] , val , 0 ); } if(command==5){ set_siz[set_num]=0; AVL_set_inside_free( set_pointer[set_num] ); set_pointer[set_num] = NULL; } if(command==6){ return set_siz[set_num]; } if(command==7){ return AVL_set_inside_minmax(set_pointer[set_num],1); } if(command==8){ return AVL_set_inside_minmax(set_pointer[set_num],0); } if(command==9){ AVL_set_inside_swap(&set_pointer[set_num],&set_pointer[val]); } return 0; } void set_print(int set_num){ set_main(-1,set_num,0); } void set_insert(int set_num, ll val){ set_main(1,set_num,val); } ll set_count(int set_num, ll val){ return set_main(2,set_num,val); } void set_erase(int set_num, ll val, int is_all){ if(is_all) set_main(4,set_num,val); else set_main(3,set_num,val); } void set_clear(int set_num){ set_main(5,set_num,0); } ll set_size(int set_num){ return set_main(6,set_num,0); } ll set_max(int set_num){ return set_main(7,set_num,0); } ll set_min(int set_num){ return set_main(8,set_num,0); } void set_swap(ll set_num1, ll set_num2){ set_main(9,set_num1,set_num2); } /* insert * size * clear * erase * count * max * min * swap * begin end merge source の要素のキーと等価なキーの要素がある場合、その要素は source から抽出されない lower_bound upper_bound */ // ll map_main() /*---------------------------AVL start--------------------------------*/ #pragma endregion AVL #pragma endregion kyopuro_templates // int ed_cnt[514315]; // ll* gr[514315]; // ll* ed_num[514315]; // // ll ans[514315]; // // freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee!!!!!!!!!!!!!!! // void pushGraph(ll v1, ll v2, ll weight, ll num , ll is_dir){ // gr[v1] = realloc( gr[v1] , sizeof(ll)*(ed_cnt[v1]*2+2) ); // gr[v1][ed_cnt[v1]*2] = v2; // gr[v1][ed_cnt[v1]*2+1] = weight; // ed_num[v1] = realloc( ed_num[v1] , sizeof(ll)*(ed_cnt[v1]+1) ); // ed_num[v1][ed_cnt[v1]] = num; // ed_cnt[v1]++; // if(!is_dir){ // gr[v2] = realloc( gr[v2] , sizeof(ll)*(ed_cnt[v2]*2+2) ); // gr[v2][ed_cnt[v2]*2] = v1; // gr[v2][ed_cnt[v2]*2+1] = weight; // ed_num[v2] = realloc( ed_num[v2] , sizeof(ll)*(ed_cnt[v2]+1) ); // ed_num[v2][ed_cnt[v2]] = num; // ed_cnt[v2]++; // } // } /*---------------Bellman_Ford start--------------------------------------------------------*/ ll ans[2141]; typedef struct{ ll from , to , cost; } graph_info; graph_info edge[11511]; //https://qiita.com/wakimiko/items/69b86627bea0e8fe29d5 int Bellman_Ford(ll start, ll vertex , ll edges){ rep(i,0,vertex) ans[i]=INF; ll cnt=0,update=1; ans[start] = 0; while(update){ update = 0; if(cnt++>vertex) return 0; rep(i,0,edges){ if( ans[edge[i].from]!=INF && ans[ edge[i].to ] > ans[edge[i].from] + edge[i].cost ){ update=1; ans[ edge[i].to ] = ans[edge[i].from] + edge[i].cost; } } } return 1; } /*--------------------------Bellman_Ford end------------------------------------------------------------------*/ // char s[1151154]; void solve(){ // fgets(s,sizeof(s),stdin); ll v,e; // ll ans=0; cin(&v); cin(&e); // scanf("%s",s); ll s,t,d; // ll [n]; rep(i,0,e){ cin(&s); cin(&t); cin(&d); // pushGraph(s,t,d,1,1); edge[i].cost=d; edge[i].from=s; edge[i].to=t; } rep(i,0,v){ if( Bellman_Ford(i,v,e) ){ rep(j,0,v){ if(j) printf(" "); if(ans[j]>1e15){ printf("INF"); }else{ printf("%lld",ans[j]); } }PN; }else{ printf("NEGATIVE CYCLE\n"); return; } } } int main(void){ ll T=1; // cin(&T); rep(i,0,T){ solve(); } return 0; } /* while (ng + 1 < ok) { int p = ng + (ok - ng) / 2; int cnt = 0; for (i = 0; i < n; i++) { cnt += (a[i] + p - 1) / p - 1; } if (cnt <= k) ok = p; else ng = p; } */ // 10^18 2^60 3^38 5^26
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118869/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118869/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.graph_info = type { i64, i64, i64 } %struct.node_AVL_set = type { i64, i32, i32, [2 x ptr] } @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @fac_cnt = dso_local local_unnamed_addr global i64 0, align 8 @is_factor_prepared = dso_local local_unnamed_addr global i64 0, align 8 @factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16 @is_minv_made = dso_local local_unnamed_addr global i64 0, align 8 @is_mf_made = dso_local local_unnamed_addr global i64 0, align 8 @num_of_inv = dso_local local_unnamed_addr global i64 2000010, align 8 @inv_arr = dso_local local_unnamed_addr global ptr null, align 8 @finv_arr = dso_local local_unnamed_addr global ptr null, align 8 @mf_arr = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld %d\0A\00", align 1 @set_main.set_is_init = internal unnamed_addr global i1 false, align 1 @set_main.set_pointer = internal global [514511 x ptr] zeroinitializer, align 16 @set_main.set_siz = internal unnamed_addr global [514511 x i64] zeroinitializer, align 16 @ans = dso_local local_unnamed_addr global [2141 x i64] zeroinitializer, align 16 @edge = dso_local local_unnamed_addr global [11511 x %struct.graph_info] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [4 x i8] c"INF\00", align 1 @str = private unnamed_addr constant [15 x i8] c"NEGATIVE CYCLE\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 4611686018427387904, i64 4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ 4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -4611686018427387904, i64 -4611686018427387904>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ -4611686018427387904, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -4611686018427387904, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #6 { entry: %cmp4 = fcmp ogt double %b, 0.000000e+00 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ] ret double %c.0.lcssa for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ] %mul = fmul double %c.05, %a %inc = add nuw nsw i64 %i.06, 1 %conv = sitofp i64 %inc to double %cmp = fcmp olt double %conv, %b br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %POW.exit, label %for.body.i.epil, !llvm.loop !20 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !21 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @digits(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i64 [ 0, %entry ], [ %add, %tailrecurse ] %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse ] %div = sdiv i64 %a.tr, %b %tobool.not = icmp eq i64 %div, 0 %add = add nuw nsw i64 %accumulator.tr, 1 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i64 %add } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @base(i64 noundef %n, i64 noundef %a, i64 noundef %i) local_unnamed_addr #6 { entry: %cmp5 = icmp eq i64 %i, 1 br i1 %cmp5, label %cond.true, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %i, 3 %1 = add i64 %i, -2 %xtraiter = and i64 %0, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cond.false.prol.loopexit, label %cond.false.prol cond.false.prol: ; preds = %cond.false.preheader, %cond.false.prol %i.tr7.prol = phi i64 [ %sub.prol, %cond.false.prol ], [ %i, %cond.false.preheader ] %n.tr6.prol = phi i64 [ %div.prol, %cond.false.prol ], [ %n, %cond.false.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %cond.false.prol ], [ 0, %cond.false.preheader ] %div.prol = sdiv i64 %n.tr6.prol, %a %sub.prol = add nsw i64 %i.tr7.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %cond.false.prol.loopexit, label %cond.false.prol, !llvm.loop !22 cond.false.prol.loopexit: ; preds = %cond.false.prol, %cond.false.preheader %div.lcssa.unr = phi i64 [ undef, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %i.tr7.unr = phi i64 [ %i, %cond.false.preheader ], [ %sub.prol, %cond.false.prol ] %n.tr6.unr = phi i64 [ %n, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %2 = icmp ult i64 %1, 3 br i1 %2, label %cond.true, label %cond.false cond.true: ; preds = %cond.false.prol.loopexit, %cond.false, %entry %n.tr.lcssa = phi i64 [ %n, %entry ], [ %div.lcssa.unr, %cond.false.prol.loopexit ], [ %div.3, %cond.false ] %rem = srem i64 %n.tr.lcssa, %a ret i64 %rem cond.false: ; preds = %cond.false.prol.loopexit, %cond.false %i.tr7 = phi i64 [ %sub.3, %cond.false ], [ %i.tr7.unr, %cond.false.prol.loopexit ] %n.tr6 = phi i64 [ %div.3, %cond.false ], [ %n.tr6.unr, %cond.false.prol.loopexit ] %div = sdiv i64 %n.tr6, %a %div.1 = sdiv i64 %div, %a %div.2 = sdiv i64 %div.1, %a %div.3 = sdiv i64 %div.2, %a %sub.3 = add nsw i64 %i.tr7, -4 %cmp.3 = icmp eq i64 %sub.3, 1 br i1 %cmp.3, label %cond.true, label %cond.false } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr1(i64 noundef %x, i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp sgt i64 %x, -1 %cmp1 = icmp slt i64 %x, %n %.not = and i1 %cmp, %cmp1 %conv = zext i1 %.not to i64 ret i64 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @is_inArr2(i64 noundef %y, i64 noundef %x, i64 noundef %h, i64 noundef %w) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %y, 0 br i1 %cmp, label %lor.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp1 = icmp sge i64 %y, %h %cmp3 = icmp slt i64 %x, 0 %or.cond = or i1 %cmp3, %cmp1 br i1 %or.cond, label %lor.end, label %lor.rhs lor.rhs: ; preds = %lor.lhs.false %cmp4 = icmp slt i64 %x, %w %0 = zext i1 %cmp4 to i64 br label %lor.end lor.end: ; preds = %lor.rhs, %lor.lhs.false, %entry %not. = phi i64 [ 0, %lor.lhs.false ], [ 0, %entry ], [ %0, %lor.rhs ] ret i64 %not. } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !25 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !26 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !25 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !26 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @factor_pre() local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_factor_prepared, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_factor_prepared, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.body6.peel.next, label %return for.body6.peel.next: ; preds = %entry %1 = tail call ptr @llvm.stacksave.p0() %vla116 = alloca [500001 x i64], align 16 store i64 2, ptr %vla116, align 16, !tbaa !5 br label %vector.body vector.body: ; preds = %vector.body, %for.body6.peel.next %index = phi i64 [ 0, %for.body6.peel.next ], [ %index.next.1, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 1, i64 2>, %for.body6.peel.next ], [ %vec.ind.next.1, %vector.body ] %offset.idx = or i64 %index, 1 %2 = shl nuw nsw <2 x i64> %vec.ind, <i64 1, i64 1> %step.add = shl <2 x i64> %vec.ind, <i64 1, i64 1> %3 = or <2 x i64> %2, <i64 1, i64 1> %4 = add <2 x i64> %step.add, <i64 5, i64 5> %5 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx store <2 x i64> %3, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds i64, ptr %5, i64 2 store <2 x i64> %4, ptr %6, align 8, !tbaa !5 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %offset.idx.1 = or i64 %index, 5 %7 = shl nuw nsw <2 x i64> %vec.ind.next, <i64 1, i64 1> %step.add.1 = shl <2 x i64> %vec.ind.next, <i64 1, i64 1> %8 = or <2 x i64> %7, <i64 1, i64 1> %9 = add <2 x i64> %step.add.1, <i64 5, i64 5> %10 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx.1 store <2 x i64> %8, ptr %10, align 8, !tbaa !5 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> %9, ptr %11, align 8, !tbaa !5 %index.next.1 = add nuw nsw i64 %index, 8 %vec.ind.next.1 = add <2 x i64> %vec.ind, <i64 8, i64 8> %12 = icmp eq i64 %index.next.1, 500000 br i1 %12, label %for.body16, label %vector.body, !llvm.loop !27 for.body16: ; preds = %vector.body, %for.inc43 %i12.0124 = phi i64 [ %inc44, %for.inc43 ], [ 1, %vector.body ] %arrayidx17 = getelementptr inbounds i64, ptr %vla116, i64 %i12.0124 %13 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %tobool18.not = icmp eq i64 %13, 0 br i1 %tobool18.not, label %for.inc43, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body16 %mul21 = shl nuw nsw i64 %i12.0124, 1 %add22 = or i64 %mul21, 1 %div = udiv i64 500001, %add22 %cmp24.not122 = icmp ugt i64 %add22, 166667 br i1 %cmp24.not122, label %for.inc43, label %for.body26 for.body26: ; preds = %for.cond20.preheader, %for.inc38 %j.0123 = phi i64 [ %add39, %for.inc38 ], [ 3, %for.cond20.preheader ] %mul29 = mul nuw nsw i64 %j.0123, %add22 %cmp30 = icmp ult i64 %mul29, 500001 br i1 %cmp30, label %if.then31, label %for.inc38 if.then31: ; preds = %for.body26 %14 = trunc i64 %mul29 to i32 %div35.lhs.trunc = add nsw i32 %14, -1 %div35120 = sdiv i32 %div35.lhs.trunc, 2 %div35.sext = zext i32 %div35120 to i64 %arrayidx36 = getelementptr inbounds i64, ptr %vla116, i64 %div35.sext store i64 0, ptr %arrayidx36, align 8, !tbaa !5 br label %for.inc38 for.inc38: ; preds = %for.body26, %if.then31 %add39 = add nuw nsw i64 %j.0123, 2 %cmp24.not = icmp ugt i64 %add39, %div br i1 %cmp24.not, label %for.inc43, label %for.body26, !llvm.loop !29 for.inc43: ; preds = %for.inc38, %for.cond20.preheader, %for.body16 %inc44 = add nuw nsw i64 %i12.0124, 1 %exitcond128.not = icmp eq i64 %inc44, 500001 br i1 %exitcond128.not, label %for.body51, label %for.body16, !llvm.loop !30 for.cond.cleanup50: ; preds = %for.inc83 tail call void @llvm.stackrestore.p0(ptr %1) br label %return for.body51: ; preds = %for.inc43, %for.inc83 %i47.0126 = phi i64 [ %inc84, %for.inc83 ], [ 0, %for.inc43 ] %arrayidx52 = getelementptr inbounds i64, ptr %vla116, i64 %i47.0126 %15 = load i64, ptr %arrayidx52, align 8, !tbaa !5 %tobool53.not = icmp eq i64 %15, 0 br i1 %tobool53.not, label %for.inc83, label %cond.end75.1 cond.end75.1: ; preds = %for.body51 %16 = load ptr, ptr @factors, align 16, !tbaa !31 %17 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %add61 = shl i64 %17, 3 %mul62 = add i64 %add61, 8 %call = tail call ptr @realloc(ptr noundef %16, i64 noundef %mul62) #28 store ptr %call, ptr @factors, align 16, !tbaa !31 %18 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77 = getelementptr inbounds i64, ptr %call, i64 %18 store i64 %15, ptr %arrayidx77, align 8, !tbaa !5 %19 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %add61.1 = shl i64 %18, 3 %mul62.1 = add i64 %add61.1, 8 %call.1 = tail call ptr @realloc(ptr noundef %19, i64 noundef %mul62.1) #28 store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %20 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc73.1 = add nsw i64 %20, 1 store i64 %inc73.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77.1 = getelementptr inbounds i64, ptr %call.1, i64 %20 store i64 0, ptr %arrayidx77.1, align 8, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %cond.end75.1, %for.body51 %inc84 = add nuw nsw i64 %i47.0126, 1 %exitcond129.not = icmp eq i64 %inc84, 500001 br i1 %exitcond129.not, label %for.cond.cleanup50, label %for.body51, !llvm.loop !33 return: ; preds = %entry, %for.cond.cleanup50 ret i64 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #11 ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #12 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #11 ; Function Attrs: nounwind uwtable define dso_local i64 @factor(i64 noundef %n, i64 noundef %new_common_plus) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp52 = icmp sgt i64 %0, 0 br i1 %cmp52, label %for.cond1.preheader.lr.ph, label %cleanup30 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8 br label %for.cond1.preheader for.cond: ; preds = %cond.end22 %inc29 = add nuw nsw i64 %i.054, 1 %3 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp = icmp slt i64 %inc29, %3 br i1 %cmp, label %for.cond1.preheader, label %cleanup30, !llvm.loop !34 for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond %i.054 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %inc29, %for.cond ] %n.addr.053 = phi i64 [ %n, %for.cond1.preheader.lr.ph ], [ %n.addr.3, %for.cond ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.054 %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %for.cond1.preheader, %land.rhs %n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.053, %for.cond1.preheader ] %cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ] %rem = srem i64 %n.addr.2, %4 %div = sdiv i64 %n.addr.2, %4 %cmp5 = icmp eq i64 %rem, 0 %conv = zext i1 %cmp5 to i64 %add = add nuw nsw i64 %cnt.1, %conv %tobool.not = icmp eq i64 %add, 0 br i1 %tobool.not, label %for.inc, label %land.rhs land.rhs: ; preds = %while.cond %rem8 = srem i64 %div, %4 %cmp9 = icmp eq i64 %rem8, 0 br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !35 for.inc: ; preds = %land.rhs, %while.cond %n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ] switch i64 %new_common_plus, label %cond.false18 [ i64 1, label %cond.end22 i64 2, label %cond.true15 ] cond.true15: ; preds = %for.inc %arrayidx16 = getelementptr inbounds i64, ptr %2, i64 %i.054 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %5, i64 %add) br label %cond.end22 cond.false18: ; preds = %for.inc %arrayidx19 = getelementptr inbounds i64, ptr %2, i64 %i.054 %6 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add20 = add nsw i64 %6, %add br label %cond.end22 cond.end22: ; preds = %for.inc, %cond.true15, %cond.false18 %cond23 = phi i64 [ %cond.i, %cond.true15 ], [ %add20, %cond.false18 ], [ %add, %for.inc ] %arrayidx24 = getelementptr inbounds i64, ptr %2, i64 %i.054 store i64 %cond23, ptr %arrayidx24, align 8, !tbaa !5 %7 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp26.not = icmp sgt i64 %7, %n.addr.3 br i1 %cmp26.not, label %cleanup30, label %for.cond cleanup30: ; preds = %cond.end22, %for.cond, %entry %n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3, %for.cond ], [ %n.addr.3, %cond.end22 ] ret i64 %n.addr.4 } ; Function Attrs: nounwind uwtable define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %0, 0 br i1 %cmp20, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.else %i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ] %n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %2, %2 %cmp2 = icmp slt i64 %n.addr.021, %mul %cmp4 = icmp eq i64 %n.addr.021, %2 %or.cond = or i1 %cmp4, %cmp2 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %for.body %rem = srem i64 %n.addr.021, %2 %cmp6 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021 %inc = add nuw nsw i64 %i.022, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !36 cleanup: ; preds = %if.else, %for.body, %entry %n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ] %cmp9 = icmp ne i64 %n.addr.0.lcssa, 1 %conv = zext i1 %cmp9 to i64 ret i64 %conv } ; Function Attrs: nounwind uwtable define dso_local i64 @makeinv(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_minv_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_minv_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #28 store ptr %call, ptr @inv_arr, align 8, !tbaa !31 %2 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call2 = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %2, i64 noundef 16) #28 store ptr %call2, ptr @finv_arr, align 8, !tbaa !31 %3 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %3, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 %arrayidx3 = getelementptr inbounds i64, ptr %call2, i64 1 store i64 1, ptr %arrayidx3, align 8, !tbaa !5 store i64 1, ptr %call2, align 8, !tbaa !5 %cmp7.not43 = icmp slt i64 %n, 2 br i1 %cmp7.not43, label %return, label %for.body9 for.body9: ; preds = %for.end, %for.body9 %4 = phi ptr [ %6, %for.body9 ], [ %3, %for.end ] %i5.044 = phi i64 [ %add10, %for.body9 ], [ 2, %for.end ] %add10 = add nuw nsw i64 %i5.044, 1 %mul = shl i64 %add10, 3 %call11 = tail call ptr @realloc(ptr noundef nonnull %4, i64 noundef %mul) #28 store ptr %call11, ptr @inv_arr, align 8, !tbaa !31 %5 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call14 = tail call ptr @realloc(ptr noundef %5, i64 noundef %mul) #28 store ptr %call14, ptr @finv_arr, align 8, !tbaa !31 %6 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %rem = srem i64 %mod, %i5.044 %arrayidx15 = getelementptr inbounds i64, ptr %6, i64 %rem %7 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %div = sdiv i64 %mod, %i5.044 %mul16 = mul nsw i64 %div, %7 %rem17 = srem i64 %mul16, %mod %sub = sub nsw i64 %mod, %rem17 %arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %i5.044 store i64 %sub, ptr %arrayidx18, align 8, !tbaa !5 %8 = getelementptr i64, ptr %call14, i64 %i5.044 %arrayidx20 = getelementptr i64, ptr %8, i64 -1 %9 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %mul22 = mul nsw i64 %9, %sub %rem23 = srem i64 %mul22, %mod store i64 %rem23, ptr %8, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i5.044, %n br i1 %exitcond.not, label %return, label %for.body9, !llvm.loop !37 return: ; preds = %for.body9, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @make_mf(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @mf_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #28 store ptr %call, ptr @mf_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %call, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 store i64 1, ptr %call, align 8, !tbaa !5 %cmp5.not24 = icmp slt i64 %n, 2 br i1 %cmp5.not24, label %return, label %for.body7 for.body7: ; preds = %for.end, %for.body7 %2 = phi ptr [ %call10, %for.body7 ], [ %call, %for.end ] %i3.026 = phi i64 [ %add8, %for.body7 ], [ 2, %for.end ] %x.025 = phi i64 [ %rem, %for.body7 ], [ 1, %for.end ] %mul = mul nsw i64 %i3.026, %x.025 %rem = srem i64 %mul, %mod %add8 = add nuw nsw i64 %i3.026, 1 %mul9 = shl i64 %add8, 3 %call10 = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9) #28 %arrayidx11 = getelementptr inbounds i64, ptr %call10, i64 %i3.026 store i64 %rem, ptr %arrayidx11, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i3.026, %n br i1 %exitcond.not, label %return.loopexit, label %for.body7, !llvm.loop !38 return.loopexit: ; preds = %for.body7 store ptr %call10, ptr @mf_arr, align 8, !tbaa !31 br label %return return: ; preds = %return.loopexit, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @m_inv(i64 noundef %x, i64 noundef %mod, i64 noundef %is_fac) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call = tail call i64 @makeinv(i64 noundef %0, i64 noundef %mod) %tobool.not = icmp eq i64 %is_fac, 0 %inv_arr.val = load ptr, ptr @inv_arr, align 8 %finv_arr.val = load ptr, ptr @finv_arr, align 8 %.pn = select i1 %tobool.not, ptr %inv_arr.val, ptr %finv_arr.val %cond.in = getelementptr inbounds i64, ptr %.pn, i64 %x %cond = load i64, ptr %cond.in, align 8, !tbaa !5 ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @m_f(i64 noundef %x, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i = add nsw i64 %1, 1 store i64 %inc.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %1, 0 %.pre = load ptr, ptr @mf_arr, align 8, !tbaa !31 br i1 %tobool.not.i, label %for.end.i, label %make_mf.exit for.end.i: ; preds = %entry %call.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre, i64 noundef 16) #28 store ptr %call.i, ptr @mf_arr, align 8, !tbaa !31 %arrayidx.i = getelementptr inbounds i64, ptr %call.i, i64 1 store i64 1, ptr %arrayidx.i, align 8, !tbaa !5 store i64 1, ptr %call.i, align 8, !tbaa !5 %cmp5.not24.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i, label %make_mf.exit, label %for.body7.i for.body7.i: ; preds = %for.end.i, %for.body7.i %2 = phi ptr [ %call10.i, %for.body7.i ], [ %call.i, %for.end.i ] %i3.026.i = phi i64 [ %add8.i, %for.body7.i ], [ 2, %for.end.i ] %x.025.i = phi i64 [ %rem.i, %for.body7.i ], [ 1, %for.end.i ] %mul.i = mul nsw i64 %x.025.i, %i3.026.i %rem.i = srem i64 %mul.i, %mod %add8.i = add nuw nsw i64 %i3.026.i, 1 %mul9.i = shl i64 %add8.i, 3 %call10.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i) #28 %arrayidx11.i = getelementptr inbounds i64, ptr %call10.i, i64 %i3.026.i store i64 %rem.i, ptr %arrayidx11.i, align 8, !tbaa !5 %exitcond.not.i = icmp eq i64 %i3.026.i, %0 br i1 %exitcond.not.i, label %return.loopexit.i, label %for.body7.i, !llvm.loop !38 return.loopexit.i: ; preds = %for.body7.i store ptr %call10.i, ptr @mf_arr, align 8, !tbaa !31 br label %make_mf.exit make_mf.exit: ; preds = %entry, %for.end.i, %return.loopexit.i %3 = phi ptr [ %.pre, %entry ], [ %call.i, %for.end.i ], [ %call10.i, %return.loopexit.i ] %arrayidx = getelementptr inbounds i64, ptr %3, i64 %x %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 ret i64 %4 } ; Function Attrs: nounwind uwtable define dso_local i64 @mod_nck(i64 noundef %n, i64 noundef %k, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %1 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i.i = add nsw i64 %1, 1 store i64 %inc.i.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i.i = icmp eq i64 %1, 0 %.pre.i = load ptr, ptr @mf_arr, align 8, !tbaa !31 br i1 %tobool.not.i.i, label %for.end.i.i, label %m_f.exit for.end.i.i: ; preds = %entry %call.i.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre.i, i64 noundef 16) #28 store ptr %call.i.i, ptr @mf_arr, align 8, !tbaa !31 %arrayidx.i.i = getelementptr inbounds i64, ptr %call.i.i, i64 1 store i64 1, ptr %arrayidx.i.i, align 8, !tbaa !5 store i64 1, ptr %call.i.i, align 8, !tbaa !5 %cmp5.not24.i.i = icmp slt i64 %0, 2 br i1 %cmp5.not24.i.i, label %m_f.exit, label %for.body7.i.i for.body7.i.i: ; preds = %for.end.i.i, %for.body7.i.i %2 = phi ptr [ %call10.i.i, %for.body7.i.i ], [ %call.i.i, %for.end.i.i ] %i3.026.i.i = phi i64 [ %add8.i.i, %for.body7.i.i ], [ 2, %for.end.i.i ] %x.025.i.i = phi i64 [ %rem.i.i, %for.body7.i.i ], [ 1, %for.end.i.i ] %mul.i.i = mul nsw i64 %x.025.i.i, %i3.026.i.i %rem.i.i = srem i64 %mul.i.i, %mod %add8.i.i = add nuw nsw i64 %i3.026.i.i, 1 %mul9.i.i = shl i64 %add8.i.i, 3 %call10.i.i = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9.i.i) #28 %arrayidx11.i.i = getelementptr inbounds i64, ptr %call10.i.i, i64 %i3.026.i.i store i64 %rem.i.i, ptr %arrayidx11.i.i, align 8, !tbaa !5 %exitcond.not.i.i = icmp eq i64 %i3.026.i.i, %0 br i1 %exitcond.not.i.i, label %return.loopexit.i.i, label %for.body7.i.i, !llvm.loop !38 return.loopexit.i.i: ; preds = %for.body7.i.i store ptr %call10.i.i, ptr @mf_arr, align 8, !tbaa !31 br label %m_f.exit m_f.exit: ; preds = %entry, %for.end.i.i, %return.loopexit.i.i %3 = phi ptr [ %.pre.i, %entry ], [ %call.i.i, %for.end.i.i ], [ %call10.i.i, %return.loopexit.i.i ] %arrayidx.i = getelementptr inbounds i64, ptr %3, i64 %n %4 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %5 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i = tail call i64 @makeinv(i64 noundef %5, i64 noundef %mod) %finv_arr.val.i = load ptr, ptr @finv_arr, align 8 %cond.in.i = getelementptr inbounds i64, ptr %finv_arr.val.i, i64 %k %cond.i = load i64, ptr %cond.in.i, align 8, !tbaa !5 %mul = mul nsw i64 %cond.i, %4 %rem = srem i64 %mul, %mod %sub = sub nsw i64 %n, %k %6 = load i64, ptr @num_of_inv, align 8, !tbaa !5 %call.i11 = tail call i64 @makeinv(i64 noundef %6, i64 noundef %mod) %finv_arr.val.i13 = load ptr, ptr @finv_arr, align 8 %cond.in.i14 = getelementptr inbounds i64, ptr %finv_arr.val.i13, i64 %sub %cond.i15 = load i64, ptr %cond.in.i14, align 8, !tbaa !5 %mul3 = mul nsw i64 %cond.i15, %rem %rem4 = srem i64 %mul3, %mod ret i64 %rem4 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @m_p(i64 noundef %r, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #6 { entry: %cmp16 = icmp sgt i64 %n, 0 br i1 %cmp16, label %while.body, label %while.end while.body: ; preds = %entry, %cond.end %s.019 = phi i64 [ %rem2, %cond.end ], [ %r, %entry ] %t.018 = phi i64 [ %cond, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %shr, %cond.end ], [ %n, %entry ] %and = and i64 %n.addr.017, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.true: ; preds = %while.body %mul = mul nsw i64 %s.019, %t.018 %rem = srem i64 %mul, %mod br label %cond.end cond.end: ; preds = %while.body, %cond.true %cond = phi i64 [ %rem, %cond.true ], [ %t.018, %while.body ] %mul1 = mul nsw i64 %s.019, %s.019 %rem2 = srem i64 %mul1, %mod %shr = lshr i64 %n.addr.017, 1 %cmp.not = icmp ult i64 %n.addr.017, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !39 while.end: ; preds = %cond.end, %entry %t.0.lcssa = phi i64 [ 1, %entry ], [ %cond, %cond.end ] %tobool3.not = icmp eq i64 %r, 0 %cond7 = select i1 %tobool3.not, i64 0, i64 %t.0.lcssa ret i64 %cond7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul2(i64 noundef %a, i64 noundef %b, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul3(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod ret i64 %rem.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul4(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod ret i64 %rem.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul5(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %e, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod %mul.i.i.i = mul nsw i64 %rem.i.i, %e %rem.i.i.i = srem i64 %mul.i.i.i, %mod ret i64 %rem.i.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #14 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #29 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i8, ptr %a, align 1, !tbaa !21 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !21 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #30 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #16 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #30 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #30 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #29 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #30 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #17 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #29 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !40 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !41 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !42 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %p, align 8, !tbaa !43 %1 = load i64, ptr %q, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %q, align 8, !tbaa !43 %1 = load i64, ptr %p, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #30 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #30 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @AVL_set_inside_rotate(ptr nocapture noundef %node, i32 noundef %is_right) local_unnamed_addr #18 { entry: %cmp = icmp eq i32 %is_right, 0 %cmp1 = icmp eq i32 %is_right, 1 %cond = select i1 %cmp, i32 -1, i32 1 %0 = load ptr, ptr %node, align 8, !tbaa !31 %idxprom = zext i1 %cmp to i64 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom %1 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %cmp3.not = icmp eq ptr %1, null br i1 %cmp3.not, label %if.end43, label %if.then if.then: ; preds = %entry %diff = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 1 %2 = load i32, ptr %diff, align 8, !tbaa !45 %mul = mul nsw i32 %2, %cond %diff8 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 1 %3 = load i32, ptr %diff8, align 8, !tbaa !45 %mul9 = mul nsw i32 %3, %cond %tobool10.not = icmp eq i32 %mul9, -1 br i1 %tobool10.not, label %if.else, label %if.then11 if.then11: ; preds = %if.then %4 = xor i32 %mul9, -1 %tobool14.not = icmp eq i32 %2, %3 %sub15 = add nsw i32 %mul9, -1 %sub16 = add nsw i32 %mul, -2 %cond17 = select i1 %tobool14.not, i32 %sub16, i32 %sub15 br label %if.end if.else: ; preds = %if.then %tobool19.not = icmp eq i32 %2, 0 %cond26 = select i1 %tobool19.not, i32 -3, i32 -2 br label %if.end if.end: ; preds = %if.else, %if.then11 %.pn = phi i32 [ %4, %if.then11 ], [ -1, %if.else ] %nb.0 = phi i32 [ %cond17, %if.then11 ], [ %cond26, %if.else ] %na.0 = add i32 %.pn, %mul %mul27 = mul nsw i32 %na.0, %cond store i32 %mul27, ptr %diff, align 8, !tbaa !45 %mul29 = mul nsw i32 %nb.0, %cond store i32 %mul29, ptr %diff8, align 8, !tbaa !45 %idxprom35 = zext i1 %cmp1 to i64 %arrayidx36 = getelementptr inbounds %struct.node_AVL_set, ptr %1, i64 0, i32 3, i64 %idxprom35 %5 = load ptr, ptr %arrayidx36, align 8, !tbaa !31 store ptr %5, ptr %arrayidx, align 8, !tbaa !31 %6 = load ptr, ptr %node, align 8, !tbaa !31 store ptr %6, ptr %arrayidx36, align 8, !tbaa !31 store ptr %1, ptr %node, align 8, !tbaa !31 br label %if.end43 if.end43: ; preds = %if.end, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @AVL_set_inside_update(ptr nocapture noundef %node, i64 noundef %data, i32 noundef %add) local_unnamed_addr #10 { entry: %0 = load ptr, ptr %node, align 8, !tbaa !31 %cmp = icmp eq ptr %0, null br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %cmp1 = icmp eq i32 %add, 2 br i1 %cmp1, label %if.then2, label %return if.then2: ; preds = %if.then %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #31 store ptr %call, ptr %node, align 8, !tbaa !31 store i64 %data, ptr %call, align 8, !tbaa !47 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 2 store i32 1, ptr %cnt, align 4, !tbaa !48 %diff = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 1 store i32 0, ptr %diff, align 8, !tbaa !45 %child = getelementptr inbounds %struct.node_AVL_set, ptr %call, i64 0, i32 3 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %child, i8 0, i64 16, i1 false) br label %return if.else: ; preds = %entry %1 = load i64, ptr %0, align 8, !tbaa !47 %cmp8 = icmp eq i64 %1, %data br i1 %cmp8, label %if.then10, label %if.else56 if.then10: ; preds = %if.else switch i32 %add, label %land.lhs.true [ i32 2, label %if.then13 i32 0, label %if.else21 ] if.then13: ; preds = %if.then10 %cnt14 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %2 = load i32, ptr %cnt14, align 4, !tbaa !48 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %cnt14, align 4, !tbaa !48 br label %return land.lhs.true: ; preds = %if.then10 %cnt16 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 2 %3 = load i32, ptr %cnt16, align 4, !tbaa !48 %cmp17 = icmp sgt i32 %3, 1 br i1 %cmp17, label %if.then19, label %if.else21 if.then19: ; preds = %land.lhs.true %dec = add nsw i32 %3, -1 store i32 %dec, ptr %cnt16, align 4, !tbaa !48 br label %return if.else21: ; preds = %if.then10, %land.lhs.true %child22 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3 %arrayidx23 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 1 %4 = load ptr, ptr %arrayidx23, align 8, !tbaa !31 %cmp24 = icmp eq ptr %4, null %5 = load ptr, ptr %child22, align 8, !tbaa !31 br i1 %cmp24, label %if.then26, label %if.else29 if.then26: ; preds = %if.else21 tail call void @free(ptr noundef nonnull %0) #30 store ptr %5, ptr %node, align 8, !tbaa !31 br label %return if.else29: ; preds = %if.else21 %cmp32 = icmp eq ptr %5, null br i1 %cmp32, label %if.then34, label %for.cond if.then34: ; preds = %if.else29 tail call void @free(ptr noundef nonnull %0) #30 store ptr %4, ptr %node, align 8, !tbaa !31 br label %return for.cond: ; preds = %if.else29, %for.cond %next_node.0 = phi ptr [ %6, %for.cond ], [ %5, %if.else29 ] %arrayidx41 = getelementptr inbounds %struct.node_AVL_set, ptr %next_node.0, i64 0, i32 3, i64 1 %6 = load ptr, ptr %arrayidx41, align 8, !tbaa !31 %cmp42.not = icmp eq ptr %6, null br i1 %cmp42.not, label %for.end, label %for.cond, !llvm.loop !49 for.end: ; preds = %for.cond %7 = load i64, ptr %next_node.0, align 8, !tbaa !47 store i64 %7, ptr %0, align 8, !tbaa !47 %8 = load i64, ptr %next_node.0, align 8, !tbaa !47 %call51 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %child22, i64 noundef %8, i32 noundef %add), !range !50 br label %if.end69 if.else56: ; preds = %if.else %cmp58.not = icmp sle i64 %1, %data %cmp62 = icmp sgt i64 %1, %data %cond64 = select i1 %cmp62, i32 1, i32 -1 %idxprom66 = zext i1 %cmp58.not to i64 %arrayidx67 = getelementptr inbounds %struct.node_AVL_set, ptr %0, i64 0, i32 3, i64 %idxprom66 %call68 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx67, i64 noundef %data, i32 noundef %add), !range !50 br label %if.end69 if.end69: ; preds = %if.else56, %for.end %delta.0 = phi i32 [ %call51, %for.end ], [ %call68, %if.else56 ] %delta_sign.0 = phi i32 [ 1, %for.end ], [ %cond64, %if.else56 ] %tobool70.not = icmp eq i32 %delta.0, 0 br i1 %tobool70.not, label %return, label %if.then71 if.then71: ; preds = %if.end69 %9 = load ptr, ptr %node, align 8, !tbaa !31 %diff72 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 1 %10 = load i32, ptr %diff72, align 8, !tbaa !45 %mul = mul nsw i32 %delta_sign.0, %delta.0 %add74 = add nsw i32 %10, %mul store i32 %add74, ptr %diff72, align 8, !tbaa !45 %cmp76 = icmp sgt i32 %add74, 1 br i1 %cmp76, label %if.then87, label %if.else79 if.else79: ; preds = %if.then71 %cmp81 = icmp slt i32 %add74, -1 br i1 %cmp81, label %if.then87, label %if.end110 if.then87: ; preds = %if.else79, %if.then71 %rotate_l.0.ph = phi i64 [ 0, %if.then71 ], [ 1, %if.else79 ] %diff_sign.0.ph = phi i32 [ 1, %if.then71 ], [ -1, %if.else79 ] %cmp.i197 = xor i1 %cmp76, true %arrayidx90 = getelementptr inbounds %struct.node_AVL_set, ptr %9, i64 0, i32 3, i64 %rotate_l.0.ph %11 = load ptr, ptr %arrayidx90, align 8, !tbaa !31 %diff91 = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 1 %12 = load i32, ptr %diff91, align 8, !tbaa !45 %mul96 = mul nsw i32 %12, %diff_sign.0.ph %cmp97 = icmp slt i32 %mul96, 0 br i1 %cmp97, label %if.then99, label %if.end104 if.then99: ; preds = %if.then87 %cond.i = select i1 %cmp76, i32 -1, i32 1 %idxprom.i = zext i1 %cmp76 to i64 %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %11, i64 0, i32 3, i64 %idxprom.i %13 = load ptr, ptr %arrayidx.i, align 8, !tbaa !31 %cmp3.not.i = icmp eq ptr %13, null br i1 %cmp3.not.i, label %if.end104, label %if.then.i if.then.i: ; preds = %if.then99 %mul.i = mul nsw i32 %12, %cond.i %diff8.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 1 %14 = load i32, ptr %diff8.i, align 8, !tbaa !45 %mul9.i = mul nsw i32 %14, %cond.i %tobool10.not.i = icmp eq i32 %mul9.i, -1 br i1 %tobool10.not.i, label %if.else.i, label %if.then11.i if.then11.i: ; preds = %if.then.i %15 = xor i32 %mul9.i, -1 %tobool14.not.i = icmp eq i32 %12, %14 %sub15.i = add nsw i32 %mul9.i, -1 %sub16.i = add nsw i32 %mul.i, -2 %cond17.i = select i1 %tobool14.not.i, i32 %sub16.i, i32 %sub15.i br label %if.end.i if.else.i: ; preds = %if.then.i %tobool19.not.i = icmp eq i32 %12, 0 %cond26.i = select i1 %tobool19.not.i, i32 -3, i32 -2 br label %if.end.i if.end.i: ; preds = %if.else.i, %if.then11.i %.pn.i = phi i32 [ %15, %if.then11.i ], [ -1, %if.else.i ] %nb.0.i = phi i32 [ %cond17.i, %if.then11.i ], [ %cond26.i, %if.else.i ] %na.0.i = add i32 %.pn.i, %mul.i %mul27.i = mul nsw i32 %na.0.i, %cond.i store i32 %mul27.i, ptr %diff91, align 8, !tbaa !45 %mul29.i = mul nsw i32 %nb.0.i, %cond.i store i32 %mul29.i, ptr %diff8.i, align 8, !tbaa !45 %idxprom35.i = zext i1 %cmp.i197 to i64 %arrayidx36.i = getelementptr inbounds %struct.node_AVL_set, ptr %13, i64 0, i32 3, i64 %idxprom35.i %16 = load ptr, ptr %arrayidx36.i, align 8, !tbaa !31 store ptr %16, ptr %arrayidx.i, align 8, !tbaa !31 %17 = load ptr, ptr %arrayidx90, align 8, !tbaa !31 store ptr %17, ptr %arrayidx36.i, align 8, !tbaa !31 store ptr %13, ptr %arrayidx90, align 8, !tbaa !31 %.pre = load ptr, ptr %node, align 8, !tbaa !31 br label %if.end104 if.end104: ; preds = %if.end.i, %if.then99, %if.then87 %18 = phi ptr [ %.pre, %if.end.i ], [ %9, %if.then99 ], [ %9, %if.then87 ] %cond.i199 = select i1 %cmp76, i32 1, i32 -1 %idxprom.i200 = zext i1 %cmp.i197 to i64 %arrayidx.i201 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 3, i64 %idxprom.i200 %19 = load ptr, ptr %arrayidx.i201, align 8, !tbaa !31 %cmp3.not.i202 = icmp eq ptr %19, null br i1 %cmp3.not.i202, label %AVL_set_inside_rotate.exit225, label %if.then.i203 if.then.i203: ; preds = %if.end104 %diff.i204 = getelementptr inbounds %struct.node_AVL_set, ptr %18, i64 0, i32 1 %20 = load i32, ptr %diff.i204, align 8, !tbaa !45 %mul.i205 = mul nsw i32 %20, %cond.i199 %diff8.i206 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 1 %21 = load i32, ptr %diff8.i206, align 8, !tbaa !45 %mul9.i207 = mul nsw i32 %21, %cond.i199 %tobool10.not.i208 = icmp eq i32 %mul9.i207, -1 br i1 %tobool10.not.i208, label %if.else.i222, label %if.then11.i209 if.then11.i209: ; preds = %if.then.i203 %22 = xor i32 %mul9.i207, -1 %tobool14.not.i210 = icmp eq i32 %20, %21 %sub15.i211 = add nsw i32 %mul9.i207, -1 %sub16.i212 = add nsw i32 %mul.i205, -2 %cond17.i213 = select i1 %tobool14.not.i210, i32 %sub16.i212, i32 %sub15.i211 br label %if.end.i214 if.else.i222: ; preds = %if.then.i203 %tobool19.not.i223 = icmp eq i32 %20, 0 %cond26.i224 = select i1 %tobool19.not.i223, i32 -3, i32 -2 br label %if.end.i214 if.end.i214: ; preds = %if.else.i222, %if.then11.i209 %.pn.i215 = phi i32 [ %22, %if.then11.i209 ], [ -1, %if.else.i222 ] %nb.0.i216 = phi i32 [ %cond17.i213, %if.then11.i209 ], [ %cond26.i224, %if.else.i222 ] %na.0.i217 = add i32 %.pn.i215, %mul.i205 %mul27.i218 = mul nsw i32 %na.0.i217, %cond.i199 store i32 %mul27.i218, ptr %diff.i204, align 8, !tbaa !45 %mul29.i219 = mul nsw i32 %nb.0.i216, %cond.i199 store i32 %mul29.i219, ptr %diff8.i206, align 8, !tbaa !45 %idxprom35.i220 = zext i1 %cmp76 to i64 %arrayidx36.i221 = getelementptr inbounds %struct.node_AVL_set, ptr %19, i64 0, i32 3, i64 %idxprom35.i220 %23 = load ptr, ptr %arrayidx36.i221, align 8, !tbaa !31 store ptr %23, ptr %arrayidx.i201, align 8, !tbaa !31 %24 = load ptr, ptr %node, align 8, !tbaa !31 store ptr %24, ptr %arrayidx36.i221, align 8, !tbaa !31 store ptr %19, ptr %node, align 8, !tbaa !31 br label %AVL_set_inside_rotate.exit225 AVL_set_inside_rotate.exit225: ; preds = %if.end104, %if.end.i214 %cmp105 = icmp slt i32 %delta.0, 0 %cmp107 = icmp ne i32 %12, 0 %25 = and i1 %cmp105, %cmp107 %cond109 = sext i1 %25 to i32 br label %return if.end110: ; preds = %if.else79 %cmp111 = icmp sgt i32 %delta.0, 0 %cmp114 = icmp eq i32 %10, 0 %or.cond = and i1 %cmp111, %cmp114 br i1 %or.cond, label %return, label %if.else117 if.else117: ; preds = %if.end110 %cmp118 = icmp slt i32 %delta.0, 0 %cmp121 = icmp ne i32 %10, 0 %or.cond134 = and i1 %cmp118, %cmp121 %. = sext i1 %or.cond134 to i32 br label %return return: ; preds = %if.then13, %if.then19, %if.then26, %if.then34, %if.else117, %if.end110, %AVL_set_inside_rotate.exit225, %if.end69, %if.then2, %if.then %retval.2 = phi i32 [ 1, %if.then2 ], [ 0, %if.then ], [ 0, %if.then13 ], [ 0, %if.then19 ], [ -1, %if.then26 ], [ -1, %if.then34 ], [ %cond109, %AVL_set_inside_rotate.exit225 ], [ 1, %if.end110 ], [ %., %if.else117 ], [ 0, %if.end69 ] ret i32 %retval.2 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #19 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @AVL_set_inside_print(ptr noundef readonly %node, i32 noundef %depth) local_unnamed_addr #2 { entry: %cmp9 = icmp eq ptr %node, null br i1 %cmp9, label %return, label %if.end if.end: ; preds = %entry, %if.end %depth.tr11 = phi i32 [ %add, %if.end ], [ %depth, %entry ] %node.tr10 = phi ptr [ %3, %if.end ], [ %node, %entry ] %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3 %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 3, i64 1 %0 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %add = add nsw i32 %depth.tr11, 1 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef %add) %1 = load i64, ptr %node.tr10, align 8, !tbaa !47 %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.tr10, i64 0, i32 2 %2 = load i32, ptr %cnt, align 4, !tbaa !48 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1, i32 noundef %2) %3 = load ptr, ptr %child, align 8, !tbaa !31 %cmp = icmp eq ptr %3, null br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nounwind uwtable define dso_local void @AVL_set_inside_free(ptr noundef %node) local_unnamed_addr #10 { entry: %cmp = icmp eq ptr %node, null br i1 %cmp, label %common.ret6, label %if.end common.ret6: ; preds = %entry, %if.end ret void if.end: ; preds = %entry %child = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3 %0 = load ptr, ptr %child, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %0) %arrayidx2 = getelementptr inbounds %struct.node_AVL_set, ptr %node, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx2, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %1) tail call void @free(ptr noundef nonnull %node) #30 br label %common.ret6 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_count(ptr noundef readonly %root, i64 noundef %val) local_unnamed_addr #21 { entry: %tobool.not16 = icmp eq ptr %root, null br i1 %tobool.not16, label %cleanup, label %while.body while.body: ; preds = %entry, %if.end8 %node.017 = phi ptr [ %node.1, %if.end8 ], [ %root, %entry ] %0 = load i64, ptr %node.017, align 8, !tbaa !47 %cmp = icmp sgt i64 %0, %val br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %child = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3 br label %if.end8 if.else: ; preds = %while.body %cmp3 = icmp slt i64 %0, %val br i1 %cmp3, label %if.then4, label %if.else7 if.then4: ; preds = %if.else %arrayidx6 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 3, i64 1 br label %if.end8 if.else7: ; preds = %if.else %cnt = getelementptr inbounds %struct.node_AVL_set, ptr %node.017, i64 0, i32 2 %1 = load i32, ptr %cnt, align 4, !tbaa !48 %conv = sext i32 %1 to i64 br label %cleanup if.end8: ; preds = %if.then4, %if.then %node.1.in = phi ptr [ %child, %if.then ], [ %arrayidx6, %if.then4 ] %node.1 = load ptr, ptr %node.1.in, align 8, !tbaa !31 %tobool.not = icmp eq ptr %node.1, null br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !51 cleanup: ; preds = %if.end8, %entry, %if.else7 %retval.0 = phi i64 [ %conv, %if.else7 ], [ 0, %entry ], [ 0, %if.end8 ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @AVL_set_inside_minmax(ptr nocapture noundef readonly %root, i32 noundef %type) local_unnamed_addr #21 { entry: %idxprom = sext i32 %type to i64 br label %while.cond while.cond: ; preds = %while.cond, %entry %root.addr.0 = phi ptr [ %root, %entry ], [ %0, %while.cond ] %arrayidx = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0, i64 0, i32 3, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !31 %cmp.not = icmp eq ptr %0, null br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !52 while.end: ; preds = %while.cond %1 = load i64, ptr %root.addr.0, align 8, !tbaa !47 ret i64 %1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @AVL_set_inside_swap(ptr nocapture noundef %node1, ptr nocapture noundef %node2) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %node1, align 8, !tbaa !31 %1 = load ptr, ptr %node2, align 8, !tbaa !31 store ptr %1, ptr %node1, align 8, !tbaa !31 store ptr %0, ptr %node2, align 8, !tbaa !31 ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @set_main(i32 noundef %command, i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #10 { entry: %.b114 = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114, label %if.end, label %if.then if.then: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry switch i32 %command, label %return [ i32 -1, label %if.then2 i32 1, label %if.then6 i32 2, label %if.then18 i32 3, label %if.then24 i32 4, label %if.end.if.then40_crit_edge i32 5, label %if.end.if.then49_crit_edge i32 6, label %if.end.if.then58_crit_edge i32 7, label %if.end.if.then63_crit_edge i32 8, label %if.end.if.then69_crit_edge i32 9, label %if.end.if.then75_crit_edge ] if.end.if.then40_crit_edge: ; preds = %if.end %.pre170 = sext i32 %set_num to i64 br label %if.then40 if.end.if.then49_crit_edge: ; preds = %if.end %.pre171 = sext i32 %set_num to i64 br label %if.then49 if.end.if.then58_crit_edge: ; preds = %if.end %.pre172 = sext i32 %set_num to i64 br label %if.then58 if.end.if.then63_crit_edge: ; preds = %if.end %.pre173 = sext i32 %set_num to i64 br label %if.then63 if.end.if.then69_crit_edge: ; preds = %if.end %.pre174 = sext i32 %set_num to i64 br label %if.then69 if.end.if.then75_crit_edge: ; preds = %if.end %.pre175 = sext i32 %set_num to i64 br label %if.then75 if.then2: ; preds = %if.end %idxprom = sext i32 %set_num to i64 %arrayidx3 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx3, align 8, !tbaa !31 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) br label %return if.then6: ; preds = %if.end %idxprom7 = sext i32 %set_num to i64 %arrayidx8 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7 %1 = load ptr, ptr %arrayidx8, align 8, !tbaa !31 %tobool.not16.i = icmp eq ptr %1, null br i1 %tobool.not16.i, label %cond.false, label %while.body.i while.body.i: ; preds = %if.then6, %if.end8.i %node.017.i = phi ptr [ %node.1.i, %if.end8.i ], [ %1, %if.then6 ] %2 = load i64, ptr %node.017.i, align 8, !tbaa !47 %cmp.i = icmp sgt i64 %2, %val br i1 %cmp.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body.i %child.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3 br label %if.end8.i if.else.i: ; preds = %while.body.i %cmp3.i = icmp slt i64 %2, %val br i1 %cmp3.i, label %if.then4.i, label %AVL_set_inside_count.exit if.then4.i: ; preds = %if.else.i %arrayidx6.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 3, i64 1 br label %if.end8.i if.end8.i: ; preds = %if.then4.i, %if.then.i %node.1.in.i = phi ptr [ %child.i, %if.then.i ], [ %arrayidx6.i, %if.then4.i ] %node.1.i = load ptr, ptr %node.1.in.i, align 8, !tbaa !31 %tobool.not.i = icmp eq ptr %node.1.i, null br i1 %tobool.not.i, label %cond.false, label %while.body.i, !llvm.loop !51 AVL_set_inside_count.exit: ; preds = %if.else.i %cnt.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i, align 4, !tbaa !48 %tobool9.not = icmp eq i32 %3, 0 br i1 %tobool9.not, label %cond.false, label %cond.end cond.false: ; preds = %if.end8.i, %if.then6, %AVL_set_inside_count.exit %arrayidx11 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7 %4 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %inc12 = add nsw i64 %4, 1 store i64 %inc12, ptr %arrayidx11, align 8, !tbaa !5 br label %cond.end cond.end: ; preds = %AVL_set_inside_count.exit, %cond.false %call15 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8, i64 noundef %val, i32 noundef 2), !range !50 br label %return if.then18: ; preds = %if.end %.pre = sext i32 %set_num to i64 %arrayidx20 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre %5 = load ptr, ptr %arrayidx20, align 8, !tbaa !31 %tobool.not16.i115 = icmp eq ptr %5, null br i1 %tobool.not16.i115, label %return, label %while.body.i116 while.body.i116: ; preds = %if.then18, %if.end8.i127 %node.017.i117 = phi ptr [ %node.1.i129, %if.end8.i127 ], [ %5, %if.then18 ] %6 = load i64, ptr %node.017.i117, align 8, !tbaa !47 %cmp.i118 = icmp sgt i64 %6, %val br i1 %cmp.i118, label %if.then.i131, label %if.else.i119 if.then.i131: ; preds = %while.body.i116 %child.i132 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 3 br label %if.end8.i127 if.else.i119: ; preds = %while.body.i116 %cmp3.i120 = icmp slt i64 %6, %val br i1 %cmp3.i120, label %if.then4.i125, label %if.else7.i121 if.then4.i125: ; preds = %if.else.i119 %arrayidx6.i126 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 3, i64 1 br label %if.end8.i127 if.else7.i121: ; preds = %if.else.i119 %cnt.i122 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117, i64 0, i32 2 %7 = load i32, ptr %cnt.i122, align 4, !tbaa !48 %conv.i123 = sext i32 %7 to i64 br label %return if.end8.i127: ; preds = %if.then4.i125, %if.then.i131 %node.1.in.i128 = phi ptr [ %child.i132, %if.then.i131 ], [ %arrayidx6.i126, %if.then4.i125 ] %node.1.i129 = load ptr, ptr %node.1.in.i128, align 8, !tbaa !31 %tobool.not.i130 = icmp eq ptr %node.1.i129, null br i1 %tobool.not.i130, label %return, label %while.body.i116, !llvm.loop !51 if.then24: ; preds = %if.end %.pre169 = sext i32 %set_num to i64 %arrayidx26 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre169 %8 = load ptr, ptr %arrayidx26, align 8, !tbaa !31 %tobool.not16.i134 = icmp eq ptr %8, null br i1 %tobool.not16.i134, label %cond.false30, label %while.body.i135 while.body.i135: ; preds = %if.then24, %if.end8.i146 %node.017.i136 = phi ptr [ %node.1.i148, %if.end8.i146 ], [ %8, %if.then24 ] %9 = load i64, ptr %node.017.i136, align 8, !tbaa !47 %cmp.i137 = icmp sgt i64 %9, %val br i1 %cmp.i137, label %if.then.i150, label %if.else.i138 if.then.i150: ; preds = %while.body.i135 %child.i151 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 3 br label %if.end8.i146 if.else.i138: ; preds = %while.body.i135 %cmp3.i139 = icmp slt i64 %9, %val br i1 %cmp3.i139, label %if.then4.i144, label %AVL_set_inside_count.exit152 if.then4.i144: ; preds = %if.else.i138 %arrayidx6.i145 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 3, i64 1 br label %if.end8.i146 if.end8.i146: ; preds = %if.then4.i144, %if.then.i150 %node.1.in.i147 = phi ptr [ %child.i151, %if.then.i150 ], [ %arrayidx6.i145, %if.then4.i144 ] %node.1.i148 = load ptr, ptr %node.1.in.i147, align 8, !tbaa !31 %tobool.not.i149 = icmp eq ptr %node.1.i148, null br i1 %tobool.not.i149, label %cond.false30, label %while.body.i135, !llvm.loop !51 AVL_set_inside_count.exit152: ; preds = %if.else.i138 %cnt.i141 = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136, i64 0, i32 2 %10 = load i32, ptr %cnt.i141, align 4, !tbaa !48 %cmp28 = icmp sgt i32 %10, 1 br i1 %cmp28, label %cond.end33, label %cond.false30 cond.false30: ; preds = %if.end8.i146, %if.then24, %AVL_set_inside_count.exit152 %arrayidx32 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre169 %11 = load i64, ptr %arrayidx32, align 8, !tbaa !5 %dec = add nsw i64 %11, -1 store i64 %dec, ptr %arrayidx32, align 8, !tbaa !5 br label %cond.end33 cond.end33: ; preds = %AVL_set_inside_count.exit152, %cond.false30 %call37 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26, i64 noundef %val, i32 noundef 1), !range !50 switch i32 %command, label %return [ i32 4, label %if.then40 i32 5, label %if.then49 i32 6, label %if.then58 i32 7, label %if.then63 i32 8, label %if.then69 i32 9, label %if.then75 ] if.then40: ; preds = %if.end.if.then40_crit_edge, %cond.end33 %idxprom41.pre-phi = phi i64 [ %.pre170, %if.end.if.then40_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx42 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom41.pre-phi %12 = load i64, ptr %arrayidx42, align 8, !tbaa !5 %dec43 = add nsw i64 %12, -1 store i64 %dec43, ptr %arrayidx42, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom41.pre-phi %call46 = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45, i64 noundef %val, i32 noundef 0), !range !50 br label %return if.then49: ; preds = %if.end.if.then49_crit_edge, %cond.end33 %idxprom50.pre-phi = phi i64 [ %.pre171, %if.end.if.then49_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx51 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom50.pre-phi store i64 0, ptr %arrayidx51, align 8, !tbaa !5 %arrayidx53 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom50.pre-phi %13 = load ptr, ptr %arrayidx53, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %13) store ptr null, ptr %arrayidx53, align 8, !tbaa !31 br label %return if.then58: ; preds = %if.end.if.then58_crit_edge, %cond.end33 %idxprom59.pre-phi = phi i64 [ %.pre172, %if.end.if.then58_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx60 = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom59.pre-phi %14 = load i64, ptr %arrayidx60, align 8, !tbaa !5 br label %return if.then63: ; preds = %if.end.if.then63_crit_edge, %cond.end33 %idxprom64.pre-phi = phi i64 [ %.pre173, %if.end.if.then63_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx65 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom64.pre-phi %15 = load ptr, ptr %arrayidx65, align 8, !tbaa !31 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %if.then63 %root.addr.0.i = phi ptr [ %15, %if.then63 ], [ %16, %while.cond.i ] %arrayidx.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i, i64 0, i32 3, i64 1 %16 = load ptr, ptr %arrayidx.i, align 8, !tbaa !31 %cmp.not.i = icmp eq ptr %16, null br i1 %cmp.not.i, label %AVL_set_inside_minmax.exit, label %while.cond.i, !llvm.loop !52 AVL_set_inside_minmax.exit: ; preds = %while.cond.i %17 = load i64, ptr %root.addr.0.i, align 8, !tbaa !47 br label %return if.then69: ; preds = %if.end.if.then69_crit_edge, %cond.end33 %idxprom70.pre-phi = phi i64 [ %.pre174, %if.end.if.then69_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx71 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom70.pre-phi %18 = load ptr, ptr %arrayidx71, align 8, !tbaa !31 br label %while.cond.i153 while.cond.i153: ; preds = %while.cond.i153, %if.then69 %root.addr.0.i154 = phi ptr [ %18, %if.then69 ], [ %19, %while.cond.i153 ] %arrayidx.i155 = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i154, i64 0, i32 3, i64 0 %19 = load ptr, ptr %arrayidx.i155, align 8, !tbaa !31 %cmp.not.i156 = icmp eq ptr %19, null br i1 %cmp.not.i156, label %AVL_set_inside_minmax.exit157, label %while.cond.i153, !llvm.loop !52 AVL_set_inside_minmax.exit157: ; preds = %while.cond.i153 %20 = load i64, ptr %root.addr.0.i154, align 8, !tbaa !47 br label %return if.then75: ; preds = %if.end.if.then75_crit_edge, %cond.end33 %idxprom76.pre-phi = phi i64 [ %.pre175, %if.end.if.then75_crit_edge ], [ %.pre169, %cond.end33 ] %arrayidx77 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom76.pre-phi %arrayidx78 = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %val %21 = load ptr, ptr %arrayidx77, align 8, !tbaa !31 %22 = load ptr, ptr %arrayidx78, align 8, !tbaa !31 store ptr %22, ptr %arrayidx77, align 8, !tbaa !31 store ptr %21, ptr %arrayidx78, align 8, !tbaa !31 br label %return return: ; preds = %if.end8.i127, %cond.end, %if.then49, %if.then40, %if.else7.i121, %if.then18, %if.then2, %if.then75, %cond.end33, %if.end, %AVL_set_inside_minmax.exit157, %AVL_set_inside_minmax.exit, %if.then58 %retval.0 = phi i64 [ %14, %if.then58 ], [ %17, %AVL_set_inside_minmax.exit ], [ %20, %AVL_set_inside_minmax.exit157 ], [ 0, %if.end ], [ 0, %if.then2 ], [ 0, %cond.end ], [ 0, %cond.end33 ], [ 0, %if.then40 ], [ 0, %if.then49 ], [ 0, %if.then75 ], [ %conv.i123, %if.else7.i121 ], [ 0, %if.then18 ], [ 0, %if.end8.i127 ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @set_print(i32 noundef %set_num) local_unnamed_addr #2 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %idxprom.i = sext i32 %set_num to i64 %arrayidx3.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom.i %0 = load ptr, ptr %arrayidx3.i, align 8, !tbaa !31 tail call void @AVL_set_inside_print(ptr noundef %0, i32 noundef 0) ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_insert(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #10 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %idxprom7.i = sext i32 %set_num to i64 %arrayidx8.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %idxprom7.i %0 = load ptr, ptr %arrayidx8.i, align 8, !tbaa !31 %tobool.not16.i.i = icmp eq ptr %0, null br i1 %tobool.not16.i.i, label %cond.false.i, label %while.body.i.i while.body.i.i: ; preds = %if.end.i, %if.end8.i.i %node.017.i.i = phi ptr [ %node.1.i.i, %if.end8.i.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i.i, align 8, !tbaa !47 %cmp.i.i = icmp sgt i64 %1, %val br i1 %cmp.i.i, label %if.then.i.i, label %if.else.i.i if.then.i.i: ; preds = %while.body.i.i %child.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3 br label %if.end8.i.i if.else.i.i: ; preds = %while.body.i.i %cmp3.i.i = icmp slt i64 %1, %val br i1 %cmp3.i.i, label %if.then4.i.i, label %AVL_set_inside_count.exit.i if.then4.i.i: ; preds = %if.else.i.i %arrayidx6.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 3, i64 1 br label %if.end8.i.i if.end8.i.i: ; preds = %if.then4.i.i, %if.then.i.i %node.1.in.i.i = phi ptr [ %child.i.i, %if.then.i.i ], [ %arrayidx6.i.i, %if.then4.i.i ] %node.1.i.i = load ptr, ptr %node.1.in.i.i, align 8, !tbaa !31 %tobool.not.i.i = icmp eq ptr %node.1.i.i, null br i1 %tobool.not.i.i, label %cond.false.i, label %while.body.i.i, !llvm.loop !51 AVL_set_inside_count.exit.i: ; preds = %if.else.i.i %cnt.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i.i, align 4, !tbaa !48 %tobool9.not.i = icmp eq i32 %2, 0 br i1 %tobool9.not.i, label %cond.false.i, label %set_main.exit cond.false.i: ; preds = %if.end8.i.i, %AVL_set_inside_count.exit.i, %if.end.i %arrayidx11.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %idxprom7.i %3 = load i64, ptr %arrayidx11.i, align 8, !tbaa !5 %inc12.i = add nsw i64 %3, 1 store i64 %inc12.i, ptr %arrayidx11.i, align 8, !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %AVL_set_inside_count.exit.i, %cond.false.i %call15.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx8.i, i64 noundef %val, i32 noundef 2), !range !50 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_count(i32 noundef %set_num, i64 noundef %val) local_unnamed_addr #22 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre.i = sext i32 %set_num to i64 %arrayidx20.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre.i %0 = load ptr, ptr %arrayidx20.i, align 8, !tbaa !31 %tobool.not16.i115.i = icmp eq ptr %0, null br i1 %tobool.not16.i115.i, label %set_main.exit, label %while.body.i116.i while.body.i116.i: ; preds = %if.end.i, %if.end8.i127.i %node.017.i117.i = phi ptr [ %node.1.i129.i, %if.end8.i127.i ], [ %0, %if.end.i ] %1 = load i64, ptr %node.017.i117.i, align 8, !tbaa !47 %cmp.i118.i = icmp sgt i64 %1, %val br i1 %cmp.i118.i, label %if.then.i131.i, label %if.else.i119.i if.then.i131.i: ; preds = %while.body.i116.i %child.i132.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 3 br label %if.end8.i127.i if.else.i119.i: ; preds = %while.body.i116.i %cmp3.i120.i = icmp slt i64 %1, %val br i1 %cmp3.i120.i, label %if.then4.i125.i, label %if.else7.i121.i if.then4.i125.i: ; preds = %if.else.i119.i %arrayidx6.i126.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 3, i64 1 br label %if.end8.i127.i if.else7.i121.i: ; preds = %if.else.i119.i %cnt.i122.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i117.i, i64 0, i32 2 %2 = load i32, ptr %cnt.i122.i, align 4, !tbaa !48 %conv.i123.i = sext i32 %2 to i64 br label %set_main.exit if.end8.i127.i: ; preds = %if.then4.i125.i, %if.then.i131.i %node.1.in.i128.i = phi ptr [ %child.i132.i, %if.then.i131.i ], [ %arrayidx6.i126.i, %if.then4.i125.i ] %node.1.i129.i = load ptr, ptr %node.1.in.i128.i, align 8, !tbaa !31 %tobool.not.i130.i = icmp eq ptr %node.1.i129.i, null br i1 %tobool.not.i130.i, label %set_main.exit, label %while.body.i116.i, !llvm.loop !51 set_main.exit: ; preds = %if.end8.i127.i, %if.end.i, %if.else7.i121.i %retval.0.i = phi i64 [ %conv.i123.i, %if.else7.i121.i ], [ 0, %if.end.i ], [ 0, %if.end8.i127.i ] ret i64 %retval.0.i } ; Function Attrs: nounwind uwtable define dso_local void @set_erase(i32 noundef %set_num, i64 noundef %val, i32 noundef %is_all) local_unnamed_addr #10 { entry: %tobool.not = icmp eq i32 %is_all, 0 %.b114.i4 = load i1, ptr @set_main.set_is_init, align 1 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %entry br i1 %.b114.i4, label %set_main.exit, label %if.then.i if.then.i: ; preds = %if.then store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %if.then, %if.then.i %.pre170.i = sext i32 %set_num to i64 %arrayidx42.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre170.i %0 = load i64, ptr %arrayidx42.i, align 8, !tbaa !5 %dec43.i = add nsw i64 %0, -1 store i64 %dec43.i, ptr %arrayidx42.i, align 8, !tbaa !5 %arrayidx45.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre170.i %call46.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx45.i, i64 noundef %val, i32 noundef 0), !range !50 br label %if.end if.else: ; preds = %entry br i1 %.b114.i4, label %if.end.i, label %if.then.i5 if.then.i5: ; preds = %if.else store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i5, %if.else %.pre169.i = sext i32 %set_num to i64 %arrayidx26.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre169.i %1 = load ptr, ptr %arrayidx26.i, align 8, !tbaa !31 %tobool.not16.i134.i = icmp eq ptr %1, null br i1 %tobool.not16.i134.i, label %cond.false30.i, label %while.body.i135.i while.body.i135.i: ; preds = %if.end.i, %if.end8.i146.i %node.017.i136.i = phi ptr [ %node.1.i148.i, %if.end8.i146.i ], [ %1, %if.end.i ] %2 = load i64, ptr %node.017.i136.i, align 8, !tbaa !47 %cmp.i137.i = icmp sgt i64 %2, %val br i1 %cmp.i137.i, label %if.then.i150.i, label %if.else.i138.i if.then.i150.i: ; preds = %while.body.i135.i %child.i151.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 3 br label %if.end8.i146.i if.else.i138.i: ; preds = %while.body.i135.i %cmp3.i139.i = icmp slt i64 %2, %val br i1 %cmp3.i139.i, label %if.then4.i144.i, label %AVL_set_inside_count.exit152.i if.then4.i144.i: ; preds = %if.else.i138.i %arrayidx6.i145.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 3, i64 1 br label %if.end8.i146.i if.end8.i146.i: ; preds = %if.then4.i144.i, %if.then.i150.i %node.1.in.i147.i = phi ptr [ %child.i151.i, %if.then.i150.i ], [ %arrayidx6.i145.i, %if.then4.i144.i ] %node.1.i148.i = load ptr, ptr %node.1.in.i147.i, align 8, !tbaa !31 %tobool.not.i149.i = icmp eq ptr %node.1.i148.i, null br i1 %tobool.not.i149.i, label %cond.false30.i, label %while.body.i135.i, !llvm.loop !51 AVL_set_inside_count.exit152.i: ; preds = %if.else.i138.i %cnt.i141.i = getelementptr inbounds %struct.node_AVL_set, ptr %node.017.i136.i, i64 0, i32 2 %3 = load i32, ptr %cnt.i141.i, align 4, !tbaa !48 %cmp28.i = icmp sgt i32 %3, 1 br i1 %cmp28.i, label %set_main.exit6, label %cond.false30.i cond.false30.i: ; preds = %if.end8.i146.i, %AVL_set_inside_count.exit152.i, %if.end.i %arrayidx32.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre169.i %4 = load i64, ptr %arrayidx32.i, align 8, !tbaa !5 %dec.i = add nsw i64 %4, -1 store i64 %dec.i, ptr %arrayidx32.i, align 8, !tbaa !5 br label %set_main.exit6 set_main.exit6: ; preds = %AVL_set_inside_count.exit152.i, %cond.false30.i %call37.i = tail call i32 @AVL_set_inside_update(ptr noundef nonnull %arrayidx26.i, i64 noundef %val, i32 noundef 1), !range !50 br label %if.end if.end: ; preds = %set_main.exit6, %set_main.exit ret void } ; Function Attrs: nounwind uwtable define dso_local void @set_clear(i32 noundef %set_num) local_unnamed_addr #10 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre171.i = sext i32 %set_num to i64 %arrayidx51.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre171.i store i64 0, ptr %arrayidx51.i, align 8, !tbaa !5 %arrayidx53.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre171.i %0 = load ptr, ptr %arrayidx53.i, align 8, !tbaa !31 tail call void @AVL_set_inside_free(ptr noundef %0) store ptr null, ptr %arrayidx53.i, align 8, !tbaa !31 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @set_size(i32 noundef %set_num) local_unnamed_addr #23 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %.pre172.i = sext i32 %set_num to i64 %arrayidx60.i = getelementptr inbounds [514511 x i64], ptr @set_main.set_siz, i64 0, i64 %.pre172.i %0 = load i64, ptr %arrayidx60.i, align 8, !tbaa !5 ret i64 %0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_max(i32 noundef %set_num) local_unnamed_addr #22 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre173.i = sext i32 %set_num to i64 %arrayidx65.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre173.i %0 = load ptr, ptr %arrayidx65.i, align 8, !tbaa !31 br label %while.cond.i.i while.cond.i.i: ; preds = %while.cond.i.i, %if.end.i %root.addr.0.i.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i.i ] %arrayidx.i.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i.i, i64 0, i32 3, i64 1 %1 = load ptr, ptr %arrayidx.i.i, align 8, !tbaa !31 %cmp.not.i.i = icmp eq ptr %1, null br i1 %cmp.not.i.i, label %set_main.exit, label %while.cond.i.i, !llvm.loop !52 set_main.exit: ; preds = %while.cond.i.i %2 = load i64, ptr %root.addr.0.i.i, align 8, !tbaa !47 ret i64 %2 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i64 @set_min(i32 noundef %set_num) local_unnamed_addr #22 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %entry %.pre174.i = sext i32 %set_num to i64 %arrayidx71.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre174.i %0 = load ptr, ptr %arrayidx71.i, align 8, !tbaa !31 br label %while.cond.i153.i while.cond.i153.i: ; preds = %while.cond.i153.i, %if.end.i %root.addr.0.i154.i = phi ptr [ %0, %if.end.i ], [ %1, %while.cond.i153.i ] %arrayidx.i155.i = getelementptr inbounds %struct.node_AVL_set, ptr %root.addr.0.i154.i, i64 0, i32 3, i64 0 %1 = load ptr, ptr %arrayidx.i155.i, align 8, !tbaa !31 %cmp.not.i156.i = icmp eq ptr %1, null br i1 %cmp.not.i156.i, label %set_main.exit, label %while.cond.i153.i, !llvm.loop !52 set_main.exit: ; preds = %while.cond.i153.i %2 = load i64, ptr %root.addr.0.i154.i, align 8, !tbaa !47 ret i64 %2 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @set_swap(i64 noundef %set_num1, i64 noundef %set_num2) local_unnamed_addr #23 { entry: %.b114.i = load i1, ptr @set_main.set_is_init, align 1 br i1 %.b114.i, label %set_main.exit, label %if.then.i if.then.i: ; preds = %entry store i1 true, ptr @set_main.set_is_init, align 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_pointer, i8 0, i64 4116088, i1 false), !tbaa !31 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4116088) @set_main.set_siz, i8 0, i64 4116088, i1 false), !tbaa !5 br label %set_main.exit set_main.exit: ; preds = %entry, %if.then.i %sext = shl i64 %set_num1, 32 %.pre175.i = ashr exact i64 %sext, 32 %arrayidx77.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %.pre175.i %arrayidx78.i = getelementptr inbounds [514511 x ptr], ptr @set_main.set_pointer, i64 0, i64 %set_num2 %0 = load ptr, ptr %arrayidx77.i, align 8, !tbaa !31 %1 = load ptr, ptr %arrayidx78.i, align 8, !tbaa !31 store ptr %1, ptr %arrayidx77.i, align 8, !tbaa !31 store ptr %0, ptr %arrayidx78.i, align 8, !tbaa !31 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Bellman_Ford(i64 noundef %start, i64 noundef %vertex, i64 noundef %edges) local_unnamed_addr #24 { entry: %cmp45 = icmp sgt i64 %vertex, 0 br i1 %cmp45, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %vertex, 4 br i1 %min.iters.check, label %for.body.preheader53, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %vertex, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %0 = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %index store <2 x i64> <i64 4611686018427387904, i64 4611686018427387904>, ptr %0, align 16, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 store <2 x i64> <i64 4611686018427387904, i64 4611686018427387904>, ptr %1, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !53 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %vertex br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader53 for.body.preheader53: ; preds = %for.body.preheader, %middle.block %i.046.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %arrayidx1 = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %start store i64 0, ptr %arrayidx1, align 8, !tbaa !5 %cmp647 = icmp sgt i64 %edges, 0 br i1 %cmp647, label %while.body.us.preheader, label %while.body while.body.us.preheader: ; preds = %for.cond.cleanup %smax = tail call i64 @llvm.smax.i64(i64 %vertex, i64 -1) %3 = add i64 %smax, 1 br label %while.body.us while.body.us: ; preds = %while.body.us.preheader, %for.cond5.while.cond.loopexit_crit_edge.us %cnt.050.us = phi i64 [ %inc2.us, %for.cond5.while.cond.loopexit_crit_edge.us ], [ 0, %while.body.us.preheader ] %inc2.us = add nuw i64 %cnt.050.us, 1 %exitcond52 = icmp eq i64 %cnt.050.us, %3 br i1 %exitcond52, label %cleanup, label %for.body8.us for.body8.us: ; preds = %while.body.us, %for.inc30.us %i4.049.us = phi i64 [ %inc31.us, %for.inc30.us ], [ 0, %while.body.us ] %update.148.us = phi i64 [ %update.2.us, %for.inc30.us ], [ 0, %while.body.us ] %arrayidx9.us = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us %4 = load i64, ptr %arrayidx9.us, align 8, !tbaa !54 %arrayidx10.us = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %4 %5 = load i64, ptr %arrayidx10.us, align 8, !tbaa !5 %cmp11.not.us = icmp eq i64 %5, 4611686018427387904 br i1 %cmp11.not.us, label %for.inc30.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body8.us %to.us = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us, i32 1 %6 = load i64, ptr %to.us, align 8, !tbaa !56 %arrayidx13.us = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %6 %7 = load i64, ptr %arrayidx13.us, align 8, !tbaa !5 %cost.us = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us, i32 2 %8 = load i64, ptr %cost.us, align 8, !tbaa !57 %add.us = add nsw i64 %8, %5 %cmp18.us = icmp sgt i64 %7, %add.us br i1 %cmp18.us, label %if.then19.us, label %for.inc30.us if.then19.us: ; preds = %land.lhs.true.us store i64 %add.us, ptr %arrayidx13.us, align 8, !tbaa !5 br label %for.inc30.us for.inc30.us: ; preds = %if.then19.us, %land.lhs.true.us, %for.body8.us %update.2.us = phi i64 [ 1, %if.then19.us ], [ %update.148.us, %land.lhs.true.us ], [ %update.148.us, %for.body8.us ] %inc31.us = add nuw nsw i64 %i4.049.us, 1 %exitcond51.not = icmp eq i64 %inc31.us, %edges br i1 %exitcond51.not, label %for.cond5.while.cond.loopexit_crit_edge.us, label %for.body8.us, !llvm.loop !58 for.cond5.while.cond.loopexit_crit_edge.us: ; preds = %for.inc30.us %tobool.not.us = icmp eq i64 %update.2.us, 0 br i1 %tobool.not.us, label %cleanup, label %while.body.us, !llvm.loop !59 for.body: ; preds = %for.body.preheader53, %for.body %i.046 = phi i64 [ %inc, %for.body ], [ %i.046.ph, %for.body.preheader53 ] %arrayidx = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %i.046 store i64 4611686018427387904, ptr %arrayidx, align 8, !tbaa !5 %inc = add nuw nsw i64 %i.046, 1 %exitcond.not = icmp eq i64 %inc, %vertex br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !60 while.body: ; preds = %for.cond.cleanup %cmp3 = icmp sgt i64 %vertex, -1 %spec.select = zext i1 %cmp3 to i32 br label %cleanup cleanup: ; preds = %while.body.us, %for.cond5.while.cond.loopexit_crit_edge.us, %while.body %.us-phi = phi i32 [ %spec.select, %while.body ], [ 0, %while.body.us ], [ 1, %for.cond5.while.cond.loopexit_crit_edge.us ] ret i32 %.us-phi } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #2 { entry: %v = alloca i64, align 8 %e = alloca i64, align 8 %s = alloca i64, align 8 %t = alloca i64, align 8 %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v) #30 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #30 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %call.i50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #30 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #30 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #30 %0 = load i64, ptr %e, align 8, !tbaa !5 %cmp57 = icmp sgt i64 %0, 0 br i1 %cmp57, label %for.body, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body, %entry %1 = load i64, ptr %v, align 8, !tbaa !5 %cmp561 = icmp sgt i64 %1, 0 br i1 %cmp561, label %for.body7, label %cleanup for.body: ; preds = %entry, %for.body %i.058 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call.i51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call.i52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call.i53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %2 = load i64, ptr %d, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i.058 %cost = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i.058, i32 2 store i64 %2, ptr %cost, align 8, !tbaa !57 %3 = load i64, ptr %s, align 8, !tbaa !5 store i64 %3, ptr %arrayidx, align 8, !tbaa !54 %4 = load i64, ptr %t, align 8, !tbaa !5 %to = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i.058, i32 1 store i64 %4, ptr %to, align 8, !tbaa !56 %inc = add nuw nsw i64 %i.058, 1 %5 = load i64, ptr %e, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %5 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !61 for.body7: ; preds = %for.cond4.preheader, %for.cond.cleanup10 %6 = phi i64 [ %18, %for.cond.cleanup10 ], [ %1, %for.cond4.preheader ] %i3.062 = phi i64 [ %inc31, %for.cond.cleanup10 ], [ 0, %for.cond4.preheader ] %7 = load i64, ptr %e, align 8, !tbaa !5 %cmp45.i = icmp sgt i64 %6, 0 br i1 %cmp45.i, label %for.body.i.preheader, label %for.cond.cleanup.i for.body.i.preheader: ; preds = %for.body7 %min.iters.check = icmp ult i64 %6, 4 br i1 %min.iters.check, label %for.body.i.preheader69, label %vector.ph vector.ph: ; preds = %for.body.i.preheader %n.vec = and i64 %6, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %8 = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %index store <2 x i64> <i64 4611686018427387904, i64 4611686018427387904>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i64, ptr %8, i64 2 store <2 x i64> <i64 4611686018427387904, i64 4611686018427387904>, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !62 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.cond.cleanup.i, label %for.body.i.preheader69 for.body.i.preheader69: ; preds = %for.body.i.preheader, %middle.block %i.046.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ] br label %for.body.i for.cond.cleanup.i: ; preds = %for.body.i, %middle.block, %for.body7 %arrayidx1.i = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %i3.062 store i64 0, ptr %arrayidx1.i, align 8, !tbaa !5 %cmp647.i = icmp sgt i64 %7, 0 br i1 %cmp647.i, label %while.body.us.preheader.i, label %Bellman_Ford.exit while.body.us.preheader.i: ; preds = %for.cond.cleanup.i %smax.i = call i64 @llvm.smax.i64(i64 %6, i64 -1) %11 = add i64 %smax.i, 1 br label %while.body.us.i while.body.us.i: ; preds = %for.cond5.while.cond.loopexit_crit_edge.us.i, %while.body.us.preheader.i %cnt.050.us.i = phi i64 [ %inc2.us.i, %for.cond5.while.cond.loopexit_crit_edge.us.i ], [ 0, %while.body.us.preheader.i ] %inc2.us.i = add nuw i64 %cnt.050.us.i, 1 %exitcond52.i = icmp eq i64 %cnt.050.us.i, %11 br i1 %exitcond52.i, label %if.else27, label %for.body8.us.i for.body8.us.i: ; preds = %while.body.us.i, %for.inc30.us.i %i4.049.us.i = phi i64 [ %inc31.us.i, %for.inc30.us.i ], [ 0, %while.body.us.i ] %update.148.us.i = phi i64 [ %update.2.us.i, %for.inc30.us.i ], [ 0, %while.body.us.i ] %arrayidx9.us.i = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us.i %12 = load i64, ptr %arrayidx9.us.i, align 8, !tbaa !54 %arrayidx10.us.i = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %12 %13 = load i64, ptr %arrayidx10.us.i, align 8, !tbaa !5 %cmp11.not.us.i = icmp eq i64 %13, 4611686018427387904 br i1 %cmp11.not.us.i, label %for.inc30.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %to.us.i = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us.i, i32 1 %14 = load i64, ptr %to.us.i, align 8, !tbaa !56 %arrayidx13.us.i = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %14 %15 = load i64, ptr %arrayidx13.us.i, align 8, !tbaa !5 %cost.us.i = getelementptr inbounds [11511 x %struct.graph_info], ptr @edge, i64 0, i64 %i4.049.us.i, i32 2 %16 = load i64, ptr %cost.us.i, align 8, !tbaa !57 %add.us.i = add nsw i64 %16, %13 %cmp18.us.i = icmp sgt i64 %15, %add.us.i br i1 %cmp18.us.i, label %if.then19.us.i, label %for.inc30.us.i if.then19.us.i: ; preds = %land.lhs.true.us.i store i64 %add.us.i, ptr %arrayidx13.us.i, align 8, !tbaa !5 br label %for.inc30.us.i for.inc30.us.i: ; preds = %if.then19.us.i, %land.lhs.true.us.i, %for.body8.us.i %update.2.us.i = phi i64 [ 1, %if.then19.us.i ], [ %update.148.us.i, %land.lhs.true.us.i ], [ %update.148.us.i, %for.body8.us.i ] %inc31.us.i = add nuw nsw i64 %i4.049.us.i, 1 %exitcond51.not.i = icmp eq i64 %inc31.us.i, %7 br i1 %exitcond51.not.i, label %for.cond5.while.cond.loopexit_crit_edge.us.i, label %for.body8.us.i, !llvm.loop !58 for.cond5.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc30.us.i %tobool.not.us.i = icmp eq i64 %update.2.us.i, 0 br i1 %tobool.not.us.i, label %for.cond8.preheader, label %while.body.us.i, !llvm.loop !59 for.body.i: ; preds = %for.body.i.preheader69, %for.body.i %i.046.i = phi i64 [ %inc.i, %for.body.i ], [ %i.046.i.ph, %for.body.i.preheader69 ] %arrayidx.i = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %i.046.i store i64 4611686018427387904, ptr %arrayidx.i, align 8, !tbaa !5 %inc.i = add nuw nsw i64 %i.046.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %6 br i1 %exitcond.not.i, label %for.cond.cleanup.i, label %for.body.i, !llvm.loop !63 Bellman_Ford.exit: ; preds = %for.cond.cleanup.i %cmp3.i = icmp slt i64 %6, 0 br i1 %cmp3.i, label %if.else27, label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond5.while.cond.loopexit_crit_edge.us.i, %Bellman_Ford.exit br i1 %cmp45.i, label %if.end.peel, label %for.cond.cleanup10 if.end.peel: ; preds = %for.cond8.preheader %.pre = load i64, ptr @ans, align 16, !tbaa !5 %cmp16.peel = icmp sgt i64 %.pre, 1000000000000000 br i1 %cmp16.peel, label %if.then18.peel, label %if.else.peel if.else.peel: ; preds = %if.end.peel %call21.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.pre) br label %for.inc23.peel if.then18.peel: ; preds = %if.end.peel %call19.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3) br label %for.inc23.peel for.inc23.peel: ; preds = %if.then18.peel, %if.else.peel %17 = load i64, ptr %v, align 8, !tbaa !5 %cmp9.peel = icmp sgt i64 %17, 1 br i1 %cmp9.peel, label %if.end, label %for.cond.cleanup10 for.cond.cleanup10: ; preds = %for.inc23, %for.inc23.peel, %for.cond8.preheader %putchar = call i32 @putchar(i32 10) %inc31 = add nuw nsw i64 %i3.062, 1 %18 = load i64, ptr %v, align 8, !tbaa !5 %cmp5 = icmp slt i64 %inc31, %18 br i1 %cmp5, label %for.body7, label %cleanup, !llvm.loop !64 if.end: ; preds = %for.inc23.peel, %for.inc23 %j.060 = phi i64 [ %inc24, %for.inc23 ], [ 1, %for.inc23.peel ] %putchar49 = call i32 @putchar(i32 32) %arrayidx15 = getelementptr inbounds [2141 x i64], ptr @ans, i64 0, i64 %j.060 %19 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %cmp16 = icmp sgt i64 %19, 1000000000000000 br i1 %cmp16, label %if.then18, label %if.else if.then18: ; preds = %if.end %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3) br label %for.inc23 if.else: ; preds = %if.end %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %19) br label %for.inc23 for.inc23: ; preds = %if.then18, %if.else %inc24 = add nuw nsw i64 %j.060, 1 %20 = load i64, ptr %v, align 8, !tbaa !5 %cmp9 = icmp slt i64 %inc24, %20 br i1 %cmp9, label %if.end, label %for.cond.cleanup10, !llvm.loop !65 if.else27: ; preds = %Bellman_Ford.exit, %while.body.us.i %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup cleanup: ; preds = %for.cond.cleanup10, %for.cond4.preheader, %if.else27 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #30 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #30 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s) #30 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #30 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v) #30 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: tail call void @solve() ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #25 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #26 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #26 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #27 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #25 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #12 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #19 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #20 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #22 = { nofree nosync nounwind memory(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 #23 = { 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 #24 = { 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 #25 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #26 = { nofree nounwind } attributes #27 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #28 = { nounwind allocsize(1) } attributes #29 = { nounwind willreturn memory(read) } attributes #30 = { nounwind } attributes #31 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !17} !21 = !{!7, !7, i64 0} !22 = distinct !{!22, !17} !23 = !{!24, !24, i64 0} !24 = !{!"int", !7, i64 0} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10, !28, !11, !12} !28 = !{!"llvm.loop.peeled.count", i32 1} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = !{!32, !32, i64 0} !32 = !{!"any pointer", !7, i64 0} !33 = distinct !{!33, !10} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !10} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10, !11, !12} !42 = distinct !{!42, !10, !12, !11} !43 = !{!44, !6, i64 0} !44 = !{!"", !6, i64 0, !6, i64 8} !45 = !{!46, !24, i64 8} !46 = !{!"node_AVL_set", !6, i64 0, !24, i64 8, !24, i64 12, !7, i64 16} !47 = !{!46, !6, i64 0} !48 = !{!46, !24, i64 12} !49 = distinct !{!49, !10} !50 = !{i32 -1, i32 2} !51 = distinct !{!51, !10} !52 = distinct !{!52, !10} !53 = distinct !{!53, !10, !11, !12} !54 = !{!55, !6, i64 0} !55 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16} !56 = !{!55, !6, i64 8} !57 = !{!55, !6, i64 16} !58 = distinct !{!58, !10} !59 = distinct !{!59, !10} !60 = distinct !{!60, !10, !12, !11} !61 = distinct !{!61, !10} !62 = distinct !{!62, !10, !11, !12} !63 = distinct !{!63, !10, !12, !11} !64 = distinct !{!64, !10} !65 = distinct !{!65, !10, !28}
#include <stdio.h> #include <stdlib.h> #define ll_int long long int #define BUCKET_SIZE 100000 int ELEMENT_N; typedef struct data_t{ ll_int num; int n; struct data_t *next; } DATA_T; DATA_T *S[BUCKET_SIZE]; // ハッシュテーブルの初期化 void Init() { int i; for(i = 0; i < BUCKET_SIZE; i++) S[i] = NULL; } ll_int Hash(ll_int num) { return num % BUCKET_SIZE; } DATA_T *Find(ll_int num) { ll_int h; DATA_T *p; h = Hash(num); for(p = S[h]; p != NULL; p = p->next) if(num == p->num) return p; return NULL; } void Insert(ll_int num) { ll_int h; DATA_T *p; if(( p = Find(num) )){ p->n++; return; } if( ( p = (DATA_T *)malloc(sizeof(DATA_T)) ) == NULL){ printf("malloc error\n"); exit(1); } h = Hash(num); p->num = num; p->n = 1; p->next = S[h]; S[h] = p; ELEMENT_N++; } int main() { int q; int query; ll_int num; DATA_T *p; int i; ELEMENT_N = 0; scanf("%d", &q); for(i = 0; i < q; i++){ scanf("%d", &query); if(query){ // find scanf("%lld", &num); if(( p = Find(num) )) printf("1\n"); else printf("0\n"); }else{ // insert scanf("%lld", &num); Insert(num); printf("%d\n", ELEMENT_N); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118911/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118911/source.c" target datalayout = "e-m:e-p270: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.data_t = type { i64, i32, ptr } @S = dso_local local_unnamed_addr global [100000 x ptr] zeroinitializer, align 16 @ELEMENT_N = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [13 x i8] c"malloc error\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Init() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) @S, i8 0, i64 800000, i1 false), !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @Hash(i64 noundef %num) local_unnamed_addr #2 { entry: %rem = srem i64 %num, 100000 ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local ptr @Find(i64 noundef %num) local_unnamed_addr #3 { entry: %rem.i = srem i64 %num, 100000 %arrayidx = getelementptr inbounds [100000 x ptr], ptr @S, i64 0, i64 %rem.i %p.08 = load ptr, ptr %arrayidx, align 8, !tbaa !5 %cmp.not9 = icmp eq ptr %p.08, null br i1 %cmp.not9, label %cleanup, label %for.body for.body: ; preds = %entry, %for.inc %p.010 = phi ptr [ %p.0, %for.inc ], [ %p.08, %entry ] %0 = load i64, ptr %p.010, align 8, !tbaa !9 %cmp2 = icmp eq i64 %0, %num br i1 %cmp2, label %cleanup, label %for.inc for.inc: ; preds = %for.body %next = getelementptr inbounds %struct.data_t, ptr %p.010, i64 0, i32 2 %p.0 = load ptr, ptr %next, align 8, !tbaa !5 %cmp.not = icmp eq ptr %p.0, null br i1 %cmp.not, label %cleanup, label %for.body, !llvm.loop !13 cleanup: ; preds = %for.body, %for.inc, %entry %p.0.lcssa = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p.010, %for.body ] ret ptr %p.0.lcssa } ; Function Attrs: nounwind uwtable define dso_local void @Insert(i64 noundef %num) local_unnamed_addr #4 { entry: %rem.i.i = srem i64 %num, 100000 %arrayidx.i = getelementptr inbounds [100000 x ptr], ptr @S, i64 0, i64 %rem.i.i %p.08.i = load ptr, ptr %arrayidx.i, align 8, !tbaa !5 %cmp.not9.i = icmp eq ptr %p.08.i, null br i1 %cmp.not9.i, label %if.end, label %for.body.i for.body.i: ; preds = %entry, %for.inc.i %p.010.i = phi ptr [ %p.0.i, %for.inc.i ], [ %p.08.i, %entry ] %0 = load i64, ptr %p.010.i, align 8, !tbaa !9 %cmp2.i = icmp eq i64 %0, %num br i1 %cmp2.i, label %if.then, label %for.inc.i for.inc.i: ; preds = %for.body.i %next.i = getelementptr inbounds %struct.data_t, ptr %p.010.i, i64 0, i32 2 %p.0.i = load ptr, ptr %next.i, align 8, !tbaa !5 %cmp.not.i = icmp eq ptr %p.0.i, null br i1 %cmp.not.i, label %if.end, label %for.body.i, !llvm.loop !13 if.then: ; preds = %for.body.i %n = getelementptr inbounds %struct.data_t, ptr %p.010.i, i64 0, i32 1 %1 = load i32, ptr %n, align 8, !tbaa !15 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %n, align 8, !tbaa !15 br label %cleanup if.end: ; preds = %for.inc.i, %entry %call1 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #10 %cmp = icmp eq ptr %call1, null br i1 %cmp, label %if.then2, label %if.end4 if.then2: ; preds = %if.end %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) tail call void @exit(i32 noundef 1) #11 unreachable if.end4: ; preds = %if.end store i64 %num, ptr %call1, align 8, !tbaa !9 %n7 = getelementptr inbounds %struct.data_t, ptr %call1, i64 0, i32 1 store i32 1, ptr %n7, align 8, !tbaa !15 %next = getelementptr inbounds %struct.data_t, ptr %call1, i64 0, i32 2 store ptr %p.08.i, ptr %next, align 8, !tbaa !16 store ptr %call1, ptr %arrayidx.i, align 8, !tbaa !5 %2 = load i32, ptr @ELEMENT_N, align 4, !tbaa !17 %inc9 = add nsw i32 %2, 1 store i32 %inc9, ptr @ELEMENT_N, align 4, !tbaa !17 br label %cleanup cleanup: ; preds = %if.end4, %if.then ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #7 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %q = alloca i32, align 4 %query = alloca i32, align 4 %num = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %query) #12 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #12 store i32 0, ptr @ELEMENT_N, align 4, !tbaa !17 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !17 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.019 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %query) %1 = load i32, ptr %query, align 4, !tbaa !17 %tobool.not = icmp eq i32 %1, 0 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %num) %2 = load i64, ptr %num, align 8, !tbaa !18 %rem.i.i.i = srem i64 %2, 100000 %arrayidx.i.i = getelementptr inbounds [100000 x ptr], ptr @S, i64 0, i64 %rem.i.i.i %p.08.i.i = load ptr, ptr %arrayidx.i.i, align 8, !tbaa !5 %cmp.not9.i.i = icmp eq ptr %p.08.i.i, null br i1 %tobool.not, label %if.else8, label %if.then if.then: ; preds = %for.body br i1 %cmp.not9.i.i, label %if.else, label %for.body.i for.body.i: ; preds = %if.then, %for.inc.i %p.010.i = phi ptr [ %p.0.i, %for.inc.i ], [ %p.08.i.i, %if.then ] %3 = load i64, ptr %p.010.i, align 8, !tbaa !9 %cmp2.i = icmp eq i64 %3, %2 br i1 %cmp2.i, label %if.then5, label %for.inc.i for.inc.i: ; preds = %for.body.i %next.i = getelementptr inbounds %struct.data_t, ptr %p.010.i, i64 0, i32 2 %p.0.i = load ptr, ptr %next.i, align 8, !tbaa !5 %cmp.not.i = icmp eq ptr %p.0.i, null br i1 %cmp.not.i, label %if.else, label %for.body.i, !llvm.loop !13 if.then5: ; preds = %for.body.i %puts13 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7) br label %for.inc if.else: ; preds = %for.inc.i, %if.then %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %for.inc if.else8: ; preds = %for.body br i1 %cmp.not9.i.i, label %if.end.i, label %for.body.i.i for.body.i.i: ; preds = %if.else8, %for.inc.i.i %p.010.i.i = phi ptr [ %p.0.i.i, %for.inc.i.i ], [ %p.08.i.i, %if.else8 ] %4 = load i64, ptr %p.010.i.i, align 8, !tbaa !9 %cmp2.i.i = icmp eq i64 %4, %2 br i1 %cmp2.i.i, label %if.then.i, label %for.inc.i.i for.inc.i.i: ; preds = %for.body.i.i %next.i.i = getelementptr inbounds %struct.data_t, ptr %p.010.i.i, i64 0, i32 2 %p.0.i.i = load ptr, ptr %next.i.i, align 8, !tbaa !5 %cmp.not.i.i = icmp eq ptr %p.0.i.i, null br i1 %cmp.not.i.i, label %if.end.i, label %for.body.i.i, !llvm.loop !13 if.then.i: ; preds = %for.body.i.i %n.i = getelementptr inbounds %struct.data_t, ptr %p.010.i.i, i64 0, i32 1 %5 = load i32, ptr %n.i, align 8, !tbaa !15 %inc.i = add nsw i32 %5, 1 store i32 %inc.i, ptr %n.i, align 8, !tbaa !15 %.pre = load i32, ptr @ELEMENT_N, align 4, !tbaa !17 br label %Insert.exit if.end.i: ; preds = %for.inc.i.i, %if.else8 %call1.i = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #10 %cmp.i = icmp eq ptr %call1.i, null br i1 %cmp.i, label %if.then2.i, label %if.end4.i if.then2.i: ; preds = %if.end.i %puts.i = call i32 @puts(ptr nonnull dereferenceable(1) @str) call void @exit(i32 noundef 1) #11 unreachable if.end4.i: ; preds = %if.end.i store i64 %2, ptr %call1.i, align 8, !tbaa !9 %n7.i = getelementptr inbounds %struct.data_t, ptr %call1.i, i64 0, i32 1 store i32 1, ptr %n7.i, align 8, !tbaa !15 %next.i14 = getelementptr inbounds %struct.data_t, ptr %call1.i, i64 0, i32 2 store ptr %p.08.i.i, ptr %next.i14, align 8, !tbaa !16 store ptr %call1.i, ptr %arrayidx.i.i, align 8, !tbaa !5 %6 = load i32, ptr @ELEMENT_N, align 4, !tbaa !17 %inc9.i = add nsw i32 %6, 1 store i32 %inc9.i, ptr @ELEMENT_N, align 4, !tbaa !17 br label %Insert.exit Insert.exit: ; preds = %if.then.i, %if.end4.i %7 = phi i32 [ %.pre, %if.then.i ], [ %inc9.i, %if.end4.i ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %7) br label %for.inc for.inc: ; preds = %Insert.exit, %if.else, %if.then5 %inc = add nuw nsw i32 %i.019, 1 %8 = load i32, ptr %q, align 4, !tbaa !17 %cmp = icmp slt i32 %inc, %8 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !19 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %query) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #12 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nounwind allocsize(0) } attributes #11 = { noreturn nounwind } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !11, i64 0} !10 = !{!"data_t", !11, i64 0, !12, i64 8, !6, i64 16} !11 = !{!"long long", !7, i64 0} !12 = !{!"int", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!10, !12, i64 8} !16 = !{!10, !6, i64 16} !17 = !{!12, !12, i64 0} !18 = !{!11, !11, i64 0} !19 = distinct !{!19, !14}
#include<stdio.h> int r=0,d[100010],p[100010]={}; int ta[10010],nt[100010],to[100010]; int R=1,C=1,H[2000010],N[2000010]; //評価関数(いまはMIN) int hyouka(int a,int b){ if(C<b)return 1; if(C<a||b==0)return 0; return N[H[a]]<N[H[b]]?1:0; } //挿入関数 void hin(int a){ int i=C++; for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2]; H[i]=R++; } //取り出す関数 int hout(){ int rt=H[1],i,j=2,k=H[--C]; for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)]; H[j/2]=k; return rt; } int main(){ int n,i,a,b,r,t,q[100010],c[100010]={}; long long s=0; scanf("%d",&n); for(i=0;i<n;i++)ta[i+1]=-1; for(i=0;i<n-1;i++){ scanf("%d %d",&a,&b); nt[i ]=ta[to[i+n-1]=a]; nt[i+n-1]=ta[to[i ]=b]; ta[b]=i+n-1; ta[a]=i; c[a]++; c[b]++; } /*for(i=0;i<n;i++){printf("%d:",i+1); for(t=ta[i+1];t+1;t=nt[t])printf(" %d",to[t]); printf("\n"); }//*/ for(i=0;i<n;i++){ scanf("%d",&a); hin(a); s+=a; } for(i=r=0;i<n;i++)d[i]=N[hout()]; for(i=1;i<=n;i++){ if(c[i]==1)q[r++]=i; } //for(i=0;i<n;i++)printf("%d\n",c[i+1]); for(t=0;r-t;t++){//printf("t:%d %d\n",t,q[t]); p[q[t]]=d[t]; for(i=ta[q[t]];i+1;i=nt[i]){ c[to[i]]--; if(c[to[i]]==1)q[r++]=to[i]; } } printf("%lld\n",s-d[n-1]); for(i=0;i<n;i++)printf("%d%c",p[i+1],i+1-n?' ':'\n'); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118955/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118955/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @r = dso_local local_unnamed_addr global i32 0, align 4 @p = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @R = dso_local local_unnamed_addr global i32 1, align 4 @C = dso_local local_unnamed_addr global i32 1, align 4 @N = dso_local local_unnamed_addr global [2000010 x i32] zeroinitializer, align 16 @H = dso_local local_unnamed_addr global [2000010 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @ta = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @to = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @nt = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @hyouka(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr @C, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %b br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %cmp1 = icmp slt i32 %0, %a %cmp2 = icmp eq i32 %b, 0 %or.cond = or i1 %cmp2, %cmp1 br i1 %or.cond, label %return, label %if.end4 if.end4: ; preds = %if.end %idxprom = sext i32 %a to i64 %arrayidx = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom5 = sext i32 %1 to i64 %arrayidx6 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %b to i64 %arrayidx8 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7 %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %idxprom9 = sext i32 %3 to i64 %arrayidx10 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp slt i32 %2, %4 %cond = zext i1 %cmp11 to i32 br label %return return: ; preds = %if.end, %entry, %if.end4 %retval.0 = phi i32 [ %cond, %if.end4 ], [ 1, %entry ], [ 0, %if.end ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @hin(i32 noundef %a) local_unnamed_addr #1 { entry: %0 = load i32, ptr @C, align 4, !tbaa !5 %.fr = freeze i32 %0 %inc = add nsw i32 %.fr, 1 store i32 %inc, ptr @C, align 4, !tbaa !5 %1 = load i32, ptr @R, align 4, !tbaa !5 store i32 %1, ptr @H, align 16, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom store i32 %a, ptr %arrayidx, align 4, !tbaa !5 %cmp1.i = icmp slt i32 %.fr, -1 br i1 %cmp1.i, label %entry.split.us, label %for.cond entry.split.us: ; preds = %entry %.fr.nonneg = sub i32 0, %.fr %div.us192426 = lshr i32 %.fr.nonneg, 1 %div.us1924.neg = sub nsw i32 0, %div.us192426 %cmp.i.us20 = icmp ult i32 %inc, %div.us1924.neg br i1 %cmp.i.us20, label %for.body.us, label %for.end for.body.us: ; preds = %entry.split.us, %for.body.us %div.us22 = phi i32 [ %div.us, %for.body.us ], [ %div.us1924.neg, %entry.split.us ] %i.0.us21 = phi i32 [ %div.us22, %for.body.us ], [ %.fr, %entry.split.us ] %idxprom2.us = sext i32 %div.us22 to i64 %arrayidx3.us = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us %2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %idxprom4.us = sext i32 %i.0.us21 to i64 %arrayidx5.us = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us store i32 %2, ptr %arrayidx5.us, align 4, !tbaa !5 %div.us = sdiv i32 %div.us22, 2 %cmp.i.us = icmp slt i32 %inc, %div.us br i1 %cmp.i.us, label %for.body.us, label %for.end, !llvm.loop !9 for.cond: ; preds = %entry, %for.body %i.0 = phi i32 [ %div, %for.body ], [ %.fr, %entry ] %div = sdiv i32 %i.0, 2 %cmp.i = icmp slt i32 %inc, %div br i1 %cmp.i, label %for.cond.for.body_crit_edge, label %if.end.i for.cond.for.body_crit_edge: ; preds = %for.cond %idxprom2.phi.trans.insert = sext i32 %div to i64 %arrayidx3.phi.trans.insert = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert %.pre = load i32, ptr %arrayidx3.phi.trans.insert, align 4, !tbaa !5 br label %for.body if.end.i: ; preds = %for.cond %i.0.off = add i32 %i.0, 1 %cmp2.i = icmp ult i32 %i.0.off, 3 br i1 %cmp2.i, label %for.end, label %hyouka.exit hyouka.exit: ; preds = %if.end.i %3 = load i32, ptr @H, align 16, !tbaa !5 %idxprom5.i = sext i32 %3 to i64 %arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i %4 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %idxprom7.i = sext i32 %div to i64 %arrayidx8.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i %5 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5 %idxprom9.i = sext i32 %5 to i64 %arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i %6 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %cmp11.i.not = icmp slt i32 %4, %6 br i1 %cmp11.i.not, label %for.body, label %for.end for.body: ; preds = %for.cond.for.body_crit_edge, %hyouka.exit %7 = phi i32 [ %.pre, %for.cond.for.body_crit_edge ], [ %5, %hyouka.exit ] %idxprom4 = sext i32 %i.0 to i64 %arrayidx5 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4 store i32 %7, ptr %arrayidx5, align 4, !tbaa !5 br label %for.cond, !llvm.loop !9 for.end: ; preds = %hyouka.exit, %if.end.i, %for.body.us, %entry.split.us %.us-phi = phi i32 [ %.fr, %entry.split.us ], [ %div.us22, %for.body.us ], [ %i.0, %if.end.i ], [ %i.0, %hyouka.exit ] %inc7 = add nsw i32 %1, 1 store i32 %inc7, ptr @R, align 4, !tbaa !5 %idxprom8 = sext i32 %.us-phi to i64 %arrayidx9 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8 store i32 %1, ptr %arrayidx9, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @hout() local_unnamed_addr #1 { entry: %0 = load i32, ptr getelementptr inbounds ([2000010 x i32], ptr @H, i64 0, i64 1), align 4, !tbaa !5 %1 = load i32, ptr @C, align 4, !tbaa !5 %.fr = freeze i32 %1 %dec = add i32 %.fr, -1 store i32 %dec, ptr @C, align 4, !tbaa !5 %idxprom = sext i32 %dec to i64 %arrayidx = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %or.cond.i35 = icmp slt i32 %.fr, 2 br i1 %or.cond.i35, label %for.end, label %hyouka.exit.lr.ph.split hyouka.exit.lr.ph.split: ; preds = %entry %idxprom5.i40 = sext i32 %0 to i64 %arrayidx6.i41 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i40 %3 = load i32, ptr %arrayidx6.i41, align 4, !tbaa !5 %idxprom9.i42 = sext i32 %2 to i64 %arrayidx10.i43 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i42 %4 = load i32, ptr %arrayidx10.i43, align 4, !tbaa !5 %cmp11.i.not44 = icmp slt i32 %3, %4 br i1 %cmp11.i.not44, label %for.body, label %for.end hyouka.exit: ; preds = %hyouka.exit31 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom5.i = sext i32 %5 to i64 %arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i %6 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom9.i = sext i32 %7 to i64 %arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i %8 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %cmp11.i.not = icmp slt i32 %6, %8 br i1 %cmp11.i.not, label %for.body, label %for.end.loopexit, !llvm.loop !11 for.body: ; preds = %hyouka.exit.lr.ph.split, %hyouka.exit %i.03745 = phi i32 [ %sub, %hyouka.exit ], [ 1, %hyouka.exit.lr.ph.split ] %mul = shl nsw i32 %i.03745, 1 %add = or i32 %mul, 1 %cmp.i16.not = icmp sgt i32 %.fr, %add br i1 %cmp.i16.not, label %if.end.i17, label %hyouka.exit31 if.end.i17: ; preds = %for.body %cmp1.i18.not = icmp sgt i32 %.fr, %mul br i1 %cmp1.i18.not, label %if.end4.i19, label %hyouka.exit31 if.end4.i19: ; preds = %if.end.i17 %idxprom.i20 = sext i32 %mul to i64 %arrayidx.i21 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i20 %9 = load i32, ptr %arrayidx.i21, align 8, !tbaa !5 %idxprom5.i22 = sext i32 %9 to i64 %arrayidx6.i23 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i22 %10 = load i32, ptr %arrayidx6.i23, align 4, !tbaa !5 %idxprom7.i24 = sext i32 %add to i64 %arrayidx8.i25 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i24 %11 = load i32, ptr %arrayidx8.i25, align 4, !tbaa !5 %idxprom9.i26 = sext i32 %11 to i64 %arrayidx10.i27 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i26 %12 = load i32, ptr %arrayidx10.i27, align 4, !tbaa !5 %cmp11.i28 = icmp slt i32 %10, %12 %cond.i29.neg = sext i1 %cmp11.i28 to i32 br label %hyouka.exit31 hyouka.exit31: ; preds = %for.body, %if.end.i17, %if.end4.i19 %retval.0.i30.neg = phi i32 [ %cond.i29.neg, %if.end4.i19 ], [ -1, %for.body ], [ 0, %if.end.i17 ] %sub = add i32 %retval.0.i30.neg, %add %idxprom5 = sext i32 %sub to i64 %arrayidx6 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom5 %13 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = sext i32 %i.03745 to i64 %arrayidx8 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7 store i32 %13, ptr %arrayidx8, align 4, !tbaa !5 %cmp1.i.not = icmp sgt i32 %.fr, %sub br i1 %cmp1.i.not, label %hyouka.exit, label %for.end.loopexit, !llvm.loop !11 for.end.loopexit: ; preds = %hyouka.exit31, %hyouka.exit %14 = sdiv i32 %sub, 2 %15 = sext i32 %14 to i64 br label %for.end for.end: ; preds = %for.end.loopexit, %hyouka.exit.lr.ph.split, %entry %j.0.lcssa = phi i64 [ 1, %entry ], [ 1, %hyouka.exit.lr.ph.split ], [ %15, %for.end.loopexit ] %arrayidx10 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %j.0.lcssa store i32 %2, ptr %arrayidx10, align 4, !tbaa !5 ret i32 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %q = alloca [100010 x i32], align 16 %c = alloca [100010 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 %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %c) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400040) %c, i8 0, i64 400040, 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 %cmp177 = icmp sgt i32 %0, 0 br i1 %cmp177, label %for.cond1.preheader, label %for.end110 for.cond1.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 4 getelementptr inbounds ([10010 x i32], ptr @ta, i64 0, i64 1), i8 -1, i64 %2, i1 false), !tbaa !5 %cmp2180.not = icmp eq i32 %0, 1 br i1 %cmp2180.not, label %for.body38.preheader, label %for.body3 for.cond36.preheader: ; preds = %for.body3 %cmp37182 = icmp sgt i32 %4, 0 br i1 %cmp37182, label %for.body38.preheader, label %for.end110 for.body38.preheader: ; preds = %for.cond1.preheader, %for.cond36.preheader br label %for.body38 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = trunc i64 %indvars.iv to i32 %6 = add i32 %5, -1 %sub6 = add i32 %6, %4 %idxprom7 = sext i32 %sub6 to i64 %arrayidx8 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %idxprom7 store i32 %3, ptr %arrayidx8, align 4, !tbaa !5 %idxprom9 = sext i32 %3 to i64 %arrayidx10 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom9 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %indvars.iv store i32 %7, ptr %arrayidx12, align 4, !tbaa !5 %8 = load i32, ptr %b, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %indvars.iv store i32 %8, ptr %arrayidx14, align 4, !tbaa !5 %idxprom15 = sext i32 %8 to i64 %arrayidx16 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom15 %9 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %arrayidx20 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %idxprom7 store i32 %9, ptr %arrayidx20, align 4, !tbaa !5 store i32 %sub6, ptr %arrayidx16, align 4, !tbaa !5 %10 = trunc i64 %indvars.iv to i32 store i32 %10, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx28 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %idxprom9 %11 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %inc29 = add nsw i32 %11, 1 store i32 %inc29, ptr %arrayidx28, align 4, !tbaa !5 %arrayidx31 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %idxprom15 %12 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %inc32 = add nsw i32 %12, 1 store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %sub = add nsw i32 %4, -1 %13 = sext i32 %sub to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp2, label %for.body3, label %for.cond36.preheader, !llvm.loop !12 for.cond44.preheader: ; preds = %hin.exit %cmp45187 = icmp sgt i32 %23, 0 br i1 %cmp45187, label %for.body47.preheader, label %for.end110 for.body47.preheader: ; preds = %for.cond44.preheader %wide.trip.count = zext i32 %23 to i64 br label %for.body47 for.body38: ; preds = %for.body38.preheader, %hin.exit %s.0184 = phi i64 [ %add40, %hin.exit ], [ 0, %for.body38.preheader ] %i.2183 = phi i32 [ %inc42, %hin.exit ], [ 0, %for.body38.preheader ] %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %14 = load i32, ptr %a, align 4, !tbaa !5 %15 = load i32, ptr @C, align 4, !tbaa !5 %.fr.i = freeze i32 %15 %inc.i = add i32 %.fr.i, 1 store i32 %inc.i, ptr @C, align 4, !tbaa !5 %16 = load i32, ptr @R, align 4, !tbaa !5 store i32 %16, ptr @H, align 16, !tbaa !5 %idxprom.i = sext i32 %16 to i64 %arrayidx.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom.i store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i.i = icmp slt i32 %.fr.i, -1 br i1 %cmp1.i.i, label %entry.split.us.i, label %for.cond.i entry.split.us.i: ; preds = %for.body38 %.fr.nonneg.i = sub i32 0, %.fr.i %div.us192426.i = lshr i32 %.fr.nonneg.i, 1 %div.us1924.neg.i = sub nsw i32 0, %div.us192426.i %cmp.i.us20.i = icmp ult i32 %inc.i, %div.us1924.neg.i br i1 %cmp.i.us20.i, label %for.body.us.i, label %hin.exit for.body.us.i: ; preds = %entry.split.us.i, %for.body.us.i %div.us22.i = phi i32 [ %div.us.i, %for.body.us.i ], [ %div.us1924.neg.i, %entry.split.us.i ] %i.0.us21.i = phi i32 [ %div.us22.i, %for.body.us.i ], [ %.fr.i, %entry.split.us.i ] %idxprom2.us.i = sext i32 %div.us22.i to i64 %arrayidx3.us.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.us.i %17 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %idxprom4.us.i = sext i32 %i.0.us21.i to i64 %arrayidx5.us.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.us.i store i32 %17, ptr %arrayidx5.us.i, align 4, !tbaa !5 %div.us.i = sdiv i32 %div.us22.i, 2 %cmp.i.us.i = icmp slt i32 %inc.i, %div.us.i br i1 %cmp.i.us.i, label %for.body.us.i, label %hin.exit, !llvm.loop !9 for.cond.i: ; preds = %for.body38, %for.body.i %i.0.i = phi i32 [ %div.i, %for.body.i ], [ %.fr.i, %for.body38 ] %div.i = sdiv i32 %i.0.i, 2 %cmp.i.i = icmp slt i32 %inc.i, %div.i br i1 %cmp.i.i, label %for.cond.for.body_crit_edge.i, label %if.end.i.i for.cond.for.body_crit_edge.i: ; preds = %for.cond.i %idxprom2.phi.trans.insert.i = sext i32 %div.i to i64 %arrayidx3.phi.trans.insert.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom2.phi.trans.insert.i %.pre.i = load i32, ptr %arrayidx3.phi.trans.insert.i, align 4, !tbaa !5 br label %for.body.i if.end.i.i: ; preds = %for.cond.i %i.0.off.i = add i32 %i.0.i, 1 %cmp2.i.i = icmp ult i32 %i.0.off.i, 3 br i1 %cmp2.i.i, label %hin.exit, label %hyouka.exit.i hyouka.exit.i: ; preds = %if.end.i.i %18 = load i32, ptr @H, align 16, !tbaa !5 %idxprom5.i.i = sext i32 %18 to i64 %arrayidx6.i.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i %19 = load i32, ptr %arrayidx6.i.i, align 4, !tbaa !5 %idxprom7.i.i = sext i32 %div.i to i64 %arrayidx8.i.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i.i %20 = load i32, ptr %arrayidx8.i.i, align 4, !tbaa !5 %idxprom9.i.i = sext i32 %20 to i64 %arrayidx10.i.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i %21 = load i32, ptr %arrayidx10.i.i, align 4, !tbaa !5 %cmp11.i.not.i = icmp slt i32 %19, %21 br i1 %cmp11.i.not.i, label %for.body.i, label %hin.exit for.body.i: ; preds = %hyouka.exit.i, %for.cond.for.body_crit_edge.i %22 = phi i32 [ %.pre.i, %for.cond.for.body_crit_edge.i ], [ %20, %hyouka.exit.i ] %idxprom4.i = sext i32 %i.0.i to i64 %arrayidx5.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom4.i store i32 %22, ptr %arrayidx5.i, align 4, !tbaa !5 br label %for.cond.i, !llvm.loop !9 hin.exit: ; preds = %if.end.i.i, %hyouka.exit.i, %for.body.us.i, %entry.split.us.i %.us-phi.i = phi i32 [ %.fr.i, %entry.split.us.i ], [ %div.us22.i, %for.body.us.i ], [ %i.0.i, %hyouka.exit.i ], [ %i.0.i, %if.end.i.i ] %inc7.i = add nsw i32 %16, 1 store i32 %inc7.i, ptr @R, align 4, !tbaa !5 %idxprom8.i = sext i32 %.us-phi.i to i64 %arrayidx9.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom8.i store i32 %16, ptr %arrayidx9.i, align 4, !tbaa !5 %conv = sext i32 %14 to i64 %add40 = add nsw i64 %s.0184, %conv %inc42 = add nuw nsw i32 %i.2183, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %cmp37 = icmp slt i32 %inc42, %23 br i1 %cmp37, label %for.body38, label %for.cond44.preheader, !llvm.loop !13 for.cond56.preheader: ; preds = %hout.exit store i32 %dec.i, ptr @C, align 4, !tbaa !5 %cmp57.not190 = icmp slt i32 %23, 1 br i1 %cmp57.not190, label %for.end110, label %for.body59.preheader for.body59.preheader: ; preds = %for.cond56.preheader %24 = add i32 %23, 1 %wide.trip.count215 = zext i32 %24 to i64 %25 = add nsw i64 %wide.trip.count215, -1 %xtraiter = and i64 %25, 1 %26 = icmp eq i32 %24, 2 br i1 %26, label %for.cond70.preheader.unr-lcssa, label %for.body59.preheader.new for.body59.preheader.new: ; preds = %for.body59.preheader %unroll_iter = and i64 %25, -2 br label %for.body59 for.body47: ; preds = %for.body47.preheader, %hout.exit %indvars.iv209 = phi i64 [ 0, %for.body47.preheader ], [ %indvars.iv.next210, %hout.exit ] %dec.i186188 = phi i32 [ %inc.i, %for.body47.preheader ], [ %dec.i, %hout.exit ] %27 = load i32, ptr getelementptr inbounds ([2000010 x i32], ptr @H, i64 0, i64 1), align 4, !tbaa !5 %dec.i = add i32 %dec.i186188, -1 %idxprom.i167 = sext i32 %dec.i to i64 %arrayidx.i168 = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i167 %28 = load i32, ptr %arrayidx.i168, align 4, !tbaa !5 %or.cond.i35.i = icmp slt i32 %dec.i186188, 2 %idxprom49.phi.trans.insert = sext i32 %27 to i64 %arrayidx50.phi.trans.insert = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom49.phi.trans.insert %.pre = load i32, ptr %arrayidx50.phi.trans.insert, align 4, !tbaa !5 br i1 %or.cond.i35.i, label %hout.exit, label %hyouka.exit.lr.ph.split.i hyouka.exit.lr.ph.split.i: ; preds = %for.body47 %idxprom9.i42.i = sext i32 %28 to i64 %arrayidx10.i43.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i42.i %29 = load i32, ptr %arrayidx10.i43.i, align 4, !tbaa !5 %cmp11.i.not44.i = icmp slt i32 %.pre, %29 br i1 %cmp11.i.not44.i, label %for.body.i169, label %hout.exit hyouka.exit.i170: ; preds = %hyouka.exit31.i %30 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %idxprom5.i.i171 = sext i32 %30 to i64 %arrayidx6.i.i172 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i.i171 %31 = load i32, ptr %arrayidx6.i.i172, align 4, !tbaa !5 %32 = load i32, ptr %arrayidx.i168, align 4, !tbaa !5 %idxprom9.i.i173 = sext i32 %32 to i64 %arrayidx10.i.i174 = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i.i173 %33 = load i32, ptr %arrayidx10.i.i174, align 4, !tbaa !5 %cmp11.i.not.i175 = icmp slt i32 %31, %33 br i1 %cmp11.i.not.i175, label %for.body.i169, label %for.end.loopexit.i, !llvm.loop !11 for.body.i169: ; preds = %hyouka.exit.lr.ph.split.i, %hyouka.exit.i170 %i.03745.i = phi i32 [ %sub.i, %hyouka.exit.i170 ], [ 1, %hyouka.exit.lr.ph.split.i ] %mul.i = shl nsw i32 %i.03745.i, 1 %add.i = or i32 %mul.i, 1 %cmp.i16.not.i = icmp sgt i32 %dec.i186188, %add.i br i1 %cmp.i16.not.i, label %if.end4.i19.i, label %hyouka.exit31.i if.end4.i19.i: ; preds = %for.body.i169 %idxprom.i20.i = sext i32 %mul.i to i64 %arrayidx.i21.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom.i20.i %34 = load i32, ptr %arrayidx.i21.i, align 8, !tbaa !5 %idxprom5.i22.i = sext i32 %34 to i64 %arrayidx6.i23.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom5.i22.i %35 = load i32, ptr %arrayidx6.i23.i, align 4, !tbaa !5 %idxprom7.i24.i = sext i32 %add.i to i64 %arrayidx8.i25.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i24.i %36 = load i32, ptr %arrayidx8.i25.i, align 4, !tbaa !5 %idxprom9.i26.i = sext i32 %36 to i64 %arrayidx10.i27.i = getelementptr inbounds [2000010 x i32], ptr @N, i64 0, i64 %idxprom9.i26.i %37 = load i32, ptr %arrayidx10.i27.i, align 4, !tbaa !5 %cmp11.i28.i = icmp slt i32 %35, %37 %cond.i29.neg.i = sext i1 %cmp11.i28.i to i32 br label %hyouka.exit31.i hyouka.exit31.i: ; preds = %if.end4.i19.i, %for.body.i169 %retval.0.i30.neg.i = phi i32 [ %cond.i29.neg.i, %if.end4.i19.i ], [ -1, %for.body.i169 ] %sub.i = add i32 %retval.0.i30.neg.i, %add.i %idxprom5.i = sext i32 %sub.i to i64 %arrayidx6.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom5.i %38 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %idxprom7.i = sext i32 %i.03745.i to i64 %arrayidx8.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %idxprom7.i store i32 %38, ptr %arrayidx8.i, align 4, !tbaa !5 %cmp1.i.not.i = icmp sgt i32 %dec.i186188, %sub.i br i1 %cmp1.i.not.i, label %hyouka.exit.i170, label %for.end.loopexit.i, !llvm.loop !11 for.end.loopexit.i: ; preds = %hyouka.exit31.i, %hyouka.exit.i170 %39 = sdiv i32 %sub.i, 2 %40 = sext i32 %39 to i64 br label %hout.exit hout.exit: ; preds = %for.body47, %hyouka.exit.lr.ph.split.i, %for.end.loopexit.i %j.0.lcssa.i = phi i64 [ 1, %hyouka.exit.lr.ph.split.i ], [ %40, %for.end.loopexit.i ], [ 1, %for.body47 ] %arrayidx10.i = getelementptr inbounds [2000010 x i32], ptr @H, i64 0, i64 %j.0.lcssa.i store i32 %28, ptr %arrayidx10.i, align 4, !tbaa !5 %arrayidx52 = getelementptr inbounds [100010 x i32], ptr @d, i64 0, i64 %indvars.iv209 store i32 %.pre, ptr %arrayidx52, align 4, !tbaa !5 %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1 %exitcond.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count br i1 %exitcond.not, label %for.cond56.preheader, label %for.body47, !llvm.loop !14 for.cond70.preheader.unr-lcssa: ; preds = %for.inc67.1, %for.body59.preheader %r.1.lcssa.ph = phi i32 [ undef, %for.body59.preheader ], [ %r.1.1, %for.inc67.1 ] %indvars.iv212.unr = phi i64 [ 1, %for.body59.preheader ], [ %indvars.iv.next213.1, %for.inc67.1 ] %r.0192.unr = phi i32 [ 0, %for.body59.preheader ], [ %r.1.1, %for.inc67.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond70.preheader, label %for.body59.epil for.body59.epil: ; preds = %for.cond70.preheader.unr-lcssa %arrayidx61.epil = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv212.unr %41 = load i32, ptr %arrayidx61.epil, align 4, !tbaa !5 %cmp62.epil = icmp eq i32 %41, 1 br i1 %cmp62.epil, label %if.then.epil, label %for.cond70.preheader if.then.epil: ; preds = %for.body59.epil %inc64.epil = add nsw i32 %r.0192.unr, 1 %idxprom65.epil = sext i32 %r.0192.unr to i64 %arrayidx66.epil = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %idxprom65.epil %42 = trunc i64 %indvars.iv212.unr to i32 store i32 %42, ptr %arrayidx66.epil, align 4, !tbaa !5 br label %for.cond70.preheader for.cond70.preheader: ; preds = %for.body59.epil, %if.then.epil, %for.cond70.preheader.unr-lcssa %r.1.lcssa = phi i32 [ %r.1.lcssa.ph, %for.cond70.preheader.unr-lcssa ], [ %inc64.epil, %if.then.epil ], [ %r.0192.unr, %for.body59.epil ] %tobool.not199 = icmp eq i32 %r.1.lcssa, 0 br i1 %tobool.not199, label %for.end110, label %for.body72 for.body59: ; preds = %for.inc67.1, %for.body59.preheader.new %indvars.iv212 = phi i64 [ 1, %for.body59.preheader.new ], [ %indvars.iv.next213.1, %for.inc67.1 ] %r.0192 = phi i32 [ 0, %for.body59.preheader.new ], [ %r.1.1, %for.inc67.1 ] %niter = phi i64 [ 0, %for.body59.preheader.new ], [ %niter.next.1, %for.inc67.1 ] %arrayidx61 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv212 %43 = load i32, ptr %arrayidx61, align 4, !tbaa !5 %cmp62 = icmp eq i32 %43, 1 br i1 %cmp62, label %if.then, label %for.inc67 if.then: ; preds = %for.body59 %inc64 = add nsw i32 %r.0192, 1 %idxprom65 = sext i32 %r.0192 to i64 %arrayidx66 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %idxprom65 %44 = trunc i64 %indvars.iv212 to i32 store i32 %44, ptr %arrayidx66, align 4, !tbaa !5 br label %for.inc67 for.inc67: ; preds = %for.body59, %if.then %r.1 = phi i32 [ %inc64, %if.then ], [ %r.0192, %for.body59 ] %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1 %arrayidx61.1 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv.next213 %45 = load i32, ptr %arrayidx61.1, align 4, !tbaa !5 %cmp62.1 = icmp eq i32 %45, 1 br i1 %cmp62.1, label %if.then.1, label %for.inc67.1 if.then.1: ; preds = %for.inc67 %inc64.1 = add nsw i32 %r.1, 1 %idxprom65.1 = sext i32 %r.1 to i64 %arrayidx66.1 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %idxprom65.1 %46 = trunc i64 %indvars.iv.next213 to i32 store i32 %46, ptr %arrayidx66.1, align 4, !tbaa !5 br label %for.inc67.1 for.inc67.1: ; preds = %if.then.1, %for.inc67 %r.1.1 = phi i32 [ %inc64.1, %if.then.1 ], [ %r.1, %for.inc67 ] %indvars.iv.next213.1 = add nuw nsw i64 %indvars.iv212, 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.cond70.preheader.unr-lcssa, label %for.body59, !llvm.loop !15 for.body72: ; preds = %for.cond70.preheader, %for.inc108 %indvars.iv217 = phi i64 [ %indvars.iv.next218, %for.inc108 ], [ 0, %for.cond70.preheader ] %r.2200 = phi i32 [ %r.3.lcssa, %for.inc108 ], [ %r.1.lcssa, %for.cond70.preheader ] %arrayidx74 = getelementptr inbounds [100010 x i32], ptr @d, i64 0, i64 %indvars.iv217 %47 = load i32, ptr %arrayidx74, align 4, !tbaa !5 %arrayidx76 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %indvars.iv217 %48 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %idxprom77 = sext i32 %48 to i64 %arrayidx78 = getelementptr inbounds [100010 x i32], ptr @p, i64 0, i64 %idxprom77 store i32 %47, ptr %arrayidx78, align 4, !tbaa !5 %arrayidx82 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom77 %i.5194 = load i32, ptr %arrayidx82, align 4, !tbaa !5 %tobool85.not195 = icmp eq i32 %i.5194, -1 br i1 %tobool85.not195, label %for.inc108, label %for.body86 for.body86: ; preds = %for.body72, %for.inc104 %i.5197 = phi i32 [ %i.5, %for.inc104 ], [ %i.5194, %for.body72 ] %r.3196 = phi i32 [ %r.4, %for.inc104 ], [ %r.2200, %for.body72 ] %idxprom87 = sext i32 %i.5197 to i64 %arrayidx88 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %idxprom87 %49 = load i32, ptr %arrayidx88, align 4, !tbaa !5 %idxprom89 = sext i32 %49 to i64 %arrayidx90 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %idxprom89 %50 = load i32, ptr %arrayidx90, align 4, !tbaa !5 %dec = add nsw i32 %50, -1 store i32 %dec, ptr %arrayidx90, align 4, !tbaa !5 %cmp95 = icmp eq i32 %dec, 1 br i1 %cmp95, label %if.then97, label %for.inc104 if.then97: ; preds = %for.body86 %inc100 = add nsw i32 %r.3196, 1 %idxprom101 = sext i32 %r.3196 to i64 %arrayidx102 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %idxprom101 store i32 %49, ptr %arrayidx102, align 4, !tbaa !5 br label %for.inc104 for.inc104: ; preds = %for.body86, %if.then97 %r.4 = phi i32 [ %inc100, %if.then97 ], [ %r.3196, %for.body86 ] %arrayidx106 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %idxprom87 %i.5 = load i32, ptr %arrayidx106, align 4, !tbaa !5 %tobool85.not = icmp eq i32 %i.5, -1 br i1 %tobool85.not, label %for.inc108, label %for.body86, !llvm.loop !16 for.inc108: ; preds = %for.inc104, %for.body72 %r.3.lcssa = phi i32 [ %r.2200, %for.body72 ], [ %r.4, %for.inc104 ] %indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1 %51 = zext i32 %r.3.lcssa to i64 %tobool.not = icmp eq i64 %indvars.iv.next218, %51 br i1 %tobool.not, label %for.end110, label %for.body72, !llvm.loop !17 for.end110: ; preds = %for.inc108, %entry, %for.cond36.preheader, %for.cond44.preheader, %for.cond56.preheader, %for.cond70.preheader %.lcssa233237244 = phi i32 [ %23, %for.cond70.preheader ], [ %23, %for.cond56.preheader ], [ %23, %for.cond44.preheader ], [ %4, %for.cond36.preheader ], [ %0, %entry ], [ %23, %for.inc108 ] %s.0.lcssa232238243 = phi i64 [ %add40, %for.cond70.preheader ], [ %add40, %for.cond56.preheader ], [ %add40, %for.cond44.preheader ], [ 0, %for.cond36.preheader ], [ 0, %entry ], [ %add40, %for.inc108 ] %sub111 = add nsw i32 %.lcssa233237244, -1 %idxprom112 = sext i32 %sub111 to i64 %arrayidx113 = getelementptr inbounds [100010 x i32], ptr @d, i64 0, i64 %idxprom112 %52 = load i32, ptr %arrayidx113, align 4, !tbaa !5 %conv114 = sext i32 %52 to i64 %sub115 = sub nsw i64 %s.0.lcssa232238243, %conv114 %call116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub115) %53 = load i32, ptr %n, align 4, !tbaa !5 %cmp118202 = icmp sgt i32 %53, 0 br i1 %cmp118202, label %for.body120, label %for.end130 for.body120: ; preds = %for.end110, %for.body120 %indvars.iv220 = phi i64 [ %indvars.iv.next221, %for.body120 ], [ 0, %for.end110 ] %54 = phi i32 [ %57, %for.body120 ], [ %53, %for.end110 ] %indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1 %arrayidx123 = getelementptr inbounds [100010 x i32], ptr @p, i64 0, i64 %indvars.iv.next221 %55 = load i32, ptr %arrayidx123, align 4, !tbaa !5 %56 = zext i32 %54 to i64 %tobool126.not = icmp eq i64 %indvars.iv.next221, %56 %cond = select i1 %tobool126.not, i32 10, i32 32 %call127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %55, i32 noundef %cond) %57 = load i32, ptr %n, align 4, !tbaa !5 %58 = sext i32 %57 to i64 %cmp118 = icmp slt i64 %indvars.iv.next221, %58 br i1 %cmp118, label %for.body120, label %for.end130, !llvm.loop !18 for.end130: ; preds = %for.body120, %for.end110 call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %q) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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} !18 = distinct !{!18, !10}
#include<stdio.h> #include<stdlib.h> #define N 1000000 int count=0,l,*S; void insertionSort(int A[], int n, int m){ int i,v,j; for(i=m;i<n;i++){ v=A[i]; j=i-m; while(j>=0&&A[j]>v){ A[j+m]=A[j]; j-=m; count++; } A[j+m]=v; } } void Sort(int A[],int n){ int i=0,a; S=(int *)malloc(n * sizeof(int)); for(a=1; ; ){ if(a>n) break; S[i]=a; i++; a=3*a+1; } l=i; for(i=l-1;i>=0;i--){ insertionSort(A,n,S[i]); } } int main(){ int i,A[N],n; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&A[i]); Sort(A,n); printf("%d\n",l); for(i=l-1;i>=0;i--){ printf("%d",S[i]); if(i) printf(" "); } printf("\n"); printf("%d\n",count); for(i=0;i<n;i++)printf("%d\n",A[i]); free(S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @count = dso_local local_unnamed_addr global i32 0, align 4 @S = dso_local local_unnamed_addr global ptr null, align 8 @l = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %m) local_unnamed_addr #0 { entry: %cmp36 = icmp slt i32 %m, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %m to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %m br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @count, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @count, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %m %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11 for.end: ; preds = %while.end, %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 @Sort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #8 store ptr %call, ptr @S, align 8, !tbaa !12 %cmp18 = icmp slt i32 %n, 1 br i1 %cmp18, label %for.end.thread, label %if.end for.end.thread: ; preds = %entry store i32 0, ptr @l, align 4, !tbaa !5 br label %for.end8 if.end: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %a.020 = phi i32 [ %add, %if.end ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %a.020, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %mul2 = mul nsw i32 %a.020, 3 %add = add nsw i32 %mul2, 1 %cmp.not = icmp slt i32 %mul2, %n br i1 %cmp.not, label %if.end, label %for.end for.end: ; preds = %if.end %0 = trunc i64 %indvars.iv.next to i32 store i32 %0, ptr @l, align 4, !tbaa !5 %cmp421 = icmp sgt i32 %0, 0 br i1 %cmp421, label %for.body.preheader, label %for.end8 for.body.preheader: ; preds = %for.end %1 = and i64 %indvars.iv.next, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %insertionSort.exit %indvars.iv24 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next25, %insertionSort.exit ] %indvars.iv.next25 = add nsw i64 %indvars.iv24, -1 %idxprom6 = and i64 %indvars.iv.next25, 4294967295 %arrayidx7 = getelementptr inbounds i32, ptr %call, i64 %idxprom6 %2 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %2, %n br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body %3 = sext i32 %2 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %5 = trunc i64 %indvars.iv.i to i32 %6 = sub i32 %5, %2 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %6, %land.rhs.preheader.i ] %i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %5, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %7 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %7, %4 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %7, ptr %arrayidx8.i, align 4, !tbaa !5 %8 = load i32, ptr @count, align 4, !tbaa !5 %inc.i = add nsw i32 %8, 1 store i32 %inc.i, ptr @count, align 4, !tbaa !5 %j.0.i = sub nsw i32 %j.034.i, %2 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %4, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %conv br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !11 insertionSort.exit: ; preds = %while.end.i, %for.body %cmp4 = icmp sgt i64 %indvars.iv24, 1 br i1 %cmp4, label %for.body, label %for.end8, !llvm.loop !14 for.end8: ; preds = %insertionSort.exit, %for.end.thread, %for.end ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %A = alloca [1000000 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 %call = 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.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !15 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.i.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ] %.lcssa = phi i32 [ %0, %entry.for.end_crit_edge ], [ %1, %for.body ] %mul.i = shl nsw i64 %conv.i.pre-phi, 2 %call.i = call noalias ptr @malloc(i64 noundef %mul.i) #8 store ptr %call.i, ptr @S, align 8, !tbaa !12 %cmp18.i = icmp slt i32 %.lcssa, 1 br i1 %cmp18.i, label %for.end.thread.i, label %if.end.i for.end.thread.i: ; preds = %for.end store i32 0, ptr @l, align 4, !tbaa !5 br label %Sort.exit if.end.i: ; preds = %for.end, %if.end.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 0, %for.end ] %a.020.i = phi i32 [ %add.i, %if.end.i ], [ 1, %for.end ] %arrayidx.i = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i store i32 %a.020.i, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %mul2.i = mul nsw i32 %a.020.i, 3 %add.i = add nsw i32 %mul2.i, 1 %cmp.not.i = icmp slt i32 %mul2.i, %.lcssa br i1 %cmp.not.i, label %if.end.i, label %for.end.i for.end.i: ; preds = %if.end.i %3 = trunc i64 %indvars.iv.next.i to i32 store i32 %3, ptr @l, align 4, !tbaa !5 %cmp421.i = icmp sgt i32 %3, 0 br i1 %cmp421.i, label %for.body.preheader.i, label %Sort.exit for.body.preheader.i: ; preds = %for.end.i %4 = and i64 %indvars.iv.next.i, 4294967295 %count.promoted = load i32, ptr @count, align 4, !tbaa !5 br label %for.body.i for.body.i: ; preds = %insertionSort.exit.i, %for.body.preheader.i %count.promoted3644 = phi i32 [ %count.promoted, %for.body.preheader.i ], [ %count.promoted3640, %insertionSort.exit.i ] %indvars.iv24.i = phi i64 [ %4, %for.body.preheader.i ], [ %indvars.iv.next25.i, %insertionSort.exit.i ] %indvars.iv.next25.i = add nsw i64 %indvars.iv24.i, -1 %idxprom6.i = and i64 %indvars.iv.next25.i, 4294967295 %arrayidx7.i = getelementptr inbounds i32, ptr %call.i, i64 %idxprom6.i %5 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5 %cmp36.i.i = icmp slt i32 %5, %.lcssa br i1 %cmp36.i.i, label %for.body.preheader.i.i, label %insertionSort.exit.i for.body.preheader.i.i: ; preds = %for.body.i %6 = sext i32 %5 to i64 br label %land.rhs.preheader.i.i land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i %count.promoted3643 = phi i32 [ %count.promoted3644, %for.body.preheader.i.i ], [ %count.promoted3641, %while.end.i.i ] %count.promoted39 = phi i32 [ %count.promoted3644, %for.body.preheader.i.i ], [ %count.promoted37, %while.end.i.i ] %indvars.iv.i.i = phi i64 [ %6, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ] %arrayidx.i.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.i %7 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %8 = trunc i64 %indvars.iv.i.i to i32 %9 = sub i32 %8, %5 %idxprom2.i.i63 = zext i32 %9 to i64 %arrayidx3.i.i64 = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i.i63 %10 = load i32, ptr %arrayidx3.i.i64, align 4, !tbaa !5 %cmp4.i.i65 = icmp sgt i32 %10, %7 br i1 %cmp4.i.i65, label %while.body.i.i, label %while.end.i.i land.rhs.i.i: ; preds = %while.body.i.i %idxprom2.i.i = zext i32 %j.0.i.i to i64 %arrayidx3.i.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i.i %11 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5 %cmp4.i.i = icmp sgt i32 %11, %7 br i1 %cmp4.i.i, label %while.body.i.i, label %while.end.i.i.loopexit, !llvm.loop !9 while.body.i.i: ; preds = %land.rhs.preheader.i.i, %land.rhs.i.i %12 = phi i32 [ %11, %land.rhs.i.i ], [ %10, %land.rhs.preheader.i.i ] %i.0.pn33.i.i68 = phi i32 [ %j.034.i.i67, %land.rhs.i.i ], [ %8, %land.rhs.preheader.i.i ] %j.034.i.i67 = phi i32 [ %j.0.i.i, %land.rhs.i.i ], [ %9, %land.rhs.preheader.i.i ] %count.promoted3866 = phi i32 [ %inc.i.i, %land.rhs.i.i ], [ %count.promoted39, %land.rhs.preheader.i.i ] %idxprom7.i.i = sext i32 %i.0.pn33.i.i68 to i64 %arrayidx8.i.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i.i store i32 %12, ptr %arrayidx8.i.i, align 4, !tbaa !5 %inc.i.i = add nsw i32 %count.promoted3866, 1 %j.0.i.i = sub nsw i32 %j.034.i.i67, %5 %cmp1.i.i = icmp sgt i32 %j.0.i.i, -1 br i1 %cmp1.i.i, label %land.rhs.i.i, label %while.end.i.i.loopexit, !llvm.loop !9 while.end.i.i.loopexit: ; preds = %while.body.i.i, %land.rhs.i.i store i32 %inc.i.i, ptr @count, align 4, !tbaa !5 br label %while.end.i.i while.end.i.i: ; preds = %while.end.i.i.loopexit, %land.rhs.preheader.i.i %count.promoted3641 = phi i32 [ %count.promoted3643, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ] %count.promoted37 = phi i32 [ %count.promoted39, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ] %i.0.pn.lcssa.ph.i.i = phi i32 [ %8, %land.rhs.preheader.i.i ], [ %j.034.i.i67, %while.end.i.i.loopexit ] %idxprom11.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64 %arrayidx12.i.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i.i store i32 %7, ptr %arrayidx12.i.i, align 4, !tbaa !5 %indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1 %exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %conv.i.pre-phi br i1 %exitcond.not.i.i, label %insertionSort.exit.i, label %land.rhs.preheader.i.i, !llvm.loop !11 insertionSort.exit.i: ; preds = %while.end.i.i, %for.body.i %count.promoted3640 = phi i32 [ %count.promoted3644, %for.body.i ], [ %count.promoted3641, %while.end.i.i ] %cmp4.i = icmp sgt i64 %indvars.iv24.i, 1 br i1 %cmp4.i, label %for.body.i, label %Sort.exit, !llvm.loop !14 Sort.exit: ; preds = %insertionSort.exit.i, %for.end.thread.i, %for.end.i %13 = phi i32 [ 0, %for.end.thread.i ], [ %3, %for.end.i ], [ %3, %insertionSort.exit.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13) %14 = load i32, ptr @l, align 4, !tbaa !5 %cmp446 = icmp sgt i32 %14, 0 br i1 %cmp446, label %for.body5.preheader, label %for.end11 for.body5.preheader: ; preds = %Sort.exit %15 = zext i32 %14 to i64 br label %for.body5 for.body5: ; preds = %for.body5.preheader, %for.inc10 %indvars.iv52 = phi i64 [ %15, %for.body5.preheader ], [ %indvars.iv.next53, %for.inc10 ] %indvars.iv.next53 = add nsw i64 %indvars.iv52, -1 %16 = load ptr, ptr @S, align 8, !tbaa !12 %idxprom6 = and i64 %indvars.iv.next53, 4294967295 %arrayidx7 = getelementptr inbounds i32, ptr %16, i64 %idxprom6 %17 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17) %18 = and i64 %indvars.iv.next53, 4294967295 %tobool.not = icmp eq i64 %18, 0 br i1 %tobool.not, label %for.inc10, label %if.then if.then: ; preds = %for.body5 %putchar32 = call i32 @putchar(i32 32) br label %for.inc10 for.inc10: ; preds = %for.body5, %if.then %cmp4 = icmp ugt i64 %indvars.iv52, 1 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !16 for.end11: ; preds = %for.inc10, %Sort.exit %putchar = call i32 @putchar(i32 10) %19 = load i32, ptr @count, align 4, !tbaa !5 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19) %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp1548 = icmp sgt i32 %20, 0 br i1 %cmp1548, label %for.body16, label %for.end22 for.body16: ; preds = %for.end11, %for.body16 %indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.body16 ], [ 0, %for.end11 ] %arrayidx18 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv55 %21 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %21) %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp15 = icmp slt i64 %indvars.iv.next56, %23 br i1 %cmp15, label %for.body16, label %for.end22, !llvm.loop !17 for.end22: ; preds = %for.body16, %for.end11 %24 = load ptr, ptr @S, align 8, !tbaa !12 call void @free(ptr noundef %24) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #9 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind } attributes #8 = { nounwind allocsize(0) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #define N 1000000 void insertionSort(int [],int,int); void shellSort(int [],int); int cnt = 0; int main(){ int b,i,a[N]; scanf("%d",&b); for(i=0;i<b;i++){ scanf("%d",&a[i]); } shellSort(a,b); printf("%d\n",cnt); for(i=0;i<b;i++){ printf("%d\n",a[i]); } return 0; } void insertionSort(int A[],int n,int g){ int i,j,v; for(i=g;i<n;i++){ v = A[i]; j=i-g; while(j>=0 && A[j]>v){ A[j+g] = A[j]; j = j - g; cnt++; } A[j+g] = v; } } void shellSort(int A[],int n){ int i,m=0; int G[n]; G[0]=0; for(i=0;i<n;i++){ G[i+1] = 3*G[i]+1; m++; if(G[i+1]>N) break; } while(G[m]>n){ m--; } printf("%d\n",m); for(i=m;i>1;i--){ printf("%d ",G[i]); } printf(" %d\n",G[1]); for(i=m;i>=0;i--){ insertionSort(A,n,G[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119062/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c" %d\0A\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 [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, 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 [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @shellSort(ptr noundef nonnull %a, i32 noundef %.lcssa) %3 = load i32, ptr @cnt, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp419 = icmp sgt i32 %4, 0 br i1 %cmp419, label %for.body5, label %for.end11 for.body5: ; preds = %for.end, %for.body5 %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body5 ], [ 0, %for.end ] %arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv23 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %6 = load i32, ptr %b, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp4 = icmp slt i64 %indvars.iv.next24, %7 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.body5, %for.end call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #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 uwtable define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %0 = zext i32 %n to i64 %vla = alloca i32, i64 %0, align 16 store i32 0, ptr %vla, align 16, !tbaa !5 %smax = tail call i32 @llvm.smax.i32(i32 %n, i32 0) %exitcond.not = icmp slt i32 %n, 1 br i1 %exitcond.not, label %for.end, label %for.body for.body: ; preds = %entry %arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 1 store i32 1, ptr %arrayidx4, align 4, !tbaa !5 %exitcond.not.1 = icmp eq i32 %n, 1 br i1 %exitcond.not.1, label %for.end, label %for.body.1 for.body.1: ; preds = %for.body %arrayidx4.1 = getelementptr inbounds i32, ptr %vla, i64 2 store i32 4, ptr %arrayidx4.1, align 8, !tbaa !5 %exitcond.not.2 = icmp eq i32 %n, 2 br i1 %exitcond.not.2, label %for.end, label %for.body.2 for.body.2: ; preds = %for.body.1 %arrayidx4.2 = getelementptr inbounds i32, ptr %vla, i64 3 store i32 13, ptr %arrayidx4.2, align 4, !tbaa !5 %exitcond.not.3 = icmp eq i32 %n, 3 br i1 %exitcond.not.3, label %for.end, label %for.body.3 for.body.3: ; preds = %for.body.2 %arrayidx4.3 = getelementptr inbounds i32, ptr %vla, i64 4 store i32 40, ptr %arrayidx4.3, align 16, !tbaa !5 %exitcond.not.4 = icmp eq i32 %n, 4 br i1 %exitcond.not.4, label %for.end, label %for.body.4 for.body.4: ; preds = %for.body.3 %arrayidx4.4 = getelementptr inbounds i32, ptr %vla, i64 5 store i32 121, ptr %arrayidx4.4, align 4, !tbaa !5 %exitcond.not.5 = icmp eq i32 %n, 5 br i1 %exitcond.not.5, label %for.end, label %for.body.5 for.body.5: ; preds = %for.body.4 %arrayidx4.5 = getelementptr inbounds i32, ptr %vla, i64 6 store i32 364, ptr %arrayidx4.5, align 8, !tbaa !5 %exitcond.not.6 = icmp eq i32 %n, 6 br i1 %exitcond.not.6, label %for.end, label %for.body.6 for.body.6: ; preds = %for.body.5 %arrayidx4.6 = getelementptr inbounds i32, ptr %vla, i64 7 store i32 1093, ptr %arrayidx4.6, align 4, !tbaa !5 %exitcond.not.7 = icmp eq i32 %n, 7 br i1 %exitcond.not.7, label %for.end, label %for.body.7 for.body.7: ; preds = %for.body.6 %arrayidx4.7 = getelementptr inbounds i32, ptr %vla, i64 8 store i32 3280, ptr %arrayidx4.7, align 16, !tbaa !5 %exitcond.not.8 = icmp eq i32 %n, 8 br i1 %exitcond.not.8, label %for.end, label %for.body.8 for.body.8: ; preds = %for.body.7 %arrayidx4.8 = getelementptr inbounds i32, ptr %vla, i64 9 store i32 9841, ptr %arrayidx4.8, align 4, !tbaa !5 %exitcond.not.9 = icmp eq i32 %n, 9 br i1 %exitcond.not.9, label %for.end, label %for.body.9 for.body.9: ; preds = %for.body.8 %arrayidx4.9 = getelementptr inbounds i32, ptr %vla, i64 10 store i32 29524, ptr %arrayidx4.9, align 8, !tbaa !5 %exitcond.not.10 = icmp eq i32 %n, 10 br i1 %exitcond.not.10, label %for.end, label %for.body.10 for.body.10: ; preds = %for.body.9 %arrayidx4.10 = getelementptr inbounds i32, ptr %vla, i64 11 store i32 88573, ptr %arrayidx4.10, align 4, !tbaa !5 %exitcond.not.11 = icmp eq i32 %n, 11 br i1 %exitcond.not.11, label %for.end, label %for.body.11 for.body.11: ; preds = %for.body.10 %arrayidx4.11 = getelementptr inbounds i32, ptr %vla, i64 12 store i32 265720, ptr %arrayidx4.11, align 16, !tbaa !5 %exitcond.not.12 = icmp eq i32 %n, 12 br i1 %exitcond.not.12, label %for.end, label %for.body.12 for.body.12: ; preds = %for.body.11 %arrayidx4.12 = getelementptr inbounds i32, ptr %vla, i64 13 store i32 797161, ptr %arrayidx4.12, align 4, !tbaa !5 %exitcond.not.13 = icmp eq i32 %n, 13 br i1 %exitcond.not.13, label %for.end, label %for.body.13 for.body.13: ; preds = %for.body.12 %arrayidx4.13 = getelementptr inbounds i32, ptr %vla, i64 14 store i32 2391484, ptr %arrayidx4.13, align 8, !tbaa !5 br label %for.end for.end: ; preds = %entry, %for.body, %for.body.1, %for.body.2, %for.body.3, %for.body.4, %for.body.5, %for.body.6, %for.body.7, %for.body.8, %for.body.9, %for.body.10, %for.body.11, %for.body.12, %for.body.13 %m.1 = phi i32 [ 14, %for.body.13 ], [ %smax, %for.body.12 ], [ %smax, %for.body.11 ], [ %smax, %for.body.10 ], [ %smax, %for.body.9 ], [ %smax, %for.body.8 ], [ %smax, %for.body.7 ], [ %smax, %for.body.6 ], [ %smax, %for.body.5 ], [ %smax, %for.body.4 ], [ %smax, %for.body.3 ], [ %smax, %for.body.2 ], [ %smax, %for.body.1 ], [ %smax, %for.body ], [ %smax, %entry ] %1 = zext i32 %m.1 to i64 br label %while.cond while.cond: ; preds = %while.cond, %for.end %indvars.iv61 = phi i32 [ %indvars.iv.next62, %while.cond ], [ %m.1, %for.end ] %indvars.iv57 = phi i64 [ %indvars.iv.next58, %while.cond ], [ %1, %for.end ] %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv57 %2 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %2, %n %indvars.iv.next58 = add i64 %indvars.iv57, -1 %indvars.iv.next62 = add i32 %indvars.iv61, -1 br i1 %cmp12, label %while.cond, label %while.end, !llvm.loop !12 while.end: ; preds = %while.cond %3 = trunc i64 %indvars.iv57 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %cmp1450 = icmp sgt i32 %3, 1 br i1 %cmp1450, label %for.body15.preheader, label %for.end21 for.body15.preheader: ; preds = %while.end %4 = zext i32 %indvars.iv61 to i64 br label %for.body15 for.body15: ; preds = %for.body15.preheader, %for.body15 %indvars.iv63 = phi i64 [ %4, %for.body15.preheader ], [ %indvars.iv.next64, %for.body15 ] %arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv63 %5 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) %indvars.iv.next64 = add nsw i64 %indvars.iv63, -1 %6 = trunc i64 %indvars.iv63 to i32 %cmp14 = icmp sgt i32 %6, 2 br i1 %cmp14, label %for.body15, label %for.end21, !llvm.loop !13 for.end21: ; preds = %for.body15, %while.end %arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 1 %7 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %call23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %7) %cmp2552 = icmp sgt i32 %3, -1 br i1 %cmp2552, label %for.body26.lr.ph, label %for.end31 for.body26.lr.ph: ; preds = %for.end21 %wide.trip.count.i = sext i32 %n to i64 %8 = zext i32 %indvars.iv61 to i64 br label %for.body26 for.body26: ; preds = %for.body26.lr.ph, %insertionSort.exit %indvars.iv68 = phi i64 [ %8, %for.body26.lr.ph ], [ %indvars.iv.next69, %insertionSort.exit ] %arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68 %9 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %9, %n br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body26 %10 = sext i32 %9 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %10, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %12 = trunc i64 %indvars.iv.i to i32 %13 = sub i32 %12, %9 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %13, %land.rhs.preheader.i ] %i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %12, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %14 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %14, %11 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %14, ptr %arrayidx8.i, align 4, !tbaa !5 %15 = load i32, ptr @cnt, align 4, !tbaa !5 %inc.i = add nsw i32 %15, 1 store i32 %inc.i, ptr @cnt, align 4, !tbaa !5 %j.0.i = sub nsw i32 %j.034.i, %9 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !14 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %11, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !15 insertionSort.exit: ; preds = %while.end.i, %for.body26 %indvars.iv.next69 = add nsw i64 %indvars.iv68, -1 %16 = trunc i64 %indvars.iv68 to i32 %cmp25 = icmp sgt i32 %16, 0 br i1 %cmp25, label %for.body26, label %for.end31, !llvm.loop !16 for.end31: ; preds = %insertionSort.exit, %for.end21 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #3 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @cnt, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !14 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !15 for.end: ; preds = %while.end, %entry ret void } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> int main() { long long t,i,j,k,m,n,x,y; scanf("%lld",&t); while(t--) { scanf("%lld",&k); if((k+1)%10==0)printf("%lld",k/10+1); else printf("%lld",k/10); if(t!=0)printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11912/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11912/source.c" target datalayout = "e-m:e-p270: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"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #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 %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec10 = add nsw i64 %0, -1 store i64 %dec10, ptr %t, align 8, !tbaa !5 %tobool.not11 = icmp eq i64 %0, 0 br i1 %tobool.not11, label %while.end, label %while.body while.body: ; preds = %entry, %if.end9 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %1 = load i64, ptr %k, align 8, !tbaa !5 %add = add nsw i64 %1, 1 %rem = srem i64 %add, 10 %cmp = icmp eq i64 %rem, 0 %div = sdiv i64 %1, 10 %add2 = zext i1 %cmp to i64 %div.sink = add nsw i64 %div, %add2 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div.sink) %2 = load i64, ptr %t, align 8, !tbaa !5 %cmp6.not = icmp eq i64 %2, 0 br i1 %cmp6.not, label %while.end, label %if.end9 if.end9: ; preds = %while.body %putchar = call i32 @putchar(i32 10) %.pre = load i64, ptr %t, align 8, !tbaa !5 %dec = add nsw i64 %.pre, -1 store i64 %dec, ptr %t, align 8, !tbaa !5 %tobool.not = icmp eq i64 %.pre, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end9, %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int A[10000000]; int m,count=0; int G[1000000]; void insert(int *A,int n,int g){ int v; int i,j; for(i=g;i<n;i++){ v=A[i]; j=i-g; while(j>=0 && A[j]>v){ A[j+g]=A[j]; j-=g; count++; } A[j+g]=v; } } void shell(int *A,int n){ int h,i; for(i=0,h=1;;i++){ if(h>n)break; G[i]=h; h=3*h+1; } m=i+1;//G.length =m; for(i=m-1;i>=0;i--){ insert(A,n,G[i]); } } int main(){ int n,i,j; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&A[i]); shell(A,n); printf("%d\n",m-1); for(i=m-2;i>=0;i--){ printf("%d",G[i]); if(i)printf(" "); } // printf("\n"); printf("\n%d\n",count); for(i=0;i<n;i++)printf("%d\n",A[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119163/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119163/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @count = dso_local local_unnamed_addr global i32 0, align 4 @G = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16 @m = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @A = dso_local global [10000000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insert(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @count, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @count, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11 for.end: ; preds = %while.end, %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 norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @shell(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp16 = icmp slt i32 %n, 1 br i1 %cmp16, label %for.end.thread, label %if.end for.end.thread: ; preds = %entry store i32 1, ptr @m, align 4, !tbaa !5 br label %for.body.lr.ph if.end: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %h.017 = phi i32 [ %add, %if.end ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv store i32 %h.017, ptr %arrayidx, align 4, !tbaa !5 %mul = mul nsw i32 %h.017, 3 %add = add nsw i32 %mul, 1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp.not = icmp slt i32 %mul, %n br i1 %cmp.not, label %if.end, label %for.end for.end: ; preds = %if.end %0 = trunc i64 %indvars.iv.next to i32 %add1 = add nuw nsw i32 %0, 1 store i32 %add1, ptr @m, align 4, !tbaa !5 %cmp319 = icmp sgt i32 %0, -1 br i1 %cmp319, label %for.body.lr.ph, label %for.end7 for.body.lr.ph: ; preds = %for.end.thread, %for.end %i.0.lcssa28 = phi i64 [ 0, %for.end.thread ], [ %indvars.iv.next, %for.end ] %wide.trip.count.i = sext i32 %n to i64 %1 = and i64 %i.0.lcssa28, 4294967295 br label %for.body for.body: ; preds = %for.body.lr.ph, %insert.exit %indvars.iv22 = phi i64 [ %1, %for.body.lr.ph ], [ %indvars.iv.next23, %insert.exit ] %arrayidx5 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv22 %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %2, %n br i1 %cmp36.i, label %for.body.preheader.i, label %insert.exit for.body.preheader.i: ; preds = %for.body %3 = sext i32 %2 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %5 = trunc i64 %indvars.iv.i to i32 %6 = sub i32 %5, %2 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %6, %land.rhs.preheader.i ] %i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %5, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %7 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %7, %4 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %7, ptr %arrayidx8.i, align 4, !tbaa !5 %8 = load i32, ptr @count, align 4, !tbaa !5 %inc.i = add nsw i32 %8, 1 store i32 %inc.i, ptr @count, align 4, !tbaa !5 %j.0.i = sub nsw i32 %j.034.i, %2 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %4, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insert.exit, label %land.rhs.preheader.i, !llvm.loop !11 insert.exit: ; preds = %while.end.i, %for.body %indvars.iv.next23 = add nsw i64 %indvars.iv22, -1 %cmp3 = icmp sgt i64 %indvars.iv22, 0 br i1 %cmp3, label %for.body, label %for.end7, !llvm.loop !12 for.end7: ; preds = %insert.exit, %for.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %for.end.thread.i for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000000 x i32], ptr @A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body %cmp16.i = icmp slt i32 %1, 1 br i1 %cmp16.i, label %for.end.thread.i, label %if.end.i for.end.thread.i: ; preds = %entry, %for.end %.lcssa59 = phi i32 [ %1, %for.end ], [ %0, %entry ] store i32 1, ptr @m, align 4, !tbaa !5 br label %for.body.lr.ph.i if.end.i: ; preds = %for.end, %if.end.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 0, %for.end ] %h.017.i = phi i32 [ %add.i, %if.end.i ], [ 1, %for.end ] %arrayidx.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.i store i32 %h.017.i, ptr %arrayidx.i, align 4, !tbaa !5 %mul.i = mul nsw i32 %h.017.i, 3 %add.i = add nsw i32 %mul.i, 1 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %cmp.not.i = icmp slt i32 %mul.i, %1 br i1 %cmp.not.i, label %if.end.i, label %for.end.i for.end.i: ; preds = %if.end.i %3 = trunc i64 %indvars.iv.next.i to i32 %add1.i = add nuw nsw i32 %3, 1 store i32 %add1.i, ptr @m, align 4, !tbaa !5 %cmp319.i = icmp sgt i32 %3, -1 br i1 %cmp319.i, label %for.body.lr.ph.i, label %shell.exit for.body.lr.ph.i: ; preds = %for.end.i, %for.end.thread.i %.lcssa58 = phi i32 [ %.lcssa59, %for.end.thread.i ], [ %1, %for.end.i ] %4 = phi i32 [ 0, %for.end.thread.i ], [ %3, %for.end.i ] %i.0.lcssa28.i = phi i64 [ 0, %for.end.thread.i ], [ %indvars.iv.next.i, %for.end.i ] %wide.trip.count.i.i = sext i32 %.lcssa58 to i64 %5 = and i64 %i.0.lcssa28.i, 4294967295 %count.promoted = load i32, ptr @count, align 4, !tbaa !5 br label %for.body.i for.body.i: ; preds = %insert.exit.i, %for.body.lr.ph.i %count.promoted3543 = phi i32 [ %count.promoted, %for.body.lr.ph.i ], [ %count.promoted3539, %insert.exit.i ] %indvars.iv22.i = phi i64 [ %5, %for.body.lr.ph.i ], [ %indvars.iv.next23.i, %insert.exit.i ] %arrayidx5.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv22.i %6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp36.i.i = icmp slt i32 %6, %.lcssa58 br i1 %cmp36.i.i, label %for.body.preheader.i.i, label %insert.exit.i for.body.preheader.i.i: ; preds = %for.body.i %7 = sext i32 %6 to i64 br label %land.rhs.preheader.i.i land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i %count.promoted3542 = phi i32 [ %count.promoted3543, %for.body.preheader.i.i ], [ %count.promoted3540, %while.end.i.i ] %count.promoted38 = phi i32 [ %count.promoted3543, %for.body.preheader.i.i ], [ %count.promoted36, %while.end.i.i ] %indvars.iv.i.i = phi i64 [ %7, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ] %arrayidx.i.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i.i %8 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %9 = trunc i64 %indvars.iv.i.i to i32 %10 = sub i32 %9, %6 %idxprom2.i.i62 = zext i32 %10 to i64 %arrayidx3.i.i63 = getelementptr inbounds i32, ptr @A, i64 %idxprom2.i.i62 %11 = load i32, ptr %arrayidx3.i.i63, align 4, !tbaa !5 %cmp4.i.i64 = icmp sgt i32 %11, %8 br i1 %cmp4.i.i64, label %while.body.i.i, label %while.end.i.i land.rhs.i.i: ; preds = %while.body.i.i %idxprom2.i.i = zext i32 %j.0.i.i to i64 %arrayidx3.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom2.i.i %12 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5 %cmp4.i.i = icmp sgt i32 %12, %8 br i1 %cmp4.i.i, label %while.body.i.i, label %while.end.i.i.loopexit, !llvm.loop !9 while.body.i.i: ; preds = %land.rhs.preheader.i.i, %land.rhs.i.i %13 = phi i32 [ %12, %land.rhs.i.i ], [ %11, %land.rhs.preheader.i.i ] %i.0.pn33.i.i67 = phi i32 [ %j.034.i.i66, %land.rhs.i.i ], [ %9, %land.rhs.preheader.i.i ] %j.034.i.i66 = phi i32 [ %j.0.i.i, %land.rhs.i.i ], [ %10, %land.rhs.preheader.i.i ] %count.promoted3765 = phi i32 [ %inc.i.i, %land.rhs.i.i ], [ %count.promoted38, %land.rhs.preheader.i.i ] %idxprom7.i.i = sext i32 %i.0.pn33.i.i67 to i64 %arrayidx8.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom7.i.i store i32 %13, ptr %arrayidx8.i.i, align 4, !tbaa !5 %inc.i.i = add nsw i32 %count.promoted3765, 1 %j.0.i.i = sub nsw i32 %j.034.i.i66, %6 %cmp1.i.i = icmp sgt i32 %j.0.i.i, -1 br i1 %cmp1.i.i, label %land.rhs.i.i, label %while.end.i.i.loopexit, !llvm.loop !9 while.end.i.i.loopexit: ; preds = %while.body.i.i, %land.rhs.i.i store i32 %inc.i.i, ptr @count, align 4, !tbaa !5 br label %while.end.i.i while.end.i.i: ; preds = %while.end.i.i.loopexit, %land.rhs.preheader.i.i %count.promoted3540 = phi i32 [ %count.promoted3542, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ] %count.promoted36 = phi i32 [ %count.promoted38, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ] %i.0.pn.lcssa.ph.i.i = phi i32 [ %9, %land.rhs.preheader.i.i ], [ %j.034.i.i66, %while.end.i.i.loopexit ] %idxprom11.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64 %arrayidx12.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom11.i.i store i32 %8, ptr %arrayidx12.i.i, align 4, !tbaa !5 %indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1 %exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i br i1 %exitcond.not.i.i, label %insert.exit.i, label %land.rhs.preheader.i.i, !llvm.loop !11 insert.exit.i: ; preds = %while.end.i.i, %for.body.i %count.promoted3539 = phi i32 [ %count.promoted3543, %for.body.i ], [ %count.promoted3540, %while.end.i.i ] %indvars.iv.next23.i = add nsw i64 %indvars.iv22.i, -1 %cmp3.i = icmp sgt i64 %indvars.iv22.i, 0 br i1 %cmp3.i, label %for.body.i, label %shell.exit, !llvm.loop !12 shell.exit: ; preds = %insert.exit.i, %for.end.i %sub = phi i32 [ %3, %for.end.i ], [ %4, %insert.exit.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %14 = load i32, ptr @m, align 4, !tbaa !5 %cmp544 = icmp sgt i32 %14, 1 br i1 %cmp544, label %for.body6.preheader, label %for.end12 for.body6.preheader: ; preds = %shell.exit %sub3 = add nsw i32 %14, -2 %15 = zext i32 %sub3 to i64 %arrayidx873 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %15 %16 = load i32, ptr %arrayidx873, align 4, !tbaa !5 %call974 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16) %tobool.not75 = icmp eq i32 %sub3, 0 br i1 %tobool.not75, label %for.end12, label %for.inc11 for.inc11: ; preds = %for.body6.preheader, %for.inc11 %indvars.iv5076 = phi i64 [ %indvars.iv.next51, %for.inc11 ], [ %15, %for.body6.preheader ] %putchar = call i32 @putchar(i32 32) %indvars.iv.next51 = add nsw i64 %indvars.iv5076, -1 %arrayidx8 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.next51 %17 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17) %tobool.not = icmp eq i64 %indvars.iv.next51, 0 br i1 %tobool.not, label %for.end12, label %for.inc11, !llvm.loop !14 for.end12: ; preds = %for.inc11, %for.body6.preheader, %shell.exit %18 = load i32, ptr @count, align 4, !tbaa !5 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %18) %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp1546 = icmp sgt i32 %19, 0 br i1 %cmp1546, label %for.body16, label %for.end22 for.body16: ; preds = %for.end12, %for.body16 %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body16 ], [ 0, %for.end12 ] %arrayidx18 = getelementptr inbounds [10000000 x i32], ptr @A, i64 0, i64 %indvars.iv53 %20 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20) %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp15 = icmp slt i64 %indvars.iv.next54, %22 br i1 %cmp15, label %for.body16, label %for.end22, !llvm.loop !15 for.end22: ; preds = %for.body16, %for.end12 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: 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 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int insertionSort(int A[], int n, int g); int shellSort(int A[], int n); int main(){ int total; scanf("%d", &total); int A[total]; int i, j; int cnt; for(i=0; i<total; ++i){ scanf("%d", &A[i]); } cnt=shellSort(A, total); //出力 printf("%d\n", cnt); for(i=0; i<total; ++i){ printf("%d\n", A[i]); } } int insertionSort(int A[], int n, int g){ int i, j; int v; int count=0; for(i=g; i<n; ++i){ v=A[i]; j=i-g; while((j>=0)&&(A[j]>v)){ A[j+g]=A[j]; j=j-g; ++count; } A[j+g]=v; } return count; } int shellSort(int A[], int n){ int index=1; int i=1, j; int cnt=0; while(i<=n){ i=i*3+1; ++index; } --index; int G[index]; i=1; for(j=0; j<index; ++j){ G[j]=i; i=i*3+1; } printf("%d\n", index); for(j=(index-1); j>=0; --j){ printf("%d", G[j]); cnt=cnt+insertionSort(A, n, G[j]); if(j>0) printf(" "); else printf("\n"); } return cnt; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119213/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119213/source.c" target datalayout = "e-m:e-p270: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: %total = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %total) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %total) %0 = load i32, ptr %total, 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 %total, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %3, 0 br i1 %cmp18, 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 i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %total, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ] %call2 = call i32 @shellSort(ptr noundef nonnull %vla, i32 noundef %.lcssa) %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call2) %6 = load i32, ptr %total, align 4, !tbaa !5 %cmp520 = icmp sgt i32 %6, 0 br i1 %cmp520, label %for.body6, label %for.end12 for.body6: ; preds = %for.end, %for.body6 %indvars.iv24 = phi i64 [ %indvars.iv.next25, %for.body6 ], [ 0, %for.end ] %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv24 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1 %8 = load i32, ptr %total, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp5 = icmp slt i64 %indvars.iv.next25, %9 br i1 %cmp5, label %for.body6, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.body6, %for.end call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %total) #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 uwtable define dso_local i32 @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp.not39 = icmp slt i32 %n, 1 br i1 %cmp.not39, label %for.end, label %while.body while.body: ; preds = %entry, %while.body %indvar = phi i64 [ %indvar.next, %while.body ], [ 0, %entry ] %index.041 = phi i32 [ %inc, %while.body ], [ 1, %entry ] %i.040 = phi i32 [ %add, %while.body ], [ 1, %entry ] %mul = mul nsw i32 %i.040, 3 %add = add nsw i32 %mul, 1 %inc = add nuw nsw i32 %index.041, 1 %cmp.not.not = icmp slt i32 %mul, %n %indvar.next = add i64 %indvar, 1 br i1 %cmp.not.not, label %while.body, label %for.body.preheader, !llvm.loop !12 for.body.preheader: ; preds = %while.body %0 = zext i32 %index.041 to i64 %vla55 = alloca i32, i64 %0, align 16 %xtraiter = and i64 %0, 3 %1 = icmp ult i64 %indvar, 3 br i1 %1, label %for.body7.lr.ph.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %0, 2147483644 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %i.144 = phi i32 [ 1, %for.body.preheader.new ], [ %add3.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv store i32 %i.144, ptr %arrayidx, align 16, !tbaa !5 %mul2 = mul nsw i32 %i.144, 3 %add3 = add nsw i32 %mul2, 1 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv.next store i32 %add3, ptr %arrayidx.1, align 4, !tbaa !5 %mul2.1 = mul nsw i32 %add3, 3 %add3.1 = add nsw i32 %mul2.1, 1 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv.next.1 store i32 %add3.1, ptr %arrayidx.2, align 8, !tbaa !5 %mul2.2 = mul nsw i32 %add3.1, 3 %add3.2 = add nsw i32 %mul2.2, 1 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv.next.2 store i32 %add3.2, ptr %arrayidx.3, align 4, !tbaa !5 %mul2.3 = mul nsw i32 %add3.2, 3 %add3.3 = add nsw i32 %mul2.3, 1 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.body7.lr.ph.unr-lcssa, label %for.body, !llvm.loop !13 for.end: ; preds = %entry %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0) br label %for.end20 for.body7.lr.ph.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %i.144.unr = phi i32 [ 1, %for.body.preheader ], [ %add3.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body7.lr.ph, label %for.body.epil for.body.epil: ; preds = %for.body7.lr.ph.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.body7.lr.ph.unr-lcssa ] %i.144.epil = phi i32 [ %add3.epil, %for.body.epil ], [ %i.144.unr, %for.body7.lr.ph.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.body7.lr.ph.unr-lcssa ] %arrayidx.epil = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv.epil store i32 %i.144.epil, ptr %arrayidx.epil, align 4, !tbaa !5 %mul2.epil = mul nsw i32 %i.144.epil, 3 %add3.epil = add nsw i32 %mul2.epil, 1 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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.body7.lr.ph, label %for.body.epil, !llvm.loop !14 for.body7.lr.ph: ; preds = %for.body.epil, %for.body7.lr.ph.unr-lcssa %call69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %index.041) %sub = add nsw i32 %index.041, -1 %wide.trip.count.i = sext i32 %n to i64 %2 = zext i32 %sub to i64 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc18 %indvars.iv50 = phi i64 [ %2, %for.body7.lr.ph ], [ %indvars.iv.next51, %for.inc18 ] %cnt.047 = phi i32 [ 0, %for.body7.lr.ph ], [ %add14, %for.inc18 ] %arrayidx9 = getelementptr inbounds i32, ptr %vla55, i64 %indvars.iv50 %3 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %cmp40.i = icmp slt i32 %3, %n br i1 %cmp40.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body7 %4 = sext i32 %3 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %4, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %count.042.i = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.lcssa.ph.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %6 = trunc i64 %indvars.iv.i to i32 %7 = sub i32 %6, %3 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.036.i = phi i32 [ %j.0.i, %while.body.i ], [ %7, %land.rhs.preheader.i ] %count.135.i = phi i32 [ %inc.i, %while.body.i ], [ %count.042.i, %land.rhs.preheader.i ] %i.0.pn34.i = phi i32 [ %j.036.i, %while.body.i ], [ %6, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.036.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %8 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %8, %5 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn34.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %8, ptr %arrayidx8.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.135.i, 1 %j.0.i = sub nsw i32 %j.036.i, %3 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !16 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn34.i, %land.rhs.i ], [ %j.036.i, %while.body.i ] %count.1.lcssa.ph.i = phi i32 [ %count.135.i, %land.rhs.i ], [ %inc.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %5, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !17 insertionSort.exit: ; preds = %while.end.i, %for.body7 %count.0.lcssa.i = phi i32 [ 0, %for.body7 ], [ %count.1.lcssa.ph.i, %while.end.i ] %add14 = add nsw i32 %count.0.lcssa.i, %cnt.047 %cmp15.not = icmp eq i64 %indvars.iv50, 0 br i1 %cmp15.not, label %for.inc18.thread, label %for.inc18 for.inc18.thread: ; preds = %insertionSort.exit %putchar = tail call i32 @putchar(i32 10) br label %for.end20 for.inc18: ; preds = %insertionSort.exit %putchar38 = tail call i32 @putchar(i32 32) %indvars.iv.next51 = add nsw i64 %indvars.iv50, -1 %cmp6 = icmp sgt i64 %indvars.iv50, 0 br i1 %cmp6, label %for.body7, label %for.end20, !llvm.loop !18 for.end20: ; preds = %for.inc18, %for.inc18.thread, %for.end %cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %add14, %for.inc18.thread ], [ %add14, %for.inc18 ] ret i32 %cnt.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #4 { entry: %cmp40 = icmp slt i32 %g, %n br i1 %cmp40, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %count.042 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa.ph, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.036 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %count.135 = phi i32 [ %inc, %while.body ], [ %count.042, %land.rhs.preheader ] %i.0.pn34 = phi i32 [ %j.036, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.036 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn34 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nsw i32 %count.135, 1 %j.0 = sub nsw i32 %j.036, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !16 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn34, %land.rhs ], [ %j.036, %while.body ] %count.1.lcssa.ph = phi i32 [ %count.135, %land.rhs ], [ %inc, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !17 for.end: ; preds = %while.end, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %while.end ] ret i32 %count.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #define N 1000000 int a[N]; int cnt=0; int G[N]; int m=1; void insertionSort(int n,int g){ for(int i=g;i<n;i++){ int v=a[i]; int j=i-g; while(j>=0 && a[j] > v){ a[j+g]=a[j]; cnt++; j=j-g; } a[j+g]=v; } return; } void shellSort(int n){ int temp=n; G[0]=1; while(1){ G[m]=G[m-1]*3+1; if(G[m] > n)break; m++; } for(int i=m-1;i>=0;i--) insertionSort(n,G[i]); return; } int main(){ int n,i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); shellSort(n); printf("%d\n",m); for(i=m-1;i>0;i--) printf("%d ",G[i]); printf("%d\n",G[0]); printf("%d\n",cnt); for(i=0;i<n;i++) printf("%d\n",a[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119257/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119257/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @cnt = dso_local local_unnamed_addr global i32 0, align 4 @m = dso_local local_unnamed_addr global i32 1, align 4 @a = dso_local global [1000000 x i32] zeroinitializer, align 16 @G = dso_local local_unnamed_addr global [1000000 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 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @insertionSort(i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 { entry: %cmp39 = icmp slt i32 %g, %n br i1 %cmp39, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %cnt.promoted34 = load i32, ptr @cnt, align 4, !tbaa !5 %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader for.cond.cleanup: ; preds = %while.end, %entry ret void land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %cnt.promoted3740 = phi i32 [ %cnt.promoted34, %for.body.preheader ], [ %cnt.promoted35.ph, %while.end ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %cnt.promoted36 = phi i32 [ %inc, %while.body ], [ %cnt.promoted3740, %land.rhs.preheader ] %j.032 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn31 = phi i32 [ %j.032, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.032 to i64 %arrayidx3 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn31 to i64 %arrayidx8 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nsw i32 %cnt.promoted36, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.032, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9 while.end: ; preds = %land.rhs, %while.body %cnt.promoted35.ph = phi i32 [ %cnt.promoted36, %land.rhs ], [ %inc, %while.body ] %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn31, %land.rhs ], [ %j.032, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %land.rhs.preheader, !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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @shellSort(i32 noundef %n) local_unnamed_addr #0 { entry: store i32 1, ptr @G, align 16, !tbaa !5 %m.promoted = load i32, ptr @m, align 4, !tbaa !5 %sub14 = add nsw i32 %m.promoted, -1 %idxprom15 = sext i32 %sub14 to i64 %arrayidx16 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom15 %0 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %mul17 = mul nsw i32 %0, 3 %add18 = add nsw i32 %mul17, 1 %idxprom119 = sext i32 %m.promoted to i64 %arrayidx220 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom119 store i32 %add18, ptr %arrayidx220, align 4, !tbaa !5 %cmp.not21 = icmp slt i32 %mul17, %n br i1 %cmp.not21, label %if.end, label %for.cond.preheader while.cond.for.cond.preheader_crit_edge: ; preds = %if.end %1 = trunc i64 %indvars.iv.next to i32 store i32 %1, ptr @m, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %while.cond.for.cond.preheader_crit_edge, %entry %.lcssa = phi i32 [ %1, %while.cond.for.cond.preheader_crit_edge ], [ %m.promoted, %entry ] %cmp628 = icmp sgt i32 %.lcssa, 0 br i1 %cmp628, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %for.cond.preheader %cnt.promoted = load i32, ptr @cnt, align 4, !tbaa !5 %wide.trip.count.i = sext i32 %n to i64 %2 = zext i32 %.lcssa to i64 br label %for.body if.end: ; preds = %entry, %if.end %3 = phi i32 [ %add, %if.end ], [ %add18, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ %idxprom119, %entry ] %indvars.iv.next = add i64 %indvars.iv, 1 %mul = mul nsw i32 %3, 3 %add = add nsw i32 %mul, 1 %arrayidx2 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.next store i32 %add, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp slt i32 %mul, %n br i1 %cmp.not, label %if.end, label %while.cond.for.cond.preheader_crit_edge for.cond.cleanup: ; preds = %insertionSort.exit, %for.cond.preheader ret void for.body: ; preds = %for.body.lr.ph, %insertionSort.exit %indvars.iv32 = phi i64 [ %2, %for.body.lr.ph ], [ %indvars.iv.next33, %insertionSort.exit ] %inc.i2729 = phi i32 [ %cnt.promoted, %for.body.lr.ph ], [ %inc.i23, %insertionSort.exit ] %indvars.iv.next33 = add nsw i64 %indvars.iv32, -1 %idxprom7 = and i64 %indvars.iv.next33, 4294967295 %arrayidx8 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp39.i = icmp slt i32 %4, %n br i1 %cmp39.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body %5 = sext i32 %4 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %inc.i26 = phi i32 [ %inc.i2729, %for.body.preheader.i ], [ %inc.i24, %while.end.i ] %indvars.iv.i = phi i64 [ %5, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %cnt.promoted3740.i = phi i32 [ %inc.i2729, %for.body.preheader.i ], [ %cnt.promoted35.ph.i, %while.end.i ] %arrayidx.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %7 = trunc i64 %indvars.iv.i to i32 %8 = sub i32 %7, %4 %idxprom2.i35 = zext i32 %8 to i64 %arrayidx3.i36 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom2.i35 %9 = load i32, ptr %arrayidx3.i36, align 4, !tbaa !5 %cmp4.i37 = icmp sgt i32 %9, %6 br i1 %cmp4.i37, label %while.body.i, label %while.end.i land.rhs.i: ; preds = %while.body.i %idxprom2.i = zext i32 %j.0.i to i64 %arrayidx3.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom2.i %10 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %10, %6 br i1 %cmp4.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !9 while.body.i: ; preds = %land.rhs.preheader.i, %land.rhs.i %11 = phi i32 [ %10, %land.rhs.i ], [ %9, %land.rhs.preheader.i ] %i.0.pn31.i40 = phi i32 [ %j.032.i39, %land.rhs.i ], [ %7, %land.rhs.preheader.i ] %j.032.i39 = phi i32 [ %j.0.i, %land.rhs.i ], [ %8, %land.rhs.preheader.i ] %cnt.promoted36.i38 = phi i32 [ %inc.i, %land.rhs.i ], [ %cnt.promoted3740.i, %land.rhs.preheader.i ] %idxprom7.i = sext i32 %i.0.pn31.i40 to i64 %arrayidx8.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom7.i store i32 %11, ptr %arrayidx8.i, align 4, !tbaa !5 %inc.i = add nsw i32 %cnt.promoted36.i38, 1 %j.0.i = sub nsw i32 %j.032.i39, %4 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i.loopexit, !llvm.loop !9 while.end.i.loopexit: ; preds = %while.body.i, %land.rhs.i store i32 %inc.i, ptr @cnt, align 4, !tbaa !5 br label %while.end.i while.end.i: ; preds = %while.end.i.loopexit, %land.rhs.preheader.i %inc.i24 = phi i32 [ %inc.i26, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %cnt.promoted35.ph.i = phi i32 [ %cnt.promoted3740.i, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %i.0.pn.lcssa.ph.i = phi i32 [ %7, %land.rhs.preheader.i ], [ %j.032.i39, %while.end.i.loopexit ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom11.i store i32 %6, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !11 insertionSort.exit: ; preds = %while.end.i, %for.body %inc.i23 = phi i32 [ %inc.i2729, %for.body ], [ %inc.i24, %while.end.i ] %cmp6 = icmp sgt i64 %indvars.iv32, 1 br i1 %cmp6, label %for.body, label %for.cond.cleanup, !llvm.loop !12 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %0, 0 br i1 %cmp30, 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 [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @G, align 16, !tbaa !5 %m.promoted.i = load i32, ptr @m, align 4, !tbaa !5 %sub14.i = add nsw i32 %m.promoted.i, -1 %idxprom15.i = sext i32 %sub14.i to i64 %arrayidx16.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom15.i %3 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %mul17.i = mul nsw i32 %3, 3 %add18.i = add nsw i32 %mul17.i, 1 %idxprom119.i = sext i32 %m.promoted.i to i64 %arrayidx220.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom119.i store i32 %add18.i, ptr %arrayidx220.i, align 4, !tbaa !5 %cmp.not21.i = icmp slt i32 %mul17.i, %.lcssa br i1 %cmp.not21.i, label %if.end.i, label %for.cond.preheader.i while.cond.for.cond.preheader_crit_edge.i: ; preds = %if.end.i %4 = trunc i64 %indvars.iv.next.i to i32 store i32 %4, ptr @m, align 4, !tbaa !5 br label %for.cond.preheader.i for.cond.preheader.i: ; preds = %while.cond.for.cond.preheader_crit_edge.i, %for.end %5 = phi i32 [ %4, %while.cond.for.cond.preheader_crit_edge.i ], [ %m.promoted.i, %for.end ] %cmp628.i = icmp sgt i32 %5, 0 br i1 %cmp628.i, label %for.body.lr.ph.i, label %shellSort.exit for.body.lr.ph.i: ; preds = %for.cond.preheader.i %cnt.promoted.i = load i32, ptr @cnt, align 4, !tbaa !5 %wide.trip.count.i.i = sext i32 %.lcssa to i64 %6 = zext i32 %5 to i64 br label %for.body.i if.end.i: ; preds = %for.end, %if.end.i %7 = phi i32 [ %add.i, %if.end.i ], [ %add18.i, %for.end ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ %idxprom119.i, %for.end ] %indvars.iv.next.i = add i64 %indvars.iv.i, 1 %mul.i = mul nsw i32 %7, 3 %add.i = add nsw i32 %mul.i, 1 %arrayidx2.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.next.i store i32 %add.i, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.not.i = icmp slt i32 %mul.i, %.lcssa br i1 %cmp.not.i, label %if.end.i, label %while.cond.for.cond.preheader_crit_edge.i for.body.i: ; preds = %insertionSort.exit.i, %for.body.lr.ph.i %indvars.iv32.i = phi i64 [ %6, %for.body.lr.ph.i ], [ %indvars.iv.next33.i, %insertionSort.exit.i ] %inc.i2729.i = phi i32 [ %cnt.promoted.i, %for.body.lr.ph.i ], [ %inc.i23.i, %insertionSort.exit.i ] %indvars.iv.next33.i = add nsw i64 %indvars.iv32.i, -1 %idxprom7.i = and i64 %indvars.iv.next33.i, 4294967295 %arrayidx8.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom7.i %8 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5 %cmp39.i.i = icmp slt i32 %8, %.lcssa br i1 %cmp39.i.i, label %for.body.preheader.i.i, label %insertionSort.exit.i for.body.preheader.i.i: ; preds = %for.body.i %9 = sext i32 %8 to i64 br label %land.rhs.preheader.i.i land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i %inc.i26.i = phi i32 [ %inc.i2729.i, %for.body.preheader.i.i ], [ %inc.i24.i, %while.end.i.i ] %indvars.iv.i.i = phi i64 [ %9, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ] %cnt.promoted3740.i.i = phi i32 [ %inc.i2729.i, %for.body.preheader.i.i ], [ %cnt.promoted35.ph.i.i, %while.end.i.i ] %arrayidx.i.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv.i.i %10 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.i.i to i32 %12 = sub i32 %11, %8 %idxprom2.i.i32 = zext i32 %12 to i64 %arrayidx3.i.i33 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom2.i.i32 %13 = load i32, ptr %arrayidx3.i.i33, align 4, !tbaa !5 %cmp4.i.i34 = icmp sgt i32 %13, %10 br i1 %cmp4.i.i34, label %while.body.i.i, label %while.end.i.i land.rhs.i.i: ; preds = %while.body.i.i %idxprom2.i.i = zext i32 %j.0.i.i to i64 %arrayidx3.i.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom2.i.i %14 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5 %cmp4.i.i = icmp sgt i32 %14, %10 br i1 %cmp4.i.i, label %while.body.i.i, label %while.end.i.i.sink.split, !llvm.loop !9 while.body.i.i: ; preds = %land.rhs.preheader.i.i, %land.rhs.i.i %15 = phi i32 [ %14, %land.rhs.i.i ], [ %13, %land.rhs.preheader.i.i ] %i.0.pn31.i.i37 = phi i32 [ %j.032.i.i36, %land.rhs.i.i ], [ %11, %land.rhs.preheader.i.i ] %j.032.i.i36 = phi i32 [ %j.0.i.i, %land.rhs.i.i ], [ %12, %land.rhs.preheader.i.i ] %cnt.promoted36.i.i35 = phi i32 [ %inc.i.i, %land.rhs.i.i ], [ %cnt.promoted3740.i.i, %land.rhs.preheader.i.i ] %idxprom7.i.i = sext i32 %i.0.pn31.i.i37 to i64 %arrayidx8.i.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom7.i.i store i32 %15, ptr %arrayidx8.i.i, align 4, !tbaa !5 %inc.i.i = add nsw i32 %cnt.promoted36.i.i35, 1 %j.0.i.i = sub nsw i32 %j.032.i.i36, %8 %cmp1.i.i = icmp sgt i32 %j.0.i.i, -1 br i1 %cmp1.i.i, label %land.rhs.i.i, label %while.end.i.i.sink.split, !llvm.loop !9 while.end.i.i.sink.split: ; preds = %land.rhs.i.i, %while.body.i.i store i32 %inc.i.i, ptr @cnt, align 4, !tbaa !5 br label %while.end.i.i while.end.i.i: ; preds = %while.end.i.i.sink.split, %land.rhs.preheader.i.i %inc.i24.i = phi i32 [ %inc.i26.i, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.sink.split ] %cnt.promoted35.ph.i.i = phi i32 [ %cnt.promoted3740.i.i, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.sink.split ] %i.0.pn.lcssa.ph.i.i = phi i32 [ %11, %land.rhs.preheader.i.i ], [ %j.032.i.i36, %while.end.i.i.sink.split ] %idxprom11.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64 %arrayidx12.i.i = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %idxprom11.i.i store i32 %10, ptr %arrayidx12.i.i, align 4, !tbaa !5 %indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1 %exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i br i1 %exitcond.not.i.i, label %insertionSort.exit.i, label %land.rhs.preheader.i.i, !llvm.loop !11 insertionSort.exit.i: ; preds = %while.end.i.i, %for.body.i %inc.i23.i = phi i32 [ %inc.i2729.i, %for.body.i ], [ %inc.i24.i, %while.end.i.i ] %cmp6.i = icmp sgt i64 %indvars.iv32.i, 1 br i1 %cmp6.i, label %for.body.i, label %shellSort.exit, !llvm.loop !12 shellSort.exit: ; preds = %insertionSort.exit.i, %for.cond.preheader.i %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %16 = load i32, ptr @m, align 4, !tbaa !5 %cmp445 = icmp sgt i32 %16, 1 br i1 %cmp445, label %for.body5.preheader, label %for.end10 for.body5.preheader: ; preds = %shellSort.exit %17 = zext i32 %16 to i64 br label %for.body5 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv53 = phi i64 [ %17, %for.body5.preheader ], [ %indvars.iv.next54, %for.body5 ] %indvars.iv.next54 = add nsw i64 %indvars.iv53, -1 %idxprom6 = and i64 %indvars.iv.next54, 4294967295 %arrayidx7 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom6 %18 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) %cmp4 = icmp ugt i64 %indvars.iv53, 2 br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !14 for.end10: ; preds = %for.body5, %shellSort.exit %19 = load i32, ptr @G, align 16, !tbaa !5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19) %20 = load i32, ptr @cnt, align 4, !tbaa !5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp1447 = icmp sgt i32 %21, 0 br i1 %cmp1447, label %for.body15, label %for.end21 for.body15: ; preds = %for.end10, %for.body15 %indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body15 ], [ 0, %for.end10 ] %arrayidx17 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv56 %22 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22) %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp14 = icmp slt i64 %indvars.iv.next57, %24 br i1 %cmp14, label %for.body15, label %for.end21, !llvm.loop !15 for.end21: ; preds = %for.body15, %for.end10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> int insertion_sort(int * a, int length, int g){ int count = 0; for( int i = 0; i < length; i ++ ){ int v = a[ i ]; int j = i - g; while( j >= 0 && a[ j ] > v ){ a[ j + g ] = a[ j ]; j = j - g; count ++; } a[ j + g ] = v; } return count; } void shell( int *a, int length ){ int count = 0; int m = length / 3 + 1; int *g = ( int * )malloc( m * sizeof( int ) ); int k = 3, i; for( i = 0; i < m && (k - 1)/2 <= length; i ++ ){ g[ i ] = (k - 1)/2; k *= 3; } m = i; printf("%d\n", m ); for( i = m - 1; i > 0; i -- ) printf("%d ", g[ i ] ); printf("%d\n", g[ i ] ); for( i = m - 1; i >= 0; i -- ) count += insertion_sort( a, length, g[ i ] ); printf("%d\n", count ); } int main( void ){ int n; scanf("%d\n", &n ); int *a = ( int * )malloc( n * sizeof( int ) ); for( int i = 0; i < n; i ++ ) scanf("%d\n", a + i ); shell( a, n ); for( int i = 0; i < n ; i ++ ) printf("%d\n", a[ i ] ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119307/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119307/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @insertion_sort(ptr nocapture noundef %a, i32 noundef %length, i32 noundef %g) local_unnamed_addr #0 { entry: %cmp39 = icmp sgt i32 %length, 0 br i1 %cmp39, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %length to i64 br label %for.body for.cond.cleanup: ; preds = %while.end, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa, %while.end ] ret i32 %count.0.lcssa for.body: ; preds = %for.body.preheader, %while.end %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %count.041 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa, %while.end ] %indvars43 = trunc i64 %indvars.iv to i32 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %j.031 = sub nsw i32 %indvars43, %g %cmp132 = icmp sgt i32 %j.031, -1 br i1 %cmp132, label %land.rhs, label %while.end land.rhs: ; preds = %for.body, %while.body %j.035 = phi i32 [ %j.0, %while.body ], [ %j.031, %for.body ] %i.0.pn34 = phi i32 [ %j.035, %while.body ], [ %indvars43, %for.body ] %count.133 = phi i32 [ %inc, %while.body ], [ %count.041, %for.body ] %idxprom2 = zext i32 %j.035 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2 %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %1, %0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn34 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7 store i32 %1, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nsw i32 %count.133, 1 %j.0 = sub nsw i32 %j.035, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9 while.end: ; preds = %land.rhs, %while.body, %for.body %count.1.lcssa = phi i32 [ %count.041, %for.body ], [ %inc, %while.body ], [ %count.133, %land.rhs ] %i.0.pn.lcssa = phi i32 [ %indvars43, %for.body ], [ %j.035, %while.body ], [ %i.0.pn34, %land.rhs ] %idxprom11 = sext i32 %i.0.pn.lcssa to i64 %arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %idxprom11 store i32 %0, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !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: 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 @shell(ptr nocapture noundef %a, i32 noundef %length) local_unnamed_addr #2 { entry: %div = sdiv i32 %length, 3 %add = add nsw i32 %div, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #5 %cmp.not57 = icmp slt i32 %length, -2 br i1 %cmp.not57, label %for.end.thread, label %land.rhs.preheader for.end.thread: ; preds = %entry %call877 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0) br label %for.end18 land.rhs.preheader: ; preds = %entry %wide.trip.count = zext i32 %add to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %for.body %indvars.iv = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next, %for.body ] %k.058 = phi i32 [ 3, %land.rhs.preheader ], [ %mul7, %for.body ] %sub = add nsw i32 %k.058, -1 %div2 = sdiv i32 %sub, 2 %cmp3.not = icmp sgt i32 %div2, %length br i1 %cmp3.not, label %for.end.split.loop.exit, label %for.body for.body: ; preds = %land.rhs %arrayidx = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %div2, ptr %arrayidx, align 4, !tbaa !5 %mul7 = mul nsw i32 %k.058, 3 %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 %land.rhs, !llvm.loop !12 for.end.split.loop.exit: ; preds = %land.rhs %0 = trunc i64 %indvars.iv to i32 br label %for.end for.end: ; preds = %for.body, %for.end.split.loop.exit %i.0.lcssa = phi i32 [ %0, %for.end.split.loop.exit ], [ %add, %for.body ] %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.lcssa) %sub9 = add i32 %i.0.lcssa, -1 %cmp1161 = icmp sgt i32 %i.0.lcssa, 1 br i1 %cmp1161, label %for.body13.preheader, label %for.end18 for.body13.preheader: ; preds = %for.end %1 = zext i32 %sub9 to i64 br label %for.body13 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv70 = phi i64 [ %1, %for.body13.preheader ], [ %indvars.iv.next71, %for.body13 ] %arrayidx15 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv70 %2 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %cmp11 = icmp ugt i64 %indvars.iv70, 1 br i1 %cmp11, label %for.body13, label %for.end18, !llvm.loop !13 for.end18: ; preds = %for.body13, %for.end.thread, %for.end %sub981 = phi i32 [ %sub9, %for.end ], [ -1, %for.end.thread ], [ %sub9, %for.body13 ] %i.0.lcssa80 = phi i32 [ %i.0.lcssa, %for.end ], [ 0, %for.end.thread ], [ %i.0.lcssa, %for.body13 ] %i.1.lcssa = phi i32 [ %sub9, %for.end ], [ -1, %for.end.thread ], [ 0, %for.body13 ] %idxprom19 = sext i32 %i.1.lcssa to i64 %arrayidx20 = getelementptr inbounds i32, ptr %call, i64 %idxprom19 %3 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %call21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %cmp2464 = icmp sgt i32 %i.0.lcssa80, 0 br i1 %cmp2464, label %for.body26.lr.ph, label %for.end33 for.body26.lr.ph: ; preds = %for.end18 %cmp39.i = icmp sgt i32 %length, 0 %wide.trip.count.i = zext i32 %length to i64 br i1 %cmp39.i, label %for.body26.us.preheader, label %for.end33 for.body26.us.preheader: ; preds = %for.body26.lr.ph %4 = zext i32 %sub981 to i64 br label %for.body26.us for.body26.us: ; preds = %for.body26.us.preheader, %insertion_sort.exit.loopexit.us %indvars.iv73 = phi i64 [ %4, %for.body26.us.preheader ], [ %indvars.iv.next74, %insertion_sort.exit.loopexit.us ] %count.065.us = phi i32 [ 0, %for.body26.us.preheader ], [ %add30.us, %insertion_sort.exit.loopexit.us ] %arrayidx28.us = getelementptr inbounds i32, ptr %call, i64 %indvars.iv73 %5 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 br label %for.body.i.us for.body.i.us: ; preds = %while.end.i.us, %for.body26.us %indvars.iv.i.us = phi i64 [ 0, %for.body26.us ], [ %indvars.iv.next.i.us, %while.end.i.us ] %count.041.i.us = phi i32 [ 0, %for.body26.us ], [ %count.1.lcssa.i.us, %while.end.i.us ] %indvars43.i.us = trunc i64 %indvars.iv.i.us to i32 %arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us %6 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5 %j.031.i.us = sub nsw i32 %indvars43.i.us, %5 %cmp132.i.us = icmp sgt i32 %j.031.i.us, -1 br i1 %cmp132.i.us, label %land.rhs.i.us, label %while.end.i.us land.rhs.i.us: ; preds = %for.body.i.us, %while.body.i.us %j.035.i.us = phi i32 [ %j.0.i.us, %while.body.i.us ], [ %j.031.i.us, %for.body.i.us ] %i.0.pn34.i.us = phi i32 [ %j.035.i.us, %while.body.i.us ], [ %indvars43.i.us, %for.body.i.us ] %count.133.i.us = phi i32 [ %inc.i.us, %while.body.i.us ], [ %count.041.i.us, %for.body.i.us ] %idxprom2.i.us = zext i32 %j.035.i.us to i64 %arrayidx3.i.us = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i.us %7 = load i32, ptr %arrayidx3.i.us, align 4, !tbaa !5 %cmp4.i.us = icmp sgt i32 %7, %6 br i1 %cmp4.i.us, label %while.body.i.us, label %while.end.i.us while.body.i.us: ; preds = %land.rhs.i.us %idxprom7.i.us = sext i32 %i.0.pn34.i.us to i64 %arrayidx8.i.us = getelementptr inbounds i32, ptr %a, i64 %idxprom7.i.us store i32 %7, ptr %arrayidx8.i.us, align 4, !tbaa !5 %inc.i.us = add nsw i32 %count.133.i.us, 1 %j.0.i.us = sub nsw i32 %j.035.i.us, %5 %cmp1.i.us = icmp sgt i32 %j.0.i.us, -1 br i1 %cmp1.i.us, label %land.rhs.i.us, label %while.end.i.us, !llvm.loop !9 while.end.i.us: ; preds = %land.rhs.i.us, %while.body.i.us, %for.body.i.us %count.1.lcssa.i.us = phi i32 [ %count.041.i.us, %for.body.i.us ], [ %count.133.i.us, %land.rhs.i.us ], [ %inc.i.us, %while.body.i.us ] %i.0.pn.lcssa.i.us = phi i32 [ %indvars43.i.us, %for.body.i.us ], [ %i.0.pn34.i.us, %land.rhs.i.us ], [ %j.035.i.us, %while.body.i.us ] %idxprom11.i.us = sext i32 %i.0.pn.lcssa.i.us to i64 %arrayidx12.i.us = getelementptr inbounds i32, ptr %a, i64 %idxprom11.i.us store i32 %6, ptr %arrayidx12.i.us, align 4, !tbaa !5 %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %insertion_sort.exit.loopexit.us, label %for.body.i.us, !llvm.loop !11 insertion_sort.exit.loopexit.us: ; preds = %while.end.i.us %add30.us = add nsw i32 %count.1.lcssa.i.us, %count.065.us %indvars.iv.next74 = add nsw i64 %indvars.iv73, -1 %cmp24.us = icmp sgt i64 %indvars.iv73, 0 br i1 %cmp24.us, label %for.body26.us, label %for.end33, !llvm.loop !14 for.end33: ; preds = %insertion_sort.exit.loopexit.us, %for.body26.lr.ph, %for.end18 %count.0.lcssa = phi i32 [ 0, %for.end18 ], [ 0, %for.body26.lr.ph ], [ %add30.us, %insertion_sort.exit.loopexit.us ] %call34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa) ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #5 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] call void @shell(ptr noundef %call1, i32 noundef %.lcssa) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp622 = icmp sgt i32 %1, 0 br i1 %cmp622, label %for.body9, label %for.cond.cleanup8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15 for.cond.cleanup8: ; preds = %for.body9, %for.cond.cleanup call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body9: ; preds = %for.cond.cleanup, %for.body9 %indvars.iv26 = phi i64 [ %indvars.iv.next27, %for.body9 ], [ 0, %for.cond.cleanup ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv26 %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp6 = icmp slt i64 %indvars.iv.next27, %6 br i1 %cmp6, label %for.body9, label %for.cond.cleanup8, !llvm.loop !16 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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 allocsize(0) } 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} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> int main(void){ int n,i,max,min,tmp,j,v,k,z,x,cnt; cnt=0; z=0; x=1; scanf("%d",&n); int a[1000001],g[20]; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0; x<=n; i++) { g[i]=x; x=x*3+1; z++; } for(k=z-1; k>=0; k--) { for(i=g[k];i<n;i++) { v=a[i]; j=i-g[k]; while(j>=0&&a[j]>v) { a[j+g[k]]=a[j]; j=j-g[k]; cnt++; } a[j+g[k]]=v; } } printf("%d\n",z); for(i=z-1; i>=0; i--) { printf("%d",g[i]); if(i){ printf(" "); } } printf("\n%d\n",cnt); for(i=0; i<n; i++) { printf("%d\n",a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119350/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119350/source.c" target datalayout = "e-m:e-p270: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.3 = private unnamed_addr constant [5 x i8] c"\0A%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 %a = alloca [1000001 x i32], align 16 %g = alloca [20 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 4000004, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %g) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp104 = icmp sgt i32 %0, 0 br i1 %cmp104, label %for.body, label %for.end48.thread for.cond2.preheader: ; preds = %for.body %cmp3.not106 = icmp slt i32 %1, 1 br i1 %cmp3.not106, label %for.end48.thread, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv134 = phi i64 [ %indvars.iv.next135, %for.body4 ], [ 0, %for.cond2.preheader ] %x.0109 = phi i32 [ %add, %for.body4 ], [ 1, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [20 x i32], ptr %g, i64 0, i64 %indvars.iv134 store i32 %x.0109, ptr %arrayidx6, align 4, !tbaa !5 %mul = mul nsw i32 %x.0109, 3 %add = add nsw i32 %mul, 1 %indvars.iv.next135 = add nuw i64 %indvars.iv134, 1 %cmp3.not.not = icmp slt i32 %mul, %1 br i1 %cmp3.not.not, label %for.body4, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.body4 %indvars = trunc i64 %indvars.iv.next135 to i32 %sub = add i32 %indvars, -1 %cmp12124 = icmp sgt i32 %indvars, 0 br i1 %cmp12124, label %for.body13.preheader, label %for.end48.thread for.body13.preheader: ; preds = %for.end10 %3 = zext i32 %sub to i64 %wide.trip.count = sext i32 %1 to i64 br label %for.body13 for.body13: ; preds = %for.body13.preheader, %for.inc47 %indvars.iv144 = phi i64 [ %3, %for.body13.preheader ], [ %indvars.iv.next145, %for.inc47 ] %cnt.0126 = phi i32 [ 0, %for.body13.preheader ], [ %cnt.1.lcssa, %for.inc47 ] %arrayidx15 = getelementptr inbounds [20 x i32], ptr %g, i64 0, i64 %indvars.iv144 %4 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp17120 = icmp slt i32 %4, %1 br i1 %cmp17120, label %for.body18.preheader, label %for.inc47 for.body18.preheader: ; preds = %for.body13 %5 = sext i32 %4 to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body18.preheader %indvars.iv139 = phi i64 [ %5, %for.body18.preheader ], [ %indvars.iv.next140, %while.end ] %cnt.1122 = phi i32 [ %cnt.0126, %for.body18.preheader ], [ %cnt.2.lcssa.ph, %while.end ] %arrayidx20 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv139 %6 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %7 = trunc i64 %indvars.iv139 to i32 %8 = trunc i64 %indvars.iv139 to i32 %9 = sub i32 %8, %4 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.0115 = phi i32 [ %j.0, %while.body ], [ %9, %land.rhs.preheader ] %cnt.2114 = phi i32 [ %inc38, %while.body ], [ %cnt.1122, %land.rhs.preheader ] %i.2.pn113 = phi i32 [ %j.0115, %while.body ], [ %7, %land.rhs.preheader ] %idxprom25 = zext i32 %j.0115 to i64 %arrayidx26 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %idxprom25 %10 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %10, %6 br i1 %cmp27, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom33 = sext i32 %i.2.pn113 to i64 %arrayidx34 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %idxprom33 store i32 %10, ptr %arrayidx34, align 4, !tbaa !5 %inc38 = add nsw i32 %cnt.2114, 1 %j.0 = sub nsw i32 %j.0115, %4 %cmp24 = icmp sgt i32 %j.0, -1 br i1 %cmp24, label %land.rhs, label %while.end, !llvm.loop !12 while.end: ; preds = %land.rhs, %while.body %i.2.pn.lcssa.ph = phi i32 [ %i.2.pn113, %land.rhs ], [ %j.0115, %while.body ] %cnt.2.lcssa.ph = phi i32 [ %cnt.2114, %land.rhs ], [ %inc38, %while.body ] %idxprom42 = sext i32 %i.2.pn.lcssa.ph to i64 %arrayidx43 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %idxprom42 store i32 %6, ptr %arrayidx43, align 4, !tbaa !5 %indvars.iv.next140 = add nsw i64 %indvars.iv139, 1 %exitcond.not = icmp eq i64 %indvars.iv.next140, %wide.trip.count br i1 %exitcond.not, label %for.inc47, label %land.rhs.preheader, !llvm.loop !13 for.inc47: ; preds = %while.end, %for.body13 %cnt.1.lcssa = phi i32 [ %cnt.0126, %for.body13 ], [ %cnt.2.lcssa.ph, %while.end ] %indvars.iv.next145 = add nsw i64 %indvars.iv144, -1 %cmp12 = icmp sgt i64 %indvars.iv144, 0 br i1 %cmp12, label %for.body13, label %for.end48, !llvm.loop !14 for.end48.thread: ; preds = %for.end10, %for.cond2.preheader, %entry %z.0.lcssa163.ph = phi i32 [ %indvars, %for.end10 ], [ 0, %for.cond2.preheader ], [ 0, %entry ] %call49170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %z.0.lcssa163.ph) br label %for.end60 for.end48: ; preds = %for.inc47 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %indvars) br i1 %cmp12124, label %for.body53.preheader, label %for.end60 for.body53.preheader: ; preds = %for.end48 %11 = zext i32 %sub to i64 %arrayidx55174 = getelementptr inbounds [20 x i32], ptr %g, i64 0, i64 %11 %12 = load i32, ptr %arrayidx55174, align 4, !tbaa !5 %call56175 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12) %tobool.not176 = icmp eq i32 %sub, 0 br i1 %tobool.not176, label %for.end60, label %for.inc58 for.inc58: ; preds = %for.body53.preheader, %for.inc58 %indvars.iv148177 = phi i64 [ %indvars.iv.next149, %for.inc58 ], [ %11, %for.body53.preheader ] %putchar = call i32 @putchar(i32 32) %indvars.iv.next149 = add nsw i64 %indvars.iv148177, -1 %arrayidx55 = getelementptr inbounds [20 x i32], ptr %g, i64 0, i64 %indvars.iv.next149 %13 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13) %tobool.not = icmp eq i64 %indvars.iv.next149, 0 br i1 %tobool.not, label %for.end60, label %for.inc58, !llvm.loop !15 for.end60: ; preds = %for.inc58, %for.body53.preheader, %for.end48.thread, %for.end48 %cnt.0.lcssa171 = phi i32 [ 0, %for.end48.thread ], [ %cnt.1.lcssa, %for.end48 ], [ %cnt.1.lcssa, %for.body53.preheader ], [ %cnt.1.lcssa, %for.inc58 ] %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cnt.0.lcssa171) %14 = load i32, ptr %n, align 4, !tbaa !5 %cmp63130 = icmp sgt i32 %14, 0 br i1 %cmp63130, label %for.body64, label %for.end70 for.body64: ; preds = %for.end60, %for.body64 %indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.body64 ], [ 0, %for.end60 ] %arrayidx66 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv152 %15 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15) %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %16 = load i32, ptr %n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp63 = icmp slt i64 %indvars.iv.next153, %17 br i1 %cmp63, label %for.body64, label %for.end70, !llvm.loop !16 for.end70: ; preds = %for.body64, %for.end60 call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %g) #4 call void @llvm.lifetime.end.p0(i64 4000004, ptr nonnull %a) #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} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> int cnt; void insertionSort(int*,int,int); int main(){ int n,A[1000000],i,m=1,hn=1; int G[100]; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&A[i]); } //shellSort cnt=0; for(i=0; i<100; i++){ hn=hn*3+1; if(n<=hn){ break; } m++; } G[m-1]=1; for(i=m-2; i>=0; i--){ G[i]=G[i+1]*3+1; } /*for(i=0; i<=m; i++){ printf("G[%d]:%d\n",i,G[i]); }*/ for(i=0; i<=m; i++){ insertionSort(A, n, G[i]); } printf("%d\n",m); for(i=0; i<m; i++){ if(i){ printf(" "); } printf("%d",G[i]); } printf("\n%d\n",cnt); for(i=0; i<n; i++){ printf("%d\n",A[i]); } return 0; } void insertionSort(int* A,int n,int g){ int i,v,j; for(i=g; i<n; i++){ v=A[i]; j=i-g; while(j>=0 && A[j]>v){ A[j+g]=A[j]; j=j-g; cnt++; } A[j+g]=v; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119394/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119394/source.c" target datalayout = "e-m:e-p270: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 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"\0A%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 %A = alloca [1000000 x i32], align 16 %G = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %G) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp80 = icmp sgt i32 %0, 0 br i1 %cmp80, 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 [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 0, ptr @cnt, align 4, !tbaa !5 br label %for.body4 for.body4: ; preds = %if.end.4, %for.end %hn.084 = phi i32 [ 1, %for.end ], [ %add.4, %if.end.4 ] %m.083 = phi i32 [ 1, %for.end ], [ %inc6.4, %if.end.4 ] %mul = mul nsw i32 %hn.084, 3 %add = add nsw i32 %mul, 1 %cmp5.not = icmp sgt i32 %.lcssa, %add br i1 %cmp5.not, label %if.end, label %for.end9 if.end: ; preds = %for.body4 %mul.1 = mul nsw i32 %add, 3 %add.1 = add nsw i32 %mul.1, 1 %cmp5.not.1 = icmp sgt i32 %.lcssa, %add.1 br i1 %cmp5.not.1, label %if.end.1, label %for.end9.split.loop.exit150 if.end.1: ; preds = %if.end %mul.2 = mul nsw i32 %add.1, 3 %add.2 = add nsw i32 %mul.2, 1 %cmp5.not.2 = icmp sgt i32 %.lcssa, %add.2 br i1 %cmp5.not.2, label %if.end.2, label %for.end9.split.loop.exit148 if.end.2: ; preds = %if.end.1 %mul.3 = mul nsw i32 %add.2, 3 %add.3 = add nsw i32 %mul.3, 1 %cmp5.not.3 = icmp sgt i32 %.lcssa, %add.3 br i1 %cmp5.not.3, label %if.end.3, label %for.end9.split.loop.exit146 if.end.3: ; preds = %if.end.2 %mul.4 = mul nsw i32 %add.3, 3 %add.4 = add nsw i32 %mul.4, 1 %cmp5.not.4 = icmp sgt i32 %.lcssa, %add.4 br i1 %cmp5.not.4, label %if.end.4, label %for.end9.split.loop.exit if.end.4: ; preds = %if.end.3 %inc6.4 = add nuw nsw i32 %m.083, 5 %exitcond.not.4 = icmp eq i32 %inc6.4, 101 br i1 %exitcond.not.4, label %for.end9.thread, label %for.body4, !llvm.loop !11 for.end9.thread: ; preds = %if.end.4 %arrayidx11124 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 100 store i32 1, ptr %arrayidx11124, align 16, !tbaa !5 br label %for.body15.preheader for.end9.split.loop.exit: ; preds = %if.end.3 %inc6.3.le = add nuw nsw i32 %m.083, 4 br label %for.end9 for.end9.split.loop.exit146: ; preds = %if.end.2 %inc6.2.le = add nuw nsw i32 %m.083, 3 br label %for.end9 for.end9.split.loop.exit148: ; preds = %if.end.1 %inc6.1.le = add nuw nsw i32 %m.083, 2 br label %for.end9 for.end9.split.loop.exit150: ; preds = %if.end %inc6.le = add nuw nsw i32 %m.083, 1 br label %for.end9 for.end9: ; preds = %for.body4, %for.end9.split.loop.exit150, %for.end9.split.loop.exit148, %for.end9.split.loop.exit146, %for.end9.split.loop.exit %m.083.lcssa = phi i32 [ %inc6.3.le, %for.end9.split.loop.exit ], [ %inc6.2.le, %for.end9.split.loop.exit146 ], [ %inc6.1.le, %for.end9.split.loop.exit148 ], [ %inc6.le, %for.end9.split.loop.exit150 ], [ %m.083, %for.body4 ] %sub = add nsw i32 %m.083.lcssa, -1 %idxprom10 = sext i32 %sub to i64 %arrayidx11 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %idxprom10 store i32 1, ptr %arrayidx11, align 4, !tbaa !5 %cmp1485 = icmp ugt i32 %m.083.lcssa, 1 br i1 %cmp1485, label %for.body15.preheader, label %for.cond25.preheader for.body15.preheader: ; preds = %for.end9.thread, %for.end9 %m.0.lcssa126 = phi i32 [ 101, %for.end9.thread ], [ %m.083.lcssa, %for.end9 ] %sub12 = add nsw i32 %m.0.lcssa126, -2 %3 = zext i32 %sub12 to i64 %4 = shl nuw nsw i64 %3, 2 %5 = getelementptr i8, ptr %G, i64 %4 %scevgep = getelementptr i8, ptr %5, i64 4 %load_initial = load i32, ptr %scevgep, align 4 %6 = add nuw nsw i64 %3, 1 %xtraiter = and i64 %6, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body15.prol.loopexit, label %for.body15.prol for.body15.prol: ; preds = %for.body15.preheader, %for.body15.prol %store_forwarded.prol = phi i32 [ %add20.prol, %for.body15.prol ], [ %load_initial, %for.body15.preheader ] %indvars.iv104.prol = phi i64 [ %indvars.iv.next105.prol, %for.body15.prol ], [ %3, %for.body15.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body15.prol ], [ 0, %for.body15.preheader ] %mul19.prol = mul nsw i32 %store_forwarded.prol, 3 %add20.prol = add nsw i32 %mul19.prol, 1 %arrayidx22.prol = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv104.prol store i32 %add20.prol, ptr %arrayidx22.prol, align 4, !tbaa !5 %indvars.iv.next105.prol = add nsw i64 %indvars.iv104.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body15.prol.loopexit, label %for.body15.prol, !llvm.loop !12 for.body15.prol.loopexit: ; preds = %for.body15.prol, %for.body15.preheader %store_forwarded.unr = phi i32 [ %load_initial, %for.body15.preheader ], [ %add20.prol, %for.body15.prol ] %indvars.iv104.unr = phi i64 [ %3, %for.body15.preheader ], [ %indvars.iv.next105.prol, %for.body15.prol ] %7 = icmp ult i32 %sub12, 3 br i1 %7, label %for.cond25.preheader, label %for.body15 for.cond25.preheader: ; preds = %for.body15.prol.loopexit, %for.body15, %for.end9 %m.0.lcssa127 = phi i32 [ 1, %for.end9 ], [ %m.0.lcssa126, %for.body15 ], [ %m.0.lcssa126, %for.body15.prol.loopexit ] %wide.trip.count.i = sext i32 %.lcssa to i64 %8 = add nuw nsw i32 %m.0.lcssa127, 1 %wide.trip.count = zext i32 %8 to i64 br label %for.body27 for.body15: ; preds = %for.body15.prol.loopexit, %for.body15 %store_forwarded = phi i32 [ %add20.3, %for.body15 ], [ %store_forwarded.unr, %for.body15.prol.loopexit ] %indvars.iv104 = phi i64 [ %indvars.iv.next105.3, %for.body15 ], [ %indvars.iv104.unr, %for.body15.prol.loopexit ] %mul19 = mul nsw i32 %store_forwarded, 3 %add20 = add nsw i32 %mul19, 1 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv104 store i32 %add20, ptr %arrayidx22, align 4, !tbaa !5 %indvars.iv.next105 = add nsw i64 %indvars.iv104, -1 %mul19.1 = mul nsw i32 %add20, 3 %add20.1 = add nsw i32 %mul19.1, 1 %arrayidx22.1 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv.next105 store i32 %add20.1, ptr %arrayidx22.1, align 4, !tbaa !5 %indvars.iv.next105.1 = add nsw i64 %indvars.iv104, -2 %mul19.2 = mul nsw i32 %add20.1, 3 %add20.2 = add nsw i32 %mul19.2, 1 %arrayidx22.2 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv.next105.1 store i32 %add20.2, ptr %arrayidx22.2, align 4, !tbaa !5 %indvars.iv.next105.2 = add nsw i64 %indvars.iv104, -3 %mul19.3 = mul nsw i32 %add20.2, 3 %add20.3 = add nsw i32 %mul19.3, 1 %arrayidx22.3 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv.next105.2 store i32 %add20.3, ptr %arrayidx22.3, align 4, !tbaa !5 %indvars.iv.next105.3 = add nsw i64 %indvars.iv104, -4 %cmp14.not.3 = icmp eq i64 %indvars.iv.next105.2, 0 br i1 %cmp14.not.3, label %for.cond25.preheader, label %for.body15, !llvm.loop !14 for.body27: ; preds = %for.cond25.preheader, %insertionSort.exit %indvars.iv108 = phi i64 [ 0, %for.cond25.preheader ], [ %indvars.iv.next109, %insertionSort.exit ] %cnt.promoted889697 = phi i32 [ 0, %for.cond25.preheader ], [ %cnt.promoted8892, %insertionSort.exit ] %arrayidx29 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv108 %9 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %9, %.lcssa br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body27 %10 = sext i32 %9 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %cnt.promoted8895 = phi i32 [ %cnt.promoted889697, %for.body.preheader.i ], [ %cnt.promoted8893, %while.end.i ] %cnt.promoted91 = phi i32 [ %cnt.promoted889697, %for.body.preheader.i ], [ %cnt.promoted89, %while.end.i ] %indvars.iv.i = phi i64 [ %10, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %12 = trunc i64 %indvars.iv.i to i32 %13 = sub i32 %12, %9 %idxprom2.i132 = zext i32 %13 to i64 %arrayidx3.i133 = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i132 %14 = load i32, ptr %arrayidx3.i133, align 4, !tbaa !5 %cmp4.i134 = icmp sgt i32 %14, %11 br i1 %cmp4.i134, label %while.body.i, label %while.end.i land.rhs.i: ; preds = %while.body.i %idxprom2.i = zext i32 %j.0.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %15 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %15, %11 br i1 %cmp4.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !15 while.body.i: ; preds = %land.rhs.preheader.i, %land.rhs.i %16 = phi i32 [ %15, %land.rhs.i ], [ %14, %land.rhs.preheader.i ] %i.0.pn33.i137 = phi i32 [ %j.034.i136, %land.rhs.i ], [ %12, %land.rhs.preheader.i ] %j.034.i136 = phi i32 [ %j.0.i, %land.rhs.i ], [ %13, %land.rhs.preheader.i ] %cnt.promoted90135 = phi i32 [ %inc.i, %land.rhs.i ], [ %cnt.promoted91, %land.rhs.preheader.i ] %idxprom7.i = sext i32 %i.0.pn33.i137 to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %16, ptr %arrayidx8.i, align 4, !tbaa !5 %inc.i = add nsw i32 %cnt.promoted90135, 1 %j.0.i = sub nsw i32 %j.034.i136, %9 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i.loopexit, !llvm.loop !15 while.end.i.loopexit: ; preds = %while.body.i, %land.rhs.i store i32 %inc.i, ptr @cnt, align 4, !tbaa !5 br label %while.end.i while.end.i: ; preds = %while.end.i.loopexit, %land.rhs.preheader.i %cnt.promoted8893 = phi i32 [ %cnt.promoted8895, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %cnt.promoted89 = phi i32 [ %cnt.promoted91, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %i.0.pn.lcssa.ph.i = phi i32 [ %12, %land.rhs.preheader.i ], [ %j.034.i136, %while.end.i.loopexit ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %11, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !16 insertionSort.exit: ; preds = %while.end.i, %for.body27 %cnt.promoted8892 = phi i32 [ %cnt.promoted889697, %for.body27 ], [ %cnt.promoted8893, %while.end.i ] %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %exitcond111.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count br i1 %exitcond111.not, label %if.end39.peel, label %for.body27, !llvm.loop !17 if.end39.peel: ; preds = %insertionSort.exit %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa127) %wide.trip.count115 = zext i32 %m.0.lcssa127 to i64 %17 = load i32, ptr %G, align 16, !tbaa !5 %call42.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17) %exitcond116.peel.not = icmp eq i32 %m.0.lcssa127, 1 br i1 %exitcond116.peel.not, label %for.end45, label %if.end39 if.end39: ; preds = %if.end39.peel, %if.end39 %indvars.iv112 = phi i64 [ %indvars.iv.next113, %if.end39 ], [ 1, %if.end39.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx41 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv112 %18 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18) %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115 br i1 %exitcond116.not, label %for.end45, label %if.end39, !llvm.loop !18 for.end45: ; preds = %if.end39, %if.end39.peel %19 = load i32, ptr @cnt, align 4, !tbaa !5 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %19) %20 = load i32, ptr %n, align 4, !tbaa !5 %cmp48100 = icmp sgt i32 %20, 0 br i1 %cmp48100, label %for.body49, label %for.end55 for.body49: ; preds = %for.end45, %for.body49 %indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.body49 ], [ 0, %for.end45 ] %arrayidx51 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv118 %21 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %21) %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp48 = icmp slt i64 %indvars.iv.next119, %23 br i1 %cmp48, label %for.body49, label %for.end55, !llvm.loop !20 for.end55: ; preds = %for.body49, %for.end45 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %G) #5 call void @llvm.lifetime.end.p0(i64 4000000, 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 norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #3 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @cnt, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !15 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !16 for.end: ; preds = %while.end, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !19} !19 = !{!"llvm.loop.peeled.count", i32 1} !20 = distinct !{!20, !10}
#include<stdio.h> #include<string.h> #include<stdlib.h> #define O 0 #define I 1 #define T 3 int c=0; void insertSort(int *,int,int); int main(){ int i,j,n,m=O,G[20]; int *A; scanf("%d",&n); A = malloc(n*sizeof(int)); for(i=O;i<n;i++){ scanf("%d",&A[i]); } G[O]=O; while(I){ if(n<T*G[m]+I){ break; } G[m+I]=T*G[m]+I; m++; } for(i=m;i>O;i--){ insertSort(A,n,G[i]); } printf("%d\n",m); for(i=m;i>=I;i--){ printf("%d ",G[i]); } printf("\n"); printf("%d\n",c); for(i=O;i<n;i++){ printf("%d\n",A[i]); } return O; } void insertSort(int *A,int n,int g){ int i,j,key; for(i=g;i<n;i++){ j=i; key=A[i]; while(O<=j-g){ if(A[j-g]<=key){ break; } A[j]=A[j-g]; j-=g; c++; } A[j]=key; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119437/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119437/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %G = alloca [20 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %G) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp68 = icmp sgt i32 %0, 0 br i1 %cmp68, label %for.body, label %for.end25.thread for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body store i32 0, ptr %G, align 16, !tbaa !5 %cmp8.not71 = icmp sgt i32 %1, 0 br i1 %cmp8.not71, label %if.end, label %for.end25.thread for.cond18.preheader: ; preds = %if.end %3 = trunc i64 %indvars.iv.next95 to i32 %cmp1985 = icmp sgt i32 %3, 0 br i1 %cmp1985, label %for.body21.lr.ph, label %for.end25.thread for.body21.lr.ph: ; preds = %for.cond18.preheader %c.promoted = load i32, ptr @c, align 4, !tbaa !5 %wide.trip.count.i = sext i32 %1 to i64 %4 = and i64 %indvars.iv.next95, 4294967295 br label %for.body21 if.end: ; preds = %for.end, %if.end %indvars.iv94 = phi i64 [ %indvars.iv.next95, %if.end ], [ 0, %for.end ] %mul773 = phi i32 [ %mul7, %if.end ], [ 0, %for.end ] %add = add nsw i32 %mul773, 1 %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %arrayidx16 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv.next95 store i32 %add, ptr %arrayidx16, align 4, !tbaa !5 %mul7 = mul nsw i32 %add, 3 %cmp8.not = icmp sgt i32 %1, %mul7 br i1 %cmp8.not, label %if.end, label %for.cond18.preheader for.body21: ; preds = %for.body21.lr.ph, %insertSort.exit %indvars.iv97 = phi i64 [ %4, %for.body21.lr.ph ], [ %indvars.iv.next98, %insertSort.exit ] %c.promoted768486 = phi i32 [ %c.promoted, %for.body21.lr.ph ], [ %c.promoted7680, %insertSort.exit ] %arrayidx23 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv97 %5 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp37.i = icmp slt i32 %5, %1 br i1 %cmp37.i, label %for.body.preheader.i, label %insertSort.exit for.body.preheader.i: ; preds = %for.body21 %6 = sext i32 %5 to i64 br label %while.body.preheader.i while.body.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %c.promoted7683 = phi i32 [ %c.promoted768486, %for.body.preheader.i ], [ %c.promoted7681, %while.end.i ] %c.promoted79 = phi i32 [ %c.promoted768486, %for.body.preheader.i ], [ %c.promoted77, %while.end.i ] %indvars.iv.i = phi i64 [ %6, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i %7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %8 = trunc i64 %indvars.iv.i to i32 %9 = sub i32 %8, %5 %idxprom3.i117 = zext i32 %9 to i64 %arrayidx4.i118 = getelementptr inbounds i32, ptr %call1, i64 %idxprom3.i117 %10 = load i32, ptr %arrayidx4.i118, align 4, !tbaa !5 %cmp5.not.i119 = icmp sgt i32 %10, %7 br i1 %cmp5.not.i119, label %if.end.i, label %while.end.i while.body.i: ; preds = %if.end.i %idxprom3.i = zext i32 %sub.i to i64 %arrayidx4.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom3.i %11 = load i32, ptr %arrayidx4.i, align 4, !tbaa !5 %cmp5.not.i = icmp sgt i32 %11, %7 br i1 %cmp5.not.i, label %if.end.i, label %while.end.i.loopexit, !llvm.loop !11 if.end.i: ; preds = %while.body.preheader.i, %while.body.i %12 = phi i32 [ %11, %while.body.i ], [ %10, %while.body.preheader.i ] %j.034.i122 = phi i32 [ %sub35.i121, %while.body.i ], [ %8, %while.body.preheader.i ] %sub35.i121 = phi i32 [ %sub.i, %while.body.i ], [ %9, %while.body.preheader.i ] %c.promoted78120 = phi i32 [ %inc.i, %while.body.i ], [ %c.promoted79, %while.body.preheader.i ] %idxprom9.i = sext i32 %j.034.i122 to i64 %arrayidx10.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom9.i store i32 %12, ptr %arrayidx10.i, align 4, !tbaa !5 %inc.i = add nsw i32 %c.promoted78120, 1 %sub.i = sub nsw i32 %sub35.i121, %5 %cmp1.i = icmp sgt i32 %sub.i, -1 br i1 %cmp1.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !11 while.end.i.loopexit: ; preds = %if.end.i, %while.body.i store i32 %inc.i, ptr @c, align 4, !tbaa !5 br label %while.end.i while.end.i: ; preds = %while.end.i.loopexit, %while.body.preheader.i %c.promoted7681 = phi i32 [ %c.promoted7683, %while.body.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %c.promoted77 = phi i32 [ %c.promoted79, %while.body.preheader.i ], [ %inc.i, %while.end.i.loopexit ] %j.0.lcssa.ph.i = phi i32 [ %8, %while.body.preheader.i ], [ %sub35.i121, %while.end.i.loopexit ] %idxprom12.i = sext i32 %j.0.lcssa.ph.i to i64 %arrayidx13.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom12.i store i32 %7, ptr %arrayidx13.i, align 4, !tbaa !5 %indvars.iv.next.i = add 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 %insertSort.exit, label %while.body.preheader.i, !llvm.loop !12 insertSort.exit: ; preds = %while.end.i, %for.body21 %c.promoted7680 = phi i32 [ %c.promoted768486, %for.body21 ], [ %c.promoted7681, %while.end.i ] %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1 %cmp19 = icmp sgt i64 %indvars.iv97, 1 br i1 %cmp19, label %for.body21, label %for.end25, !llvm.loop !13 for.end25.thread: ; preds = %entry, %for.cond18.preheader, %for.end %m.0.lcssa112.ph = phi i32 [ %3, %for.cond18.preheader ], [ 0, %for.end ], [ 0, %entry ] %call26116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa112.ph) br label %for.end36 for.end25: ; preds = %insertSort.exit %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) br i1 %cmp1985, label %for.body30.preheader, label %for.end36 for.body30.preheader: ; preds = %for.end25 %13 = and i64 %indvars.iv.next95, 4294967295 br label %for.body30 for.body30: ; preds = %for.body30.preheader, %for.body30 %indvars.iv100 = phi i64 [ %13, %for.body30.preheader ], [ %indvars.iv.next101, %for.body30 ] %arrayidx32 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv100 %14 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %indvars.iv.next101 = add nsw i64 %indvars.iv100, -1 %cmp28 = icmp ugt i64 %indvars.iv100, 1 br i1 %cmp28, label %for.body30, label %for.end36, !llvm.loop !14 for.end36: ; preds = %for.body30, %for.end25.thread, %for.end25 %putchar = call i32 @putchar(i32 10) %15 = load i32, ptr @c, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15) %16 = load i32, ptr %n, align 4, !tbaa !5 %cmp4090 = icmp sgt i32 %16, 0 br i1 %cmp4090, label %for.body42, label %for.end48 for.body42: ; preds = %for.end36, %for.body42 %indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.body42 ], [ 0, %for.end36 ] %arrayidx44 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv103 %17 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17) %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp40 = icmp slt i64 %indvars.iv.next104, %19 br i1 %cmp40, label %for.body42, label %for.end48, !llvm.loop !15 for.end48: ; preds = %for.body42, %for.end36 call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %G) #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insertSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #4 { entry: %cmp37 = icmp slt i32 %g, %n br i1 %cmp37, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %while.body.preheader while.body.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %while.body while.body: ; preds = %while.body.preheader, %if.end %sub35 = phi i32 [ %sub, %if.end ], [ %4, %while.body.preheader ] %j.034 = phi i32 [ %sub35, %if.end ], [ %2, %while.body.preheader ] %idxprom3 = zext i32 %sub35 to i64 %arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %idxprom3 %5 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5.not = icmp sgt i32 %5, %1 br i1 %cmp5.not, label %if.end, label %while.end if.end: ; preds = %while.body %idxprom9 = sext i32 %j.034 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %A, i64 %idxprom9 store i32 %5, ptr %arrayidx10, align 4, !tbaa !5 %6 = load i32, ptr @c, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @c, align 4, !tbaa !5 %sub = sub nsw i32 %sub35, %g %cmp1 = icmp sgt i32 %sub, -1 br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %if.end, %while.body %j.0.lcssa.ph = phi i32 [ %sub35, %if.end ], [ %j.034, %while.body ] %idxprom12 = sext i32 %j.0.lcssa.ph to i64 %arrayidx13 = getelementptr inbounds i32, ptr %A, i64 %idxprom12 store i32 %1, ptr %arrayidx13, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %while.body.preheader, !llvm.loop !12 for.end: ; preds = %while.end, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = 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}
//a.c A-AtCoder Crackers #include<stdio.h> int main(void){ int n,k; scanf("%d %d",&n,&k); if(n%k==0){ printf("0\n"); }else{ printf("1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119480/source.c" target datalayout = "e-m:e-p270: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"1\00", align 1 @str.3 = 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: %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 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main () { int n, k; scanf("%d %d", &n, &k); if(n % k) puts("1"); else puts("0"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119523/source.c" target datalayout = "e-m:e-p270: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 [2 x i8] c"1\00", align 1 @.str.2 = 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: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %tobool.not = icmp eq i32 %rem, 0 %.str.2..str.1 = select i1 %tobool.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int n,k; scanf("%d %d",&n,&k); if(n%k==0){ printf("0\n"); } else{ printf("1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119567/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119567/source.c" target datalayout = "e-m:e-p270: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"1\00", align 1 @str.3 = 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: %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 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <math.h> int a[1000]; int status[11000]; int sum[11000]; int main() { int i,j,n,m,s,t,max,k; while(scanf("%d",&n)!=EOF) { memset(sum,0,sizeof(sum)); for(i=0;i<=n-1;i++) { scanf("%d",&a[i]); sum[a[i]]+=1; } if(n==1) { printf("YES\n"); continue; }else if(n==2) { if(a[0]!=a[1]) { printf("YES\n"); }else { printf("NO\n"); } continue; } for(i=0;i<=n-1;i++) { if(i==0) { k=a[i]; }else if(k!=a[i]) { break; } } if(i==n) { printf("NO\n"); continue; } for(i=1;i<=1000;i++) { if(i==1) { max=sum[i]; }else if(max<sum[i]) { max=sum[i]; } } if(n-max>=max-1) { printf("YES\n"); }else { printf("NO\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11961/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11961/source.c" target datalayout = "e-m:e-p270: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 @sum = dso_local local_unnamed_addr global [11000 x i32] zeroinitializer, align 16 @a = dso_local global [1000 x i32] zeroinitializer, align 16 @status = dso_local local_unnamed_addr global [11000 x i32] zeroinitializer, align 16 @str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.7 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call94103108 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not95104109 = icmp eq i32 %call94103108, -1 br i1 %cmp.not95104109, label %while.end, label %while.body while.body: ; preds = %entry, %while.body.backedge call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44000) @sum, i8 0, i64 44000, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1.not.not92 = icmp sgt i32 %0, 0 br i1 %cmp1.not.not92, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom5 = sext i32 %1 to i64 %arrayidx6 = getelementptr inbounds [11000 x i32], ptr @sum, i64 0, i64 %idxprom5 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %2, 1 store i32 %add, ptr %arrayidx6, align 4, !tbaa !5 %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 %cmp1.not.not = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp1.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %.lcssa = phi i32 [ %0, %while.body ], [ %3, %for.body ] switch i32 %.lcssa, label %for.cond18.preheader [ i32 1, label %while.cond.backedge i32 2, label %if.then10 ] for.cond18.preheader: ; preds = %for.end %cmp20.not.not96 = icmp sgt i32 %.lcssa, 0 br i1 %cmp20.not.not96, label %for.body21.peel.next, label %for.end35 for.body21.peel.next: ; preds = %for.cond18.preheader %5 = load i32, ptr @a, align 16 %wide.trip.count = zext i32 %.lcssa to i64 br label %if.else26 while.cond.backedge: ; preds = %for.end, %if.then10 %str.6.sink = phi ptr [ %str.5.str.6, %if.then10 ], [ @str.7, %for.end ] %puts88 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body.backedge while.body.backedge: ; preds = %while.cond.backedge, %for.inc56, %if.then37 br label %while.body, !llvm.loop !11 if.then10: ; preds = %for.end %6 = load i32, ptr @a, align 16, !tbaa !5 %7 = load i32, ptr getelementptr inbounds ([1000 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5 %cmp11.not = icmp eq i32 %6, %7 %str.5.str.6 = select i1 %cmp11.not, ptr @str.5, ptr @str.7 br label %while.cond.backedge if.else26: ; preds = %for.inc33, %for.body21.peel.next %indvars.iv119 = phi i64 [ 1, %for.body21.peel.next ], [ %indvars.iv.next120, %for.inc33 ] %arrayidx28 = getelementptr inbounds [1000 x i32], ptr @a, i64 0, i64 %indvars.iv119 %8 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.not = icmp eq i32 %5, %8 br i1 %cmp29.not, label %for.inc33, label %for.end35.loopexit for.inc33: ; preds = %if.else26 %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1 %exitcond.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count br i1 %exitcond.not, label %if.then37, label %if.else26, !llvm.loop !12 for.end35.loopexit: ; preds = %if.else26 %9 = trunc i64 %indvars.iv119 to i32 br label %for.end35 for.end35: ; preds = %for.end35.loopexit, %for.cond18.preheader %i.1.lcssa = phi i32 [ 0, %for.cond18.preheader ], [ %9, %for.end35.loopexit ] %cmp36 = icmp eq i32 %i.1.lcssa, %.lcssa br i1 %cmp36, label %if.then37, label %vector.ph vector.ph: ; preds = %for.end35 %10 = load <4 x i32>, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 1), align 4 %minmax.ident.splat = shufflevector <4 x i32> %10, <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> [ %minmax.ident.splat, %vector.ph ], [ %13, %vector.body ] %vec.phi143 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %14, %vector.body ] %offset.idx = or i64 %index, 2 %11 = getelementptr inbounds [11000 x i32], ptr @sum, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %11, align 8, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load144 = load <4 x i32>, ptr %12, align 8, !tbaa !5 %13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %14 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi143, <4 x i32> %wide.load144) %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, 992 br i1 %15, label %for.inc56, label %vector.body, !llvm.loop !14 if.then37: ; preds = %for.inc33, %for.end35 %puts86 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %call94 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not95 = icmp eq i32 %call94, -1 br i1 %cmp.not95, label %while.end, label %while.body.backedge for.inc56: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %13, <4 x i32> %14) %16 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %17 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 994), align 8, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %16, i32 %17) %18 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 995), align 4, !tbaa !5 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %18) %19 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 996), align 16, !tbaa !5 %spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %19) %20 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 997), align 4, !tbaa !5 %spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %20) %21 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 998), align 8, !tbaa !5 %spec.select.4 = call i32 @llvm.smax.i32(i32 %spec.select.3, i32 %21) %22 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 999), align 4, !tbaa !5 %spec.select.5 = call i32 @llvm.smax.i32(i32 %spec.select.4, i32 %22) %23 = load i32, ptr getelementptr inbounds ([11000 x i32], ptr @sum, i64 0, i64 1000), align 16, !tbaa !5 %spec.select.6 = call i32 @llvm.smax.i32(i32 %spec.select.5, i32 %23) %sub59 = sub nsw i32 %.lcssa, %spec.select.6 %sub60 = add nsw i32 %spec.select.6, -1 %cmp61.not = icmp slt i32 %sub59, %sub60 %str.str.3 = select i1 %cmp61.not, ptr @str.5, ptr @str.7 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) %call94103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not95104 = icmp eq i32 %call94103, -1 br i1 %cmp.not95104, label %while.end, label %while.body.backedge while.end: ; preds = %for.inc56, %if.then37, %while.cond.backedge, %entry 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!"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, !13, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"}
#include<stdio.h> int main() { int N, K; scanf("%d %d", &N, &K); if(N%K == 0){ printf("0"); }else{ printf("1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119653/source.c" target datalayout = "e-m:e-p270: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: %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 = load i32, ptr %K, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %. = select i1 %cmp, i32 48, i32 49 %putchar = call i32 @putchar(i32 %.) 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 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"}
#include<stdio.h> int main() { int n,k; while(scanf("%d%d",&n,&k)!=EOF) { if(n%k==0)printf("0\n"); else printf("1\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119697/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119697/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.3 = 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: %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 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %cmp.not6 = icmp eq i32 %call5, -1 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp1 = icmp eq i32 %rem, 0 %str.3.str = select i1 %cmp1, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry 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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int a,b; int c=0; scanf("%d%d", &a, &b); while(a<=b){ a*=3; b*=2; ++c; } printf("%d\n", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11974/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11974/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp.not6 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %c.09 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %mul48 = phi i32 [ %mul, %while.body ], [ %a.promoted, %entry ] %mul157 = phi i32 [ %mul1, %while.body ], [ %b.promoted, %entry ] %mul = mul nsw i32 %mul48, 3 %mul1 = shl nsw i32 %mul157, 1 %inc = add nuw nsw i32 %c.09, 1 %cmp.not = icmp sgt i32 %mul, %mul1 br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %mul, ptr %a, align 4, !tbaa !5 store i32 %mul1, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %c.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int n, *fw[26]; char *s; inline int lsb(int x) { return x & -x; } int fwSum(int ix, int x) { int r = 0; while(x) { r += fw[ix][x]; x -= lsb(x); } return r; } void fwChange(int ix, int iy, int x) { int dx = x - (fwSum(ix, iy) - fwSum(ix, iy - 1)); if(!dx) return; while(iy <= n) { fw[ix][iy] += dx; iy += lsb(iy); } } int main() { int q, i; scanf("%d", &n); s = malloc((n + 1)*sizeof(char)); for(i = 0; i < 26; i++) fw[i] = calloc(n + 1, sizeof(int)); scanf(" %s %d", s, &q); for(i = 0; i < n; i++) fwChange(s[i] - 'a', i + 1, 1); while(q--) { int f, a1; scanf("%d %d", &f, &a1); a1--; if(f == 1) { char a2; scanf(" %c", &a2); if(s[a1] == a2) continue; fwChange(s[a1] - 'a', a1 + 1, 0); fwChange((s[a1] = a2) - 'a', a1 + 1, 1); } else { int a2, r = 0; scanf("%d", &a2); for(i = 0; i < 26; i++) r += !!(fwSum(i, a2) - fwSum(i, a1)); printf("%d\n", r); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119790/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119790/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @fw = dso_local local_unnamed_addr global [26 x ptr] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @s = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [7 x i8] c" %s %d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c" %c\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @fwSum(i32 noundef %ix, i32 noundef %x) local_unnamed_addr #0 { entry: %tobool.not7 = icmp eq i32 %x, 0 br i1 %tobool.not7, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %idxprom = sext i32 %ix to i64 %arrayidx = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %r.09 = phi i32 [ 0, %while.body.lr.ph ], [ %add, %while.body ] %x.addr.08 = phi i32 [ %x, %while.body.lr.ph ], [ %sub, %while.body ] %idxprom1 = sext i32 %x.addr.08 to i64 %arrayidx2 = getelementptr inbounds i32, ptr %0, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !9 %add = add nsw i32 %1, %r.09 %sub.i.not = add i32 %x.addr.08, -1 %sub = and i32 %sub.i.not, %x.addr.08 %tobool.not = icmp eq i32 %sub, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @fwChange(i32 noundef %ix, i32 noundef %iy, i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not7.i = icmp eq i32 %iy, 0 %idxprom.i18.phi.trans.insert = sext i32 %ix to i64 %arrayidx.i19.phi.trans.insert = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %idxprom.i18.phi.trans.insert %.pre = load ptr, ptr %arrayidx.i19.phi.trans.insert, align 8, !tbaa !5 br i1 %tobool.not7.i, label %while.body.lr.ph.i17, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %r.09.i = phi i32 [ %add.i, %while.body.i ], [ 0, %entry ] %x.addr.08.i = phi i32 [ %sub.i, %while.body.i ], [ %iy, %entry ] %idxprom1.i = sext i32 %x.addr.08.i to i64 %arrayidx2.i = getelementptr inbounds i32, ptr %.pre, i64 %idxprom1.i %0 = load i32, ptr %arrayidx2.i, align 4, !tbaa !9 %add.i = add nsw i32 %0, %r.09.i %sub.i.not.i = add i32 %x.addr.08.i, -1 %sub.i = and i32 %sub.i.not.i, %x.addr.08.i %tobool.not.i = icmp eq i32 %sub.i, 0 br i1 %tobool.not.i, label %fwSum.exit, label %while.body.i, !llvm.loop !11 fwSum.exit: ; preds = %while.body.i %sub = add nsw i32 %iy, -1 %tobool.not7.i16 = icmp eq i32 %sub, 0 br i1 %tobool.not7.i16, label %fwSum.exit30, label %while.body.lr.ph.i17 while.body.lr.ph.i17: ; preds = %entry, %fwSum.exit %sub37 = phi i32 [ %sub, %fwSum.exit ], [ -1, %entry ] %r.0.lcssa.i35 = phi i32 [ %add.i, %fwSum.exit ], [ 0, %entry ] br label %while.body.i20 while.body.i20: ; preds = %while.body.i20, %while.body.lr.ph.i17 %r.09.i21 = phi i32 [ 0, %while.body.lr.ph.i17 ], [ %add.i25, %while.body.i20 ] %x.addr.08.i22 = phi i32 [ %sub37, %while.body.lr.ph.i17 ], [ %sub.i27, %while.body.i20 ] %idxprom1.i23 = sext i32 %x.addr.08.i22 to i64 %arrayidx2.i24 = getelementptr inbounds i32, ptr %.pre, i64 %idxprom1.i23 %1 = load i32, ptr %arrayidx2.i24, align 4, !tbaa !9 %add.i25 = add nsw i32 %1, %r.09.i21 %sub.i.not.i26 = add i32 %x.addr.08.i22, -1 %sub.i27 = and i32 %sub.i.not.i26, %x.addr.08.i22 %tobool.not.i28 = icmp eq i32 %sub.i27, 0 br i1 %tobool.not.i28, label %fwSum.exit30, label %while.body.i20, !llvm.loop !11 fwSum.exit30: ; preds = %while.body.i20, %fwSum.exit %r.0.lcssa.i36 = phi i32 [ %add.i, %fwSum.exit ], [ %r.0.lcssa.i35, %while.body.i20 ] %r.0.lcssa.i29 = phi i32 [ 0, %fwSum.exit ], [ %add.i25, %while.body.i20 ] %sub2.neg = sub i32 %r.0.lcssa.i29, %r.0.lcssa.i36 %sub3 = add i32 %sub2.neg, %x %tobool.not = icmp eq i32 %sub3, 0 %2 = load i32, ptr @n, align 4 %cmp.not38 = icmp slt i32 %2, %iy %or.cond = select i1 %tobool.not, i1 true, i1 %cmp.not38 br i1 %or.cond, label %cleanup, label %while.body while.body: ; preds = %fwSum.exit30, %while.body %iy.addr.039 = phi i32 [ %add7, %while.body ], [ %iy, %fwSum.exit30 ] %idxprom4 = sext i32 %iy.addr.039 to i64 %arrayidx5 = getelementptr inbounds i32, ptr %.pre, i64 %idxprom4 %3 = load i32, ptr %arrayidx5, align 4, !tbaa !9 %add = add nsw i32 %3, %sub3 store i32 %add, ptr %arrayidx5, align 4, !tbaa !9 %sub.i31 = sub nsw i32 0, %iy.addr.039 %and.i = and i32 %iy.addr.039, %sub.i31 %add7 = add nsw i32 %and.i, %iy.addr.039 %4 = load i32, ptr @n, align 4, !tbaa !9 %cmp.not = icmp sgt i32 %add7, %4 br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !13 cleanup: ; preds = %while.body, %fwSum.exit30 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %f = alloca i32, align 4 %a1 = alloca i32, align 4 %a2 = alloca i8, align 1 %a240 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !9 %add = add nsw i32 %0, 1 %conv = sext i32 %add to i64 %call1 = tail call noalias ptr @malloc(i64 noundef %conv) #8 store ptr %call1, ptr @s, align 8, !tbaa !5 %call5 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5, ptr @fw, align 16, !tbaa !5 %call5.1 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.1, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 1), align 8, !tbaa !5 %call5.2 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.2, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 2), align 16, !tbaa !5 %call5.3 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.3, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 3), align 8, !tbaa !5 %call5.4 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.4, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 4), align 16, !tbaa !5 %call5.5 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.5, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 5), align 8, !tbaa !5 %call5.6 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.6, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 6), align 16, !tbaa !5 %call5.7 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.7, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 7), align 8, !tbaa !5 %call5.8 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.8, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 8), align 16, !tbaa !5 %call5.9 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.9, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 9), align 8, !tbaa !5 %call5.10 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.10, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 10), align 16, !tbaa !5 %call5.11 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.11, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 11), align 8, !tbaa !5 %call5.12 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.12, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 12), align 16, !tbaa !5 %call5.13 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.13, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 13), align 8, !tbaa !5 %call5.14 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.14, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 14), align 16, !tbaa !5 %call5.15 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.15, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 15), align 8, !tbaa !5 %call5.16 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.16, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 16), align 16, !tbaa !5 %call5.17 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.17, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 17), align 8, !tbaa !5 %call5.18 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.18, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 18), align 16, !tbaa !5 %call5.19 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.19, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 19), align 8, !tbaa !5 %call5.20 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.20, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 20), align 16, !tbaa !5 %call5.21 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.21, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 21), align 8, !tbaa !5 %call5.22 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.22, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 22), align 16, !tbaa !5 %call5.23 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.23, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 23), align 8, !tbaa !5 %call5.24 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.24, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 24), align 16, !tbaa !5 %call5.25 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9 store ptr %call5.25, ptr getelementptr inbounds ([26 x ptr], ptr @fw, i64 0, i64 25), align 8, !tbaa !5 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call1, ptr noundef nonnull %q) %1 = load i32, ptr @n, align 4 %cmp8178 = icmp sgt i32 %1, 0 br i1 %cmp8178, label %for.body10.lr.ph, label %while.cond.preheader for.body10.lr.ph: ; preds = %entry %2 = load ptr, ptr @s, align 8, !tbaa !5 br label %for.body10 while.cond.preheader: ; preds = %fwChange.exit, %entry %3 = load i32, ptr %q, align 4, !tbaa !9 %dec182 = add nsw i32 %3, -1 store i32 %dec182, ptr %q, align 4, !tbaa !9 %tobool.not183 = icmp eq i32 %3, 0 br i1 %tobool.not183, label %while.end, label %while.body for.body10: ; preds = %for.body10.lr.ph, %fwChange.exit %4 = phi i32 [ %1, %for.body10.lr.ph ], [ %12, %fwChange.exit ] %indvars.iv = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next, %fwChange.exit ] %arrayidx12 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv %5 = load i8, ptr %arrayidx12, align 1, !tbaa !14 %conv13 = sext i8 %5 to i64 %sub = add nsw i64 %conv13, -97 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.i19.phi.trans.insert.i = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %sub %.pre.i = load ptr, ptr %arrayidx.i19.phi.trans.insert.i, align 8, !tbaa !5 %6 = trunc i64 %indvars.iv.next to i32 br label %while.body.i.i while.body.i.i: ; preds = %while.body.i.i, %for.body10 %r.09.i.i = phi i32 [ %add.i.i, %while.body.i.i ], [ 0, %for.body10 ] %x.addr.08.i.i = phi i32 [ %sub.i.i, %while.body.i.i ], [ %6, %for.body10 ] %idxprom1.i.i = sext i32 %x.addr.08.i.i to i64 %arrayidx2.i.i = getelementptr inbounds i32, ptr %.pre.i, i64 %idxprom1.i.i %7 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !9 %add.i.i = add nsw i32 %7, %r.09.i.i %sub.i.not.i.i = add i32 %x.addr.08.i.i, -1 %sub.i.i = and i32 %sub.i.not.i.i, %x.addr.08.i.i %tobool.not.i.i = icmp eq i32 %sub.i.i, 0 br i1 %tobool.not.i.i, label %fwSum.exit.i, label %while.body.i.i, !llvm.loop !11 fwSum.exit.i: ; preds = %while.body.i.i %tobool.not7.i16.i = icmp eq i64 %indvars.iv, 0 br i1 %tobool.not7.i16.i, label %fwSum.exit30.i, label %while.body.i20.i.preheader while.body.i20.i.preheader: ; preds = %fwSum.exit.i %8 = trunc i64 %indvars.iv to i32 br label %while.body.i20.i while.body.i20.i: ; preds = %while.body.i20.i.preheader, %while.body.i20.i %r.09.i21.i = phi i32 [ %add.i25.i, %while.body.i20.i ], [ 0, %while.body.i20.i.preheader ] %x.addr.08.i22.i = phi i32 [ %sub.i27.i, %while.body.i20.i ], [ %8, %while.body.i20.i.preheader ] %idxprom1.i23.i = sext i32 %x.addr.08.i22.i to i64 %arrayidx2.i24.i = getelementptr inbounds i32, ptr %.pre.i, i64 %idxprom1.i23.i %9 = load i32, ptr %arrayidx2.i24.i, align 4, !tbaa !9 %add.i25.i = add nsw i32 %9, %r.09.i21.i %sub.i.not.i26.i = add i32 %x.addr.08.i22.i, -1 %sub.i27.i = and i32 %sub.i.not.i26.i, %x.addr.08.i22.i %tobool.not.i28.i = icmp eq i32 %sub.i27.i, 0 br i1 %tobool.not.i28.i, label %fwSum.exit30.i, label %while.body.i20.i, !llvm.loop !11 fwSum.exit30.i: ; preds = %while.body.i20.i, %fwSum.exit.i %r.0.lcssa.i29.i = phi i32 [ 0, %fwSum.exit.i ], [ %add.i25.i, %while.body.i20.i ] %sub2.neg.i = sub i32 %r.0.lcssa.i29.i, %add.i.i %sub3.i = add i32 %sub2.neg.i, 1 %tobool.not.i = icmp eq i32 %sub3.i, 0 br i1 %tobool.not.i, label %fwChange.exit, label %while.body.i while.body.i: ; preds = %fwSum.exit30.i, %while.body.i %iy.addr.039.i = phi i32 [ %add7.i, %while.body.i ], [ %6, %fwSum.exit30.i ] %idxprom4.i = sext i32 %iy.addr.039.i to i64 %arrayidx5.i = getelementptr inbounds i32, ptr %.pre.i, i64 %idxprom4.i %10 = load i32, ptr %arrayidx5.i, align 4, !tbaa !9 %add.i = add nsw i32 %10, %sub3.i store i32 %add.i, ptr %arrayidx5.i, align 4, !tbaa !9 %sub.i31.i = sub nsw i32 0, %iy.addr.039.i %and.i.i = and i32 %iy.addr.039.i, %sub.i31.i %add7.i = add nsw i32 %and.i.i, %iy.addr.039.i %11 = load i32, ptr @n, align 4 %cmp.not.i = icmp sgt i32 %add7.i, %11 br i1 %cmp.not.i, label %fwChange.exit, label %while.body.i, !llvm.loop !13 fwChange.exit: ; preds = %while.body.i, %fwSum.exit30.i %12 = phi i32 [ %4, %fwSum.exit30.i ], [ %11, %while.body.i ] %13 = sext i32 %12 to i64 %cmp8 = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp8, label %for.body10, label %while.cond.preheader, !llvm.loop !15 while.body: ; preds = %while.cond.preheader, %cleanup57 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #7 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %f, ptr noundef nonnull %a1) %14 = load i32, ptr %a1, align 4, !tbaa !9 %dec19 = add nsw i32 %14, -1 store i32 %dec19, ptr %a1, align 4, !tbaa !9 %15 = load i32, ptr %f, align 4, !tbaa !9 %cmp20 = icmp eq i32 %15, 1 br i1 %cmp20, label %if.then, label %if.else if.then: ; preds = %while.body call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a2) #7 %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a2) %16 = load ptr, ptr @s, align 8, !tbaa !5 %17 = load i32, ptr %a1, align 4, !tbaa !9 %idxprom23 = sext i32 %17 to i64 %arrayidx24 = getelementptr inbounds i8, ptr %16, i64 %idxprom23 %18 = load i8, ptr %arrayidx24, align 1, !tbaa !14 %19 = load i8, ptr %a2, align 1, !tbaa !14 %cmp27.not = icmp eq i8 %18, %19 br i1 %cmp27.not, label %cleanup57.critedge, label %if.end, !llvm.loop !16 if.end: ; preds = %if.then %conv25 = sext i8 %18 to i64 %sub33 = add nsw i64 %conv25, -97 %add34 = add nsw i32 %17, 1 %tobool.not7.i.i = icmp eq i32 %add34, 0 %arrayidx.i19.phi.trans.insert.i75 = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %sub33 %.pre.i76 = load ptr, ptr %arrayidx.i19.phi.trans.insert.i75, align 8, !tbaa !5 br i1 %tobool.not7.i.i, label %while.body.lr.ph.i17.i88, label %while.body.i.i77 while.body.i.i77: ; preds = %if.end, %while.body.i.i77 %r.09.i.i78 = phi i32 [ %add.i.i82, %while.body.i.i77 ], [ 0, %if.end ] %x.addr.08.i.i79 = phi i32 [ %sub.i.i84, %while.body.i.i77 ], [ %add34, %if.end ] %idxprom1.i.i80 = sext i32 %x.addr.08.i.i79 to i64 %arrayidx2.i.i81 = getelementptr inbounds i32, ptr %.pre.i76, i64 %idxprom1.i.i80 %20 = load i32, ptr %arrayidx2.i.i81, align 4, !tbaa !9 %add.i.i82 = add nsw i32 %20, %r.09.i.i78 %sub.i.not.i.i83 = add i32 %x.addr.08.i.i79, -1 %sub.i.i84 = and i32 %sub.i.not.i.i83, %x.addr.08.i.i79 %tobool.not.i.i85 = icmp eq i32 %sub.i.i84, 0 br i1 %tobool.not.i.i85, label %fwSum.exit.i86, label %while.body.i.i77, !llvm.loop !11 fwSum.exit.i86: ; preds = %while.body.i.i77 %tobool.not7.i16.i87 = icmp eq i32 %17, 0 br i1 %tobool.not7.i16.i87, label %fwSum.exit30.i98, label %while.body.lr.ph.i17.i88 while.body.lr.ph.i17.i88: ; preds = %fwSum.exit.i86, %if.end %r.0.lcssa.i35.i = phi i32 [ %add.i.i82, %fwSum.exit.i86 ], [ 0, %if.end ] br label %while.body.i20.i89 while.body.i20.i89: ; preds = %while.body.i20.i89, %while.body.lr.ph.i17.i88 %r.09.i21.i90 = phi i32 [ 0, %while.body.lr.ph.i17.i88 ], [ %add.i25.i94, %while.body.i20.i89 ] %x.addr.08.i22.i91 = phi i32 [ %17, %while.body.lr.ph.i17.i88 ], [ %sub.i27.i96, %while.body.i20.i89 ] %idxprom1.i23.i92 = sext i32 %x.addr.08.i22.i91 to i64 %arrayidx2.i24.i93 = getelementptr inbounds i32, ptr %.pre.i76, i64 %idxprom1.i23.i92 %21 = load i32, ptr %arrayidx2.i24.i93, align 4, !tbaa !9 %add.i25.i94 = add nsw i32 %21, %r.09.i21.i90 %sub.i.not.i26.i95 = add i32 %x.addr.08.i22.i91, -1 %sub.i27.i96 = and i32 %sub.i.not.i26.i95, %x.addr.08.i22.i91 %tobool.not.i28.i97 = icmp eq i32 %sub.i27.i96, 0 br i1 %tobool.not.i28.i97, label %fwSum.exit30.i98, label %while.body.i20.i89, !llvm.loop !11 fwSum.exit30.i98: ; preds = %while.body.i20.i89, %fwSum.exit.i86 %r.0.lcssa.i36.i = phi i32 [ %add.i.i82, %fwSum.exit.i86 ], [ %r.0.lcssa.i35.i, %while.body.i20.i89 ] %r.0.lcssa.i29.i99 = phi i32 [ 0, %fwSum.exit.i86 ], [ %add.i25.i94, %while.body.i20.i89 ] %sub2.neg.i100 = sub i32 %r.0.lcssa.i29.i99, %r.0.lcssa.i36.i %tobool.not.i101 = icmp eq i32 %r.0.lcssa.i29.i99, %r.0.lcssa.i36.i %22 = load i32, ptr @n, align 4 %cmp.not38.i102 = icmp sle i32 %22, %17 %or.cond.i103 = select i1 %tobool.not.i101, i1 true, i1 %cmp.not38.i102 br i1 %or.cond.i103, label %fwChange.exit113, label %while.body.i104 while.body.i104: ; preds = %fwSum.exit30.i98, %while.body.i104 %iy.addr.039.i105 = phi i32 [ %add7.i111, %while.body.i104 ], [ %add34, %fwSum.exit30.i98 ] %idxprom4.i106 = sext i32 %iy.addr.039.i105 to i64 %arrayidx5.i107 = getelementptr inbounds i32, ptr %.pre.i76, i64 %idxprom4.i106 %23 = load i32, ptr %arrayidx5.i107, align 4, !tbaa !9 %add.i108 = add nsw i32 %sub2.neg.i100, %23 store i32 %add.i108, ptr %arrayidx5.i107, align 4, !tbaa !9 %sub.i31.i109 = sub nsw i32 0, %iy.addr.039.i105 %and.i.i110 = and i32 %iy.addr.039.i105, %sub.i31.i109 %add7.i111 = add nsw i32 %and.i.i110, %iy.addr.039.i105 %24 = load i32, ptr @n, align 4, !tbaa !9 %cmp.not.i112 = icmp sgt i32 %add7.i111, %24 br i1 %cmp.not.i112, label %fwChange.exit113.loopexit, label %while.body.i104, !llvm.loop !13 fwChange.exit113.loopexit: ; preds = %while.body.i104 %.pre = load i32, ptr %a1, align 4, !tbaa !9 %.pre189 = sext i32 %.pre to i64 br label %fwChange.exit113 fwChange.exit113: ; preds = %fwChange.exit113.loopexit, %fwSum.exit30.i98 %idxprom35.pre-phi = phi i64 [ %.pre189, %fwChange.exit113.loopexit ], [ %idxprom23, %fwSum.exit30.i98 ] %arrayidx36 = getelementptr inbounds i8, ptr %16, i64 %idxprom35.pre-phi store i8 %19, ptr %arrayidx36, align 1, !tbaa !14 %conv37 = sext i8 %19 to i64 %sub38 = add nsw i64 %conv37, -97 %25 = load i32, ptr %a1, align 4, !tbaa !9 %add39 = add nsw i32 %25, 1 %tobool.not7.i.i114 = icmp eq i32 %add39, 0 %arrayidx.i19.phi.trans.insert.i116 = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %sub38 %.pre.i117 = load ptr, ptr %arrayidx.i19.phi.trans.insert.i116, align 8, !tbaa !5 br i1 %tobool.not7.i.i114, label %while.body.lr.ph.i17.i129, label %while.body.i.i118 while.body.i.i118: ; preds = %fwChange.exit113, %while.body.i.i118 %r.09.i.i119 = phi i32 [ %add.i.i123, %while.body.i.i118 ], [ 0, %fwChange.exit113 ] %x.addr.08.i.i120 = phi i32 [ %sub.i.i125, %while.body.i.i118 ], [ %add39, %fwChange.exit113 ] %idxprom1.i.i121 = sext i32 %x.addr.08.i.i120 to i64 %arrayidx2.i.i122 = getelementptr inbounds i32, ptr %.pre.i117, i64 %idxprom1.i.i121 %26 = load i32, ptr %arrayidx2.i.i122, align 4, !tbaa !9 %add.i.i123 = add nsw i32 %26, %r.09.i.i119 %sub.i.not.i.i124 = add i32 %x.addr.08.i.i120, -1 %sub.i.i125 = and i32 %sub.i.not.i.i124, %x.addr.08.i.i120 %tobool.not.i.i126 = icmp eq i32 %sub.i.i125, 0 br i1 %tobool.not.i.i126, label %fwSum.exit.i127, label %while.body.i.i118, !llvm.loop !11 fwSum.exit.i127: ; preds = %while.body.i.i118 %tobool.not7.i16.i128 = icmp eq i32 %25, 0 br i1 %tobool.not7.i16.i128, label %fwSum.exit30.i141, label %while.body.lr.ph.i17.i129 while.body.lr.ph.i17.i129: ; preds = %fwSum.exit.i127, %fwChange.exit113 %r.0.lcssa.i35.i131 = phi i32 [ %add.i.i123, %fwSum.exit.i127 ], [ 0, %fwChange.exit113 ] br label %while.body.i20.i132 while.body.i20.i132: ; preds = %while.body.i20.i132, %while.body.lr.ph.i17.i129 %r.09.i21.i133 = phi i32 [ 0, %while.body.lr.ph.i17.i129 ], [ %add.i25.i137, %while.body.i20.i132 ] %x.addr.08.i22.i134 = phi i32 [ %25, %while.body.lr.ph.i17.i129 ], [ %sub.i27.i139, %while.body.i20.i132 ] %idxprom1.i23.i135 = sext i32 %x.addr.08.i22.i134 to i64 %arrayidx2.i24.i136 = getelementptr inbounds i32, ptr %.pre.i117, i64 %idxprom1.i23.i135 %27 = load i32, ptr %arrayidx2.i24.i136, align 4, !tbaa !9 %add.i25.i137 = add nsw i32 %27, %r.09.i21.i133 %sub.i.not.i26.i138 = add i32 %x.addr.08.i22.i134, -1 %sub.i27.i139 = and i32 %sub.i.not.i26.i138, %x.addr.08.i22.i134 %tobool.not.i28.i140 = icmp eq i32 %sub.i27.i139, 0 br i1 %tobool.not.i28.i140, label %fwSum.exit30.i141, label %while.body.i20.i132, !llvm.loop !11 fwSum.exit30.i141: ; preds = %while.body.i20.i132, %fwSum.exit.i127 %r.0.lcssa.i36.i142 = phi i32 [ %add.i.i123, %fwSum.exit.i127 ], [ %r.0.lcssa.i35.i131, %while.body.i20.i132 ] %r.0.lcssa.i29.i143 = phi i32 [ 0, %fwSum.exit.i127 ], [ %add.i25.i137, %while.body.i20.i132 ] %sub2.neg.i144 = sub i32 %r.0.lcssa.i29.i143, %r.0.lcssa.i36.i142 %sub3.i145 = add i32 %sub2.neg.i144, 1 %tobool.not.i146 = icmp eq i32 %sub3.i145, 0 %28 = load i32, ptr @n, align 4 %cmp.not38.i147 = icmp sle i32 %28, %25 %or.cond.i148 = select i1 %tobool.not.i146, i1 true, i1 %cmp.not38.i147 br i1 %or.cond.i148, label %fwChange.exit158, label %while.body.i149 while.body.i149: ; preds = %fwSum.exit30.i141, %while.body.i149 %iy.addr.039.i150 = phi i32 [ %add7.i156, %while.body.i149 ], [ %add39, %fwSum.exit30.i141 ] %idxprom4.i151 = sext i32 %iy.addr.039.i150 to i64 %arrayidx5.i152 = getelementptr inbounds i32, ptr %.pre.i117, i64 %idxprom4.i151 %29 = load i32, ptr %arrayidx5.i152, align 4, !tbaa !9 %add.i153 = add nsw i32 %29, %sub3.i145 store i32 %add.i153, ptr %arrayidx5.i152, align 4, !tbaa !9 %sub.i31.i154 = sub nsw i32 0, %iy.addr.039.i150 %and.i.i155 = and i32 %iy.addr.039.i150, %sub.i31.i154 %add7.i156 = add nsw i32 %and.i.i155, %iy.addr.039.i150 %30 = load i32, ptr @n, align 4, !tbaa !9 %cmp.not.i157 = icmp sgt i32 %add7.i156, %30 br i1 %cmp.not.i157, label %fwChange.exit158, label %while.body.i149, !llvm.loop !13 fwChange.exit158: ; preds = %while.body.i149, %fwSum.exit30.i141 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a2) #7 br label %cleanup57 if.else: ; preds = %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a240) #7 %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a240) %31 = load i32, ptr %a240, align 4, !tbaa !9 %tobool.not7.i = icmp eq i32 %31, 0 %32 = load i32, ptr %a1, align 4, !tbaa !9 %tobool.not7.i162 = icmp eq i32 %32, 0 br label %for.body45 for.body45: ; preds = %if.else, %fwSum.exit176 %indvars.iv186 = phi i64 [ 0, %if.else ], [ %indvars.iv.next187, %fwSum.exit176 ] %r.0181 = phi i32 [ 0, %if.else ], [ %add51, %fwSum.exit176 ] br i1 %tobool.not7.i, label %fwSum.exit, label %while.body.lr.ph.i while.body.lr.ph.i: ; preds = %for.body45 %arrayidx.i = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %indvars.iv186 %33 = load ptr, ptr %arrayidx.i, align 8, !tbaa !5 br label %while.body.i159 while.body.i159: ; preds = %while.body.i159, %while.body.lr.ph.i %r.09.i = phi i32 [ 0, %while.body.lr.ph.i ], [ %add.i160, %while.body.i159 ] %x.addr.08.i = phi i32 [ %31, %while.body.lr.ph.i ], [ %sub.i, %while.body.i159 ] %idxprom1.i = sext i32 %x.addr.08.i to i64 %arrayidx2.i = getelementptr inbounds i32, ptr %33, i64 %idxprom1.i %34 = load i32, ptr %arrayidx2.i, align 4, !tbaa !9 %add.i160 = add nsw i32 %34, %r.09.i %sub.i.not.i = add i32 %x.addr.08.i, -1 %sub.i = and i32 %sub.i.not.i, %x.addr.08.i %tobool.not.i161 = icmp eq i32 %sub.i, 0 br i1 %tobool.not.i161, label %fwSum.exit, label %while.body.i159, !llvm.loop !11 fwSum.exit: ; preds = %while.body.i159, %for.body45 %r.0.lcssa.i = phi i32 [ 0, %for.body45 ], [ %add.i160, %while.body.i159 ] br i1 %tobool.not7.i162, label %fwSum.exit176, label %while.body.lr.ph.i163 while.body.lr.ph.i163: ; preds = %fwSum.exit %arrayidx.i165 = getelementptr inbounds [26 x ptr], ptr @fw, i64 0, i64 %indvars.iv186 %35 = load ptr, ptr %arrayidx.i165, align 8, !tbaa !5 br label %while.body.i166 while.body.i166: ; preds = %while.body.i166, %while.body.lr.ph.i163 %r.09.i167 = phi i32 [ 0, %while.body.lr.ph.i163 ], [ %add.i171, %while.body.i166 ] %x.addr.08.i168 = phi i32 [ %32, %while.body.lr.ph.i163 ], [ %sub.i173, %while.body.i166 ] %idxprom1.i169 = sext i32 %x.addr.08.i168 to i64 %arrayidx2.i170 = getelementptr inbounds i32, ptr %35, i64 %idxprom1.i169 %36 = load i32, ptr %arrayidx2.i170, align 4, !tbaa !9 %add.i171 = add nsw i32 %36, %r.09.i167 %sub.i.not.i172 = add i32 %x.addr.08.i168, -1 %sub.i173 = and i32 %sub.i.not.i172, %x.addr.08.i168 %tobool.not.i174 = icmp eq i32 %sub.i173, 0 br i1 %tobool.not.i174, label %fwSum.exit176, label %while.body.i166, !llvm.loop !11 fwSum.exit176: ; preds = %while.body.i166, %fwSum.exit %r.0.lcssa.i175 = phi i32 [ 0, %fwSum.exit ], [ %add.i171, %while.body.i166 ] %tobool49 = icmp ne i32 %r.0.lcssa.i, %r.0.lcssa.i175 %lnot.ext = zext i1 %tobool49 to i32 %add51 = add nuw nsw i32 %r.0181, %lnot.ext %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1 %exitcond.not = icmp eq i64 %indvars.iv.next187, 26 br i1 %exitcond.not, label %for.end54, label %for.body45, !llvm.loop !17 for.end54: ; preds = %fwSum.exit176 %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %add51) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a240) #7 br label %cleanup57 cleanup57.critedge: ; preds = %if.then call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a2) #7 br label %cleanup57 cleanup57: ; preds = %fwChange.exit158, %for.end54, %cleanup57.critedge call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #7 %37 = load i32, ptr %q, align 4, !tbaa !9 %dec = add nsw i32 %37, -1 store i32 %dec, ptr %q, align 4, !tbaa !9 %tobool.not = icmp eq i32 %37, 0 br i1 %tobool.not, label %while.end, label %while.body while.end: ; preds = %cleanup57, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nounwind } attributes #8 = { nounwind allocsize(0) } attributes #9 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12}
#include<stdio.h> int main(){ int n,m,i,a,b; scanf("%d%d",&n,&m); char s[5]={}; while(m--){ scanf("%d%d",&a,&b); if(a==1&&b==0&&n-1) goto END; if(s[a-1]&&s[a-1]-b-'0') goto END; s[a-1]=b+'0'; } if(s[0]==0) s[0]=n-1?'1':'0'; for(i=0;i<n;i++) if(!s[i]) s[i]='0'; printf("%s\n",s); return 0; END: ; printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119877/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119877/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\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 %a = alloca i32, align 4 %b = alloca i32, align 4 %s = alloca [5 x i8], align 1 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 %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %s, i8 0, i64 5, i1 false) %0 = load i32, ptr %m, align 4, !tbaa !5 %dec54 = add nsw i32 %0, -1 store i32 %dec54, ptr %m, align 4, !tbaa !5 %tobool.not55 = icmp eq i32 %0, 0 br i1 %tobool.not55, label %while.end.thread, label %while.body while.end.thread: ; preds = %entry %.pre59.pre = load i32, ptr %n, align 4, !tbaa !5 br label %if.then25 while.body: ; preds = %entry, %if.end16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp ne i32 %1, 1 %2 = load i32, ptr %b, align 4 %cmp2 = icmp ne i32 %2, 0 %or.cond.not53 = select i1 %cmp, i1 true, i1 %cmp2 %3 = load i32, ptr %n, align 4 %tobool4.not = icmp eq i32 %3, 1 %or.cond51 = select i1 %or.cond.not53, i1 true, i1 %tobool4.not br i1 %or.cond51, label %if.end, label %cleanup if.end: ; preds = %while.body %sub5 = add nsw i32 %1, -1 %idxprom = sext i32 %sub5 to i64 %arrayidx = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 %idxprom %4 = load i8, ptr %arrayidx, align 1, !tbaa !9 %tobool6.not = icmp eq i8 %4, 0 %conv = sext i8 %4 to i32 %sub12 = sub nsw i32 %conv, %2 %tobool14.not = icmp eq i32 %sub12, 48 %or.cond52 = select i1 %tobool6.not, i1 true, i1 %tobool14.not br i1 %or.cond52, label %if.end16, label %cleanup if.end16: ; preds = %if.end %5 = trunc i32 %2 to i8 %conv17 = add i8 %5, 48 store i8 %conv17, ptr %arrayidx, align 1, !tbaa !9 %6 = load i32, ptr %m, align 4, !tbaa !5 %dec = add nsw i32 %6, -1 store i32 %dec, ptr %m, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %if.end16 %.pre = load i8, ptr %s, align 1, !tbaa !9 %7 = icmp eq i8 %.pre, 0 br i1 %7, label %if.then25, label %if.end30 if.then25: ; preds = %while.end.thread, %while.end %.pre5964 = phi i32 [ %.pre59.pre, %while.end.thread ], [ %3, %while.end ] %tobool27.not = icmp eq i32 %.pre5964, 1 %conv28 = select i1 %tobool27.not, i8 48, i8 49 store i8 %conv28, ptr %s, align 1, !tbaa !9 br label %if.end30 if.end30: ; preds = %if.then25, %while.end %.pre5963 = phi i32 [ %.pre5964, %if.then25 ], [ %3, %while.end ] %cmp3156 = icmp sgt i32 %.pre5963, 0 br i1 %cmp3156, label %iter.check, label %cleanup iter.check: ; preds = %if.end30 %wide.trip.count = zext i32 %.pre5963 to i64 %min.iters.check = icmp ult i32 %.pre5963, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check68 = icmp ult i32 %.pre5963, 32 br i1 %min.iters.check68, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %8 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %8, align 1, !tbaa !9 %9 = getelementptr inbounds i8, ptr %8, i64 16 %wide.load69 = load <16 x i8>, ptr %9, align 1, !tbaa !9 %10 = icmp eq <16 x i8> %wide.load, zeroinitializer %11 = icmp eq <16 x i8> %wide.load69, zeroinitializer %12 = select <16 x i1> %10, <16 x i8> <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>, <16 x i8> %wide.load %13 = select <16 x i1> %11, <16 x i8> <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>, <16 x i8> %wide.load69 store <16 x i8> %12, ptr %8, align 1 store <16 x i8> %13, ptr %9, align 1 %index.next = add nuw i64 %index, 32 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 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.vec71 = and i64 %wide.trip.count, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index73 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next75, %vec.epilog.vector.body ] %15 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 %index73 %wide.load74 = load <8 x i8>, ptr %15, align 1, !tbaa !9 %16 = icmp eq <8 x i8> %wide.load74, zeroinitializer %17 = select <8 x i1> %16, <8 x i8> <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>, <8 x i8> %wide.load74 store <8 x i8> %17, ptr %15, align 1 %index.next75 = add nuw i64 %index73, 8 %18 = icmp eq i64 %index.next75, %n.vec71 br i1 %18, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n72 = icmp eq i64 %n.vec71, %wide.trip.count br i1 %cmp.n72, label %cleanup, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec71, %vec.epilog.middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx34 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 %indvars.iv %19 = load i8, ptr %arrayidx34, align 1, !tbaa !9 %tobool35.not = icmp eq i8 %19, 0 %spec.store.select = select i1 %tobool35.not, i8 48, i8 %19 store i8 %spec.store.select, ptr %arrayidx34, align 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !16 cleanup: ; preds = %while.body, %if.end, %for.body, %middle.block, %vec.epilog.middle.block, %if.end30 %str.sink = phi ptr [ %s, %if.end30 ], [ %s, %vec.epilog.middle.block ], [ %s, %middle.block ], [ %s, %for.body ], [ @str, %if.end ], [ @str, %while.body ] %puts50 = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !13, !14} !16 = distinct !{!16, !11, !14, !13}
#include <stdio.h> int main(void) { int N, M, i, j,keta_tmp; int s[10],c[10]; int suuzi[3] = {-1,-1,-1}; scanf("%d %d",&N,&M); for(i=0; i<M; i++){ scanf("%d %d",&s[i],&c[i]); } for(i=0; i<M; i++){//左からs[i]桁目がc[i]である keta_tmp = s[i]-1; if((keta_tmp == 0) && (c[i] == 0)){//一番上の桁が0の場合は存在しないので-1 if(N != 1){ printf("-1\n"); return 0; } } if((suuzi[keta_tmp] == -1)||(suuzi[keta_tmp] == c[i])){//未入力か一緒の場合 suuzi[keta_tmp] = c[i]; } else {//一つの桁に違う数字を指定された場合 printf("-1\n"); return 0; } } if(N == 1){ if(suuzi[0] == -1){ printf("0"); } else { printf("%d",suuzi[0]); } } else { for(i=0; i<N; i++){ if(suuzi[i] == -1){ if(i==0){ printf("1"); } else { printf("0"); } } else { printf("%d",suuzi[i]); } //-1の時は0を代入するっていうのを後で書く //一番上の桁が指定されてない時は1 } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119927/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119927/source.c" target datalayout = "e-m:e-p270: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.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str.6 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %s = alloca [10 x i32], align 16 %c = alloca [10 x i32], align 16 %suuzi = 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 4, ptr nonnull %M) #5 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %suuzi) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %suuzi, i8 -1, i64 12, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %M, align 4, !tbaa !5 %cmp99 = icmp sgt i32 %0, 0 br i1 %cmp99, label %for.body, label %for.cond4.preheader.thread for.cond4.preheader.thread: ; preds = %entry %.pre122125 = load i32, ptr %N, align 4 %.fr126 = freeze i32 %.pre122125 br label %for.end34 for.cond4.preheader: ; preds = %for.body %cmp5101 = icmp sgt i32 %4, 0 %.pre122 = load i32, ptr %N, align 4 %.fr = freeze i32 %.pre122 br i1 %cmp5101, label %for.body6.lr.ph, label %for.end34 for.body6.lr.ph: ; preds = %for.cond4.preheader %cmp13.not = icmp eq i32 %.fr, 1 %wide.trip.count115 = zext i32 %4 to i64 br i1 %cmp13.not, label %for.body6.us, label %for.body6 for.body6.us: ; preds = %for.body6.lr.ph, %if.then25.us %indvars.iv112 = phi i64 [ %indvars.iv.next113, %if.then25.us ], [ 0, %for.body6.lr.ph ] %arrayidx8.us = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 %indvars.iv112 %1 = load i32, ptr %arrayidx8.us, align 4, !tbaa !5 %sub.us = add nsw i32 %1, -1 %idxprom17.us = sext i32 %sub.us to i64 %arrayidx18.us = getelementptr inbounds [3 x i32], ptr %suuzi, i64 0, i64 %idxprom17.us %2 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %cmp19.us = icmp eq i32 %2, -1 %arrayidx27.us.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %indvars.iv112 %.pre121 = load i32, ptr %arrayidx27.us.phi.trans.insert, align 4, !tbaa !5 br i1 %cmp19.us, label %if.then25.us, label %lor.lhs.false.us lor.lhs.false.us: ; preds = %for.body6.us %cmp24.us = icmp eq i32 %2, %.pre121 br i1 %cmp24.us, label %if.then25.us, label %if.else if.then25.us: ; preds = %for.body6.us, %lor.lhs.false.us %3 = phi i32 [ %2, %lor.lhs.false.us ], [ %.pre121, %for.body6.us ] store i32 %3, ptr %arrayidx18.us, align 4, !tbaa !5 %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115 br i1 %exitcond116.not, label %for.end34, label %for.body6.us, !llvm.loop !9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %M, 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.cond4.preheader, !llvm.loop !11 for.body6: ; preds = %for.body6.lr.ph, %if.then25 %indvars.iv109 = phi i64 [ %indvars.iv.next110, %if.then25 ], [ 0, %for.body6.lr.ph ] %arrayidx8 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 %indvars.iv109 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp9 = icmp eq i32 %sub, 0 br i1 %cmp9, label %land.lhs.true, label %if.end16 land.lhs.true: ; preds = %for.body6 %arrayidx11 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %indvars.iv109 %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp eq i32 %7, 0 br i1 %cmp12, label %if.then14, label %if.end16 if.then14: ; preds = %land.lhs.true %puts98 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %cleanup if.end16: ; preds = %land.lhs.true, %for.body6 %idxprom17 = sext i32 %sub to i64 %arrayidx18 = getelementptr inbounds [3 x i32], ptr %suuzi, i64 0, i64 %idxprom17 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %8, -1 %arrayidx27.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %indvars.iv109 %.pre = load i32, ptr %arrayidx27.phi.trans.insert, align 4, !tbaa !5 br i1 %cmp19, label %if.then25, label %lor.lhs.false lor.lhs.false: ; preds = %if.end16 %cmp24 = icmp eq i32 %8, %.pre br i1 %cmp24, label %if.then25, label %if.else if.then25: ; preds = %if.end16, %lor.lhs.false %9 = phi i32 [ %8, %lor.lhs.false ], [ %.pre, %if.end16 ] store i32 %9, ptr %arrayidx18, align 4, !tbaa !5 %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count115 br i1 %exitcond.not, label %for.end34, label %for.body6, !llvm.loop !9 if.else: ; preds = %lor.lhs.false, %lor.lhs.false.us %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %cleanup for.end34: ; preds = %if.then25, %if.then25.us, %for.cond4.preheader.thread, %for.cond4.preheader %.fr127 = phi i32 [ %.fr126, %for.cond4.preheader.thread ], [ %.fr, %for.cond4.preheader ], [ %.fr, %if.then25.us ], [ %.fr, %if.then25 ] %cmp35 = icmp eq i32 %.fr127, 1 br i1 %cmp35, label %if.then36, label %for.cond46.preheader for.cond46.preheader: ; preds = %for.end34 %cmp47103 = icmp sgt i32 %.fr127, 0 br i1 %cmp47103, label %for.body48.preheader, label %if.end67 for.body48.preheader: ; preds = %for.cond46.preheader %10 = load i32, ptr %suuzi, align 4, !tbaa !5 %cmp51.peel = icmp eq i32 %10, -1 br i1 %cmp51.peel, label %if.then54.peel, label %if.else59.peel if.else59.peel: ; preds = %for.body48.preheader %call62.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %10) br label %for.inc64.peel if.then54.peel: ; preds = %for.body48.preheader %putchar95.peel = call i32 @putchar(i32 49) br label %for.inc64.peel for.inc64.peel: ; preds = %if.then54.peel, %if.else59.peel %11 = load i32, ptr %N, align 4, !tbaa !5 %cmp47.peel = icmp sgt i32 %11, 1 br i1 %cmp47.peel, label %for.body48, label %if.end67 if.then36: ; preds = %for.end34 %12 = load i32, ptr %suuzi, align 4, !tbaa !5 %cmp38 = icmp eq i32 %12, -1 br i1 %cmp38, label %if.then39, label %if.else41 if.then39: ; preds = %if.then36 %putchar96 = call i32 @putchar(i32 48) br label %if.end67 if.else41: ; preds = %if.then36 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12) br label %if.end67 for.body48: ; preds = %for.inc64.peel, %for.inc64 %indvars.iv117 = phi i64 [ %indvars.iv.next118, %for.inc64 ], [ 1, %for.inc64.peel ] %arrayidx50 = getelementptr inbounds [3 x i32], ptr %suuzi, i64 0, i64 %indvars.iv117 %13 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %cmp51 = icmp eq i32 %13, -1 br i1 %cmp51, label %if.else56, label %if.else59 if.else56: ; preds = %for.body48 %putchar = call i32 @putchar(i32 48) br label %for.inc64 if.else59: ; preds = %for.body48 %call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13) br label %for.inc64 for.inc64: ; preds = %if.else59, %if.else56 %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %14 = load i32, ptr %N, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp47 = icmp slt i64 %indvars.iv.next118, %15 br i1 %cmp47, label %for.body48, label %if.end67, !llvm.loop !12 if.end67: ; preds = %for.inc64, %for.inc64.peel, %for.cond46.preheader, %if.then39, %if.else41 %putchar97 = call i32 @putchar(i32 10) br label %cleanup cleanup: ; preds = %if.end67, %if.else, %if.then14 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %suuzi) #5 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 40, 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) #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: 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, !13} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <math.h> #include <limits.h> #define Max(a, b) ((a) > (b) ? (a) : (b)) #define Min(a, b) ((a) > (b) ? (b) : (a)) #define abs(x) ((x) > 0 ? (x) : -(x)) #define MOD (ll)1000000007 //10^9 + 7 #define endl printf("\n") typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, n, m) for (int i = (n), i < (m); i++) int main(int argc, char *argv[]) { int n; ll a[100010]; scanf("%d", &n); ll b = 0, sign = -1; for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); sign *= -1; b += sign * a[i]; } for (int i = 0; i < n; i++) { printf("%lld ", b); b = (ll)2 * a[i] - b; } endl; return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119978/source.c" target datalayout = "e-m:e-p270: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"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld \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 %a = alloca [100010 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 800080, 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 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %for.cond.cleanup8 for.cond6.preheader: ; preds = %for.body %1 = icmp sgt i32 %3, 0 br i1 %1, label %for.body9, label %for.cond.cleanup8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sign.029 = phi i64 [ %sign.0.neg28, %for.body ], [ -1, %entry ] %sign.0.neg28 = phi i64 [ %sign.029, %for.body ], [ 1, %entry ] %b.027 = phi i64 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100010 x i64], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %2 = load i64, ptr %arrayidx, align 8, !tbaa !9 %mul4 = mul nsw i64 %2, %sign.0.neg28 %add = add nsw i64 %mul4, %b.027 %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.cond6.preheader, !llvm.loop !11 for.cond.cleanup8: ; preds = %for.body9, %entry, %for.cond6.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body9: ; preds = %for.cond6.preheader, %for.body9 %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.body9 ], [ 0, %for.cond6.preheader ] %b.132 = phi i64 [ %sub, %for.body9 ], [ %add, %for.cond6.preheader ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %b.132) %arrayidx12 = getelementptr inbounds [100010 x i64], ptr %a, i64 0, i64 %indvars.iv35 %5 = load i64, ptr %arrayidx12, align 8, !tbaa !9 %mul13 = shl nsw i64 %5, 1 %sub = sub nsw i64 %mul13, %b.132 %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp7 = icmp slt i64 %indvars.iv.next36, %7 br i1 %cmp7, label %for.body9, label %for.cond.cleanup8, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress 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 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> long long min(long long a,long long b){ if(a < b){ return a; } return b; } int main(void){ int N; scanf("%d\n", &N); long long A[N]; long long sum = 0; for (int i = 0; i < N; i++) { scanf("%lld", &A[i]); sum += A[i]; } long long even = 0; for (int i = 2; i < N; i++) { if(i%2 == 0) even += A[i]; } long long ans[N]; ans[1] = sum-2*even; for (int i = 1; i < N; i++) { ans[i+1] = A[i]*2-ans[i]; } ans[0] = A[N-1]*2-ans[N-1]; for (int i = 0; i < N; i++) { printf("%lld", ans[i]); if(i != N-1) printf(" "); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120019/source.c" target datalayout = "e-m:e-p270: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 [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 %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp76 = icmp sgt i32 %3, 0 br i1 %cmp76, label %for.body, label %for.cond5.preheader.for.cond.cleanup7_crit_edge for.cond5.preheader: ; preds = %for.body %cmp680 = icmp sgt i32 %9, 2 br i1 %cmp680, label %for.body8.preheader, label %for.cond5.preheader.for.cond.cleanup7_crit_edge for.cond5.preheader.for.cond.cleanup7_crit_edge: ; preds = %entry, %for.cond5.preheader %4 = phi i32 [ %9, %for.cond5.preheader ], [ %3, %entry ] %sum.0.lcssa106 = phi i64 [ %add, %for.cond5.preheader ], [ 0, %entry ] %.pre101 = zext i32 %4 to i64 br label %for.cond.cleanup7 for.body8.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %9 to i64 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %9, 3 br i1 %5, label %for.cond.cleanup7.loopexit.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %6 = and i64 %wide.trip.count, 4294967294 %7 = add nsw i64 %6, -4 br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.077 = phi i64 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %8 = load i64, ptr %arrayidx, align 8, !tbaa !9 %add = add nsw i64 %8, %sum.077 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %N, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !11 for.cond.cleanup7.loopexit.unr-lcssa: ; preds = %for.body8, %for.body8.preheader %even.1.lcssa.ph = phi i64 [ undef, %for.body8.preheader ], [ %add12, %for.body8 ] %indvars.iv90.unr = phi i64 [ 2, %for.body8.preheader ], [ %indvars.iv.next91.1, %for.body8 ] %even.081.unr = phi i64 [ 0, %for.body8.preheader ], [ %add12, %for.body8 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup7.loopexit, label %for.body8.epil for.body8.epil: ; preds = %for.cond.cleanup7.loopexit.unr-lcssa %rem102.epil = and i64 %indvars.iv90.unr, 1 %cmp9.epil = icmp eq i64 %rem102.epil, 0 br i1 %cmp9.epil, label %if.then.epil, label %for.cond.cleanup7.loopexit if.then.epil: ; preds = %for.body8.epil %arrayidx11.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv90.unr %11 = load i64, ptr %arrayidx11.epil, align 8, !tbaa !9 %add12.epil = add nsw i64 %11, %even.081.unr br label %for.cond.cleanup7.loopexit for.cond.cleanup7.loopexit: ; preds = %for.body8.epil, %if.then.epil, %for.cond.cleanup7.loopexit.unr-lcssa %even.1.lcssa = phi i64 [ %even.1.lcssa.ph, %for.cond.cleanup7.loopexit.unr-lcssa ], [ %add12.epil, %if.then.epil ], [ %even.081.unr, %for.body8.epil ] %12 = shl nsw i64 %even.1.lcssa, 1 br label %for.cond.cleanup7 for.cond.cleanup7: ; preds = %for.cond5.preheader.for.cond.cleanup7_crit_edge, %for.cond.cleanup7.loopexit %13 = phi i32 [ %4, %for.cond5.preheader.for.cond.cleanup7_crit_edge ], [ %9, %for.cond.cleanup7.loopexit ] %sum.0.lcssa105 = phi i64 [ %sum.0.lcssa106, %for.cond5.preheader.for.cond.cleanup7_crit_edge ], [ %add, %for.cond.cleanup7.loopexit ] %.pre-phi = phi i64 [ %.pre101, %for.cond5.preheader.for.cond.cleanup7_crit_edge ], [ %wide.trip.count, %for.cond.cleanup7.loopexit ] %even.0.lcssa = phi i64 [ 0, %for.cond5.preheader.for.cond.cleanup7_crit_edge ], [ %12, %for.cond.cleanup7.loopexit ] %vla16 = alloca i64, i64 %.pre-phi, align 16 %sub = sub nsw i64 %sum.0.lcssa105, %even.0.lcssa %arrayidx17 = getelementptr inbounds i64, ptr %vla16, i64 1 store i64 %sub, ptr %arrayidx17, align 8, !tbaa !9 %cmp2084 = icmp sgt i32 %13, 1 br i1 %cmp2084, label %for.body22.preheader, label %for.cond.cleanup21 for.body22.preheader: ; preds = %for.cond.cleanup7 %14 = add nsw i64 %.pre-phi, -1 %15 = add nsw i64 %.pre-phi, -2 %xtraiter108 = and i64 %14, 3 %16 = icmp ult i64 %15, 3 br i1 %16, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter110 = and i64 %14, -4 br label %for.body22 for.body8: ; preds = %for.body8, %for.body8.preheader.new %indvars.iv90 = phi i64 [ 2, %for.body8.preheader.new ], [ %indvars.iv.next91.1, %for.body8 ] %even.081 = phi i64 [ 0, %for.body8.preheader.new ], [ %add12, %for.body8 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ] %arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv90 %17 = load i64, ptr %arrayidx11, align 16, !tbaa !9 %add12 = add nsw i64 %17, %even.081 %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter, %7 br i1 %niter.ncmp.1, label %for.cond.cleanup7.loopexit.unr-lcssa, label %for.body8, !llvm.loop !13 for.cond.cleanup21.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %.unr = phi i64 [ %sub, %for.body22.preheader ], [ %sub28.3, %for.body22 ] %indvars.iv93.unr = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next94.3, %for.body22 ] %lcmp.mod109.not = icmp eq i64 %xtraiter108, 0 br i1 %lcmp.mod109.not, label %for.cond.cleanup21, label %for.body22.epil for.body22.epil: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil %18 = phi i64 [ %sub28.epil, %for.body22.epil ], [ %.unr, %for.cond.cleanup21.loopexit.unr-lcssa ] %indvars.iv93.epil = phi i64 [ %indvars.iv.next94.epil, %for.body22.epil ], [ %indvars.iv93.unr, %for.cond.cleanup21.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond.cleanup21.loopexit.unr-lcssa ] %arrayidx24.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv93.epil %19 = load i64, ptr %arrayidx24.epil, align 8, !tbaa !9 %mul25.epil = shl nsw i64 %19, 1 %sub28.epil = sub nsw i64 %mul25.epil, %18 %indvars.iv.next94.epil = add nuw nsw i64 %indvars.iv93.epil, 1 %arrayidx31.epil = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv.next94.epil store i64 %sub28.epil, ptr %arrayidx31.epil, align 8, !tbaa !9 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter108 br i1 %epil.iter.cmp.not, label %for.cond.cleanup21, label %for.body22.epil, !llvm.loop !14 for.cond.cleanup21: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil, %for.cond.cleanup7 %sub35 = add nsw i32 %13, -1 %idxprom36 = sext i32 %sub35 to i64 %arrayidx37 = getelementptr inbounds i64, ptr %vla, i64 %idxprom36 %20 = load i64, ptr %arrayidx37, align 8, !tbaa !9 %mul38 = shl nsw i64 %20, 1 %arrayidx41 = getelementptr inbounds i64, ptr %vla16, i64 %idxprom36 %21 = load i64, ptr %arrayidx41, align 8, !tbaa !9 %sub42 = sub nsw i64 %mul38, %21 store i64 %sub42, ptr %vla16, align 16, !tbaa !9 %cmp4686 = icmp sgt i32 %13, 0 br i1 %cmp4686, label %for.body48, label %for.cond.cleanup47 for.body22: ; preds = %for.body22, %for.body22.preheader.new %22 = phi i64 [ %sub, %for.body22.preheader.new ], [ %sub28.3, %for.body22 ] %indvars.iv93 = phi i64 [ 1, %for.body22.preheader.new ], [ %indvars.iv.next94.3, %for.body22 ] %niter111 = phi i64 [ 0, %for.body22.preheader.new ], [ %niter111.next.3, %for.body22 ] %arrayidx24 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv93 %23 = load i64, ptr %arrayidx24, align 8, !tbaa !9 %mul25 = shl nsw i64 %23, 1 %sub28 = sub nsw i64 %mul25, %22 %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %arrayidx31 = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv.next94 store i64 %sub28, ptr %arrayidx31, align 8, !tbaa !9 %arrayidx24.1 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next94 %24 = load i64, ptr %arrayidx24.1, align 8, !tbaa !9 %mul25.1 = shl nsw i64 %24, 1 %sub28.1 = sub nsw i64 %mul25.1, %sub28 %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 2 %arrayidx31.1 = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv.next94.1 store i64 %sub28.1, ptr %arrayidx31.1, align 8, !tbaa !9 %arrayidx24.2 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next94.1 %25 = load i64, ptr %arrayidx24.2, align 8, !tbaa !9 %mul25.2 = shl nsw i64 %25, 1 %sub28.2 = sub nsw i64 %mul25.2, %sub28.1 %indvars.iv.next94.2 = add nuw nsw i64 %indvars.iv93, 3 %arrayidx31.2 = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv.next94.2 store i64 %sub28.2, ptr %arrayidx31.2, align 8, !tbaa !9 %arrayidx24.3 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next94.2 %26 = load i64, ptr %arrayidx24.3, align 8, !tbaa !9 %mul25.3 = shl nsw i64 %26, 1 %sub28.3 = sub nsw i64 %mul25.3, %sub28.2 %indvars.iv.next94.3 = add nuw nsw i64 %indvars.iv93, 4 %arrayidx31.3 = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv.next94.3 store i64 %sub28.3, ptr %arrayidx31.3, align 8, !tbaa !9 %niter111.next.3 = add i64 %niter111, 4 %niter111.ncmp.3 = icmp eq i64 %niter111.next.3, %unroll_iter110 br i1 %niter111.ncmp.3, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22, !llvm.loop !16 for.cond.cleanup47: ; preds = %for.inc57, %for.cond.cleanup21 call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 for.body48: ; preds = %for.cond.cleanup21, %for.inc57 %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc57 ], [ 0, %for.cond.cleanup21 ] %arrayidx50 = getelementptr inbounds i64, ptr %vla16, i64 %indvars.iv98 %27 = load i64, ptr %arrayidx50, align 8, !tbaa !9 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %27) %28 = load i32, ptr %N, align 4, !tbaa !5 %sub52 = add nsw i32 %28, -1 %29 = zext i32 %sub52 to i64 %cmp53.not = icmp eq i64 %indvars.iv98, %29 br i1 %cmp53.not, label %for.inc57, label %if.then54 if.then54: ; preds = %for.body48 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc57 for.inc57: ; preds = %for.body48, %if.then54 %30 = phi i32 [ %28, %for.body48 ], [ %.pre, %if.then54 ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %31 = sext i32 %30 to i64 %cmp46 = icmp slt i64 %indvars.iv.next99, %31 br i1 %cmp46, label %for.body48, label %for.cond.cleanup47, !llvm.loop !17 } ; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12}
#include <stdio.h> #include <string.h> struct count { int cnt; char moji; }; int main() { int N, K, i, j, max = 0, sum = 0, k; char S[100001]; struct count c[100000]; memset(c, 0, sizeof(c)); scanf("%d %d", &N, &K); scanf("%s", S); i = 0; j = 0; while (i < N) { c[j].moji = S[i]; do { c[j].cnt++; i++; } while (i < N && c[j].moji == S[i]); j++; } k = K; for (i = 0; i < j && k > 0; i++) { if (c[i].moji == '0') k--; sum += c[i].cnt; } if (i == j) { printf("%d", sum); return 0; } sum += c[i].cnt; max = sum; if (i >= K * 2) sum -= c[i - K * 2].cnt; sum -= c[i - K * 2 + 1].cnt; for (i = i + 1; i < N; i++) { sum += c[i].cnt; if (++i < N) sum += c[i].cnt; if (sum > max) max = sum; sum -= c[i - K * 2].cnt; sum -= c[i - K * 2 + 1].cnt; } printf("%d", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120062/source.c" target datalayout = "e-m:e-p270: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.count = type { i32, i8 } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 %S = alloca [100001 x i8], align 16 %c = alloca [100000 x %struct.count], align 16 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 void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %S) #5 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %c, i8 0, i64 800000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp148 = icmp sgt i32 %0, 0 br i1 %cmp148, label %while.body.preheader, label %cleanup while.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 br label %while.body while.body: ; preds = %while.body.preheader, %do.end %indvars.iv167 = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next168, %do.end ] %i.0149 = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %do.end ] %sext = shl i64 %i.0149, 32 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [100001 x i8], ptr %S, i64 0, i64 %idxprom %2 = load i8, ptr %arrayidx, align 1, !tbaa !9 %arrayidx4 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %indvars.iv167 %moji = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %indvars.iv167, i32 1 store i8 %2, ptr %moji, align 4, !tbaa !10 %arrayidx4.promoted = load i32, ptr %arrayidx4, align 8, !tbaa !12 br label %do.body do.body: ; preds = %land.rhs, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %land.rhs ], [ %idxprom, %while.body ] %3 = phi i32 [ %inc, %land.rhs ], [ %arrayidx4.promoted, %while.body ] %inc = add nsw i32 %3, 1 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %cmp8 = icmp slt i64 %indvars.iv.next, %1 br i1 %cmp8, label %land.rhs, label %do.end.thread do.end.thread: ; preds = %do.body store i32 %inc, ptr %arrayidx4, align 8, !tbaa !12 %indvars.iv.next168180 = add nuw i64 %indvars.iv167, 1 br label %while.end land.rhs: ; preds = %do.body %arrayidx13 = getelementptr inbounds [100001 x i8], ptr %S, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %cmp15 = icmp eq i8 %2, %4 br i1 %cmp15, label %do.body, label %do.end, !llvm.loop !13 do.end: ; preds = %land.rhs %5 = trunc i64 %indvars.iv.next to i32 store i32 %inc, ptr %arrayidx4, align 8, !tbaa !12 %indvars.iv.next168 = add nuw i64 %indvars.iv167, 1 %cmp = icmp sgt i32 %0, %5 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !15 while.end: ; preds = %do.end, %do.end.thread %indvars.iv.next168182 = phi i64 [ %indvars.iv.next168180, %do.end.thread ], [ %indvars.iv.next168, %do.end ] %6 = trunc i64 %indvars.iv.next168182 to i32 %7 = load i32, ptr %K, align 4, !tbaa !5 %cmp18152 = icmp ne i32 %6, 0 %cmp21153 = icmp sgt i32 %7, 0 %8 = select i1 %cmp18152, i1 %cmp21153, i1 false br i1 %8, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %while.end %9 = and i64 %indvars.iv.next168182, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv170 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next171, %for.body ] %k.0156 = phi i32 [ %7, %for.body.preheader ], [ %spec.select, %for.body ] %sum.0155 = phi i32 [ 0, %for.body.preheader ], [ %add, %for.body ] %arrayidx25 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %indvars.iv170 %moji26 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %indvars.iv170, i32 1 %10 = load i8, ptr %moji26, align 4, !tbaa !10 %cmp28 = icmp eq i8 %10, 48 %dec = sext i1 %cmp28 to i32 %spec.select = add nsw i32 %k.0156, %dec %11 = load i32, ptr %arrayidx25, align 8, !tbaa !12 %add = add nsw i32 %11, %sum.0155 %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1 %cmp18 = icmp ult i64 %indvars.iv.next171, %9 %cmp21 = icmp ne i32 %spec.select, 0 %12 = select i1 %cmp18, i1 %cmp21, i1 false br i1 %12, label %for.body, label %for.end.loopexit, !llvm.loop !16 for.end.loopexit: ; preds = %for.body %13 = trunc i64 %indvars.iv.next171 to i32 br label %for.end for.end: ; preds = %for.end.loopexit, %while.end %i.2.lcssa = phi i32 [ 0, %while.end ], [ %13, %for.end.loopexit ] %sum.0.lcssa = phi i32 [ 0, %while.end ], [ %add, %for.end.loopexit ] %cmp34 = icmp eq i32 %i.2.lcssa, %6 br i1 %cmp34, label %cleanup, label %if.end38 if.end38: ; preds = %for.end %idxprom39 = zext i32 %i.2.lcssa to i64 %arrayidx40 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %idxprom39 %14 = load i32, ptr %arrayidx40, align 8, !tbaa !12 %add42 = add nsw i32 %14, %sum.0.lcssa %mul = shl nsw i32 %7, 1 %cmp43.not = icmp slt i32 %i.2.lcssa, %mul %.pre = sub i32 %i.2.lcssa, %mul br i1 %cmp43.not, label %if.end51, label %if.then45 if.then45: ; preds = %if.end38 %idxprom47 = sext i32 %.pre to i64 %arrayidx48 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %idxprom47 %15 = load i32, ptr %arrayidx48, align 8, !tbaa !12 %sub50 = sub nsw i32 %add42, %15 br label %if.end51 if.end51: ; preds = %if.end38, %if.then45 %sum.1 = phi i32 [ %sub50, %if.then45 ], [ %add42, %if.end38 ] %i.3159 = add nuw nsw i32 %i.2.lcssa, 1 %cmp61160 = icmp slt i32 %i.3159, %0 br i1 %cmp61160, label %for.body63.preheader, label %cleanup for.body63.preheader: ; preds = %if.end51 %add54 = add i32 %.pre, 1 %idxprom55 = sext i32 %add54 to i64 %arrayidx56 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %idxprom55 %16 = load i32, ptr %arrayidx56, align 8, !tbaa !12 %sub58 = sub nsw i32 %sum.1, %16 %17 = sext i32 %0 to i64 %18 = sext i32 %mul to i64 br label %for.body63 for.body63: ; preds = %for.body63.preheader, %if.end76 %indvars.iv173 = phi i64 [ %idxprom39, %for.body63.preheader ], [ %indvars.iv.next174, %if.end76 ] %i.3164 = phi i32 [ %i.3159, %for.body63.preheader ], [ %27, %if.end76 ] %sum.2163 = phi i32 [ %sub58, %for.body63.preheader ], [ %sub93, %if.end76 ] %max.0162 = phi i32 [ %add42, %for.body63.preheader ], [ %spec.select145, %if.end76 ] %idxprom64 = zext i32 %i.3164 to i64 %arrayidx65 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %idxprom64 %19 = load i32, ptr %arrayidx65, align 8, !tbaa !12 %add67 = add nsw i32 %19, %sum.2163 %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 2 %cmp69 = icmp slt i64 %indvars.iv.next174, %17 br i1 %cmp69, label %if.then71, label %if.end76 if.then71: ; preds = %for.body63 %idxprom72 = and i64 %indvars.iv.next174, 4294967295 %arrayidx73 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %idxprom72 %20 = load i32, ptr %arrayidx73, align 8, !tbaa !12 %add75 = add nsw i32 %20, %add67 br label %if.end76 if.end76: ; preds = %if.then71, %for.body63 %sum.3 = phi i32 [ %add75, %if.then71 ], [ %add67, %for.body63 ] %spec.select145 = call i32 @llvm.smax.i32(i32 %sum.3, i32 %max.0162) %21 = sub nsw i64 %indvars.iv.next174, %18 %arrayidx84 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %21 %22 = load i32, ptr %arrayidx84, align 8, !tbaa !12 %23 = add nsw i64 %21, 1 %arrayidx91 = getelementptr inbounds [100000 x %struct.count], ptr %c, i64 0, i64 %23 %24 = load i32, ptr %arrayidx91, align 8, !tbaa !12 %25 = add i32 %22, %24 %sub93 = sub i32 %sum.3, %25 %26 = add nuw nsw i64 %indvars.iv173, 3 %cmp61 = icmp slt i64 %26, %17 %27 = trunc i64 %26 to i32 br i1 %cmp61, label %for.body63, label %cleanup, !llvm.loop !17 cleanup: ; preds = %if.end76, %if.end51, %for.end, %entry %max.0.lcssa.sink = phi i32 [ %sum.0.lcssa, %for.end ], [ 0, %entry ], [ %add42, %if.end51 ], [ %spec.select145, %if.end76 ] %call97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa.sink) call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %S) #5 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: 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 speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 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 = !{!11, !7, i64 4} !11 = !{!"count", !6, i64 0, !7, i64 4} !12 = !{!11, !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14} !17 = distinct !{!17, !14}
#include <stdio.h> #include <stdlib.h> int main(void){ int n, k; int first, next, *count; char in; int p = 0; int sum, max; scanf("%d %d ", &n, &k); count = malloc(sizeof(int) * (n + 10)); count[0] = 0; next = '1'; for(int i = 0; i < n; i++){ scanf("%c", &in); if(in != next){ p++; count[p] = 0; next = in; } count[p]++; } p++; for(int i = 0; i < 3; i++){ count[p + i] = 0; } sum = 0; for(int i = 0; i < 2 * k + 1 && i < p; i++) sum += count[i]; max = sum; for(int i = 0; i + 2 * k < p; i += 2){ //printf("%d-%d:%d\n", i, i + 2 * k + 1, sum); sum -= count[i] + count[i + 1]; //printf("-%d-%d\n", count[i], count[i + 1]); sum += count[i + 2 * k + 1] + count[i + 2 * k + 2]; //printf("+%d+%d\n", count[i + 2 * k + 1], count[i + 2 * k + 2]); if(max < sum)max = sum; } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d %d \00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %in = alloca i8, align 1 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 void @llvm.lifetime.start.p0(i64 1, ptr nonnull %in) #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 %add = add nsw i32 %0, 10 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 store i32 0, ptr %call1, align 4, !tbaa !5 %cmp108 = icmp sgt i32 %0, 0 br i1 %cmp108, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %if.end, %entry %p.0.lcssa = phi i32 [ 0, %entry ], [ %p.1, %if.end ] %inc13 = add nsw i32 %p.0.lcssa, 1 %1 = sext i32 %inc13 to i64 %arrayidx22 = getelementptr inbounds i32, ptr %call1, i64 %1 store i32 0, ptr %arrayidx22, align 4, !tbaa !5 %2 = getelementptr i32, ptr %call1, i64 %1 %arrayidx22.1 = getelementptr i32, ptr %2, i64 1 store i32 0, ptr %arrayidx22.1, align 4, !tbaa !5 %3 = getelementptr i32, ptr %call1, i64 %1 %arrayidx22.2 = getelementptr i32, ptr %3, i64 2 store i32 0, ptr %arrayidx22.2, align 4, !tbaa !5 %4 = load i32, ptr %k, align 4, !tbaa !5 %mul28 = shl nsw i32 %4, 1 %5 = or i32 %p.0.lcssa, %4 %6 = icmp sgt i32 %5, -1 br i1 %6, label %for.body35.preheader, label %for.cond43.preheader for.body: ; preds = %entry, %if.end %.pre = phi i32 [ %inc11, %if.end ], [ 0, %entry ] %i.0111 = phi i32 [ %inc12, %if.end ], [ 0, %entry ] %p.0110 = phi i32 [ %p.1, %if.end ], [ 0, %entry ] %next.0109 = phi i32 [ %next.1, %if.end ], [ 49, %entry ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in) %7 = load i8, ptr %in, align 1, !tbaa !9 %conv4 = sext i8 %7 to i32 %cmp5.not = icmp eq i32 %next.0109, %conv4 br i1 %cmp5.not, label %for.body.if.end_crit_edge, label %if.then for.body.if.end_crit_edge: ; preds = %for.body %idxprom9.phi.trans.insert = sext i32 %p.0110 to i64 br label %if.end if.then: ; preds = %for.body %inc = add nsw i32 %p.0110, 1 %idxprom = sext i32 %inc to i64 %arrayidx7 = getelementptr inbounds i32, ptr %call1, i64 %idxprom store i32 0, ptr %arrayidx7, align 4, !tbaa !5 br label %if.end if.end: ; preds = %for.body.if.end_crit_edge, %if.then %idxprom9.pre-phi = phi i64 [ %idxprom9.phi.trans.insert, %for.body.if.end_crit_edge ], [ %idxprom, %if.then ] %8 = phi i32 [ %.pre, %for.body.if.end_crit_edge ], [ 0, %if.then ] %next.1 = phi i32 [ %next.0109, %for.body.if.end_crit_edge ], [ %conv4, %if.then ] %p.1 = phi i32 [ %p.0110, %for.body.if.end_crit_edge ], [ %inc, %if.then ] %arrayidx10 = getelementptr inbounds i32, ptr %call1, i64 %idxprom9.pre-phi %inc11 = add nsw i32 %8, 1 store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5 %inc12 = add nuw nsw i32 %i.0111, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc12, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10 for.body35.preheader: ; preds = %for.cond.cleanup %add29 = or i32 %mul28, 1 %10 = sext i32 %add29 to i64 %11 = sext i32 %p.0.lcssa to i64 %smax = call i64 @llvm.smax.i64(i64 %11, i64 0) %smax134 = call i64 @llvm.smax.i64(i64 %10, i64 1) %12 = add nsw i64 %smax134, -1 %umin = call i64 @llvm.umin.i64(i64 %smax, i64 %12) %13 = add nuw nsw i64 %umin, 1 %min.iters.check = icmp ult i64 %umin, 7 br i1 %min.iters.check, label %for.body35.preheader137, label %vector.ph vector.ph: ; preds = %for.body35.preheader %n.vec = and i64 %13, 9223372036854775800 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.phi135 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %14 = getelementptr inbounds i32, ptr %call1, i64 %index %wide.load = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load136 = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load136, %vec.phi135 %index.next = add nuw i64 %index, 8 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %13, %n.vec br i1 %cmp.n, label %for.cond43.preheader, label %for.body35.preheader137 for.body35.preheader137: ; preds = %for.body35.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body35.preheader ], [ %n.vec, %middle.block ] %sum.0115.ph = phi i32 [ 0, %for.body35.preheader ], [ %19, %middle.block ] br label %for.body35 for.cond43.preheader: ; preds = %for.body35, %middle.block, %for.cond.cleanup %sum.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %19, %middle.block ], [ %add38, %for.body35 ] %cmp46.not119 = icmp sgt i32 %mul28, %p.0.lcssa br i1 %cmp46.not119, label %for.cond.cleanup48, label %for.body49.preheader for.body49.preheader: ; preds = %for.cond43.preheader %20 = sext i32 %mul28 to i64 %21 = sext i32 %p.0.lcssa to i64 br label %for.body49 for.body35: ; preds = %for.body35.preheader137, %for.body35 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body35 ], [ %indvars.iv.ph, %for.body35.preheader137 ] %sum.0115 = phi i32 [ %add38, %for.body35 ], [ %sum.0115.ph, %for.body35.preheader137 ] %arrayidx37 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %22 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %add38 = add nsw i32 %22, %sum.0115 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp30 = icmp slt i64 %indvars.iv.next, %10 %cmp32 = icmp slt i64 %indvars.iv, %11 %23 = and i1 %cmp32, %cmp30 br i1 %23, label %for.body35, label %for.cond43.preheader, !llvm.loop !15 for.cond.cleanup48: ; preds = %for.body49, %for.cond43.preheader %max.0.lcssa = phi i32 [ %sum.0.lcssa, %for.cond43.preheader ], [ %spec.select, %for.body49 ] %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %in) #5 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 for.body49: ; preds = %for.body49.preheader, %for.body49 %indvars.iv128 = phi i64 [ 0, %for.body49.preheader ], [ %indvars.iv.next129, %for.body49 ] %add45123 = phi i32 [ %mul28, %for.body49.preheader ], [ %31, %for.body49 ] %max.0121 = phi i32 [ %sum.0.lcssa, %for.body49.preheader ], [ %spec.select, %for.body49 ] %sum.1120 = phi i32 [ %sum.0.lcssa, %for.body49.preheader ], [ %add67, %for.body49 ] %arrayidx51 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv128 %24 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %25 = or i64 %indvars.iv128, 1 %arrayidx54 = getelementptr inbounds i32, ptr %call1, i64 %25 %26 = load i32, ptr %arrayidx54, align 4, !tbaa !5 %add58 = or i32 %add45123, 1 %idxprom59 = sext i32 %add58 to i64 %arrayidx60 = getelementptr inbounds i32, ptr %call1, i64 %idxprom59 %27 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %add63 = add nsw i32 %add45123, 2 %idxprom64 = sext i32 %add63 to i64 %arrayidx65 = getelementptr inbounds i32, ptr %call1, i64 %idxprom64 %28 = load i32, ptr %arrayidx65, align 4, !tbaa !5 %29 = add i32 %24, %26 %add55.neg = sub i32 %sum.1120, %29 %sub = add i32 %add55.neg, %27 %add67 = add i32 %sub, %28 %spec.select = call i32 @llvm.smax.i32(i32 %max.0121, i32 %add67) %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 2 %30 = add nsw i64 %indvars.iv.next129, %20 %cmp46.not = icmp sgt i64 %30, %21 %31 = trunc i64 %30 to i32 br i1 %cmp46.not, label %for.cond.cleanup48, label %for.body49, !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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !14, !13} !16 = distinct !{!16, !11}
#include <stdio.h> #include <string.h> int main(){ char A[9][4]={"A","SAT","FRI","THU","WED","TUE","MON","SUN"}; char S[4]; scanf("%s",S); int ans=1; while(strcmp(S,A[ans])!=0) ans++; printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120149/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120149/source.c" target datalayout = "e-m:e-p270: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.A = private unnamed_addr constant [9 x [4 x i8]] [[4 x i8] c"A\00\00\00", [4 x i8] c"SAT\00", [4 x i8] c"FRI\00", [4 x i8] c"THU\00", [4 x i8] c"WED\00", [4 x i8] c"TUE\00", [4 x i8] c"MON\00", [4 x i8] c"SUN\00", [4 x i8] zeroinitializer], align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 1, %entry ] %arrayidx = getelementptr inbounds [9 x [4 x i8]], ptr @__const.main.A, i64 0, i64 %indvars.iv %call3 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(1) %arrayidx) #5 %cmp.not = icmp eq i32 %call3, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond %0 = trunc i64 %indvars.iv to i32 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ char s[7][4]={"SUN","MON","TUE","WED","THU","FRI","SAT"}; char t[4]; scanf("%s",t); for(int i=0; i<7; i++){ if (strcmp(t,s[i])==0) printf("%d\n",7-i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120192/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120192/source.c" target datalayout = "e-m:e-p270: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.s = private unnamed_addr constant [7 x [4 x i8]] [[4 x i8] c"SUN\00", [4 x i8] c"MON\00", [4 x i8] c"TUE\00", [4 x i8] c"WED\00", [4 x i8] c"THU\00", [4 x i8] c"FRI\00", [4 x i8] c"SAT\00"], align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca [4 x i8], align 1 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 %t) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) @__const.main.s, i64 4) %cmp4 = icmp eq i32 %bcmp, 0 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 7) br label %for.inc for.inc: ; preds = %entry, %if.then %bcmp12 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 1), i64 4) %cmp4.1 = icmp eq i32 %bcmp12, 0 br i1 %cmp4.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %call5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 6) br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %bcmp13 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 2), i64 4) %cmp4.2 = icmp eq i32 %bcmp13, 0 br i1 %cmp4.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %call5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 5) br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %bcmp14 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 3), i64 4) %cmp4.3 = icmp eq i32 %bcmp14, 0 br i1 %cmp4.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %call5.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 4) br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %bcmp15 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 4), i64 4) %cmp4.4 = icmp eq i32 %bcmp15, 0 br i1 %cmp4.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %call5.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 3) br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %bcmp16 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 5), i64 4) %cmp4.5 = icmp eq i32 %bcmp16, 0 br i1 %cmp4.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %call5.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2) br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %bcmp17 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %t, ptr noundef nonnull dereferenceable(4) getelementptr inbounds ([7 x [4 x i8]], ptr @__const.main.s, i64 0, i64 6), i64 4) %cmp4.6 = icmp eq i32 %bcmp17, 0 br i1 %cmp4.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %call5.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1) br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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 willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: read) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> #include <string.h> int main(void){ // Your code here! int cnt; char s[4]; scanf("%s",s); if(strcmp(s,"SUN")==0) cnt=7; if(strcmp(s,"MON")==0) cnt=6; if(strcmp(s,"TUE")==0) cnt=5; if(strcmp(s,"WED")==0) cnt=4; if(strcmp(s,"THU")==0) cnt=3; if(strcmp(s,"FRI")==0) cnt=2; if(strcmp(s,"SAT")==0) cnt=1; printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120235/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120235/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.6 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 @.str.8 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %bcmp34 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.2, i64 4) %cmp5 = icmp eq i32 %bcmp34, 0 %cnt.1 = select i1 %cmp5, i32 6, i32 7 %bcmp35 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4) %cmp10 = icmp eq i32 %bcmp35, 0 %cnt.2 = select i1 %cmp10, i32 5, i32 %cnt.1 %bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.4, i64 4) %cmp15 = icmp eq i32 %bcmp36, 0 %cnt.3 = select i1 %cmp15, i32 4, i32 %cnt.2 %bcmp37 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4) %cmp20 = icmp eq i32 %bcmp37, 0 %cnt.4 = select i1 %cmp20, i32 3, i32 %cnt.3 %bcmp38 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.6, i64 4) %cmp25 = icmp eq i32 %bcmp38, 0 %cnt.5 = select i1 %cmp25, i32 2, i32 %cnt.4 %bcmp39 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4) %cmp30 = icmp eq i32 %bcmp39, 0 %cnt.6 = select i1 %cmp30, i32 1, i32 %cnt.5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %cnt.6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: read) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> #include <string.h> int main() { static char s[4]; scanf("%s", s); if (strcmp(s, "SUN") == 0) printf("7\n"); else if (strcmp(s, "MON") == 0) printf("6\n"); else if (strcmp(s, "TUE") == 0) printf("5\n"); else if (strcmp(s, "WED") == 0) printf("4\n"); else if (strcmp(s, "THU") == 0) printf("3\n"); else if (strcmp(s, "FRI") == 0) printf("2\n"); else printf("1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120293/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120293/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.s = internal global [4 x i8] zeroinitializer, align 1 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"SUN\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.14 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.15 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @str.16 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @str.17 = private unnamed_addr constant [2 x i8] c"5\00", align 1 @str.18 = private unnamed_addr constant [2 x i8] c"6\00", align 1 @str.19 = private unnamed_addr constant [2 x i8] c"7\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @main.s) %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.1, i64 4) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %if.end33, label %if.else if.else: ; preds = %entry %bcmp34 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4) %cmp4 = icmp eq i32 %bcmp34, 0 br i1 %cmp4, label %if.end33, label %if.else7 if.else7: ; preds = %if.else %bcmp35 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4) %cmp9 = icmp eq i32 %bcmp35, 0 br i1 %cmp9, label %if.end33, label %if.else12 if.else12: ; preds = %if.else7 %bcmp36 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4) %cmp14 = icmp eq i32 %bcmp36, 0 br i1 %cmp14, label %if.end33, label %if.else17 if.else17: ; preds = %if.else12 %bcmp37 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4) %cmp19 = icmp eq i32 %bcmp37, 0 br i1 %cmp19, label %if.end33, label %if.else22 if.else22: ; preds = %if.else17 %bcmp38 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(4) @main.s, ptr noundef nonnull dereferenceable(4) @.str.11, i64 4) %cmp24 = icmp eq i32 %bcmp38, 0 %str.14.str = select i1 %cmp24, ptr @str.14, ptr @str br label %if.end33 if.end33: ; preds = %if.else22, %if.else17, %if.else12, %if.else7, %if.else, %entry %str.18.sink = phi ptr [ @str.19, %entry ], [ @str.18, %if.else ], [ @str.17, %if.else7 ], [ @str.16, %if.else12 ], [ @str.15, %if.else17 ], [ %str.14.str, %if.else22 ] %puts43 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.18.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #2 ; 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 = { nofree nounwind "no-trapping-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 willreturn memory(argmem: read) } attributes #3 = { nofree nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
/*#include<stdio.h> int main(){ char S[3]; scanf("%s",S); printf("%s",S); if (S[1] == "SUN") if (S[2] == "N") printf("7"); else if (S[2] == "E") printf("5"); else if (S[1] =="O" ) printf("6"); else if (S[1] == "E") printf("4"); else if (S[1] == "H") printf("3"); else if (S[1] == "R") printf("2"); else if (S[1] == "A") printf("1"); return 0; }*/ #include<stdio.h> #include<string.h> int main(){ char S[3]; scanf("%s",S); //printf("%s",S[1]); if (strncmp(S,"SUN",3) == 0) printf("7"); else if (strncmp(S,"MON",3) == 0) printf("6"); else if (strncmp(S,"TUE",3) == 0) printf("5"); else if (strncmp(S,"WED",3) == 0) printf("4"); else if (strncmp(S,"THU",3) == 0) printf("3"); else if (strncmp(S,"FRI",3) == 0) printf("2"); else if (strncmp(S,"SAT",3) == 0) printf("1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120343/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120343/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"SUN\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.13 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.1, i64 3) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %if.end44.sink.split, label %if.else if.else: ; preds = %entry %bcmp45 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.3, i64 3) %cmp6 = icmp eq i32 %bcmp45, 0 br i1 %cmp6, label %if.end44.sink.split, label %if.else9 if.else9: ; preds = %if.else %bcmp46 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.5, i64 3) %cmp12 = icmp eq i32 %bcmp46, 0 br i1 %cmp12, label %if.end44.sink.split, label %if.else15 if.else15: ; preds = %if.else9 %bcmp47 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.7, i64 3) %cmp18 = icmp eq i32 %bcmp47, 0 br i1 %cmp18, label %if.end44.sink.split, label %if.else21 if.else21: ; preds = %if.else15 %bcmp48 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.9, i64 3) %cmp24 = icmp eq i32 %bcmp48, 0 br i1 %cmp24, label %if.end44.sink.split, label %if.else27 if.else27: ; preds = %if.else21 %bcmp49 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.11, i64 3) %cmp30 = icmp eq i32 %bcmp49, 0 br i1 %cmp30, label %if.end44.sink.split, label %if.else33 if.else33: ; preds = %if.else27 %bcmp50 = call i32 @bcmp(ptr noundef nonnull dereferenceable(3) %S, ptr noundef nonnull dereferenceable(3) @.str.13, i64 3) %cmp36 = icmp eq i32 %bcmp50, 0 br i1 %cmp36, label %if.end44.sink.split, label %if.end44 if.end44.sink.split: ; preds = %if.else33, %if.else27, %if.else21, %if.else15, %if.else9, %if.else, %entry %.sink = phi i32 [ 55, %entry ], [ 54, %if.else ], [ 53, %if.else9 ], [ 52, %if.else15 ], [ 51, %if.else21 ], [ 50, %if.else27 ], [ 49, %if.else33 ] %putchar55 = call i32 @putchar(i32 %.sink) br label %if.end44 if.end44: ; preds = %if.end44.sink.split, %if.else33 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } 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)"}
#include <stdio.h> #include <string.h> int main() { char S[10]; scanf("%s", S); if (strcmp(S, "SUN") == 0) { printf("7"); } else if (strcmp(S, "MON") == 0) { printf("6"); } else if (strcmp(S, "TUE") == 0) { printf("5"); } else if (strcmp(S, "WED") == 0) { printf("4"); } else if (strcmp(S, "THU") == 0) { printf("3"); } else if (strcmp(S, "FRI") == 0) { printf("2"); } else if (strcmp(S, "SAT") == 0) { printf("1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120387/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120387/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"SUN\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.13 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.1, i64 4) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %if.end44.sink.split, label %if.else if.else: ; preds = %entry %bcmp45 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4) %cmp6 = icmp eq i32 %bcmp45, 0 br i1 %cmp6, label %if.end44.sink.split, label %if.else9 if.else9: ; preds = %if.else %bcmp46 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4) %cmp12 = icmp eq i32 %bcmp46, 0 br i1 %cmp12, label %if.end44.sink.split, label %if.else15 if.else15: ; preds = %if.else9 %bcmp47 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4) %cmp18 = icmp eq i32 %bcmp47, 0 br i1 %cmp18, label %if.end44.sink.split, label %if.else21 if.else21: ; preds = %if.else15 %bcmp48 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4) %cmp24 = icmp eq i32 %bcmp48, 0 br i1 %cmp24, label %if.end44.sink.split, label %if.else27 if.else27: ; preds = %if.else21 %bcmp49 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.11, i64 4) %cmp30 = icmp eq i32 %bcmp49, 0 br i1 %cmp30, label %if.end44.sink.split, label %if.else33 if.else33: ; preds = %if.else27 %bcmp50 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %S, ptr noundef nonnull dereferenceable(4) @.str.13, i64 4) %cmp36 = icmp eq i32 %bcmp50, 0 br i1 %cmp36, label %if.end44.sink.split, label %if.end44 if.end44.sink.split: ; preds = %if.else33, %if.else27, %if.else21, %if.else15, %if.else9, %if.else, %entry %.sink = phi i32 [ 55, %entry ], [ 54, %if.else ], [ 53, %if.else9 ], [ 52, %if.else15 ], [ 51, %if.else21 ], [ 50, %if.else27 ], [ 49, %if.else33 ] %putchar55 = call i32 @putchar(i32 %.sink) br label %if.end44 if.end44: ; preds = %if.end44.sink.split, %if.else33 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } 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)"}
#include<stdio.h> int main() { int l,b,i,x; x=1; while(l<10&&b<=l); scanf("%d %d",&l,&b); for(i=1;;i++){ l=l*3; b=b*2; if(l<=b) x++; if(l>b) break; } printf("%d",x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12043/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12043/source.c" target datalayout = "e-m:e-p270: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 { while.end: %l = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #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 %l, ptr noundef nonnull %b) %l.promoted = load i32, ptr %l, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 br label %for.cond for.cond: ; preds = %for.cond, %while.end %mul211 = phi i32 [ %b.promoted, %while.end ], [ %mul2, %for.cond ] %mul10 = phi i32 [ %l.promoted, %while.end ], [ %mul, %for.cond ] %x.0 = phi i32 [ 1, %while.end ], [ %inc, %for.cond ] %mul = mul nsw i32 %mul10, 3 %mul2 = shl nsw i32 %mul211, 1 %cmp3.not = icmp sgt i32 %mul, %mul2 %inc = add nuw nsw i32 %x.0, 1 br i1 %cmp3.not, label %for.end, label %for.cond for.end: ; preds = %for.cond store i32 %mul, ptr %l, align 4, !tbaa !5 store i32 %mul2, ptr %b, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int cmp(const void *a, const void*b){ return *(int*)a - *(int*)b; } int main(){ while(1){ int n; scanf("%d", &n); if(n==0) break; int a[n], i; for(i=0;i<n;i++) scanf("%d", &a[i]); qsort(a, n, sizeof(int), cmp); int min = a[n-1], temp; for(i=0;i<n-1;i++){ temp = a[i+1] - a[i]; if(temp<min) min = temp; } printf("%d\n", min); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp41 = icmp eq i32 %0, 0 br i1 %cmp41, label %while.end, label %if.end if.end: ; preds = %entry, %cleanup %1 = phi i32 [ %21, %cleanup ], [ %0, %entry ] %2 = zext i32 %1 to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %2, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp134 = icmp sgt i32 %4, 0 br i1 %cmp134, label %for.body, label %if.end.for.end_crit_edge if.end.for.end_crit_edge: ; preds = %if.end %.pre47 = sext i32 %4 to i64 br label %for.end for.body: ; preds = %if.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %if.end ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %if.end.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre47, %if.end.for.end_crit_edge ], [ %6, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #7 %7 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %idxprom3 = sext i32 %sub to i64 %arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %idxprom3 %8 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp736 = icmp sgt i32 %7, 1 br i1 %cmp736, label %for.body9.preheader, label %cleanup for.body9.preheader: ; preds = %for.end %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %vla, align 16, !tbaa !5 %min.iters.check = icmp ult i32 %7, 9 br i1 %min.iters.check, label %for.body9.preheader50, label %vector.ph vector.ph: ; preds = %for.body9.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %8, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.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 ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load49, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %16, %vector.body ] %vec.phi48 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %17, %vector.body ] %9 = or i64 %index, 1 %10 = getelementptr inbounds i32, ptr %vla, i64 %9 %wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load49 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %13 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load49, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %14 = sub nsw <4 x i32> %wide.load, %12 %15 = sub nsw <4 x i32> %wide.load49, %13 %16 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %14, <4 x i32> %vec.phi) %17 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %15, <4 x i32> %vec.phi48) %index.next = add nuw i64 %index, 8 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %16, <4 x i32> %17) %19 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count %vector.recur.extract = extractelement <4 x i32> %wide.load49, i64 3 br i1 %cmp.n, label %cleanup, label %for.body9.preheader50 for.body9.preheader50: ; preds = %for.body9.preheader, %middle.block %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body9.preheader ] %indvars.iv44.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body9.preheader ] %min.038.ph = phi i32 [ %19, %middle.block ], [ %8, %for.body9.preheader ] br label %for.body9 for.body9: ; preds = %for.body9.preheader50, %for.body9 %scalar.recur = phi i32 [ %20, %for.body9 ], [ %scalar.recur.ph, %for.body9.preheader50 ] %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body9 ], [ %indvars.iv44.ph, %for.body9.preheader50 ] %min.038 = phi i32 [ %spec.select, %for.body9 ], [ %min.038.ph, %for.body9.preheader50 ] %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next45 %20 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub14 = sub nsw i32 %20, %scalar.recur %spec.select = call i32 @llvm.smin.i32(i32 %sub14, i32 %min.038) %exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body9, !llvm.loop !14 cleanup: ; preds = %for.body9, %middle.block, %for.end %min.0.lcssa = phi i32 [ %8, %for.end ], [ %19, %middle.block ], [ %spec.select, %for.body9 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %21 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %21, 0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %cleanup, %entry 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12}
#include <stdio.h> int main(void){ int s=0, m,n; scanf("%d",&n); m=n; while(m>0){ s+=m%10; m=m/10; } if(n%s==0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120530/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %m.011 = phi i32 [ %div, %while.body ], [ %0, %entry ] %s.010 = phi i32 [ %add, %while.body ], [ 0, %entry ] %rem = urem i32 %m.011, 10 %add = add nuw nsw i32 %rem, %s.010 %div = udiv i32 %m.011, 10 %cmp.not = icmp ult i32 %m.011, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i32 %0, %s.0.lcssa %cmp2 = icmp eq i32 %rem1, 0 %str.3.str = select i1 %cmp2, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int n,s=0,r,i; scanf("%d",&n); r=n; while(n!=0) { i=n%10; s=s+i; n=n/10; } if(r%s!=0) printf("No"); else printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120574/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not6 = icmp eq i32 %0, 0 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %s.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %1 = phi i32 [ %div, %while.body ], [ %0, %entry ] %rem = srem i32 %1, 10 %add = add nsw i32 %s.07, %rem %div = sdiv i32 %1, 10 %.off = add i32 %1, 9 %cmp.not = icmp ult i32 %.off, 19 br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %div, ptr %n, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %s.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ] %rem1 = srem i32 %0, %s.0.lcssa %cmp2.not = icmp eq i32 %rem1, 0 %.str.2..str.1 = select i1 %cmp2.not, ptr @.str.2, ptr @.str.1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int n,i,s=0; scanf("%d",&n); for(i=n;i;i/=10)s+=i%10; puts(n%s==0?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120617/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120617/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %s.08 = phi i32 [ %add, %for.body ], [ 0, %entry ] %i.07 = phi i32 [ %div, %for.body ], [ %0, %entry ] %rem = srem i32 %i.07, 10 %add = add nsw i32 %s.08, %rem %div = sdiv i32 %i.07, 10 %i.07.off = add i32 %i.07, 9 %tobool.not = icmp ult i32 %i.07.off, 19 br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %rem1 = srem i32 %0, %s.0.lcssa %cmp = icmp eq i32 %rem1, 0 %cond = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N; scanf("%d", &N); if(N/10==0){ printf("Yes\n"); } else{ int D = N; int S = 0; while(D!=0){ S+=D%10; D/=10; } if(N%S==0){ printf("Yes\n"); } else{ printf("No\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120660/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %.off = add i32 %0, 9 %cmp = icmp ult i32 %.off, 19 br i1 %cmp, label %if.end10, label %while.body while.body: ; preds = %entry, %while.body %S.018 = phi i32 [ %add, %while.body ], [ 0, %entry ] %D.017 = phi i32 [ %div3, %while.body ], [ %0, %entry ] %rem = srem i32 %D.017, 10 %add = add nsw i32 %S.018, %rem %div3 = sdiv i32 %D.017, 10 %D.017.off = add i32 %D.017, 9 %cmp2.not = icmp ult i32 %D.017.off, 19 br i1 %cmp2.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body %rem4 = srem i32 %0, %add %cmp5 = icmp eq i32 %rem4, 0 %str.3.str = select i1 %cmp5, ptr @str.4, ptr @str br label %if.end10 if.end10: ; preds = %while.end, %entry %str.3.sink = phi ptr [ @str.4, %entry ], [ %str.3.str, %while.end ] %puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include "stdio.h" #define lnth(a,l) for(l=0;a[l];l++) int main(){ int s=0,n,t; scanf("%d",&n); t = n; while(t){ s += t%10; t/=10; } //printf("%d",s); printf(n%s==0?"Yes":"No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120703/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120703/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %t.08 = phi i32 [ %div, %while.body ], [ %0, %entry ] %s.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %rem = srem i32 %t.08, 10 %add = add nsw i32 %rem, %s.07 %div = sdiv i32 %t.08, 10 %t.08.off = add i32 %t.08, 9 %tobool.not = icmp ult i32 %t.08.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i32 %0, %s.0.lcssa %cmp = icmp eq i32 %rem1, 0 %cond = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) 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"}