Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main(void){ int n,i,x; scanf("%d",&n); for(i=1;i<=n;i++){ x=i; if(x%3==0){ printf(" %d",i); continue; } do{ if(x%10==3){ printf(" %d",i); break; } if((x/=10)==0) break; }while(x!=0); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229994/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229994/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %cmp.not20 = icmp slt i32 %0, 1 br i1 %cmp.not20, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %i.021 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %rem = urem i32 %i.021, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.inc.sink.split, label %do.body do.body: ; preds = %for.body, %if.end7 %x.0 = phi i32 [ %div, %if.end7 ], [ %i.021, %for.body ] %rem3 = srem i32 %x.0, 10 %div = sdiv i32 %x.0, 10 %cmp4 = icmp eq i32 %rem3, 3 br i1 %cmp4, label %for.inc.sink.split, label %if.end7 if.end7: ; preds = %do.body %x.0.off = add i32 %x.0, 9 %cmp8.not = icmp ult i32 %x.0.off, 19 br i1 %cmp8.not, label %for.inc, label %do.body, !llvm.loop !9 for.inc.sink.split: ; preds = %do.body, %for.body %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.021) br label %for.inc for.inc: ; preds = %if.end7, %for.inc.sink.split %inc = add nuw nsw i32 %i.021, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.021, %1 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) 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}
#include <stdio.h> int main(){ int n, i; scanf("%d\n", &n); i = 1; while(1) { if((i / 10) % 10 == 3 || (i / 100) % 10 == 3 || (i / 1000) % 10 == 3) { printf(" %d", i); } else if((i - 3) % 10 == 0) { printf(" %d", i); } else if(i % 3 == 0) { printf(" %d", i); } if(i == n) { printf("\n"); break; } i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230042/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230042/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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) br label %while.cond while.cond: ; preds = %if.end19, %entry %i.0 = phi i32 [ 1, %entry ], [ %inc, %if.end19 ] %div = udiv i32 %i.0, 10 %rem = urem i32 %div, 10 %cmp = icmp eq i32 %rem, 3 br i1 %cmp, label %if.end19.sink.split, label %lor.lhs.false lor.lhs.false: ; preds = %while.cond %div1 = udiv i32 %i.0, 100 %rem2 = urem i32 %div1, 10 %cmp3 = icmp eq i32 %rem2, 3 br i1 %cmp3, label %if.end19.sink.split, label %lor.lhs.false4 lor.lhs.false4: ; preds = %lor.lhs.false %div5 = udiv i32 %i.0, 1000 %rem6 = urem i32 %div5, 10 %cmp7 = icmp eq i32 %rem6, 3 br i1 %cmp7, label %if.end19.sink.split, label %if.else if.else: ; preds = %lor.lhs.false4 %sub = add nsw i32 %i.0, -3 %rem9 = srem i32 %sub, 10 %cmp10 = icmp eq i32 %rem9, 0 %rem14 = urem i32 %i.0, 3 %cmp15 = icmp eq i32 %rem14, 0 %or.cond = or i1 %cmp10, %cmp15 br i1 %or.cond, label %if.end19.sink.split, label %if.end19 if.end19.sink.split: ; preds = %if.else, %while.cond, %lor.lhs.false, %lor.lhs.false4 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0) br label %if.end19 if.end19: ; preds = %if.else, %if.end19.sink.split %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp20 = icmp eq i32 %i.0, %0 %inc = add nuw nsw i32 %i.0, 1 br i1 %cmp20, label %if.then21, label %while.cond if.then21: ; preds = %if.end19 %putchar = call i32 @putchar(i32 10) 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"}
#include <stdio.h> int main(void){ int n,i,j; scanf("%d",&n); for(i = 1;i<=n;i++){ if(i % 3 == 0){ printf(" %d",i); } else { for(j = i;j>0;j /= 10){ if(j % 10 == 3){ printf(" %d",i); break; } } } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230143/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230143/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %cmp.not22 = icmp slt i32 %0, 1 br i1 %cmp.not22, label %for.end12, label %for.body for.body: ; preds = %entry, %for.inc11 %i.023 = phi i32 [ %inc, %for.inc11 ], [ 1, %entry ] %rem = urem i32 %i.023, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.inc11.sink.split, label %for.body5 for.body5: ; preds = %for.body, %for.inc %j.021 = phi i32 [ %div, %for.inc ], [ %i.023, %for.body ] %rem6 = urem i32 %j.021, 10 %div = udiv i32 %j.021, 10 %cmp7 = icmp eq i32 %rem6, 3 br i1 %cmp7, label %for.inc11.sink.split, label %for.inc for.inc: ; preds = %for.body5 %cmp4.not = icmp ult i32 %j.021, 10 br i1 %cmp4.not, label %for.inc11, label %for.body5, !llvm.loop !9 for.inc11.sink.split: ; preds = %for.body5, %for.body %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.023) br label %for.inc11 for.inc11: ; preds = %for.inc, %for.inc11.sink.split %inc = add nuw nsw i32 %i.023, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.023, %1 br i1 %cmp.not.not, label %for.body, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.inc11, %entry %putchar = call i32 @putchar(i32 10) 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}
#include <stdio.h> //#include <string.h> int main() { int n, i, x, include3 = 0; scanf("%d", &n); i = 1; while (1) { if (!include3) { // check num x = i; if (x % 3 == 0) { printf(" %d", i); if (++i <= n) { include3 = 0; continue; } else break; } } include3 = 0; // include3 if (x % 10 == 3) { printf(" %d", i); if (++i <= n) { include3 = 0; continue; } else break; } x /= 10; if (x) { include3 = 1; continue; } if (++i <= n) { include3 = 0; continue; } else break; } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230187/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230187/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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) br label %while.cond.outer while.cond.outer: ; preds = %while.cond.outer.backedge, %entry %i.0.ph = phi i32 [ 1, %entry ], [ %i.0.ph.be, %while.cond.outer.backedge ] %rem = urem i32 %i.0.ph, 3 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.then.us, label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.outer %rem633 = urem i32 %i.0.ph, 10 %cmp734 = icmp eq i32 %rem633, 3 br i1 %cmp734, label %if.then8, label %if.end14 if.then.us: ; preds = %while.cond.outer %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.ph) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp3.not.not = icmp slt i32 %i.0.ph, %0 br i1 %cmp3.not.not, label %while.cond.outer.backedge, label %while.end if.then8: ; preds = %if.then16, %while.cond.preheader %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.ph) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp11.not.not = icmp slt i32 %i.0.ph, %1 br i1 %cmp11.not.not, label %while.cond.outer.backedge, label %while.end while.cond.outer.backedge: ; preds = %if.end17, %if.then8, %if.then.us %i.0.ph.be = add nuw nsw i32 %i.0.ph, 1 br label %while.cond.outer if.end14: ; preds = %while.cond.preheader, %if.then16 %tobool.not35 = phi i32 [ %div, %if.then16 ], [ %i.0.ph, %while.cond.preheader ] %x.1.off = add i32 %tobool.not35, 9 %tobool15.not = icmp ult i32 %x.1.off, 19 br i1 %tobool15.not, label %if.end17, label %if.then16 if.then16: ; preds = %if.end14 %div = sdiv i32 %tobool.not35, 10 %rem6 = srem i32 %div, 10 %cmp7 = icmp eq i32 %rem6, 3 br i1 %cmp7, label %if.then8, label %if.end14 if.end17: ; preds = %if.end14 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp19.not.not = icmp slt i32 %i.0.ph, %2 br i1 %cmp19.not.not, label %while.cond.outer.backedge, label %while.end while.end: ; preds = %if.end17, %if.then8, %if.then.us %putchar = call i32 @putchar(i32 10) 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"}
#include<stdio.h> int main(void) { int n; int i=1; int x; scanf("%d", &n); do { int x = i; if (x % 3 == 0) { printf(" %d", i); continue; } do{ if (x % 10 == 3) { printf(" %d", i); break; } else { x /= 10; } } while (x); } while (++i <= n); printf("\n"); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230237/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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) br label %do.body do.body: ; preds = %cleanup, %entry %i.0 = phi i32 [ 1, %entry ], [ %inc, %cleanup ] %rem = urem i32 %i.0, 3 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %cleanup.sink.split, label %do.body3 do.body3: ; preds = %do.body, %if.else %x1.0 = phi i32 [ %div, %if.else ], [ %i.0, %do.body ] %rem4 = srem i32 %x1.0, 10 %div = sdiv i32 %x1.0, 10 %cmp5 = icmp eq i32 %rem4, 3 br i1 %cmp5, label %cleanup.sink.split, label %if.else if.else: ; preds = %do.body3 %x1.0.off = add i32 %x1.0, 9 %tobool.not = icmp ult i32 %x1.0.off, 19 br i1 %tobool.not, label %cleanup, label %do.body3, !llvm.loop !5 cleanup.sink.split: ; preds = %do.body3, %do.body %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0) br label %cleanup cleanup: ; preds = %if.else, %cleanup.sink.split %inc = add nuw nsw i32 %i.0, 1 %0 = load i32, ptr %n, align 4, !tbaa !7 %cmp10.not.not = icmp slt i32 %i.0, %0 br i1 %cmp10.not.not, label %do.body, label %do.end11, !llvm.loop !11 do.end11: ; preds = %cleanup %putchar = call i32 @putchar(i32 10) 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int main(void){ int i,num; scanf("%d",&num); for(i=1;i<=num;i++){ if(i%10==3){ printf(" %d",i); } else if(i%3==0){ if(i==num){ printf(" %d",i); } else printf(" %d",i); } else if(i/10==3){ printf(" %d",i); } else if(30<=(i%100)&&(i%100)<=39){ printf(" %d",i); } else if(300<=(i%1000)&&(i%1000)<=399){ printf(" %d",i); } else if(3000<=(i%10000)&&(i%10000)<=3999){ printf(" %d",i); } } printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230280/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230280/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp.not65 = icmp slt i32 %0, 1 br i1 %cmp.not65, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %i.066 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %rem = urem i32 %i.066, 10 %cmp1 = icmp eq i32 %rem, 3 br i1 %cmp1, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %rem3 = urem i32 %i.066, 3 %cmp4 = icmp eq i32 %rem3, 0 %i.0.off = add nsw i32 %i.066, -30 %cmp12 = icmp ult i32 %i.0.off, 10 %or.cond67 = select i1 %cmp4, i1 true, i1 %cmp12 br i1 %or.cond67, label %for.inc.sink.split, label %if.else15 if.else15: ; preds = %if.else %rem16 = urem i32 %i.066, 100 %1 = add nsw i32 %rem16, -30 %or.cond = icmp ult i32 %1, 10 br i1 %or.cond, label %for.inc.sink.split, label %if.else22 if.else22: ; preds = %if.else15 %rem23 = urem i32 %i.066, 1000 %2 = add nsw i32 %rem23, -300 %or.cond63 = icmp ult i32 %2, 100 br i1 %or.cond63, label %for.inc.sink.split, label %if.else30 if.else30: ; preds = %if.else22 %rem31 = urem i32 %i.066, 10000 %3 = add nsw i32 %rem31, -3000 %or.cond64 = icmp ult i32 %3, 1000 br i1 %or.cond64, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %if.else30, %if.else22, %if.else15, %for.body %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.066) br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else30 %inc = add nuw nsw i32 %i.066, 1 %4 = load i32, ptr %num, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.066, %4 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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"}
#include <stdio.h> #define TRUE 1 #define FALSE 0 int has3(int x) { while(x) { if(x%10 ==3) return TRUE; x /= 10; } return FALSE; } void call(int n) { int x; for(x=1;x<=n;x++) { if(x%3==0 || has3(x)) { printf(" %d",x); } } printf("\n"); } int main(void) { int n; scanf("%d",&n); call(n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230323/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @has3(i32 noundef %x) local_unnamed_addr #0 { entry: %tobool.not3 = icmp eq i32 %x, 0 br i1 %tobool.not3, label %return, label %while.body while.body: ; preds = %entry, %if.end %x.addr.04 = phi i32 [ %div, %if.end ], [ %x, %entry ] %rem = srem i32 %x.addr.04, 10 %div = sdiv i32 %x.addr.04, 10 %cmp = icmp eq i32 %rem, 3 br i1 %cmp, label %return, label %if.end if.end: ; preds = %while.body %x.addr.04.off = add i32 %x.addr.04, 9 %tobool.not = icmp ult i32 %x.addr.04.off, 19 br i1 %tobool.not, label %return, label %while.body, !llvm.loop !5 return: ; preds = %while.body, %if.end, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end ], [ 1, %while.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @call(i32 noundef %n) local_unnamed_addr #1 { entry: %cmp.not10 = icmp slt i32 %n, 1 br i1 %cmp.not10, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %x.011 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %rem = urem i32 %x.011, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.then, label %while.body.i while.body.i: ; preds = %for.body, %if.end.i %x.addr.04.i = phi i32 [ %div.i, %if.end.i ], [ %x.011, %for.body ] %rem.i = srem i32 %x.addr.04.i, 10 %div.i = sdiv i32 %x.addr.04.i, 10 %cmp.i = icmp eq i32 %rem.i, 3 br i1 %cmp.i, label %if.then, label %if.end.i if.end.i: ; preds = %while.body.i %x.addr.04.off.i = add i32 %x.addr.04.i, 9 %tobool.not.i = icmp ult i32 %x.addr.04.off.i, 19 br i1 %tobool.not.i, label %for.inc, label %while.body.i, !llvm.loop !5 if.then: ; preds = %while.body.i, %for.body %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %x.011) br label %for.inc for.inc: ; preds = %if.end.i, %if.then %inc = add nuw i32 %x.011, 1 %exitcond.not = icmp eq i32 %x.011, %n br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !7 for.end: ; preds = %for.inc, %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) #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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; 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) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !8 %cmp.not10.i = icmp slt i32 %0, 1 br i1 %cmp.not10.i, label %call.exit, label %for.body.i for.body.i: ; preds = %entry, %for.inc.i %x.011.i = phi i32 [ %inc.i, %for.inc.i ], [ 1, %entry ] %rem.i = urem i32 %x.011.i, 3 %cmp1.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.i, label %if.then.i, label %while.body.i.i while.body.i.i: ; preds = %for.body.i, %if.end.i.i %x.addr.04.i.i = phi i32 [ %div.i.i, %if.end.i.i ], [ %x.011.i, %for.body.i ] %rem.i.i = srem i32 %x.addr.04.i.i, 10 %div.i.i = sdiv i32 %x.addr.04.i.i, 10 %cmp.i.i = icmp eq i32 %rem.i.i, 3 br i1 %cmp.i.i, label %if.then.i, label %if.end.i.i if.end.i.i: ; preds = %while.body.i.i %x.addr.04.off.i.i = add i32 %x.addr.04.i.i, 9 %tobool.not.i.i = icmp ult i32 %x.addr.04.off.i.i, 19 br i1 %tobool.not.i.i, label %for.inc.i, label %while.body.i.i, !llvm.loop !5 if.then.i: ; preds = %while.body.i.i, %for.body.i %call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %x.011.i) br label %for.inc.i for.inc.i: ; preds = %if.end.i.i, %if.then.i %inc.i = add nuw i32 %x.011.i, 1 %exitcond.not.i = icmp eq i32 %x.011.i, %0 br i1 %exitcond.not.i, label %call.exit, label %for.body.i, !llvm.loop !7 call.exit: ; preds = %for.inc.i, %entry %putchar.i = call i32 @putchar(i32 10) 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 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"int", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int i, n; scanf("%d", &n); for (i = 1; i <= n; i++) { int x = i; if (x % 3 == 0) { printf(" %d", i); } else { while (x) { if (x % 10 == 3) { printf(" %d", i); break; } x /= 10; } } } printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230381/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230381/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %cmp.not17 = icmp slt i32 %0, 1 br i1 %cmp.not17, label %for.end, label %for.body for.body: ; preds = %entry, %if.end7 %i.018 = phi i32 [ %inc, %if.end7 ], [ 1, %entry ] %rem = urem i32 %i.018, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.end7.sink.split, label %while.body while.body: ; preds = %for.body, %if.end %x.016 = phi i32 [ %div, %if.end ], [ %i.018, %for.body ] %rem3 = srem i32 %x.016, 10 %div = sdiv i32 %x.016, 10 %cmp4 = icmp eq i32 %rem3, 3 br i1 %cmp4, label %if.end7.sink.split, label %if.end if.end: ; preds = %while.body %x.016.off = add i32 %x.016, 9 %tobool.not = icmp ult i32 %x.016.off, 19 br i1 %tobool.not, label %if.end7, label %while.body, !llvm.loop !9 if.end7.sink.split: ; preds = %while.body, %for.body %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.018) br label %if.end7 if.end7: ; preds = %if.end, %if.end7.sink.split %inc = add nuw nsw i32 %i.018, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.018, %1 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %if.end7, %entry %putchar = call i32 @putchar(i32 10) 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}
#include <stdio.h> int main() { int n ; scanf("%d",&n) ; int x ; int y ; for( x=1 ; x<=n ; x++ ){ if( x % 3 == 0){ printf(" %d", x) ; }else{ y = x; while( y != 0 ){ if( y % 10 == 3){ printf(" %d",x) ; y = 0 ; }else{ y = y / 10 ; } } } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230475/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230475/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %cmp.not19 = icmp slt i32 %0, 1 br i1 %cmp.not19, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %x.020 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %rem = urem i32 %x.020, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.inc.sink.split, label %while.body while.body: ; preds = %for.body, %if.end %y.018 = phi i32 [ %div, %if.end ], [ %x.020, %for.body ] %rem4 = srem i32 %y.018, 10 %div = sdiv i32 %y.018, 10 %cmp5 = icmp eq i32 %rem4, 3 br i1 %cmp5, label %for.inc.sink.split, label %if.end if.end: ; preds = %while.body %y.018.off = add i32 %y.018, 9 %cmp3.not = icmp ult i32 %y.018.off, 19 br i1 %cmp3.not, label %for.inc, label %while.body, !llvm.loop !9 for.inc.sink.split: ; preds = %while.body, %for.body %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.020) br label %for.inc for.inc: ; preds = %if.end, %for.inc.sink.split %inc = add nuw nsw i32 %x.020, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %x.020, %1 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) 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}
#include<stdio.h> int main(void){ int x; int jyuu; int hyaku; int sen; scanf("%d",&x); for(int i=1;i<=x;i++){ sen=i/1000; hyaku=(i-sen*1000)/100; jyuu=((i-sen*1000)-hyaku*100)/10; if(i%3==0||i%10==3||i%100==3||i%1000==3){ printf(" %d",i); } else if(sen==3||hyaku==3||jyuu==3){ printf(" %d",i); } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230525/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230525/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp.not44 = icmp slt i32 %0, 1 br i1 %cmp.not44, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 for.body: ; preds = %entry, %for.inc %i.045 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %1 = urem i32 %i.045, 1000 %rem = urem i32 %i.045, 3 %cmp7 = icmp eq i32 %rem, 0 %rem8 = urem i32 %i.045, 10 %cmp9 = icmp eq i32 %rem8, 3 %or.cond41 = or i1 %cmp7, %cmp9 %rem11 = urem i32 %i.045, 100 %cmp12 = icmp eq i32 %rem11, 3 %or.cond42 = or i1 %cmp12, %or.cond41 %cmp15 = icmp eq i32 %1, 3 %or.cond43 = or i1 %cmp15, %or.cond42 br i1 %or.cond43, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %.lhs.trunc = trunc i32 %1 to i16 %2 = urem i16 %.lhs.trunc, 100 %.zext = zext i16 %2 to i32 %i.0.off = add nsw i32 %i.045, -3000 %cmp17 = icmp ult i32 %i.0.off, 1000 %.off = add nsw i32 %1, -300 %cmp19 = icmp ult i32 %.off, 100 %or.cond = select i1 %cmp17, i1 true, i1 %cmp19 %.off40 = add nsw i32 %.zext, -30 %cmp21 = icmp ult i32 %.off40, 10 %or.cond26 = select i1 %or.cond, i1 true, i1 %cmp21 br i1 %or.cond26, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.045) br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %inc = add i32 %i.045, 1 %3 = load i32, ptr %x, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %inc, %3 br i1 %cmp.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: 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"}
#include<stdio.h> int main(void){ int n,i,x; scanf("%d",&n); for(i=1;i<=n;i++){ x=i; if ( x % 3 == 0 ){ printf(" %d",i); }else{ do{ if ( x % 10 == 3 ){ printf(" %d",i); x=0; } x /= 10; }while( x ); } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230569/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %cmp.not20 = icmp slt i32 %0, 1 br i1 %cmp.not20, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %i.021 = phi i32 [ %inc, %for.inc ], [ 1, %entry ] %rem = urem i32 %i.021, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.inc.sink.split, label %do.body do.body: ; preds = %for.body, %if.end %x.0 = phi i32 [ %div, %if.end ], [ %i.021, %for.body ] %rem3 = srem i32 %x.0, 10 %div = sdiv i32 %x.0, 10 %cmp4 = icmp eq i32 %rem3, 3 br i1 %cmp4, label %for.inc.sink.split, label %if.end if.end: ; preds = %do.body %x.1.off = add i32 %x.0, 9 %tobool.not = icmp ult i32 %x.1.off, 19 br i1 %tobool.not, label %for.inc, label %do.body, !llvm.loop !9 for.inc.sink.split: ; preds = %do.body, %for.body %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.021) br label %for.inc for.inc: ; preds = %if.end, %for.inc.sink.split %inc = add nuw nsw i32 %i.021, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.021, %1 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) 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}
#include<stdio.h> int main(void) { int A,B; scanf("%d%d",&A,&B); if(B%A==0) printf("%d\n",A+B); else printf("%d\n",B-A); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230619/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230619/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int A, B; scanf("%d%d",&A, &B); if(B%A==0) { printf("%d",A+B); } else { printf("%d",B-A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230662/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230662/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(b%a==0){printf("%d",a+b);} else{printf("%d",b-a);} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230705/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230705/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int A, B; scanf("%d %d", &A, &B); if (B % A == 0) { printf("%d", A + B); } else { printf("%d", B - A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230749/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); if(b/a*a==b){ printf("%d",a+b); }else{ printf("%d",b-a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230792/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230792/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = srem i32 %.fr, %1 %cmp = icmp eq i32 %2, 0 %3 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %3 %sub.sink = add i32 %.fr, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b; scanf("%d",&a); scanf("%d",&b); if(b%a==0){ printf("%d",a+b); }else{ printf("%d",b-a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230842/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230842/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int A,B; scanf("%d %d",&A,&B); if(B%A==0) { printf("%d\n",A+B); } else { printf("%d\n",B-A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230893/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230893/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %A, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
//set many funcs template //Ver.20180717 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} int sankaku(int x){return ((1+x)*x)/2;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} void shuffledget(int x[],int n){ srand(time(0)); int i,b[524288],p,c; for(i=0;i<n;i++){ b[i]=i; } for(i=n;i>=1;i--){ p=rand()%i; c=b[i-1];b[i-1]=b[p];b[p]=c; } for(i=0;i<n;i++){ scanf("%d",&x[b[i]]); } } int dx4[4]={1,-1,0,0}; int dy4[4]={0,0,1,-1}; int dx8[8]={-1,-1,-1,0,0,1,1,1}; int dy8[8]={-1,0,1,-1,1,-1,0,1}; int search(int x,int a[],int n){ int st=0,fi=n-1,te; while(st<=fi){ te=(st+fi)/2; if(a[te]<x){st=te+1;}else{fi=te-1;} } return st; } typedef struct{ int val; int node; }sd; int sdsortfnc(const void *a,const void *b){ if(((sd*)a)->val < ((sd*)b)->val){return -1;} if(((sd*)a)->val > ((sd*)b)->val){return 1;} return 0; } int main(void){ int i,j,n,m,k,a,b,c,h,w,r=0,l,t; scanf("%d%d",&n,&k); if(k%n==0){ printf("%d\n",n+k); } else{ printf("%d\n",k-n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230936/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230936/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16 @dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16 @dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.05, 10 %add = add nsw i32 %r.06, %rem %div = sdiv i32 %x.addr.05, 10 %x.addr.05.off = add i32 %x.addr.05, 9 %tobool.not = icmp ult i32 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i32 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.06, %b %add = add nsw i32 %rem, %r.07 %div = sdiv i32 %x.addr.06, %b %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i32 %x, 1 %mul = mul nsw i32 %add, %x %div = sdiv i32 %mul, 2 ret i32 %div } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.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.end, label %for.body.epil, !llvm.loop !19 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.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.body: ; preds = %for.body, %for.body.preheader.new %r.05 = 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 %r.05, %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.05.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.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.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.end, label %for.body.epil, !llvm.loop !22 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.05, 10 %add = add nsw i64 %r.06, %rem %div = sdiv i64 %x.addr.05, 10 %x.addr.05.off = add i64 %x.addr.05, 9 %tobool.not = icmp ult i64 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.06, %b %add = add nsw i64 %rem, %r.07 %div = sdiv i64 %x.addr.06, %b %tobool.not = icmp eq i64 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i64 %x, 1 %mul = mul nsw i64 %add, %x %div = sdiv i64 %mul, 2 ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #13 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #13 ret i32 %call } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 { entry: %b = alloca [524288 x i32], align 16 %call = tail call i64 @time(ptr noundef null) #14 %conv = trunc i64 %call to i32 tail call void @srand(i32 noundef %conv) #14 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #14 %cmp44 = icmp sgt i32 %n, 0 br i1 %cmp44, label %for.body.preheader, label %for.end29 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.preheader61, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61 for.body.preheader61: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond2.preheader: ; preds = %for.body, %middle.block br i1 %cmp44, label %for.body5.preheader, label %for.end29 for.body5.preheader: ; preds = %for.cond2.preheader %3 = zext i32 %n to i64 br label %for.body5 for.body: ; preds = %for.body.preheader61, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !25 %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.cond2.preheader, label %for.body, !llvm.loop !34 for.cond18.preheader: ; preds = %for.body5 br i1 %cmp44, label %for.body21.preheader, label %for.end29 for.body21.preheader: ; preds = %for.cond18.preheader %wide.trip.count58 = zext i32 %n to i64 br label %for.body21 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ] %call6 = tail call i32 @rand() #14 %5 = trunc i64 %indvars.iv51 to i32 %rem = srem i32 %call6, %5 %indvars.iv.next52 = add nsw i64 %indvars.iv51, -1 %idxprom7 = and i64 %indvars.iv.next52, 4294967295 %arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !25 %idxprom9 = sext i32 %rem to i64 %arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !25 store i32 %7, ptr %arrayidx8, align 4, !tbaa !25 store i32 %6, ptr %arrayidx10, align 4, !tbaa !25 %cmp3 = icmp ugt i64 %indvars.iv51, 1 br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !35 for.body21: ; preds = %for.body21.preheader, %for.body21 %indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ] %arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54 %8 = load i32, ptr %arrayidx23, align 4, !tbaa !25 %idxprom24 = sext i32 %8 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24 %call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25) %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58 br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !36 for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #14 ret void } ; Function Attrs: nounwind declare void @srand(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i64 @time(ptr noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 { entry: %cmp.not9 = icmp slt i32 %n, 1 br i1 %cmp.not9, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ] %fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ] %add = add nsw i32 %st.011, %fi.010 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !25 %cmp1 = icmp slt i32 %0, %x %add2 = add nsw i32 %div, 1 %sub3 = add nsw i32 %div, -1 %fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3 %st.1 = select i1 %cmp1, i32 %add2, i32 %st.011 %cmp.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !37 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !38 %1 = load i32, ptr %b, align 4, !tbaa !38 %cmp = icmp slt i32 %0, %1 %cmp4 = icmp sgt i32 %0, %1 %. = zext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #11 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #14 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !25 %1 = load i32, ptr %n, align 4, !tbaa !25 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %sub.sink.p = select i1 %cmp, i32 %1, i32 %2 %sub.sink = add i32 %0, %sub.sink.p %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #14 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #12 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nofree 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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nounwind willreturn memory(read) } attributes #14 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !6} !22 = distinct !{!22, !20} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = !{!26, !26, i64 0} !26 = !{!"int", !27, i64 0} !27 = !{!"omnipotent char", !28, i64 0} !28 = !{!"Simple C/C++ TBAA"} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !27, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !27, i64 0} !33 = distinct !{!33, !6, !9, !10} !34 = distinct !{!34, !6, !10, !9} !35 = distinct !{!35, !6} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = !{!39, !26, i64 0} !39 = !{!"", !26, i64 0, !26, i64 4}
#include<stdio.h> int main() { int a,b,c,d; int x,y; int arr[1002],m[1000]; int i,j,k,l; for(i=0;i<1001;i++) arr[i]=0; for(i=2;i<1001;i++) if(arr[i]==0) { for(j=2;i*j<1001;i++) { arr[i*j]=1; } } i=2;j=0; for(;i<1001;i++) if(arr[i]==0) { m[j]=i; j++; } scanf("%d%d%d%d",&a,&b,&c,&d); if((a*d)>(c*b)) { x=(a*d)-(b*c); y=a*d; } else { x=(b*c)-(d*a); y=c*b; } for(i=0;i<j;i++) while((x%m[i]==0) && (y%m[i]==0)) { x=x/m[i]; y=y/m[i]; } printf("%d/%d\n",x,y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23098/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23098/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d/%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %arr = alloca [1002 x i32], align 16 %m = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4008, ptr nonnull %arr) #5 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %m) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %arr, i8 0, i64 4004, i1 false), !tbaa !5 br label %for.body3 for.body3: ; preds = %entry, %for.inc16 %i.193 = phi i32 [ %inc17, %for.inc16 ], [ 2, %entry ] %idxprom4 = sext i32 %i.193 to i64 %arrayidx5 = getelementptr inbounds [1002 x i32], ptr %arr, i64 0, i64 %idxprom4 %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %0, 0 %cmp891 = icmp slt i32 %i.193, 501 %or.cond = and i1 %cmp6, %cmp891 br i1 %or.cond, label %for.body9, label %for.inc16 for.body9: ; preds = %for.body3, %for.body9 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body9 ], [ %idxprom4, %for.body3 ] %1 = trunc i64 %indvars.iv to i32 %mul = shl nsw i32 %1, 1 %idxprom11 = sext i32 %mul to i64 %arrayidx12 = getelementptr inbounds [1002 x i32], ptr %arr, i64 0, i64 %idxprom11 store i32 1, ptr %arrayidx12, align 8, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %2 = and i64 %indvars.iv.next, 4294967295 %exitcond.not = icmp eq i64 %2, 501 br i1 %exitcond.not, label %for.inc16, label %for.body9, !llvm.loop !9 for.inc16: ; preds = %for.body9, %for.body3 %i.3 = phi i32 [ %i.193, %for.body3 ], [ 501, %for.body9 ] %inc17 = add nsw i32 %i.3, 1 %cmp2 = icmp slt i32 %i.3, 1000 br i1 %cmp2, label %for.body3, label %for.body21, !llvm.loop !11 for.body21: ; preds = %for.inc16, %for.inc30.1 %indvars.iv112 = phi i64 [ %indvars.iv.next113.1, %for.inc30.1 ], [ 2, %for.inc16 ] %j.095 = phi i32 [ %j.1.1, %for.inc30.1 ], [ 0, %for.inc16 ] %arrayidx23 = getelementptr inbounds [1002 x i32], ptr %arr, i64 0, i64 %indvars.iv112 %3 = load i32, ptr %arrayidx23, align 8, !tbaa !5 %cmp24 = icmp eq i32 %3, 0 br i1 %cmp24, label %if.then25, label %for.inc30 if.then25: ; preds = %for.body21 %idxprom26 = sext i32 %j.095 to i64 %arrayidx27 = getelementptr inbounds [1000 x i32], ptr %m, i64 0, i64 %idxprom26 %4 = trunc i64 %indvars.iv112 to i32 store i32 %4, ptr %arrayidx27, align 4, !tbaa !5 %inc28 = add nsw i32 %j.095, 1 br label %for.inc30 for.inc30: ; preds = %for.body21, %if.then25 %j.1 = phi i32 [ %inc28, %if.then25 ], [ %j.095, %for.body21 ] %indvars.iv.next113 = or i64 %indvars.iv112, 1 %exitcond115.not = icmp eq i64 %indvars.iv.next113, 1001 br i1 %exitcond115.not, label %for.end32, label %for.body21.1, !llvm.loop !12 for.body21.1: ; preds = %for.inc30 %arrayidx23.1 = getelementptr inbounds [1002 x i32], ptr %arr, i64 0, i64 %indvars.iv.next113 %5 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %cmp24.1 = icmp eq i32 %5, 0 br i1 %cmp24.1, label %if.then25.1, label %for.inc30.1 if.then25.1: ; preds = %for.body21.1 %idxprom26.1 = sext i32 %j.1 to i64 %arrayidx27.1 = getelementptr inbounds [1000 x i32], ptr %m, i64 0, i64 %idxprom26.1 %6 = trunc i64 %indvars.iv.next113 to i32 store i32 %6, ptr %arrayidx27.1, align 4, !tbaa !5 %inc28.1 = add nsw i32 %j.1, 1 br label %for.inc30.1 for.inc30.1: ; preds = %if.then25.1, %for.body21.1 %j.1.1 = phi i32 [ %inc28.1, %if.then25.1 ], [ %j.1, %for.body21.1 ] %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2 br label %for.body21 for.end32: ; preds = %for.inc30 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %7 = load i32, ptr %a, align 4, !tbaa !5 %8 = load i32, ptr %d, align 4, !tbaa !5 %mul33 = mul nsw i32 %8, %7 %9 = load i32, ptr %c, align 4, !tbaa !5 %10 = load i32, ptr %b, align 4, !tbaa !5 %mul34 = mul nsw i32 %10, %9 %sub = sub nsw i32 %mul33, %mul34 %y.0 = call i32 @llvm.smax.i32(i32 %mul33, i32 %mul34) %x.0 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %cmp46104 = icmp sgt i32 %j.1, 0 br i1 %cmp46104, label %while.cond.preheader.preheader, label %for.end62 while.cond.preheader.preheader: ; preds = %for.end32 %wide.trip.count = zext i32 %j.1 to i64 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.preheader, %for.inc60 %indvars.iv116 = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next117, %for.inc60 ] %x.1107 = phi i32 [ %x.0, %while.cond.preheader.preheader ], [ %x.2.lcssa, %for.inc60 ] %y.1106 = phi i32 [ %y.0, %while.cond.preheader.preheader ], [ %y.2.lcssa, %for.inc60 ] %arrayidx49 = getelementptr inbounds [1000 x i32], ptr %m, i64 0, i64 %indvars.iv116 %11 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %rem96 = srem i32 %x.1107, %11 %cmp5097 = icmp eq i32 %rem96, 0 br i1 %cmp5097, label %land.rhs, label %for.inc60 land.rhs: ; preds = %while.cond.preheader, %while.body %x.299 = phi i32 [ %div, %while.body ], [ %x.1107, %while.cond.preheader ] %y.298 = phi i32 [ %div59, %while.body ], [ %y.1106, %while.cond.preheader ] %rem53 = srem i32 %y.298, %11 %div59 = sdiv i32 %y.298, %11 %cmp54 = icmp eq i32 %rem53, 0 br i1 %cmp54, label %while.body, label %for.inc60 while.body: ; preds = %land.rhs %div = sdiv i32 %x.299, %11 %rem = srem i32 %div, %11 %cmp50 = icmp eq i32 %rem, 0 br i1 %cmp50, label %land.rhs, label %for.inc60, !llvm.loop !13 for.inc60: ; preds = %while.body, %land.rhs, %while.cond.preheader %y.2.lcssa = phi i32 [ %y.1106, %while.cond.preheader ], [ %y.298, %land.rhs ], [ %div59, %while.body ] %x.2.lcssa = phi i32 [ %x.1107, %while.cond.preheader ], [ %x.299, %land.rhs ], [ %div, %while.body ] %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1 %exitcond119.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count br i1 %exitcond119.not, label %for.end62, label %while.cond.preheader, !llvm.loop !14 for.end62: ; preds = %for.inc60, %for.end32 %y.1.lcssa = phi i32 [ %y.0, %for.end32 ], [ %y.2.lcssa, %for.inc60 ] %x.1.lcssa = phi i32 [ %x.0, %for.end32 ], [ %x.2.lcssa, %for.inc60 ] %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1.lcssa, i32 noundef %y.1.lcssa) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4008, ptr nonnull %arr) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(void) { int a, b; int c; scanf("%d %d", &a, &b); if(b%a==0) c=a+b; else c=b-a; printf("%d\n", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231021/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231021/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %2 = sub i32 0, %1 %c.0.p = select i1 %cmp, i32 %1, i32 %2 %c.0 = add i32 %c.0.p, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> //累乗(power)a^n(mod10^9+7) long long power(long long a,long long n){ long long count=a,sum=1; while(n>0){ if(n%2==1) sum*=count; count*=count; count%=1000000007; sum%=1000000007; n/=2; } return sum; } //nCr(mod10^9+7) long long int comb(long long int n,long long int r){ long long x=1,y=1,i; for(i=0;i<r;i++){ x*=n-i; y*=r-i; x%=1000000007; y%=1000000007; } y=power(y,1000000005); return (x*y)%1000000007; } int main(){ long long n,a,b,count; scanf("%lld%lld%lld",&n,&a,&b); count=power(2,n)-comb(n,a)-comb(n,b)-1; while(count<0){ count+=1000000007; } printf("%lld\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231072/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231072/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @power(i64 noundef %a, i64 noundef %n) local_unnamed_addr #0 { entry: %cmp13 = icmp sgt i64 %n, 0 br i1 %cmp13, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.016 = phi i64 [ %rem4, %while.body ], [ 1, %entry ] %count.015 = phi i64 [ %rem3, %while.body ], [ %a, %entry ] %n.addr.014 = phi i64 [ %div12, %while.body ], [ %n, %entry ] %rem = and i64 %n.addr.014, 1 %cmp1.not = icmp eq i64 %rem, 0 %mul = select i1 %cmp1.not, i64 1, i64 %count.015 %spec.select = mul nsw i64 %mul, %sum.016 %mul2 = mul nsw i64 %count.015, %count.015 %rem3 = urem i64 %mul2, 1000000007 %rem4 = srem i64 %spec.select, 1000000007 %div12 = lshr i64 %n.addr.014, 1 %cmp.not = icmp ult i64 %n.addr.014, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i64 [ 1, %entry ], [ %rem4, %while.body ] ret i64 %sum.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(none) uwtable define dso_local i64 @comb(i64 noundef %n, i64 noundef %r) local_unnamed_addr #0 { entry: %cmp15 = icmp sgt i64 %r, 0 br i1 %cmp15, label %for.body.preheader, label %while.body.i.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %r, 1 %0 = icmp eq i64 %r, 1 br i1 %0, label %while.body.i.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %r, -2 br label %for.body while.body.i.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.1, %for.body ] %rem3.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem3.1, %for.body ] %i.018.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.body ] %y.017.unr = phi i64 [ 1, %for.body.preheader ], [ %rem3.1, %for.body ] %x.016.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body.i.preheader, label %for.body.epil for.body.epil: ; preds = %while.body.i.preheader.loopexit.unr-lcssa %sub.epil = sub nsw i64 %n, %i.018.unr %mul.epil = mul nsw i64 %sub.epil, %x.016.unr %sub1.epil = sub nsw i64 %r, %i.018.unr %mul2.epil = mul nsw i64 %sub1.epil, %y.017.unr %rem.epil = srem i64 %mul.epil, 1000000007 %rem3.epil = srem i64 %mul2.epil, 1000000007 br label %while.body.i.preheader while.body.i.preheader: ; preds = %for.body.epil, %while.body.i.preheader.loopexit.unr-lcssa, %entry %x.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %while.body.i.preheader.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ] %y.0.lcssa = phi i64 [ 1, %entry ], [ %rem3.lcssa.ph, %while.body.i.preheader.loopexit.unr-lcssa ], [ %rem3.epil, %for.body.epil ] br label %while.body.i for.body: ; preds = %for.body, %for.body.preheader.new %i.018 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.body ] %y.017 = phi i64 [ 1, %for.body.preheader.new ], [ %rem3.1, %for.body ] %x.016 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %sub = sub nsw i64 %n, %i.018 %mul = mul nsw i64 %sub, %x.016 %sub1 = sub nsw i64 %r, %i.018 %mul2 = mul nsw i64 %sub1, %y.017 %rem = srem i64 %mul, 1000000007 %rem3 = srem i64 %mul2, 1000000007 %inc = or i64 %i.018, 1 %sub.1 = sub nsw i64 %n, %inc %mul.1 = mul nsw i64 %sub.1, %rem %sub1.1 = sub nsw i64 %r, %inc %mul2.1 = mul nsw i64 %sub1.1, %rem3 %rem.1 = srem i64 %mul.1, 1000000007 %rem3.1 = srem i64 %mul2.1, 1000000007 %inc.1 = add nuw nsw i64 %i.018, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.body.i.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 while.body.i: ; preds = %while.body.i.preheader, %while.body.i %sum.016.i = phi i64 [ %rem4.i, %while.body.i ], [ 1, %while.body.i.preheader ] %count.015.i = phi i64 [ %rem3.i, %while.body.i ], [ %y.0.lcssa, %while.body.i.preheader ] %n.addr.014.i = phi i64 [ %div12.i, %while.body.i ], [ 1000000005, %while.body.i.preheader ] %rem.i = and i64 %n.addr.014.i, 1 %cmp1.not.i = icmp eq i64 %rem.i, 0 %mul.i = select i1 %cmp1.not.i, i64 1, i64 %count.015.i %spec.select.i = mul nsw i64 %mul.i, %sum.016.i %mul2.i = mul nsw i64 %count.015.i, %count.015.i %rem3.i = urem i64 %mul2.i, 1000000007 %rem4.i = srem i64 %spec.select.i, 1000000007 %div12.i = lshr i64 %n.addr.014.i, 1 %cmp.not.i = icmp ult i64 %n.addr.014.i, 2 br i1 %cmp.not.i, label %power.exit, label %while.body.i, !llvm.loop !5 power.exit: ; preds = %while.body.i %mul4 = mul nsw i64 %rem4.i, %x.0.lcssa %rem5 = srem i64 %mul4, 1000000007 ret i64 %rem5 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %n, align 8, !tbaa !8 %cmp13.i = icmp sgt i64 %0, 0 br i1 %cmp13.i, label %while.body.i, label %power.exit while.body.i: ; preds = %entry, %while.body.i %sum.016.i = phi i64 [ %rem4.i, %while.body.i ], [ 1, %entry ] %count.015.i = phi i64 [ %rem3.i, %while.body.i ], [ 2, %entry ] %n.addr.014.i = phi i64 [ %div12.i, %while.body.i ], [ %0, %entry ] %rem.i = and i64 %n.addr.014.i, 1 %cmp1.not.i = icmp eq i64 %rem.i, 0 %mul.i = select i1 %cmp1.not.i, i64 1, i64 %count.015.i %spec.select.i = mul nsw i64 %mul.i, %sum.016.i %mul2.i = mul nuw nsw i64 %count.015.i, %count.015.i %rem3.i = urem i64 %mul2.i, 1000000007 %rem4.i = srem i64 %spec.select.i, 1000000007 %div12.i = lshr i64 %n.addr.014.i, 1 %cmp.not.i = icmp ult i64 %n.addr.014.i, 2 br i1 %cmp.not.i, label %power.exit, label %while.body.i, !llvm.loop !5 power.exit: ; preds = %while.body.i, %entry %sum.0.lcssa.i = phi i64 [ 1, %entry ], [ %rem4.i, %while.body.i ] %1 = load i64, ptr %a, align 8, !tbaa !8 %cmp15.i = icmp sgt i64 %1, 0 br i1 %cmp15.i, label %for.body.i.preheader, label %while.body.i.preheader.i for.body.i.preheader: ; preds = %power.exit %xtraiter = and i64 %1, 1 %2 = icmp eq i64 %1, 1 br i1 %2, label %while.body.i.preheader.i.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %1, -2 br label %for.body.i while.body.i.preheader.i.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %rem.i11.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %rem.i11.1, %for.body.i ] %rem3.i12.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %rem3.i12.1, %for.body.i ] %i.018.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %y.017.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %rem3.i12.1, %for.body.i ] %x.016.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %rem.i11.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body.i.preheader.i, label %for.body.i.epil for.body.i.epil: ; preds = %while.body.i.preheader.i.loopexit.unr-lcssa %sub.i.epil = sub nsw i64 %0, %i.018.i.unr %mul.i9.epil = mul nsw i64 %x.016.i.unr, %sub.i.epil %sub1.i.epil = sub nsw i64 %1, %i.018.i.unr %mul2.i10.epil = mul nsw i64 %sub1.i.epil, %y.017.i.unr %rem.i11.epil = srem i64 %mul.i9.epil, 1000000007 %rem3.i12.epil = srem i64 %mul2.i10.epil, 1000000007 br label %while.body.i.preheader.i while.body.i.preheader.i: ; preds = %for.body.i.epil, %while.body.i.preheader.i.loopexit.unr-lcssa, %power.exit %x.0.lcssa.i = phi i64 [ 1, %power.exit ], [ %rem.i11.lcssa.ph, %while.body.i.preheader.i.loopexit.unr-lcssa ], [ %rem.i11.epil, %for.body.i.epil ] %y.0.lcssa.i = phi i64 [ 1, %power.exit ], [ %rem3.i12.lcssa.ph, %while.body.i.preheader.i.loopexit.unr-lcssa ], [ %rem3.i12.epil, %for.body.i.epil ] br label %while.body.i.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %i.018.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %y.017.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %rem3.i12.1, %for.body.i ] %x.016.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %rem.i11.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub nsw i64 %0, %i.018.i %mul.i9 = mul nsw i64 %x.016.i, %sub.i %sub1.i = sub nsw i64 %1, %i.018.i %mul2.i10 = mul nsw i64 %sub1.i, %y.017.i %rem.i11 = srem i64 %mul.i9, 1000000007 %rem3.i12 = srem i64 %mul2.i10, 1000000007 %inc.i = or i64 %i.018.i, 1 %sub.i.1 = sub nsw i64 %0, %inc.i %mul.i9.1 = mul nsw i64 %rem.i11, %sub.i.1 %sub1.i.1 = sub nsw i64 %1, %inc.i %mul2.i10.1 = mul nsw i64 %sub1.i.1, %rem3.i12 %rem.i11.1 = srem i64 %mul.i9.1, 1000000007 %rem3.i12.1 = srem i64 %mul2.i10.1, 1000000007 %inc.i.1 = add nuw nsw i64 %i.018.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.body.i.preheader.i.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 while.body.i.i: ; preds = %while.body.i.i, %while.body.i.preheader.i %sum.016.i.i = phi i64 [ %rem4.i.i, %while.body.i.i ], [ 1, %while.body.i.preheader.i ] %count.015.i.i = phi i64 [ %rem3.i.i, %while.body.i.i ], [ %y.0.lcssa.i, %while.body.i.preheader.i ] %n.addr.014.i.i = phi i64 [ %div12.i.i, %while.body.i.i ], [ 1000000005, %while.body.i.preheader.i ] %rem.i.i = and i64 %n.addr.014.i.i, 1 %cmp1.not.i.i = icmp eq i64 %rem.i.i, 0 %mul.i.i = select i1 %cmp1.not.i.i, i64 1, i64 %count.015.i.i %spec.select.i.i = mul nsw i64 %mul.i.i, %sum.016.i.i %mul2.i.i = mul nsw i64 %count.015.i.i, %count.015.i.i %rem3.i.i = urem i64 %mul2.i.i, 1000000007 %rem4.i.i = srem i64 %spec.select.i.i, 1000000007 %div12.i.i = lshr i64 %n.addr.014.i.i, 1 %cmp.not.i.i = icmp ult i64 %n.addr.014.i.i, 2 br i1 %cmp.not.i.i, label %comb.exit, label %while.body.i.i, !llvm.loop !5 comb.exit: ; preds = %while.body.i.i %3 = load i64, ptr %b, align 8, !tbaa !8 %cmp15.i13 = icmp sgt i64 %3, 0 br i1 %cmp15.i13, label %for.body.i32.preheader, label %while.body.i.preheader.i14 for.body.i32.preheader: ; preds = %comb.exit %xtraiter47 = and i64 %3, 1 %4 = icmp eq i64 %3, 1 br i1 %4, label %while.body.i.preheader.i14.loopexit.unr-lcssa, label %for.body.i32.preheader.new for.body.i32.preheader.new: ; preds = %for.body.i32.preheader %unroll_iter51 = and i64 %3, -2 br label %for.body.i32 while.body.i.preheader.i14.loopexit.unr-lcssa: ; preds = %for.body.i32, %for.body.i32.preheader %rem.i40.lcssa.ph = phi i64 [ undef, %for.body.i32.preheader ], [ %rem.i40.1, %for.body.i32 ] %rem3.i41.lcssa.ph = phi i64 [ undef, %for.body.i32.preheader ], [ %rem3.i41.1, %for.body.i32 ] %i.018.i33.unr = phi i64 [ 0, %for.body.i32.preheader ], [ %inc.i42.1, %for.body.i32 ] %y.017.i34.unr = phi i64 [ 1, %for.body.i32.preheader ], [ %rem3.i41.1, %for.body.i32 ] %x.016.i35.unr = phi i64 [ 1, %for.body.i32.preheader ], [ %rem.i40.1, %for.body.i32 ] %lcmp.mod48.not = icmp eq i64 %xtraiter47, 0 br i1 %lcmp.mod48.not, label %while.body.i.preheader.i14, label %for.body.i32.epil for.body.i32.epil: ; preds = %while.body.i.preheader.i14.loopexit.unr-lcssa %sub.i36.epil = sub nsw i64 %0, %i.018.i33.unr %mul.i37.epil = mul nsw i64 %x.016.i35.unr, %sub.i36.epil %sub1.i38.epil = sub nsw i64 %3, %i.018.i33.unr %mul2.i39.epil = mul nsw i64 %sub1.i38.epil, %y.017.i34.unr %rem.i40.epil = srem i64 %mul.i37.epil, 1000000007 %rem3.i41.epil = srem i64 %mul2.i39.epil, 1000000007 br label %while.body.i.preheader.i14 while.body.i.preheader.i14: ; preds = %for.body.i32.epil, %while.body.i.preheader.i14.loopexit.unr-lcssa, %comb.exit %x.0.lcssa.i15 = phi i64 [ 1, %comb.exit ], [ %rem.i40.lcssa.ph, %while.body.i.preheader.i14.loopexit.unr-lcssa ], [ %rem.i40.epil, %for.body.i32.epil ] %y.0.lcssa.i16 = phi i64 [ 1, %comb.exit ], [ %rem3.i41.lcssa.ph, %while.body.i.preheader.i14.loopexit.unr-lcssa ], [ %rem3.i41.epil, %for.body.i32.epil ] br label %while.body.i.i17 for.body.i32: ; preds = %for.body.i32, %for.body.i32.preheader.new %i.018.i33 = phi i64 [ 0, %for.body.i32.preheader.new ], [ %inc.i42.1, %for.body.i32 ] %y.017.i34 = phi i64 [ 1, %for.body.i32.preheader.new ], [ %rem3.i41.1, %for.body.i32 ] %x.016.i35 = phi i64 [ 1, %for.body.i32.preheader.new ], [ %rem.i40.1, %for.body.i32 ] %niter52 = phi i64 [ 0, %for.body.i32.preheader.new ], [ %niter52.next.1, %for.body.i32 ] %sub.i36 = sub nsw i64 %0, %i.018.i33 %mul.i37 = mul nsw i64 %x.016.i35, %sub.i36 %sub1.i38 = sub nsw i64 %3, %i.018.i33 %mul2.i39 = mul nsw i64 %sub1.i38, %y.017.i34 %rem.i40 = srem i64 %mul.i37, 1000000007 %rem3.i41 = srem i64 %mul2.i39, 1000000007 %inc.i42 = or i64 %i.018.i33, 1 %sub.i36.1 = sub nsw i64 %0, %inc.i42 %mul.i37.1 = mul nsw i64 %rem.i40, %sub.i36.1 %sub1.i38.1 = sub nsw i64 %3, %inc.i42 %mul2.i39.1 = mul nsw i64 %sub1.i38.1, %rem3.i41 %rem.i40.1 = srem i64 %mul.i37.1, 1000000007 %rem3.i41.1 = srem i64 %mul2.i39.1, 1000000007 %inc.i42.1 = add nuw nsw i64 %i.018.i33, 2 %niter52.next.1 = add i64 %niter52, 2 %niter52.ncmp.1 = icmp eq i64 %niter52.next.1, %unroll_iter51 br i1 %niter52.ncmp.1, label %while.body.i.preheader.i14.loopexit.unr-lcssa, label %for.body.i32, !llvm.loop !7 while.body.i.i17: ; preds = %while.body.i.i17, %while.body.i.preheader.i14 %sum.016.i.i18 = phi i64 [ %rem4.i.i27, %while.body.i.i17 ], [ 1, %while.body.i.preheader.i14 ] %count.015.i.i19 = phi i64 [ %rem3.i.i26, %while.body.i.i17 ], [ %y.0.lcssa.i16, %while.body.i.preheader.i14 ] %n.addr.014.i.i20 = phi i64 [ %div12.i.i28, %while.body.i.i17 ], [ 1000000005, %while.body.i.preheader.i14 ] %rem.i.i21 = and i64 %n.addr.014.i.i20, 1 %cmp1.not.i.i22 = icmp eq i64 %rem.i.i21, 0 %mul.i.i23 = select i1 %cmp1.not.i.i22, i64 1, i64 %count.015.i.i19 %spec.select.i.i24 = mul nsw i64 %mul.i.i23, %sum.016.i.i18 %mul2.i.i25 = mul nsw i64 %count.015.i.i19, %count.015.i.i19 %rem3.i.i26 = urem i64 %mul2.i.i25, 1000000007 %rem4.i.i27 = srem i64 %spec.select.i.i24, 1000000007 %div12.i.i28 = lshr i64 %n.addr.014.i.i20, 1 %cmp.not.i.i29 = icmp ult i64 %n.addr.014.i.i20, 2 br i1 %cmp.not.i.i29, label %comb.exit44, label %while.body.i.i17, !llvm.loop !5 comb.exit44: ; preds = %while.body.i.i17 %mul4.i = mul nsw i64 %rem4.i.i, %x.0.lcssa.i %rem5.i = srem i64 %mul4.i, 1000000007 %mul4.i30 = mul nsw i64 %rem4.i.i27, %x.0.lcssa.i15 %rem5.i31 = srem i64 %mul4.i30, 1000000007 %5 = add nsw i64 %rem5.i31, %rem5.i %6 = xor i64 %5, -1 %sub5 = add nsw i64 %sum.0.lcssa.i, %6 %smax = call i64 @llvm.smax.i64(i64 %sub5, i64 0) %7 = add i64 %5, %smax %8 = add i64 %7, 1 %9 = icmp ne i64 %8, %sum.0.lcssa.i %umin = zext i1 %9 to i64 %10 = add nsw i64 %sum.0.lcssa.i, %umin %11 = sub i64 %8, %10 %12 = udiv i64 %11, 1000000007 %13 = add nuw nsw i64 %12, %umin %14 = mul i64 %13, 1000000007 %15 = add i64 %sum.0.lcssa.i, %14 %16 = xor i64 %5, -1 %17 = add i64 %15, %16 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %17) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"long long", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.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<<60) #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);} 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; 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(2*1e6+10,mod); return is_fac?finv_arr[x]:inv_arr[x]; } ll m_f(ll x, ll mod){ make_mf(2*1e6+10,mod); return mf_arr[x]; } // ll mod_nck(ll n, ll k, ll mod){ return m_f[n]*finv_arr[k]%mod*finv_arr[n-k]%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);} char s[1151154]; ll dp[10005][105][2]; int main(void){ // fgets(s,sizeof(s),stdin); ll d,n; ll ans=0; scanf("%s",s); cin(&d); rep(i,0,s[0]-'0'){ dp[0][i%d][0]++; } dp[0][ (s[0]-'0') %d ][1]=1; n=strlen(s); rep(i,1,n){ rep(k,0,d){ ll p=s[i]-'0'; rep(j,0,p){ dp[i][(j+k)%d][0]+=dp[i-1][k][1]+dp[i-1][k][0]; dp[i][(j+k)%d][0]%=MOD1; } dp[i][(p+k)%d][0]+=dp[i-1][k][0]; dp[i][(p+k)%d][0]%=MOD1; dp[i][(p+k)%d][1]+=dp[i-1][k][1]; dp[i][(p+k)%d][1]%=MOD1; rep(j,p+1,10){ dp[i][(j+k)%d][0]+=dp[i-1][k][0]; dp[i][(j+k)%d][0]%=MOD1; } } } ans+=dp[n-1][0][1]; ans+=dp[n-1][0][0]; ans+=mod_MOD1(-1); printf("%lld\n",ans%MOD1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231137/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231137/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @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 @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 [3 x i8] c"%s\00", align 1 @s = dso_local global [1151154 x i8] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [10005 x [105 x [2 x i64]]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: 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 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %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 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %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 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %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 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %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(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) #19 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) #19 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) #19 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) #19 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) #19 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) #19 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) #19 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) #19 %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: %call = tail call i64 @makeinv(i64 noundef 2000010, 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 @is_mf_made, align 8, !tbaa !5 %inc.i = add nsw i64 %0, 1 store i64 %inc.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %0, 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) #19 %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 br label %for.body7.i for.body7.i: ; preds = %for.body7.i, %for.end.i %1 = 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 %1, i64 noundef %mul9.i) #19 %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, 2000010 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, %return.loopexit.i %2 = phi ptr [ %.pre, %entry ], [ %call10.i, %return.loopexit.i ] %arrayidx = getelementptr inbounds i64, ptr %2, i64 %x %3 = load i64, ptr %arrayidx, align 8, !tbaa !5 ret i64 %3 } ; 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) #20 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) #21 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) #21 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) #21 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) #20 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #21 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) #20 %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) #21 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) #21 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #21 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s) %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %0 = load i8, ptr @s, align 16, !tbaa !21 %conv = sext i8 %0 to i64 %sub = add nsw i64 %conv, -48 %cmp180 = icmp sgt i8 %0, 48 %.pre = load i64, ptr %d, align 8, !tbaa !5 br i1 %cmp180, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %conv, 1 %1 = icmp eq i8 %0, 49 br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %sub, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %i.0181.unr = phi i64 [ 0, %for.body.preheader ], [ %inc4.1, %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 %rem.epil = srem i64 %i.0181.unr, %.pre %arrayidx.epil = getelementptr inbounds [105 x [2 x i64]], ptr @dp, i64 0, i64 %rem.epil %2 = load i64, ptr %arrayidx.epil, align 16, !tbaa !5 %inc.epil = add nsw i64 %2, 1 store i64 %inc.epil, ptr %arrayidx.epil, align 16, !tbaa !5 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %rem8 = srem i64 %sub, %.pre %arrayidx10 = getelementptr inbounds [105 x [2 x i64]], ptr @dp, i64 0, i64 %rem8, i64 1 store i64 1, ptr %arrayidx10, align 8, !tbaa !5 %call11 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #20 %cmp14188 = icmp sgt i64 %call11, 1 %cmp19186 = icmp sgt i64 %.pre, 0 %or.cond = select i1 %cmp14188, i1 %cmp19186, i1 false br i1 %or.cond, label %for.cond18.preheader.us, label %for.cond.cleanup16 for.cond18.preheader.us: ; preds = %for.cond.cleanup, %for.cond18.for.cond.cleanup21_crit_edge.us %i12.0189.us = phi i64 [ %inc117.us, %for.cond18.for.cond.cleanup21_crit_edge.us ], [ 1, %for.cond.cleanup ] %arrayidx23.us = getelementptr inbounds [1151154 x i8], ptr @s, i64 0, i64 %i12.0189.us %3 = load i8, ptr %arrayidx23.us, align 1, !tbaa !21 %conv24.us = sext i8 %3 to i64 %sub25.us = add nsw i64 %conv24.us, -48 %cmp28182.us = icmp sgt i8 %3, 48 %sub32.us = add nsw i64 %i12.0189.us, -1 %add88.us = add nsw i64 %conv24.us, -47 %cmp90184.us = icmp slt i8 %3, 57 br label %for.body22.us for.body22.us: ; preds = %for.cond18.preheader.us, %for.cond.cleanup92.us %k.0187.us = phi i64 [ 0, %for.cond18.preheader.us ], [ %inc114.us, %for.cond.cleanup92.us ] br i1 %cmp28182.us, label %for.body31.lr.ph.us, label %for.body22.us.for.cond.cleanup30.us_crit_edge for.body22.us.for.cond.cleanup30.us_crit_edge: ; preds = %for.body22.us %arrayidx74.us.phi.trans.insert = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %sub32.us, i64 %k.0187.us, i64 1 %.pre195 = load i64, ptr %arrayidx74.us.phi.trans.insert, align 8, !tbaa !5 br label %for.cond.cleanup30.us for.cond.cleanup30.us: ; preds = %for.body31.us, %for.body22.us.for.cond.cleanup30.us_crit_edge %4 = phi i64 [ %.pre195, %for.body22.us.for.cond.cleanup30.us_crit_edge ], [ %.pre194, %for.body31.us ] %arrayidx57.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %sub32.us, i64 %k.0187.us %5 = load i64, ptr %arrayidx57.us, align 16, !tbaa !5 %add60.us = add nsw i64 %sub25.us, %k.0187.us %rem61.us = srem i64 %add60.us, %.pre %arrayidx62.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %i12.0189.us, i64 %rem61.us %6 = load i64, ptr %arrayidx62.us, align 16, !tbaa !5 %add64.us = add nsw i64 %6, %5 %rem70.us = srem i64 %add64.us, 1000000007 store i64 %rem70.us, ptr %arrayidx62.us, align 16, !tbaa !5 %arrayidx79.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %i12.0189.us, i64 %rem61.us, i64 1 %7 = load i64, ptr %arrayidx79.us, align 8, !tbaa !5 %add80.us = add nsw i64 %7, %4 %rem86.us = srem i64 %add80.us, 1000000007 store i64 %rem86.us, ptr %arrayidx79.us, align 8, !tbaa !5 br i1 %cmp90184.us, label %for.body93.us, label %for.cond.cleanup92.us for.cond.cleanup92.us: ; preds = %for.body93.us, %for.cond.cleanup30.us %inc114.us = add nuw nsw i64 %k.0187.us, 1 %exitcond192.not = icmp eq i64 %inc114.us, %.pre br i1 %exitcond192.not, label %for.cond18.for.cond.cleanup21_crit_edge.us, label %for.body22.us, !llvm.loop !45 for.body93.us: ; preds = %for.cond.cleanup30.us, %for.body93.us %j87.0185.us = phi i64 [ %inc111.us, %for.body93.us ], [ %add88.us, %for.cond.cleanup30.us ] %8 = load i64, ptr %arrayidx57.us, align 16, !tbaa !5 %add99.us = add nsw i64 %j87.0185.us, %k.0187.us %rem100.us = srem i64 %add99.us, %.pre %arrayidx101.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %i12.0189.us, i64 %rem100.us %9 = load i64, ptr %arrayidx101.us, align 16, !tbaa !5 %add103.us = add nsw i64 %9, %8 %rem109.us = srem i64 %add103.us, 1000000007 store i64 %rem109.us, ptr %arrayidx101.us, align 16, !tbaa !5 %inc111.us = add nsw i64 %j87.0185.us, 1 %cmp90.us = icmp slt i64 %j87.0185.us, 9 br i1 %cmp90.us, label %for.body93.us, label %for.cond.cleanup92.us, !llvm.loop !46 for.body31.us: ; preds = %for.body31.lr.ph.us, %for.body31.us %j.0183.us = phi i64 [ 0, %for.body31.lr.ph.us ], [ %inc53.us, %for.body31.us ] %10 = load i64, ptr %arrayidx34.us, align 16, !tbaa !5 %add.us = add nsw i64 %10, %.pre194 %add41.us = add nuw nsw i64 %j.0183.us, %k.0187.us %rem42.us = srem i64 %add41.us, %.pre %arrayidx43.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %i12.0189.us, i64 %rem42.us %11 = load i64, ptr %arrayidx43.us, align 16, !tbaa !5 %add45.us = add nsw i64 %add.us, %11 %rem51.us = srem i64 %add45.us, 1000000007 store i64 %rem51.us, ptr %arrayidx43.us, align 16, !tbaa !5 %inc53.us = add nuw nsw i64 %j.0183.us, 1 %exitcond191.not = icmp eq i64 %inc53.us, %sub25.us br i1 %exitcond191.not, label %for.cond.cleanup30.us, label %for.body31.us, !llvm.loop !47 for.body31.lr.ph.us: ; preds = %for.body22.us %arrayidx34.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %sub32.us, i64 %k.0187.us %arrayidx35.us = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %sub32.us, i64 %k.0187.us, i64 1 %.pre194 = load i64, ptr %arrayidx35.us, align 8, !tbaa !5 br label %for.body31.us for.cond18.for.cond.cleanup21_crit_edge.us: ; preds = %for.cond.cleanup92.us %inc117.us = add nuw nsw i64 %i12.0189.us, 1 %exitcond193.not = icmp eq i64 %inc117.us, %call11 br i1 %exitcond193.not, label %for.cond.cleanup16, label %for.cond18.preheader.us, !llvm.loop !48 for.body: ; preds = %for.body, %for.body.preheader.new %i.0181 = phi i64 [ 0, %for.body.preheader.new ], [ %inc4.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %rem = srem i64 %i.0181, %.pre %arrayidx = getelementptr inbounds [105 x [2 x i64]], ptr @dp, i64 0, i64 %rem %12 = load i64, ptr %arrayidx, align 16, !tbaa !5 %inc = add nsw i64 %12, 1 store i64 %inc, ptr %arrayidx, align 16, !tbaa !5 %inc4 = or i64 %i.0181, 1 %rem.1 = srem i64 %inc4, %.pre %arrayidx.1 = getelementptr inbounds [105 x [2 x i64]], ptr @dp, i64 0, i64 %rem.1 %13 = load i64, ptr %arrayidx.1, align 16, !tbaa !5 %inc.1 = add nsw i64 %13, 1 store i64 %inc.1, ptr %arrayidx.1, align 16, !tbaa !5 %inc4.1 = add nuw nsw i64 %i.0181, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !49 for.cond.cleanup16: ; preds = %for.cond18.for.cond.cleanup21_crit_edge.us, %for.cond.cleanup %sub119 = add nsw i64 %call11, -1 %arrayidx120 = getelementptr inbounds [10005 x [105 x [2 x i64]]], ptr @dp, i64 0, i64 %sub119 %arrayidx122 = getelementptr inbounds [2 x i64], ptr %arrayidx120, i64 0, i64 1 %14 = load i64, ptr %arrayidx122, align 8, !tbaa !5 %15 = load i64, ptr %arrayidx120, align 16, !tbaa !5 %add128 = add i64 %14, 1000000006 %add130 = add i64 %add128, %15 %rem131 = srem i64 %add130, 1000000007 %call132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem131) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #21 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #18 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #19 = { nounwind allocsize(1) } attributes #20 = { nounwind willreturn memory(read) } attributes #21 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 = distinct !{!45, !10} !46 = distinct !{!46, !10} !47 = distinct !{!47, !10} !48 = distinct !{!48, !10} !49 = distinct !{!49, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> //============================================================================ #define pred(x) ((x)-1) #define succ(x) ((x)+1) //============================================================================ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- long *Array, *Work; long Cnt,icount; //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void mergesort(long first, long last) { int middle; static long i, j, k, p, l; if (first < last) { middle = (first + last) / 2; mergesort(first, middle); mergesort(middle + 1, last); p = 0; for (i = first; i <= middle; i++) Work[p++] = Array[i]; i = middle + 1; j = 0; k = first; l=i-k; while (i <= last && j < p){ if (Work[j] <= Array[i]){ Array[k++] = Work[j++]; l--; }else{ Array[k++] = Array[i++]; Cnt+=l; } } while (j < p) Array[k++] = Work[j++]; } } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void input(FILE *file) { long n; fscanf(file, "%ld", &n); Array = malloc(succ(n)*sizeof(long)); Work = malloc(succ(n/2)*sizeof(long)); for (icount=Cnt=0; icount<n; icount++){ fscanf(file, "%ld", &Array[icount]); } mergesort(0, pred(n)); printf("%ld\n", Cnt); free(Array); free(Work); } //============================================================================ #ifndef DESKTOP int main() { input(stdin); return 0; } #endif
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231195/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231195/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @Array = dso_local local_unnamed_addr global ptr null, align 8 @Work = dso_local local_unnamed_addr global ptr null, align 8 @Cnt = dso_local local_unnamed_addr global i64 0, align 8 @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @icount = dso_local local_unnamed_addr global i64 0, align 8 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @mergesort(i64 noundef %first, i64 noundef %last) local_unnamed_addr #0 { entry: %cmp = icmp slt i64 %first, %last br i1 %cmp, label %if.then, label %if.end38 if.then: ; preds = %entry %add = add nsw i64 %last, %first %div = sdiv i64 %add, 2 %sext = shl i64 %div, 32 %conv1 = ashr exact i64 %sext, 32 tail call void @mergesort(i64 noundef %first, i64 noundef %conv1) %sext52 = add i64 %sext, 4294967296 %conv3 = ashr exact i64 %sext52, 32 tail call void @mergesort(i64 noundef %conv3, i64 noundef %last) %cmp5.not54 = icmp slt i64 %conv1, %first br i1 %cmp5.not54, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %if.then %0 = load ptr, ptr @Array, align 8, !tbaa !5 %1 = load ptr, ptr @Work, align 8, !tbaa !5 %2 = add nsw i64 %conv1, 1 %3 = sub i64 %2, %first %min.iters.check = icmp ult i64 %3, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.body.lr.ph %4 = ptrtoint ptr %1 to i64 %5 = ptrtoint ptr %0 to i64 %6 = shl i64 %first, 3 %7 = add i64 %6, %5 %8 = sub i64 %4, %7 %diff.check = icmp ult i64 %8, 32 br i1 %diff.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %3, -4 %ind.end = add i64 %n.vec, %first %invariant.gep = getelementptr i64, ptr %0, i64 %first br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i64, ptr %invariant.gep, i64 %index %wide.load = load <2 x i64>, ptr %gep, align 8, !tbaa !9 %9 = getelementptr inbounds i64, ptr %gep, i64 2 %wide.load83 = load <2 x i64>, ptr %9, align 8, !tbaa !9 %10 = getelementptr inbounds i64, ptr %1, i64 %index store <2 x i64> %wide.load, ptr %10, align 8, !tbaa !9 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> %wide.load83, ptr %11, align 8, !tbaa !9 %index.next = add nuw i64 %index, 4 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %for.body.lr.ph, %middle.block %storemerge56.ph = phi i64 [ %first, %vector.memcheck ], [ %first, %for.body.lr.ph ], [ %ind.end, %middle.block ] %inc5355.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ] %13 = add nsw i64 %div, 1 %14 = sub i64 %13, %storemerge56.ph %15 = sub i64 %conv1, %storemerge56.ph %xtraiter = and i64 %14, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader, %for.body.prol %storemerge56.prol = phi i64 [ %inc8.prol, %for.body.prol ], [ %storemerge56.ph, %for.body.preheader ] %inc5355.prol = phi i64 [ %inc.prol, %for.body.prol ], [ %inc5355.ph, %for.body.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ] %arrayidx.prol = getelementptr inbounds i64, ptr %0, i64 %storemerge56.prol %16 = load i64, ptr %arrayidx.prol, align 8, !tbaa !9 %inc.prol = add nuw nsw i64 %inc5355.prol, 1 %arrayidx7.prol = getelementptr inbounds i64, ptr %1, i64 %inc5355.prol store i64 %16, ptr %arrayidx7.prol, align 8, !tbaa !9 %inc8.prol = add i64 %storemerge56.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.body.prol.loopexit, label %for.body.prol, !llvm.loop !15 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %inc.lcssa.unr = phi i64 [ undef, %for.body.preheader ], [ %inc.prol, %for.body.prol ] %storemerge56.unr = phi i64 [ %storemerge56.ph, %for.body.preheader ], [ %inc8.prol, %for.body.prol ] %inc5355.unr = phi i64 [ %inc5355.ph, %for.body.preheader ], [ %inc.prol, %for.body.prol ] %17 = icmp ult i64 %15, 3 br i1 %17, label %for.end, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.prol.loopexit %invariant.gep107 = getelementptr i64, ptr %0, i64 1 %invariant.gep109 = getelementptr i64, ptr %1, i64 1 %invariant.gep111 = getelementptr i64, ptr %0, i64 2 %invariant.gep113 = getelementptr i64, ptr %1, i64 2 %invariant.gep115 = getelementptr i64, ptr %1, i64 3 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %storemerge56 = phi i64 [ %storemerge56.unr, %for.body.preheader.new ], [ %inc8.3, %for.body ] %inc5355 = phi i64 [ %inc5355.unr, %for.body.preheader.new ], [ %inc.3, %for.body ] %arrayidx = getelementptr inbounds i64, ptr %0, i64 %storemerge56 %18 = load i64, ptr %arrayidx, align 8, !tbaa !9 %arrayidx7 = getelementptr inbounds i64, ptr %1, i64 %inc5355 store i64 %18, ptr %arrayidx7, align 8, !tbaa !9 %gep108 = getelementptr i64, ptr %invariant.gep107, i64 %storemerge56 %19 = load i64, ptr %gep108, align 8, !tbaa !9 %gep110 = getelementptr i64, ptr %invariant.gep109, i64 %inc5355 store i64 %19, ptr %gep110, align 8, !tbaa !9 %gep112 = getelementptr i64, ptr %invariant.gep111, i64 %storemerge56 %20 = load i64, ptr %gep112, align 8, !tbaa !9 %gep114 = getelementptr i64, ptr %invariant.gep113, i64 %inc5355 store i64 %20, ptr %gep114, align 8, !tbaa !9 %inc8.2 = add i64 %storemerge56, 3 %arrayidx.3 = getelementptr inbounds i64, ptr %0, i64 %inc8.2 %21 = load i64, ptr %arrayidx.3, align 8, !tbaa !9 %inc.3 = add nuw nsw i64 %inc5355, 4 %gep116 = getelementptr i64, ptr %invariant.gep115, i64 %inc5355 store i64 %21, ptr %gep116, align 8, !tbaa !9 %inc8.3 = add i64 %storemerge56, 4 %exitcond.not.3 = icmp eq i64 %inc8.2, %conv1 br i1 %exitcond.not.3, label %for.end, label %for.body, !llvm.loop !17 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %if.then %22 = phi i64 [ 0, %if.then ], [ %n.vec, %middle.block ], [ %inc.lcssa.unr, %for.body.prol.loopexit ], [ %inc.3, %for.body ] %cmp1163 = icmp sle i64 %conv3, %last %cmp1364 = icmp sgt i64 %22, 0 %23 = select i1 %cmp1163, i1 %cmp1364, i1 false br i1 %23, label %while.body.lr.ph, label %while.cond29.preheader while.body.lr.ph: ; preds = %for.end %sub = sub nsw i64 %conv3, %first %24 = load ptr, ptr @Work, align 8, !tbaa !5 %25 = load ptr, ptr @Array, align 8, !tbaa !5 br label %while.body while.cond29.preheader: ; preds = %if.end, %for.end %mergesort.k.promoted71 = phi i64 [ %first, %for.end ], [ %inc22.sink, %if.end ] %mergesort.j.promoted69 = phi i64 [ 0, %for.end ], [ %inc2059, %if.end ] %cmp3073 = icmp slt i64 %mergesort.j.promoted69, %22 br i1 %cmp3073, label %while.body32.lr.ph, label %if.end38 while.body32.lr.ph: ; preds = %while.cond29.preheader %26 = load ptr, ptr @Work, align 8, !tbaa !5 %27 = load ptr, ptr @Array, align 8, !tbaa !5 %28 = sub i64 %22, %mergesort.j.promoted69 %min.iters.check88 = icmp ult i64 %28, 12 br i1 %min.iters.check88, label %while.body32.preheader, label %vector.memcheck84 vector.memcheck84: ; preds = %while.body32.lr.ph %29 = ptrtoint ptr %27 to i64 %30 = ptrtoint ptr %26 to i64 %31 = shl i64 %mergesort.k.promoted71, 3 %32 = add i64 %31, %29 %33 = shl i64 %mergesort.j.promoted69, 3 %34 = add i64 %33, %30 %35 = sub i64 %32, %34 %diff.check85 = icmp ult i64 %35, 32 br i1 %diff.check85, label %while.body32.preheader, label %vector.ph89 vector.ph89: ; preds = %vector.memcheck84 %n.vec91 = and i64 %28, -4 %ind.end92 = add i64 %mergesort.j.promoted69, %n.vec91 %ind.end94 = add i64 %mergesort.k.promoted71, %n.vec91 %36 = getelementptr i64, ptr %26, i64 %mergesort.j.promoted69 %37 = getelementptr i64, ptr %27, i64 %mergesort.k.promoted71 br label %vector.body97 vector.body97: ; preds = %vector.body97, %vector.ph89 %index98 = phi i64 [ 0, %vector.ph89 ], [ %index.next103, %vector.body97 ] %38 = getelementptr i64, ptr %36, i64 %index98 %wide.load101 = load <2 x i64>, ptr %38, align 8, !tbaa !9 %39 = getelementptr inbounds i64, ptr %38, i64 2 %wide.load102 = load <2 x i64>, ptr %39, align 8, !tbaa !9 %40 = getelementptr i64, ptr %37, i64 %index98 store <2 x i64> %wide.load101, ptr %40, align 8, !tbaa !9 %41 = getelementptr inbounds i64, ptr %40, i64 2 store <2 x i64> %wide.load102, ptr %41, align 8, !tbaa !9 %index.next103 = add nuw i64 %index98, 4 %42 = icmp eq i64 %index.next103, %n.vec91 br i1 %42, label %middle.block86, label %vector.body97, !llvm.loop !18 middle.block86: ; preds = %vector.body97 %cmp.n96 = icmp eq i64 %28, %n.vec91 br i1 %cmp.n96, label %if.end38, label %while.body32.preheader while.body32.preheader: ; preds = %vector.memcheck84, %while.body32.lr.ph, %middle.block86 %inc337075.ph = phi i64 [ %mergesort.j.promoted69, %vector.memcheck84 ], [ %mergesort.j.promoted69, %while.body32.lr.ph ], [ %ind.end92, %middle.block86 ] %inc357274.ph = phi i64 [ %mergesort.k.promoted71, %vector.memcheck84 ], [ %mergesort.k.promoted71, %while.body32.lr.ph ], [ %ind.end94, %middle.block86 ] %43 = sub i64 %22, %inc337075.ph %44 = xor i64 %inc337075.ph, -1 %45 = add i64 %22, %44 %xtraiter104 = and i64 %43, 3 %lcmp.mod105.not = icmp eq i64 %xtraiter104, 0 br i1 %lcmp.mod105.not, label %while.body32.prol.loopexit, label %while.body32.prol while.body32.prol: ; preds = %while.body32.preheader, %while.body32.prol %inc337075.prol = phi i64 [ %inc33.prol, %while.body32.prol ], [ %inc337075.ph, %while.body32.preheader ] %inc357274.prol = phi i64 [ %inc35.prol, %while.body32.prol ], [ %inc357274.ph, %while.body32.preheader ] %prol.iter106 = phi i64 [ %prol.iter106.next, %while.body32.prol ], [ 0, %while.body32.preheader ] %inc33.prol = add nsw i64 %inc337075.prol, 1 %arrayidx34.prol = getelementptr inbounds i64, ptr %26, i64 %inc337075.prol %46 = load i64, ptr %arrayidx34.prol, align 8, !tbaa !9 %inc35.prol = add nsw i64 %inc357274.prol, 1 %arrayidx36.prol = getelementptr inbounds i64, ptr %27, i64 %inc357274.prol store i64 %46, ptr %arrayidx36.prol, align 8, !tbaa !9 %prol.iter106.next = add i64 %prol.iter106, 1 %prol.iter106.cmp.not = icmp eq i64 %prol.iter106.next, %xtraiter104 br i1 %prol.iter106.cmp.not, label %while.body32.prol.loopexit, label %while.body32.prol, !llvm.loop !19 while.body32.prol.loopexit: ; preds = %while.body32.prol, %while.body32.preheader %inc337075.unr = phi i64 [ %inc337075.ph, %while.body32.preheader ], [ %inc33.prol, %while.body32.prol ] %inc357274.unr = phi i64 [ %inc357274.ph, %while.body32.preheader ], [ %inc35.prol, %while.body32.prol ] %47 = icmp ult i64 %45, 3 br i1 %47, label %if.end38, label %while.body32.preheader.new while.body32.preheader.new: ; preds = %while.body32.prol.loopexit %invariant.gep117 = getelementptr i64, ptr %26, i64 1 %invariant.gep119 = getelementptr i64, ptr %27, i64 1 %invariant.gep121 = getelementptr i64, ptr %26, i64 2 %invariant.gep123 = getelementptr i64, ptr %27, i64 2 %invariant.gep125 = getelementptr i64, ptr %26, i64 3 %invariant.gep127 = getelementptr i64, ptr %27, i64 3 br label %while.body32 while.body: ; preds = %while.body.lr.ph, %if.end %inc245867 = phi i64 [ %conv3, %while.body.lr.ph ], [ %inc2457, %if.end ] %inc206066 = phi i64 [ 0, %while.body.lr.ph ], [ %inc2059, %if.end ] %inc266165 = phi i64 [ %first, %while.body.lr.ph ], [ %inc22.sink, %if.end ] %48 = phi i64 [ %sub, %while.body.lr.ph ], [ %52, %if.end ] %arrayidx15 = getelementptr inbounds i64, ptr %24, i64 %inc206066 %49 = load i64, ptr %arrayidx15, align 8, !tbaa !9 %arrayidx16 = getelementptr inbounds i64, ptr %25, i64 %inc245867 %50 = load i64, ptr %arrayidx16, align 8, !tbaa !9 %cmp17.not = icmp sgt i64 %49, %50 %arrayidx27 = getelementptr inbounds i64, ptr %25, i64 %inc266165 br i1 %cmp17.not, label %if.else, label %if.then19 if.then19: ; preds = %while.body %inc20 = add nsw i64 %inc206066, 1 store i64 %49, ptr %arrayidx27, align 8, !tbaa !9 %dec = add nsw i64 %48, -1 br label %if.end if.else: ; preds = %while.body %inc24 = add nsw i64 %inc245867, 1 store i64 %50, ptr %arrayidx27, align 8, !tbaa !9 %51 = load i64, ptr @Cnt, align 8, !tbaa !9 %add28 = add nsw i64 %51, %48 store i64 %add28, ptr @Cnt, align 8, !tbaa !9 br label %if.end if.end: ; preds = %if.else, %if.then19 %52 = phi i64 [ %48, %if.else ], [ %dec, %if.then19 ] %inc2059 = phi i64 [ %inc206066, %if.else ], [ %inc20, %if.then19 ] %inc2457 = phi i64 [ %inc24, %if.else ], [ %inc245867, %if.then19 ] %inc22.sink = add nsw i64 %inc266165, 1 %cmp11 = icmp sle i64 %inc2457, %last %cmp13 = icmp slt i64 %inc2059, %22 %53 = select i1 %cmp11, i1 %cmp13, i1 false br i1 %53, label %while.body, label %while.cond29.preheader, !llvm.loop !20 while.body32: ; preds = %while.body32, %while.body32.preheader.new %inc337075 = phi i64 [ %inc337075.unr, %while.body32.preheader.new ], [ %inc33.3, %while.body32 ] %inc357274 = phi i64 [ %inc357274.unr, %while.body32.preheader.new ], [ %inc35.3, %while.body32 ] %arrayidx34 = getelementptr inbounds i64, ptr %26, i64 %inc337075 %54 = load i64, ptr %arrayidx34, align 8, !tbaa !9 %arrayidx36 = getelementptr inbounds i64, ptr %27, i64 %inc357274 store i64 %54, ptr %arrayidx36, align 8, !tbaa !9 %gep118 = getelementptr i64, ptr %invariant.gep117, i64 %inc337075 %55 = load i64, ptr %gep118, align 8, !tbaa !9 %gep120 = getelementptr i64, ptr %invariant.gep119, i64 %inc357274 store i64 %55, ptr %gep120, align 8, !tbaa !9 %gep122 = getelementptr i64, ptr %invariant.gep121, i64 %inc337075 %56 = load i64, ptr %gep122, align 8, !tbaa !9 %gep124 = getelementptr i64, ptr %invariant.gep123, i64 %inc357274 store i64 %56, ptr %gep124, align 8, !tbaa !9 %inc33.3 = add nsw i64 %inc337075, 4 %gep126 = getelementptr i64, ptr %invariant.gep125, i64 %inc337075 %57 = load i64, ptr %gep126, align 8, !tbaa !9 %inc35.3 = add nsw i64 %inc357274, 4 %gep128 = getelementptr i64, ptr %invariant.gep127, i64 %inc357274 store i64 %57, ptr %gep128, align 8, !tbaa !9 %exitcond78.not.3 = icmp eq i64 %inc33.3, %22 br i1 %exitcond78.not.3, label %if.end38, label %while.body32, !llvm.loop !21 if.end38: ; preds = %while.body32.prol.loopexit, %while.body32, %middle.block86, %while.cond29.preheader, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local void @input(ptr noundef %file) local_unnamed_addr #2 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %file, ptr noundef nonnull @.str, ptr noundef nonnull %n) #7 %0 = load i64, ptr %n, align 8, !tbaa !9 %add = shl i64 %0, 3 %mul = add i64 %add, 8 %call1 = call noalias ptr @malloc(i64 noundef %mul) #8 store ptr %call1, ptr @Array, align 8, !tbaa !5 %div = sdiv i64 %0, 2 %add2 = shl i64 %div, 3 %mul3 = add i64 %add2, 8 %call4 = call noalias ptr @malloc(i64 noundef %mul3) #8 store ptr %call4, ptr @Work, align 8, !tbaa !5 store i64 0, ptr @Cnt, align 8, !tbaa !9 store i64 0, ptr @icount, align 8, !tbaa !9 %cmp9 = icmp sgt i64 %0, 0 br i1 %cmp9, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %storemerge10 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %1 = load ptr, ptr @Array, align 8, !tbaa !5 %arrayidx = getelementptr inbounds i64, ptr %1, i64 %storemerge10 %call5 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %file, ptr noundef nonnull @.str, ptr noundef %arrayidx) #7 %2 = load i64, ptr @icount, align 8, !tbaa !9 %inc = add nsw i64 %2, 1 store i64 %inc, ptr @icount, align 8, !tbaa !9 %3 = load i64, ptr %n, align 8, !tbaa !9 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22 for.end: ; preds = %for.body, %entry %.lcssa = phi i64 [ %0, %entry ], [ %3, %for.body ] %sub = add nsw i64 %.lcssa, -1 call void @mergesort(i64 noundef 0, i64 noundef %sub) %4 = load i64, ptr @Cnt, align 8, !tbaa !9 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4) %5 = load ptr, ptr @Array, align 8, !tbaa !5 call void @free(ptr noundef %5) #7 %6 = load ptr, ptr @Work, align 8, !tbaa !5 call void @free(ptr noundef %6) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7 ret void } declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4 ; 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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 tail call void @input(ptr noundef %0) ret i32 0 } attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 #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 = { nounwind } attributes #8 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !12, !13} !18 = distinct !{!18, !12, !13, !14} !19 = distinct !{!19, !16} !20 = distinct !{!20, !12} !21 = distinct !{!21, !12, !13} !22 = distinct !{!22, !12}
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<limits.h> int n; long count=0; void merge(int *A,int left,int mid,int right){ int *L,*R; L=malloc(sizeof(int)*(mid-left+1)); R=malloc(sizeof(int)*(right-mid+1)); int i; for(i=0;i<mid-left;i++) L[i]=A[left+i]; L[mid-left]=INT_MAX; for(i=0;i<right-mid;i++) R[i]=A[mid+i]; R[right-mid]=INT_MAX;//どの不等式にもかつ数字を、配列の最後尾に入れる int l,r; l=0; r=0; for(i=0;i<right-left;i++){ if(L[l] <= R[r]){ A[left+i]=L[l]; l+=1; } else{ count+=mid-left-l; A[left+i]=R[r]; r+=1; } } free(L); free(R); } void mergesort(int *A,int left,int right){ if(left +1 < right){//整列させる要素が2つ以上ある場合は、分割する int mid; mid=(left+right)/2; mergesort(A,left,mid); mergesort(A,mid,right); merge(A,left,mid,right); } } //A[left]からA[right-1]まで整列させる int main(){ int *A; scanf("%d",&n); A=malloc(n*sizeof(int)); int i; for(i=0;i<n;i++) scanf("%d",&A[i]); mergesort(A,0,n); printf("%ld\n",count); return 0; } //どの不等式にも勝つ数字を入れたいときは、INT_MAX。limits.hをインクルードする必要あり
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231238/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231238/source.c" target datalayout = "e-m:e-p270: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 i64 0, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 { entry: %sub = sub nsw i32 %mid, %left %add = add nsw i32 %sub, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #5 %sub1 = sub nsw i32 %right, %mid %add2 = add nsw i32 %sub1, 1 %conv3 = sext i32 %add2 to i64 %mul4 = shl nsw i64 %conv3, 2 %call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #5 %cmp104 = icmp sgt i32 %sub, 0 br i1 %cmp104, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %left to i64 %1 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %A, i64 %1 %2 = xor i32 %left, -1 %3 = add i32 %2, %mid %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 2 %6 = add nuw nsw i64 %5, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry %idxprom12 = sext i32 %sub to i64 %arrayidx13 = getelementptr inbounds i32, ptr %call, i64 %idxprom12 store i32 2147483647, ptr %arrayidx13, align 4, !tbaa !5 %cmp16106 = icmp sgt i32 %sub1, 0 br i1 %cmp16106, label %for.body18.preheader, label %for.end26 for.body18.preheader: ; preds = %for.end %7 = sext i32 %mid to i64 %8 = shl nsw i64 %7, 2 %scevgep117 = getelementptr i8, ptr %A, i64 %8 %9 = xor i32 %mid, -1 %10 = add i32 %9, %right %11 = zext i32 %10 to i64 %12 = shl nuw nsw i64 %11, 2 %13 = add nuw nsw i64 %12, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call5, ptr noundef nonnull align 4 dereferenceable(1) %scevgep117, i64 %13, i1 false), !tbaa !5 br label %for.end26 for.end26: ; preds = %for.body18.preheader, %for.end %idxprom28 = sext i32 %sub1 to i64 %arrayidx29 = getelementptr inbounds i32, ptr %call5, i64 %idxprom28 store i32 2147483647, ptr %arrayidx29, align 4, !tbaa !5 %sub31 = sub nsw i32 %right, %left %cmp32110 = icmp sgt i32 %sub31, 0 br i1 %cmp32110, label %for.body34.preheader, label %for.end59 for.body34.preheader: ; preds = %for.end26 %count.promoted = load i64, ptr @count, align 8, !tbaa !9 %14 = sext i32 %left to i64 %wide.trip.count = zext i32 %sub31 to i64 %invariant.gep = getelementptr i32, ptr %A, i64 %14 %invariant.gep123 = getelementptr i32, ptr %A, i64 %14 br label %for.body34 for.body34: ; preds = %for.body34.preheader, %for.inc57 %indvars.iv = phi i64 [ 0, %for.body34.preheader ], [ %indvars.iv.next, %for.inc57 ] %r.0114 = phi i32 [ 0, %for.body34.preheader ], [ %r.1, %for.inc57 ] %l.0113 = phi i32 [ 0, %for.body34.preheader ], [ %l.1, %for.inc57 ] %add50109111 = phi i64 [ %count.promoted, %for.body34.preheader ], [ %add50108, %for.inc57 ] %idxprom35 = sext i32 %l.0113 to i64 %arrayidx36 = getelementptr inbounds i32, ptr %call, i64 %idxprom35 %15 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %idxprom37 = sext i32 %r.0114 to i64 %arrayidx38 = getelementptr inbounds i32, ptr %call5, i64 %idxprom37 %16 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %cmp39.not = icmp sgt i32 %15, %16 br i1 %cmp39.not, label %if.else, label %if.then if.then: ; preds = %for.body34 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv store i32 %15, ptr %gep, align 4, !tbaa !5 %add46 = add nsw i32 %l.0113, 1 br label %for.inc57 if.else: ; preds = %for.body34 %sub48 = sub nsw i32 %sub, %l.0113 %conv49 = sext i32 %sub48 to i64 %add50 = add nsw i64 %add50109111, %conv49 store i64 %add50, ptr @count, align 8, !tbaa !9 %gep124 = getelementptr i32, ptr %invariant.gep123, i64 %indvars.iv store i32 %16, ptr %gep124, align 4, !tbaa !5 %add56 = add nsw i32 %r.0114, 1 br label %for.inc57 for.inc57: ; preds = %if.then, %if.else %add50108 = phi i64 [ %add50109111, %if.then ], [ %add50, %if.else ] %l.1 = phi i32 [ %add46, %if.then ], [ %l.0113, %if.else ] %r.1 = phi i32 [ %r.0114, %if.then ], [ %add56, %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.end59, label %for.body34, !llvm.loop !11 for.end59: ; preds = %for.inc57, %for.end26 tail call void @free(ptr noundef nonnull %call) #6 tail call void @free(ptr noundef nonnull %call5) #6 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 #1 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nounwind uwtable define dso_local void @mergesort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %add = add nsw i32 %left, 1 %cmp = icmp slt i32 %add, %right br i1 %cmp, label %if.then, label %common.ret12 common.ret12: ; preds = %entry, %if.then ret void if.then: ; preds = %entry %add1 = add nsw i32 %right, %left %div = sdiv i32 %add1, 2 tail call void @mergesort(ptr noundef %A, i32 noundef %left, i32 noundef %div) tail call void @mergesort(ptr noundef %A, i32 noundef %div, i32 noundef %right) tail call void @merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right) br label %common.ret12 } ; Function Attrs: 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 @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = tail call noalias ptr @malloc(i64 noundef %mul) #5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, 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 %call1, i64 %indvars.iv %call3 = tail 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 !13 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] tail call void @mergesort(ptr noundef %call1, i32 noundef 0, i32 noundef %.lcssa) %3 = load i64, ptr @count, align 8, !tbaa !9 %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> #include <stdlib.h> #include <limits.h> void mergeSort(int* list, int left, int right); unsigned long count = 0; int main() { int n, * a; scanf("%d", &n); a = (int*)malloc(n * sizeof(int)); for (int i = 0; i < n; i++) scanf("%d", a + i); mergeSort(a, 0, n); printf("%lld\n", count); return 0; } void mergeSort(int* list, int left, int right) { if (left + 1 < right) { int middle = (left + right) / 2; mergeSort(list, left, middle); mergeSort(list, middle, right); int nL = middle - left, nR = right - middle, *l = malloc((nL + 1) * sizeof(int)), *r = malloc((nR + 1) * sizeof(int)); for (int i = 0; i < nL; i++) l[i] = list[left + i]; for (int i = 0; i < nR; i++) r[i] = list[middle + i]; l[nL] = INT_MAX, r[nR] = INT_MAX; int i = 0, j = 0; for (int k = left; k < right; k++) if (l[i] > r[j]) list[k] = r[j++], count += nL - i; else list[k] = l[i++]; free(l); free(r); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231281/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231281/source.c" target datalayout = "e-m:e-p270: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 i64 0, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: 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 %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 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] call void @mergeSort(ptr noundef %call1, i32 noundef 0, i32 noundef %.lcssa) %1 = load i64, ptr @count, align 8, !tbaa !9 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 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 !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress 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: nounwind uwtable define dso_local void @mergeSort(ptr noundef %list, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %add = add nsw i32 %left, 1 %cmp = icmp slt i32 %add, %right br i1 %cmp, label %if.then, label %if.end60 if.then: ; preds = %entry %add1 = add nsw i32 %right, %left %div = sdiv i32 %add1, 2 tail call void @mergeSort(ptr noundef %list, i32 noundef %left, i32 noundef %div) tail call void @mergeSort(ptr noundef %list, i32 noundef %div, i32 noundef %right) %sub = sub nsw i32 %div, %left %sub2 = sub nsw i32 %right, %div %add3 = add nsw i32 %sub, 1 %conv = sext i32 %add3 to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #7 %add4 = add nsw i32 %sub2, 1 %conv5 = sext i32 %add4 to i64 %mul6 = shl nsw i64 %conv5, 2 %call7 = tail call noalias ptr @malloc(i64 noundef %mul6) #7 %cmp8105 = icmp sgt i32 %sub, 0 br i1 %cmp8105, label %for.body.preheader, label %for.cond14.preheader for.body.preheader: ; preds = %if.then %0 = sext i32 %left to i64 %1 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %list, i64 %1 %2 = xor i32 %left, -1 %3 = add i32 %div, %2 %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 2 %6 = add nuw nsw i64 %5, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false), !tbaa !5 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.body.preheader, %if.then %cmp15107 = icmp sgt i32 %sub2, 0 br i1 %cmp15107, label %for.body18.preheader, label %for.cond.cleanup17 for.body18.preheader: ; preds = %for.cond14.preheader %7 = sext i32 %div to i64 %8 = shl nsw i64 %7, 2 %scevgep118 = getelementptr i8, ptr %list, i64 %8 %9 = xor i32 %div, -1 %10 = add i32 %9, %right %11 = zext i32 %10 to i64 %12 = shl nuw nsw i64 %11, 2 %13 = add nuw nsw i64 %12, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call7, ptr noundef nonnull align 4 dereferenceable(1) %scevgep118, i64 %13, i1 false), !tbaa !5 br label %for.cond.cleanup17 for.cond.cleanup17: ; preds = %for.body18.preheader, %for.cond14.preheader %idxprom27 = sext i32 %sub to i64 %arrayidx28 = getelementptr inbounds i32, ptr %call, i64 %idxprom27 store i32 2147483647, ptr %arrayidx28, align 4, !tbaa !5 %idxprom29 = sext i32 %sub2 to i64 %arrayidx30 = getelementptr inbounds i32, ptr %call7, i64 %idxprom29 store i32 2147483647, ptr %arrayidx30, align 4, !tbaa !5 %cmp33111 = icmp slt i32 %left, %right br i1 %cmp33111, label %for.body36.preheader, label %for.cond.cleanup35 for.body36.preheader: ; preds = %for.cond.cleanup17 %count.promoted = load i64, ptr @count, align 8, !tbaa !9 %14 = sext i32 %left to i64 %wide.trip.count = sext i32 %right to i64 br label %for.body36 for.cond.cleanup35: ; preds = %for.inc57, %for.cond.cleanup17 tail call void @free(ptr noundef nonnull %call) #6 tail call void @free(ptr noundef nonnull %call7) #6 br label %if.end60 for.body36: ; preds = %for.body36.preheader, %for.inc57 %indvars.iv = phi i64 [ %14, %for.body36.preheader ], [ %indvars.iv.next, %for.inc57 ] %j.0114 = phi i32 [ 0, %for.body36.preheader ], [ %j.1, %for.inc57 ] %i31.0113 = phi i32 [ 0, %for.body36.preheader ], [ %i31.1, %for.inc57 ] %add51110112 = phi i64 [ %count.promoted, %for.body36.preheader ], [ %add51109, %for.inc57 ] %idxprom37 = sext i32 %i31.0113 to i64 %arrayidx38 = getelementptr inbounds i32, ptr %call, i64 %idxprom37 %15 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %idxprom39 = sext i32 %j.0114 to i64 %arrayidx40 = getelementptr inbounds i32, ptr %call7, i64 %idxprom39 %16 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp sgt i32 %15, %16 br i1 %cmp41, label %if.then43, label %if.else if.then43: ; preds = %for.body36 %inc44 = add nsw i32 %j.0114, 1 %sub49 = sub nsw i32 %sub, %i31.0113 %conv50 = sext i32 %sub49 to i64 %add51 = add i64 %add51110112, %conv50 store i64 %add51, ptr @count, align 8, !tbaa !9 br label %for.inc57 if.else: ; preds = %for.body36 %inc52 = add nsw i32 %i31.0113, 1 br label %for.inc57 for.inc57: ; preds = %if.then43, %if.else %.sink = phi i32 [ %16, %if.then43 ], [ %15, %if.else ] %add51109 = phi i64 [ %add51, %if.then43 ], [ %add51110112, %if.else ] %i31.1 = phi i32 [ %i31.0113, %if.then43 ], [ %inc52, %if.else ] %j.1 = phi i32 [ %inc44, %if.then43 ], [ %j.0114, %if.else ] %17 = getelementptr inbounds i32, ptr %list, i64 %indvars.iv store i32 %.sink, ptr %17, align 4 %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.cleanup35, label %for.body36, !llvm.loop !13 if.end60: ; preds = %for.cond.cleanup35, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) 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 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define scani(x) scanf("%d",&x) #define scanc(x) scanf("%s",x) #define printi(x) printf("%d",x) #define printin(x) printf("%d\n",x) #define printd(x) printf("%.8f",x) #define printc(x) printf("%s",x) #define repd(i,n,m) for(int i = n; i > m; i--) #define repu(i,n,m) for(int i = n; i < m; i++) #define allprintu(i,n,m,a) for(int i = n; i < m; i++){if(i != m-1){printf("%d ",a[i]);}else{printf("%d\n",a[i]);}} #define allprintd(i,n,m,a) for(int i = n; i > m; i--){if(i != 0){printf("%d ",a[i]);}else{printf("%d\n",a[i]);}} #define MAX 200000 #define LIMIT pow(10,9)+1 int n; int a[MAX]; long long int merge(int A[],int n, int left, int mid, int right){ long long int cnt = 0; int n1 = mid - left, n2 = right - mid; int *L = (int*)malloc(sizeof(int)*(n1+1)); int *R = (int*)malloc(sizeof(int)*(n2+1)); repu(i,0,n1){ L[i] = A[left + i]; } repu(i,0,n2){ R[i] = A[mid + i]; } L[n1] = R[n2] = LIMIT; int i = 0; int j = 0; repu(k,left,right){ if(L[i] <= R[j]){ A[k] = L[i]; i = i + 1; }else{ A[k] = R[j]; j = j + 1; cnt += n1 - i; } } free(L); free(R); return cnt; } long long int mergeSort(int A[], int n, int left, int right){ long long int v1, v2, v3; if( left + 1 < right){ int mid = (left+right)/2; v1 = mergeSort(A,n,left,mid); v2 = mergeSort(A,n,mid,right); v3 = merge(A,n,left, mid, right); return v1 + v2 + v3; }else{ return 0; } } int main(void){ scani(n); repu(i,0,n){ scani(a[i]); } printf("%llu\n",mergeSort(a,n,0,n)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231324/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231324/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @a = dso_local global [200000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i64 @merge(ptr nocapture noundef %A, i32 %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 { entry: %sub = sub nsw i32 %mid, %left %sub1 = sub nsw i32 %right, %mid %add = add nsw i32 %sub, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #5 %add2 = add nsw i32 %sub1, 1 %conv3 = sext i32 %add2 to i64 %mul4 = shl nsw i64 %conv3, 2 %call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #5 %cmp96 = icmp sgt i32 %sub, 0 br i1 %cmp96, label %for.body.preheader, label %for.cond11.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %left to i64 %1 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %A, i64 %1 %2 = xor i32 %left, -1 %3 = add i32 %2, %mid %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 2 %6 = add nuw nsw i64 %5, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false), !tbaa !5 br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.body.preheader, %entry %cmp1298 = icmp sgt i32 %sub1, 0 br i1 %cmp1298, label %for.body15.preheader, label %for.cond.cleanup14 for.body15.preheader: ; preds = %for.cond11.preheader %7 = sext i32 %mid to i64 %8 = shl nsw i64 %7, 2 %scevgep107 = getelementptr i8, ptr %A, i64 %8 %9 = xor i32 %mid, -1 %10 = add i32 %9, %right %11 = zext i32 %10 to i64 %12 = shl nuw nsw i64 %11, 2 %13 = add nuw nsw i64 %12, 4 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call5, ptr noundef nonnull align 4 dereferenceable(1) %scevgep107, i64 %13, i1 false), !tbaa !5 br label %for.cond.cleanup14 for.cond.cleanup14: ; preds = %for.body15.preheader, %for.cond11.preheader %idxprom27 = sext i32 %sub1 to i64 %arrayidx28 = getelementptr inbounds i32, ptr %call5, i64 %idxprom27 store i32 1000000001, ptr %arrayidx28, align 4, !tbaa !5 %idxprom29 = sext i32 %sub to i64 %arrayidx30 = getelementptr inbounds i32, ptr %call, i64 %idxprom29 store i32 1000000001, ptr %arrayidx30, align 4, !tbaa !5 %cmp33100 = icmp slt i32 %left, %right br i1 %cmp33100, label %for.body36.preheader, label %for.cond.cleanup35 for.body36.preheader: ; preds = %for.cond.cleanup14 %14 = sext i32 %left to i64 %wide.trip.count = sext i32 %right to i64 br label %for.body36 for.cond.cleanup35: ; preds = %for.inc56, %for.cond.cleanup14 %cnt.0.lcssa = phi i64 [ 0, %for.cond.cleanup14 ], [ %cnt.1, %for.inc56 ] tail call void @free(ptr noundef nonnull %call) #6 tail call void @free(ptr noundef nonnull %call5) #6 ret i64 %cnt.0.lcssa for.body36: ; preds = %for.body36.preheader, %for.inc56 %indvars.iv = phi i64 [ %14, %for.body36.preheader ], [ %indvars.iv.next, %for.inc56 ] %j.0103 = phi i32 [ 0, %for.body36.preheader ], [ %j.1, %for.inc56 ] %i31.0102 = phi i32 [ 0, %for.body36.preheader ], [ %i31.1, %for.inc56 ] %cnt.0101 = phi i64 [ 0, %for.body36.preheader ], [ %cnt.1, %for.inc56 ] %idxprom37 = sext i32 %i31.0102 to i64 %arrayidx38 = getelementptr inbounds i32, ptr %call, i64 %idxprom37 %15 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %idxprom39 = sext i32 %j.0103 to i64 %arrayidx40 = getelementptr inbounds i32, ptr %call5, i64 %idxprom39 %16 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41.not = icmp sgt i32 %15, %16 br i1 %cmp41.not, label %if.else, label %if.then if.then: ; preds = %for.body36 %add47 = add nsw i32 %i31.0102, 1 br label %for.inc56 if.else: ; preds = %for.body36 %add52 = add nsw i32 %j.0103, 1 %sub53 = sub nsw i32 %sub, %i31.0102 %conv54 = sext i32 %sub53 to i64 %add55 = add nsw i64 %cnt.0101, %conv54 br label %for.inc56 for.inc56: ; preds = %if.then, %if.else %.sink = phi i32 [ %16, %if.else ], [ %15, %if.then ] %cnt.1 = phi i64 [ %add55, %if.else ], [ %cnt.0101, %if.then ] %i31.1 = phi i32 [ %i31.0102, %if.else ], [ %add47, %if.then ] %j.1 = phi i32 [ %add52, %if.else ], [ %j.0103, %if.then ] %17 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv store i32 %.sink, ptr %17, align 4 %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.cleanup35, label %for.body36, !llvm.loop !9 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nounwind uwtable define dso_local i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %add = add nsw i32 %left, 1 %cmp = icmp slt i32 %add, %right br i1 %cmp, label %if.then, label %common.ret20 common.ret20: ; preds = %entry, %if.then %common.ret20.op = phi i64 [ %add5, %if.then ], [ 0, %entry ] ret i64 %common.ret20.op if.then: ; preds = %entry %add1 = add nsw i32 %right, %left %div = sdiv i32 %add1, 2 %call = tail call i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div) %call2 = tail call i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right) %call3 = tail call i64 @merge(ptr noundef %A, i32 poison, i32 noundef %left, i32 noundef %div, i32 noundef %right) %add4 = add nsw i64 %call2, %call %add5 = add nsw i64 %add4, %call3 br label %common.ret20 } ; Function Attrs: 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 @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] %call2 = tail call i64 @mergeSort(ptr noundef nonnull @a, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa) %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call2) ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv %call1 = tail 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 !11 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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}
#include<stdio.h> #define M 200000 #define SNT 2000000000 typedef long long int llong; int L[M / 2 + 2], R[M / 2 + 2]; llong merge(int*, int, int, int, int); llong mergeSort(int*, int, int, int); llong merge(int A[], int n, int left, int mid, int right){ int i, j, k; int n1, n2; llong count = 0; n1 = mid - left; n2 = right - mid; for( i = 0 ; i < n1 ; i++){ L[i] = A[left + i]; } for( i = 0 ; i < n2 ; i++){ R[i] = A[mid + i]; } L[n1] = R[n2] = SNT; i = j = 0; for( k = left ; k < right ; k++){ if( L[i] <= R[j] ){ A[k] = L[i++]; } else{ A[k] = R[j++]; count += n1 - i; } } return count; } llong mergeSort(int A[], int n, int left, int right){ int mid; llong v1, v2, v3; if( left + 1 < right){ mid = (left + right) / 2; v1 = mergeSort(A, n, left, mid); v2 = mergeSort(A, n, mid, right); v3 = merge(A, n, left, mid, right); return v1 + v2 + v3; } else return 0; } int main(){ int A[M], n, i; llong ans; scanf("%d", &n); for( i = 0 ; i < n ; i++){ scanf("%d", &A[i]); } ans = mergeSort(A, n, 0, n); printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @L = dso_local local_unnamed_addr global [100002 x i32] zeroinitializer, align 16 @R = dso_local local_unnamed_addr global [100002 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 { entry: %A93 = ptrtoint ptr %A to i64 %sub = sub nsw i32 %mid, %left %sub1 = sub i32 %right, %mid %cmp69 = icmp sgt i32 %sub, 0 br i1 %cmp69, label %for.body.preheader, label %for.cond4.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %left to i64 %wide.trip.count = zext i32 %sub to i64 %invariant.gep = getelementptr i32, ptr %A, i64 %0 %min.iters.check = icmp ult i32 %sub, 12 br i1 %min.iters.check, label %for.body.preheader111, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %1 = shl nsw i64 %0, 2 %2 = add i64 %1, %A93 %3 = sub i64 ptrtoint (ptr @L to i64), %2 %diff.check = icmp ult i64 %3, 32 br i1 %diff.check, label %for.body.preheader111, label %vector.ph vector.ph: ; preds = %vector.memcheck %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 i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = getelementptr i32, ptr %4, i64 4 %wide.load94 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %index store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %wide.load94, ptr %7, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader111 for.body.preheader111: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %9 = xor i64 %indvars.iv.ph, -1 %10 = add nsw i64 %9, %wide.trip.count %xtraiter = and i64 %wide.trip.count, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader111, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader111 ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader111 ] %gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol %11 = load i32, ptr %gep.prol, align 4, !tbaa !5 %arrayidx3.prol = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.prol store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.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.body.prol.loopexit, label %for.body.prol, !llvm.loop !13 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader111 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader111 ], [ %indvars.iv.next.prol, %for.body.prol ] %12 = icmp ult i64 %10, 3 br i1 %12, label %for.cond4.preheader, label %for.body for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry %cmp571 = icmp sgt i32 %sub1, 0 br i1 %cmp571, label %for.body6.preheader, label %for.end14 for.body6.preheader: ; preds = %for.cond4.preheader %13 = sext i32 %mid to i64 %wide.trip.count84 = zext i32 %sub1 to i64 %invariant.gep91 = getelementptr i32, ptr %A, i64 %13 %min.iters.check99 = icmp ult i32 %sub1, 12 br i1 %min.iters.check99, label %for.body6.preheader110, label %vector.memcheck95 vector.memcheck95: ; preds = %for.body6.preheader %14 = shl nsw i64 %13, 2 %15 = add i64 %14, %A93 %16 = sub i64 ptrtoint (ptr @R to i64), %15 %diff.check96 = icmp ult i64 %16, 32 br i1 %diff.check96, label %for.body6.preheader110, label %vector.ph100 vector.ph100: ; preds = %vector.memcheck95 %n.vec102 = and i64 %wide.trip.count84, 4294967288 br label %vector.body105 vector.body105: ; preds = %vector.body105, %vector.ph100 %index106 = phi i64 [ 0, %vector.ph100 ], [ %index.next109, %vector.body105 ] %17 = getelementptr i32, ptr %invariant.gep91, i64 %index106 %wide.load107 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr i32, ptr %17, i64 4 %wide.load108 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %index106 store <4 x i32> %wide.load107, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 store <4 x i32> %wide.load108, ptr %20, align 16, !tbaa !5 %index.next109 = add nuw i64 %index106, 8 %21 = icmp eq i64 %index.next109, %n.vec102 br i1 %21, label %middle.block97, label %vector.body105, !llvm.loop !15 middle.block97: ; preds = %vector.body105 %cmp.n104 = icmp eq i64 %n.vec102, %wide.trip.count84 br i1 %cmp.n104, label %for.end14, label %for.body6.preheader110 for.body6.preheader110: ; preds = %vector.memcheck95, %for.body6.preheader, %middle.block97 %indvars.iv80.ph = phi i64 [ 0, %vector.memcheck95 ], [ 0, %for.body6.preheader ], [ %n.vec102, %middle.block97 ] %22 = xor i64 %indvars.iv80.ph, -1 %23 = add nsw i64 %22, %wide.trip.count84 %xtraiter112 = and i64 %wide.trip.count84, 3 %lcmp.mod113.not = icmp eq i64 %xtraiter112, 0 br i1 %lcmp.mod113.not, label %for.body6.prol.loopexit, label %for.body6.prol for.body6.prol: ; preds = %for.body6.preheader110, %for.body6.prol %indvars.iv80.prol = phi i64 [ %indvars.iv.next81.prol, %for.body6.prol ], [ %indvars.iv80.ph, %for.body6.preheader110 ] %prol.iter114 = phi i64 [ %prol.iter114.next, %for.body6.prol ], [ 0, %for.body6.preheader110 ] %gep92.prol = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv80.prol %24 = load i32, ptr %gep92.prol, align 4, !tbaa !5 %arrayidx11.prol = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv80.prol store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5 %indvars.iv.next81.prol = add nuw nsw i64 %indvars.iv80.prol, 1 %prol.iter114.next = add i64 %prol.iter114, 1 %prol.iter114.cmp.not = icmp eq i64 %prol.iter114.next, %xtraiter112 br i1 %prol.iter114.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !16 for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader110 %indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body6.preheader110 ], [ %indvars.iv.next81.prol, %for.body6.prol ] %25 = icmp ult i64 %23, 3 br i1 %25, label %for.end14, label %for.body6 for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %26 = load i32, ptr %gep, align 4, !tbaa !5 %arrayidx3 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv store i32 %26, ptr %arrayidx3, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next %27 = load i32, ptr %gep.1, align 4, !tbaa !5 %arrayidx3.1 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1 %28 = load i32, ptr %gep.2, align 4, !tbaa !5 %arrayidx3.2 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1 store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2 %29 = load i32, ptr %gep.3, align 4, !tbaa !5 %arrayidx3.3 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2 store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !17 for.body6: ; preds = %for.body6.prol.loopexit, %for.body6 %indvars.iv80 = phi i64 [ %indvars.iv.next81.3, %for.body6 ], [ %indvars.iv80.unr, %for.body6.prol.loopexit ] %gep92 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv80 %30 = load i32, ptr %gep92, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv80 store i32 %30, ptr %arrayidx11, align 4, !tbaa !5 %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %gep92.1 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81 %31 = load i32, ptr %gep92.1, align 4, !tbaa !5 %arrayidx11.1 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81 store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5 %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2 %gep92.2 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81.1 %32 = load i32, ptr %gep92.2, align 4, !tbaa !5 %arrayidx11.2 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.1 store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5 %indvars.iv.next81.2 = add nuw nsw i64 %indvars.iv80, 3 %gep92.3 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81.2 %33 = load i32, ptr %gep92.3, align 4, !tbaa !5 %arrayidx11.3 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.2 store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5 %indvars.iv.next81.3 = add nuw nsw i64 %indvars.iv80, 4 %exitcond85.not.3 = icmp eq i64 %indvars.iv.next81.3, %wide.trip.count84 br i1 %exitcond85.not.3, label %for.end14, label %for.body6, !llvm.loop !18 for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block97, %for.cond4.preheader %idxprom15 = sext i32 %sub1 to i64 %arrayidx16 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %idxprom15 store i32 2000000000, ptr %arrayidx16, align 4, !tbaa !5 %idxprom17 = sext i32 %sub to i64 %arrayidx18 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %idxprom17 store i32 2000000000, ptr %arrayidx18, align 4, !tbaa !5 %cmp2073 = icmp slt i32 %left, %right br i1 %cmp2073, label %for.body21.preheader, label %for.end41 for.body21.preheader: ; preds = %for.end14 %34 = sext i32 %left to i64 %wide.trip.count89 = sext i32 %right to i64 br label %for.body21 for.body21: ; preds = %for.body21.preheader, %for.inc39 %indvars.iv86 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next87, %for.inc39 ] %count.077 = phi i64 [ 0, %for.body21.preheader ], [ %count.1, %for.inc39 ] %i.276 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.inc39 ] %j.075 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.inc39 ] %idxprom22 = sext i32 %i.276 to i64 %arrayidx23 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %idxprom22 %35 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %idxprom24 = sext i32 %j.075 to i64 %arrayidx25 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %idxprom24 %36 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %cmp26.not = icmp sgt i32 %35, %36 br i1 %cmp26.not, label %if.else, label %if.then if.then: ; preds = %for.body21 %inc27 = add nsw i32 %i.276, 1 br label %for.inc39 if.else: ; preds = %for.body21 %inc32 = add nsw i32 %j.075, 1 %sub37 = sub nsw i32 %sub, %i.276 %conv = sext i32 %sub37 to i64 %add38 = add nsw i64 %count.077, %conv br label %for.inc39 for.inc39: ; preds = %if.then, %if.else %.sink = phi i32 [ %36, %if.else ], [ %35, %if.then ] %j.1 = phi i32 [ %inc32, %if.else ], [ %j.075, %if.then ] %i.3 = phi i32 [ %i.276, %if.else ], [ %inc27, %if.then ] %count.1 = phi i64 [ %add38, %if.else ], [ %count.077, %if.then ] %37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv86 store i32 %.sink, ptr %37, align 4 %indvars.iv.next87 = add nsw i64 %indvars.iv86, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89 br i1 %exitcond90.not, label %for.end41, label %for.body21, !llvm.loop !19 for.end41: ; preds = %for.inc39, %for.end14 %count.0.lcssa = phi i64 [ 0, %for.end14 ], [ %count.1, %for.inc39 ] ret i64 %count.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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 { entry: %A21 = ptrtoint ptr %A to i64 %add = add nsw i32 %left, 1 %cmp = icmp slt i32 %add, %right br i1 %cmp, label %if.then, label %cleanup if.then: ; preds = %entry %add1 = add nsw i32 %right, %left %div = sdiv i32 %add1, 2 %call = tail call i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div) %call2 = tail call i64 @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right) %sub.i = sub nsw i32 %div, %left %sub1.i = sub i32 %right, %div %cmp69.i = icmp sgt i32 %sub.i, 0 br i1 %cmp69.i, label %for.body.preheader.i, label %for.cond4.preheader.i for.body.preheader.i: ; preds = %if.then %0 = sext i32 %left to i64 %wide.trip.count.i = zext i32 %sub.i to i64 %invariant.gep.i = getelementptr i32, ptr %A, i64 %0 %min.iters.check = icmp ult i32 %sub.i, 12 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader.i %1 = shl nsw i64 %0, 2 %2 = add i64 %1, %A21 %3 = sub i64 ptrtoint (ptr @L to i64), %2 %diff.check = icmp ult i64 %3, 32 br i1 %diff.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %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 ] %4 = getelementptr i32, ptr %invariant.gep.i, i64 %index %wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = getelementptr i32, ptr %4, i64 4 %wide.load22 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %index store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %wide.load22, ptr %7, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] %9 = xor i64 %indvars.iv.i.ph, -1 %10 = add nsw i64 %9, %wide.trip.count.i %xtraiter = and i64 %wide.trip.count.i, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol %indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ] %gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol %11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5 %arrayidx3.i.prol = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5 %indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.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.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !21 for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ] %12 = icmp ult i64 %10, 3 br i1 %12, label %for.cond4.preheader.i, label %for.body.i for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then %cmp571.i = icmp sgt i32 %sub1.i, 0 br i1 %cmp571.i, label %for.body6.preheader.i, label %for.end14.i for.body6.preheader.i: ; preds = %for.cond4.preheader.i %13 = sext i32 %div to i64 %wide.trip.count84.i = zext i32 %sub1.i to i64 %invariant.gep91.i = getelementptr i32, ptr %A, i64 %13 %min.iters.check27 = icmp ult i32 %sub1.i, 12 br i1 %min.iters.check27, label %for.body6.i.preheader, label %vector.memcheck23 vector.memcheck23: ; preds = %for.body6.preheader.i %14 = shl nsw i64 %13, 2 %15 = add i64 %14, %A21 %16 = sub i64 ptrtoint (ptr @R to i64), %15 %diff.check24 = icmp ult i64 %16, 32 br i1 %diff.check24, label %for.body6.i.preheader, label %vector.ph28 vector.ph28: ; preds = %vector.memcheck23 %n.vec30 = and i64 %wide.trip.count84.i, 4294967288 br label %vector.body33 vector.body33: ; preds = %vector.body33, %vector.ph28 %index34 = phi i64 [ 0, %vector.ph28 ], [ %index.next37, %vector.body33 ] %17 = getelementptr i32, ptr %invariant.gep91.i, i64 %index34 %wide.load35 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr i32, ptr %17, i64 4 %wide.load36 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %index34 store <4 x i32> %wide.load35, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 store <4 x i32> %wide.load36, ptr %20, align 16, !tbaa !5 %index.next37 = add nuw i64 %index34, 8 %21 = icmp eq i64 %index.next37, %n.vec30 br i1 %21, label %middle.block25, label %vector.body33, !llvm.loop !22 middle.block25: ; preds = %vector.body33 %cmp.n32 = icmp eq i64 %n.vec30, %wide.trip.count84.i br i1 %cmp.n32, label %for.end14.i, label %for.body6.i.preheader for.body6.i.preheader: ; preds = %vector.memcheck23, %for.body6.preheader.i, %middle.block25 %indvars.iv80.i.ph = phi i64 [ 0, %vector.memcheck23 ], [ 0, %for.body6.preheader.i ], [ %n.vec30, %middle.block25 ] %22 = xor i64 %indvars.iv80.i.ph, -1 %23 = add nsw i64 %22, %wide.trip.count84.i %xtraiter38 = and i64 %wide.trip.count84.i, 3 %lcmp.mod39.not = icmp eq i64 %xtraiter38, 0 br i1 %lcmp.mod39.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol %indvars.iv80.i.prol = phi i64 [ %indvars.iv.next81.i.prol, %for.body6.i.prol ], [ %indvars.iv80.i.ph, %for.body6.i.preheader ] %prol.iter40 = phi i64 [ %prol.iter40.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ] %gep92.i.prol = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv80.i.prol %24 = load i32, ptr %gep92.i.prol, align 4, !tbaa !5 %arrayidx11.i.prol = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv80.i.prol store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5 %indvars.iv.next81.i.prol = add nuw nsw i64 %indvars.iv80.i.prol, 1 %prol.iter40.next = add i64 %prol.iter40, 1 %prol.iter40.cmp.not = icmp eq i64 %prol.iter40.next, %xtraiter38 br i1 %prol.iter40.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !23 for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader %indvars.iv80.i.unr = phi i64 [ %indvars.iv80.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next81.i.prol, %for.body6.i.prol ] %25 = icmp ult i64 %23, 3 br i1 %25, label %for.end14.i, label %for.body6.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %26 = load i32, ptr %gep.i, align 4, !tbaa !5 %arrayidx3.i = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.i store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i %27 = load i32, ptr %gep.i.1, align 4, !tbaa !5 %arrayidx3.i.1 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1 %28 = load i32, ptr %gep.i.2, align 4, !tbaa !5 %arrayidx3.i.2 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1 store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5 %indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3 %gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2 %29 = load i32, ptr %gep.i.3, align 4, !tbaa !5 %arrayidx3.i.3 = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2 store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5 %indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4 %exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !24 for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i %indvars.iv80.i = phi i64 [ %indvars.iv.next81.i.3, %for.body6.i ], [ %indvars.iv80.i.unr, %for.body6.i.prol.loopexit ] %gep92.i = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv80.i %30 = load i32, ptr %gep92.i, align 4, !tbaa !5 %arrayidx11.i = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv80.i store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5 %indvars.iv.next81.i = add nuw nsw i64 %indvars.iv80.i, 1 %gep92.i.1 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i %31 = load i32, ptr %gep92.i.1, align 4, !tbaa !5 %arrayidx11.i.1 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5 %indvars.iv.next81.i.1 = add nuw nsw i64 %indvars.iv80.i, 2 %gep92.i.2 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.1 %32 = load i32, ptr %gep92.i.2, align 4, !tbaa !5 %arrayidx11.i.2 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i.1 store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5 %indvars.iv.next81.i.2 = add nuw nsw i64 %indvars.iv80.i, 3 %gep92.i.3 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.2 %33 = load i32, ptr %gep92.i.3, align 4, !tbaa !5 %arrayidx11.i.3 = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i.2 store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5 %indvars.iv.next81.i.3 = add nuw nsw i64 %indvars.iv80.i, 4 %exitcond85.not.i.3 = icmp eq i64 %indvars.iv.next81.i.3, %wide.trip.count84.i br i1 %exitcond85.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !25 for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block25, %for.cond4.preheader.i %idxprom15.i = sext i32 %sub1.i to i64 %arrayidx16.i = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %idxprom15.i store i32 2000000000, ptr %arrayidx16.i, align 4, !tbaa !5 %idxprom17.i = sext i32 %sub.i to i64 %arrayidx18.i = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %idxprom17.i store i32 2000000000, ptr %arrayidx18.i, align 4, !tbaa !5 %34 = sext i32 %left to i64 %wide.trip.count89.i = sext i32 %right to i64 br label %for.body21.i for.body21.i: ; preds = %for.inc39.i, %for.end14.i %indvars.iv86.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next87.i, %for.inc39.i ] %count.077.i = phi i64 [ 0, %for.end14.i ], [ %count.1.i, %for.inc39.i ] %i.276.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.inc39.i ] %j.075.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.inc39.i ] %idxprom22.i = sext i32 %i.276.i to i64 %arrayidx23.i = getelementptr inbounds [100002 x i32], ptr @L, i64 0, i64 %idxprom22.i %35 = load i32, ptr %arrayidx23.i, align 4, !tbaa !5 %idxprom24.i = sext i32 %j.075.i to i64 %arrayidx25.i = getelementptr inbounds [100002 x i32], ptr @R, i64 0, i64 %idxprom24.i %36 = load i32, ptr %arrayidx25.i, align 4, !tbaa !5 %cmp26.not.i = icmp sgt i32 %35, %36 br i1 %cmp26.not.i, label %if.else.i, label %if.then.i if.then.i: ; preds = %for.body21.i %inc27.i = add nsw i32 %i.276.i, 1 br label %for.inc39.i if.else.i: ; preds = %for.body21.i %inc32.i = add nsw i32 %j.075.i, 1 %sub37.i = sub nsw i32 %sub.i, %i.276.i %conv.i = sext i32 %sub37.i to i64 %add38.i = add nsw i64 %count.077.i, %conv.i br label %for.inc39.i for.inc39.i: ; preds = %if.else.i, %if.then.i %.sink.i = phi i32 [ %36, %if.else.i ], [ %35, %if.then.i ] %j.1.i = phi i32 [ %inc32.i, %if.else.i ], [ %j.075.i, %if.then.i ] %i.3.i = phi i32 [ %i.276.i, %if.else.i ], [ %inc27.i, %if.then.i ] %count.1.i = phi i64 [ %add38.i, %if.else.i ], [ %count.077.i, %if.then.i ] %37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv86.i store i32 %.sink.i, ptr %37, align 4 %indvars.iv.next87.i = add nsw i64 %indvars.iv86.i, 1 %exitcond90.not.i = icmp eq i64 %indvars.iv.next87.i, %wide.trip.count89.i br i1 %exitcond90.not.i, label %merge.exit, label %for.body21.i, !llvm.loop !19 merge.exit: ; preds = %for.inc39.i %add4 = add nsw i64 %call2, %call %add5 = add nsw i64 %add4, %count.1.i br label %cleanup cleanup: ; preds = %entry, %merge.exit %retval.0 = phi i64 [ %add5, %merge.exit ], [ 0, %entry ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %A = alloca [200000 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, 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 [200000 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 !26 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] %call2 = call i64 @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa) %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(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 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10, !11, !12} !16 = distinct !{!16, !14} !17 = distinct !{!17, !10, !11} !18 = distinct !{!18, !10, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !14} !22 = distinct !{!22, !10, !11, !12} !23 = distinct !{!23, !14} !24 = distinct !{!24, !10, !11} !25 = distinct !{!25, !10, !11} !26 = distinct !{!26, !10}
#include<stdio.h> #include<math.h> int main() { unsigned long long int n; scanf("%lld", &n); long long int x; x = ceil(sqrt(n)); while (n%x > 0) x--; int ans = 0; x = n / x; while (x > 0) { ans++; x /= 10; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231469/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231469/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %conv = uitofp i64 %0 to double %sqrt = call double @llvm.sqrt.f64(double %conv) %1 = call double @llvm.ceil.f64(double %sqrt) %conv2 = fptosi double %1 to i64 br label %while.cond while.cond: ; preds = %while.cond, %entry %x.0 = phi i64 [ %conv2, %entry ], [ %dec, %while.cond ] %rem = urem i64 %0, %x.0 %div = udiv i64 %0, %x.0 %cmp.not = icmp eq i64 %rem, 0 %dec = add nsw i64 %x.0, -1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %cmp516 = icmp sgt i64 %div, 0 br i1 %cmp516, label %while.body7, label %while.end9 while.body7: ; preds = %while.end, %while.body7 %ans.018 = phi i32 [ %inc, %while.body7 ], [ 0, %while.end ] %x.117 = phi i64 [ %div8, %while.body7 ], [ %div, %while.end ] %inc = add nuw nsw i32 %ans.018, 1 %div8 = udiv i64 %x.117, 10 %cmp5.not = icmp ult i64 %x.117, 10 br i1 %cmp5.not, label %while.end9, label %while.body7, !llvm.loop !11 while.end9: ; preds = %while.body7, %while.end %ans.0.lcssa = phi i32 [ 0, %while.end ], [ %inc, %while.body7 ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, 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 speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.sqrt.f64(double) #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 speculatable willreturn memory(none) } 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <string.h> #include <stdbool.h> #define S_MAX 1000 #define N_MAX 50 #define M_MAX 50 #define INF 2000000000 #define MOD 1000000007 #define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b)))) typedef unsigned long long ull; typedef signed long long dll; typedef struct { int a; int b; int c; } moneydata; ull n, m; int h, w; int i, j; int k; ull max(ull a, ull b){ return (a > b) ? a : b; } ull min(ull a, ull b){ return (a < b) ? a : b; } ull abs(dll a) { if (a >= 0) return (ull)a; else return (ull)(-a); } void solve(){ ull i = 1; ull x; while (i * i <= n) { if ((n % i) == 0) x = i; i++; } i = n / x; x = 0; while (i) { x++; i /= 10; } printf("%llu\n", x); return; } int main (void) { scanf("%llu", &n); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231526/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231526/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i64 0, align 8 @.str = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @m = dso_local local_unnamed_addr global i64 0, align 8 @h = dso_local local_unnamed_addr global i32 0, align 4 @w = dso_local local_unnamed_addr global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @k = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @abs(i64 noundef %a) local_unnamed_addr #0 { entry: %retval.0 = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #1 { entry: %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp.not15 = icmp eq i64 %0, 0 br i1 %cmp.not15, label %while.body3.preheader, label %while.body while.body: ; preds = %entry, %while.body %x.017 = phi i64 [ %spec.select, %while.body ], [ undef, %entry ] %i.016 = phi i64 [ %inc, %while.body ], [ 1, %entry ] %rem = urem i64 %0, %i.016 %cmp1 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp1, i64 %i.016, i64 %x.017 %inc = add i64 %i.016, 1 %mul = mul i64 %inc, %inc %cmp.not = icmp ugt i64 %mul, %0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body %tobool.not19 = icmp ugt i64 %spec.select, %0 br i1 %tobool.not19, label %while.end6, label %while.body3.preheader while.body3.preheader: ; preds = %entry, %while.end %x.0.lcssa25 = phi i64 [ %spec.select, %while.end ], [ undef, %entry ] %div = udiv i64 %0, %x.0.lcssa25 br label %while.body3 while.body3: ; preds = %while.body3.preheader, %while.body3 %x.221 = phi i64 [ %inc4, %while.body3 ], [ 0, %while.body3.preheader ] %i.120 = phi i64 [ %div5, %while.body3 ], [ %div, %while.body3.preheader ] %inc4 = add i64 %x.221, 1 %div5 = udiv i64 %i.120, 10 %tobool.not = icmp ult i64 %i.120, 10 br i1 %tobool.not, label %while.end6, label %while.body3, !llvm.loop !11 while.end6: ; preds = %while.body3, %while.end %x.2.lcssa = phi i64 [ 0, %while.end ], [ %inc4, %while.body3 ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %x.2.lcssa) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp.not15.i = icmp eq i64 %0, 0 br i1 %cmp.not15.i, label %while.body3.preheader.i, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %x.017.i = phi i64 [ %spec.select.i, %while.body.i ], [ undef, %entry ] %i.016.i = phi i64 [ %inc.i, %while.body.i ], [ 1, %entry ] %rem.i = urem i64 %0, %i.016.i %cmp1.i = icmp eq i64 %rem.i, 0 %spec.select.i = select i1 %cmp1.i, i64 %i.016.i, i64 %x.017.i %inc.i = add i64 %i.016.i, 1 %mul.i = mul i64 %inc.i, %inc.i %cmp.not.i = icmp ugt i64 %mul.i, %0 br i1 %cmp.not.i, label %while.end.i, label %while.body.i, !llvm.loop !9 while.end.i: ; preds = %while.body.i %tobool.not19.i = icmp ugt i64 %spec.select.i, %0 br i1 %tobool.not19.i, label %solve.exit, label %while.body3.preheader.i while.body3.preheader.i: ; preds = %while.end.i, %entry %x.0.lcssa25.i = phi i64 [ %spec.select.i, %while.end.i ], [ undef, %entry ] %div.i = udiv i64 %0, %x.0.lcssa25.i br label %while.body3.i while.body3.i: ; preds = %while.body3.i, %while.body3.preheader.i %x.221.i = phi i64 [ %inc4.i, %while.body3.i ], [ 0, %while.body3.preheader.i ] %i.120.i = phi i64 [ %div5.i, %while.body3.i ], [ %div.i, %while.body3.preheader.i ] %inc4.i = add i64 %x.221.i, 1 %div5.i = udiv i64 %i.120.i, 10 %tobool.not.i = icmp ult i64 %i.120.i, 10 br i1 %tobool.not.i, label %solve.exit, label %while.body3.i, !llvm.loop !11 solve.exit: ; preds = %while.body3.i, %while.end.i %x.2.lcssa.i = phi i64 [ 0, %while.end.i ], [ %inc4.i, %while.body3.i ] %call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %x.2.lcssa.i) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #3 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 = { nofree nounwind "no-trapping-math"="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) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define NUMBER 4 int main(void){ int a[NUMBER],b[NUMBER]; int a_number[10],b_number[10]; int hit,blow; int i; while(scanf("%d",&a[0]) != EOF){ hit = blow = 0; for(i=0;i<10;i++){ a_number[i] = b_number[i] = 0; } a_number[a[0]]++; for(i=1;i<NUMBER;i++){ scanf("%d",&a[i]); a_number[a[i]]++; } for(i=0;i<NUMBER;i++){ scanf("%d",&b[i]); b_number[b[i]]++; } for(i=0;i<NUMBER;i++){ if(a[i] == b[i]) hit++; } for(i=0;i<10;i++){ blow += (a_number[i] < b_number[i]) ? a_number[i] :b_number[i]; } blow -= hit; printf("%d %d\n",hit,blow); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231591/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i32], align 16 %b = alloca [4 x i32], align 16 %a_number = alloca [10 x i32], align 16 %b_number = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a_number) #5 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %b_number) #5 %call98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not99 = icmp eq i32 %call98, -1 br i1 %cmp.not99, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %arrayidx13 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1 %arrayidx13.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2 %arrayidx13.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3 %arrayidx27.1 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1 %arrayidx27.2 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2 %arrayidx27.3 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3 %arrayidx53.8 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 8 %arrayidx55.8 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 8 %arrayidx53.9 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 9 %arrayidx55.9 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 9 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.cond.preheader call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %b_number, i8 0, i64 40, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %a_number, i8 0, i64 40, i1 false), !tbaa !5 %0 = load i32, ptr %a, align 16, !tbaa !5 %idxprom6 = sext i32 %0 to i64 %arrayidx7 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 %idxprom6 %1 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %inc8 = add nsw i32 %1, 1 store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx13) %2 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %idxprom17 = sext i32 %2 to i64 %arrayidx18 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 %idxprom17 %3 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %inc19 = add nsw i32 %3, 1 store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5 %call14.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx13.1) %4 = load i32, ptr %arrayidx13.1, align 8, !tbaa !5 %idxprom17.1 = sext i32 %4 to i64 %arrayidx18.1 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 %idxprom17.1 %5 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %inc19.1 = add nsw i32 %5, 1 store i32 %inc19.1, ptr %arrayidx18.1, align 4, !tbaa !5 %call14.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx13.2) %6 = load i32, ptr %arrayidx13.2, align 4, !tbaa !5 %idxprom17.2 = sext i32 %6 to i64 %arrayidx18.2 = getelementptr inbounds [10 x i32], ptr %a_number, i64 0, i64 %idxprom17.2 %7 = load i32, ptr %arrayidx18.2, align 4, !tbaa !5 %inc19.2 = add nsw i32 %7, 1 store i32 %inc19.2, ptr %arrayidx18.2, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %8 = load i32, ptr %b, align 16, !tbaa !5 %idxprom31 = sext i32 %8 to i64 %arrayidx32 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 %idxprom31 %9 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %inc33 = add nsw i32 %9, 1 store i32 %inc33, ptr %arrayidx32, align 4, !tbaa !5 %call28.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27.1) %10 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %idxprom31.1 = sext i32 %10 to i64 %arrayidx32.1 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 %idxprom31.1 %11 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5 %inc33.1 = add nsw i32 %11, 1 store i32 %inc33.1, ptr %arrayidx32.1, align 4, !tbaa !5 %call28.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27.2) %12 = load i32, ptr %arrayidx27.2, align 8, !tbaa !5 %idxprom31.2 = sext i32 %12 to i64 %arrayidx32.2 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 %idxprom31.2 %13 = load i32, ptr %arrayidx32.2, align 4, !tbaa !5 %inc33.2 = add nsw i32 %13, 1 store i32 %inc33.2, ptr %arrayidx32.2, align 4, !tbaa !5 %call28.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27.3) %14 = load i32, ptr %arrayidx53.8, align 16, !tbaa !5 %15 = load i32, ptr %arrayidx53.9, align 4, !tbaa !5 %16 = load <4 x i32>, ptr %b, align 16, !tbaa !5 %17 = extractelement <4 x i32> %16, i64 3 %idxprom31.3 = sext i32 %17 to i64 %arrayidx32.3 = getelementptr inbounds [10 x i32], ptr %b_number, i64 0, i64 %idxprom31.3 %18 = load i32, ptr %arrayidx32.3, align 4, !tbaa !5 %inc33.3 = add nsw i32 %18, 1 store i32 %inc33.3, ptr %arrayidx32.3, align 4, !tbaa !5 %19 = load <4 x i32>, ptr %a, align 16, !tbaa !5 %20 = icmp eq <4 x i32> %19, %16 %21 = load <8 x i32>, ptr %a_number, align 16, !tbaa !5 %22 = load <8 x i32>, ptr %b_number, align 16, !tbaa !5 %23 = call <8 x i32> @llvm.smin.v8i32(<8 x i32> %21, <8 x i32> %22) %24 = load i32, ptr %arrayidx55.8, align 16, !tbaa !5 %..8 = call i32 @llvm.smin.i32(i32 %14, i32 %24) %25 = load i32, ptr %arrayidx55.9, align 4, !tbaa !5 %..9 = call i32 @llvm.smin.i32(i32 %15, i32 %25) %26 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %23) %op.rdx = add i32 %26, %..8 %op.rdx105 = add i32 %op.rdx, %..9 %27 = bitcast <4 x i1> %20 to i4 %28 = call i4 @llvm.ctpop.i4(i4 %27), !range !9 %29 = zext i4 %28 to i32 %sub = sub nsw i32 %op.rdx105, %29 %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %29, i32 noundef %sub) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10 while.end: ; preds = %for.cond.preheader, %entry call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %b_number) #5 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a_number) #5 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <8 x i32> @llvm.smin.v8i32(<8 x i32>, <8 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.ctpop.i4(i4) #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 = { 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 = !{i4 0, i4 5} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int sum1[4], sum2[4]; int i, j, hit, blow; hit = blow = 0; while(scanf("%d%d%d%d\n%d%d%d%d", &sum1[0], &sum1[1], &sum1[2], &sum1[3], &sum2[0], &sum2[1], &sum2[2], &sum2[3]) != EOF){ for(i = 0; i < 4; i++){ for(j = 0; j < 4; j++) if(sum1[i] == sum2[j]) blow++; } for(i = 0; i< 4; i++) if(sum1[i] == sum2[i]) hit++; printf("%d %d\n", hit, blow-hit); hit = blow = 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231634/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%d%d%d%d\0A%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sum1 = alloca [4 x i32], align 16 %sum2 = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %sum1) #4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %sum2) #4 %arrayidx1 = getelementptr inbounds [4 x i32], ptr %sum1, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [4 x i32], ptr %sum1, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [4 x i32], ptr %sum1, i64 0, i64 3 %arrayidx5 = getelementptr inbounds [4 x i32], ptr %sum2, i64 0, i64 1 %arrayidx6 = getelementptr inbounds [4 x i32], ptr %sum2, i64 0, i64 2 %arrayidx7 = getelementptr inbounds [4 x i32], ptr %sum2, i64 0, i64 3 %call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum1, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %sum2, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7) %cmp.not54 = icmp eq i32 %call53, -1 br i1 %cmp.not54, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.preheader %0 = load <4 x i32>, ptr %sum2, align 16, !tbaa !5 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3> %2 = load <4 x i32>, ptr %sum1, align 16, !tbaa !5 %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3> %4 = icmp eq <16 x i32> %3, %1 %5 = zext <16 x i1> %4 to <16 x i32> %6 = extractelement <16 x i32> %5, i64 0 %7 = extractelement <16 x i32> %5, i64 5 %spec.select46.1 = add nuw nsw i32 %6, %7 %8 = extractelement <16 x i32> %5, i64 10 %spec.select46.2 = add nuw nsw i32 %spec.select46.1, %8 %9 = extractelement <16 x i32> %5, i64 15 %spec.select46.3 = add nuw nsw i32 %spec.select46.2, %9 %10 = bitcast <16 x i1> %4 to i16 %11 = call i16 @llvm.ctpop.i16(i16 %10), !range !9 %12 = zext i16 %11 to i32 %sub = sub nsw i32 %12, %spec.select46.3 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select46.3, i32 noundef %sub) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum1, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %sum2, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10 while.end: ; preds = %for.cond.preheader, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %sum2) #4 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %sum1) #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 i16 @llvm.ctpop.i16(i16) #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 = !{i16 0, i16 17} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a[4]; int b[4]; int i,j; int hit,blow; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF) { hit=0;blow=0; scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(a[i]==b[j]) { if(i==j){hit++;} else{blow++;} } } } printf("%d %d\n",hit,blow); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231685/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231685/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i32], align 16 %b = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #4 %arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3 %call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3) %cmp.not41 = icmp eq i32 %call40, -1 br i1 %cmp.not41, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1 %arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2 %arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7) %0 = load <4 x i32>, ptr %b, align 16, !tbaa !5 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 3, i32 0, i32 2, i32 3, i32 0, i32 1, i32 3, i32 0> %2 = load <4 x i32>, ptr %a, align 16, !tbaa !5 %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 3> %4 = icmp eq <8 x i32> %3, %1 %5 = bitcast <8 x i1> %4 to i8 %6 = call i8 @llvm.ctpop.i8(i8 %5), !range !9 %7 = zext i8 %6 to i32 %8 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 3, i32 3, i32 3, i32 2, i32 1, i32 0, i32 0, i32 0> %9 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 3, i32 2, i32 1, i32 2, i32 1, i32 2, i32 1, i32 0> %10 = icmp eq <8 x i32> %8, %9 %11 = extractelement <8 x i1> %10, i64 7 %spec.select = zext i1 %11 to i32 %12 = extractelement <8 x i1> %10, i64 6 %blow.2.1 = zext i1 %12 to i32 %inc19.2 = select i1 %12, i32 2, i32 1 %13 = extractelement <8 x i1> %10, i64 5 %blow.2.2 = select i1 %13, i32 %inc19.2, i32 %blow.2.1 %inc.1.1 = select i1 %11, i32 2, i32 1 %14 = extractelement <8 x i1> %10, i64 4 %hit.2.1.1 = select i1 %14, i32 %inc.1.1, i32 %spec.select %15 = extractelement <8 x i1> %10, i64 3 %inc.2.2 = zext i1 %15 to i32 %hit.2.2.2 = add nuw nsw i32 %hit.2.1.1, %inc.2.2 %16 = extractelement <8 x i1> %10, i64 2 %inc19.1.3 = zext i1 %16 to i32 %17 = extractelement <8 x i1> %10, i64 1 %inc19.2.3 = zext i1 %17 to i32 %op.rdx = add nuw nsw i32 %7, %inc19.1.3 %op.rdx74 = add nuw nsw i32 %blow.2.2, %inc19.2.3 %op.rdx75 = add nuw nsw i32 %op.rdx, %op.rdx74 %18 = extractelement <8 x i1> %10, i64 0 %inc.3.3 = zext i1 %18 to i32 %hit.2.3.3 = add nuw nsw i32 %hit.2.2.2, %inc.3.3 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %hit.2.3.3, i32 noundef %op.rdx75) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.ctpop.i8(i8) #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 = !{i8 0, i8 9} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int main(){ int i,a[4],b[4],t; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF){ scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); int blow=0,hit=0; for(i=0;i<4;i++){ if(a[i]==b[i]){ hit++; } } for(i=0;i<4;i++){ for(t=0;t<4;t++){ if(a[i]==b[t]){ blow++; } } } blow=blow-hit; printf("%d %d\n",hit,blow); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231735/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231735/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i32], align 16 %b = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #4 %arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2 %arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3 %call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3) %cmp.not56 = icmp eq i32 %call55, -1 br i1 %cmp.not56, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1 %arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2 %arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7) %0 = load <4 x i32>, ptr %a, align 16, !tbaa !5 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3> %2 = load <4 x i32>, ptr %b, align 16, !tbaa !5 %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3> %4 = icmp eq <16 x i32> %1, %3 %5 = zext <16 x i1> %4 to <16 x i32> %6 = bitcast <16 x i1> %4 to i16 %7 = call i16 @llvm.ctpop.i16(i16 %6), !range !9 %8 = zext i16 %7 to i32 %9 = extractelement <16 x i32> %5, i64 0 %10 = extractelement <16 x i32> %5, i64 5 %spec.select.1 = add nuw nsw i32 %9, %10 %11 = extractelement <16 x i32> %5, i64 10 %spec.select.2 = add nuw nsw i32 %spec.select.1, %11 %12 = extractelement <16 x i32> %5, i64 15 %spec.select.3 = add nuw nsw i32 %spec.select.2, %12 %sub = sub nsw i32 %8, %spec.select.3 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.3, i32 noundef %sub) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #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 = !{i16 0, i16 17} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a[4], b[4]; int hit, blow; int i, j; while (scanf("%d", &a[0]) != EOF){ hit = blow = 0; for (i = 1; i < 4; i++){ scanf("%d", &a[i]); } for (i = 0; i < 4; i++){ scanf("%d", &b[i]); if (a[i] == b[i]){ hit++; a[i] = -2; } } for (i = 0; i < 4; i++){ for (j = 0; j < 4; j++){ if (a[i] == b[j]){ blow++; a[i] = -2; break; } } } printf("%d %d\n", hit, blow); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231786/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231786/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i32], align 16 %b = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #3 %call66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not67 = icmp eq i32 %call66, -1 br i1 %cmp.not67, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1 %arrayidx2.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2 %arrayidx2.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3 %arrayidx8.1 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1 %arrayidx8.2 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2 %arrayidx8.3 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.inc40.3 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2) %call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2.1) %call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2.2) %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 16, !tbaa !5 %1 = load i32, ptr %b, align 16, !tbaa !5 %cmp14 = icmp eq i32 %0, %1 br i1 %cmp14, label %if.then, label %for.inc18 if.then: ; preds = %for.cond.preheader store i32 -2, ptr %a, align 16, !tbaa !5 br label %for.inc18 for.inc18: ; preds = %for.cond.preheader, %if.then %hit.1 = phi i32 [ 1, %if.then ], [ 0, %for.cond.preheader ] %call9.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.1) %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %cmp14.1 = icmp eq i32 %2, %3 br i1 %cmp14.1, label %if.then.1, label %for.inc18.1 if.then.1: ; preds = %for.inc18 %inc15.1 = add nuw nsw i32 %hit.1, 1 store i32 -2, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc18.1 for.inc18.1: ; preds = %if.then.1, %for.inc18 %hit.1.1 = phi i32 [ %inc15.1, %if.then.1 ], [ %hit.1, %for.inc18 ] %call9.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.2) %4 = load i32, ptr %arrayidx2.1, align 8, !tbaa !5 %5 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5 %cmp14.2 = icmp eq i32 %4, %5 br i1 %cmp14.2, label %if.then.2, label %for.inc18.2 if.then.2: ; preds = %for.inc18.1 %inc15.2 = add nuw nsw i32 %hit.1.1, 1 store i32 -2, ptr %arrayidx2.1, align 8, !tbaa !5 br label %for.inc18.2 for.inc18.2: ; preds = %if.then.2, %for.inc18.1 %hit.1.2 = phi i32 [ %inc15.2, %if.then.2 ], [ %hit.1.1, %for.inc18.1 ] %call9.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.3) %6 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5 %cmp14.3 = icmp eq i32 %6, %7 br i1 %cmp14.3, label %if.then.3, label %for.inc18.3 if.then.3: ; preds = %for.inc18.2 %inc15.3 = add nuw nsw i32 %hit.1.2, 1 store i32 -2, ptr %arrayidx2.2, align 4, !tbaa !5 br label %for.inc18.3 for.inc18.3: ; preds = %if.then.3, %for.inc18.2 %8 = phi i32 [ -2, %if.then.3 ], [ %6, %for.inc18.2 ] %hit.1.3 = phi i32 [ %inc15.3, %if.then.3 ], [ %hit.1.2, %for.inc18.2 ] %9 = load i32, ptr %a, align 16, !tbaa !5 %10 = load i32, ptr %b, align 16, !tbaa !5 %cmp31 = icmp eq i32 %9, %10 %11 = load i32, ptr %arrayidx8.1, align 4 %cmp31.1 = icmp eq i32 %9, %11 %or.cond = select i1 %cmp31, i1 true, i1 %cmp31.1 %12 = load i32, ptr %arrayidx8.2, align 8 %cmp31.2 = icmp eq i32 %9, %12 %or.cond78 = select i1 %or.cond, i1 true, i1 %cmp31.2 %cmp31.3 = icmp eq i32 %9, %7 %or.cond79 = or i1 %or.cond78, %cmp31.3 br i1 %or.cond79, label %if.then32, label %for.inc40 if.then32: ; preds = %for.inc18.3 store i32 -2, ptr %a, align 16, !tbaa !5 br label %for.inc40 for.inc40: ; preds = %for.inc18.3, %if.then32 %blow.1 = phi i32 [ 1, %if.then32 ], [ 0, %for.inc18.3 ] %13 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp31.172 = icmp eq i32 %13, %10 %14 = load i32, ptr %arrayidx8.1, align 4 %cmp31.1.1 = icmp eq i32 %13, %14 %or.cond80 = select i1 %cmp31.172, i1 true, i1 %cmp31.1.1 %15 = load i32, ptr %arrayidx8.2, align 8 %cmp31.2.1 = icmp eq i32 %13, %15 %or.cond81 = select i1 %or.cond80, i1 true, i1 %cmp31.2.1 %cmp31.3.1 = icmp eq i32 %13, %7 %or.cond82 = or i1 %or.cond81, %cmp31.3.1 br i1 %or.cond82, label %if.then32.1, label %for.inc40.1 if.then32.1: ; preds = %for.inc40 %inc33.1 = add nuw nsw i32 %blow.1, 1 store i32 -2, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc40.1 for.inc40.1: ; preds = %for.inc40, %if.then32.1 %blow.1.1 = phi i32 [ %inc33.1, %if.then32.1 ], [ %blow.1, %for.inc40 ] %16 = load i32, ptr %arrayidx2.1, align 8, !tbaa !5 %cmp31.274 = icmp eq i32 %16, %10 %17 = load i32, ptr %arrayidx8.1, align 4 %cmp31.1.2 = icmp eq i32 %16, %17 %or.cond83 = select i1 %cmp31.274, i1 true, i1 %cmp31.1.2 %18 = load i32, ptr %arrayidx8.2, align 8 %cmp31.2.2 = icmp eq i32 %16, %18 %or.cond84 = select i1 %or.cond83, i1 true, i1 %cmp31.2.2 %cmp31.3.2 = icmp eq i32 %16, %7 %or.cond85 = or i1 %or.cond84, %cmp31.3.2 br i1 %or.cond85, label %if.then32.2, label %for.inc40.2 if.then32.2: ; preds = %for.inc40.1 %inc33.2 = add nuw nsw i32 %blow.1.1, 1 store i32 -2, ptr %arrayidx2.1, align 8, !tbaa !5 br label %for.inc40.2 for.inc40.2: ; preds = %for.inc40.1, %if.then32.2 %blow.1.2 = phi i32 [ %inc33.2, %if.then32.2 ], [ %blow.1.1, %for.inc40.1 ] %cmp31.376 = icmp eq i32 %8, %10 %19 = load i32, ptr %arrayidx8.1, align 4 %cmp31.1.3 = icmp eq i32 %8, %19 %or.cond86 = select i1 %cmp31.376, i1 true, i1 %cmp31.1.3 %20 = load i32, ptr %arrayidx8.2, align 8 %cmp31.2.3 = icmp eq i32 %8, %20 %or.cond87 = select i1 %or.cond86, i1 true, i1 %cmp31.2.3 %cmp31.3.3 = icmp eq i32 %8, %7 %or.cond88 = or i1 %or.cond87, %cmp31.3.3 br i1 %or.cond88, label %if.then32.3, label %for.inc40.3 if.then32.3: ; preds = %for.inc40.2 %inc33.3 = add nuw nsw i32 %blow.1.2, 1 store i32 -2, ptr %arrayidx2.2, align 4, !tbaa !5 br label %for.inc40.3 for.inc40.3: ; preds = %for.inc40.2, %if.then32.3 %blow.1.3 = phi i32 [ %inc33.3, %if.then32.3 ], [ %blow.1.2, %for.inc40.2 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %hit.1.3, i32 noundef %blow.1.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %for.inc40.3, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 16, 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> // printf(), scanf() #define MAX_N 100 #define MAX_W 10000 int n, W; int v[MAX_N], w[MAX_N], m[MAX_N]; int solve() { int dp[MAX_W + 1]; int deq[MAX_W + 1]; // ?????????(??????????????????) int deqv[MAX_W + 1]; // ?????????(???) int a; int i, j; for (i = 0; i <= MAX_W; ++i) dp[i] = 0; for (i = 0; i < n; ++i) { for (a = 0; a < w[i]; ++a) { int s = 0, t = 0; // ????????????????????¨????°? for (j = 0; j * w[i] + a <= W; ++j) { // ????????????????°???? j ????????? int val = dp[j * w[i] + a] - j * v[i]; while (s < t && deqv[t - 1] <= val) t--; deq[t] = j; deqv[t++] = val; // ????????????????????????????????? dp[j * w[i] + a] = deqv[s] + j * v[i]; if (deq[s] == j - m[i]) s++; } } } return dp[W]; } int main(int argc, char** argv) { int i; scanf("%d %d", &n, &W); for (i = 0; i < n; ++i) scanf("%d %d %d", &v[i], &w[i], &m[i]); printf("%d\n", solve()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231829/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231829/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @w = dso_local global [100 x i32] zeroinitializer, align 16 @W = dso_local global i32 0, align 4 @v = dso_local global [100 x i32] zeroinitializer, align 16 @m = dso_local global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @solve() local_unnamed_addr #0 { entry: %dp = alloca [10001 x i32], align 16 %deq = alloca [10001 x i32], align 16 %deqv = alloca [10001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %dp) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deq) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deqv) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40004) %dp, i8 0, i64 40004, i1 false), !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp2101 = icmp sgt i32 %0, 0 %.pre = load i32, ptr @W, align 4 %1 = sext i32 %.pre to i64 br i1 %cmp2101, label %for.cond4.preheader.lr.ph, label %for.end60 for.cond4.preheader.lr.ph: ; preds = %entry %wide.trip.count118 = zext i32 %0 to i64 br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond4.preheader.lr.ph, %for.inc58 %indvars.iv115 = phi i64 [ 0, %for.cond4.preheader.lr.ph ], [ %indvars.iv.next116, %for.inc58 ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr @w, i64 0, i64 %indvars.iv115 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp799 = icmp sgt i32 %2, 0 br i1 %cmp799, label %for.cond9.preheader.lr.ph, label %for.inc58 for.cond9.preheader.lr.ph: ; preds = %for.cond4.preheader %arrayidx21 = getelementptr inbounds [100 x i32], ptr @v, i64 0, i64 %indvars.iv115 %arrayidx48 = getelementptr inbounds [100 x i32], ptr @m, i64 0, i64 %indvars.iv115 %3 = zext i32 %2 to i64 %wide.trip.count = zext i32 %2 to i64 br label %for.cond9.preheader for.cond9.preheader: ; preds = %for.cond9.preheader.lr.ph, %for.end54 %indvars.iv112 = phi i64 [ 0, %for.cond9.preheader.lr.ph ], [ %indvars.iv.next113, %for.end54 ] %cmp12.not94 = icmp sgt i64 %indvars.iv112, %1 br i1 %cmp12.not94, label %for.end54, label %for.body13.lr.ph for.body13.lr.ph: ; preds = %for.cond9.preheader %4 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx48, align 4, !tbaa !5 br label %for.body13 for.body13: ; preds = %for.body13.lr.ph, %while.end %indvars.iv105 = phi i64 [ 0, %for.body13.lr.ph ], [ %indvars.iv.next106, %while.end ] %add98.in = phi i64 [ %indvars.iv112, %for.body13.lr.ph ], [ %19, %while.end ] %t.097 = phi i32 [ 0, %for.body13.lr.ph ], [ %inc30, %while.end ] %s.096 = phi i32 [ 0, %for.body13.lr.ph ], [ %spec.select, %while.end ] %sext = shl i64 %add98.in, 32 %idxprom18 = ashr exact i64 %sext, 32 %arrayidx19 = getelementptr inbounds [10001 x i32], ptr %dp, i64 0, i64 %idxprom18 %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %7 = trunc i64 %indvars.iv105 to i32 %8 = mul i32 %4, %7 %sub = sub nsw i32 %6, %8 %9 = sext i32 %t.097 to i64 %10 = zext i32 %s.096 to i64 %smin = tail call i32 @llvm.smin.i32(i32 %t.097, i32 %s.096) br label %while.cond while.cond: ; preds = %land.rhs, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %land.rhs ], [ %9, %for.body13 ] %cmp23 = icmp sgt i64 %indvars.iv, %10 br i1 %cmp23, label %land.rhs, label %while.end land.rhs: ; preds = %while.cond %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx26 = getelementptr inbounds [10001 x i32], ptr %deqv, i64 0, i64 %indvars.iv.next %11 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %cmp27.not = icmp sgt i32 %11, %sub br i1 %cmp27.not, label %while.end.split.loop.exit121, label %while.cond, !llvm.loop !9 while.end.split.loop.exit121: ; preds = %land.rhs %12 = trunc i64 %indvars.iv to i32 br label %while.end while.end: ; preds = %while.cond, %while.end.split.loop.exit121 %t.1.lcssa = phi i32 [ %12, %while.end.split.loop.exit121 ], [ %smin, %while.cond ] %idxprom28 = sext i32 %t.1.lcssa to i64 %arrayidx29 = getelementptr inbounds [10001 x i32], ptr %deq, i64 0, i64 %idxprom28 %13 = trunc i64 %indvars.iv105 to i32 store i32 %13, ptr %arrayidx29, align 4, !tbaa !5 %inc30 = add nsw i32 %t.1.lcssa, 1 %arrayidx32 = getelementptr inbounds [10001 x i32], ptr %deqv, i64 0, i64 %idxprom28 store i32 %sub, ptr %arrayidx32, align 4, !tbaa !5 %idxprom33 = zext i32 %s.096 to i64 %arrayidx34 = getelementptr inbounds [10001 x i32], ptr %deqv, i64 0, i64 %idxprom33 %14 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add38 = add nsw i32 %14, %8 store i32 %add38, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx46 = getelementptr inbounds [10001 x i32], ptr %deq, i64 0, i64 %idxprom33 %15 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %16 = trunc i64 %indvars.iv105 to i32 %17 = sub i32 %16, %5 %cmp50 = icmp eq i32 %15, %17 %inc51 = zext i1 %cmp50 to i32 %spec.select = add nuw nsw i32 %s.096, %inc51 %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %18 = mul nsw i64 %indvars.iv.next106, %3 %19 = add nuw nsw i64 %18, %indvars.iv112 %cmp12.not = icmp sgt i64 %19, %1 br i1 %cmp12.not, label %for.end54, label %for.body13, !llvm.loop !11 for.end54: ; preds = %while.end, %for.cond9.preheader %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count br i1 %exitcond.not, label %for.inc58, label %for.cond9.preheader, !llvm.loop !12 for.inc58: ; preds = %for.end54, %for.cond4.preheader %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1 %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118 br i1 %exitcond119.not, label %for.end60, label %for.cond4.preheader, !llvm.loop !13 for.end60: ; preds = %for.inc58, %entry %arrayidx62 = getelementptr inbounds [10001 x i32], ptr %dp, i64 0, i64 %1 %20 = load i32, ptr %arrayidx62, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %deqv) #6 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %deq) #6 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %dp) #6 ret i32 %20 } ; 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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { entry: %dp.i = alloca [10001 x i32], align 16 %deq.i = alloca [10001 x i32], align 16 %deqv.i = alloca [10001 x i32], align 16 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @W) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 0 br i1 %cmp13, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %dp.i) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deq.i) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deqv.i) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40004) %dp.i, i8 0, i64 40004, i1 false), !tbaa !5 %.pre.i20 = load i32, ptr @W, align 4 %1 = sext i32 %.pre.i20 to i64 br label %solve.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 @v, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i32], ptr @w, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [100 x i32], ptr @m, i64 0, i64 %indvars.iv %call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr @n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %dp.i) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deq.i) #6 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %deqv.i) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40004) %dp.i, i8 0, i64 40004, i1 false), !tbaa !5 %cmp2101.i = icmp sgt i32 %2, 0 %.pre.i = load i32, ptr @W, align 4 %4 = sext i32 %.pre.i to i64 br i1 %cmp2101.i, label %for.cond4.preheader.lr.ph.i, label %solve.exit for.cond4.preheader.lr.ph.i: ; preds = %for.end %wide.trip.count118.i = zext i32 %2 to i64 br label %for.cond4.preheader.i for.cond4.preheader.i: ; preds = %for.inc58.i, %for.cond4.preheader.lr.ph.i %indvars.iv115.i = phi i64 [ 0, %for.cond4.preheader.lr.ph.i ], [ %indvars.iv.next116.i, %for.inc58.i ] %arrayidx6.i = getelementptr inbounds [100 x i32], ptr @w, i64 0, i64 %indvars.iv115.i %5 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5 %cmp799.i = icmp sgt i32 %5, 0 br i1 %cmp799.i, label %for.cond9.preheader.lr.ph.i, label %for.inc58.i for.cond9.preheader.lr.ph.i: ; preds = %for.cond4.preheader.i %arrayidx21.i = getelementptr inbounds [100 x i32], ptr @v, i64 0, i64 %indvars.iv115.i %arrayidx48.i = getelementptr inbounds [100 x i32], ptr @m, i64 0, i64 %indvars.iv115.i %6 = zext i32 %5 to i64 br label %for.cond9.preheader.i for.cond9.preheader.i: ; preds = %for.end54.i, %for.cond9.preheader.lr.ph.i %indvars.iv112.i = phi i64 [ 0, %for.cond9.preheader.lr.ph.i ], [ %indvars.iv.next113.i, %for.end54.i ] %cmp12.not94.i = icmp sgt i64 %indvars.iv112.i, %4 br i1 %cmp12.not94.i, label %for.end54.i, label %for.body13.lr.ph.i for.body13.lr.ph.i: ; preds = %for.cond9.preheader.i %7 = load i32, ptr %arrayidx21.i, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx48.i, align 4, !tbaa !5 br label %for.body13.i for.body13.i: ; preds = %while.end.i, %for.body13.lr.ph.i %indvars.iv105.i = phi i64 [ 0, %for.body13.lr.ph.i ], [ %indvars.iv.next106.i, %while.end.i ] %add98.in.i = phi i64 [ %indvars.iv112.i, %for.body13.lr.ph.i ], [ %20, %while.end.i ] %t.097.i = phi i32 [ 0, %for.body13.lr.ph.i ], [ %inc30.i, %while.end.i ] %s.096.i = phi i32 [ 0, %for.body13.lr.ph.i ], [ %spec.select.i, %while.end.i ] %sext.i = shl i64 %add98.in.i, 32 %idxprom18.i = ashr exact i64 %sext.i, 32 %arrayidx19.i = getelementptr inbounds [10001 x i32], ptr %dp.i, i64 0, i64 %idxprom18.i %9 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5 %10 = trunc i64 %indvars.iv105.i to i32 %11 = mul i32 %7, %10 %sub.i = sub nsw i32 %9, %11 %12 = sext i32 %t.097.i to i64 %13 = zext i32 %s.096.i to i64 %smin.i = tail call i32 @llvm.smin.i32(i32 %t.097.i, i32 %s.096.i) br label %while.cond.i while.cond.i: ; preds = %land.rhs.i, %for.body13.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %land.rhs.i ], [ %12, %for.body13.i ] %cmp23.i = icmp sgt i64 %indvars.iv.i, %13 br i1 %cmp23.i, label %land.rhs.i, label %while.end.i land.rhs.i: ; preds = %while.cond.i %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx26.i = getelementptr inbounds [10001 x i32], ptr %deqv.i, i64 0, i64 %indvars.iv.next.i %14 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5 %cmp27.not.i = icmp sgt i32 %14, %sub.i br i1 %cmp27.not.i, label %while.end.split.loop.exit121.i, label %while.cond.i, !llvm.loop !9 while.end.split.loop.exit121.i: ; preds = %land.rhs.i %15 = trunc i64 %indvars.iv.i to i32 br label %while.end.i while.end.i: ; preds = %while.cond.i, %while.end.split.loop.exit121.i %t.1.lcssa.i = phi i32 [ %15, %while.end.split.loop.exit121.i ], [ %smin.i, %while.cond.i ] %idxprom28.i = sext i32 %t.1.lcssa.i to i64 %arrayidx29.i = getelementptr inbounds [10001 x i32], ptr %deq.i, i64 0, i64 %idxprom28.i store i32 %10, ptr %arrayidx29.i, align 4, !tbaa !5 %inc30.i = add nsw i32 %t.1.lcssa.i, 1 %arrayidx32.i = getelementptr inbounds [10001 x i32], ptr %deqv.i, i64 0, i64 %idxprom28.i store i32 %sub.i, ptr %arrayidx32.i, align 4, !tbaa !5 %arrayidx34.i = getelementptr inbounds [10001 x i32], ptr %deqv.i, i64 0, i64 %13 %16 = load i32, ptr %arrayidx34.i, align 4, !tbaa !5 %add38.i = add nsw i32 %16, %11 store i32 %add38.i, ptr %arrayidx19.i, align 4, !tbaa !5 %arrayidx46.i = getelementptr inbounds [10001 x i32], ptr %deq.i, i64 0, i64 %13 %17 = load i32, ptr %arrayidx46.i, align 4, !tbaa !5 %18 = sub i32 %10, %8 %cmp50.i = icmp eq i32 %17, %18 %inc51.i = zext i1 %cmp50.i to i32 %spec.select.i = add nuw nsw i32 %s.096.i, %inc51.i %indvars.iv.next106.i = add nuw nsw i64 %indvars.iv105.i, 1 %19 = mul nsw i64 %indvars.iv.next106.i, %6 %20 = add nuw nsw i64 %19, %indvars.iv112.i %cmp12.not.i = icmp sgt i64 %20, %4 br i1 %cmp12.not.i, label %for.end54.i, label %for.body13.i, !llvm.loop !11 for.end54.i: ; preds = %while.end.i, %for.cond9.preheader.i %indvars.iv.next113.i = add nuw nsw i64 %indvars.iv112.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next113.i, %6 br i1 %exitcond.not.i, label %for.inc58.i, label %for.cond9.preheader.i, !llvm.loop !12 for.inc58.i: ; preds = %for.end54.i, %for.cond4.preheader.i %indvars.iv.next116.i = add nuw nsw i64 %indvars.iv115.i, 1 %exitcond119.not.i = icmp eq i64 %indvars.iv.next116.i, %wide.trip.count118.i br i1 %exitcond119.not.i, label %solve.exit, label %for.cond4.preheader.i, !llvm.loop !13 solve.exit: ; preds = %for.inc58.i, %for.end.thread, %for.end %21 = phi i64 [ %1, %for.end.thread ], [ %4, %for.end ], [ %4, %for.inc58.i ] %arrayidx62.i = getelementptr inbounds [10001 x i32], ptr %dp.i, i64 0, i64 %21 %22 = load i32, ptr %arrayidx62.i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %deqv.i) #6 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %deq.i) #6 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %dp.i) #6 %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { 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 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> long min2(long a,long b){ return a>=b?b:a; } int compare(const void *a, const void *b){return *(long *)a - *(long *)b;} int sqs(long a[],long n,long s){ if(s==4){qsort(a,n,sizeof(long),compare);} return 0; } long mod(long a,long b){ return a/b?mod(a%b,b):a; } long comb(long a,long b){ if(a==1) return 1; if(b==0 || b==a) return 1; return comb(a-1,b-1)+comb(a-1,b);} int main(void){ long l,r,i,j/*c,ju*/; scanf("%ld%ld",&l,&r); //printf("%ld\n",l); if(r-l>=2019){ printf("0\n"); return 0; } if(l<=r/2019*2019){ printf("0\n"); return 0; } l=mod(l,2019); r=mod(r,2019); // long by[2019],k=0; // for(i=0;i<2019;i++){ // by[i]=10000; // } long min=10000; for(i=l;i<r;i++){ for(j=i+1;j<r+1;j++){ //ju=0; // if(k>0){ // for(c=0;c<k;c++){ // if(by[c]== mod(i*j,2019)){ // ju=1; // break; // } // } // } // if(ju==1) continue; // by[k] = mod(i*j,2019); // k++; // if(k==2019) break; min = min2(min,mod(i*j,2019)); } } printf("%ld\n",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231887/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231887/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @sqs(ptr noundef %a, i64 noundef %n, i64 noundef %s) local_unnamed_addr #2 { entry: %cmp = icmp eq i64 %s, 4 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry tail call void @qsort(ptr noundef %a, i64 noundef %n, i64 noundef 8, ptr noundef nonnull @compare) #10 br label %if.end if.end: ; preds = %if.then, %entry ret i32 0 } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %div5 = sdiv i64 %a, %b %rem = srem i64 %a, %b %tobool.not6 = icmp eq i64 %div5, 0 %spec.select = select i1 %tobool.not6, i64 %a, i64 %rem ret i64 %spec.select } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @comb(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %cmp14 = icmp eq i64 %a, 1 br i1 %cmp14, label %return, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry %cmp1 = icmp eq i64 %b, 0 %sub5 = add nsw i64 %b, -1 br i1 %cmp1, label %return, label %if.end if.end: ; preds = %if.end.lr.ph, %if.end4 %a.tr16 = phi i64 [ %sub, %if.end4 ], [ %a, %if.end.lr.ph ] %accumulator.tr15 = phi i64 [ %add, %if.end4 ], [ 0, %if.end.lr.ph ] %cmp2 = icmp eq i64 %a.tr16, %b br i1 %cmp2, label %return.loopexit, label %if.end4 if.end4: ; preds = %if.end %sub = add nsw i64 %a.tr16, -1 %call = tail call i64 @comb(i64 noundef %sub, i64 noundef %sub5) %add = add nsw i64 %call, %accumulator.tr15 %cmp = icmp eq i64 %sub, 1 br i1 %cmp, label %return.loopexit, label %if.end return.loopexit: ; preds = %if.end, %if.end4 %accumulator.tr.lcssa.ph = phi i64 [ %add, %if.end4 ], [ %accumulator.tr15, %if.end ] %0 = add nsw i64 %accumulator.tr.lcssa.ph, 1 br label %return return: ; preds = %return.loopexit, %if.end.lr.ph, %entry %accumulator.tr.lcssa = phi i64 [ 1, %entry ], [ 1, %if.end.lr.ph ], [ %0, %return.loopexit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %l = alloca i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #10 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r) %0 = load i64, ptr %r, align 8, !tbaa !5 %.fr = freeze i64 %0 %1 = load i64, ptr %l, align 8, !tbaa !5 %sub = sub nsw i64 %.fr, %1 %cmp = icmp sgt i64 %sub, 2018 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts29 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end: ; preds = %entry %2 = srem i64 %.fr, 2019 %mul = sub nsw i64 %.fr, %2 %cmp2.not = icmp sgt i64 %1, %mul br i1 %cmp2.not, label %if.end5, label %if.then3 if.then3: ; preds = %if.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end5: ; preds = %if.end %.off = add i64 %1, 2018 %tobool.not6.i = icmp ult i64 %.off, 4037 %rem.i = srem i64 %1, 2019 %a.tr.lcssa.i = select i1 %tobool.not6.i, i64 %1, i64 %rem.i store i64 %a.tr.lcssa.i, ptr %l, align 8, !tbaa !5 %.fr.off = add i64 %.fr, 2018 %tobool.not6.i31 = icmp ult i64 %.fr.off, 4037 %a.tr.lcssa.i34 = select i1 %tobool.not6.i31, i64 %.fr, i64 %2 store i64 %a.tr.lcssa.i34, ptr %r, align 8, !tbaa !5 %cmp845 = icmp slt i64 %a.tr.lcssa.i, %a.tr.lcssa.i34 br i1 %cmp845, label %for.body12.preheader, label %for.end18 for.cond.loopexit: ; preds = %for.body12 %exitcond.not = icmp eq i64 %add, %a.tr.lcssa.i34 br i1 %exitcond.not, label %for.end18, label %for.body12.preheader, !llvm.loop !9 for.body12.preheader: ; preds = %if.end5, %for.cond.loopexit %min.047 = phi i64 [ %cond.i, %for.cond.loopexit ], [ 10000, %if.end5 ] %i.046 = phi i64 [ %add, %for.cond.loopexit ], [ %a.tr.lcssa.i, %if.end5 ] %add = add nsw i64 %i.046, 1 br label %for.body12 for.body12: ; preds = %for.body12.preheader, %for.body12 %min.144 = phi i64 [ %cond.i, %for.body12 ], [ %min.047, %for.body12.preheader ] %j.043 = phi i64 [ %inc, %for.body12 ], [ %add, %for.body12.preheader ] %mul13 = mul nsw i64 %j.043, %i.046 %mul13.off = add i64 %mul13, 2018 %tobool.not6.i37 = icmp ult i64 %mul13.off, 4037 %rem.i39 = srem i64 %mul13, 2019 %a.tr.lcssa.i40 = select i1 %tobool.not6.i37, i64 %mul13, i64 %rem.i39 %cond.i = call i64 @llvm.smin.i64(i64 %min.144, i64 %a.tr.lcssa.i40) %inc = add nsw i64 %j.043, 1 %cmp11.not.not = icmp slt i64 %j.043, %a.tr.lcssa.i34 br i1 %cmp11.not.not, label %for.body12, label %for.cond.loopexit, !llvm.loop !11 for.end18: ; preds = %for.cond.loopexit, %if.end5 %min.0.lcssa = phi i64 [ 10000, %if.end5 ], [ %cond.i, %for.cond.loopexit ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %min.0.lcssa) br label %cleanup cleanup: ; preds = %for.end18, %if.then3, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #10 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { 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 #5 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nofree nounwind } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<stdlib.h> int cucu(int a, int b) { while (a != b) { if (a > b) a = a - b; else b = b - a; //printf("a=%d b=%d\n", a, b); } return a; } int main(void) { int a = 0, b = 0, unu = 0, doi = 0, gcd = 0, lcm = 0, no = 0; scanf("%d %d %d %d", &unu, &doi, &a, &b); lcm = (unu * doi) /cucu(unu, doi); no = b /lcm - a/lcm + ((a%lcm == 0) ?1:0); printf("%d", no); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23193/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23193/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @cucu(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp.not10 = icmp eq i32 %a, %b br i1 %cmp.not10, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %b.addr.012 = phi i32 [ %b.addr.1, %while.body ], [ %b, %entry ] %a.addr.011 = phi i32 [ %a.addr.1, %while.body ], [ %a, %entry ] %cmp1 = icmp sgt i32 %a.addr.011, %b.addr.012 %sub = select i1 %cmp1, i32 %b.addr.012, i32 0 %a.addr.1 = sub nsw i32 %a.addr.011, %sub %sub2 = select i1 %cmp1, i32 0, i32 %a.addr.011 %b.addr.1 = sub nsw i32 %b.addr.012, %sub2 %cmp.not = icmp eq i32 %a.addr.1, %b.addr.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %a.addr.1, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %unu = alloca i32, align 4 %doi = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 store i32 0, ptr %a, align 4, !tbaa !7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 store i32 0, ptr %b, align 4, !tbaa !7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %unu) #4 store i32 0, ptr %unu, align 4, !tbaa !7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %doi) #4 store i32 0, ptr %doi, align 4, !tbaa !7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %unu, ptr noundef nonnull %doi, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %unu, align 4, !tbaa !7 %1 = load i32, ptr %doi, align 4, !tbaa !7 %cmp.not10.i = icmp eq i32 %0, %1 br i1 %cmp.not10.i, label %cucu.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %b.addr.012.i = phi i32 [ %b.addr.1.i, %while.body.i ], [ %1, %entry ] %a.addr.011.i = phi i32 [ %a.addr.1.i, %while.body.i ], [ %0, %entry ] %cmp1.i = icmp sgt i32 %a.addr.011.i, %b.addr.012.i %sub.i = select i1 %cmp1.i, i32 %b.addr.012.i, i32 0 %a.addr.1.i = sub nsw i32 %a.addr.011.i, %sub.i %sub2.i = select i1 %cmp1.i, i32 0, i32 %a.addr.011.i %b.addr.1.i = sub nsw i32 %b.addr.012.i, %sub2.i %cmp.not.i = icmp eq i32 %a.addr.1.i, %b.addr.1.i br i1 %cmp.not.i, label %cucu.exit, label %while.body.i, !llvm.loop !5 cucu.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %0, %entry ], [ %a.addr.1.i, %while.body.i ] %mul = mul nsw i32 %1, %0 %div = sdiv i32 %mul, %a.addr.0.lcssa.i %2 = load i32, ptr %b, align 4, !tbaa !7 %div2 = sdiv i32 %2, %div %3 = load i32, ptr %a, align 4, !tbaa !7 %div3 = sdiv i32 %3, %div %sub = sub i32 %div2, %div3 %rem = srem i32 %3, %div %cmp = icmp eq i32 %rem, 0 %cond = zext i1 %cmp to i32 %add = add nsw i32 %sub, %cond %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %doi) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %unu) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define min(X, Y) ((X) < (Y) ? (X) : (Y)) typedef long long ll; int main() { ll ans = 2020; ll l, r; scanf("%lld %lld", &l, &r); for (ll i = l; i <= min(l + 2019, r); i++) { for (ll j = i + 1; j <= min(l + 2019, r); j++) { ans = min(ans, (i * j) % 2019); } } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231973/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231973/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r) %0 = load i64, ptr %l, align 8 %add = add nsw i64 %0, 2019 %1 = load i64, ptr %r, align 8 %cond = call i64 @llvm.smin.i64(i64 %add, i64 %1) %cmp2.not38 = icmp slt i64 %1, %0 br i1 %cmp2.not38, label %for.cond.cleanup, label %for.body for.cond.loopexit: ; preds = %for.body14 br i1 %cmp12.not35.not, label %for.body, label %for.cond.cleanup, !llvm.loop !5 for.cond.cleanup: ; preds = %for.body, %for.cond.loopexit, %entry %ans.0.lcssa = phi i64 [ 2020, %entry ], [ %ans.039, %for.body ], [ %ans.1.rem, %for.cond.loopexit ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #4 ret i32 0 for.body: ; preds = %entry, %for.cond.loopexit %i.040 = phi i64 [ %add3, %for.cond.loopexit ], [ %0, %entry ] %ans.039 = phi i64 [ %ans.1.rem, %for.cond.loopexit ], [ 2020, %entry ] %add3 = add nsw i64 %i.040, 1 %cmp12.not35.not = icmp slt i64 %i.040, %cond br i1 %cmp12.not35.not, label %for.body14, label %for.cond.cleanup for.body14: ; preds = %for.body, %for.body14 %j.037 = phi i64 [ %inc, %for.body14 ], [ %add3, %for.body ] %ans.136 = phi i64 [ %ans.1.rem, %for.body14 ], [ %ans.039, %for.body ] %mul = mul nsw i64 %j.037, %i.040 %rem = srem i64 %mul, 2019 %ans.1.rem = call i64 @llvm.smin.i64(i64 %ans.136, i64 %rem) %inc = add nsw i64 %j.037, 1 %cmp12.not.not = icmp slt i64 %j.037, %cond br i1 %cmp12.not.not, label %for.body14, label %for.cond.loopexit, !llvm.loop !7 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6}
#include <stdio.h> #include <math.h> #define ll long long long long calc (long long a, long long b){ return (a * b) % 2019; } int main(){ ll a, b, min = 1000000000; scanf("%lld %lld", &a, &b); if (a * b < 2019){ printf("%lld\n", a * b); return 0; } else if ((a * b % 2019 == 0) || (floor(a/2019) != floor(b/2019))){ printf("0\n"); return 0; } else { for (long long i = a; i < b; i++) { for (long long j = a + 1; j <= b; j++){ if (calc(i, j) < min) min = calc(i, j); } } printf("%lld\n", min); return 0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232015/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232015/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @calc(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, 2019 ret i64 %rem } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %mul = mul nsw i64 %1, %0 %cmp = icmp slt i64 %mul, 2019 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul) br label %cleanup if.else: ; preds = %entry %rem = urem i64 %mul, 2019 %cmp4 = icmp eq i64 %rem, 0 br i1 %cmp4, label %if.then9, label %lor.lhs.false lor.lhs.false: ; preds = %if.else %div = sdiv i64 %0, 2019 %conv = sitofp i64 %div to double %div5 = sdiv i64 %1, 2019 %conv6 = sitofp i64 %div5 to double %cmp7 = fcmp une double %conv, %conv6 br i1 %cmp7, label %if.then9, label %for.cond.preheader for.cond.preheader: ; preds = %lor.lhs.false %cmp1242 = icmp slt i64 %0, %1 br i1 %cmp1242, label %for.cond14.preheader.us.preheader, label %for.cond.cleanup for.cond14.preheader.us.preheader: ; preds = %for.cond.preheader %2 = sub i64 %1, %0 %.neg = add i64 %0, 1 %xtraiter = and i64 %2, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %j.0.us.prol = add nsw i64 %0, 1 %3 = icmp eq i64 %1, %.neg br label %for.cond14.preheader.us for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.preheader, %for.cond14.for.cond.cleanup17_crit_edge.us %i.044.us = phi i64 [ %inc25.us, %for.cond14.for.cond.cleanup17_crit_edge.us ], [ %0, %for.cond14.preheader.us.preheader ] %min.043.us = phi i64 [ %spec.select.us.lcssa, %for.cond14.for.cond.cleanup17_crit_edge.us ], [ 1000000000, %for.cond14.preheader.us.preheader ] br i1 %lcmp.mod.not, label %for.body18.us.prol.loopexit, label %for.body18.us.prol for.body18.us.prol: ; preds = %for.cond14.preheader.us %mul.i.us.prol = mul nsw i64 %j.0.us.prol, %i.044.us %rem.i.us.prol = srem i64 %mul.i.us.prol, 2019 %spec.select.us.prol = call i64 @llvm.smin.i64(i64 %rem.i.us.prol, i64 %min.043.us) br label %for.body18.us.prol.loopexit for.body18.us.prol.loopexit: ; preds = %for.body18.us.prol, %for.cond14.preheader.us %spec.select.us.lcssa.unr = phi i64 [ undef, %for.cond14.preheader.us ], [ %spec.select.us.prol, %for.body18.us.prol ] %j.0.in41.us.unr = phi i64 [ %0, %for.cond14.preheader.us ], [ %j.0.us.prol, %for.body18.us.prol ] %min.140.us.unr = phi i64 [ %min.043.us, %for.cond14.preheader.us ], [ %spec.select.us.prol, %for.body18.us.prol ] br i1 %3, label %for.cond14.for.cond.cleanup17_crit_edge.us, label %for.body18.us for.body18.us: ; preds = %for.body18.us.prol.loopexit, %for.body18.us %j.0.in41.us = phi i64 [ %j.0.us.1, %for.body18.us ], [ %j.0.in41.us.unr, %for.body18.us.prol.loopexit ] %min.140.us = phi i64 [ %spec.select.us.1, %for.body18.us ], [ %min.140.us.unr, %for.body18.us.prol.loopexit ] %j.0.us = add nsw i64 %j.0.in41.us, 1 %mul.i.us = mul nsw i64 %j.0.us, %i.044.us %rem.i.us = srem i64 %mul.i.us, 2019 %spec.select.us = call i64 @llvm.smin.i64(i64 %rem.i.us, i64 %min.140.us) %j.0.us.1 = add nsw i64 %j.0.in41.us, 2 %mul.i.us.1 = mul nsw i64 %j.0.us.1, %i.044.us %rem.i.us.1 = srem i64 %mul.i.us.1, 2019 %spec.select.us.1 = call i64 @llvm.smin.i64(i64 %rem.i.us.1, i64 %spec.select.us) %exitcond.not.1 = icmp eq i64 %j.0.us.1, %1 br i1 %exitcond.not.1, label %for.cond14.for.cond.cleanup17_crit_edge.us, label %for.body18.us, !llvm.loop !9 for.cond14.for.cond.cleanup17_crit_edge.us: ; preds = %for.body18.us, %for.body18.us.prol.loopexit %spec.select.us.lcssa = phi i64 [ %spec.select.us.lcssa.unr, %for.body18.us.prol.loopexit ], [ %spec.select.us.1, %for.body18.us ] %inc25.us = add nsw i64 %i.044.us, 1 %exitcond46.not = icmp eq i64 %inc25.us, %1 br i1 %exitcond46.not, label %for.cond.cleanup, label %for.cond14.preheader.us, !llvm.loop !11 if.then9: ; preds = %lor.lhs.false, %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup for.cond.cleanup: ; preds = %for.cond14.for.cond.cleanup17_crit_edge.us, %for.cond.preheader %min.0.lcssa = phi i64 [ 1000000000, %for.cond.preheader ], [ %spec.select.us.lcssa, %for.cond14.for.cond.cleanup17_crit_edge.us ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0.lcssa) br label %cleanup cleanup: ; preds = %for.cond.cleanup, %if.then9, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> long long max(long long A,long long B){ return A>B?A:B; } long long min(long long A,long long B){ return A<B?A:B; } long long roundup(long long A,long long B){ return (A+B-1)/B; } int main(void){ long long l,r,ans=1e9; scanf("%lld%lld",&l,&r); if (r-l>=2019){ ans=0; } l=l%2019; r=r%2019; if (l>=r){ ans=0; } for (long long i=l; i<=r; i++){ for (long long j=i+1; j<=r; j++){ ans=min(ans,(i*j)%2019); } } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232059/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %A, i64 noundef %B) local_unnamed_addr #0 { 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 @min(i64 noundef %A, i64 noundef %B) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %A, i64 %B) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @roundup(i64 noundef %A, i64 noundef %B) local_unnamed_addr #1 { entry: %add = add i64 %A, -1 %sub = add i64 %add, %B %div = sdiv i64 %sub, %B ret i64 %div } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %l = alloca i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r) %0 = load i64, ptr %r, align 8, !tbaa !5 %1 = load i64, ptr %l, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %cmp = icmp sgt i64 %sub, 2018 %spec.select = select i1 %cmp, i64 0, i64 1000000000 %rem = srem i64 %1, 2019 store i64 %rem, ptr %l, align 8, !tbaa !5 %rem1 = srem i64 %0, 2019 store i64 %rem1, ptr %r, align 8, !tbaa !5 %cmp2.not = icmp slt i64 %rem, %rem1 %ans.1 = select i1 %cmp2.not, i64 %spec.select, i64 0 %cmp5.not25 = icmp sgt i64 %rem, %rem1 br i1 %cmp5.not25, label %for.cond.cleanup, label %for.body for.cond.loopexit: ; preds = %for.body9 br i1 %cmp7.not22.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup: ; preds = %for.body, %for.cond.loopexit, %entry %ans.2.lcssa = phi i64 [ %ans.1, %entry ], [ %ans.226, %for.body ], [ %cond.i, %for.cond.loopexit ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.2.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #6 ret i32 0 for.body: ; preds = %entry, %for.cond.loopexit %i.027 = phi i64 [ %add, %for.cond.loopexit ], [ %rem, %entry ] %ans.226 = phi i64 [ %cond.i, %for.cond.loopexit ], [ %ans.1, %entry ] %add = add nsw i64 %i.027, 1 %cmp7.not22.not = icmp slt i64 %i.027, %rem1 br i1 %cmp7.not22.not, label %for.body9, label %for.cond.cleanup for.body9: ; preds = %for.body, %for.body9 %j.024 = phi i64 [ %inc, %for.body9 ], [ %add, %for.body ] %ans.323 = phi i64 [ %cond.i, %for.body9 ], [ %ans.226, %for.body ] %mul = mul nsw i64 %j.024, %i.027 %rem10 = srem i64 %mul, 2019 %cond.i = call i64 @llvm.smin.i64(i64 %ans.323, i64 %rem10) %inc = add nsw i64 %j.024, 1 %cmp7.not.not = icmp slt i64 %j.024, %rem1 br i1 %cmp7.not.not, label %for.body9, label %for.cond.loopexit, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> char s[4040]; int cnt = 0; int main() { int n; scanf("%d",&n); int r = 0, g = 0, b = 0; long long cnt = 0; scanf("%s",s +1); for(int i = 1; i <=n; i++) if(s[i] == 'R') r++; else if(s[i] == 'G') g++; else b++; for(int i = 1; i <=n ;i++) for(int j = i+1; j <=n; j++){ int k = 2 *j - i; if(k <= n && s[i] != s[j] && s[i] != s[k] && s[j] != s[k] ) cnt++; } printf("%lld",1ll*r*g*b - cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232101/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232101/source.c" target datalayout = "e-m:e-p270: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 [3 x i8] c"%s\00", align 1 @s = dso_local global [4040 x i8] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca 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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([4040 x i8], ptr @s, i64 0, i64 1)) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not89 = icmp slt i32 %0, 1 br i1 %cmp.not89, label %for.cond.cleanup19, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = add i32 %0, 1 %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %2, 1 %3 = icmp eq i32 %1, 2 br i1 %3, label %for.cond16.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %2, -2 br label %for.body for.cond16.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %r.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %r.1.1, %for.inc.1 ] %g.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %g.1.1, %for.inc.1 ] %b.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %b.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %b.092.unr = phi i32 [ 0, %for.body.preheader ], [ %b.1.1, %for.inc.1 ] %g.091.unr = phi i32 [ 0, %for.body.preheader ], [ %g.1.1, %for.inc.1 ] %r.090.unr = phi i32 [ 0, %for.body.preheader ], [ %r.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond16.preheader.unr-lcssa %arrayidx.epil = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %indvars.iv.unr %4 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 switch i8 %4, label %if.else11.epil [ i8 82, label %if.then.epil i8 71, label %if.then9.epil ] if.then9.epil: ; preds = %for.body.epil %inc10.epil = add nsw i32 %g.091.unr, 1 br label %for.cond16.preheader if.then.epil: ; preds = %for.body.epil %inc.epil = add nsw i32 %r.090.unr, 1 br label %for.cond16.preheader if.else11.epil: ; preds = %for.body.epil %inc12.epil = add nsw i32 %b.092.unr, 1 br label %for.cond16.preheader for.cond16.preheader: ; preds = %if.then9.epil, %if.then.epil, %if.else11.epil, %for.cond16.preheader.unr-lcssa %r.1.lcssa = phi i32 [ %r.1.lcssa.ph, %for.cond16.preheader.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %r.090.unr, %if.then9.epil ], [ %r.090.unr, %if.else11.epil ] %g.1.lcssa = phi i32 [ %g.1.lcssa.ph, %for.cond16.preheader.unr-lcssa ], [ %g.091.unr, %if.then.epil ], [ %inc10.epil, %if.then9.epil ], [ %g.091.unr, %if.else11.epil ] %b.1.lcssa = phi i32 [ %b.1.lcssa.ph, %for.cond16.preheader.unr-lcssa ], [ %b.092.unr, %if.then.epil ], [ %b.092.unr, %if.then9.epil ], [ %inc12.epil, %if.else11.epil ] %5 = sext i32 %r.1.lcssa to i64 %6 = sext i32 %g.1.lcssa to i64 %7 = sext i32 %b.1.lcssa to i64 br i1 %cmp.not89, label %for.cond.cleanup19, label %for.body20.preheader for.body20.preheader: ; preds = %for.cond16.preheader %8 = add nuw i32 %0, 1 %9 = zext i32 %0 to i64 %wide.trip.count116 = zext i32 %8 to i64 br label %for.body20 for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %b.092 = phi i32 [ 0, %for.body.preheader.new ], [ %b.1.1, %for.inc.1 ] %g.091 = phi i32 [ 0, %for.body.preheader.new ], [ %g.1.1, %for.inc.1 ] %r.090 = phi i32 [ 0, %for.body.preheader.new ], [ %r.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !9 switch i8 %10, label %if.else11 [ i8 82, label %if.then i8 71, label %if.then9 ] if.then: ; preds = %for.body %inc = add nsw i32 %r.090, 1 br label %for.inc if.then9: ; preds = %for.body %inc10 = add nsw i32 %g.091, 1 br label %for.inc if.else11: ; preds = %for.body %inc12 = add nsw i32 %b.092, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else11, %if.then9 %r.1 = phi i32 [ %inc, %if.then ], [ %r.090, %if.then9 ], [ %r.090, %if.else11 ] %g.1 = phi i32 [ %g.091, %if.then ], [ %inc10, %if.then9 ], [ %g.091, %if.else11 ] %b.1 = phi i32 [ %b.092, %if.then ], [ %b.092, %if.then9 ], [ %inc12, %if.else11 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %indvars.iv.next %11 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 switch i8 %11, label %if.else11.1 [ i8 82, label %if.then.1 i8 71, label %if.then9.1 ] if.then9.1: ; preds = %for.inc %inc10.1 = add nsw i32 %g.1, 1 br label %for.inc.1 if.then.1: ; preds = %for.inc %inc.1 = add nsw i32 %r.1, 1 br label %for.inc.1 if.else11.1: ; preds = %for.inc %inc12.1 = add nsw i32 %b.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.else11.1, %if.then.1, %if.then9.1 %r.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %r.1, %if.then9.1 ], [ %r.1, %if.else11.1 ] %g.1.1 = phi i32 [ %g.1, %if.then.1 ], [ %inc10.1, %if.then9.1 ], [ %g.1, %if.else11.1 ] %b.1.1 = phi i32 [ %b.1, %if.then.1 ], [ %b.1, %if.then9.1 ], [ %inc12.1, %if.else11.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond16.preheader.unr-lcssa, label %for.body, !llvm.loop !10 for.cond16.loopexit: ; preds = %if.end56, %for.body20 %cnt.1.lcssa = phi i64 [ %cnt.0102, %for.body20 ], [ %cnt.2, %if.end56 ] %indvars.iv.next107 = add nuw i32 %indvars.iv106, 1 %exitcond117.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count116 br i1 %exitcond117.not, label %for.cond.cleanup19, label %for.body20, !llvm.loop !12 for.cond.cleanup19: ; preds = %for.cond16.loopexit, %entry, %for.cond16.preheader %b.0.lcssa123 = phi i64 [ %7, %for.cond16.preheader ], [ 0, %entry ], [ %7, %for.cond16.loopexit ] %g.0.lcssa122 = phi i64 [ %6, %for.cond16.preheader ], [ 0, %entry ], [ %6, %for.cond16.loopexit ] %r.0.lcssa121 = phi i64 [ %5, %for.cond16.preheader ], [ 0, %entry ], [ %5, %for.cond16.loopexit ] %cnt.0.lcssa = phi i64 [ 0, %for.cond16.preheader ], [ 0, %entry ], [ %cnt.1.lcssa, %for.cond16.loopexit ] %mul66 = mul nsw i64 %g.0.lcssa122, %r.0.lcssa121 %mul68 = mul nsw i64 %mul66, %b.0.lcssa123 %sub69 = sub nsw i64 %mul68, %cnt.0.lcssa %call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub69) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body20: ; preds = %for.body20.preheader, %for.cond16.loopexit %indvars.iv113 = phi i64 [ 1, %for.body20.preheader ], [ %indvars.iv.next114, %for.cond16.loopexit ] %indvars.iv106 = phi i32 [ 2, %for.body20.preheader ], [ %indvars.iv.next107, %for.cond16.loopexit ] %cnt.0102 = phi i64 [ 0, %for.body20.preheader ], [ %cnt.1.lcssa, %for.cond16.loopexit ] %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %cmp22.not97.not = icmp ult i64 %indvars.iv113, %9 br i1 %cmp22.not97.not, label %for.body25.lr.ph, label %for.cond16.loopexit for.body25.lr.ph: ; preds = %for.body20 %12 = zext i32 %indvars.iv106 to i64 %arrayidx29 = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %indvars.iv113 %13 = trunc i64 %indvars.iv113 to i32 br label %for.body25 for.body25: ; preds = %for.body25.lr.ph, %if.end56 %indvars.iv108 = phi i64 [ %12, %for.body25.lr.ph ], [ %indvars.iv.next109, %if.end56 ] %cnt.198 = phi i64 [ %cnt.0102, %for.body25.lr.ph ], [ %cnt.2, %if.end56 ] %indvars111 = trunc i64 %indvars.iv108 to i32 %mul = shl nuw nsw i32 %indvars111, 1 %sub = sub nsw i32 %mul, %13 %cmp26.not = icmp sgt i32 %sub, %0 br i1 %cmp26.not, label %if.end56, label %land.lhs.true land.lhs.true: ; preds = %for.body25 %14 = load i8, ptr %arrayidx29, align 1, !tbaa !9 %idxprom31 = and i64 %indvars.iv108, 4294967295 %arrayidx32 = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %idxprom31 %15 = load i8, ptr %arrayidx32, align 1, !tbaa !9 %cmp34.not = icmp eq i8 %14, %15 br i1 %cmp34.not, label %if.end56, label %land.lhs.true36 land.lhs.true36: ; preds = %land.lhs.true %idxprom40 = sext i32 %sub to i64 %arrayidx41 = getelementptr inbounds [4040 x i8], ptr @s, i64 0, i64 %idxprom40 %16 = load i8, ptr %arrayidx41, align 1, !tbaa !9 %cmp43.not = icmp ne i8 %14, %16 %cmp52.not = icmp ne i8 %15, %16 %or.cond.not = and i1 %cmp43.not, %cmp52.not %inc55 = zext i1 %or.cond.not to i64 %spec.select = add nsw i64 %cnt.198, %inc55 br label %if.end56 if.end56: ; preds = %land.lhs.true36, %land.lhs.true, %for.body25 %cnt.2 = phi i64 [ %cnt.198, %land.lhs.true ], [ %cnt.198, %for.body25 ], [ %spec.select, %land.lhs.true36 ] %indvars.iv.next109 = add i64 %indvars.iv108, 1 %lftr.wideiv = trunc i64 %indvars.iv.next109 to i32 %exitcond112.not = icmp eq i32 %8, %lftr.wideiv br i1 %exitcond112.not, label %for.cond16.loopexit, label %for.body25, !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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include<stdio.h> #include<stdlib.h> int main(){ int n,i,j; long long int count,r=0,g=0,b=0; scanf("%d ",&n); char s[4010]; for(i=0;i<n;i++){ scanf("%c",&s[i]); if(s[i]=='R') r++; else if(s[i]=='G') g++; else b++; } count=r*g*b; for(i=0;i<n;i++){ j=1; while(i+j+j<n){ if(s[i]!=s[j+i] && s[j+i]!=s[j+j+i] && s[i]!=s[j+j+i]) count-=1; j+=1; } } printf("%lld\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232152/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232152/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca [4010 x i8], align 16 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) call void @llvm.lifetime.start.p0(i64 4010, ptr nonnull %s) #3 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp88 = icmp sgt i32 %0, 0 br i1 %cmp88, label %for.body, label %for.end61 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %b.092 = phi i64 [ %b.1, %for.inc ], [ 0, %entry ] %g.091 = phi i64 [ %g.1, %for.inc ], [ 0, %entry ] %r.090 = phi i64 [ %r.1, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [4010 x i8], ptr %s, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 switch i8 %1, label %if.else13 [ i8 82, label %if.then i8 71, label %if.then11 ] if.then: ; preds = %for.body %inc = add nsw i64 %r.090, 1 br label %for.inc if.then11: ; preds = %for.body %inc12 = add nsw i64 %g.091, 1 br label %for.inc if.else13: ; preds = %for.body %inc14 = add nsw i64 %b.092, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else13, %if.then11 %r.1 = phi i64 [ %inc, %if.then ], [ %r.090, %if.then11 ], [ %r.090, %if.else13 ] %g.1 = phi i64 [ %g.091, %if.then ], [ %inc12, %if.then11 ], [ %g.091, %if.else13 ] %b.1 = phi i64 [ %b.092, %if.then ], [ %b.092, %if.then11 ], [ %inc14, %if.else13 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.inc %4 = mul nsw i64 %g.1, %r.1 %5 = mul nsw i64 %4, %b.1 %cmp19103 = icmp sgt i32 %2, 0 br i1 %cmp19103, label %while.cond.preheader.preheader, label %for.end61 while.cond.preheader.preheader: ; preds = %for.end %6 = zext i32 %2 to i64 %wide.trip.count = zext i32 %2 to i64 %invariant.op = add nsw i64 %6, -2 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.preheader, %for.inc59 %indvars.iv122 = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next123, %for.inc59 ] %indvars.iv109 = phi i64 [ 1, %while.cond.preheader.preheader ], [ %indvars.iv.next110, %for.inc59 ] %count.0105 = phi i64 [ %5, %while.cond.preheader.preheader ], [ %count.1.lcssa, %for.inc59 ] %cmp2398 = icmp slt i64 %indvars.iv122, %invariant.op br i1 %cmp2398, label %while.body.lr.ph, label %for.inc59 while.body.lr.ph: ; preds = %while.cond.preheader %arrayidx26 = getelementptr inbounds [4010 x i8], ptr %s, i64 0, i64 %indvars.iv122 %7 = load i8, ptr %arrayidx26, align 1, !tbaa !9 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end57 %indvars.iv113 = phi i64 [ 1, %while.body.lr.ph ], [ %indvars.iv.next114, %if.end57 ] %indvars.iv111 = phi i64 [ %indvars.iv109, %while.body.lr.ph ], [ %indvars.iv.next112, %if.end57 ] %count.1100 = phi i64 [ %count.0105, %while.body.lr.ph ], [ %count.2, %if.end57 ] %arrayidx30 = getelementptr inbounds [4010 x i8], ptr %s, i64 0, i64 %indvars.iv111 %8 = load i8, ptr %arrayidx30, align 1, !tbaa !9 %cmp32.not = icmp eq i8 %7, %8 br i1 %cmp32.not, label %if.end57, label %land.lhs.true land.lhs.true: ; preds = %while.body %9 = shl nuw nsw i64 %indvars.iv113, 1 %10 = add nuw nsw i64 %9, %indvars.iv122 %arrayidx41 = getelementptr inbounds [4010 x i8], ptr %s, i64 0, i64 %10 %11 = load i8, ptr %arrayidx41, align 1, !tbaa !9 %cmp43.not = icmp ne i8 %8, %11 %cmp54.not = icmp ne i8 %7, %11 %or.cond.not = and i1 %cmp43.not, %cmp54.not %sub = sext i1 %or.cond.not to i64 %spec.select = add nsw i64 %count.1100, %sub br label %if.end57 if.end57: ; preds = %land.lhs.true, %while.body %count.2 = phi i64 [ %count.1100, %while.body ], [ %spec.select, %land.lhs.true ] %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %reass.add = shl nuw i64 %indvars.iv.next114, 1 %12 = add i64 %indvars.iv122, %reass.add %13 = trunc i64 %12 to i32 %cmp23 = icmp sgt i32 %2, %13 br i1 %cmp23, label %while.body, label %for.inc59, !llvm.loop !12 for.inc59: ; preds = %if.end57, %while.cond.preheader %count.1.lcssa = phi i64 [ %count.0105, %while.cond.preheader ], [ %count.2, %if.end57 ] %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1 %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1 %exitcond.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count br i1 %exitcond.not, label %for.end61, label %while.cond.preheader, !llvm.loop !13 for.end61: ; preds = %for.inc59, %entry, %for.end %count.0.lcssa = phi i64 [ %5, %for.end ], [ 0, %entry ], [ %count.1.lcssa, %for.inc59 ] %call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4010, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include <stdio.h> #include <inttypes.h> int N; char S[4096]; int id(char c) { switch (c) { case 'R': return 0; case 'G': return 1; case 'B': return 2; } return 3; } int rui[4][4096]; int main(void) { int i, j; uint64_t kotae = 0; if (scanf("%d", &N) != 1) return 1; if (scanf("%4095s", S) != 1) return 1; for (i = 0; i < N; i++) { rui[id(S[i])][i]++; } for (i = 0; i < 3; i++) { for (j = 1; j <= N; j++) rui[i][j] += rui[i][j - 1]; } for (i = 0; i < N; i++) { for (j = i + 1; j < N; j++) { if (S[i] != S[j]) { int target = 3 - id(S[i]) - id(S[j]); int delta = rui[target][N] - rui[target][j]; if (j + (j - i) < N && id(S[j + (j - i)]) == target) delta--; kotae += delta; } } } printf("%" PRIu64 "\n", kotae); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232196/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232196/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @N = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [7 x i8] c"%4095s\00", align 1 @S = dso_local global [4096 x i8] zeroinitializer, align 16 @rui = dso_local local_unnamed_addr global [4 x [4096 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @id(i8 noundef signext %c) local_unnamed_addr #0 { entry: %conv = sext i8 %c to i32 switch i32 %conv, label %sw.epilog [ i32 82, label %return i32 71, label %sw.bb1 i32 66, label %sw.bb2 ] sw.bb1: ; preds = %entry br label %return sw.bb2: ; preds = %entry br label %return sw.epilog: ; preds = %entry br label %return return: ; preds = %entry, %sw.epilog, %sw.bb2, %sw.bb1 %retval.0 = phi i32 [ 3, %sw.epilog ], [ 2, %sw.bb2 ], [ 1, %sw.bb1 ], [ 0, %entry ] ret i32 %retval.0 } ; 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 @N) %cmp.not = icmp eq i32 %call, 1 br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @S) %cmp2.not = icmp eq i32 %call1, 1 br i1 %cmp2.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %if.end %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp5137 = icmp sgt i32 %0, 0 br i1 %cmp5137, label %for.body.preheader, label %for.end85 for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.cond12.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond12.preheader.unr-lcssa: ; preds = %id.exit.1, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %id.exit.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond12.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond12.preheader.unr-lcssa %arrayidx.epil = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %indvars.iv.unr %2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %conv.i.epil = sext i8 %2 to i32 switch i32 %conv.i.epil, label %sw.epilog.i.epil [ i32 82, label %id.exit.epil i32 71, label %sw.bb1.i.epil i32 66, label %sw.bb2.i.epil ] sw.bb2.i.epil: ; preds = %for.body.epil br label %id.exit.epil sw.bb1.i.epil: ; preds = %for.body.epil br label %id.exit.epil sw.epilog.i.epil: ; preds = %for.body.epil br label %id.exit.epil id.exit.epil: ; preds = %sw.epilog.i.epil, %sw.bb1.i.epil, %sw.bb2.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 3, %sw.epilog.i.epil ], [ 2, %sw.bb2.i.epil ], [ 1, %sw.bb1.i.epil ], [ 0, %for.body.epil ] %arrayidx10.epil = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 %retval.0.i.epil, i64 %indvars.iv.unr %3 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %inc.epil = add nsw i32 %3, 1 store i32 %inc.epil, ptr %arrayidx10.epil, align 4, !tbaa !5 br label %for.cond12.preheader for.cond12.preheader: ; preds = %for.cond12.preheader.unr-lcssa, %id.exit.epil %cmp16.not139 = icmp slt i32 %0, 1 br i1 %cmp16.not139, label %for.end85, label %for.cond15.preheader.preheader for.cond15.preheader.preheader: ; preds = %for.cond12.preheader %4 = add nuw i32 %0, 1 %wide.trip.count156 = zext i32 %4 to i64 %.pre = load i32, ptr @rui, align 16, !tbaa !5 %5 = add nsw i64 %wide.trip.count156, -1 %6 = add nsw i64 %wide.trip.count156, -2 %xtraiter179 = and i64 %5, 3 %7 = icmp ult i64 %6, 3 br i1 %7, label %for.cond15.for.inc29_crit_edge.unr-lcssa, label %for.cond15.preheader.preheader.new for.cond15.preheader.preheader.new: ; preds = %for.cond15.preheader.preheader %unroll_iter181 = and i64 %5, -4 br label %for.body17 for.body: ; preds = %id.exit.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %id.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %id.exit.1 ] %arrayidx = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %indvars.iv %8 = load i8, ptr %arrayidx, align 2, !tbaa !9 %conv.i = sext i8 %8 to i32 switch i32 %conv.i, label %sw.epilog.i [ i32 82, label %id.exit i32 71, label %sw.bb1.i i32 66, label %sw.bb2.i ] sw.bb1.i: ; preds = %for.body br label %id.exit sw.bb2.i: ; preds = %for.body br label %id.exit sw.epilog.i: ; preds = %for.body br label %id.exit id.exit: ; preds = %for.body, %sw.bb1.i, %sw.bb2.i, %sw.epilog.i %retval.0.i = phi i64 [ 3, %sw.epilog.i ], [ 2, %sw.bb2.i ], [ 1, %sw.bb1.i ], [ 0, %for.body ] %arrayidx10 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 %retval.0.i, i64 %indvars.iv %9 = load i32, ptr %arrayidx10, align 8, !tbaa !5 %inc = add nsw i32 %9, 1 store i32 %inc, ptr %arrayidx10, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %indvars.iv.next %10 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %conv.i.1 = sext i8 %10 to i32 switch i32 %conv.i.1, label %sw.epilog.i.1 [ i32 82, label %id.exit.1 i32 71, label %sw.bb1.i.1 i32 66, label %sw.bb2.i.1 ] sw.bb2.i.1: ; preds = %id.exit br label %id.exit.1 sw.bb1.i.1: ; preds = %id.exit br label %id.exit.1 sw.epilog.i.1: ; preds = %id.exit br label %id.exit.1 id.exit.1: ; preds = %sw.epilog.i.1, %sw.bb1.i.1, %sw.bb2.i.1, %id.exit %retval.0.i.1 = phi i64 [ 3, %sw.epilog.i.1 ], [ 2, %sw.bb2.i.1 ], [ 1, %sw.bb1.i.1 ], [ 0, %id.exit ] %arrayidx10.1 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 %retval.0.i.1, i64 %indvars.iv.next %11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %inc.1 = add nsw i32 %11, 1 store i32 %inc.1, ptr %arrayidx10.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond12.preheader.unr-lcssa, label %for.body, !llvm.loop !10 for.cond32.preheader.unr-lcssa: ; preds = %for.body17.2, %for.cond15.for.inc29_crit_edge.1 %.unr201 = phi i32 [ %.pre177, %for.cond15.for.inc29_crit_edge.1 ], [ %add.2.3, %for.body17.2 ] %indvars.iv152.2.unr = phi i64 [ 1, %for.cond15.for.inc29_crit_edge.1 ], [ %indvars.iv.next153.2.3, %for.body17.2 ] %lcmp.mod202.not = icmp eq i64 %xtraiter199, 0 br i1 %lcmp.mod202.not, label %for.cond32.preheader, label %for.body17.2.epil for.body17.2.epil: ; preds = %for.cond32.preheader.unr-lcssa, %for.body17.2.epil %12 = phi i32 [ %add.2.epil, %for.body17.2.epil ], [ %.unr201, %for.cond32.preheader.unr-lcssa ] %indvars.iv152.2.epil = phi i64 [ %indvars.iv.next153.2.epil, %for.body17.2.epil ], [ %indvars.iv152.2.unr, %for.cond32.preheader.unr-lcssa ] %epil.iter200 = phi i64 [ %epil.iter200.next, %for.body17.2.epil ], [ 0, %for.cond32.preheader.unr-lcssa ] %arrayidx25.2.epil = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 %indvars.iv152.2.epil %13 = load i32, ptr %arrayidx25.2.epil, align 4, !tbaa !5 %add.2.epil = add nsw i32 %13, %12 store i32 %add.2.epil, ptr %arrayidx25.2.epil, align 4, !tbaa !5 %indvars.iv.next153.2.epil = add nuw nsw i64 %indvars.iv152.2.epil, 1 %epil.iter200.next = add i64 %epil.iter200, 1 %epil.iter200.cmp.not = icmp eq i64 %epil.iter200.next, %xtraiter199 br i1 %epil.iter200.cmp.not, label %for.cond32.preheader, label %for.body17.2.epil, !llvm.loop !12 for.cond32.preheader: ; preds = %for.body17.2.epil, %for.cond32.preheader.unr-lcssa br i1 %cmp5137, label %for.body34.lr.ph, label %for.end85 for.body34.lr.ph: ; preds = %for.cond32.preheader %idxprom57 = zext i32 %0 to i64 %wide.trip.count174 = zext i32 %0 to i64 br label %for.body34 for.body17: ; preds = %for.body17, %for.cond15.preheader.preheader.new %14 = phi i32 [ %.pre, %for.cond15.preheader.preheader.new ], [ %add.3, %for.body17 ] %indvars.iv152 = phi i64 [ 1, %for.cond15.preheader.preheader.new ], [ %indvars.iv.next153.3, %for.body17 ] %niter182 = phi i64 [ 0, %for.cond15.preheader.preheader.new ], [ %niter182.next.3, %for.body17 ] %arrayidx25 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 0, i64 %indvars.iv152 %15 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %add = add nsw i32 %15, %14 store i32 %add, ptr %arrayidx25, align 4, !tbaa !5 %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %arrayidx25.1184 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 0, i64 %indvars.iv.next153 %16 = load i32, ptr %arrayidx25.1184, align 4, !tbaa !5 %add.1185 = add nsw i32 %16, %add store i32 %add.1185, ptr %arrayidx25.1184, align 4, !tbaa !5 %indvars.iv.next153.1186 = add nuw nsw i64 %indvars.iv152, 2 %arrayidx25.2189 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 0, i64 %indvars.iv.next153.1186 %17 = load i32, ptr %arrayidx25.2189, align 4, !tbaa !5 %add.2190 = add nsw i32 %17, %add.1185 store i32 %add.2190, ptr %arrayidx25.2189, align 4, !tbaa !5 %indvars.iv.next153.2191 = add nuw nsw i64 %indvars.iv152, 3 %arrayidx25.3 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 0, i64 %indvars.iv.next153.2191 %18 = load i32, ptr %arrayidx25.3, align 4, !tbaa !5 %add.3 = add nsw i32 %18, %add.2190 store i32 %add.3, ptr %arrayidx25.3, align 4, !tbaa !5 %indvars.iv.next153.3 = add nuw nsw i64 %indvars.iv152, 4 %niter182.next.3 = add i64 %niter182, 4 %niter182.ncmp.3 = icmp eq i64 %niter182.next.3, %unroll_iter181 br i1 %niter182.ncmp.3, label %for.cond15.for.inc29_crit_edge.unr-lcssa, label %for.body17, !llvm.loop !14 for.cond15.for.inc29_crit_edge.unr-lcssa: ; preds = %for.body17, %for.cond15.preheader.preheader %.unr = phi i32 [ %.pre, %for.cond15.preheader.preheader ], [ %add.3, %for.body17 ] %indvars.iv152.unr = phi i64 [ 1, %for.cond15.preheader.preheader ], [ %indvars.iv.next153.3, %for.body17 ] %lcmp.mod180.not = icmp eq i64 %xtraiter179, 0 br i1 %lcmp.mod180.not, label %for.cond15.for.inc29_crit_edge, label %for.body17.epil for.body17.epil: ; preds = %for.cond15.for.inc29_crit_edge.unr-lcssa, %for.body17.epil %19 = phi i32 [ %add.epil, %for.body17.epil ], [ %.unr, %for.cond15.for.inc29_crit_edge.unr-lcssa ] %indvars.iv152.epil = phi i64 [ %indvars.iv.next153.epil, %for.body17.epil ], [ %indvars.iv152.unr, %for.cond15.for.inc29_crit_edge.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body17.epil ], [ 0, %for.cond15.for.inc29_crit_edge.unr-lcssa ] %arrayidx25.epil = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 0, i64 %indvars.iv152.epil %20 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %20, %19 store i32 %add.epil, ptr %arrayidx25.epil, align 4, !tbaa !5 %indvars.iv.next153.epil = add nuw nsw i64 %indvars.iv152.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter179 br i1 %epil.iter.cmp.not, label %for.cond15.for.inc29_crit_edge, label %for.body17.epil, !llvm.loop !15 for.cond15.for.inc29_crit_edge: ; preds = %for.body17.epil, %for.cond15.for.inc29_crit_edge.unr-lcssa %.pre176 = load i32, ptr getelementptr inbounds ([4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 0), align 16, !tbaa !5 %xtraiter193 = and i64 %5, 3 %21 = icmp ult i64 %6, 3 br i1 %21, label %for.cond15.for.inc29_crit_edge.1.unr-lcssa, label %for.cond15.for.inc29_crit_edge.new for.cond15.for.inc29_crit_edge.new: ; preds = %for.cond15.for.inc29_crit_edge %unroll_iter197 = and i64 %5, -4 br label %for.body17.1 for.body17.1: ; preds = %for.body17.1, %for.cond15.for.inc29_crit_edge.new %22 = phi i32 [ %.pre176, %for.cond15.for.inc29_crit_edge.new ], [ %add.1.3, %for.body17.1 ] %indvars.iv152.1 = phi i64 [ 1, %for.cond15.for.inc29_crit_edge.new ], [ %indvars.iv.next153.1.3, %for.body17.1 ] %niter198 = phi i64 [ 0, %for.cond15.for.inc29_crit_edge.new ], [ %niter198.next.3, %for.body17.1 ] %arrayidx25.1 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 %indvars.iv152.1 %23 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5 %add.1 = add nsw i32 %23, %22 store i32 %add.1, ptr %arrayidx25.1, align 4, !tbaa !5 %indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152.1, 1 %arrayidx25.1.1 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 %indvars.iv.next153.1 %24 = load i32, ptr %arrayidx25.1.1, align 4, !tbaa !5 %add.1.1 = add nsw i32 %24, %add.1 store i32 %add.1.1, ptr %arrayidx25.1.1, align 4, !tbaa !5 %indvars.iv.next153.1.1 = add nuw nsw i64 %indvars.iv152.1, 2 %arrayidx25.1.2 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 %indvars.iv.next153.1.1 %25 = load i32, ptr %arrayidx25.1.2, align 4, !tbaa !5 %add.1.2 = add nsw i32 %25, %add.1.1 store i32 %add.1.2, ptr %arrayidx25.1.2, align 4, !tbaa !5 %indvars.iv.next153.1.2 = add nuw nsw i64 %indvars.iv152.1, 3 %arrayidx25.1.3 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 %indvars.iv.next153.1.2 %26 = load i32, ptr %arrayidx25.1.3, align 4, !tbaa !5 %add.1.3 = add nsw i32 %26, %add.1.2 store i32 %add.1.3, ptr %arrayidx25.1.3, align 4, !tbaa !5 %indvars.iv.next153.1.3 = add nuw nsw i64 %indvars.iv152.1, 4 %niter198.next.3 = add i64 %niter198, 4 %niter198.ncmp.3 = icmp eq i64 %niter198.next.3, %unroll_iter197 br i1 %niter198.ncmp.3, label %for.cond15.for.inc29_crit_edge.1.unr-lcssa, label %for.body17.1, !llvm.loop !14 for.cond15.for.inc29_crit_edge.1.unr-lcssa: ; preds = %for.body17.1, %for.cond15.for.inc29_crit_edge %.unr195 = phi i32 [ %.pre176, %for.cond15.for.inc29_crit_edge ], [ %add.1.3, %for.body17.1 ] %indvars.iv152.1.unr = phi i64 [ 1, %for.cond15.for.inc29_crit_edge ], [ %indvars.iv.next153.1.3, %for.body17.1 ] %lcmp.mod196.not = icmp eq i64 %xtraiter193, 0 br i1 %lcmp.mod196.not, label %for.cond15.for.inc29_crit_edge.1, label %for.body17.1.epil for.body17.1.epil: ; preds = %for.cond15.for.inc29_crit_edge.1.unr-lcssa, %for.body17.1.epil %27 = phi i32 [ %add.1.epil, %for.body17.1.epil ], [ %.unr195, %for.cond15.for.inc29_crit_edge.1.unr-lcssa ] %indvars.iv152.1.epil = phi i64 [ %indvars.iv.next153.1.epil, %for.body17.1.epil ], [ %indvars.iv152.1.unr, %for.cond15.for.inc29_crit_edge.1.unr-lcssa ] %epil.iter194 = phi i64 [ %epil.iter194.next, %for.body17.1.epil ], [ 0, %for.cond15.for.inc29_crit_edge.1.unr-lcssa ] %arrayidx25.1.epil = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 1, i64 %indvars.iv152.1.epil %28 = load i32, ptr %arrayidx25.1.epil, align 4, !tbaa !5 %add.1.epil = add nsw i32 %28, %27 store i32 %add.1.epil, ptr %arrayidx25.1.epil, align 4, !tbaa !5 %indvars.iv.next153.1.epil = add nuw nsw i64 %indvars.iv152.1.epil, 1 %epil.iter194.next = add i64 %epil.iter194, 1 %epil.iter194.cmp.not = icmp eq i64 %epil.iter194.next, %xtraiter193 br i1 %epil.iter194.cmp.not, label %for.cond15.for.inc29_crit_edge.1, label %for.body17.1.epil, !llvm.loop !16 for.cond15.for.inc29_crit_edge.1: ; preds = %for.body17.1.epil, %for.cond15.for.inc29_crit_edge.1.unr-lcssa %.pre177 = load i32, ptr getelementptr inbounds ([4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 0), align 16, !tbaa !5 %xtraiter199 = and i64 %5, 3 %29 = icmp ult i64 %6, 3 br i1 %29, label %for.cond32.preheader.unr-lcssa, label %for.cond15.for.inc29_crit_edge.1.new for.cond15.for.inc29_crit_edge.1.new: ; preds = %for.cond15.for.inc29_crit_edge.1 %unroll_iter203 = and i64 %5, -4 br label %for.body17.2 for.body17.2: ; preds = %for.body17.2, %for.cond15.for.inc29_crit_edge.1.new %30 = phi i32 [ %.pre177, %for.cond15.for.inc29_crit_edge.1.new ], [ %add.2.3, %for.body17.2 ] %indvars.iv152.2 = phi i64 [ 1, %for.cond15.for.inc29_crit_edge.1.new ], [ %indvars.iv.next153.2.3, %for.body17.2 ] %niter204 = phi i64 [ 0, %for.cond15.for.inc29_crit_edge.1.new ], [ %niter204.next.3, %for.body17.2 ] %arrayidx25.2 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 %indvars.iv152.2 %31 = load i32, ptr %arrayidx25.2, align 4, !tbaa !5 %add.2 = add nsw i32 %31, %30 store i32 %add.2, ptr %arrayidx25.2, align 4, !tbaa !5 %indvars.iv.next153.2 = add nuw nsw i64 %indvars.iv152.2, 1 %arrayidx25.2.1 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 %indvars.iv.next153.2 %32 = load i32, ptr %arrayidx25.2.1, align 4, !tbaa !5 %add.2.1 = add nsw i32 %32, %add.2 store i32 %add.2.1, ptr %arrayidx25.2.1, align 4, !tbaa !5 %indvars.iv.next153.2.1 = add nuw nsw i64 %indvars.iv152.2, 2 %arrayidx25.2.2 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 %indvars.iv.next153.2.1 %33 = load i32, ptr %arrayidx25.2.2, align 4, !tbaa !5 %add.2.2 = add nsw i32 %33, %add.2.1 store i32 %add.2.2, ptr %arrayidx25.2.2, align 4, !tbaa !5 %indvars.iv.next153.2.2 = add nuw nsw i64 %indvars.iv152.2, 3 %arrayidx25.2.3 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 2, i64 %indvars.iv.next153.2.2 %34 = load i32, ptr %arrayidx25.2.3, align 4, !tbaa !5 %add.2.3 = add nsw i32 %34, %add.2.2 store i32 %add.2.3, ptr %arrayidx25.2.3, align 4, !tbaa !5 %indvars.iv.next153.2.3 = add nuw nsw i64 %indvars.iv152.2, 4 %niter204.next.3 = add i64 %niter204, 4 %niter204.ncmp.3 = icmp eq i64 %niter204.next.3, %unroll_iter203 br i1 %niter204.ncmp.3, label %for.cond32.preheader.unr-lcssa, label %for.body17.2, !llvm.loop !14 for.cond32.loopexit: ; preds = %for.inc80, %for.body34 %kotae.1.lcssa = phi i64 [ %kotae.0148, %for.body34 ], [ %kotae.2, %for.inc80 ] %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1 %exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count174 br i1 %exitcond175.not, label %for.end85, label %for.body34, !llvm.loop !17 for.body34: ; preds = %for.body34.lr.ph, %for.cond32.loopexit %indvars.iv171 = phi i64 [ 0, %for.body34.lr.ph ], [ %indvars.iv.next172, %for.cond32.loopexit ] %indvars.iv162 = phi i64 [ 1, %for.body34.lr.ph ], [ %indvars.iv.next163, %for.cond32.loopexit ] %kotae.0148 = phi i64 [ 0, %for.body34.lr.ph ], [ %kotae.1.lcssa, %for.cond32.loopexit ] %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1 %cmp37142 = icmp ult i64 %indvars.iv.next172, %idxprom57 br i1 %cmp37142, label %for.body38.lr.ph, label %for.cond32.loopexit for.body38.lr.ph: ; preds = %for.body34 %arrayidx40 = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %indvars.iv171 %35 = load i8, ptr %arrayidx40, align 1, !tbaa !9 %conv.i119 = sext i8 %35 to i32 br label %for.body38 for.body38: ; preds = %for.body38.lr.ph, %for.inc80 %indvars.iv164 = phi i64 [ %indvars.iv162, %for.body38.lr.ph ], [ %indvars.iv.next165, %for.inc80 ] %kotae.1144 = phi i64 [ %kotae.0148, %for.body38.lr.ph ], [ %kotae.2, %for.inc80 ] %arrayidx42 = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %indvars.iv164 %36 = load i8, ptr %arrayidx42, align 1, !tbaa !9 %cmp44.not = icmp eq i8 %35, %36 br i1 %cmp44.not, label %for.inc80, label %if.then46 if.then46: ; preds = %for.body38 switch i32 %conv.i119, label %sw.epilog.i123 [ i32 82, label %id.exit124 i32 71, label %sw.bb1.i122 i32 66, label %sw.bb2.i120 ] sw.bb1.i122: ; preds = %if.then46 br label %id.exit124 sw.bb2.i120: ; preds = %if.then46 br label %id.exit124 sw.epilog.i123: ; preds = %if.then46 br label %id.exit124 id.exit124: ; preds = %if.then46, %sw.bb1.i122, %sw.bb2.i120, %sw.epilog.i123 %retval.0.i121 = phi i32 [ 0, %sw.epilog.i123 ], [ 1, %sw.bb2.i120 ], [ 2, %sw.bb1.i122 ], [ 3, %if.then46 ] %conv.i125 = sext i8 %36 to i32 switch i32 %conv.i125, label %sw.epilog.i129 [ i32 82, label %id.exit130 i32 71, label %sw.bb1.i128 i32 66, label %sw.bb2.i126 ] sw.bb1.i128: ; preds = %id.exit124 br label %id.exit130 sw.bb2.i126: ; preds = %id.exit124 br label %id.exit130 sw.epilog.i129: ; preds = %id.exit124 br label %id.exit130 id.exit130: ; preds = %id.exit124, %sw.bb1.i128, %sw.bb2.i126, %sw.epilog.i129 %retval.0.i127.neg = phi i32 [ -3, %sw.epilog.i129 ], [ -2, %sw.bb2.i126 ], [ -1, %sw.bb1.i128 ], [ 0, %id.exit124 ] %sub54 = add nsw i32 %retval.0.i127.neg, %retval.0.i121 %idxprom55 = sext i32 %sub54 to i64 %arrayidx58 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 %idxprom55, i64 %idxprom57 %37 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %arrayidx62 = getelementptr inbounds [4 x [4096 x i32]], ptr @rui, i64 0, i64 %idxprom55, i64 %indvars.iv164 %38 = load i32, ptr %arrayidx62, align 4, !tbaa !5 %sub63 = sub nsw i32 %37, %38 %sub64 = sub nsw i64 %indvars.iv164, %indvars.iv171 %sext = shl i64 %sub64, 32 %39 = ashr exact i64 %sext, 32 %40 = add nuw nsw i64 %39, %indvars.iv164 %cmp66.wide = icmp slt i64 %40, %idxprom57 br i1 %cmp66.wide, label %land.lhs.true, label %if.end76 land.lhs.true: ; preds = %id.exit130 %arrayidx71 = getelementptr inbounds [4096 x i8], ptr @S, i64 0, i64 %40 %41 = load i8, ptr %arrayidx71, align 1, !tbaa !9 %conv.i131 = sext i8 %41 to i32 switch i32 %conv.i131, label %sw.epilog.i135 [ i32 82, label %id.exit136 i32 71, label %sw.bb1.i134 i32 66, label %sw.bb2.i132 ] sw.bb1.i134: ; preds = %land.lhs.true br label %id.exit136 sw.bb2.i132: ; preds = %land.lhs.true br label %id.exit136 sw.epilog.i135: ; preds = %land.lhs.true br label %id.exit136 id.exit136: ; preds = %land.lhs.true, %sw.bb1.i134, %sw.bb2.i132, %sw.epilog.i135 %retval.0.i133 = phi i32 [ 3, %sw.epilog.i135 ], [ 2, %sw.bb2.i132 ], [ 1, %sw.bb1.i134 ], [ 0, %land.lhs.true ] %cmp73 = icmp eq i32 %retval.0.i133, %sub54 %dec = sext i1 %cmp73 to i32 %spec.select = add nsw i32 %sub63, %dec br label %if.end76 if.end76: ; preds = %id.exit136, %id.exit130 %delta.0 = phi i32 [ %sub63, %id.exit130 ], [ %spec.select, %id.exit136 ] %conv77 = sext i32 %delta.0 to i64 %add78 = add i64 %kotae.1144, %conv77 br label %for.inc80 for.inc80: ; preds = %for.body38, %if.end76 %kotae.2 = phi i64 [ %add78, %if.end76 ], [ %kotae.1144, %for.body38 ] %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1 %exitcond170.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count174 br i1 %exitcond170.not, label %for.cond32.loopexit, label %for.body38, !llvm.loop !18 for.end85: ; preds = %for.cond32.loopexit, %for.cond.preheader, %for.cond12.preheader, %for.cond32.preheader %kotae.0.lcssa = phi i64 [ 0, %for.cond32.preheader ], [ 0, %for.cond12.preheader ], [ 0, %for.cond.preheader ], [ %kotae.1.lcssa, %for.cond32.loopexit ] %call86 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %kotae.0.lcssa) br label %cleanup cleanup: ; preds = %if.end, %entry, %for.end85 %retval.0 = phi i32 [ 0, %for.end85 ], [ 1, %entry ], [ 1, %if.end ] ret i32 %retval.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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !11} !15 = distinct !{!15, !13} !16 = distinct !{!16, !13} !17 = distinct !{!17, !11} !18 = distinct !{!18, !11}
#include <stdio.h> int main(void) { int team[100][2] = {{0}}; int array[31] = {0}; int i = 0, j, k, n, count; while(scanf("%d,%d",&team[i][0],&team[i][1]) ,team[i][0] != 0 ) { i++; } n = i; for(--i; i >= 0; i--) { array[team[i][1]] = 1; } while(scanf("%d",&k) != EOF) { count = 0; for(i = 0; i < n; i++ ) { if(team[i][0] == k ) { j = team[i][1]; break; } } for(i = 31; i > j; i--) { if(array[i]) { count++; } } printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %team = alloca [100 x [2 x i32]], align 16 %array = alloca [31 x i32], align 16 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %team) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %team, i8 0, i64 800, i1 false) call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %array) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(124) %array, i8 0, i64 124, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv81 = phi i32 [ %indvars.iv.next82, %while.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x [2 x i32]], ptr %team, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [100 x [2 x i32]], ptr %team, i64 0, i64 %indvars.iv, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %0 = load i32, ptr %arrayidx, align 8, !tbaa !5 %cmp.not = icmp eq i32 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next82 = add nuw i32 %indvars.iv81, 1 br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !9 for.cond.preheader: ; preds = %while.cond %1 = and i64 %indvars.iv, 4294967295 %cmp861.not = icmp eq i64 %1, 0 br i1 %cmp861.not, label %while.cond15.preheader.thread, label %for.body while.cond15.preheader: ; preds = %for.body %call1668 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %cmp17.not69 = icmp eq i32 %call1668, -1 br i1 %cmp17.not69, label %while.end44, label %for.cond19.preheader.lr.ph while.cond15.preheader.thread: ; preds = %for.cond.preheader %call166887 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %cmp17.not6988 = icmp eq i32 %call166887, -1 br i1 %cmp17.not6988, label %while.end44, label %for.cond19.preheader.preheader for.cond19.preheader.lr.ph: ; preds = %while.cond15.preheader br i1 %cmp861.not, label %for.cond19.preheader.preheader, label %for.cond19.preheader.us.preheader for.cond19.preheader.preheader: ; preds = %while.cond15.preheader.thread, %for.cond19.preheader.lr.ph br label %for.cond19.preheader for.cond19.preheader.us.preheader: ; preds = %for.cond19.preheader.lr.ph %wide.trip.count = zext i32 %indvars.iv81 to i64 br label %for.cond19.preheader.us for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.end42.us %j.070.us = phi i32 [ %j.1.us, %for.end42.us ], [ undef, %for.cond19.preheader.us.preheader ] %2 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body21.us for.cond19.us: ; preds = %for.body21.us %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count br i1 %exitcond.not, label %for.end31.us, label %for.body21.us, !llvm.loop !11 for.body21.us: ; preds = %for.cond19.preheader.us, %for.cond19.us %indvars.iv77 = phi i64 [ 0, %for.cond19.preheader.us ], [ %indvars.iv.next78, %for.cond19.us ] %arrayidx23.us = getelementptr inbounds [100 x [2 x i32]], ptr %team, i64 0, i64 %indvars.iv77 %3 = load i32, ptr %arrayidx23.us, align 8, !tbaa !5 %cmp25.us = icmp eq i32 %3, %2 br i1 %cmp25.us, label %if.then.us, label %for.cond19.us if.then.us: ; preds = %for.body21.us %arrayidx28.us = getelementptr inbounds [100 x [2 x i32]], ptr %team, i64 0, i64 %indvars.iv77, i64 1 %4 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 br label %for.end31.us for.end31.us: ; preds = %for.cond19.us, %if.then.us %j.1.us = phi i32 [ %4, %if.then.us ], [ %j.070.us, %for.cond19.us ] %cmp3365.us = icmp slt i32 %j.1.us, 31 br i1 %cmp3365.us, label %for.body34.us.preheader, label %for.end42.us for.body34.us.preheader: ; preds = %for.end31.us %5 = sext i32 %j.1.us to i64 %6 = sub nsw i64 31, %5 %min.iters.check = icmp ult i64 %6, 8 br i1 %min.iters.check, label %for.body34.us.preheader96, label %vector.ph vector.ph: ; preds = %for.body34.us.preheader %n.vec = and i64 %6, -8 %ind.end = sub nsw i64 31, %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %offset.idx = sub i64 31, %index %7 = getelementptr inbounds [31 x i32], ptr %array, i64 0, i64 %offset.idx %8 = getelementptr inbounds i32, ptr %7, i64 -3 %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %9 = getelementptr inbounds i32, ptr %7, i64 -7 %wide.load94 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %reverse95 = shufflevector <4 x i32> %wide.load94, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %10 = icmp ne <4 x i32> %reverse, zeroinitializer %11 = icmp ne <4 x i32> %reverse95, zeroinitializer %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi, %12 %15 = add <4 x i32> %vec.phi93, %13 %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 !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.end42.us, label %for.body34.us.preheader96 for.body34.us.preheader96: ; preds = %for.body34.us.preheader, %middle.block %indvars.iv83.ph = phi i64 [ 31, %for.body34.us.preheader ], [ %ind.end, %middle.block ] %count.067.us.ph = phi i32 [ 0, %for.body34.us.preheader ], [ %17, %middle.block ] br label %for.body34.us for.end42.us: ; preds = %for.body34.us, %middle.block, %for.end31.us %count.0.lcssa.us = phi i32 [ 0, %for.end31.us ], [ %17, %middle.block ], [ %spec.select.us, %for.body34.us ] %call43.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa.us) %call16.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %cmp17.not.us = icmp eq i32 %call16.us, -1 br i1 %cmp17.not.us, label %while.end44, label %for.cond19.preheader.us, !llvm.loop !15 for.body34.us: ; preds = %for.body34.us.preheader96, %for.body34.us %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body34.us ], [ %indvars.iv83.ph, %for.body34.us.preheader96 ] %count.067.us = phi i32 [ %spec.select.us, %for.body34.us ], [ %count.067.us.ph, %for.body34.us.preheader96 ] %arrayidx36.us = getelementptr inbounds [31 x i32], ptr %array, i64 0, i64 %indvars.iv83 %18 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %tobool.not.us = icmp ne i32 %18, 0 %inc38.us = zext i1 %tobool.not.us to i32 %spec.select.us = add nuw nsw i32 %count.067.us, %inc38.us %indvars.iv.next84 = add nsw i64 %indvars.iv83, -1 %cmp33.us = icmp sgt i64 %indvars.iv.next84, %5 br i1 %cmp33.us, label %for.body34.us, label %for.end42.us, !llvm.loop !16 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body ], [ %indvars.iv, %for.cond.preheader ] %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1 %idxprom9 = and i64 %indvars.iv.next75, 4294967295 %arrayidx11 = getelementptr inbounds [100 x [2 x i32]], ptr %team, i64 0, i64 %idxprom9, i64 1 %19 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %idxprom12 = sext i32 %19 to i64 %arrayidx13 = getelementptr inbounds [31 x i32], ptr %array, i64 0, i64 %idxprom12 store i32 1, ptr %arrayidx13, align 4, !tbaa !5 %20 = icmp sgt i64 %indvars.iv74, 1 br i1 %20, label %for.body, label %while.cond15.preheader, !llvm.loop !17 for.cond19.preheader: ; preds = %for.cond19.preheader.preheader, %for.cond19.preheader %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0) %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %cmp17.not = icmp eq i32 %call16, -1 br i1 %cmp17.not, label %while.end44, label %for.cond19.preheader, !llvm.loop !15 while.end44: ; preds = %for.end42.us, %for.cond19.preheader, %while.cond15.preheader.thread, %while.cond15.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %array) #5 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %team) #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.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 = { 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int t[1000],juni[1000]; int i=1,ju=1,k,j; int n,toi; while(1){ scanf("%d,%d",&n,&t[i]); if(n==0)break; i++; } for(k=30;k>=0;k--){ for(j=0;j<i;j++){ if(k==t[j]){ juni[j]=ju; n=1; } } if(n==1){ n=0; ju++; } } while(scanf("%d",&toi)!=EOF){ printf("%d\n",juni[toi]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232303/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca [1000 x i32], align 16 %juni = alloca [1000 x i32], align 16 %n = alloca i32, align 4 %toi = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %juni) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %toi) #3 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv44 = phi i32 [ %indvars.iv.next45, %while.cond ], [ 1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %arrayidx) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next45 = add nuw i32 %indvars.iv44, 1 br i1 %cmp, label %for.cond.preheader, label %while.cond for.cond.preheader: ; preds = %while.cond %wide.trip.count = zext i32 %indvars.iv44 to i64 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc17 %k.037 = phi i32 [ 30, %for.cond.preheader ], [ %dec, %for.inc17 ] %ju.036 = phi i32 [ 1, %for.cond.preheader ], [ %ju.1, %for.inc17 ] %1 = phi i32 [ 0, %for.cond.preheader ], [ %3, %for.inc17 ] br label %for.body4.outer for.body4.outer: ; preds = %for.inc.thread, %for.cond2.preheader %indvars.iv41.ph = phi i64 [ %indvars.iv.next4246, %for.inc.thread ], [ 0, %for.cond2.preheader ] %.ph = phi i32 [ 1, %for.inc.thread ], [ %1, %for.cond2.preheader ] br label %for.body4 while.cond19.preheader: ; preds = %for.inc17 %call2038 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %toi) %cmp21.not39 = icmp eq i32 %call2038, -1 br i1 %cmp21.not39, label %while.end26, label %while.body22 for.body4: ; preds = %for.body4.outer, %for.inc %indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.inc ], [ %indvars.iv41.ph, %for.body4.outer ] %arrayidx6 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv41 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %k.037, %2 br i1 %cmp7, label %for.inc.thread, label %for.inc for.inc: ; preds = %for.body4 %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1 %exitcond.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body4, !llvm.loop !9 for.inc.thread: ; preds = %for.body4 %arrayidx10 = getelementptr inbounds [1000 x i32], ptr %juni, i64 0, i64 %indvars.iv41 store i32 %ju.036, ptr %arrayidx10, align 4, !tbaa !5 store i32 1, ptr %n, align 4, !tbaa !5 %indvars.iv.next4246 = add nuw nsw i64 %indvars.iv41, 1 %exitcond.not47 = icmp eq i64 %indvars.iv.next4246, %wide.trip.count br i1 %exitcond.not47, label %if.then14, label %for.body4.outer, !llvm.loop !9 for.end: ; preds = %for.inc %cmp13 = icmp eq i32 %.ph, 1 br i1 %cmp13, label %if.then14, label %for.inc17 if.then14: ; preds = %for.inc.thread, %for.end store i32 0, ptr %n, align 4, !tbaa !5 %inc15 = add nsw i32 %ju.036, 1 br label %for.inc17 for.inc17: ; preds = %for.end, %if.then14 %3 = phi i32 [ 0, %if.then14 ], [ %.ph, %for.end ] %ju.1 = phi i32 [ %inc15, %if.then14 ], [ %ju.036, %for.end ] %dec = add nsw i32 %k.037, -1 %cmp1.not = icmp eq i32 %k.037, 0 br i1 %cmp1.not, label %while.cond19.preheader, label %for.cond2.preheader, !llvm.loop !11 while.body22: ; preds = %while.cond19.preheader, %while.body22 %4 = load i32, ptr %toi, align 4, !tbaa !5 %idxprom23 = sext i32 %4 to i64 %arrayidx24 = getelementptr inbounds [1000 x i32], ptr %juni, i64 0, i64 %idxprom23 %5 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %toi) %cmp21.not = icmp eq i32 %call20, -1 br i1 %cmp21.not, label %while.end26, label %while.body22, !llvm.loop !12 while.end26: ; preds = %while.body22, %while.cond19.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %toi) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %juni) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int num, variety, cake[100], i, max= 0; scanf("%d%d", &num, &variety); for(i= 0; i< variety; i++) { scanf("%d", &cake[i]); if(cake[i]> max) max= cake[i]; } if(max<= (num+ 1)/ 2) printf("0\n"); else printf("%d\n", max* 2- num- 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232347/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232347/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %variety = alloca i32, align 4 %cake = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %variety) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %cake) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %variety) %0 = load i32, ptr %variety, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %max.021 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %cake, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.021) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %variety, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %4 = load i32, ptr %num, align 4, !tbaa !5 %add = add nsw i32 %4, 1 %div = sdiv i32 %add, 2 %cmp7.not = icmp sgt i32 %max.0.lcssa, %div br i1 %cmp7.not, label %if.else, label %if.then8 if.then8: ; preds = %for.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end12 if.else: ; preds = %for.end %mul = shl nuw nsw i32 %max.0.lcssa, 1 %5 = xor i32 %4, -1 %sub10 = add i32 %mul, %5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub10) br label %if.end12 if.end12: ; preds = %if.else, %if.then8 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %cake) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %variety) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <limits.h> typedef struct { int l; int r; }pair_t; int main(void) { int n, q; char s[100001] = { 0 }; pair_t pair[100001] = { 0 }; int posi[100001] = { 0 }; int ans = 0; scanf("%d %d", &n, &q); scanf("%s", s); for (int i = 0; i < q; i++) scanf("%d %d", &pair[i].l, &pair[i].r); for (int i = 1; i < n ; i++) { posi[i] = posi[i - 1]; if (s[i - 1] == 'A' && s[i] == 'C') posi[i]++; } for (int i = 0; i < q; i++) { ans = posi[pair[i].r - 1]; ans -= posi[pair[i].l - 1]; printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232390/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232390/source.c" target datalayout = "e-m:e-p270: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.pair_t = type { i32, i32 } @.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 [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 %q = alloca i32, align 4 %s = alloca [100001 x i8], align 16 %pair = alloca [100001 x %struct.pair_t], align 16 %posi = alloca [100001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100001) %s, i8 0, i64 100001, i1 false) call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %pair) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800008) %pair, i8 0, i64 800008, i1 false) call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %posi) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %posi, i8 0, i64 400004, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body, label %for.cond6.preheader for.cond6.preheader.loopexit: ; preds = %for.body %1 = icmp sgt i32 %3, 0 br label %for.cond6.preheader for.cond6.preheader: ; preds = %for.cond6.preheader.loopexit, %entry %cmp3270 = phi i1 [ %1, %for.cond6.preheader.loopexit ], [ false, %entry ] %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp768 = icmp sgt i32 %2, 1 br i1 %cmp768, label %for.body9.preheader, label %for.cond31.preheader for.body9.preheader: ; preds = %for.cond6.preheader %wide.trip.count = zext i32 %2 to i64 br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x %struct.pair_t], ptr %pair, i64 0, i64 %indvars.iv %r = getelementptr inbounds [100001 x %struct.pair_t], ptr %pair, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %r) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %q, 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.loopexit, !llvm.loop !9 for.cond31.preheader: ; preds = %for.inc27, %for.cond6.preheader br i1 %cmp3270, label %for.body35, label %for.cond.cleanup34 for.body9: ; preds = %for.body9.preheader, %for.inc27 %5 = phi i32 [ 0, %for.body9.preheader ], [ %9, %for.inc27 ] %indvars.iv73 = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next74, %for.inc27 ] %6 = add nsw i64 %indvars.iv73, -1 %arrayidx13 = getelementptr inbounds [100001 x i32], ptr %posi, i64 0, i64 %indvars.iv73 store i32 %5, ptr %arrayidx13, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %6 %7 = load i8, ptr %arrayidx16, align 1, !tbaa !11 %cmp17 = icmp eq i8 %7, 65 br i1 %cmp17, label %land.lhs.true, label %for.inc27 land.lhs.true: ; preds = %for.body9 %arrayidx20 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv73 %8 = load i8, ptr %arrayidx20, align 1, !tbaa !11 %cmp22 = icmp eq i8 %8, 67 br i1 %cmp22, label %if.then, label %for.inc27 if.then: ; preds = %land.lhs.true %inc26 = add nsw i32 %5, 1 store i32 %inc26, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %for.body9, %land.lhs.true, %if.then %9 = phi i32 [ %5, %for.body9 ], [ %5, %land.lhs.true ], [ %inc26, %if.then ] %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count br i1 %exitcond.not, label %for.cond31.preheader, label %for.body9, !llvm.loop !12 for.cond.cleanup34: ; preds = %for.body35, %for.cond31.preheader call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %posi) #4 call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %pair) #4 call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body35: ; preds = %for.cond31.preheader, %for.body35 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body35 ], [ 0, %for.cond31.preheader ] %arrayidx37 = getelementptr inbounds [100001 x %struct.pair_t], ptr %pair, i64 0, i64 %indvars.iv77 %r38 = getelementptr inbounds [100001 x %struct.pair_t], ptr %pair, i64 0, i64 %indvars.iv77, i32 1 %10 = load i32, ptr %r38, align 4, !tbaa !13 %sub39 = add nsw i32 %10, -1 %idxprom40 = sext i32 %sub39 to i64 %arrayidx41 = getelementptr inbounds [100001 x i32], ptr %posi, i64 0, i64 %idxprom40 %11 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %12 = load i32, ptr %arrayidx37, align 8, !tbaa !15 %sub45 = add nsw i32 %12, -1 %idxprom46 = sext i32 %sub45 to i64 %arrayidx47 = getelementptr inbounds [100001 x i32], ptr %posi, i64 0, i64 %idxprom46 %13 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %sub48 = sub nsw i32 %11, %13 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub48) %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %14 = load i32, ptr %q, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp32 = icmp slt i64 %indvars.iv.next78, %15 br i1 %cmp32, label %for.body35, label %for.cond.cleanup34, !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: 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = !{!14, !6, i64 4} !14 = !{!"", !6, i64 0, !6, i64 4} !15 = !{!14, !6, i64 0} !16 = distinct !{!16, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ int N,Q,num[100005],l[100005],r[100005],x[100005],i,j; char str[100005],*p,s[100005]; fgets(str,sizeof(str),stdin); p=strtok(str," \n"); N=atoi(p); p=strtok(NULL," \n"); Q=atoi(p); fgets(str,sizeof(str),stdin); p=strtok(str," \n"); strcpy(s,p); for(i=0;i<Q;i++){ fgets(str,sizeof(str),stdin); p=strtok(str," \n"); l[i]=atoi(p); p=strtok(NULL," \n"); r[i]=atoi(p); } for(i=1,num[0]=0;i<N;i++){ if(s[i-1]=='A' && s[i]=='C'){ num[i]=num[i-1]+1; }else{ num[i]=num[i-1]; } } for(i=0;i<Q;i++){ x[i]=num[r[i]-1]-num[l[i]-1]; printf("%d\n",x[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232433/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232433/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c" \0A\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: %num = alloca [100005 x i32], align 16 %l = alloca [100005 x i32], align 16 %r = alloca [100005 x i32], align 16 %str = alloca [100005 x i8], align 16 %s = alloca [100005 x i8], align 16 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %num) #5 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %str) #5 call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %s) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100005, ptr noundef %0) %call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %call2, ptr noundef null, i32 noundef 10) #5 %conv.i = trunc i64 %call.i to i32 %call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call.i92 = call i64 @strtol(ptr nocapture noundef nonnull %call4, ptr noundef null, i32 noundef 10) #5 %conv.i93 = trunc i64 %call.i92 to i32 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call7 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100005, ptr noundef %1) %call9 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5 %call11 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %call9) #5 %cmp98 = icmp sgt i32 %conv.i93, 0 br i1 %cmp98, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call.i92, 4294967295 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 ] %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call13 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100005, ptr noundef %2) %call15 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5 %call.i94 = call i64 @strtol(ptr nocapture noundef nonnull %call15, ptr noundef null, i32 noundef 10) #5 %conv.i95 = trunc i64 %call.i94 to i32 %arrayidx = getelementptr inbounds [100005 x i32], ptr %l, i64 0, i64 %indvars.iv store i32 %conv.i95, ptr %arrayidx, align 4, !tbaa !9 %call17 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call.i96 = call i64 @strtol(ptr nocapture noundef nonnull %call17, ptr noundef null, i32 noundef 10) #5 %conv.i97 = trunc i64 %call.i96 to i32 %arrayidx20 = getelementptr inbounds [100005 x i32], ptr %r, i64 0, i64 %indvars.iv store i32 %conv.i97, ptr %arrayidx20, align 4, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry store i32 0, ptr %num, align 16, !tbaa !9 %cmp23100 = icmp sgt i32 %conv.i, 1 br i1 %cmp23100, label %for.body24.preheader, label %for.cond47.preheader for.body24.preheader: ; preds = %for.end %wide.trip.count109 = and i64 %call.i, 4294967295 br label %for.body24 for.cond47.preheader: ; preds = %for.inc44, %for.end br i1 %cmp98, label %for.body50.preheader, label %for.end69 for.body50.preheader: ; preds = %for.cond47.preheader %wide.trip.count114 = and i64 %call.i92, 4294967295 br label %for.body50 for.body24: ; preds = %for.body24.preheader, %for.inc44 %indvars.iv105 = phi i64 [ 1, %for.body24.preheader ], [ %indvars.iv.next106, %for.inc44 ] %3 = add nsw i64 %indvars.iv105, -1 %arrayidx26 = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %3 %4 = load i8, ptr %arrayidx26, align 1, !tbaa !13 %cmp27 = icmp eq i8 %4, 65 br i1 %cmp27, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body24 %arrayidx30 = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %indvars.iv105 %5 = load i8, ptr %arrayidx30, align 1, !tbaa !13 %cmp32 = icmp eq i8 %5, 67 br i1 %cmp32, label %if.then, label %if.else if.then: ; preds = %land.lhs.true %arrayidx36 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %3 %6 = load i32, ptr %arrayidx36, align 4, !tbaa !9 %add = add nsw i32 %6, 1 br label %for.inc44 if.else: ; preds = %land.lhs.true, %for.body24 %arrayidx41 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %3 %7 = load i32, ptr %arrayidx41, align 4, !tbaa !9 br label %for.inc44 for.inc44: ; preds = %if.then, %if.else %add.sink = phi i32 [ %add, %if.then ], [ %7, %if.else ] %arrayidx38 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %indvars.iv105 store i32 %add.sink, ptr %arrayidx38, align 4, !tbaa !9 %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count109 br i1 %exitcond110.not, label %for.cond47.preheader, label %for.body24, !llvm.loop !14 for.body50: ; preds = %for.body50.preheader, %for.body50 %indvars.iv111 = phi i64 [ 0, %for.body50.preheader ], [ %indvars.iv.next112, %for.body50 ] %arrayidx52 = getelementptr inbounds [100005 x i32], ptr %r, i64 0, i64 %indvars.iv111 %8 = load i32, ptr %arrayidx52, align 4, !tbaa !9 %sub53 = add nsw i32 %8, -1 %idxprom54 = sext i32 %sub53 to i64 %arrayidx55 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %idxprom54 %9 = load i32, ptr %arrayidx55, align 4, !tbaa !9 %arrayidx57 = getelementptr inbounds [100005 x i32], ptr %l, i64 0, i64 %indvars.iv111 %10 = load i32, ptr %arrayidx57, align 4, !tbaa !9 %sub58 = add nsw i32 %10, -1 %idxprom59 = sext i32 %sub58 to i64 %arrayidx60 = getelementptr inbounds [100005 x i32], ptr %num, i64 0, i64 %idxprom59 %11 = load i32, ptr %arrayidx60, align 4, !tbaa !9 %sub61 = sub nsw i32 %9, %11 %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub61) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114 br i1 %exitcond115.not, label %for.end69, label %for.body50, !llvm.loop !15 for.end69: ; preds = %for.body50, %for.cond47.preheader call void @llvm.lifetime.end.p0(i64 100005, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 100005, ptr nonnull %str) #5 call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %num) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, 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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include<stdio.h> #include<stdlib.h> #define MAX(A, B) (((A) > (B)) ? (A) : (B)) int* aclist(char* s, int size) { int f=0; int count=0; int* list = malloc((size + 1) * sizeof(int)); for (int i=0; i<size; i++) { if (*(s + i) == 'A') {f = 1;} else if ((*(s + i) == 'C') && (f)) { count++; f = 0; } else { f = 0; } *(list + i) = count; } *(list + size) = count; return list; } int ac(int* list, int l, int r) { int n; n = *(list + r - 1) - *(list + l - 1); return n; } int main() { int N, Q; scanf("%d %d", &N, &Q); char* s = malloc(N * sizeof(char)); scanf("%s", s); int* list = aclist(s, N); int l, r; for (int i=0; i<Q; i++) { scanf("%d %d", &l, &r); printf("%d\n", ac(list, l, r)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232477/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232477/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind memory(write, argmem: read, inaccessiblemem: readwrite) uwtable define dso_local noalias ptr @aclist(ptr nocapture noundef readonly %s, i32 noundef %size) local_unnamed_addr #0 { entry: %add = add nsw i32 %size, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #6 %cmp29 = icmp sgt i32 %size, 0 br i1 %cmp29, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %size, 1 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 %wide.trip.count, 4294967294 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %if.end12, %for.body.preheader %count.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %count.1.1, %if.end12 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %if.end12 ] %f.031.unr = phi i1 [ false, %for.body.preheader ], [ %cmp3.1, %if.end12 ] %count.030.unr = phi i32 [ 0, %for.body.preheader ], [ %count.1.1, %if.end12 ] %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 %add.ptr.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.unr %1 = load i8, ptr %add.ptr.epil, align 1, !tbaa !5 %cmp3.epil = icmp eq i8 %1, 65 %cmp8.epil = icmp eq i8 %1, 67 %or.cond.epil = and i1 %f.031.unr, %cmp8.epil %inc.epil = zext i1 %or.cond.epil to i32 %spec.select.epil = add nsw i32 %count.030.unr, %inc.epil %count.1.epil = select i1 %cmp3.epil, i32 %count.030.unr, i32 %spec.select.epil %add.ptr14.epil = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.unr store i32 %count.1.epil, ptr %add.ptr14.epil, align 4, !tbaa !8 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %count.1.epil, %for.body.epil ] %idx.ext16 = sext i32 %size to i64 %add.ptr17 = getelementptr inbounds i32, ptr %call, i64 %idx.ext16 store i32 %count.0.lcssa, ptr %add.ptr17, align 4, !tbaa !8 ret ptr %call for.body: ; preds = %if.end12, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %if.end12 ] %f.031 = phi i32 [ 0, %for.body.preheader.new ], [ %f.1.1, %if.end12 ] %count.030 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %if.end12 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %if.end12 ] %add.ptr = getelementptr inbounds i8, ptr %s, i64 %indvars.iv %2 = load i8, ptr %add.ptr, align 1, !tbaa !5 %cmp3 = icmp eq i8 %2, 65 br i1 %cmp3, label %if.end12, label %if.else if.else: ; preds = %for.body %cmp8 = icmp eq i8 %2, 67 %tobool = icmp ne i32 %f.031, 0 %or.cond = and i1 %tobool, %cmp8 %inc = zext i1 %or.cond to i32 %spec.select = add nsw i32 %count.030, %inc br label %if.end12 if.end12: ; preds = %if.else, %for.body %count.1 = phi i32 [ %count.030, %for.body ], [ %spec.select, %if.else ] %add.ptr14 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %count.1, ptr %add.ptr14, align 4, !tbaa !8 %indvars.iv.next = or i64 %indvars.iv, 1 %add.ptr.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %3 = load i8, ptr %add.ptr.1, align 1, !tbaa !5 %cmp3.1 = icmp eq i8 %3, 65 %cmp8.1 = icmp eq i8 %3, 67 %or.cond.1 = and i1 %cmp3, %cmp8.1 %inc.1 = zext i1 %or.cond.1 to i32 %spec.select.1 = add nsw i32 %count.1, %inc.1 %count.1.1 = select i1 %cmp3.1, i32 %count.1, i32 %spec.select.1 %f.1.1 = select i1 %cmp3.1, i32 1, i32 0 %add.ptr14.1 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next store i32 %count.1.1, ptr %add.ptr14.1, align 4, !tbaa !8 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ac(ptr nocapture noundef readonly %list, i32 noundef %l, i32 noundef %r) local_unnamed_addr #3 { entry: %idx.ext = sext i32 %r to i64 %add.ptr = getelementptr inbounds i32, ptr %list, i64 %idx.ext %add.ptr1 = getelementptr inbounds i32, ptr %add.ptr, i64 -1 %0 = load i32, ptr %add.ptr1, align 4, !tbaa !8 %idx.ext2 = sext i32 %l to i64 %add.ptr3 = getelementptr inbounds i32, ptr %list, i64 %idx.ext2 %add.ptr4 = getelementptr inbounds i32, ptr %add.ptr3, i64 -1 %1 = load i32, ptr %add.ptr4, align 4, !tbaa !8 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %N = alloca i32, align 4 %Q = alloca i32, align 4 %l = alloca i32, align 4 %r = 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 %Q) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Q) %0 = load i32, ptr %N, align 4, !tbaa !8 %conv = sext i32 %0 to i64 %call1 = call noalias ptr @malloc(i64 noundef %conv) #6 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call1) %1 = load i32, ptr %N, align 4, !tbaa !8 %add.i = add nsw i32 %1, 1 %conv.i = sext i32 %add.i to i64 %mul.i = shl nsw i64 %conv.i, 2 %call.i = call noalias ptr @malloc(i64 noundef %mul.i) #6 %cmp29.i = icmp sgt i32 %1, 0 br i1 %cmp29.i, label %for.body.preheader.i, label %aclist.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %2 = icmp eq i32 %1, 1 br i1 %2, label %aclist.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %if.end12.i, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %if.end12.i ] %f.031.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %f.1.i.1, %if.end12.i ] %count.030.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %count.1.i.1, %if.end12.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %if.end12.i ] %add.ptr.i = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv.i %3 = load i8, ptr %add.ptr.i, align 1, !tbaa !5 %cmp3.i = icmp eq i8 %3, 65 br i1 %cmp3.i, label %if.end12.i, label %if.else.i if.else.i: ; preds = %for.body.i %cmp8.i = icmp eq i8 %3, 67 %tobool.i = icmp ne i32 %f.031.i, 0 %or.cond.i = and i1 %tobool.i, %cmp8.i %inc.i = zext i1 %or.cond.i to i32 %spec.select.i = add nsw i32 %count.030.i, %inc.i br label %if.end12.i if.end12.i: ; preds = %if.else.i, %for.body.i %count.1.i = phi i32 [ %count.030.i, %for.body.i ], [ %spec.select.i, %if.else.i ] %add.ptr14.i = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i store i32 %count.1.i, ptr %add.ptr14.i, align 4, !tbaa !8 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %add.ptr.i.1 = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv.next.i %4 = load i8, ptr %add.ptr.i.1, align 1, !tbaa !5 %cmp3.i.1 = icmp eq i8 %4, 65 %cmp8.i.1 = icmp eq i8 %4, 67 %or.cond.i.1 = and i1 %cmp3.i, %cmp8.i.1 %inc.i.1 = zext i1 %or.cond.i.1 to i32 %spec.select.i.1 = add nsw i32 %count.1.i, %inc.i.1 %count.1.i.1 = select i1 %cmp3.i.1, i32 %count.1.i, i32 %spec.select.i.1 %f.1.i.1 = select i1 %cmp3.i.1, i32 1, i32 0 %add.ptr14.i.1 = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.next.i store i32 %count.1.i.1, ptr %add.ptr14.i.1, align 4, !tbaa !8 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %aclist.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !10 aclist.exit.loopexit.unr-lcssa: ; preds = %if.end12.i, %for.body.preheader.i %count.1.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %count.1.i.1, %if.end12.i ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %if.end12.i ] %f.031.i.unr = phi i1 [ false, %for.body.preheader.i ], [ %cmp3.i.1, %if.end12.i ] %count.030.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.i.1, %if.end12.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %aclist.exit, label %for.body.i.epil for.body.i.epil: ; preds = %aclist.exit.loopexit.unr-lcssa %add.ptr.i.epil = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv.i.unr %5 = load i8, ptr %add.ptr.i.epil, align 1, !tbaa !5 %cmp3.i.epil = icmp eq i8 %5, 65 %cmp8.i.epil = icmp eq i8 %5, 67 %or.cond.i.epil = and i1 %f.031.i.unr, %cmp8.i.epil %inc.i.epil = zext i1 %or.cond.i.epil to i32 %spec.select.i.epil = add nsw i32 %count.030.i.unr, %inc.i.epil %count.1.i.epil = select i1 %cmp3.i.epil, i32 %count.030.i.unr, i32 %spec.select.i.epil %add.ptr14.i.epil = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i.unr store i32 %count.1.i.epil, ptr %add.ptr14.i.epil, align 4, !tbaa !8 br label %aclist.exit aclist.exit: ; preds = %for.body.i.epil, %aclist.exit.loopexit.unr-lcssa, %entry %count.0.lcssa.i = phi i32 [ 0, %entry ], [ %count.1.i.lcssa.ph, %aclist.exit.loopexit.unr-lcssa ], [ %count.1.i.epil, %for.body.i.epil ] %idx.ext16.i = sext i32 %1 to i64 %add.ptr17.i = getelementptr inbounds i32, ptr %call.i, i64 %idx.ext16.i store i32 %count.0.lcssa.i, ptr %add.ptr17.i, align 4, !tbaa !8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %invariant.gep = getelementptr i32, ptr %call.i, i64 -1 %6 = load i32, ptr %Q, align 4, !tbaa !8 %cmp13 = icmp sgt i32 %6, 0 br i1 %cmp13, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %aclist.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 for.body: ; preds = %aclist.exit, %for.body %i.014 = phi i32 [ %inc, %for.body ], [ 0, %aclist.exit ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r) %7 = load i32, ptr %l, align 4, !tbaa !8 %8 = load i32, ptr %r, align 4, !tbaa !8 %idx.ext.i = sext i32 %8 to i64 %gep = getelementptr i32, ptr %invariant.gep, i64 %idx.ext.i %9 = load i32, ptr %gep, align 4, !tbaa !8 %idx.ext2.i = sext i32 %7 to i64 %gep12 = getelementptr i32, ptr %invariant.gep, i64 %idx.ext2.i %10 = load i32, ptr %gep12, align 4, !tbaa !8 %sub.i = sub nsw i32 %9, %10 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub.i) %inc = add nuw nsw i32 %i.014, 1 %11 = load i32, ptr %Q, align 4, !tbaa !8 %cmp = icmp slt i32 %inc, %11 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12 } ; 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 = { nofree nounwind memory(write, argmem: read, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind allocsize(0) } 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include<stdio.h> #include<string.h> int main() { int a[100001],i,n; while(~scanf("%d",&n)) { memset(a,0,sizeof(a)); for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=n-2;i>=0;i--) if(a[i+1]<a[i]) break; printf("%d\n",i+1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23252/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23252/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [100001 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool.not28 = icmp eq i32 %call27, -1 br i1 %tobool.not28, label %while.end, label %while.body while.body: ; preds = %entry, %for.end11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %a, i8 0, i64 400004, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.body, label %for.end.thread for.end.thread: ; preds = %while.body %sub32 = add nsw i32 %0, -2 br label %for.end11 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [100001 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 = add nsw i32 %1, -2 %cmp323 = icmp sgt i32 %1, 1 br i1 %cmp323, label %for.body4, label %for.end11 for.body4: ; preds = %for.end, %for.inc10 %i.124 = phi i32 [ %dec, %for.inc10 ], [ %sub, %for.end ] %add = add nuw nsw i32 %i.124, 1 %idxprom5 = zext i32 %add to i64 %arrayidx6 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom5 %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %idxprom7 = zext i32 %i.124 to i64 %arrayidx8 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom7 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp slt i32 %3, %4 br i1 %cmp9, label %for.end11, label %for.inc10 for.inc10: ; preds = %for.body4 %dec = add nsw i32 %i.124, -1 %cmp3 = icmp sgt i32 %i.124, 0 br i1 %cmp3, label %for.body4, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.inc10, %for.body4, %for.end.thread, %for.end %i.1.lcssa = phi i32 [ %sub, %for.end ], [ %sub32, %for.end.thread ], [ %i.124, %for.body4 ], [ -1, %for.inc10 ] %add12 = add nsw i32 %i.1.lcssa, 1 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add12) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %for.end11, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 400004, 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int aa[4][2]={{-1,0},{0,-1},{1,0},{0,1}}; int seihou[200][2],an[100][2],i,n,m=0,ten,muki; int minx=0,maxx=0,miny=0,maxy=0; while(1){ scanf("%d",&n); if(n==0)break; seihou[0][0]=0; seihou[0][1]=0; for(i=1;i<n;i++){ scanf("%d%d",&ten,&muki); seihou[i][0]=seihou[ten][0]+aa[muki][0]; seihou[i][1]=seihou[ten][1]+aa[muki][1]; } for(i=0;i<n;i++){ if(minx>seihou[i][0])minx=seihou[i][0]; else if(maxx<seihou[i][0])maxx=seihou[i][0]; else if(miny>seihou[i][1])miny=seihou[i][1]; else if(maxy<seihou[i][1])maxy=seihou[i][1]; } an[m][0]=maxx-minx+1; an[m][1]=maxy-miny+1; m++; maxx=0;minx=0,miny=0,maxy=0; } for(i=0;i<m;i++){ printf("%d %d\n",an[i][0],an[i][1]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232563/source.c" target datalayout = "e-m:e-p270: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.aa = private unnamed_addr constant [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 -1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1]], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %seihou = alloca [200 x [2 x i32]], align 16 %an = alloca [100 x [2 x i32]], align 16 %n = alloca i32, align 4 %ten = alloca i32, align 4 %muki = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %seihou) #4 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %an) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ten) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %muki) #4 %call129 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp130 = icmp eq i32 %0, 0 br i1 %cmp130, label %for.end90, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry %arrayidx3 = getelementptr inbounds [2 x i32], ptr %seihou, i64 0, i64 1 br label %if.end for.cond78.preheader: ; preds = %for.end67 %1 = and i64 %indvars.iv.next142, 4294967295 %cmp79133.not = icmp eq i64 %1, 0 br i1 %cmp79133.not, label %for.end90, label %for.body80.preheader for.body80.preheader: ; preds = %for.cond78.preheader %wide.trip.count147 = and i64 %indvars.iv.next142, 4294967295 br label %for.body80 if.end: ; preds = %if.end.lr.ph, %for.end67 %2 = phi i32 [ %0, %if.end.lr.ph ], [ %19, %for.end67 ] %indvars.iv141 = phi i64 [ 0, %if.end.lr.ph ], [ %indvars.iv.next142, %for.end67 ] store i32 0, ptr %seihou, align 16, !tbaa !5 store i32 0, ptr %arrayidx3, align 4, !tbaa !5 %cmp4117 = icmp sgt i32 %2, 1 br i1 %cmp4117, label %for.body, label %for.cond24.preheader for.cond24.preheader: ; preds = %for.body, %if.end %.lcssa = phi i32 [ %2, %if.end ], [ %9, %for.body ] %cmp25119 = icmp sgt i32 %.lcssa, 0 br i1 %cmp25119, label %for.body26.preheader, label %for.end67 for.body26.preheader: ; preds = %for.cond24.preheader %wide.trip.count = zext i32 %.lcssa to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %.lcssa, 1 br i1 %3, label %for.end67.loopexit.unr-lcssa, label %for.body26.preheader.new for.body26.preheader.new: ; preds = %for.body26.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body26 for.body: ; preds = %if.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %if.end ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ten, ptr noundef nonnull %muki) %4 = load i32, ptr %ten, align 4, !tbaa !5 %idxprom = sext i32 %4 to i64 %arrayidx6 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %idxprom %5 = load i32, ptr %muki, align 4, !tbaa !5 %idxprom8 = sext i32 %5 to i64 %arrayidx9 = getelementptr inbounds [4 x [2 x i32]], ptr @__const.main.aa, i64 0, i64 %idxprom8 %arrayidx12 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv %6 = load <2 x i32>, ptr %arrayidx6, align 8, !tbaa !5 %7 = load <2 x i32>, ptr %arrayidx9, align 8, !tbaa !5 %8 = add nsw <2 x i32> %7, %6 store <2 x i32> %8, ptr %arrayidx12, align 8, !tbaa !5 %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 %cmp4 = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp4, label %for.body, label %for.cond24.preheader, !llvm.loop !9 for.body26: ; preds = %for.inc65.1, %for.body26.preheader.new %indvars.iv138 = phi i64 [ 0, %for.body26.preheader.new ], [ %indvars.iv.next139.1, %for.inc65.1 ] %maxy.1124 = phi i32 [ 0, %for.body26.preheader.new ], [ %maxy.2.1, %for.inc65.1 ] %miny.1123 = phi i32 [ 0, %for.body26.preheader.new ], [ %miny.2.1, %for.inc65.1 ] %maxx.1122 = phi i32 [ 0, %for.body26.preheader.new ], [ %maxx.2.1, %for.inc65.1 ] %minx.1121 = phi i32 [ 0, %for.body26.preheader.new ], [ %minx.2.1, %for.inc65.1 ] %niter = phi i64 [ 0, %for.body26.preheader.new ], [ %niter.next.1, %for.inc65.1 ] %arrayidx28 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv138 %11 = load i32, ptr %arrayidx28, align 16, !tbaa !5 %cmp30 = icmp sgt i32 %minx.1121, %11 br i1 %cmp30, label %for.inc65, label %if.else if.else: ; preds = %for.body26 %cmp38 = icmp slt i32 %maxx.1122, %11 br i1 %cmp38, label %for.inc65, label %if.else43 if.else43: ; preds = %if.else %arrayidx46 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv138, i64 1 %12 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %miny.1123, %12 br i1 %cmp47, label %for.inc65, label %if.else52 if.else52: ; preds = %if.else43 %spec.select = call i32 @llvm.smax.i32(i32 %maxy.1124, i32 %12) br label %for.inc65 for.inc65: ; preds = %if.else52, %if.else43, %if.else, %for.body26 %minx.2 = phi i32 [ %11, %for.body26 ], [ %minx.1121, %if.else ], [ %minx.1121, %if.else43 ], [ %minx.1121, %if.else52 ] %maxx.2 = phi i32 [ %maxx.1122, %for.body26 ], [ %11, %if.else ], [ %maxx.1122, %if.else43 ], [ %maxx.1122, %if.else52 ] %miny.2 = phi i32 [ %miny.1123, %for.body26 ], [ %miny.1123, %if.else ], [ %12, %if.else43 ], [ %miny.1123, %if.else52 ] %maxy.2 = phi i32 [ %maxy.1124, %for.body26 ], [ %maxy.1124, %if.else ], [ %maxy.1124, %if.else43 ], [ %spec.select, %if.else52 ] %indvars.iv.next139 = or i64 %indvars.iv138, 1 %arrayidx28.1 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv.next139 %13 = load i32, ptr %arrayidx28.1, align 8, !tbaa !5 %cmp30.1 = icmp sgt i32 %minx.2, %13 br i1 %cmp30.1, label %for.inc65.1, label %if.else.1 if.else.1: ; preds = %for.inc65 %cmp38.1 = icmp slt i32 %maxx.2, %13 br i1 %cmp38.1, label %for.inc65.1, label %if.else43.1 if.else43.1: ; preds = %if.else.1 %arrayidx46.1 = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv.next139, i64 1 %14 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5 %cmp47.1 = icmp sgt i32 %miny.2, %14 br i1 %cmp47.1, label %for.inc65.1, label %if.else52.1 if.else52.1: ; preds = %if.else43.1 %spec.select.1 = call i32 @llvm.smax.i32(i32 %maxy.2, i32 %14) br label %for.inc65.1 for.inc65.1: ; preds = %if.else52.1, %if.else43.1, %if.else.1, %for.inc65 %minx.2.1 = phi i32 [ %13, %for.inc65 ], [ %minx.2, %if.else.1 ], [ %minx.2, %if.else43.1 ], [ %minx.2, %if.else52.1 ] %maxx.2.1 = phi i32 [ %maxx.2, %for.inc65 ], [ %13, %if.else.1 ], [ %maxx.2, %if.else43.1 ], [ %maxx.2, %if.else52.1 ] %miny.2.1 = phi i32 [ %miny.2, %for.inc65 ], [ %miny.2, %if.else.1 ], [ %14, %if.else43.1 ], [ %miny.2, %if.else52.1 ] %maxy.2.1 = phi i32 [ %maxy.2, %for.inc65 ], [ %maxy.2, %if.else.1 ], [ %maxy.2, %if.else43.1 ], [ %spec.select.1, %if.else52.1 ] %indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138, 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.end67.loopexit.unr-lcssa, label %for.body26, !llvm.loop !11 for.end67.loopexit.unr-lcssa: ; preds = %for.inc65.1, %for.body26.preheader %minx.2.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %minx.2.1, %for.inc65.1 ] %maxx.2.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %maxx.2.1, %for.inc65.1 ] %miny.2.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %miny.2.1, %for.inc65.1 ] %maxy.2.lcssa.ph = phi i32 [ undef, %for.body26.preheader ], [ %maxy.2.1, %for.inc65.1 ] %indvars.iv138.unr = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next139.1, %for.inc65.1 ] %maxy.1124.unr = phi i32 [ 0, %for.body26.preheader ], [ %maxy.2.1, %for.inc65.1 ] %miny.1123.unr = phi i32 [ 0, %for.body26.preheader ], [ %miny.2.1, %for.inc65.1 ] %maxx.1122.unr = phi i32 [ 0, %for.body26.preheader ], [ %maxx.2.1, %for.inc65.1 ] %minx.1121.unr = phi i32 [ 0, %for.body26.preheader ], [ %minx.2.1, %for.inc65.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end67.loopexit, label %for.body26.epil for.body26.epil: ; preds = %for.end67.loopexit.unr-lcssa %arrayidx28.epil = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv138.unr %15 = load i32, ptr %arrayidx28.epil, align 8, !tbaa !5 %cmp30.epil = icmp sgt i32 %minx.1121.unr, %15 br i1 %cmp30.epil, label %for.end67.loopexit, label %if.else.epil if.else.epil: ; preds = %for.body26.epil %cmp38.epil = icmp slt i32 %maxx.1122.unr, %15 br i1 %cmp38.epil, label %for.end67.loopexit, label %if.else43.epil if.else43.epil: ; preds = %if.else.epil %arrayidx46.epil = getelementptr inbounds [200 x [2 x i32]], ptr %seihou, i64 0, i64 %indvars.iv138.unr, i64 1 %16 = load i32, ptr %arrayidx46.epil, align 4, !tbaa !5 %cmp47.epil = icmp sgt i32 %miny.1123.unr, %16 br i1 %cmp47.epil, label %for.end67.loopexit, label %if.else52.epil if.else52.epil: ; preds = %if.else43.epil %spec.select.epil = call i32 @llvm.smax.i32(i32 %maxy.1124.unr, i32 %16) br label %for.end67.loopexit for.end67.loopexit: ; preds = %for.body26.epil, %if.else.epil, %if.else43.epil, %if.else52.epil, %for.end67.loopexit.unr-lcssa %minx.2.lcssa = phi i32 [ %minx.2.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %15, %for.body26.epil ], [ %minx.1121.unr, %if.else.epil ], [ %minx.1121.unr, %if.else43.epil ], [ %minx.1121.unr, %if.else52.epil ] %maxx.2.lcssa = phi i32 [ %maxx.2.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %maxx.1122.unr, %for.body26.epil ], [ %15, %if.else.epil ], [ %maxx.1122.unr, %if.else43.epil ], [ %maxx.1122.unr, %if.else52.epil ] %miny.2.lcssa = phi i32 [ %miny.2.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %miny.1123.unr, %for.body26.epil ], [ %miny.1123.unr, %if.else.epil ], [ %16, %if.else43.epil ], [ %miny.1123.unr, %if.else52.epil ] %maxy.2.lcssa = phi i32 [ %maxy.2.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %maxy.1124.unr, %for.body26.epil ], [ %maxy.1124.unr, %if.else.epil ], [ %maxy.1124.unr, %if.else43.epil ], [ %spec.select.epil, %if.else52.epil ] %17 = sub i32 %maxx.2.lcssa, %minx.2.lcssa %18 = sub i32 %maxy.2.lcssa, %miny.2.lcssa br label %for.end67 for.end67: ; preds = %for.end67.loopexit, %for.cond24.preheader %reass.sub = phi i32 [ 0, %for.cond24.preheader ], [ %17, %for.end67.loopexit ] %reass.sub135 = phi i32 [ 0, %for.cond24.preheader ], [ %18, %for.end67.loopexit ] %add68 = add i32 %reass.sub, 1 %arrayidx70 = getelementptr inbounds [100 x [2 x i32]], ptr %an, i64 0, i64 %indvars.iv141 store i32 %add68, ptr %arrayidx70, align 8, !tbaa !5 %add73 = add i32 %reass.sub135, 1 %arrayidx76 = getelementptr inbounds [100 x [2 x i32]], ptr %an, i64 0, i64 %indvars.iv141, i64 1 store i32 %add73, ptr %arrayidx76, align 4, !tbaa !5 %indvars.iv.next142 = add nuw i64 %indvars.iv141, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %19, 0 br i1 %cmp, label %for.cond78.preheader, label %if.end for.body80: ; preds = %for.body80.preheader, %for.body80 %indvars.iv144 = phi i64 [ 0, %for.body80.preheader ], [ %indvars.iv.next145, %for.body80 ] %arrayidx82 = getelementptr inbounds [100 x [2 x i32]], ptr %an, i64 0, i64 %indvars.iv144 %20 = load i32, ptr %arrayidx82, align 8, !tbaa !5 %arrayidx86 = getelementptr inbounds [100 x [2 x i32]], ptr %an, i64 0, i64 %indvars.iv144, i64 1 %21 = load i32, ptr %arrayidx86, align 4, !tbaa !5 %call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20, i32 noundef %21) %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147 br i1 %exitcond148.not, label %for.end90, label %for.body80, !llvm.loop !12 for.end90: ; preds = %for.body80, %entry, %for.cond78.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %muki) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ten) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %an) #4 call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %seihou) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int get_uint() { int n = 0; int c = getchar_unlocked(); if(c < 48 || 57 < c) return c; while(47 < c && c < 58) n = 10 * n + (c & 0xf), c = getchar_unlocked(); return n; } void print(unsigned char Q[8][8]) { for(int i = 0; i < 8; ++i) { for(int j = 0; j < 8; ++j) putchar_unlocked(Q[i][j] ? 'Q' : '.'); putchar_unlocked('\n'); } } void queen_eight(unsigned char Q[8][8], unsigned char row[8], unsigned char col[8], unsigned char lrd[15], unsigned char lld[15], int cnt) { if(cnt == 8) { print(Q); return; } if(row[cnt]) { queen_eight(Q, row, col, lrd, lld, cnt + 1); return; } for(int i = 0; i < 8; ++i) { if(col[i] || lrd[cnt - i + 7] || lld[cnt + i]) continue; Q[cnt][i] = row[cnt] = col[i] = lrd[cnt - i + 7] = lld[cnt + i] = 1; queen_eight(Q, row, col, lrd, lld, cnt + 1); Q[cnt][i] = row[cnt] = col[i] = lrd[cnt - i + 7] = lld[cnt + i] = 0; } } int main(int argc, char **argv) { unsigned char Q[8][8] = {}; unsigned char row[8] = {}; unsigned char col[8] = {}; unsigned char lrd[15] = {}; unsigned char lld[15] = {}; int k = get_uint(); for(int i = 0; i < k; ++i) { int r = get_uint(); int c = get_uint(); Q[r][c] = row[r] = col[c] = lrd[r - c + 7] = lld[r + c] = 1; } queen_eight(Q, row, col, lrd, lld, 0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232620/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232620/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @stdin = external local_unnamed_addr global ptr, align 8 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @get_uint() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 br label %getchar_unlocked.exit cond.false.i: ; preds = %entry %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %getchar_unlocked.exit getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] %4 = add i32 %cond.i, -58 %or.cond = icmp ult i32 %4, -10 br i1 %or.cond, label %cleanup, label %while.body.preheader while.body.preheader: ; preds = %getchar_unlocked.exit %.pre24 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit21 %5 = phi ptr [ %9, %getchar_unlocked.exit21 ], [ %.pre24, %while.body.preheader ] %c.023 = phi i32 [ %cond.i17, %getchar_unlocked.exit21 ], [ %cond.i, %while.body.preheader ] %n.022 = phi i32 [ %add, %getchar_unlocked.exit21 ], [ 0, %while.body.preheader ] %mul = mul nsw i32 %n.022, 10 %and = and i32 %c.023, 15 %add = add nsw i32 %and, %mul %_IO_read_ptr.i12 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1 %6 = load ptr, ptr %_IO_read_ptr.i12, align 8, !tbaa !9 %_IO_read_end.i13 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2 %7 = load ptr, ptr %_IO_read_end.i13, align 8, !tbaa !14 %cmp.not.i14 = icmp ult ptr %6, %7 br i1 %cmp.not.i14, label %cond.false.i18, label %cond.true.i15, !prof !15 cond.true.i15: ; preds = %while.body %call.i16 = tail call i32 @__uflow(ptr noundef nonnull %5) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21 cond.false.i18: ; preds = %while.body %incdec.ptr.i19 = getelementptr inbounds i8, ptr %6, i64 1 store ptr %incdec.ptr.i19, ptr %_IO_read_ptr.i12, align 8, !tbaa !9 %8 = load i8, ptr %6, align 1, !tbaa !16 %conv3.i20 = zext i8 %8 to i32 br label %getchar_unlocked.exit21 getchar_unlocked.exit21: ; preds = %cond.true.i15, %cond.false.i18 %9 = phi ptr [ %.pre, %cond.true.i15 ], [ %5, %cond.false.i18 ] %cond.i17 = phi i32 [ %call.i16, %cond.true.i15 ], [ %conv3.i20, %cond.false.i18 ] %10 = add i32 %cond.i17, -48 %11 = icmp ult i32 %10, 10 br i1 %11, label %while.body, label %cleanup, !llvm.loop !17 cleanup: ; preds = %getchar_unlocked.exit21, %getchar_unlocked.exit %retval.0 = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %add, %getchar_unlocked.exit21 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %Q) local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %putchar_unlocked.exit %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %putchar_unlocked.exit ] %arrayidx6 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 0 %0 = load i8, ptr %arrayidx6, align 1, !tbaa !16 %tobool.not = icmp eq i8 %0, 0 %cond = select i1 %tobool.not, i32 46, i32 81 %1 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15 = getelementptr inbounds %struct._IO_FILE, ptr %1, i64 0, i32 5 %2 = load ptr, ptr %_IO_write_ptr.i15, align 8, !tbaa !19 %_IO_write_end.i16 = getelementptr inbounds %struct._IO_FILE, ptr %1, i64 0, i32 6 %3 = load ptr, ptr %_IO_write_end.i16, align 8, !tbaa !20 %cmp.not.i17 = icmp ult ptr %2, %3 br i1 %cmp.not.i17, label %cond.false.i21, label %cond.true.i18, !prof !15 for.cond.cleanup: ; preds = %putchar_unlocked.exit ret void cond.true.i: ; preds = %putchar_unlocked.exit23.7 %call.i = tail call i32 @__overflow(ptr noundef nonnull %32, i32 noundef 10) #4 br label %putchar_unlocked.exit cond.false.i: ; preds = %putchar_unlocked.exit23.7 %incdec.ptr.i = getelementptr inbounds i8, ptr %33, i64 1 store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !19 store i8 10, ptr %33, align 1, !tbaa !16 br label %putchar_unlocked.exit putchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !21 cond.true.i18: ; preds = %for.cond1.preheader %call.i19 = tail call i32 @__overflow(ptr noundef nonnull %1, i32 noundef %cond) #4 br label %putchar_unlocked.exit23 cond.false.i21: ; preds = %for.cond1.preheader %conv4.i = trunc i32 %cond to i8 %incdec.ptr.i22 = getelementptr inbounds i8, ptr %2, i64 1 store ptr %incdec.ptr.i22, ptr %_IO_write_ptr.i15, align 8, !tbaa !19 store i8 %conv4.i, ptr %2, align 1, !tbaa !16 br label %putchar_unlocked.exit23 putchar_unlocked.exit23: ; preds = %cond.true.i18, %cond.false.i21 %arrayidx6.1 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 1 %4 = load i8, ptr %arrayidx6.1, align 1, !tbaa !16 %tobool.not.1 = icmp eq i8 %4, 0 %cond.1 = select i1 %tobool.not.1, i32 46, i32 81 %5 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.1 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 5 %6 = load ptr, ptr %_IO_write_ptr.i15.1, align 8, !tbaa !19 %_IO_write_end.i16.1 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 6 %7 = load ptr, ptr %_IO_write_end.i16.1, align 8, !tbaa !20 %cmp.not.i17.1 = icmp ult ptr %6, %7 br i1 %cmp.not.i17.1, label %cond.false.i21.1, label %cond.true.i18.1, !prof !15 cond.true.i18.1: ; preds = %putchar_unlocked.exit23 %call.i19.1 = tail call i32 @__overflow(ptr noundef nonnull %5, i32 noundef %cond.1) #4 br label %putchar_unlocked.exit23.1 cond.false.i21.1: ; preds = %putchar_unlocked.exit23 %conv4.i.1 = trunc i32 %cond.1 to i8 %incdec.ptr.i22.1 = getelementptr inbounds i8, ptr %6, i64 1 store ptr %incdec.ptr.i22.1, ptr %_IO_write_ptr.i15.1, align 8, !tbaa !19 store i8 %conv4.i.1, ptr %6, align 1, !tbaa !16 br label %putchar_unlocked.exit23.1 putchar_unlocked.exit23.1: ; preds = %cond.false.i21.1, %cond.true.i18.1 %arrayidx6.2 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 2 %8 = load i8, ptr %arrayidx6.2, align 1, !tbaa !16 %tobool.not.2 = icmp eq i8 %8, 0 %cond.2 = select i1 %tobool.not.2, i32 46, i32 81 %9 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.2 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 5 %10 = load ptr, ptr %_IO_write_ptr.i15.2, align 8, !tbaa !19 %_IO_write_end.i16.2 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 6 %11 = load ptr, ptr %_IO_write_end.i16.2, align 8, !tbaa !20 %cmp.not.i17.2 = icmp ult ptr %10, %11 br i1 %cmp.not.i17.2, label %cond.false.i21.2, label %cond.true.i18.2, !prof !15 cond.true.i18.2: ; preds = %putchar_unlocked.exit23.1 %call.i19.2 = tail call i32 @__overflow(ptr noundef nonnull %9, i32 noundef %cond.2) #4 br label %putchar_unlocked.exit23.2 cond.false.i21.2: ; preds = %putchar_unlocked.exit23.1 %conv4.i.2 = trunc i32 %cond.2 to i8 %incdec.ptr.i22.2 = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr.i22.2, ptr %_IO_write_ptr.i15.2, align 8, !tbaa !19 store i8 %conv4.i.2, ptr %10, align 1, !tbaa !16 br label %putchar_unlocked.exit23.2 putchar_unlocked.exit23.2: ; preds = %cond.false.i21.2, %cond.true.i18.2 %arrayidx6.3 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 3 %12 = load i8, ptr %arrayidx6.3, align 1, !tbaa !16 %tobool.not.3 = icmp eq i8 %12, 0 %cond.3 = select i1 %tobool.not.3, i32 46, i32 81 %13 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.3 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 5 %14 = load ptr, ptr %_IO_write_ptr.i15.3, align 8, !tbaa !19 %_IO_write_end.i16.3 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 6 %15 = load ptr, ptr %_IO_write_end.i16.3, align 8, !tbaa !20 %cmp.not.i17.3 = icmp ult ptr %14, %15 br i1 %cmp.not.i17.3, label %cond.false.i21.3, label %cond.true.i18.3, !prof !15 cond.true.i18.3: ; preds = %putchar_unlocked.exit23.2 %call.i19.3 = tail call i32 @__overflow(ptr noundef nonnull %13, i32 noundef %cond.3) #4 br label %putchar_unlocked.exit23.3 cond.false.i21.3: ; preds = %putchar_unlocked.exit23.2 %conv4.i.3 = trunc i32 %cond.3 to i8 %incdec.ptr.i22.3 = getelementptr inbounds i8, ptr %14, i64 1 store ptr %incdec.ptr.i22.3, ptr %_IO_write_ptr.i15.3, align 8, !tbaa !19 store i8 %conv4.i.3, ptr %14, align 1, !tbaa !16 br label %putchar_unlocked.exit23.3 putchar_unlocked.exit23.3: ; preds = %cond.false.i21.3, %cond.true.i18.3 %arrayidx6.4 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 4 %16 = load i8, ptr %arrayidx6.4, align 1, !tbaa !16 %tobool.not.4 = icmp eq i8 %16, 0 %cond.4 = select i1 %tobool.not.4, i32 46, i32 81 %17 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.4 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 5 %18 = load ptr, ptr %_IO_write_ptr.i15.4, align 8, !tbaa !19 %_IO_write_end.i16.4 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 6 %19 = load ptr, ptr %_IO_write_end.i16.4, align 8, !tbaa !20 %cmp.not.i17.4 = icmp ult ptr %18, %19 br i1 %cmp.not.i17.4, label %cond.false.i21.4, label %cond.true.i18.4, !prof !15 cond.true.i18.4: ; preds = %putchar_unlocked.exit23.3 %call.i19.4 = tail call i32 @__overflow(ptr noundef nonnull %17, i32 noundef %cond.4) #4 br label %putchar_unlocked.exit23.4 cond.false.i21.4: ; preds = %putchar_unlocked.exit23.3 %conv4.i.4 = trunc i32 %cond.4 to i8 %incdec.ptr.i22.4 = getelementptr inbounds i8, ptr %18, i64 1 store ptr %incdec.ptr.i22.4, ptr %_IO_write_ptr.i15.4, align 8, !tbaa !19 store i8 %conv4.i.4, ptr %18, align 1, !tbaa !16 br label %putchar_unlocked.exit23.4 putchar_unlocked.exit23.4: ; preds = %cond.false.i21.4, %cond.true.i18.4 %arrayidx6.5 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 5 %20 = load i8, ptr %arrayidx6.5, align 1, !tbaa !16 %tobool.not.5 = icmp eq i8 %20, 0 %cond.5 = select i1 %tobool.not.5, i32 46, i32 81 %21 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.5 = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 5 %22 = load ptr, ptr %_IO_write_ptr.i15.5, align 8, !tbaa !19 %_IO_write_end.i16.5 = getelementptr inbounds %struct._IO_FILE, ptr %21, i64 0, i32 6 %23 = load ptr, ptr %_IO_write_end.i16.5, align 8, !tbaa !20 %cmp.not.i17.5 = icmp ult ptr %22, %23 br i1 %cmp.not.i17.5, label %cond.false.i21.5, label %cond.true.i18.5, !prof !15 cond.true.i18.5: ; preds = %putchar_unlocked.exit23.4 %call.i19.5 = tail call i32 @__overflow(ptr noundef nonnull %21, i32 noundef %cond.5) #4 br label %putchar_unlocked.exit23.5 cond.false.i21.5: ; preds = %putchar_unlocked.exit23.4 %conv4.i.5 = trunc i32 %cond.5 to i8 %incdec.ptr.i22.5 = getelementptr inbounds i8, ptr %22, i64 1 store ptr %incdec.ptr.i22.5, ptr %_IO_write_ptr.i15.5, align 8, !tbaa !19 store i8 %conv4.i.5, ptr %22, align 1, !tbaa !16 br label %putchar_unlocked.exit23.5 putchar_unlocked.exit23.5: ; preds = %cond.false.i21.5, %cond.true.i18.5 %arrayidx6.6 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 6 %24 = load i8, ptr %arrayidx6.6, align 1, !tbaa !16 %tobool.not.6 = icmp eq i8 %24, 0 %cond.6 = select i1 %tobool.not.6, i32 46, i32 81 %25 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.6 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 5 %26 = load ptr, ptr %_IO_write_ptr.i15.6, align 8, !tbaa !19 %_IO_write_end.i16.6 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 6 %27 = load ptr, ptr %_IO_write_end.i16.6, align 8, !tbaa !20 %cmp.not.i17.6 = icmp ult ptr %26, %27 br i1 %cmp.not.i17.6, label %cond.false.i21.6, label %cond.true.i18.6, !prof !15 cond.true.i18.6: ; preds = %putchar_unlocked.exit23.5 %call.i19.6 = tail call i32 @__overflow(ptr noundef nonnull %25, i32 noundef %cond.6) #4 br label %putchar_unlocked.exit23.6 cond.false.i21.6: ; preds = %putchar_unlocked.exit23.5 %conv4.i.6 = trunc i32 %cond.6 to i8 %incdec.ptr.i22.6 = getelementptr inbounds i8, ptr %26, i64 1 store ptr %incdec.ptr.i22.6, ptr %_IO_write_ptr.i15.6, align 8, !tbaa !19 store i8 %conv4.i.6, ptr %26, align 1, !tbaa !16 br label %putchar_unlocked.exit23.6 putchar_unlocked.exit23.6: ; preds = %cond.false.i21.6, %cond.true.i18.6 %arrayidx6.7 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 7 %28 = load i8, ptr %arrayidx6.7, align 1, !tbaa !16 %tobool.not.7 = icmp eq i8 %28, 0 %cond.7 = select i1 %tobool.not.7, i32 46, i32 81 %29 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.7 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 5 %30 = load ptr, ptr %_IO_write_ptr.i15.7, align 8, !tbaa !19 %_IO_write_end.i16.7 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 6 %31 = load ptr, ptr %_IO_write_end.i16.7, align 8, !tbaa !20 %cmp.not.i17.7 = icmp ult ptr %30, %31 br i1 %cmp.not.i17.7, label %cond.false.i21.7, label %cond.true.i18.7, !prof !15 cond.true.i18.7: ; preds = %putchar_unlocked.exit23.6 %call.i19.7 = tail call i32 @__overflow(ptr noundef nonnull %29, i32 noundef %cond.7) #4 br label %putchar_unlocked.exit23.7 cond.false.i21.7: ; preds = %putchar_unlocked.exit23.6 %conv4.i.7 = trunc i32 %cond.7 to i8 %incdec.ptr.i22.7 = getelementptr inbounds i8, ptr %30, i64 1 store ptr %incdec.ptr.i22.7, ptr %_IO_write_ptr.i15.7, align 8, !tbaa !19 store i8 %conv4.i.7, ptr %30, align 1, !tbaa !16 br label %putchar_unlocked.exit23.7 putchar_unlocked.exit23.7: ; preds = %cond.false.i21.7, %cond.true.i18.7 %32 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 5 %33 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !19 %_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 6 %34 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !20 %cmp.not.i = icmp ult ptr %33, %34 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 } ; Function Attrs: nounwind uwtable define dso_local void @queen_eight(ptr nocapture noundef %Q, ptr nocapture noundef %row, ptr nocapture noundef %col, ptr nocapture noundef %lrd, ptr nocapture noundef %lld, i32 noundef %cnt) local_unnamed_addr #0 { entry: %cmp98 = icmp eq i32 %cnt, 8 br i1 %cmp98, label %if.then, label %if.end.preheader if.end.preheader: ; preds = %entry %0 = sext i32 %cnt to i64 br label %if.end if.then: ; preds = %if.then1, %entry tail call void @print(ptr noundef %Q) br label %for.end if.end: ; preds = %if.end.preheader, %if.then1 %indvars.iv = phi i64 [ %0, %if.end.preheader ], [ %indvars.iv.next, %if.then1 ] %arrayidx = getelementptr inbounds i8, ptr %row, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !16 %tobool.not = icmp eq i8 %1, 0 br i1 %tobool.not, label %for.cond.preheader, label %if.then1 for.cond.preheader: ; preds = %if.end %arrayidx.le = getelementptr inbounds i8, ptr %row, i64 %indvars.iv %2 = trunc i64 %indvars.iv to i32 %sub = add i64 %indvars.iv, 7 %add35 = add nsw i32 %2, 1 %sext = shl i64 %indvars.iv, 32 %3 = ashr exact i64 %sext, 32 %invariant.gep = getelementptr i8, ptr %lld, i64 %3 br label %for.body if.then1: ; preds = %if.end %indvars.iv.next = add nsw i64 %indvars.iv, 1 %4 = and i64 %indvars.iv.next, 4294967295 %cmp = icmp eq i64 %4, 8 br i1 %cmp, label %if.then, label %if.end for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv104 = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next105, %for.inc ] %arrayidx5 = getelementptr inbounds i8, ptr %col, i64 %indvars.iv104 %5 = load i8, ptr %arrayidx5, align 1, !tbaa !16 %tobool6.not = icmp eq i8 %5, 0 br i1 %tobool6.not, label %lor.lhs.false, label %for.inc lor.lhs.false: ; preds = %for.body %add7 = sub i64 %sub, %indvars.iv104 %sext108 = shl i64 %add7, 32 %idxprom8 = ashr exact i64 %sext108, 32 %arrayidx9 = getelementptr inbounds i8, ptr %lrd, i64 %idxprom8 %6 = load i8, ptr %arrayidx9, align 1, !tbaa !16 %tobool11.not = icmp eq i8 %6, 0 br i1 %tobool11.not, label %lor.lhs.false12, label %for.inc lor.lhs.false12: ; preds = %lor.lhs.false %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv104 %7 = load i8, ptr %gep, align 1, !tbaa !16 %tobool17.not = icmp eq i8 %7, 0 br i1 %tobool17.not, label %if.end19, label %for.inc if.end19: ; preds = %lor.lhs.false12 store i8 1, ptr %gep, align 1, !tbaa !16 store i8 1, ptr %arrayidx9, align 1, !tbaa !16 store i8 1, ptr %arrayidx5, align 1, !tbaa !16 store i8 1, ptr %arrayidx.le, align 1, !tbaa !16 %arrayidx34 = getelementptr inbounds [8 x i8], ptr %Q, i64 %indvars.iv, i64 %indvars.iv104 store i8 1, ptr %arrayidx34, align 1, !tbaa !16 tail call void @queen_eight(ptr noundef %Q, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %lrd, ptr noundef nonnull %lld, i32 noundef %add35) store i8 0, ptr %gep, align 1, !tbaa !16 store i8 0, ptr %arrayidx9, align 1, !tbaa !16 store i8 0, ptr %arrayidx5, align 1, !tbaa !16 store i8 0, ptr %arrayidx.le, align 1, !tbaa !16 store i8 0, ptr %arrayidx34, align 1, !tbaa !16 br label %for.inc for.inc: ; preds = %for.body, %lor.lhs.false, %lor.lhs.false12, %if.end19 %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %exitcond.not = icmp eq i64 %indvars.iv.next105, 8 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !22 for.end: ; preds = %for.inc, %if.then ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %Q = alloca [8 x [8 x i8]], align 16 %row = alloca [8 x i8], align 8 %col = alloca [8 x i8], align 8 %lrd = alloca [15 x i8], align 1 %lld = alloca [15 x i8], align 1 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %Q) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %Q, i8 0, i64 64, i1 false) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %row) #4 store i64 0, ptr %row, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %col) #4 store i64 0, ptr %col, align 8 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %lrd) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %lrd, i8 0, i64 15, i1 false) call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %lld) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %lld, i8 0, i64 15, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %entry %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 br label %getchar_unlocked.exit.i cond.false.i.i: ; preds = %entry %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %getchar_unlocked.exit.i getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i %cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ] %4 = add i32 %cond.i.i, -58 %or.cond.i = icmp ult i32 %4, -10 br i1 %or.cond.i, label %get_uint.exit, label %while.body.preheader.i while.body.preheader.i: ; preds = %getchar_unlocked.exit.i %.pre24.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body.i while.body.i: ; preds = %getchar_unlocked.exit21.i, %while.body.preheader.i %5 = phi ptr [ %9, %getchar_unlocked.exit21.i ], [ %.pre24.i, %while.body.preheader.i ] %c.023.i = phi i32 [ %cond.i17.i, %getchar_unlocked.exit21.i ], [ %cond.i.i, %while.body.preheader.i ] %n.022.i = phi i32 [ %add.i, %getchar_unlocked.exit21.i ], [ 0, %while.body.preheader.i ] %mul.i = mul nsw i32 %n.022.i, 10 %and.i = and i32 %c.023.i, 15 %add.i = add nsw i32 %mul.i, %and.i %_IO_read_ptr.i12.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1 %6 = load ptr, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !9 %_IO_read_end.i13.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2 %7 = load ptr, ptr %_IO_read_end.i13.i, align 8, !tbaa !14 %cmp.not.i14.i = icmp ult ptr %6, %7 br i1 %cmp.not.i14.i, label %cond.false.i18.i, label %cond.true.i15.i, !prof !15 cond.true.i15.i: ; preds = %while.body.i %call.i16.i = tail call i32 @__uflow(ptr noundef nonnull %5) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i cond.false.i18.i: ; preds = %while.body.i %incdec.ptr.i19.i = getelementptr inbounds i8, ptr %6, i64 1 store ptr %incdec.ptr.i19.i, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !9 %8 = load i8, ptr %6, align 1, !tbaa !16 %conv3.i20.i = zext i8 %8 to i32 br label %getchar_unlocked.exit21.i getchar_unlocked.exit21.i: ; preds = %cond.false.i18.i, %cond.true.i15.i %9 = phi ptr [ %.pre.i, %cond.true.i15.i ], [ %5, %cond.false.i18.i ] %cond.i17.i = phi i32 [ %call.i16.i, %cond.true.i15.i ], [ %conv3.i20.i, %cond.false.i18.i ] %10 = add i32 %cond.i17.i, -48 %11 = icmp ult i32 %10, 10 br i1 %11, label %while.body.i, label %get_uint.exit, !llvm.loop !17 get_uint.exit: ; preds = %getchar_unlocked.exit21.i, %getchar_unlocked.exit.i %retval.0.i = phi i32 [ %cond.i.i, %getchar_unlocked.exit.i ], [ %add.i, %getchar_unlocked.exit21.i ] %cmp89 = icmp sgt i32 %retval.0.i, 0 br i1 %cmp89, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %get_uint.exit %.pre91 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %get_uint.exit88, %get_uint.exit call void @queen_eight(ptr noundef nonnull %Q, ptr noundef nonnull %row, ptr noundef nonnull %col, ptr noundef nonnull %lrd, ptr noundef nonnull %lld, i32 noundef 0) call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %lld) #4 call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %lrd) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %col) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %row) #4 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %Q) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %get_uint.exit88 %.pre9297 = phi ptr [ %.pre9298, %get_uint.exit88 ], [ %.pre91, %for.body.preheader ] %12 = phi ptr [ %36, %get_uint.exit88 ], [ %.pre91, %for.body.preheader ] %i.090 = phi i32 [ %inc, %get_uint.exit88 ], [ 0, %for.body.preheader ] %_IO_read_ptr.i.i25 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i.i25, align 8, !tbaa !9 %_IO_read_end.i.i26 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i.i26, align 8, !tbaa !14 %cmp.not.i.i27 = icmp ult ptr %13, %14 br i1 %cmp.not.i.i27, label %cond.false.i.i53, label %cond.true.i.i28, !prof !15 cond.true.i.i28: ; preds = %for.body %call.i.i29 = tail call i32 @__uflow(ptr noundef nonnull %12) #4 %.pre92.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i30 cond.false.i.i53: ; preds = %for.body %incdec.ptr.i.i54 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i.i54, ptr %_IO_read_ptr.i.i25, align 8, !tbaa !9 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i.i55 = zext i8 %15 to i32 br label %getchar_unlocked.exit.i30 getchar_unlocked.exit.i30: ; preds = %cond.false.i.i53, %cond.true.i.i28 %.pre92 = phi ptr [ %.pre92.pre, %cond.true.i.i28 ], [ %.pre9297, %cond.false.i.i53 ] %cond.i.i31 = phi i32 [ %call.i.i29, %cond.true.i.i28 ], [ %conv3.i.i55, %cond.false.i.i53 ] %16 = add i32 %cond.i.i31, -58 %or.cond.i32 = icmp ult i32 %16, -10 br i1 %or.cond.i32, label %get_uint.exit56, label %while.body.i35 while.body.i35: ; preds = %getchar_unlocked.exit.i30, %getchar_unlocked.exit21.i47 %.pre9294 = phi ptr [ %.pre9293, %getchar_unlocked.exit21.i47 ], [ %.pre92, %getchar_unlocked.exit.i30 ] %17 = phi ptr [ %21, %getchar_unlocked.exit21.i47 ], [ %.pre92, %getchar_unlocked.exit.i30 ] %c.023.i36 = phi i32 [ %cond.i17.i48, %getchar_unlocked.exit21.i47 ], [ %cond.i.i31, %getchar_unlocked.exit.i30 ] %n.022.i37 = phi i32 [ %add.i40, %getchar_unlocked.exit21.i47 ], [ 0, %getchar_unlocked.exit.i30 ] %mul.i38 = mul nsw i32 %n.022.i37, 10 %and.i39 = and i32 %c.023.i36, 15 %add.i40 = add nsw i32 %mul.i38, %and.i39 %_IO_read_ptr.i12.i41 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 1 %18 = load ptr, ptr %_IO_read_ptr.i12.i41, align 8, !tbaa !9 %_IO_read_end.i13.i42 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 2 %19 = load ptr, ptr %_IO_read_end.i13.i42, align 8, !tbaa !14 %cmp.not.i14.i43 = icmp ult ptr %18, %19 br i1 %cmp.not.i14.i43, label %cond.false.i18.i50, label %cond.true.i15.i44, !prof !15 cond.true.i15.i44: ; preds = %while.body.i35 %call.i16.i45 = tail call i32 @__uflow(ptr noundef nonnull %17) #4 %.pre.i46 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i47 cond.false.i18.i50: ; preds = %while.body.i35 %incdec.ptr.i19.i51 = getelementptr inbounds i8, ptr %18, i64 1 store ptr %incdec.ptr.i19.i51, ptr %_IO_read_ptr.i12.i41, align 8, !tbaa !9 %20 = load i8, ptr %18, align 1, !tbaa !16 %conv3.i20.i52 = zext i8 %20 to i32 br label %getchar_unlocked.exit21.i47 getchar_unlocked.exit21.i47: ; preds = %cond.false.i18.i50, %cond.true.i15.i44 %.pre9293 = phi ptr [ %.pre.i46, %cond.true.i15.i44 ], [ %.pre9294, %cond.false.i18.i50 ] %21 = phi ptr [ %.pre.i46, %cond.true.i15.i44 ], [ %17, %cond.false.i18.i50 ] %cond.i17.i48 = phi i32 [ %call.i16.i45, %cond.true.i15.i44 ], [ %conv3.i20.i52, %cond.false.i18.i50 ] %22 = add i32 %cond.i17.i48, -48 %23 = icmp ult i32 %22, 10 br i1 %23, label %while.body.i35, label %get_uint.exit56, !llvm.loop !17 get_uint.exit56: ; preds = %getchar_unlocked.exit21.i47, %getchar_unlocked.exit.i30 %.pre92100 = phi ptr [ %.pre92, %getchar_unlocked.exit.i30 ], [ %.pre9293, %getchar_unlocked.exit21.i47 ] %24 = phi ptr [ %.pre92, %getchar_unlocked.exit.i30 ], [ %21, %getchar_unlocked.exit21.i47 ] %retval.0.i49 = phi i32 [ %cond.i.i31, %getchar_unlocked.exit.i30 ], [ %add.i40, %getchar_unlocked.exit21.i47 ] %_IO_read_ptr.i.i57 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 1 %25 = load ptr, ptr %_IO_read_ptr.i.i57, align 8, !tbaa !9 %_IO_read_end.i.i58 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 2 %26 = load ptr, ptr %_IO_read_end.i.i58, align 8, !tbaa !14 %cmp.not.i.i59 = icmp ult ptr %25, %26 br i1 %cmp.not.i.i59, label %cond.false.i.i85, label %cond.true.i.i60, !prof !15 cond.true.i.i60: ; preds = %get_uint.exit56 %call.i.i61 = tail call i32 @__uflow(ptr noundef nonnull %24) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i62 cond.false.i.i85: ; preds = %get_uint.exit56 %incdec.ptr.i.i86 = getelementptr inbounds i8, ptr %25, i64 1 store ptr %incdec.ptr.i.i86, ptr %_IO_read_ptr.i.i57, align 8, !tbaa !9 %27 = load i8, ptr %25, align 1, !tbaa !16 %conv3.i.i87 = zext i8 %27 to i32 br label %getchar_unlocked.exit.i62 getchar_unlocked.exit.i62: ; preds = %cond.false.i.i85, %cond.true.i.i60 %.pre9299 = phi ptr [ %.pre, %cond.true.i.i60 ], [ %.pre92100, %cond.false.i.i85 ] %.pre24.i66 = phi ptr [ %.pre, %cond.true.i.i60 ], [ %24, %cond.false.i.i85 ] %cond.i.i63 = phi i32 [ %call.i.i61, %cond.true.i.i60 ], [ %conv3.i.i87, %cond.false.i.i85 ] %28 = add i32 %cond.i.i63, -58 %or.cond.i64 = icmp ult i32 %28, -10 br i1 %or.cond.i64, label %get_uint.exit88, label %while.body.i67 while.body.i67: ; preds = %getchar_unlocked.exit.i62, %getchar_unlocked.exit21.i79 %.pre9296 = phi ptr [ %.pre9295, %getchar_unlocked.exit21.i79 ], [ %.pre9299, %getchar_unlocked.exit.i62 ] %29 = phi ptr [ %33, %getchar_unlocked.exit21.i79 ], [ %.pre24.i66, %getchar_unlocked.exit.i62 ] %c.023.i68 = phi i32 [ %cond.i17.i80, %getchar_unlocked.exit21.i79 ], [ %cond.i.i63, %getchar_unlocked.exit.i62 ] %n.022.i69 = phi i32 [ %add.i72, %getchar_unlocked.exit21.i79 ], [ 0, %getchar_unlocked.exit.i62 ] %mul.i70 = mul nsw i32 %n.022.i69, 10 %and.i71 = and i32 %c.023.i68, 15 %add.i72 = add nsw i32 %mul.i70, %and.i71 %_IO_read_ptr.i12.i73 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 1 %30 = load ptr, ptr %_IO_read_ptr.i12.i73, align 8, !tbaa !9 %_IO_read_end.i13.i74 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 2 %31 = load ptr, ptr %_IO_read_end.i13.i74, align 8, !tbaa !14 %cmp.not.i14.i75 = icmp ult ptr %30, %31 br i1 %cmp.not.i14.i75, label %cond.false.i18.i82, label %cond.true.i15.i76, !prof !15 cond.true.i15.i76: ; preds = %while.body.i67 %call.i16.i77 = tail call i32 @__uflow(ptr noundef nonnull %29) #4 %.pre.i78 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i79 cond.false.i18.i82: ; preds = %while.body.i67 %incdec.ptr.i19.i83 = getelementptr inbounds i8, ptr %30, i64 1 store ptr %incdec.ptr.i19.i83, ptr %_IO_read_ptr.i12.i73, align 8, !tbaa !9 %32 = load i8, ptr %30, align 1, !tbaa !16 %conv3.i20.i84 = zext i8 %32 to i32 br label %getchar_unlocked.exit21.i79 getchar_unlocked.exit21.i79: ; preds = %cond.false.i18.i82, %cond.true.i15.i76 %.pre9295 = phi ptr [ %.pre.i78, %cond.true.i15.i76 ], [ %.pre9296, %cond.false.i18.i82 ] %33 = phi ptr [ %.pre.i78, %cond.true.i15.i76 ], [ %29, %cond.false.i18.i82 ] %cond.i17.i80 = phi i32 [ %call.i16.i77, %cond.true.i15.i76 ], [ %conv3.i20.i84, %cond.false.i18.i82 ] %34 = add i32 %cond.i17.i80, -48 %35 = icmp ult i32 %34, 10 br i1 %35, label %while.body.i67, label %get_uint.exit88, !llvm.loop !17 get_uint.exit88: ; preds = %getchar_unlocked.exit21.i79, %getchar_unlocked.exit.i62 %.pre9298 = phi ptr [ %.pre9299, %getchar_unlocked.exit.i62 ], [ %.pre9295, %getchar_unlocked.exit21.i79 ] %36 = phi ptr [ %.pre24.i66, %getchar_unlocked.exit.i62 ], [ %33, %getchar_unlocked.exit21.i79 ] %retval.0.i81 = phi i32 [ %cond.i.i63, %getchar_unlocked.exit.i62 ], [ %add.i72, %getchar_unlocked.exit21.i79 ] %add = add nsw i32 %retval.0.i81, %retval.0.i49 %idxprom = sext i32 %add to i64 %arrayidx = getelementptr inbounds [15 x i8], ptr %lld, i64 0, i64 %idxprom store i8 1, ptr %arrayidx, align 1, !tbaa !16 %sub = add i32 %retval.0.i49, 7 %add3 = sub i32 %sub, %retval.0.i81 %idxprom4 = sext i32 %add3 to i64 %arrayidx5 = getelementptr inbounds [15 x i8], ptr %lrd, i64 0, i64 %idxprom4 store i8 1, ptr %arrayidx5, align 1, !tbaa !16 %idxprom6 = sext i32 %retval.0.i81 to i64 %arrayidx7 = getelementptr inbounds [8 x i8], ptr %col, i64 0, i64 %idxprom6 store i8 1, ptr %arrayidx7, align 1, !tbaa !16 %idxprom8 = sext i32 %retval.0.i49 to i64 %arrayidx9 = getelementptr inbounds [8 x i8], ptr %row, i64 0, i64 %idxprom8 store i8 1, ptr %arrayidx9, align 1, !tbaa !16 %arrayidx13 = getelementptr inbounds [8 x [8 x i8]], ptr %Q, i64 0, i64 %idxprom8, i64 %idxprom6 store i8 1, ptr %arrayidx13, align 1, !tbaa !16 %inc = add nuw nsw i32 %i.090, 1 %exitcond.not = icmp eq i32 %inc, %retval.0.i br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !23 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 declare i32 @__uflow(ptr noundef) local_unnamed_addr #3 declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!10, !6, i64 40} !20 = !{!10, !6, i64 48} !21 = distinct !{!21, !18} !22 = distinct !{!22, !18} !23 = distinct !{!23, !18}
#include <stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 #define TRUE 2 int row[N],col[N],dpos[N*2-1],dneg[N*2-1]; int X[N][N]; void putQueen(int); void printBoard(void); void putQueen(int i){ int j; if(i==N){ printBoard(); return; } for(j=0;j<N;j++){ if(col[j]==NOT_FREE || dpos[i+j]==NOT_FREE || dneg[i-j+N-1]==NOT_FREE) continue; row[i]=j; col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE; putQueen(i+1); col[j]=dpos[i+j]=dneg[i-j+N-1]=FREE; } } void printBoard(){ int i,j; for(i = 0;i<N;i++) { for(j = 0;j<N;j++) { if(X[i][j]==TRUE) { if(row[i] != j) return; } } } for(i=0;i<N;i++){ for(j=0;j<N;j++){ if(row[i]==j)printf("Q"); else printf("."); } printf("\n"); } return; } int main(){ int i,n,a,b; for(i=0;i<N;i++){ row[i]=col[i]=FREE; } for(i=0;i<N*2-1;i++){ dpos[i]=dneg[i]=FREE; } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a,&b); X[a][b]=TRUE; } putQueen(0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232664/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232664/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @X = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @putQueen(i32 noundef %i) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = add i32 %i, 7 %idxprom14 = sext i32 %i to i64 %arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14 %add26 = add nsw i32 %i, 1 %0 = load i32, ptr @col, align 16, !tbaa !5 %cmp2 = icmp eq i32 %0, 1 br i1 %cmp2, label %for.inc, label %lor.lhs.false if.then: ; preds = %entry tail call void @printBoard() br label %common.ret lor.lhs.false: ; preds = %for.cond.preheader %arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14 %1 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %1, 1 br i1 %cmp5, label %for.inc, label %lor.lhs.false6 lor.lhs.false6: ; preds = %lor.lhs.false %idxprom9 = sext i32 %sub to i64 %arrayidx10 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %2, 1 br i1 %cmp11, label %for.inc, label %if.end13 if.end13: ; preds = %lor.lhs.false6 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 store i32 1, ptr %arrayidx4, align 4, !tbaa !5 store i32 1, ptr @col, align 16, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4, align 4, !tbaa !5 store i32 -1, ptr @col, align 16, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13 %3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 %cmp2.1 = icmp eq i32 %3, 1 br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %for.inc %4 = add nsw i64 %idxprom14, 1 %arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4 %5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %cmp5.1 = icmp eq i32 %5, 1 br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1 lor.lhs.false6.1: ; preds = %lor.lhs.false.1 %sub8.1 = add i32 %i, 6 %idxprom9.1 = sext i32 %sub8.1 to i64 %arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.1 %6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %cmp11.1 = icmp eq i32 %6, 1 br i1 %cmp11.1, label %for.inc.1, label %if.end13.1 if.end13.1: ; preds = %lor.lhs.false6.1 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc %7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 %cmp2.2 = icmp eq i32 %7, 1 br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %for.inc.1 %8 = add nsw i64 %idxprom14, 2 %arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8 %9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %cmp5.2 = icmp eq i32 %9, 1 br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2 lor.lhs.false6.2: ; preds = %lor.lhs.false.2 %sub8.2 = add i32 %i, 5 %idxprom9.2 = sext i32 %sub8.2 to i64 %arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.2 %10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %cmp11.2 = icmp eq i32 %10, 1 br i1 %cmp11.2, label %for.inc.2, label %if.end13.2 if.end13.2: ; preds = %lor.lhs.false6.2 store i32 2, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1 %11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 %cmp2.3 = icmp eq i32 %11, 1 br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %for.inc.2 %12 = add nsw i64 %idxprom14, 3 %arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12 %13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5 %cmp5.3 = icmp eq i32 %13, 1 br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3 lor.lhs.false6.3: ; preds = %lor.lhs.false.3 %sub8.3 = add i32 %i, 4 %idxprom9.3 = sext i32 %sub8.3 to i64 %arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.3 %14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %cmp11.3 = icmp eq i32 %14, 1 br i1 %cmp11.3, label %for.inc.3, label %if.end13.3 if.end13.3: ; preds = %lor.lhs.false6.3 store i32 3, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2 %15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 %cmp2.4 = icmp eq i32 %15, 1 br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %for.inc.3 %16 = add nsw i64 %idxprom14, 4 %arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16 %17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5 %cmp5.4 = icmp eq i32 %17, 1 br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4 lor.lhs.false6.4: ; preds = %lor.lhs.false.4 %sub8.4 = add i32 %i, 3 %idxprom9.4 = sext i32 %sub8.4 to i64 %arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.4 %18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5 %cmp11.4 = icmp eq i32 %18, 1 br i1 %cmp11.4, label %for.inc.4, label %if.end13.4 if.end13.4: ; preds = %lor.lhs.false6.4 store i32 4, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3 %19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 %cmp2.5 = icmp eq i32 %19, 1 br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %for.inc.4 %20 = add nsw i64 %idxprom14, 5 %arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20 %21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5 %cmp5.5 = icmp eq i32 %21, 1 br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5 lor.lhs.false6.5: ; preds = %lor.lhs.false.5 %sub8.5 = add i32 %i, 2 %idxprom9.5 = sext i32 %sub8.5 to i64 %arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.5 %22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5 %cmp11.5 = icmp eq i32 %22, 1 br i1 %cmp11.5, label %for.inc.5, label %if.end13.5 if.end13.5: ; preds = %lor.lhs.false6.5 store i32 5, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4 %23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 %cmp2.6 = icmp eq i32 %23, 1 br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %for.inc.5 %24 = add nsw i64 %idxprom14, 6 %arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24 %25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5 %cmp5.6 = icmp eq i32 %25, 1 br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6 lor.lhs.false6.6: ; preds = %lor.lhs.false.6 %sub8.6 = add i32 %i, 1 %idxprom9.6 = sext i32 %sub8.6 to i64 %arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.6 %26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5 %cmp11.6 = icmp eq i32 %26, 1 br i1 %cmp11.6, label %for.inc.6, label %if.end13.6 if.end13.6: ; preds = %lor.lhs.false6.6 store i32 6, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5 %27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 %cmp2.7 = icmp eq i32 %27, 1 br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %for.inc.6 %28 = add nsw i64 %idxprom14, 7 %arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28 %29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5 %cmp5.7 = icmp eq i32 %29, 1 br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7 lor.lhs.false6.7: ; preds = %lor.lhs.false.7 %arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom14 %30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5 %cmp11.7 = icmp eq i32 %30, 1 br i1 %cmp11.7, label %common.ret, label %if.end13.7 common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7 ret void if.end13.7: ; preds = %lor.lhs.false6.7 store i32 7, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 tail call void @putQueen(i32 noundef %add26) store i32 -1, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 br label %common.ret } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @printBoard() local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx8 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv %arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 0 %0 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %cmp6 = icmp eq i32 %0, 2 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not = icmp eq i32 %1, 0 br i1 %cmp9.not, label %for.inc, label %cleanup for.inc: ; preds = %for.cond1.preheader, %if.then %arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %cmp6.1 = icmp eq i32 %2, 2 br i1 %cmp6.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.1 = icmp eq i32 %3, 1 br i1 %cmp9.not.1, label %for.inc.1, label %cleanup for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 2 %4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %cmp6.2 = icmp eq i32 %4, 2 br i1 %cmp6.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.2 = icmp eq i32 %5, 2 br i1 %cmp9.not.2, label %for.inc.2, label %cleanup for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 3 %6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %cmp6.3 = icmp eq i32 %6, 2 br i1 %cmp6.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.3 = icmp eq i32 %7, 3 br i1 %cmp9.not.3, label %for.inc.3, label %cleanup for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %cmp6.4 = icmp eq i32 %8, 2 br i1 %cmp6.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.4 = icmp eq i32 %9, 4 br i1 %cmp9.not.4, label %for.inc.4, label %cleanup for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 5 %10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %cmp6.5 = icmp eq i32 %10, 2 br i1 %cmp6.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.5 = icmp eq i32 %11, 5 br i1 %cmp9.not.5, label %for.inc.5, label %cleanup for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 6 %12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5 %cmp6.6 = icmp eq i32 %12, 2 br i1 %cmp6.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.6 = icmp eq i32 %13, 6 br i1 %cmp9.not.6, label %for.inc.6, label %cleanup for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 7 %14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %cmp6.7 = icmp eq i32 %14, 2 br i1 %cmp6.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.7 = icmp eq i32 %15, 7 br i1 %cmp9.not.7, label %for.inc.7, label %cleanup for.inc.7: ; preds = %if.then.7, %for.inc.6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !9 for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ] %arrayidx22 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv58 %16 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp eq i32 %16, 0 %. = select i1 %cmp23, i32 81, i32 46 %putchar48 = tail call i32 @putchar(i32 %.) %17 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.1 = icmp eq i32 %17, 1 %.sink63 = select i1 %cmp23.1, i32 81, i32 46 %putchar48.1 = tail call i32 @putchar(i32 %.sink63) %18 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.2 = icmp eq i32 %18, 2 %.sink64 = select i1 %cmp23.2, i32 81, i32 46 %putchar48.2 = tail call i32 @putchar(i32 %.sink64) %19 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.3 = icmp eq i32 %19, 3 %.sink65 = select i1 %cmp23.3, i32 81, i32 46 %putchar48.3 = tail call i32 @putchar(i32 %.sink65) %20 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.4 = icmp eq i32 %20, 4 %.sink66 = select i1 %cmp23.4, i32 81, i32 46 %putchar48.4 = tail call i32 @putchar(i32 %.sink66) %21 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.5 = icmp eq i32 %21, 5 %.sink67 = select i1 %cmp23.5, i32 81, i32 46 %putchar48.5 = tail call i32 @putchar(i32 %.sink67) %22 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.6 = icmp eq i32 %22, 6 %.sink68 = select i1 %cmp23.6, i32 81, i32 46 %putchar48.6 = tail call i32 @putchar(i32 %.sink68) %23 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.7 = icmp eq i32 %23, 7 %.sink69 = select i1 %cmp23.7, i32 81, i32 46 %putchar48.7 = tail call i32 @putchar(i32 %.sink69) %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next59, 8 br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !11 cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader 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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = 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 %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1435 = icmp sgt i32 %0, 0 br i1 %cmp1435, label %for.body15, label %for.end23 for.body15: ; preds = %entry, %for.body15 %i.236 = phi i32 [ %inc22, %for.body15 ], [ 0, %entry ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !5 %idxprom17 = sext i32 %1 to i64 %2 = load i32, ptr %b, align 4, !tbaa !5 %idxprom19 = sext i32 %2 to i64 %arrayidx20 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 2, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %i.236, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %3 br i1 %cmp14, label %for.body15, label %for.end23, !llvm.loop !12 for.end23: ; preds = %for.body15, %entry call void @putQueen(i32 noundef 0) 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 %n) #5 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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #define N 8 void print(void); void backtrack(int); int a[N][N] = {{}}; int row[N] = {}; int l[15] = {}; int r[15] = {}; int s[N] = {}; void backtrack(int i){ int j; if(i == N){ print(); return; } for(j = 0;j < N;j++){ if(s[j] == 1 || l[i + j] == 1 || r[i - j + N - 1] == 1) continue; row[i] = j; l[i + j] = r[i - j + N - 1] = s[j] = 1; backtrack(i + 1); row[i] = s[j] = l[i + j] = r[i - j + N - 1] = 0; } } int main(){ int i,j,r,c,k; scanf("%d",&k); for(i = 0;i < k;i++){ scanf("%d%d",&r,&c); a[r][c] = 1; } backtrack(0); return 0; } void print(){ int i,j; for(i = 0;i < N;i++){ for(j = 0;j < N;j++){ if(a[i][j] == 1){ if(row[i] != j) { return; } } } } for(i = 0;i < N;i++){ for(j = 0;j < N;j++){ if(row[i] == j) printf("Q"); else printf("."); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232714/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232714/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @a = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @l = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @r = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @s = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @backtrack(i32 noundef %i) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = add i32 %i, 7 %idxprom14 = sext i32 %i to i64 %arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14 %add26 = add nsw i32 %i, 1 %0 = load i32, ptr @s, align 16, !tbaa !5 %cmp2 = icmp eq i32 %0, 1 br i1 %cmp2, label %for.inc, label %lor.lhs.false if.then: ; preds = %entry tail call void @print() br label %common.ret lor.lhs.false: ; preds = %for.cond.preheader %arrayidx4 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %idxprom14 %1 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %1, 1 br i1 %cmp5, label %for.inc, label %lor.lhs.false6 lor.lhs.false6: ; preds = %lor.lhs.false %idxprom9 = sext i32 %sub to i64 %arrayidx10 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %2, 1 br i1 %cmp11, label %for.inc, label %if.end13 if.end13: ; preds = %lor.lhs.false6 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr @s, align 16, !tbaa !5 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 store i32 1, ptr %arrayidx4, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10, align 4, !tbaa !5 store i32 0, ptr %arrayidx4, align 4, !tbaa !5 store i32 0, ptr @s, align 16, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13 %3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 1), align 4, !tbaa !5 %cmp2.1 = icmp eq i32 %3, 1 br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %for.inc %4 = add nsw i64 %idxprom14, 1 %arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %4 %5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %cmp5.1 = icmp eq i32 %5, 1 br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1 lor.lhs.false6.1: ; preds = %lor.lhs.false.1 %sub8.1 = add i32 %i, 6 %idxprom9.1 = sext i32 %sub8.1 to i64 %arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.1 %6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %cmp11.1 = icmp eq i32 %6, 1 br i1 %cmp11.1, label %for.inc.1, label %if.end13.1 if.end13.1: ; preds = %lor.lhs.false6.1 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 1), align 4, !tbaa !5 store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 1), align 4, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc %7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 2), align 8, !tbaa !5 %cmp2.2 = icmp eq i32 %7, 1 br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %for.inc.1 %8 = add nsw i64 %idxprom14, 2 %arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %8 %9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %cmp5.2 = icmp eq i32 %9, 1 br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2 lor.lhs.false6.2: ; preds = %lor.lhs.false.2 %sub8.2 = add i32 %i, 5 %idxprom9.2 = sext i32 %sub8.2 to i64 %arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.2 %10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %cmp11.2 = icmp eq i32 %10, 1 br i1 %cmp11.2, label %for.inc.2, label %if.end13.2 if.end13.2: ; preds = %lor.lhs.false6.2 store i32 2, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 2), align 8, !tbaa !5 store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 2), align 8, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1 %11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 3), align 4, !tbaa !5 %cmp2.3 = icmp eq i32 %11, 1 br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %for.inc.2 %12 = add nsw i64 %idxprom14, 3 %arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %12 %13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5 %cmp5.3 = icmp eq i32 %13, 1 br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3 lor.lhs.false6.3: ; preds = %lor.lhs.false.3 %sub8.3 = add i32 %i, 4 %idxprom9.3 = sext i32 %sub8.3 to i64 %arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.3 %14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %cmp11.3 = icmp eq i32 %14, 1 br i1 %cmp11.3, label %for.inc.3, label %if.end13.3 if.end13.3: ; preds = %lor.lhs.false6.3 store i32 3, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 3), align 4, !tbaa !5 store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 3), align 4, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2 %15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 4), align 16, !tbaa !5 %cmp2.4 = icmp eq i32 %15, 1 br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %for.inc.3 %16 = add nsw i64 %idxprom14, 4 %arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %16 %17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5 %cmp5.4 = icmp eq i32 %17, 1 br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4 lor.lhs.false6.4: ; preds = %lor.lhs.false.4 %sub8.4 = add i32 %i, 3 %idxprom9.4 = sext i32 %sub8.4 to i64 %arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.4 %18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5 %cmp11.4 = icmp eq i32 %18, 1 br i1 %cmp11.4, label %for.inc.4, label %if.end13.4 if.end13.4: ; preds = %lor.lhs.false6.4 store i32 4, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 4), align 16, !tbaa !5 store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 4), align 16, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3 %19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 5), align 4, !tbaa !5 %cmp2.5 = icmp eq i32 %19, 1 br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %for.inc.4 %20 = add nsw i64 %idxprom14, 5 %arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %20 %21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5 %cmp5.5 = icmp eq i32 %21, 1 br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5 lor.lhs.false6.5: ; preds = %lor.lhs.false.5 %sub8.5 = add i32 %i, 2 %idxprom9.5 = sext i32 %sub8.5 to i64 %arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.5 %22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5 %cmp11.5 = icmp eq i32 %22, 1 br i1 %cmp11.5, label %for.inc.5, label %if.end13.5 if.end13.5: ; preds = %lor.lhs.false6.5 store i32 5, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 5), align 4, !tbaa !5 store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 5), align 4, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4 %23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 6), align 8, !tbaa !5 %cmp2.6 = icmp eq i32 %23, 1 br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %for.inc.5 %24 = add nsw i64 %idxprom14, 6 %arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %24 %25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5 %cmp5.6 = icmp eq i32 %25, 1 br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6 lor.lhs.false6.6: ; preds = %lor.lhs.false.6 %sub8.6 = add i32 %i, 1 %idxprom9.6 = sext i32 %sub8.6 to i64 %arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom9.6 %26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5 %cmp11.6 = icmp eq i32 %26, 1 br i1 %cmp11.6, label %for.inc.6, label %if.end13.6 if.end13.6: ; preds = %lor.lhs.false6.6 store i32 6, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 6), align 8, !tbaa !5 store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 6), align 8, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5 %27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 7), align 4, !tbaa !5 %cmp2.7 = icmp eq i32 %27, 1 br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %for.inc.6 %28 = add nsw i64 %idxprom14, 7 %arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @l, i64 0, i64 %28 %29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5 %cmp5.7 = icmp eq i32 %29, 1 br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7 lor.lhs.false6.7: ; preds = %lor.lhs.false.7 %arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @r, i64 0, i64 %idxprom14 %30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5 %cmp11.7 = icmp eq i32 %30, 1 br i1 %cmp11.7, label %common.ret, label %if.end13.7 common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7 ret void if.end13.7: ; preds = %lor.lhs.false6.7 store i32 7, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 7), align 4, !tbaa !5 store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5 tail call void @backtrack(i32 noundef %add26) store i32 0, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @s, i64 0, i64 7), align 4, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 br label %common.ret } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print() local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx8 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv %arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 0 %0 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %cmp6 = icmp eq i32 %0, 1 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not = icmp eq i32 %1, 0 br i1 %cmp9.not, label %for.inc, label %cleanup for.inc: ; preds = %for.cond1.preheader, %if.then %arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %cmp6.1 = icmp eq i32 %2, 1 br i1 %cmp6.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.1 = icmp eq i32 %3, 1 br i1 %cmp9.not.1, label %for.inc.1, label %cleanup for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 2 %4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %cmp6.2 = icmp eq i32 %4, 1 br i1 %cmp6.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.2 = icmp eq i32 %5, 2 br i1 %cmp9.not.2, label %for.inc.2, label %cleanup for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 3 %6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %cmp6.3 = icmp eq i32 %6, 1 br i1 %cmp6.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.3 = icmp eq i32 %7, 3 br i1 %cmp9.not.3, label %for.inc.3, label %cleanup for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %cmp6.4 = icmp eq i32 %8, 1 br i1 %cmp6.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.4 = icmp eq i32 %9, 4 br i1 %cmp9.not.4, label %for.inc.4, label %cleanup for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 5 %10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %cmp6.5 = icmp eq i32 %10, 1 br i1 %cmp6.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.5 = icmp eq i32 %11, 5 br i1 %cmp9.not.5, label %for.inc.5, label %cleanup for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 6 %12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5 %cmp6.6 = icmp eq i32 %12, 1 br i1 %cmp6.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.6 = icmp eq i32 %13, 6 br i1 %cmp9.not.6, label %for.inc.6, label %cleanup for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 7 %14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %cmp6.7 = icmp eq i32 %14, 1 br i1 %cmp6.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.7 = icmp eq i32 %15, 7 br i1 %cmp9.not.7, label %for.inc.7, label %cleanup for.inc.7: ; preds = %if.then.7, %for.inc.6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !9 for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ] %arrayidx22 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv58 %16 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp eq i32 %16, 0 %. = select i1 %cmp23, i32 81, i32 46 %putchar48 = tail call i32 @putchar(i32 %.) %17 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.1 = icmp eq i32 %17, 1 %.sink63 = select i1 %cmp23.1, i32 81, i32 46 %putchar48.1 = tail call i32 @putchar(i32 %.sink63) %18 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.2 = icmp eq i32 %18, 2 %.sink64 = select i1 %cmp23.2, i32 81, i32 46 %putchar48.2 = tail call i32 @putchar(i32 %.sink64) %19 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.3 = icmp eq i32 %19, 3 %.sink65 = select i1 %cmp23.3, i32 81, i32 46 %putchar48.3 = tail call i32 @putchar(i32 %.sink65) %20 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.4 = icmp eq i32 %20, 4 %.sink66 = select i1 %cmp23.4, i32 81, i32 46 %putchar48.4 = tail call i32 @putchar(i32 %.sink66) %21 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.5 = icmp eq i32 %21, 5 %.sink67 = select i1 %cmp23.5, i32 81, i32 46 %putchar48.5 = tail call i32 @putchar(i32 %.sink67) %22 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.6 = icmp eq i32 %22, 6 %.sink68 = select i1 %cmp23.6, i32 81, i32 46 %putchar48.6 = tail call i32 @putchar(i32 %.sink68) %23 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.7 = icmp eq i32 %23, 7 %.sink69 = select i1 %cmp23.7, i32 81, i32 46 %putchar48.7 = tail call i32 @putchar(i32 %.sink69) %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next59, 8 br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !11 cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader 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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca i32, align 4 %c = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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 %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %0, 0 br i1 %cmp5, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c) %1 = load i32, ptr %r, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %2 = load i32, ptr %c, align 4, !tbaa !5 %idxprom2 = sext i32 %2 to i64 %arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom2 store i32 1, ptr %arrayidx3, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.06, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body, %entry call void @backtrack(i32 noundef 0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = distinct !{!12, !10}
#include<stdio.h> int a[8][8], row[8], col[8], d1[17], d2[17]; int f(int i, int j, int s){ int i1 = i + (j==7), j1 = (j + 1) % 8; if(s == 0) return 1; if(i > 7) return 0; if(a[i][j] == 1){ if(f(i1, j1, s-1)) return 1; return 0; } if(row[i] == 0 && col[j] == 0 && d1[i + j] == 0 && d2[j - i + 7] == 0){ a[i][j] = 1; row[i] = col[j] = d1[i + j] = d2[j - i + 7] = 1; if(f(i1, j1, s-1)) return 1; row[i] = col[j] = d1[i + j] = d2[j - i + 7] = 0; a[i][j] = 0; } if(f(i1, j1, s)) return 1; return 0; } int main(){ int k, i, j, x, y; scanf("%d", &k); for(i = 1; i <= k; i++){ scanf("%d %d", &x, &y); a[x][y] = 1; row[x] = col[y] = d1[x+y] = d2[y - x + 7] = 1; } f(0, 0, 8); for(i = 0; i < 8; i++){ for(j = 0; j < 8; j++){ if(a[i][j]) printf("Q"); else printf("."); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232765/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232765/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @a = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @d1 = dso_local local_unnamed_addr global [17 x i32] zeroinitializer, align 16 @d2 = dso_local local_unnamed_addr global [17 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @f(i32 noundef %i, i32 noundef %j, i32 noundef %s) local_unnamed_addr #0 { entry: %cmp2127 = icmp eq i32 %s, 0 br i1 %cmp2127, label %cleanup, label %if.end.lr.ph.preheader if.end.lr.ph.preheader: ; preds = %entry %cmp115128 = icmp eq i32 %j, 7 %conv116129 = zext i1 %cmp115128 to i32 %add117130 = add nsw i32 %conv116129, %i br label %if.end.lr.ph if.end.lr.ph: ; preds = %if.end.lr.ph.preheader, %if.then12 %add117137 = phi i32 [ %add117, %if.then12 ], [ %add117130, %if.end.lr.ph.preheader ] %s.tr.ph135 = phi i32 [ %sub53, %if.then12 ], [ %s, %if.end.lr.ph.preheader ] %j.tr.ph134 = phi i32 [ %rem123155, %if.then12 ], [ %j, %if.end.lr.ph.preheader ] %i.tr.ph133 = phi i32 [ %add122152, %if.then12 ], [ %i, %if.end.lr.ph.preheader ] %sub53 = add nsw i32 %s.tr.ph135, -1 %cmp4151 = icmp sgt i32 %i.tr.ph133, 7 br i1 %cmp4151, label %cleanup, label %if.end7 if.end7: ; preds = %if.end.lr.ph, %if.end73 %i.tr120154 = phi i32 [ %add122152, %if.end73 ], [ %i.tr.ph133, %if.end.lr.ph ] %j.tr121153 = phi i32 [ %rem123155, %if.end73 ], [ %j.tr.ph134, %if.end.lr.ph ] %add122152 = phi i32 [ %add, %if.end73 ], [ %add117137, %if.end.lr.ph ] %rem123155.in = add nsw i32 %j.tr121153, 1 %rem123155 = srem i32 %rem123155.in, 8 %idxprom = sext i32 %i.tr120154 to i64 %idxprom8 = sext i32 %j.tr121153 to i64 %arrayidx9 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom8 %0 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %0, 1 br i1 %cmp10, label %if.then12, label %if.end15 if.then12: ; preds = %if.end7 %cmp2 = icmp eq i32 %sub53, 0 %cmp115 = icmp eq i32 %rem123155, 7 %conv116 = zext i1 %cmp115 to i32 %add117 = add nsw i32 %add122152, %conv116 br i1 %cmp2, label %cleanup, label %if.end.lr.ph if.end15: ; preds = %if.end7 %arrayidx17 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18 = icmp eq i32 %1, 0 br i1 %cmp18, label %land.lhs.true, label %if.end73 land.lhs.true: ; preds = %if.end15 %arrayidx21 = getelementptr inbounds [8 x i32], ptr @col, i64 0, i64 %idxprom8 %2 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %2, 0 br i1 %cmp22, label %land.lhs.true24, label %if.end73 land.lhs.true24: ; preds = %land.lhs.true %add25 = add nsw i32 %j.tr121153, %i.tr120154 %idxprom26 = sext i32 %add25 to i64 %arrayidx27 = getelementptr inbounds [17 x i32], ptr @d1, i64 0, i64 %idxprom26 %3 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp eq i32 %3, 0 br i1 %cmp28, label %land.lhs.true30, label %if.end73 land.lhs.true30: ; preds = %land.lhs.true24 %reass.sub = sub i32 %j.tr121153, %i.tr120154 %add32 = add i32 %reass.sub, 7 %idxprom33 = sext i32 %add32 to i64 %arrayidx34 = getelementptr inbounds [17 x i32], ptr @d2, i64 0, i64 %idxprom33 %4 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %cmp35 = icmp eq i32 %4, 0 br i1 %cmp35, label %if.then37, label %if.end73 if.then37: ; preds = %land.lhs.true30 store i32 1, ptr %arrayidx9, align 4, !tbaa !5 store i32 1, ptr %arrayidx34, align 4, !tbaa !5 store i32 1, ptr %arrayidx27, align 4, !tbaa !5 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 store i32 1, ptr %arrayidx17, align 4, !tbaa !5 %call54 = tail call i32 @f(i32 noundef %add122152, i32 noundef %rem123155, i32 noundef %sub53), !range !9 %tobool55.not = icmp eq i32 %call54, 0 br i1 %tobool55.not, label %if.end57, label %cleanup if.end57: ; preds = %if.then37 store i32 0, ptr %arrayidx34, align 4, !tbaa !5 store i32 0, ptr %arrayidx27, align 4, !tbaa !5 store i32 0, ptr %arrayidx21, align 4, !tbaa !5 store i32 0, ptr %arrayidx17, align 4, !tbaa !5 store i32 0, ptr %arrayidx9, align 4, !tbaa !5 br label %if.end73 if.end73: ; preds = %if.end57, %land.lhs.true30, %land.lhs.true24, %land.lhs.true, %if.end15 %cmp = icmp eq i32 %rem123155, 7 %conv = zext i1 %cmp to i32 %add = add nsw i32 %add122152, %conv %cmp4 = icmp sgt i32 %add122152, 7 br i1 %cmp4, label %cleanup, label %if.end7 cleanup: ; preds = %if.then12, %if.end.lr.ph, %if.then37, %if.end73, %entry %retval.0 = phi i32 [ 1, %entry ], [ 0, %if.end73 ], [ 1, %if.then37 ], [ 1, %if.then12 ], [ 0, %if.end.lr.ph ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %k = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not41 = icmp slt i32 %0, 1 br i1 %cmp.not41, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %i.042 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i32, ptr %x, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %2 = load i32, ptr %y, align 4, !tbaa !5 %idxprom2 = sext i32 %2 to i64 %arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom2 store i32 1, ptr %arrayidx3, align 4, !tbaa !5 %reass.sub = sub i32 %2, %1 %add = add i32 %reass.sub, 7 %idxprom4 = sext i32 %add to i64 %arrayidx5 = getelementptr inbounds [17 x i32], ptr @d2, i64 0, i64 %idxprom4 store i32 1, ptr %arrayidx5, align 4, !tbaa !5 %add6 = add nsw i32 %2, %1 %idxprom7 = sext i32 %add6 to i64 %arrayidx8 = getelementptr inbounds [17 x i32], ptr @d1, i64 0, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [8 x i32], ptr @col, i64 0, i64 %idxprom2 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom store i32 1, ptr %arrayidx12, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.042, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.042, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %entry %call13 = call i32 @f(i32 noundef 0, i32 noundef 0, i32 noundef 8), !range !9 br label %for.cond17.preheader for.cond17.preheader: ; preds = %for.end, %for.cond17.preheader %indvars.iv = phi i64 [ 0, %for.end ], [ %indvars.iv.next, %for.cond17.preheader ] %arrayidx23 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 0 %4 = load i32, ptr %arrayidx23, align 16, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 %. = select i1 %tobool.not, i32 46, i32 81 %putchar40 = call i32 @putchar(i32 %.) %arrayidx23.1 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 1 %5 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %5, 0 %.sink47 = select i1 %tobool.not.1, i32 46, i32 81 %putchar39.1 = call i32 @putchar(i32 %.sink47) %arrayidx23.2 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 2 %6 = load i32, ptr %arrayidx23.2, align 8, !tbaa !5 %tobool.not.2 = icmp eq i32 %6, 0 %.sink48 = select i1 %tobool.not.2, i32 46, i32 81 %putchar39.2 = call i32 @putchar(i32 %.sink48) %arrayidx23.3 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 3 %7 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 %tobool.not.3 = icmp eq i32 %7, 0 %.sink49 = select i1 %tobool.not.3, i32 46, i32 81 %putchar39.3 = call i32 @putchar(i32 %.sink49) %arrayidx23.4 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx23.4, align 16, !tbaa !5 %tobool.not.4 = icmp eq i32 %8, 0 %.sink50 = select i1 %tobool.not.4, i32 46, i32 81 %putchar39.4 = call i32 @putchar(i32 %.sink50) %arrayidx23.5 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 5 %9 = load i32, ptr %arrayidx23.5, align 4, !tbaa !5 %tobool.not.5 = icmp eq i32 %9, 0 %.sink51 = select i1 %tobool.not.5, i32 46, i32 81 %putchar39.5 = call i32 @putchar(i32 %.sink51) %arrayidx23.6 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 6 %10 = load i32, ptr %arrayidx23.6, align 8, !tbaa !5 %tobool.not.6 = icmp eq i32 %10, 0 %.sink52 = select i1 %tobool.not.6, i32 46, i32 81 %putchar39.6 = call i32 @putchar(i32 %.sink52) %arrayidx23.7 = getelementptr inbounds [8 x [8 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 7 %11 = load i32, ptr %arrayidx23.7, align 4, !tbaa !5 %tobool.not.7 = icmp eq i32 %11, 0 %.sink53 = select i1 %tobool.not.7, i32 46, i32 81 %putchar39.7 = call i32 @putchar(i32 %.sink53) %putchar = call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.end32, label %for.cond17.preheader, !llvm.loop !12 for.end32: ; preds = %for.cond17.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = !{i32 0, i32 2} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include<stdio.h> #include <stdbool.h> /* boolは、ブーリアン型(Boolean datatype)で、真理値の2つの値 bool true falseのシンボルが定義 */ #define N 8 int row[N]; bool col[N],dpos[2*N-1],dneg[2*N-1]; bool X[N][N]; void initialize(){ for(int i = 0;i < N;i++){ row[i] = -1; col[i] = -1; } for(int i = 0;i < 2*N-1;i++){ dpos[i] = -1; col[i] = -1; } } void printBoard(){ for(int i = 0;i < N;i++){ for(int j = 0;j < N;j++){ if(X[i][j]){ if(row[i] != j) return; } } } for (int i = 0; i < N;i++){ for (int j = 0; j < N;j++){ printf("%c",(row[i] == j) ? 'Q' : '.'); } printf("\n"); } } void recursive(int i){ if (i == N){ printBoard(); return; } for (int j = 0; j < N;j++){ if(!col[j] && !dpos[i + j] && !dneg[i - j + N - 1]){ row[i] = j; col[j] = dpos[i + j] = dneg[i - j + N - 1] = true; recursive(i + 1); row[i] = -1; col[j] = dpos[i + j] = dneg[i - j + N - 1] = false; } } } int main(){ int i,k,r,c; initialize; for(i = 0;i < N;i++){ for(int j = 0;j < N;j++){ X[i][j] = false; } } scanf("%d",&k); for (i = 0; i < k;i++){ scanf("%d %d",&r,&c); X[r][c] = true; } recursive(0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232808/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232808/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @col = dso_local local_unnamed_addr global [8 x i8] zeroinitializer, align 1 @dpos = dso_local local_unnamed_addr global [15 x i8] zeroinitializer, align 1 @X = dso_local local_unnamed_addr global [8 x [8 x i8]] zeroinitializer, align 16 @dneg = dso_local local_unnamed_addr global [15 x i8] zeroinitializer, align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @initialize() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) @dpos, i8 1, i64 15, i1 false), !tbaa !9 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) @col, i8 1, i64 15, i1 false), !tbaa !9 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @printBoard() local_unnamed_addr #2 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx8 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 0 %0 = load i8, ptr %arrayidx6, align 8, !tbaa !9, !range !11, !noundef !12 %tobool.not = icmp eq i8 %0, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not = icmp eq i32 %1, 0 br i1 %cmp9.not, label %for.inc, label %for.end38 for.inc: ; preds = %for.cond1.preheader, %if.then %arrayidx6.1 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 1 %2 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.1 = icmp eq i8 %2, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.1 = icmp eq i32 %3, 1 br i1 %cmp9.not.1, label %for.inc.1, label %for.end38 for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx6.2 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 2 %4 = load i8, ptr %arrayidx6.2, align 2, !tbaa !9, !range !11, !noundef !12 %tobool.not.2 = icmp eq i8 %4, 0 br i1 %tobool.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.2 = icmp eq i32 %5, 2 br i1 %cmp9.not.2, label %for.inc.2, label %for.end38 for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx6.3 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 3 %6 = load i8, ptr %arrayidx6.3, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.3 = icmp eq i8 %6, 0 br i1 %tobool.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.3 = icmp eq i32 %7, 3 br i1 %cmp9.not.3, label %for.inc.3, label %for.end38 for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx6.4 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 4 %8 = load i8, ptr %arrayidx6.4, align 4, !tbaa !9, !range !11, !noundef !12 %tobool.not.4 = icmp eq i8 %8, 0 br i1 %tobool.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.4 = icmp eq i32 %9, 4 br i1 %cmp9.not.4, label %for.inc.4, label %for.end38 for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx6.5 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 5 %10 = load i8, ptr %arrayidx6.5, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.5 = icmp eq i8 %10, 0 br i1 %tobool.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.5 = icmp eq i32 %11, 5 br i1 %cmp9.not.5, label %for.inc.5, label %for.end38 for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx6.6 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 6 %12 = load i8, ptr %arrayidx6.6, align 2, !tbaa !9, !range !11, !noundef !12 %tobool.not.6 = icmp eq i8 %12, 0 br i1 %tobool.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.6 = icmp eq i32 %13, 6 br i1 %cmp9.not.6, label %for.inc.6, label %for.end38 for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx6.7 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %indvars.iv, i64 7 %14 = load i8, ptr %arrayidx6.7, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.7 = icmp eq i8 %14, 0 br i1 %tobool.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9.not.7 = icmp eq i32 %15, 7 br i1 %cmp9.not.7, label %for.inc.7, label %for.end38 for.inc.7: ; preds = %if.then.7, %for.inc.6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond23.preheader, label %for.cond1.preheader, !llvm.loop !13 for.cond23.preheader: ; preds = %for.inc.7, %for.cond23.preheader %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.cond23.preheader ], [ 0, %for.inc.7 ] %arrayidx28 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv65 %16 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp eq i32 %16, 0 %cond = select i1 %cmp29, i32 81, i32 46 %putchar51 = tail call i32 @putchar(i32 %cond) %17 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.1 = icmp eq i32 %17, 1 %cond.1 = select i1 %cmp29.1, i32 81, i32 46 %putchar51.1 = tail call i32 @putchar(i32 %cond.1) %18 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.2 = icmp eq i32 %18, 2 %cond.2 = select i1 %cmp29.2, i32 81, i32 46 %putchar51.2 = tail call i32 @putchar(i32 %cond.2) %19 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.3 = icmp eq i32 %19, 3 %cond.3 = select i1 %cmp29.3, i32 81, i32 46 %putchar51.3 = tail call i32 @putchar(i32 %cond.3) %20 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.4 = icmp eq i32 %20, 4 %cond.4 = select i1 %cmp29.4, i32 81, i32 46 %putchar51.4 = tail call i32 @putchar(i32 %cond.4) %21 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.5 = icmp eq i32 %21, 5 %cond.5 = select i1 %cmp29.5, i32 81, i32 46 %putchar51.5 = tail call i32 @putchar(i32 %cond.5) %22 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.6 = icmp eq i32 %22, 6 %cond.6 = select i1 %cmp29.6, i32 81, i32 46 %putchar51.6 = tail call i32 @putchar(i32 %cond.6) %23 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.7 = icmp eq i32 %23, 7 %cond.7 = select i1 %cmp29.7, i32 81, i32 46 %putchar51.7 = tail call i32 @putchar(i32 %cond.7) %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %exitcond68.not = icmp eq i64 %indvars.iv.next66, 8 br i1 %exitcond68.not, label %for.end38, label %for.cond23.preheader, !llvm.loop !15 for.end38: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond23.preheader ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @recursive(i32 noundef %i) local_unnamed_addr #2 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = add i32 %i, 7 %idxprom12 = sext i32 %i to i64 %arrayidx13 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom12 %add24 = add nsw i32 %i, 1 %0 = load i8, ptr @col, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not = icmp eq i8 %0, 0 br i1 %tobool.not, label %land.lhs.true, label %for.inc if.then: ; preds = %entry tail call void @printBoard() br label %common.ret land.lhs.true: ; preds = %for.cond.preheader %arrayidx3 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %idxprom12 %1 = load i8, ptr %arrayidx3, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not = icmp eq i8 %1, 0 br i1 %tobool4.not, label %land.lhs.true5, label %for.inc land.lhs.true5: ; preds = %land.lhs.true %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8 %2 = load i8, ptr %arrayidx9, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not = icmp eq i8 %2, 0 br i1 %tobool10.not, label %if.then11, label %for.inc if.then11: ; preds = %land.lhs.true5 store i32 0, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9, align 1, !tbaa !9 store i8 1, ptr %arrayidx3, align 1, !tbaa !9 store i8 1, ptr @col, align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9, align 1, !tbaa !9 store i8 0, ptr %arrayidx3, align 1, !tbaa !9 store i8 0, ptr @col, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.cond.preheader, %land.lhs.true, %land.lhs.true5, %if.then11 %3 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 1), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.1 = icmp eq i8 %3, 0 br i1 %tobool.not.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %4 = add nsw i64 %idxprom12, 1 %arrayidx3.1 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %4 %5 = load i8, ptr %arrayidx3.1, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.1 = icmp eq i8 %5, 0 br i1 %tobool4.not.1, label %land.lhs.true5.1, label %for.inc.1 land.lhs.true5.1: ; preds = %land.lhs.true.1 %sub7.1 = add i32 %i, 6 %idxprom8.1 = sext i32 %sub7.1 to i64 %arrayidx9.1 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.1 %6 = load i8, ptr %arrayidx9.1, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.1 = icmp eq i8 %6, 0 br i1 %tobool10.not.1, label %if.then11.1, label %for.inc.1 if.then11.1: ; preds = %land.lhs.true5.1 store i32 1, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.1, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.1, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 1), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.1, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.1, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 1), align 1, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then11.1, %land.lhs.true5.1, %land.lhs.true.1, %for.inc %7 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 2), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.2 = icmp eq i8 %7, 0 br i1 %tobool.not.2, label %land.lhs.true.2, label %for.inc.2 land.lhs.true.2: ; preds = %for.inc.1 %8 = add nsw i64 %idxprom12, 2 %arrayidx3.2 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %8 %9 = load i8, ptr %arrayidx3.2, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.2 = icmp eq i8 %9, 0 br i1 %tobool4.not.2, label %land.lhs.true5.2, label %for.inc.2 land.lhs.true5.2: ; preds = %land.lhs.true.2 %sub7.2 = add i32 %i, 5 %idxprom8.2 = sext i32 %sub7.2 to i64 %arrayidx9.2 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.2 %10 = load i8, ptr %arrayidx9.2, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.2 = icmp eq i8 %10, 0 br i1 %tobool10.not.2, label %if.then11.2, label %for.inc.2 if.then11.2: ; preds = %land.lhs.true5.2 store i32 2, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.2, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.2, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 2), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.2, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.2, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 2), align 1, !tbaa !9 br label %for.inc.2 for.inc.2: ; preds = %if.then11.2, %land.lhs.true5.2, %land.lhs.true.2, %for.inc.1 %11 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 3), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.3 = icmp eq i8 %11, 0 br i1 %tobool.not.3, label %land.lhs.true.3, label %for.inc.3 land.lhs.true.3: ; preds = %for.inc.2 %12 = add nsw i64 %idxprom12, 3 %arrayidx3.3 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %12 %13 = load i8, ptr %arrayidx3.3, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.3 = icmp eq i8 %13, 0 br i1 %tobool4.not.3, label %land.lhs.true5.3, label %for.inc.3 land.lhs.true5.3: ; preds = %land.lhs.true.3 %sub7.3 = add i32 %i, 4 %idxprom8.3 = sext i32 %sub7.3 to i64 %arrayidx9.3 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.3 %14 = load i8, ptr %arrayidx9.3, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.3 = icmp eq i8 %14, 0 br i1 %tobool10.not.3, label %if.then11.3, label %for.inc.3 if.then11.3: ; preds = %land.lhs.true5.3 store i32 3, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.3, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.3, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 3), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.3, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.3, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 3), align 1, !tbaa !9 br label %for.inc.3 for.inc.3: ; preds = %if.then11.3, %land.lhs.true5.3, %land.lhs.true.3, %for.inc.2 %15 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 4), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.4 = icmp eq i8 %15, 0 br i1 %tobool.not.4, label %land.lhs.true.4, label %for.inc.4 land.lhs.true.4: ; preds = %for.inc.3 %16 = add nsw i64 %idxprom12, 4 %arrayidx3.4 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %16 %17 = load i8, ptr %arrayidx3.4, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.4 = icmp eq i8 %17, 0 br i1 %tobool4.not.4, label %land.lhs.true5.4, label %for.inc.4 land.lhs.true5.4: ; preds = %land.lhs.true.4 %sub7.4 = add i32 %i, 3 %idxprom8.4 = sext i32 %sub7.4 to i64 %arrayidx9.4 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.4 %18 = load i8, ptr %arrayidx9.4, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.4 = icmp eq i8 %18, 0 br i1 %tobool10.not.4, label %if.then11.4, label %for.inc.4 if.then11.4: ; preds = %land.lhs.true5.4 store i32 4, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.4, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.4, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 4), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.4, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.4, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 4), align 1, !tbaa !9 br label %for.inc.4 for.inc.4: ; preds = %if.then11.4, %land.lhs.true5.4, %land.lhs.true.4, %for.inc.3 %19 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 5), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.5 = icmp eq i8 %19, 0 br i1 %tobool.not.5, label %land.lhs.true.5, label %for.inc.5 land.lhs.true.5: ; preds = %for.inc.4 %20 = add nsw i64 %idxprom12, 5 %arrayidx3.5 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %20 %21 = load i8, ptr %arrayidx3.5, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.5 = icmp eq i8 %21, 0 br i1 %tobool4.not.5, label %land.lhs.true5.5, label %for.inc.5 land.lhs.true5.5: ; preds = %land.lhs.true.5 %sub7.5 = add i32 %i, 2 %idxprom8.5 = sext i32 %sub7.5 to i64 %arrayidx9.5 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.5 %22 = load i8, ptr %arrayidx9.5, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.5 = icmp eq i8 %22, 0 br i1 %tobool10.not.5, label %if.then11.5, label %for.inc.5 if.then11.5: ; preds = %land.lhs.true5.5 store i32 5, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.5, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.5, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 5), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.5, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.5, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 5), align 1, !tbaa !9 br label %for.inc.5 for.inc.5: ; preds = %if.then11.5, %land.lhs.true5.5, %land.lhs.true.5, %for.inc.4 %23 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 6), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.6 = icmp eq i8 %23, 0 br i1 %tobool.not.6, label %land.lhs.true.6, label %for.inc.6 land.lhs.true.6: ; preds = %for.inc.5 %24 = add nsw i64 %idxprom12, 6 %arrayidx3.6 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %24 %25 = load i8, ptr %arrayidx3.6, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.6 = icmp eq i8 %25, 0 br i1 %tobool4.not.6, label %land.lhs.true5.6, label %for.inc.6 land.lhs.true5.6: ; preds = %land.lhs.true.6 %sub7.6 = add i32 %i, 1 %idxprom8.6 = sext i32 %sub7.6 to i64 %arrayidx9.6 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom8.6 %26 = load i8, ptr %arrayidx9.6, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.6 = icmp eq i8 %26, 0 br i1 %tobool10.not.6, label %if.then11.6, label %for.inc.6 if.then11.6: ; preds = %land.lhs.true5.6 store i32 6, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.6, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.6, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 6), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.6, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.6, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 6), align 1, !tbaa !9 br label %for.inc.6 for.inc.6: ; preds = %if.then11.6, %land.lhs.true5.6, %land.lhs.true.6, %for.inc.5 %27 = load i8, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 7), align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not.7 = icmp eq i8 %27, 0 br i1 %tobool.not.7, label %land.lhs.true.7, label %common.ret land.lhs.true.7: ; preds = %for.inc.6 %28 = add nsw i64 %idxprom12, 7 %arrayidx3.7 = getelementptr inbounds [15 x i8], ptr @dpos, i64 0, i64 %28 %29 = load i8, ptr %arrayidx3.7, align 1, !tbaa !9, !range !11, !noundef !12 %tobool4.not.7 = icmp eq i8 %29, 0 br i1 %tobool4.not.7, label %land.lhs.true5.7, label %common.ret land.lhs.true5.7: ; preds = %land.lhs.true.7 %arrayidx9.7 = getelementptr inbounds [15 x i8], ptr @dneg, i64 0, i64 %idxprom12 %30 = load i8, ptr %arrayidx9.7, align 1, !tbaa !9, !range !11, !noundef !12 %tobool10.not.7 = icmp eq i8 %30, 0 br i1 %tobool10.not.7, label %if.then11.7, label %common.ret common.ret: ; preds = %if.then, %land.lhs.true5.7, %land.lhs.true.7, %for.inc.6, %if.then11.7 ret void if.then11.7: ; preds = %land.lhs.true5.7 store i32 7, ptr %arrayidx13, align 4, !tbaa !5 store i8 1, ptr %arrayidx9.7, align 1, !tbaa !9 store i8 1, ptr %arrayidx3.7, align 1, !tbaa !9 store i8 1, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 7), align 1, !tbaa !9 tail call void @recursive(i32 noundef %add24) store i32 -1, ptr %arrayidx13, align 4, !tbaa !5 store i8 0, ptr %arrayidx9.7, align 1, !tbaa !9 store i8 0, ptr %arrayidx3.7, align 1, !tbaa !9 store i8 0, ptr getelementptr inbounds ([8 x i8], ptr @col, i64 0, i64 7), align 1, !tbaa !9 br label %common.ret } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @X, i8 0, i64 64, i1 false), !tbaa !9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp1028 = icmp sgt i32 %0, 0 br i1 %cmp1028, label %for.body11, label %for.end19 for.body11: ; preds = %entry, %for.body11 %i.129 = phi i32 [ %inc18, %for.body11 ], [ 0, %entry ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %r, ptr noundef nonnull %c) %1 = load i32, ptr %r, align 4, !tbaa !5 %idxprom13 = sext i32 %1 to i64 %2 = load i32, ptr %c, align 4, !tbaa !5 %idxprom15 = sext i32 %2 to i64 %arrayidx16 = getelementptr inbounds [8 x [8 x i8]], ptr @X, i64 0, i64 %idxprom13, i64 %idxprom15 store i8 1, ptr %arrayidx16, align 1, !tbaa !9 %inc18 = add nuw nsw i32 %i.129, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc18, %3 br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !16 for.end19: ; preds = %for.body11, %entry call void @recursive(i32 noundef 0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"_Bool", !7, i64 0} !11 = !{i8 0, i8 2} !12 = !{} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14} !16 = distinct !{!16, !14}
#include<stdio.h> #include<string.h> char s[10][10]; int a[20],b[20],c[20],d[20]; void dfs(int x){ int i; if(c[x] == 1) dfs(x + 1); if(x == 8){ for(i = 0;i < 8;i++) printf("%s\n",s[i]); return; } for(i = 0;i < 8;i++){ if(a[i] == 0 && b[x+i] == 0 && d[x-i+8] == 0) { a[i] = 1; b[x+i] = 1; d[x-i+8] = 1; s[x][i] = 'Q'; dfs(x+1); a[i] = 0; b[x+i] = 0; d[x-i+8] = 0; s[x][i] = '.'; } } } int main(){ int i,j,k,r,q; scanf("%d",&k); for(i = 0;i < 8;i++) for(j = 0;j < 8;j++) s[i][j]='.'; for(i = 0;i < k;i++) { scanf("%d%d",&r,&q); s[r][q] = 'Q'; a[q] = 1; b[r+q] = 1; d[r-q+8] = 1; c[r]=1; } dfs(0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232851/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232851/source.c" target datalayout = "e-m:e-p270: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 [20 x i32] zeroinitializer, align 16 @s = dso_local global [10 x [10 x i8]] zeroinitializer, align 16 @a = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @dfs(i32 noundef %x) local_unnamed_addr #0 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [20 x i32], ptr @c, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %add = add nsw i32 %x, 1 tail call void @dfs(i32 noundef %add) br label %if.end if.end: ; preds = %if.then, %entry %cmp1 = icmp eq i32 %x, 8 br i1 %cmp1, label %for.body.preheader, label %for.cond7.preheader for.body.preheader: ; preds = %if.end %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @s) %puts.1 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 1)) %puts.2 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 2)) %puts.3 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 3)) %puts.4 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 4)) %puts.5 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 5)) %puts.6 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 6)) %puts.7 = tail call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 7)) br label %common.ret for.cond7.preheader: ; preds = %if.end %sub = add i32 %x, 8 %add36 = add nsw i32 %x, 1 %1 = load i32, ptr @a, align 16, !tbaa !5 %cmp12 = icmp eq i32 %1, 0 br i1 %cmp12, label %land.lhs.true, label %for.inc51 land.lhs.true: ; preds = %for.cond7.preheader %arrayidx15 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp eq i32 %2, 0 br i1 %cmp16, label %land.lhs.true17, label %for.inc51 land.lhs.true17: ; preds = %land.lhs.true %idxprom19 = sext i32 %sub to i64 %arrayidx20 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19 %3 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %3, 0 br i1 %cmp21, label %if.then22, label %for.inc51 if.then22: ; preds = %land.lhs.true17 store i32 1, ptr @a, align 16, !tbaa !5 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %arrayidx35 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 0 store i8 81, ptr %arrayidx35, align 2, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr @a, align 16, !tbaa !5 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 store i32 0, ptr %arrayidx20, align 4, !tbaa !5 store i8 46, ptr %arrayidx35, align 2, !tbaa !9 br label %for.inc51 for.inc51: ; preds = %for.cond7.preheader, %land.lhs.true, %land.lhs.true17, %if.then22 %4 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5 %cmp12.1 = icmp eq i32 %4, 0 br i1 %cmp12.1, label %land.lhs.true.1, label %for.inc51.1 land.lhs.true.1: ; preds = %for.inc51 %5 = add nsw i64 %idxprom, 1 %arrayidx15.1 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %5 %6 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %cmp16.1 = icmp eq i32 %6, 0 br i1 %cmp16.1, label %land.lhs.true17.1, label %for.inc51.1 land.lhs.true17.1: ; preds = %land.lhs.true.1 %add18.1 = add i32 %x, 7 %idxprom19.1 = sext i32 %add18.1 to i64 %arrayidx20.1 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.1 %7 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %cmp21.1 = icmp eq i32 %7, 0 br i1 %cmp21.1, label %if.then22.1, label %for.inc51.1 if.then22.1: ; preds = %land.lhs.true17.1 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5 store i32 1, ptr %arrayidx15.1, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.1, align 4, !tbaa !5 %arrayidx35.1 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 1 store i8 81, ptr %arrayidx35.1, align 1, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5 store i32 0, ptr %arrayidx15.1, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.1, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.1, align 1, !tbaa !9 br label %for.inc51.1 for.inc51.1: ; preds = %if.then22.1, %land.lhs.true17.1, %land.lhs.true.1, %for.inc51 %8 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !5 %cmp12.2 = icmp eq i32 %8, 0 br i1 %cmp12.2, label %land.lhs.true.2, label %for.inc51.2 land.lhs.true.2: ; preds = %for.inc51.1 %9 = add nsw i64 %idxprom, 2 %arrayidx15.2 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %9 %10 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5 %cmp16.2 = icmp eq i32 %10, 0 br i1 %cmp16.2, label %land.lhs.true17.2, label %for.inc51.2 land.lhs.true17.2: ; preds = %land.lhs.true.2 %add18.2 = add i32 %x, 6 %idxprom19.2 = sext i32 %add18.2 to i64 %arrayidx20.2 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.2 %11 = load i32, ptr %arrayidx20.2, align 4, !tbaa !5 %cmp21.2 = icmp eq i32 %11, 0 br i1 %cmp21.2, label %if.then22.2, label %for.inc51.2 if.then22.2: ; preds = %land.lhs.true17.2 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !5 store i32 1, ptr %arrayidx15.2, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.2, align 4, !tbaa !5 %arrayidx35.2 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 2 store i8 81, ptr %arrayidx35.2, align 2, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !5 store i32 0, ptr %arrayidx15.2, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.2, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.2, align 2, !tbaa !9 br label %for.inc51.2 for.inc51.2: ; preds = %if.then22.2, %land.lhs.true17.2, %land.lhs.true.2, %for.inc51.1 %12 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !5 %cmp12.3 = icmp eq i32 %12, 0 br i1 %cmp12.3, label %land.lhs.true.3, label %for.inc51.3 land.lhs.true.3: ; preds = %for.inc51.2 %13 = add nsw i64 %idxprom, 3 %arrayidx15.3 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %13 %14 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5 %cmp16.3 = icmp eq i32 %14, 0 br i1 %cmp16.3, label %land.lhs.true17.3, label %for.inc51.3 land.lhs.true17.3: ; preds = %land.lhs.true.3 %add18.3 = add i32 %x, 5 %idxprom19.3 = sext i32 %add18.3 to i64 %arrayidx20.3 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.3 %15 = load i32, ptr %arrayidx20.3, align 4, !tbaa !5 %cmp21.3 = icmp eq i32 %15, 0 br i1 %cmp21.3, label %if.then22.3, label %for.inc51.3 if.then22.3: ; preds = %land.lhs.true17.3 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !5 store i32 1, ptr %arrayidx15.3, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.3, align 4, !tbaa !5 %arrayidx35.3 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 3 store i8 81, ptr %arrayidx35.3, align 1, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !5 store i32 0, ptr %arrayidx15.3, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.3, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.3, align 1, !tbaa !9 br label %for.inc51.3 for.inc51.3: ; preds = %if.then22.3, %land.lhs.true17.3, %land.lhs.true.3, %for.inc51.2 %16 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 4), align 16, !tbaa !5 %cmp12.4 = icmp eq i32 %16, 0 br i1 %cmp12.4, label %land.lhs.true.4, label %for.inc51.4 land.lhs.true.4: ; preds = %for.inc51.3 %17 = add nsw i64 %idxprom, 4 %arrayidx15.4 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %17 %18 = load i32, ptr %arrayidx15.4, align 4, !tbaa !5 %cmp16.4 = icmp eq i32 %18, 0 br i1 %cmp16.4, label %land.lhs.true17.4, label %for.inc51.4 land.lhs.true17.4: ; preds = %land.lhs.true.4 %add18.4 = add i32 %x, 4 %idxprom19.4 = sext i32 %add18.4 to i64 %arrayidx20.4 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.4 %19 = load i32, ptr %arrayidx20.4, align 4, !tbaa !5 %cmp21.4 = icmp eq i32 %19, 0 br i1 %cmp21.4, label %if.then22.4, label %for.inc51.4 if.then22.4: ; preds = %land.lhs.true17.4 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 4), align 16, !tbaa !5 store i32 1, ptr %arrayidx15.4, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.4, align 4, !tbaa !5 %arrayidx35.4 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 4 store i8 81, ptr %arrayidx35.4, align 2, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 4), align 16, !tbaa !5 store i32 0, ptr %arrayidx15.4, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.4, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.4, align 2, !tbaa !9 br label %for.inc51.4 for.inc51.4: ; preds = %if.then22.4, %land.lhs.true17.4, %land.lhs.true.4, %for.inc51.3 %20 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 5), align 4, !tbaa !5 %cmp12.5 = icmp eq i32 %20, 0 br i1 %cmp12.5, label %land.lhs.true.5, label %for.inc51.5 land.lhs.true.5: ; preds = %for.inc51.4 %21 = add nsw i64 %idxprom, 5 %arrayidx15.5 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %21 %22 = load i32, ptr %arrayidx15.5, align 4, !tbaa !5 %cmp16.5 = icmp eq i32 %22, 0 br i1 %cmp16.5, label %land.lhs.true17.5, label %for.inc51.5 land.lhs.true17.5: ; preds = %land.lhs.true.5 %add18.5 = add i32 %x, 3 %idxprom19.5 = sext i32 %add18.5 to i64 %arrayidx20.5 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.5 %23 = load i32, ptr %arrayidx20.5, align 4, !tbaa !5 %cmp21.5 = icmp eq i32 %23, 0 br i1 %cmp21.5, label %if.then22.5, label %for.inc51.5 if.then22.5: ; preds = %land.lhs.true17.5 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 5), align 4, !tbaa !5 store i32 1, ptr %arrayidx15.5, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.5, align 4, !tbaa !5 %arrayidx35.5 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 5 store i8 81, ptr %arrayidx35.5, align 1, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 5), align 4, !tbaa !5 store i32 0, ptr %arrayidx15.5, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.5, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.5, align 1, !tbaa !9 br label %for.inc51.5 for.inc51.5: ; preds = %if.then22.5, %land.lhs.true17.5, %land.lhs.true.5, %for.inc51.4 %24 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 6), align 8, !tbaa !5 %cmp12.6 = icmp eq i32 %24, 0 br i1 %cmp12.6, label %land.lhs.true.6, label %for.inc51.6 land.lhs.true.6: ; preds = %for.inc51.5 %25 = add nsw i64 %idxprom, 6 %arrayidx15.6 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %25 %26 = load i32, ptr %arrayidx15.6, align 4, !tbaa !5 %cmp16.6 = icmp eq i32 %26, 0 br i1 %cmp16.6, label %land.lhs.true17.6, label %for.inc51.6 land.lhs.true17.6: ; preds = %land.lhs.true.6 %add18.6 = add i32 %x, 2 %idxprom19.6 = sext i32 %add18.6 to i64 %arrayidx20.6 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.6 %27 = load i32, ptr %arrayidx20.6, align 4, !tbaa !5 %cmp21.6 = icmp eq i32 %27, 0 br i1 %cmp21.6, label %if.then22.6, label %for.inc51.6 if.then22.6: ; preds = %land.lhs.true17.6 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 6), align 8, !tbaa !5 store i32 1, ptr %arrayidx15.6, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.6, align 4, !tbaa !5 %arrayidx35.6 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 6 store i8 81, ptr %arrayidx35.6, align 2, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 6), align 8, !tbaa !5 store i32 0, ptr %arrayidx15.6, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.6, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.6, align 2, !tbaa !9 br label %for.inc51.6 for.inc51.6: ; preds = %if.then22.6, %land.lhs.true17.6, %land.lhs.true.6, %for.inc51.5 %28 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 7), align 4, !tbaa !5 %cmp12.7 = icmp eq i32 %28, 0 br i1 %cmp12.7, label %land.lhs.true.7, label %common.ret land.lhs.true.7: ; preds = %for.inc51.6 %29 = add nsw i64 %idxprom, 7 %arrayidx15.7 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %29 %30 = load i32, ptr %arrayidx15.7, align 4, !tbaa !5 %cmp16.7 = icmp eq i32 %30, 0 br i1 %cmp16.7, label %land.lhs.true17.7, label %common.ret land.lhs.true17.7: ; preds = %land.lhs.true.7 %add18.7 = add i32 %x, 1 %idxprom19.7 = sext i32 %add18.7 to i64 %arrayidx20.7 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom19.7 %31 = load i32, ptr %arrayidx20.7, align 4, !tbaa !5 %cmp21.7 = icmp eq i32 %31, 0 br i1 %cmp21.7, label %if.then22.7, label %common.ret common.ret: ; preds = %for.body.preheader, %land.lhs.true17.7, %land.lhs.true.7, %for.inc51.6, %if.then22.7 ret void if.then22.7: ; preds = %land.lhs.true17.7 store i32 1, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 7), align 4, !tbaa !5 store i32 1, ptr %arrayidx15.7, align 4, !tbaa !5 store i32 1, ptr %arrayidx20.7, align 4, !tbaa !5 %arrayidx35.7 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom, i64 7 store i8 81, ptr %arrayidx35.7, align 1, !tbaa !9 tail call void @dfs(i32 noundef %add36) store i32 0, ptr getelementptr inbounds ([20 x i32], ptr @a, i64 0, i64 7), align 4, !tbaa !5 store i32 0, ptr %arrayidx15.7, align 4, !tbaa !5 store i32 0, ptr %arrayidx20.7, align 4, !tbaa !5 store i8 46, ptr %arrayidx35.7, align 1, !tbaa !9 br label %common.ret } ; 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 #0 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) store i64 3327647950551526958, ptr @s, align 16 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 1, i64 0), align 2 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 2, i64 0), align 4 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 3, i64 0), align 2 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 4, i64 0), align 8 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 5, i64 0), align 2 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 6, i64 0), align 4 store i64 3327647950551526958, ptr getelementptr inbounds ([10 x [10 x i8]], ptr @s, i64 0, i64 7, i64 0), align 2 %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp1037 = icmp sgt i32 %0, 0 br i1 %cmp1037, label %for.body11, label %for.end28 for.body11: ; preds = %entry, %for.body11 %i.138 = phi i32 [ %inc27, %for.body11 ], [ 0, %entry ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %r, ptr noundef nonnull %q) %1 = load i32, ptr %r, align 4, !tbaa !5 %idxprom13 = sext i32 %1 to i64 %2 = load i32, ptr %q, align 4, !tbaa !5 %idxprom15 = sext i32 %2 to i64 %arrayidx16 = getelementptr inbounds [10 x [10 x i8]], ptr @s, i64 0, i64 %idxprom13, i64 %idxprom15 store i8 81, ptr %arrayidx16, align 1, !tbaa !9 %arrayidx18 = getelementptr inbounds [20 x i32], ptr @a, i64 0, i64 %idxprom15 store i32 1, ptr %arrayidx18, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %idxprom19 = sext i32 %add to i64 %arrayidx20 = getelementptr inbounds [20 x i32], ptr @b, i64 0, i64 %idxprom19 store i32 1, ptr %arrayidx20, align 4, !tbaa !5 %sub = add i32 %1, 8 %add21 = sub i32 %sub, %2 %idxprom22 = sext i32 %add21 to i64 %arrayidx23 = getelementptr inbounds [20 x i32], ptr @d, i64 0, i64 %idxprom22 store i32 1, ptr %arrayidx23, align 4, !tbaa !5 %arrayidx25 = getelementptr inbounds [20 x i32], ptr @c, i64 0, i64 %idxprom13 store i32 1, ptr %arrayidx25, align 4, !tbaa !5 %inc27 = add nuw nsw i32 %i.138, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc27, %3 br i1 %cmp10, label %for.body11, label %for.end28, !llvm.loop !10 for.end28: ; preds = %for.body11, %entry call void @dfs(i32 noundef 0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 @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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define EMPTY -111//何もいない状態 #define HERE 100//Queenがいる状態 #define N 8//N×Nの盤面 #define KOSHIN 3180 void putQueen(int); void printBoard(void); int row[N];//横 int col[N];//縦 int dpos[N*2];//左斜め下 dpos = i + j (i -> 行、j -> 列) int dneg[N*2];//右斜め下 dneg = i - j + (N - 1) int judge[N][N]; int main(){ int k = 0, r = 0, c = 0; int i = 0; //盤面の初期化 for(i = 0; i < N; i++){ row[i] = col[i] = EMPTY; } for(i = 0; i < N*2; i++){ dneg[i] = dpos[i] = EMPTY; } //盤面に駒をおいていく scanf("%d",&k); for(i = 0; i < k; i++){ scanf("%d%d",&r,&c); row[r] = c; col[c] = dpos[r+c] = dneg[r-c+N-1] = HERE; judge[r][c] = KOSHIN; } //ここで被らないようにQをおいていく putQueen(0); return 0; } void putQueen(int i){ int j = 0; if(i == N){//終了条件 printBoard(); return; } for(j = 0; j < N; j++){ if(judge[i][j] == KOSHIN){ } else if(col[j] == HERE || dpos[i+j] == HERE || dneg[i-j+N-1] == HERE){ continue; } //put a queen at(i, j) row[i] = j; col[j] = dpos[i+j] = dneg[i-j+N-1] = HERE; //try the next row putQueen(i+1); //remove the queen at (i, j)for backtracking if(judge[i][j] == KOSHIN); else col[j] = dpos[i+j] = dneg[i-j+N-1] = EMPTY; } } void printBoard(void){ int i = 0, j = 0; for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ if(col[j] == HERE && row[i] == j)printf("Q"); else printf("."); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232895/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232895/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @dpos = dso_local local_unnamed_addr global [16 x i32] zeroinitializer, align 16 @dneg = dso_local local_unnamed_addr global [16 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @judge = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 store i32 0, ptr %k, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 store i32 0, ptr %r, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 store i32 0, ptr %c, align 4, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr @col, align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr @row, align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([8 x i32], ptr @row, i64 0, i64 4), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr @dpos, align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr @dneg, align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dpos, i64 0, i64 4), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dneg, i64 0, i64 4), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dpos, i64 0, i64 8), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dneg, i64 0, i64 8), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dpos, i64 0, i64 12), align 16, !tbaa !5 store <4 x i32> <i32 -111, i32 -111, i32 -111, i32 -111>, ptr getelementptr inbounds ([16 x i32], ptr @dneg, i64 0, i64 12), align 16, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp1445 = icmp sgt i32 %0, 0 br i1 %cmp1445, label %for.body15, label %for.end33 for.body15: ; preds = %entry, %for.body15 %i.246 = phi i32 [ %inc32, %for.body15 ], [ 0, %entry ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c) %1 = load i32, ptr %c, align 4, !tbaa !5 %2 = load i32, ptr %r, align 4, !tbaa !5 %idxprom17 = sext i32 %2 to i64 %arrayidx18 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom17 store i32 %1, ptr %arrayidx18, align 4, !tbaa !5 %reass.sub = sub i32 %2, %1 %sub19 = add i32 %reass.sub, 7 %idxprom20 = sext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds [16 x i32], ptr @dneg, i64 0, i64 %idxprom20 store i32 100, ptr %arrayidx21, align 4, !tbaa !5 %add22 = add nsw i32 %2, %1 %idxprom23 = sext i32 %add22 to i64 %arrayidx24 = getelementptr inbounds [16 x i32], ptr @dpos, i64 0, i64 %idxprom23 store i32 100, ptr %arrayidx24, align 4, !tbaa !5 %idxprom25 = sext i32 %1 to i64 %arrayidx26 = getelementptr inbounds [8 x i32], ptr @col, i64 0, i64 %idxprom25 store i32 100, ptr %arrayidx26, align 4, !tbaa !5 %arrayidx30 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %idxprom17, i64 %idxprom25 store i32 3180, ptr %arrayidx30, align 4, !tbaa !5 %inc32 = add nuw nsw i32 %i.246, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc32, %3 br i1 %cmp14, label %for.body15, label %for.end33, !llvm.loop !9 for.end33: ; preds = %for.body15, %entry call void @putQueen(i32 noundef 0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 @putQueen(i32 noundef %i) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %idxprom = sext i32 %i to i64 %sub = add i32 %i, 7 %arrayidx22 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom %add33 = add nsw i32 %i, 1 br label %for.body if.then: ; preds = %entry tail call void @printBoard() br label %cleanup for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv77 = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next78, %for.inc ] %indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %idxprom, i64 %indvars.iv77 %0 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp eq i32 %0, 3180 br i1 %cmp4, label %for.body.if.end20_crit_edge, label %if.else for.body.if.end20_crit_edge: ; preds = %for.body %.pre = trunc i64 %indvars.iv to i32 %.pre85 = add i32 %sub, %.pre %.pre86 = sext i32 %.pre85 to i64 %.pre87 = add nsw i64 %indvars.iv77, %idxprom br label %if.end20 if.else: ; preds = %for.body %arrayidx7 = getelementptr inbounds [8 x i32], ptr @col, i64 0, i64 %indvars.iv77 %1 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp eq i32 %1, 100 br i1 %cmp8, label %for.inc, label %lor.lhs.false lor.lhs.false: ; preds = %if.else %2 = add nsw i64 %indvars.iv77, %idxprom %arrayidx10 = getelementptr inbounds [16 x i32], ptr @dpos, i64 0, i64 %2 %3 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %3, 100 br i1 %cmp11, label %for.inc, label %lor.lhs.false12 lor.lhs.false12: ; preds = %lor.lhs.false %4 = trunc i64 %indvars.iv to i32 %sub14 = add i32 %sub, %4 %idxprom15 = sext i32 %sub14 to i64 %arrayidx16 = getelementptr inbounds [16 x i32], ptr @dneg, i64 0, i64 %idxprom15 %5 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp eq i32 %5, 100 br i1 %cmp17, label %for.inc, label %if.end20 if.end20: ; preds = %for.body.if.end20_crit_edge, %lor.lhs.false12 %.pre-phi88 = phi i64 [ %.pre87, %for.body.if.end20_crit_edge ], [ %2, %lor.lhs.false12 ] %idxprom26.pre-phi = phi i64 [ %.pre86, %for.body.if.end20_crit_edge ], [ %idxprom15, %lor.lhs.false12 ] %6 = trunc i64 %indvars.iv77 to i32 store i32 %6, ptr %arrayidx22, align 4, !tbaa !5 %arrayidx27 = getelementptr inbounds [16 x i32], ptr @dneg, i64 0, i64 %idxprom26.pre-phi store i32 100, ptr %arrayidx27, align 4, !tbaa !5 %arrayidx30 = getelementptr inbounds [16 x i32], ptr @dpos, i64 0, i64 %.pre-phi88 store i32 100, ptr %arrayidx30, align 4, !tbaa !5 %arrayidx32 = getelementptr inbounds [8 x i32], ptr @col, i64 0, i64 %indvars.iv77 store i32 100, ptr %arrayidx32, align 4, !tbaa !5 tail call void @putQueen(i32 noundef %add33) %7 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp38 = icmp eq i32 %7, 3180 br i1 %cmp38, label %for.inc, label %if.else40 if.else40: ; preds = %if.end20 store i32 -111, ptr %arrayidx27, align 4, !tbaa !5 store i32 -111, ptr %arrayidx30, align 4, !tbaa !5 store i32 -111, ptr %arrayidx32, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.else40, %if.end20, %if.else, %lor.lhs.false, %lor.lhs.false12 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %exitcond.not = icmp eq i64 %indvars.iv.next78, 8 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11 cleanup: ; preds = %for.inc, %if.then 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 uwtable define dso_local void @printBoard() local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx6 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv %0 = load i32, ptr @col, align 16, !tbaa !5 %cmp4 = icmp eq i32 %0, 100 br i1 %cmp4, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %1, 0 br i1 %cmp7, label %for.inc, label %if.else if.else: ; preds = %land.lhs.true, %for.cond1.preheader br label %for.inc for.inc: ; preds = %land.lhs.true, %if.else %.sink = phi i32 [ 46, %if.else ], [ 81, %land.lhs.true ] %putchar19 = tail call i32 @putchar(i32 %.sink) %2 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 %cmp4.1 = icmp eq i32 %2, 100 br i1 %cmp4.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.1 = icmp eq i32 %3, 1 %spec.select = select i1 %cmp7.1, i32 81, i32 46 br label %for.inc.1 for.inc.1: ; preds = %land.lhs.true.1, %for.inc %.sink25 = phi i32 [ 46, %for.inc ], [ %spec.select, %land.lhs.true.1 ] %putchar19.1 = tail call i32 @putchar(i32 %.sink25) %4 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 %cmp4.2 = icmp eq i32 %4, 100 br i1 %cmp4.2, label %land.lhs.true.2, label %for.inc.2 land.lhs.true.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.2 = icmp eq i32 %5, 2 %spec.select32 = select i1 %cmp7.2, i32 81, i32 46 br label %for.inc.2 for.inc.2: ; preds = %land.lhs.true.2, %for.inc.1 %.sink26 = phi i32 [ 46, %for.inc.1 ], [ %spec.select32, %land.lhs.true.2 ] %putchar19.2 = tail call i32 @putchar(i32 %.sink26) %6 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 %cmp4.3 = icmp eq i32 %6, 100 br i1 %cmp4.3, label %land.lhs.true.3, label %for.inc.3 land.lhs.true.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.3 = icmp eq i32 %7, 3 %spec.select33 = select i1 %cmp7.3, i32 81, i32 46 br label %for.inc.3 for.inc.3: ; preds = %land.lhs.true.3, %for.inc.2 %.sink27 = phi i32 [ 46, %for.inc.2 ], [ %spec.select33, %land.lhs.true.3 ] %putchar19.3 = tail call i32 @putchar(i32 %.sink27) %8 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 %cmp4.4 = icmp eq i32 %8, 100 br i1 %cmp4.4, label %land.lhs.true.4, label %for.inc.4 land.lhs.true.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.4 = icmp eq i32 %9, 4 %spec.select34 = select i1 %cmp7.4, i32 81, i32 46 br label %for.inc.4 for.inc.4: ; preds = %land.lhs.true.4, %for.inc.3 %.sink28 = phi i32 [ 46, %for.inc.3 ], [ %spec.select34, %land.lhs.true.4 ] %putchar19.4 = tail call i32 @putchar(i32 %.sink28) %10 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 %cmp4.5 = icmp eq i32 %10, 100 br i1 %cmp4.5, label %land.lhs.true.5, label %for.inc.5 land.lhs.true.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.5 = icmp eq i32 %11, 5 %spec.select35 = select i1 %cmp7.5, i32 81, i32 46 br label %for.inc.5 for.inc.5: ; preds = %land.lhs.true.5, %for.inc.4 %.sink29 = phi i32 [ 46, %for.inc.4 ], [ %spec.select35, %land.lhs.true.5 ] %putchar19.5 = tail call i32 @putchar(i32 %.sink29) %12 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 %cmp4.6 = icmp eq i32 %12, 100 br i1 %cmp4.6, label %land.lhs.true.6, label %for.inc.6 land.lhs.true.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.6 = icmp eq i32 %13, 6 %spec.select36 = select i1 %cmp7.6, i32 81, i32 46 br label %for.inc.6 for.inc.6: ; preds = %land.lhs.true.6, %for.inc.5 %.sink30 = phi i32 [ 46, %for.inc.5 ], [ %spec.select36, %land.lhs.true.6 ] %putchar19.6 = tail call i32 @putchar(i32 %.sink30) %14 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 %cmp4.7 = icmp eq i32 %14, 100 br i1 %cmp4.7, label %land.lhs.true.7, label %for.inc.7 land.lhs.true.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7.7 = icmp eq i32 %15, 7 %spec.select37 = select i1 %cmp7.7, i32 81, i32 46 br label %for.inc.7 for.inc.7: ; preds = %land.lhs.true.7, %for.inc.6 %.sink31 = phi i32 [ 46, %for.inc.6 ], [ %spec.select37, %land.lhs.true.7 ] %putchar19.7 = tail call i32 @putchar(i32 %.sink31) %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.end12, label %for.cond1.preheader, !llvm.loop !12 for.end12: ; preds = %for.inc.7 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #define N 8 #define M 15 int sum[N][N]; void xu(int); int num[N]; int tum[N]; int rum[M]; int hum[M]; void fan(){ int i, j; for(i=0;i<N;i++){ for(j=0;j<N;j++){ if(sum[i][j]){ if(num[i] != j) return; } } } for(i=0;i<N;i++){ for(j=0;j<N;j++){ if(num[i] == j) printf("Q"); else printf("."); } printf("\n"); } } int main(){ int n, i, j, a, b; for(i=0;i<N;i++)num[i] = tum[i] = 0; for(i=0;i<M;i++)rum[i] = hum[i] = 0; for(i=0;i<N;i++){ for(j=0;j<N;j++) sum[i][j] = 0; } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&a,&b); sum[a][b] = 1; } xu(0); return 0; } void xu(int i){ int j; if(i == N){ fan(); return; } for(j=0;j<N;j++){ if(tum[j] == -1 || rum[i + j] == -1 || hum[i - j + 7] == -1) continue; num[i] = j; tum[j] = rum[i + j] = hum[i - j + 7] = -1; xu(i+1); num[i] = tum[j] = rum[i+j] = hum[i - j + 7] = 0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232938/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232938/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @sum = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 @num = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @tum = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @hum = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @rum = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @fan() local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx7 = getelementptr inbounds [8 x i32], ptr @num, i64 0, i64 %indvars.iv %arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 0 %0 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not = icmp eq i32 %1, 0 br i1 %cmp8.not, label %for.inc, label %cleanup for.inc: ; preds = %for.cond1.preheader, %if.then %arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %2, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.1 = icmp eq i32 %3, 1 br i1 %cmp8.not.1, label %for.inc.1, label %cleanup for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 2 %4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %tobool.not.2 = icmp eq i32 %4, 0 br i1 %tobool.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.2 = icmp eq i32 %5, 2 br i1 %cmp8.not.2, label %for.inc.2, label %cleanup for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 3 %6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %tobool.not.3 = icmp eq i32 %6, 0 br i1 %tobool.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.3 = icmp eq i32 %7, 3 br i1 %cmp8.not.3, label %for.inc.3, label %cleanup for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %tobool.not.4 = icmp eq i32 %8, 0 br i1 %tobool.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.4 = icmp eq i32 %9, 4 br i1 %cmp8.not.4, label %for.inc.4, label %cleanup for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 5 %10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %tobool.not.5 = icmp eq i32 %10, 0 br i1 %tobool.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.5 = icmp eq i32 %11, 5 br i1 %cmp8.not.5, label %for.inc.5, label %cleanup for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 6 %12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5 %tobool.not.6 = icmp eq i32 %12, 0 br i1 %tobool.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.6 = icmp eq i32 %13, 6 br i1 %cmp8.not.6, label %for.inc.6, label %cleanup for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %indvars.iv, i64 7 %14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %tobool.not.7 = icmp eq i32 %14, 0 br i1 %tobool.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.7 = icmp eq i32 %15, 7 br i1 %cmp8.not.7, label %for.inc.7, label %cleanup for.inc.7: ; preds = %if.then.7, %for.inc.6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond17.preheader, label %for.cond1.preheader, !llvm.loop !9 for.cond17.preheader: ; preds = %for.inc.7, %for.cond17.preheader %indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.cond17.preheader ], [ 0, %for.inc.7 ] %arrayidx21 = getelementptr inbounds [8 x i32], ptr @num, i64 0, i64 %indvars.iv57 %16 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %16, 0 %. = select i1 %cmp22, i32 81, i32 46 %putchar47 = tail call i32 @putchar(i32 %.) %17 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.1 = icmp eq i32 %17, 1 %.sink62 = select i1 %cmp22.1, i32 81, i32 46 %putchar47.1 = tail call i32 @putchar(i32 %.sink62) %18 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.2 = icmp eq i32 %18, 2 %.sink63 = select i1 %cmp22.2, i32 81, i32 46 %putchar47.2 = tail call i32 @putchar(i32 %.sink63) %19 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.3 = icmp eq i32 %19, 3 %.sink64 = select i1 %cmp22.3, i32 81, i32 46 %putchar47.3 = tail call i32 @putchar(i32 %.sink64) %20 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.4 = icmp eq i32 %20, 4 %.sink65 = select i1 %cmp22.4, i32 81, i32 46 %putchar47.4 = tail call i32 @putchar(i32 %.sink65) %21 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.5 = icmp eq i32 %21, 5 %.sink66 = select i1 %cmp22.5, i32 81, i32 46 %putchar47.5 = tail call i32 @putchar(i32 %.sink66) %22 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.6 = icmp eq i32 %22, 6 %.sink67 = select i1 %cmp22.6, i32 81, i32 46 %putchar47.6 = tail call i32 @putchar(i32 %.sink67) %23 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.7 = icmp eq i32 %23, 7 %.sink68 = select i1 %cmp22.7, i32 81, i32 46 %putchar47.7 = tail call i32 @putchar(i32 %.sink68) %putchar = tail call i32 @putchar(i32 10) %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond60.not = icmp eq i64 %indvars.iv.next58, 8 br i1 %exitcond60.not, label %cleanup, label %for.cond17.preheader, !llvm.loop !11 cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond17.preheader ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = 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 %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @tum, i8 0, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @num, i8 0, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @hum, i8 0, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @rum, i8 0, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @sum, i8 0, i64 256, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp3058 = icmp sgt i32 %0, 0 br i1 %cmp3058, label %for.body31, label %for.end39 for.body31: ; preds = %entry, %for.body31 %i.359 = phi i32 [ %inc38, %for.body31 ], [ 0, %entry ] %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !5 %idxprom33 = sext i32 %1 to i64 %2 = load i32, ptr %b, align 4, !tbaa !5 %idxprom35 = sext i32 %2 to i64 %arrayidx36 = getelementptr inbounds [8 x [8 x i32]], ptr @sum, i64 0, i64 %idxprom33, i64 %idxprom35 store i32 1, ptr %arrayidx36, align 4, !tbaa !5 %inc38 = add nuw nsw i32 %i.359, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp30 = icmp slt i32 %inc38, %3 br i1 %cmp30, label %for.body31, label %for.end39, !llvm.loop !12 for.end39: ; preds = %for.body31, %entry call void @xu(i32 noundef 0) 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 %n) #5 ret i32 0 } ; 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 @xu(i32 noundef %i) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = add i32 %i, 7 %idxprom13 = sext i32 %i to i64 %arrayidx14 = getelementptr inbounds [8 x i32], ptr @num, i64 0, i64 %idxprom13 %add24 = add nsw i32 %i, 1 %0 = load i32, ptr @tum, align 16, !tbaa !5 %cmp2 = icmp eq i32 %0, -1 br i1 %cmp2, label %for.inc, label %lor.lhs.false if.then: ; preds = %entry tail call void @fan() br label %common.ret lor.lhs.false: ; preds = %for.cond.preheader %arrayidx4 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %idxprom13 %1 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %1, -1 br i1 %cmp5, label %for.inc, label %lor.lhs.false6 lor.lhs.false6: ; preds = %lor.lhs.false %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8 %2 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %2, -1 br i1 %cmp10, label %for.inc, label %if.end12 if.end12: ; preds = %lor.lhs.false6 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4, align 4, !tbaa !5 store i32 -1, ptr @tum, align 16, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9, align 4, !tbaa !5 store i32 0, ptr %arrayidx4, align 4, !tbaa !5 store i32 0, ptr @tum, align 16, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end12 %3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 1), align 4, !tbaa !5 %cmp2.1 = icmp eq i32 %3, -1 br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %for.inc %4 = add nsw i64 %idxprom13, 1 %arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %4 %5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %cmp5.1 = icmp eq i32 %5, -1 br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1 lor.lhs.false6.1: ; preds = %lor.lhs.false.1 %add7.1 = add i32 %i, 6 %idxprom8.1 = sext i32 %add7.1 to i64 %arrayidx9.1 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.1 %6 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %cmp10.1 = icmp eq i32 %6, -1 br i1 %cmp10.1, label %for.inc.1, label %if.end12.1 if.end12.1: ; preds = %lor.lhs.false6.1 store i32 1, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.1, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 1), align 4, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.1, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 1), align 4, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end12.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc %7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 2), align 8, !tbaa !5 %cmp2.2 = icmp eq i32 %7, -1 br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %for.inc.1 %8 = add nsw i64 %idxprom13, 2 %arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %8 %9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %cmp5.2 = icmp eq i32 %9, -1 br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2 lor.lhs.false6.2: ; preds = %lor.lhs.false.2 %add7.2 = add i32 %i, 5 %idxprom8.2 = sext i32 %add7.2 to i64 %arrayidx9.2 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.2 %10 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5 %cmp10.2 = icmp eq i32 %10, -1 br i1 %cmp10.2, label %for.inc.2, label %if.end12.2 if.end12.2: ; preds = %lor.lhs.false6.2 store i32 2, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.2, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 2), align 8, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.2, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 2), align 8, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end12.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1 %11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 3), align 4, !tbaa !5 %cmp2.3 = icmp eq i32 %11, -1 br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %for.inc.2 %12 = add nsw i64 %idxprom13, 3 %arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %12 %13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5 %cmp5.3 = icmp eq i32 %13, -1 br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3 lor.lhs.false6.3: ; preds = %lor.lhs.false.3 %add7.3 = add i32 %i, 4 %idxprom8.3 = sext i32 %add7.3 to i64 %arrayidx9.3 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.3 %14 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5 %cmp10.3 = icmp eq i32 %14, -1 br i1 %cmp10.3, label %for.inc.3, label %if.end12.3 if.end12.3: ; preds = %lor.lhs.false6.3 store i32 3, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.3, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 3), align 4, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.3, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 3), align 4, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.end12.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2 %15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 4), align 16, !tbaa !5 %cmp2.4 = icmp eq i32 %15, -1 br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %for.inc.3 %16 = add nsw i64 %idxprom13, 4 %arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %16 %17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5 %cmp5.4 = icmp eq i32 %17, -1 br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4 lor.lhs.false6.4: ; preds = %lor.lhs.false.4 %add7.4 = add i32 %i, 3 %idxprom8.4 = sext i32 %add7.4 to i64 %arrayidx9.4 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.4 %18 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5 %cmp10.4 = icmp eq i32 %18, -1 br i1 %cmp10.4, label %for.inc.4, label %if.end12.4 if.end12.4: ; preds = %lor.lhs.false6.4 store i32 4, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.4, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 4), align 16, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.4, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 4), align 16, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.end12.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3 %19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 5), align 4, !tbaa !5 %cmp2.5 = icmp eq i32 %19, -1 br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %for.inc.4 %20 = add nsw i64 %idxprom13, 5 %arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %20 %21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5 %cmp5.5 = icmp eq i32 %21, -1 br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5 lor.lhs.false6.5: ; preds = %lor.lhs.false.5 %add7.5 = add i32 %i, 2 %idxprom8.5 = sext i32 %add7.5 to i64 %arrayidx9.5 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.5 %22 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5 %cmp10.5 = icmp eq i32 %22, -1 br i1 %cmp10.5, label %for.inc.5, label %if.end12.5 if.end12.5: ; preds = %lor.lhs.false6.5 store i32 5, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.5, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 5), align 4, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.5, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 5), align 4, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.end12.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4 %23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 6), align 8, !tbaa !5 %cmp2.6 = icmp eq i32 %23, -1 br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %for.inc.5 %24 = add nsw i64 %idxprom13, 6 %arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %24 %25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5 %cmp5.6 = icmp eq i32 %25, -1 br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6 lor.lhs.false6.6: ; preds = %lor.lhs.false.6 %add7.6 = add i32 %i, 1 %idxprom8.6 = sext i32 %add7.6 to i64 %arrayidx9.6 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom8.6 %26 = load i32, ptr %arrayidx9.6, align 4, !tbaa !5 %cmp10.6 = icmp eq i32 %26, -1 br i1 %cmp10.6, label %for.inc.6, label %if.end12.6 if.end12.6: ; preds = %lor.lhs.false6.6 store i32 6, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.6, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 6), align 8, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.6, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 6), align 8, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.end12.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5 %27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 7), align 4, !tbaa !5 %cmp2.7 = icmp eq i32 %27, -1 br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %for.inc.6 %28 = add nsw i64 %idxprom13, 7 %arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @rum, i64 0, i64 %28 %29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5 %cmp5.7 = icmp eq i32 %29, -1 br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7 lor.lhs.false6.7: ; preds = %lor.lhs.false.7 %arrayidx9.7 = getelementptr inbounds [15 x i32], ptr @hum, i64 0, i64 %idxprom13 %30 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5 %cmp10.7 = icmp eq i32 %30, -1 br i1 %cmp10.7, label %common.ret, label %if.end12.7 common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end12.7 ret void if.end12.7: ; preds = %lor.lhs.false6.7 store i32 7, ptr %arrayidx14, align 4, !tbaa !5 store i32 -1, ptr %arrayidx9.7, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 7), align 4, !tbaa !5 tail call void @xu(i32 noundef %add24) store i32 0, ptr %arrayidx9.7, align 4, !tbaa !5 store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @tum, i64 0, i64 7), align 4, !tbaa !5 store i32 0, ptr %arrayidx14, align 4, !tbaa !5 br label %common.ret } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int X[N][N]; void initialize(); void printBoard(); void recursive(int i); int main(void) { int i,j,k; int r,c; initialize(); for(i=0;i<N;i++) { for(j=0;j<N;j++) { X[i][j]=0; } } scanf("%d",&k); for(i=0;i<k;i++) { scanf("%d%d",&r,&c); X[r][c]=1; } recursive(0); } void initialize() { int i; for(i=0;i<N;i++) { row[i]=FREE; col[i]=FREE; } for(i=0;i<2*N-1;i++) { dpos[i]=FREE; dneg[i]=FREE; } } void printBoard() { int i,j; for(i=0;i<N;i++) { for(j=0;j<N;j++) { if(X[i][j]) { if(row[i]!=j) { return; } } } } for(i=0;i<N;i++) { for(j=0;j<N;j++) { printf("%s",(row[i]==j)?"Q":"."); } putchar('\n'); } } void recursive(int i) { int j; if(i==N) { printBoard(); return; } for(j=0;j<N;j++) { if(NOT_FREE==col[j]||NOT_FREE==dpos[i+j]||NOT_FREE==dneg[i-j+N-1]) { continue; } row[i]=j; col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE; recursive(i+1); row[i]=col[j]=dpos[i+j]=dneg[i-j+N-1]=FREE; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233001/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @X = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"Q\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c".\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @X, i8 0, i64 256, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp1028 = icmp sgt i32 %0, 0 br i1 %cmp1028, label %for.body11, label %for.end19 for.body11: ; preds = %entry, %for.body11 %i.129 = phi i32 [ %inc18, %for.body11 ], [ 0, %entry ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c) %1 = load i32, ptr %r, align 4, !tbaa !5 %idxprom13 = sext i32 %1 to i64 %2 = load i32, ptr %c, align 4, !tbaa !5 %idxprom15 = sext i32 %2 to i64 %arrayidx16 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %idxprom13, i64 %idxprom15 store i32 1, ptr %arrayidx16, align 4, !tbaa !5 %inc18 = add nuw nsw i32 %i.129, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc18, %3 br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !9 for.end19: ; preds = %for.body11, %entry call void @recursive(i32 noundef 0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @recursive(i32 noundef %i) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub = add i32 %i, 7 %idxprom14 = sext i32 %i to i64 %arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14 %add26 = add nsw i32 %i, 1 %0 = load i32, ptr @col, align 16, !tbaa !5 %cmp2 = icmp eq i32 %0, 1 br i1 %cmp2, label %for.inc, label %lor.lhs.false if.then: ; preds = %entry tail call void @printBoard() br label %common.ret lor.lhs.false: ; preds = %for.cond.preheader %arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14 %1 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp eq i32 %1, 1 br i1 %cmp5, label %for.inc, label %lor.lhs.false6 lor.lhs.false6: ; preds = %lor.lhs.false %idxprom9 = sext i32 %sub to i64 %arrayidx10 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %2, 1 br i1 %cmp11, label %for.inc, label %if.end13 if.end13: ; preds = %lor.lhs.false6 store i32 0, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 store i32 1, ptr %arrayidx4, align 4, !tbaa !5 store i32 1, ptr @col, align 16, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4, align 4, !tbaa !5 store i32 -1, ptr @col, align 16, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13 %3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 %cmp2.1 = icmp eq i32 %3, 1 br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %for.inc %4 = add nsw i64 %idxprom14, 1 %arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4 %5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %cmp5.1 = icmp eq i32 %5, 1 br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1 lor.lhs.false6.1: ; preds = %lor.lhs.false.1 %sub8.1 = add i32 %i, 6 %idxprom9.1 = sext i32 %sub8.1 to i64 %arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.1 %6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %cmp11.1 = icmp eq i32 %6, 1 br i1 %cmp11.1, label %for.inc.1, label %if.end13.1 if.end13.1: ; preds = %lor.lhs.false6.1 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.1, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc %7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 %cmp2.2 = icmp eq i32 %7, 1 br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %for.inc.1 %8 = add nsw i64 %idxprom14, 2 %arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8 %9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %cmp5.2 = icmp eq i32 %9, 1 br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2 lor.lhs.false6.2: ; preds = %lor.lhs.false.2 %sub8.2 = add i32 %i, 5 %idxprom9.2 = sext i32 %sub8.2 to i64 %arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.2 %10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %cmp11.2 = icmp eq i32 %10, 1 br i1 %cmp11.2, label %for.inc.2, label %if.end13.2 if.end13.2: ; preds = %lor.lhs.false6.2 store i32 2, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.2, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1 %11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 %cmp2.3 = icmp eq i32 %11, 1 br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %for.inc.2 %12 = add nsw i64 %idxprom14, 3 %arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12 %13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5 %cmp5.3 = icmp eq i32 %13, 1 br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3 lor.lhs.false6.3: ; preds = %lor.lhs.false.3 %sub8.3 = add i32 %i, 4 %idxprom9.3 = sext i32 %sub8.3 to i64 %arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.3 %14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %cmp11.3 = icmp eq i32 %14, 1 br i1 %cmp11.3, label %for.inc.3, label %if.end13.3 if.end13.3: ; preds = %lor.lhs.false6.3 store i32 3, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.3, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2 %15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 %cmp2.4 = icmp eq i32 %15, 1 br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %for.inc.3 %16 = add nsw i64 %idxprom14, 4 %arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16 %17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5 %cmp5.4 = icmp eq i32 %17, 1 br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4 lor.lhs.false6.4: ; preds = %lor.lhs.false.4 %sub8.4 = add i32 %i, 3 %idxprom9.4 = sext i32 %sub8.4 to i64 %arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.4 %18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5 %cmp11.4 = icmp eq i32 %18, 1 br i1 %cmp11.4, label %for.inc.4, label %if.end13.4 if.end13.4: ; preds = %lor.lhs.false6.4 store i32 4, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.4, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3 %19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 %cmp2.5 = icmp eq i32 %19, 1 br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %for.inc.4 %20 = add nsw i64 %idxprom14, 5 %arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20 %21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5 %cmp5.5 = icmp eq i32 %21, 1 br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5 lor.lhs.false6.5: ; preds = %lor.lhs.false.5 %sub8.5 = add i32 %i, 2 %idxprom9.5 = sext i32 %sub8.5 to i64 %arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.5 %22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5 %cmp11.5 = icmp eq i32 %22, 1 br i1 %cmp11.5, label %for.inc.5, label %if.end13.5 if.end13.5: ; preds = %lor.lhs.false6.5 store i32 5, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.5, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4 %23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 %cmp2.6 = icmp eq i32 %23, 1 br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %for.inc.5 %24 = add nsw i64 %idxprom14, 6 %arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24 %25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5 %cmp5.6 = icmp eq i32 %25, 1 br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6 lor.lhs.false6.6: ; preds = %lor.lhs.false.6 %sub8.6 = add i32 %i, 1 %idxprom9.6 = sext i32 %sub8.6 to i64 %arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.6 %26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5 %cmp11.6 = icmp eq i32 %26, 1 br i1 %cmp11.6, label %for.inc.6, label %if.end13.6 if.end13.6: ; preds = %lor.lhs.false6.6 store i32 6, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.6, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5 %27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 %cmp2.7 = icmp eq i32 %27, 1 br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %for.inc.6 %28 = add nsw i64 %idxprom14, 7 %arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28 %29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5 %cmp5.7 = icmp eq i32 %29, 1 br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7 lor.lhs.false6.7: ; preds = %lor.lhs.false.7 %arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom14 %30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5 %cmp11.7 = icmp eq i32 %30, 1 br i1 %cmp11.7, label %common.ret, label %if.end13.7 common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7 ret void if.end13.7: ; preds = %lor.lhs.false6.7 store i32 7, ptr %arrayidx15, align 4, !tbaa !5 store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 tail call void @recursive(i32 noundef %add26) store i32 -1, ptr %arrayidx10.7, align 4, !tbaa !5 store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5 store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 br label %common.ret } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @initialize() local_unnamed_addr #3 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printBoard() local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc.7 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ] %arrayidx7 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv %arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 0 %0 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.cond1.preheader %1 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not = icmp eq i32 %1, 0 br i1 %cmp8.not, label %for.inc, label %cleanup for.inc: ; preds = %for.cond1.preheader, %if.then %arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %2, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.1 = icmp eq i32 %3, 1 br i1 %cmp8.not.1, label %for.inc.1, label %cleanup for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 2 %4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %tobool.not.2 = icmp eq i32 %4, 0 br i1 %tobool.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.2 = icmp eq i32 %5, 2 br i1 %cmp8.not.2, label %for.inc.2, label %cleanup for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 3 %6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %tobool.not.3 = icmp eq i32 %6, 0 br i1 %tobool.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.3 = icmp eq i32 %7, 3 br i1 %cmp8.not.3, label %for.inc.3, label %cleanup for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 4 %8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5 %tobool.not.4 = icmp eq i32 %8, 0 br i1 %tobool.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 %9 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.4 = icmp eq i32 %9, 4 br i1 %cmp8.not.4, label %for.inc.4, label %cleanup for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 5 %10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %tobool.not.5 = icmp eq i32 %10, 0 br i1 %tobool.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %11 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.5 = icmp eq i32 %11, 5 br i1 %cmp8.not.5, label %for.inc.5, label %cleanup for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 6 %12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5 %tobool.not.6 = icmp eq i32 %12, 0 br i1 %tobool.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 %13 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.6 = icmp eq i32 %13, 6 br i1 %cmp8.not.6, label %for.inc.6, label %cleanup for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 7 %14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %tobool.not.7 = icmp eq i32 %14, 0 br i1 %tobool.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 %15 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not.7 = icmp eq i32 %15, 7 br i1 %cmp8.not.7, label %for.inc.7, label %cleanup for.inc.7: ; preds = %if.then.7, %for.inc.6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond17.preheader, label %for.cond1.preheader, !llvm.loop !11 for.cond17.preheader: ; preds = %for.inc.7, %for.cond17.preheader %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.cond17.preheader ], [ 0, %for.inc.7 ] %arrayidx21 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv52 %16 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %16, 0 %cond = select i1 %cmp22, ptr @.str.3, ptr @.str.4 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond) %17 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.1 = icmp eq i32 %17, 1 %cond.1 = select i1 %cmp22.1, ptr @.str.3, ptr @.str.4 %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.1) %18 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.2 = icmp eq i32 %18, 2 %cond.2 = select i1 %cmp22.2, ptr @.str.3, ptr @.str.4 %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.2) %19 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.3 = icmp eq i32 %19, 3 %cond.3 = select i1 %cmp22.3, ptr @.str.3, ptr @.str.4 %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.3) %20 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.4 = icmp eq i32 %20, 4 %cond.4 = select i1 %cmp22.4, ptr @.str.3, ptr @.str.4 %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.4) %21 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.5 = icmp eq i32 %21, 5 %cond.5 = select i1 %cmp22.5, ptr @.str.3, ptr @.str.4 %call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.5) %22 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.6 = icmp eq i32 %22, 6 %cond.6 = select i1 %cmp22.6, ptr @.str.3, ptr @.str.4 %call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.6) %23 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22.7 = icmp eq i32 %23, 7 %cond.7 = select i1 %cmp22.7, ptr @.str.3, ptr @.str.4 %call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %cond.7) %24 = load ptr, ptr @stdout, align 8, !tbaa !12 %call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %24) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next53, 8 br i1 %exitcond55.not, label %cleanup, label %for.cond17.preheader, !llvm.loop !14 cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond17.preheader ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !10}
#include <stdio.h> int main() { int n,k,p,s=0,d; scanf("%d %d",&n,&k); while(n--) { scanf("%d",&d); if(d%k!=0) p=(d/k)+1; else p=d/k; s+=p; } if(s%2==0) printf("%d",s/2); else printf("%d",(s/2)+1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23306/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23306/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #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 %dec17 = add nsw i32 %0, -1 store i32 %dec17, ptr %n, align 4, !tbaa !5 %tobool.not18 = icmp eq i32 %0, 0 br i1 %tobool.not18, label %if.then6, label %while.body while.body: ; preds = %entry, %while.body %s.019 = phi i32 [ %add3, %while.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %d) %1 = load i32, ptr %d, align 4, !tbaa !5 %2 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %1, %2 %cmp.not = icmp ne i32 %rem, 0 %div2 = sdiv i32 %1, %2 %add = zext i1 %cmp.not to i32 %p.0 = add nsw i32 %div2, %add %add3 = add nsw i32 %p.0, %s.019 %3 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body %4 = and i32 %add3, 1 %cmp5 = icmp eq i32 %4, 0 br i1 %cmp5, label %if.then6, label %if.else9 if.then6: ; preds = %entry, %while.end %s.0.lcssa22 = phi i32 [ %add3, %while.end ], [ 0, %entry ] %div7 = sdiv i32 %s.0.lcssa22, 2 br label %if.end13 if.else9: ; preds = %while.end %div10 = sdiv i32 %add3, 2 %add11 = add nsw i32 %div10, 1 br label %if.end13 if.end13: ; preds = %if.else9, %if.then6 %add11.sink = phi i32 [ %add11, %if.else9 ], [ %div7, %if.then6 ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add11.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define N 8 #define nf -1 #define f 10 int putQueen(int,int [N],int [N+N-1],int [N+N-1],int[N]); void printBoard(int[N]); char ban[N][N]; int rr[N]; int main(){ int k; int i,r,c,j; int dpos[N+N-1]; int dneg[N+N-1]; int col[N]; int row[N]; scanf("%d",&k); for(i=0;i<N;i++){ row[i] = f; rr[i] = f; for(j=0;j<N;j++){ dpos[i+j] = f; dneg[i-j + N-1] = f; col[j] = f; } } for(i=0;i<k;i++){ scanf("%d%d",&r,&c); row[r] = c; rr[r] = r; dpos[r+c] = nf; dneg[r-c + N-1] = nf; col[c] = nf; } putQueen(0,col,dpos,dneg,row); return 0; } int putQueen(int i,int col[N],int dpos[N+N-1],int dneg[N+N-1],int row[N]){ int j; if(i==N){ printBoard(row); return 0; } if(rr[i] == i){ putQueen(i+1,col,dpos,dneg,row); } for(j=0; j<N; j++){ if(rr[i] == i){ break; } if(col[j] == nf || dpos[i+j] == nf || dneg[i-j+N-1] == nf){ continue; } row[i] = j; col[j] = dpos[i+j]= dneg[i-j+N-1] = nf; putQueen(i+1,col,dpos,dneg,row); col[j] = dpos[i+j] = dneg[i-j+N-1] = f; } } void printBoard(int row[N]){ int i,j; for(i=0;i<N;i++){ for(j=0;j<N;j++){ if(row[i] == j){ ban[i][j] = 'Q'; } else ban[i][j] = '.'; } } for(i=0;i<N;i++){ for(j=0;j<N;j++){ printf("%c",ban[i][j]); } printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233160/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @rr = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @ban = dso_local local_unnamed_addr global [8 x [8 x i8]] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 %c = alloca i32, align 4 %dpos = alloca [15 x i32], align 16 %dneg = alloca [15 x i32], align 16 %col = alloca [8 x i32], align 16 %row = alloca [8 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %dpos) #4 call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %dneg) #4 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %col) #4 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %row) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %arrayidx11.3 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 4 %arrayidx7.4 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 4 %arrayidx13.4 = getelementptr inbounds [8 x i32], ptr %col, i64 0, i64 4 %arrayidx11.163 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 8 %arrayidx7.7.1 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 8 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %row, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr @rr, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %dpos, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %dneg, align 16, !tbaa !5 %arrayidx.4 = getelementptr inbounds [8 x i32], ptr %row, i64 0, i64 4 %arrayidx11.571 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 12 %arrayidx7.7.5 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 12 %arrayidx11.673 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 13 %arrayidx7.7.6 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 13 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx.4, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr getelementptr inbounds ([8 x i32], ptr @rr, i64 0, i64 4), align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx7.4, align 16, !tbaa !5 %arrayidx11.775 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 14 store i32 10, ptr %arrayidx11.775, align 8, !tbaa !5 store i32 10, ptr %arrayidx11.673, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.571, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %col, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx7.7.1, align 16, !tbaa !5 store i32 10, ptr %arrayidx7.7.5, align 16, !tbaa !5 store i32 10, ptr %arrayidx7.7.6, align 4, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx11.163, align 16, !tbaa !5 %arrayidx7.7.7 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 14 store i32 10, ptr %arrayidx7.7.7, align 8, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx11.3, align 16, !tbaa !5 store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, ptr %arrayidx13.4, align 16, !tbaa !5 %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp1855 = icmp sgt i32 %0, 0 br i1 %cmp1855, label %for.body19, label %for.end37 for.body19: ; preds = %entry, %for.body19 %i.156 = phi i32 [ %inc36, %for.body19 ], [ 0, %entry ] %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c) %1 = load i32, ptr %c, align 4, !tbaa !5 %2 = load i32, ptr %r, align 4, !tbaa !5 %idxprom21 = sext i32 %2 to i64 %arrayidx22 = getelementptr inbounds [8 x i32], ptr %row, i64 0, i64 %idxprom21 store i32 %1, ptr %arrayidx22, align 4, !tbaa !5 %arrayidx24 = getelementptr inbounds [8 x i32], ptr @rr, i64 0, i64 %idxprom21 store i32 %2, ptr %arrayidx24, align 4, !tbaa !5 %add25 = add nsw i32 %2, %1 %idxprom26 = sext i32 %add25 to i64 %arrayidx27 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 %idxprom26 store i32 -1, ptr %arrayidx27, align 4, !tbaa !5 %reass.sub = sub i32 %2, %1 %sub30 = add i32 %reass.sub, 7 %idxprom31 = sext i32 %sub30 to i64 %arrayidx32 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 %idxprom31 store i32 -1, ptr %arrayidx32, align 4, !tbaa !5 %idxprom33 = sext i32 %1 to i64 %arrayidx34 = getelementptr inbounds [8 x i32], ptr %col, i64 0, i64 %idxprom33 store i32 -1, ptr %arrayidx34, align 4, !tbaa !5 %inc36 = add nuw nsw i32 %i.156, 1 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp18 = icmp slt i32 %inc36, %3 br i1 %cmp18, label %for.body19, label %for.end37, !llvm.loop !9 for.end37: ; preds = %for.body19, %entry %call41 = call i32 @putQueen(i32 noundef 0, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef nonnull %row) call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %row) #4 call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %col) #4 call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %dneg) #4 call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %dpos) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 i32 @putQueen(i32 noundef %i, ptr noundef %col, ptr noundef %dpos, ptr noundef %dneg, ptr noundef %row) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %i, 8 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry tail call void @printBoard(ptr noundef %row) br label %common.ret if.end: ; preds = %entry %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [8 x i32], ptr @rr, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, %i %add = add nsw i32 %i, 1 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end %call = tail call i32 @putQueen(i32 noundef %add, ptr noundef %col, ptr noundef %dpos, ptr noundef %dneg, ptr noundef %row) %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.end, %if.then2 %1 = phi i32 [ %.pre, %if.then2 ], [ %0, %if.end ] %sub = add i32 %i, 7 %arrayidx26 = getelementptr inbounds i32, ptr %row, i64 %idxprom %cmp7 = icmp eq i32 %1, %i br i1 %cmp7, label %common.ret, label %if.end9 if.end9: ; preds = %if.end3 %2 = load i32, ptr %col, align 4, !tbaa !5 %cmp12 = icmp eq i32 %2, -1 br i1 %cmp12, label %for.inc, label %lor.lhs.false lor.lhs.false: ; preds = %if.end9 %arrayidx15 = getelementptr inbounds i32, ptr %dpos, i64 %idxprom %3 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp eq i32 %3, -1 br i1 %cmp16, label %for.inc, label %lor.lhs.false17 lor.lhs.false17: ; preds = %lor.lhs.false %idxprom20 = sext i32 %sub to i64 %arrayidx21 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20 %4 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp eq i32 %4, -1 br i1 %cmp22, label %for.inc, label %if.end24 if.end24: ; preds = %lor.lhs.false17 store i32 0, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15, align 4, !tbaa !5 store i32 -1, ptr %col, align 4, !tbaa !5 %call38 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21, align 4, !tbaa !5 store i32 10, ptr %arrayidx15, align 4, !tbaa !5 store i32 10, ptr %col, align 4, !tbaa !5 %.pre91 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end9, %lor.lhs.false, %lor.lhs.false17, %if.end24 %5 = phi i32 [ %1, %if.end9 ], [ %1, %lor.lhs.false ], [ %1, %lor.lhs.false17 ], [ %.pre91, %if.end24 ] %cmp7.1 = icmp eq i32 %5, %i br i1 %cmp7.1, label %common.ret, label %if.end9.1 if.end9.1: ; preds = %for.inc %arrayidx11.1 = getelementptr inbounds i32, ptr %col, i64 1 %6 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %cmp12.1 = icmp eq i32 %6, -1 br i1 %cmp12.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %if.end9.1 %7 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.1 = getelementptr i32, ptr %7, i64 1 %8 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %cmp16.1 = icmp eq i32 %8, -1 br i1 %cmp16.1, label %for.inc.1, label %lor.lhs.false17.1 lor.lhs.false17.1: ; preds = %lor.lhs.false.1 %sub19.1 = add i32 %i, 6 %idxprom20.1 = sext i32 %sub19.1 to i64 %arrayidx21.1 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.1 %9 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5 %cmp22.1 = icmp eq i32 %9, -1 br i1 %cmp22.1, label %for.inc.1, label %if.end24.1 if.end24.1: ; preds = %lor.lhs.false17.1 store i32 1, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.1, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.1, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.1, align 4, !tbaa !5 %call38.1 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.1, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.1, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.1, align 4, !tbaa !5 %.pre92 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end24.1, %lor.lhs.false17.1, %lor.lhs.false.1, %if.end9.1 %10 = phi i32 [ %.pre92, %if.end24.1 ], [ %5, %lor.lhs.false17.1 ], [ %5, %lor.lhs.false.1 ], [ %5, %if.end9.1 ] %cmp7.2 = icmp eq i32 %10, %i br i1 %cmp7.2, label %common.ret, label %if.end9.2 if.end9.2: ; preds = %for.inc.1 %arrayidx11.2 = getelementptr inbounds i32, ptr %col, i64 2 %11 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5 %cmp12.2 = icmp eq i32 %11, -1 br i1 %cmp12.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %if.end9.2 %12 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.2 = getelementptr i32, ptr %12, i64 2 %13 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5 %cmp16.2 = icmp eq i32 %13, -1 br i1 %cmp16.2, label %for.inc.2, label %lor.lhs.false17.2 lor.lhs.false17.2: ; preds = %lor.lhs.false.2 %sub19.2 = add i32 %i, 5 %idxprom20.2 = sext i32 %sub19.2 to i64 %arrayidx21.2 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.2 %14 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5 %cmp22.2 = icmp eq i32 %14, -1 br i1 %cmp22.2, label %for.inc.2, label %if.end24.2 if.end24.2: ; preds = %lor.lhs.false17.2 store i32 2, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.2, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.2, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.2, align 4, !tbaa !5 %call38.2 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.2, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.2, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.2, align 4, !tbaa !5 %.pre93 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end24.2, %lor.lhs.false17.2, %lor.lhs.false.2, %if.end9.2 %15 = phi i32 [ %.pre93, %if.end24.2 ], [ %10, %lor.lhs.false17.2 ], [ %10, %lor.lhs.false.2 ], [ %10, %if.end9.2 ] %cmp7.3 = icmp eq i32 %15, %i br i1 %cmp7.3, label %common.ret, label %if.end9.3 if.end9.3: ; preds = %for.inc.2 %arrayidx11.3 = getelementptr inbounds i32, ptr %col, i64 3 %16 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5 %cmp12.3 = icmp eq i32 %16, -1 br i1 %cmp12.3, label %for.inc.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %if.end9.3 %17 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.3 = getelementptr i32, ptr %17, i64 3 %18 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5 %cmp16.3 = icmp eq i32 %18, -1 br i1 %cmp16.3, label %for.inc.3, label %lor.lhs.false17.3 lor.lhs.false17.3: ; preds = %lor.lhs.false.3 %sub19.3 = add i32 %i, 4 %idxprom20.3 = sext i32 %sub19.3 to i64 %arrayidx21.3 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.3 %19 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5 %cmp22.3 = icmp eq i32 %19, -1 br i1 %cmp22.3, label %for.inc.3, label %if.end24.3 if.end24.3: ; preds = %lor.lhs.false17.3 store i32 3, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.3, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.3, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.3, align 4, !tbaa !5 %call38.3 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.3, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.3, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.3, align 4, !tbaa !5 %.pre94 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.end24.3, %lor.lhs.false17.3, %lor.lhs.false.3, %if.end9.3 %20 = phi i32 [ %.pre94, %if.end24.3 ], [ %15, %lor.lhs.false17.3 ], [ %15, %lor.lhs.false.3 ], [ %15, %if.end9.3 ] %cmp7.4 = icmp eq i32 %20, %i br i1 %cmp7.4, label %common.ret, label %if.end9.4 if.end9.4: ; preds = %for.inc.3 %arrayidx11.4 = getelementptr inbounds i32, ptr %col, i64 4 %21 = load i32, ptr %arrayidx11.4, align 4, !tbaa !5 %cmp12.4 = icmp eq i32 %21, -1 br i1 %cmp12.4, label %for.inc.4, label %lor.lhs.false.4 lor.lhs.false.4: ; preds = %if.end9.4 %22 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.4 = getelementptr i32, ptr %22, i64 4 %23 = load i32, ptr %arrayidx15.4, align 4, !tbaa !5 %cmp16.4 = icmp eq i32 %23, -1 br i1 %cmp16.4, label %for.inc.4, label %lor.lhs.false17.4 lor.lhs.false17.4: ; preds = %lor.lhs.false.4 %sub19.4 = add i32 %i, 3 %idxprom20.4 = sext i32 %sub19.4 to i64 %arrayidx21.4 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.4 %24 = load i32, ptr %arrayidx21.4, align 4, !tbaa !5 %cmp22.4 = icmp eq i32 %24, -1 br i1 %cmp22.4, label %for.inc.4, label %if.end24.4 if.end24.4: ; preds = %lor.lhs.false17.4 store i32 4, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.4, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.4, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.4, align 4, !tbaa !5 %call38.4 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.4, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.4, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.4, align 4, !tbaa !5 %.pre95 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.end24.4, %lor.lhs.false17.4, %lor.lhs.false.4, %if.end9.4 %25 = phi i32 [ %.pre95, %if.end24.4 ], [ %20, %lor.lhs.false17.4 ], [ %20, %lor.lhs.false.4 ], [ %20, %if.end9.4 ] %cmp7.5 = icmp eq i32 %25, %i br i1 %cmp7.5, label %common.ret, label %if.end9.5 if.end9.5: ; preds = %for.inc.4 %arrayidx11.5 = getelementptr inbounds i32, ptr %col, i64 5 %26 = load i32, ptr %arrayidx11.5, align 4, !tbaa !5 %cmp12.5 = icmp eq i32 %26, -1 br i1 %cmp12.5, label %for.inc.5, label %lor.lhs.false.5 lor.lhs.false.5: ; preds = %if.end9.5 %27 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.5 = getelementptr i32, ptr %27, i64 5 %28 = load i32, ptr %arrayidx15.5, align 4, !tbaa !5 %cmp16.5 = icmp eq i32 %28, -1 br i1 %cmp16.5, label %for.inc.5, label %lor.lhs.false17.5 lor.lhs.false17.5: ; preds = %lor.lhs.false.5 %sub19.5 = add i32 %i, 2 %idxprom20.5 = sext i32 %sub19.5 to i64 %arrayidx21.5 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.5 %29 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5 %cmp22.5 = icmp eq i32 %29, -1 br i1 %cmp22.5, label %for.inc.5, label %if.end24.5 if.end24.5: ; preds = %lor.lhs.false17.5 store i32 5, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.5, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.5, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.5, align 4, !tbaa !5 %call38.5 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.5, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.5, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.5, align 4, !tbaa !5 %.pre96 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.end24.5, %lor.lhs.false17.5, %lor.lhs.false.5, %if.end9.5 %30 = phi i32 [ %.pre96, %if.end24.5 ], [ %25, %lor.lhs.false17.5 ], [ %25, %lor.lhs.false.5 ], [ %25, %if.end9.5 ] %cmp7.6 = icmp eq i32 %30, %i br i1 %cmp7.6, label %common.ret, label %if.end9.6 if.end9.6: ; preds = %for.inc.5 %arrayidx11.6 = getelementptr inbounds i32, ptr %col, i64 6 %31 = load i32, ptr %arrayidx11.6, align 4, !tbaa !5 %cmp12.6 = icmp eq i32 %31, -1 br i1 %cmp12.6, label %for.inc.6, label %lor.lhs.false.6 lor.lhs.false.6: ; preds = %if.end9.6 %32 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.6 = getelementptr i32, ptr %32, i64 6 %33 = load i32, ptr %arrayidx15.6, align 4, !tbaa !5 %cmp16.6 = icmp eq i32 %33, -1 br i1 %cmp16.6, label %for.inc.6, label %lor.lhs.false17.6 lor.lhs.false17.6: ; preds = %lor.lhs.false.6 %sub19.6 = add i32 %i, 1 %idxprom20.6 = sext i32 %sub19.6 to i64 %arrayidx21.6 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.6 %34 = load i32, ptr %arrayidx21.6, align 4, !tbaa !5 %cmp22.6 = icmp eq i32 %34, -1 br i1 %cmp22.6, label %for.inc.6, label %if.end24.6 if.end24.6: ; preds = %lor.lhs.false17.6 store i32 6, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.6, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.6, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.6, align 4, !tbaa !5 %call38.6 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.6, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.6, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.6, align 4, !tbaa !5 %.pre97 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc.6 for.inc.6: ; preds = %if.end24.6, %lor.lhs.false17.6, %lor.lhs.false.6, %if.end9.6 %35 = phi i32 [ %.pre97, %if.end24.6 ], [ %30, %lor.lhs.false17.6 ], [ %30, %lor.lhs.false.6 ], [ %30, %if.end9.6 ] %cmp7.7 = icmp eq i32 %35, %i br i1 %cmp7.7, label %common.ret, label %if.end9.7 if.end9.7: ; preds = %for.inc.6 %arrayidx11.7 = getelementptr inbounds i32, ptr %col, i64 7 %36 = load i32, ptr %arrayidx11.7, align 4, !tbaa !5 %cmp12.7 = icmp eq i32 %36, -1 br i1 %cmp12.7, label %common.ret, label %lor.lhs.false.7 lor.lhs.false.7: ; preds = %if.end9.7 %37 = getelementptr i32, ptr %dpos, i64 %idxprom %arrayidx15.7 = getelementptr i32, ptr %37, i64 7 %38 = load i32, ptr %arrayidx15.7, align 4, !tbaa !5 %cmp16.7 = icmp eq i32 %38, -1 br i1 %cmp16.7, label %common.ret, label %lor.lhs.false17.7 lor.lhs.false17.7: ; preds = %lor.lhs.false.7 %arrayidx21.7 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom %39 = load i32, ptr %arrayidx21.7, align 4, !tbaa !5 %cmp22.7 = icmp eq i32 %39, -1 br i1 %cmp22.7, label %common.ret, label %if.end24.7 common.ret: ; preds = %if.then, %if.end9.7, %lor.lhs.false.7, %lor.lhs.false17.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %if.end3, %if.end24.7 %common.ret.op = phi i32 [ 0, %if.end24.7 ], [ 0, %if.end3 ], [ 0, %for.inc ], [ 0, %for.inc.1 ], [ 0, %for.inc.2 ], [ 0, %for.inc.3 ], [ 0, %for.inc.4 ], [ 0, %for.inc.5 ], [ 0, %for.inc.6 ], [ 0, %lor.lhs.false17.7 ], [ 0, %lor.lhs.false.7 ], [ 0, %if.end9.7 ], [ 0, %if.then ] ret i32 %common.ret.op if.end24.7: ; preds = %lor.lhs.false17.7 store i32 7, ptr %arrayidx26, align 4, !tbaa !5 store i32 -1, ptr %arrayidx21.7, align 4, !tbaa !5 store i32 -1, ptr %arrayidx15.7, align 4, !tbaa !5 store i32 -1, ptr %arrayidx11.7, align 4, !tbaa !5 %call38.7 = tail call i32 @putQueen(i32 noundef %add, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg, ptr noundef %row) store i32 10, ptr %arrayidx21.7, align 4, !tbaa !5 store i32 10, ptr %arrayidx15.7, align 4, !tbaa !5 store i32 10, ptr %arrayidx11.7, align 4, !tbaa !5 br label %common.ret } ; 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 @printBoard(ptr nocapture noundef readonly %row) local_unnamed_addr #0 { entry: br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.preheader %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond1.preheader ] %arrayidx = getelementptr inbounds i32, ptr %row, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp eq i32 %0, 0 %spec.select = select i1 %cmp4, i8 81, i8 46 %1 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 0 store i8 %spec.select, ptr %1, align 8 %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.1 = icmp eq i32 %2, 1 %.sink83 = select i1 %cmp4.1, i8 81, i8 46 %3 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 1 store i8 %.sink83, ptr %3, align 1 %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.2 = icmp eq i32 %4, 2 %.sink84 = select i1 %cmp4.2, i8 81, i8 46 %5 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 2 store i8 %.sink84, ptr %5, align 2 %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.3 = icmp eq i32 %6, 3 %.sink85 = select i1 %cmp4.3, i8 81, i8 46 %7 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 3 store i8 %.sink85, ptr %7, align 1 %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.4 = icmp eq i32 %8, 4 %.sink86 = select i1 %cmp4.4, i8 81, i8 46 %9 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 4 store i8 %.sink86, ptr %9, align 4 %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.5 = icmp eq i32 %10, 5 %.sink87 = select i1 %cmp4.5, i8 81, i8 46 %11 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 5 store i8 %.sink87, ptr %11, align 1 %12 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.6 = icmp eq i32 %12, 6 %.sink88 = select i1 %cmp4.6, i8 81, i8 46 %13 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 6 store i8 %.sink88, ptr %13, align 2 %14 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4.7 = icmp eq i32 %14, 7 %.sink89 = select i1 %cmp4.7, i8 81, i8 46 %15 = getelementptr inbounds [8 x [8 x i8]], ptr @ban, i64 0, i64 %indvars.iv, i64 7 store i8 %.sink89, ptr %15, align 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 8 br i1 %exitcond.not, label %for.cond19.preheader.preheader, label %for.cond1.preheader, !llvm.loop !11 for.cond19.preheader.preheader: ; preds = %for.cond1.preheader %16 = load i8, ptr @ban, align 16, !tbaa !12 %conv = sext i8 %16 to i32 %putchar47 = tail call i32 @putchar(i32 %conv) %17 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 1), align 1, !tbaa !12 %conv.1 = sext i8 %17 to i32 %putchar47.1 = tail call i32 @putchar(i32 %conv.1) %18 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 2), align 2, !tbaa !12 %conv.2 = sext i8 %18 to i32 %putchar47.2 = tail call i32 @putchar(i32 %conv.2) %19 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 3), align 1, !tbaa !12 %conv.3 = sext i8 %19 to i32 %putchar47.3 = tail call i32 @putchar(i32 %conv.3) %20 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 4), align 4, !tbaa !12 %conv.4 = sext i8 %20 to i32 %putchar47.4 = tail call i32 @putchar(i32 %conv.4) %21 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 5), align 1, !tbaa !12 %conv.5 = sext i8 %21 to i32 %putchar47.5 = tail call i32 @putchar(i32 %conv.5) %22 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 6), align 2, !tbaa !12 %conv.6 = sext i8 %22 to i32 %putchar47.6 = tail call i32 @putchar(i32 %conv.6) %23 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 0, i64 7), align 1, !tbaa !12 %conv.7 = sext i8 %23 to i32 %putchar47.7 = tail call i32 @putchar(i32 %conv.7) %putchar = tail call i32 @putchar(i32 10) %24 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 0), align 8, !tbaa !12 %conv.163 = sext i8 %24 to i32 %putchar47.164 = tail call i32 @putchar(i32 %conv.163) %25 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 1), align 1, !tbaa !12 %conv.1.1 = sext i8 %25 to i32 %putchar47.1.1 = tail call i32 @putchar(i32 %conv.1.1) %26 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 2), align 2, !tbaa !12 %conv.2.1 = sext i8 %26 to i32 %putchar47.2.1 = tail call i32 @putchar(i32 %conv.2.1) %27 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 3), align 1, !tbaa !12 %conv.3.1 = sext i8 %27 to i32 %putchar47.3.1 = tail call i32 @putchar(i32 %conv.3.1) %28 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 4), align 4, !tbaa !12 %conv.4.1 = sext i8 %28 to i32 %putchar47.4.1 = tail call i32 @putchar(i32 %conv.4.1) %29 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 5), align 1, !tbaa !12 %conv.5.1 = sext i8 %29 to i32 %putchar47.5.1 = tail call i32 @putchar(i32 %conv.5.1) %30 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 6), align 2, !tbaa !12 %conv.6.1 = sext i8 %30 to i32 %putchar47.6.1 = tail call i32 @putchar(i32 %conv.6.1) %31 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 1, i64 7), align 1, !tbaa !12 %conv.7.1 = sext i8 %31 to i32 %putchar47.7.1 = tail call i32 @putchar(i32 %conv.7.1) %putchar.1 = tail call i32 @putchar(i32 10) %32 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 0), align 16, !tbaa !12 %conv.266 = sext i8 %32 to i32 %putchar47.267 = tail call i32 @putchar(i32 %conv.266) %33 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 1), align 1, !tbaa !12 %conv.1.2 = sext i8 %33 to i32 %putchar47.1.2 = tail call i32 @putchar(i32 %conv.1.2) %34 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 2), align 2, !tbaa !12 %conv.2.2 = sext i8 %34 to i32 %putchar47.2.2 = tail call i32 @putchar(i32 %conv.2.2) %35 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 3), align 1, !tbaa !12 %conv.3.2 = sext i8 %35 to i32 %putchar47.3.2 = tail call i32 @putchar(i32 %conv.3.2) %36 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 4), align 4, !tbaa !12 %conv.4.2 = sext i8 %36 to i32 %putchar47.4.2 = tail call i32 @putchar(i32 %conv.4.2) %37 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 5), align 1, !tbaa !12 %conv.5.2 = sext i8 %37 to i32 %putchar47.5.2 = tail call i32 @putchar(i32 %conv.5.2) %38 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 6), align 2, !tbaa !12 %conv.6.2 = sext i8 %38 to i32 %putchar47.6.2 = tail call i32 @putchar(i32 %conv.6.2) %39 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 2, i64 7), align 1, !tbaa !12 %conv.7.2 = sext i8 %39 to i32 %putchar47.7.2 = tail call i32 @putchar(i32 %conv.7.2) %putchar.2 = tail call i32 @putchar(i32 10) %40 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 0), align 8, !tbaa !12 %conv.369 = sext i8 %40 to i32 %putchar47.370 = tail call i32 @putchar(i32 %conv.369) %41 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 1), align 1, !tbaa !12 %conv.1.3 = sext i8 %41 to i32 %putchar47.1.3 = tail call i32 @putchar(i32 %conv.1.3) %42 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 2), align 2, !tbaa !12 %conv.2.3 = sext i8 %42 to i32 %putchar47.2.3 = tail call i32 @putchar(i32 %conv.2.3) %43 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 3), align 1, !tbaa !12 %conv.3.3 = sext i8 %43 to i32 %putchar47.3.3 = tail call i32 @putchar(i32 %conv.3.3) %44 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 4), align 4, !tbaa !12 %conv.4.3 = sext i8 %44 to i32 %putchar47.4.3 = tail call i32 @putchar(i32 %conv.4.3) %45 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 5), align 1, !tbaa !12 %conv.5.3 = sext i8 %45 to i32 %putchar47.5.3 = tail call i32 @putchar(i32 %conv.5.3) %46 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 6), align 2, !tbaa !12 %conv.6.3 = sext i8 %46 to i32 %putchar47.6.3 = tail call i32 @putchar(i32 %conv.6.3) %47 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 3, i64 7), align 1, !tbaa !12 %conv.7.3 = sext i8 %47 to i32 %putchar47.7.3 = tail call i32 @putchar(i32 %conv.7.3) %putchar.3 = tail call i32 @putchar(i32 10) %48 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 0), align 16, !tbaa !12 %conv.472 = sext i8 %48 to i32 %putchar47.473 = tail call i32 @putchar(i32 %conv.472) %49 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 1), align 1, !tbaa !12 %conv.1.4 = sext i8 %49 to i32 %putchar47.1.4 = tail call i32 @putchar(i32 %conv.1.4) %50 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 2), align 2, !tbaa !12 %conv.2.4 = sext i8 %50 to i32 %putchar47.2.4 = tail call i32 @putchar(i32 %conv.2.4) %51 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 3), align 1, !tbaa !12 %conv.3.4 = sext i8 %51 to i32 %putchar47.3.4 = tail call i32 @putchar(i32 %conv.3.4) %52 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 4), align 4, !tbaa !12 %conv.4.4 = sext i8 %52 to i32 %putchar47.4.4 = tail call i32 @putchar(i32 %conv.4.4) %53 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 5), align 1, !tbaa !12 %conv.5.4 = sext i8 %53 to i32 %putchar47.5.4 = tail call i32 @putchar(i32 %conv.5.4) %54 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 6), align 2, !tbaa !12 %conv.6.4 = sext i8 %54 to i32 %putchar47.6.4 = tail call i32 @putchar(i32 %conv.6.4) %55 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 4, i64 7), align 1, !tbaa !12 %conv.7.4 = sext i8 %55 to i32 %putchar47.7.4 = tail call i32 @putchar(i32 %conv.7.4) %putchar.4 = tail call i32 @putchar(i32 10) %56 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 0), align 8, !tbaa !12 %conv.575 = sext i8 %56 to i32 %putchar47.576 = tail call i32 @putchar(i32 %conv.575) %57 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 1), align 1, !tbaa !12 %conv.1.5 = sext i8 %57 to i32 %putchar47.1.5 = tail call i32 @putchar(i32 %conv.1.5) %58 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 2), align 2, !tbaa !12 %conv.2.5 = sext i8 %58 to i32 %putchar47.2.5 = tail call i32 @putchar(i32 %conv.2.5) %59 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 3), align 1, !tbaa !12 %conv.3.5 = sext i8 %59 to i32 %putchar47.3.5 = tail call i32 @putchar(i32 %conv.3.5) %60 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 4), align 4, !tbaa !12 %conv.4.5 = sext i8 %60 to i32 %putchar47.4.5 = tail call i32 @putchar(i32 %conv.4.5) %61 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 5), align 1, !tbaa !12 %conv.5.5 = sext i8 %61 to i32 %putchar47.5.5 = tail call i32 @putchar(i32 %conv.5.5) %62 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 6), align 2, !tbaa !12 %conv.6.5 = sext i8 %62 to i32 %putchar47.6.5 = tail call i32 @putchar(i32 %conv.6.5) %63 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 5, i64 7), align 1, !tbaa !12 %conv.7.5 = sext i8 %63 to i32 %putchar47.7.5 = tail call i32 @putchar(i32 %conv.7.5) %putchar.5 = tail call i32 @putchar(i32 10) %64 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 0), align 16, !tbaa !12 %conv.678 = sext i8 %64 to i32 %putchar47.679 = tail call i32 @putchar(i32 %conv.678) %65 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 1), align 1, !tbaa !12 %conv.1.6 = sext i8 %65 to i32 %putchar47.1.6 = tail call i32 @putchar(i32 %conv.1.6) %66 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 2), align 2, !tbaa !12 %conv.2.6 = sext i8 %66 to i32 %putchar47.2.6 = tail call i32 @putchar(i32 %conv.2.6) %67 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 3), align 1, !tbaa !12 %conv.3.6 = sext i8 %67 to i32 %putchar47.3.6 = tail call i32 @putchar(i32 %conv.3.6) %68 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 4), align 4, !tbaa !12 %conv.4.6 = sext i8 %68 to i32 %putchar47.4.6 = tail call i32 @putchar(i32 %conv.4.6) %69 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 5), align 1, !tbaa !12 %conv.5.6 = sext i8 %69 to i32 %putchar47.5.6 = tail call i32 @putchar(i32 %conv.5.6) %70 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 6), align 2, !tbaa !12 %conv.6.6 = sext i8 %70 to i32 %putchar47.6.6 = tail call i32 @putchar(i32 %conv.6.6) %71 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 6, i64 7), align 1, !tbaa !12 %conv.7.6 = sext i8 %71 to i32 %putchar47.7.6 = tail call i32 @putchar(i32 %conv.7.6) %putchar.6 = tail call i32 @putchar(i32 10) %72 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 0), align 8, !tbaa !12 %conv.781 = sext i8 %72 to i32 %putchar47.782 = tail call i32 @putchar(i32 %conv.781) %73 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 1), align 1, !tbaa !12 %conv.1.7 = sext i8 %73 to i32 %putchar47.1.7 = tail call i32 @putchar(i32 %conv.1.7) %74 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 2), align 2, !tbaa !12 %conv.2.7 = sext i8 %74 to i32 %putchar47.2.7 = tail call i32 @putchar(i32 %conv.2.7) %75 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 3), align 1, !tbaa !12 %conv.3.7 = sext i8 %75 to i32 %putchar47.3.7 = tail call i32 @putchar(i32 %conv.3.7) %76 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 4), align 4, !tbaa !12 %conv.4.7 = sext i8 %76 to i32 %putchar47.4.7 = tail call i32 @putchar(i32 %conv.4.7) %77 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 5), align 1, !tbaa !12 %conv.5.7 = sext i8 %77 to i32 %putchar47.5.7 = tail call i32 @putchar(i32 %conv.5.7) %78 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 6), align 2, !tbaa !12 %conv.6.7 = sext i8 %78 to i32 %putchar47.6.7 = tail call i32 @putchar(i32 %conv.6.7) %79 = load i8, ptr getelementptr inbounds ([8 x [8 x i8]], ptr @ban, i64 0, i64 7, i64 7), align 1, !tbaa !12 %conv.7.7 = sext i8 %79 to i32 %putchar47.7.7 = tail call i32 @putchar(i32 %conv.7.7) %putchar.7 = tail call i32 @putchar(i32 10) ret void } ; 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 = !{!7, !7, i64 0}
#include <stdio.h> int main(void) { int n; int h[100]; int i, j; int d, prev; while (1){ scanf("%d", &n); if (n == 0){ break; } n++; for (i = 0; i < n; i++){ scanf("%d", &h[i]); } for (i = 0; i < n; i++){ prev = 0; d = 0; //printf("(i=%d)", i); for (j = 0; j < n; j++){ if (j == i){ continue; } if (prev == 0){ prev = h[j]; continue; } if (d == 0){ d = h[j] - prev; if (d == 0){ break; } prev = h[j]; continue; } if (h[j] != prev + d){ break; } prev = h[j]; } if (j == n){ printf("%d\n", h[i]); break; } } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233203/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %h = 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 %h) #3 %call78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp79 = icmp eq i32 %0, 0 br i1 %cmp79, label %while.end, label %if.end if.end: ; preds = %entry, %for.end46 %1 = phi i32 [ %8, %for.end46 ], [ %0, %entry ] %inc = add nsw i32 %1, 1 store i32 %inc, ptr %n, align 4, !tbaa !5 %cmp167 = icmp sgt i32 %1, -1 br i1 %cmp167, label %for.body, label %for.end46 for.cond4.preheader: ; preds = %for.body %cmp576 = icmp sgt i32 %6, 0 br i1 %cmp576, label %for.cond7.preheader.us.preheader, label %for.end46 for.cond7.preheader.us.preheader: ; preds = %for.cond4.preheader %wide.trip.count89 = zext i32 %6 to i64 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.inc44.us %indvars.iv86 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next87, %for.inc44.us ] br label %for.body9.us for.body9.us: ; preds = %for.cond7.preheader.us, %for.inc35.us %indvars.iv83 = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next84, %for.inc35.us ] %prev.072.us = phi i32 [ 0, %for.cond7.preheader.us ], [ %prev.1.us, %for.inc35.us ] %d.071.us = phi i32 [ 0, %for.cond7.preheader.us ], [ %d.1.us, %for.inc35.us ] %cmp10.us = icmp eq i64 %indvars.iv83, %indvars.iv86 br i1 %cmp10.us, label %for.inc35.us, label %if.end12.us if.end12.us: ; preds = %for.body9.us %cmp13.us = icmp eq i32 %prev.072.us, 0 br i1 %cmp13.us, label %if.then14.us, label %if.end17.us if.end17.us: ; preds = %if.end12.us %cmp18.us = icmp eq i32 %d.071.us, 0 %arrayidx21.us = getelementptr inbounds [100 x i32], ptr %h, i64 0, i64 %indvars.iv83 %2 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5 br i1 %cmp18.us, label %if.then19.us, label %if.end27.us if.end27.us: ; preds = %if.end17.us %add.us = add nsw i32 %prev.072.us, %d.071.us %cmp30.not.us = icmp eq i32 %2, %add.us br i1 %cmp30.not.us, label %for.inc35.us, label %for.end37.us if.then19.us: ; preds = %if.end17.us %sub.us = sub nsw i32 %2, %prev.072.us %cmp22.us = icmp eq i32 %sub.us, 0 br i1 %cmp22.us, label %for.end37.us, label %for.inc35.us for.end37.us: ; preds = %if.then19.us, %if.end27.us %3 = trunc i64 %indvars.iv83 to i32 %cmp38.us = icmp eq i32 %6, %3 br i1 %cmp38.us, label %if.then39.split.us, label %for.inc44.us for.inc44.us: ; preds = %for.end37.us %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89 br i1 %exitcond90.not, label %for.end46, label %for.cond7.preheader.us, !llvm.loop !9 if.then14.us: ; preds = %if.end12.us %arrayidx16.us = getelementptr inbounds [100 x i32], ptr %h, i64 0, i64 %indvars.iv83 %4 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 br label %for.inc35.us for.inc35.us: ; preds = %if.then14.us, %if.then19.us, %if.end27.us, %for.body9.us %d.1.us = phi i32 [ %d.071.us, %for.body9.us ], [ %d.071.us, %if.then14.us ], [ %sub.us, %if.then19.us ], [ %d.071.us, %if.end27.us ] %prev.1.us = phi i32 [ %prev.072.us, %for.body9.us ], [ %4, %if.then14.us ], [ %2, %if.then19.us ], [ %2, %if.end27.us ] %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count89 br i1 %exitcond.not, label %if.then39.split.us, label %for.body9.us, !llvm.loop !11 if.then39.split.us: ; preds = %for.end37.us, %for.inc35.us %idxprom40 = and i64 %indvars.iv86, 4294967295 %arrayidx41 = getelementptr inbounds [100 x i32], ptr %h, i64 0, i64 %idxprom40 %5 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) br label %for.end46 for.body: ; preds = %if.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %if.end ] %arrayidx = getelementptr inbounds [100 x i32], ptr %h, 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 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp1, label %for.body, label %for.cond4.preheader, !llvm.loop !12 for.end46: ; preds = %for.inc44.us, %if.end, %for.cond4.preheader, %if.then39.split.us %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %8, 0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end46, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %h) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(a<b && c<d) { printf("%d",a+c); } else if(a<b && c>d) { printf("%d",a+d); } else if(a>b && c<d) { printf("%d",b+c); } else if(a>b && c>d) { printf("%d",b+d); } else if(a==b && c<d) { printf("%d",b+c); } else if(a==b && c>d) { printf("%d",b+d); } else if(a>b && c==d) { printf("%d",b+c); } else if(a<b && c==d) { printf("%d",a+c); } else { printf("%d",b+c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233254/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233254/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %.pre.pre.pre.pre.pre = load i32, ptr %c, align 4, !tbaa !5 br i1 %cmp, label %land.lhs.true, label %if.else9 land.lhs.true: ; preds = %entry %2 = load i32, ptr %d, align 4, !tbaa !5 %cmp1 = icmp slt i32 %.pre.pre.pre.pre.pre, %2 br i1 %cmp1, label %if.then, label %land.lhs.true4 if.then: ; preds = %land.lhs.true %add = add nsw i32 %.pre.pre.pre.pre.pre, %0 br label %if.end60 land.lhs.true4: ; preds = %land.lhs.true %cmp5 = icmp sgt i32 %.pre.pre.pre.pre.pre, %2 br i1 %cmp5, label %if.then6, label %if.else9 if.then6: ; preds = %land.lhs.true4 %add7 = add nsw i32 %2, %0 br label %if.end60 if.else9: ; preds = %entry, %land.lhs.true4 %cmp10 = icmp sgt i32 %0, %1 br i1 %cmp10, label %land.lhs.true11, label %if.else23 land.lhs.true11: ; preds = %if.else9 %3 = load i32, ptr %d, align 4, !tbaa !5 %cmp12 = icmp slt i32 %.pre.pre.pre.pre.pre, %3 br i1 %cmp12, label %if.then13, label %land.lhs.true18 if.then13: ; preds = %land.lhs.true11 %add14 = add nsw i32 %.pre.pre.pre.pre.pre, %1 br label %if.end60 land.lhs.true18: ; preds = %land.lhs.true11 %cmp19 = icmp sgt i32 %.pre.pre.pre.pre.pre, %3 br i1 %cmp19, label %if.then20, label %if.else23 if.then20: ; preds = %land.lhs.true18 %add21 = add nsw i32 %3, %1 br label %if.end60 if.else23: ; preds = %if.else9, %land.lhs.true18 %cmp24 = icmp eq i32 %0, %1 br i1 %cmp24, label %land.lhs.true25, label %if.else37 land.lhs.true25: ; preds = %if.else23 %4 = load i32, ptr %d, align 4, !tbaa !5 %cmp26 = icmp slt i32 %.pre.pre.pre.pre.pre, %4 br i1 %cmp26, label %if.then27, label %land.lhs.true32 if.then27: ; preds = %land.lhs.true25 %add28 = add nsw i32 %.pre.pre.pre.pre.pre, %0 br label %if.end60 land.lhs.true32: ; preds = %land.lhs.true25 %cmp33 = icmp sgt i32 %.pre.pre.pre.pre.pre, %4 br i1 %cmp33, label %if.then34, label %if.else37 if.then34: ; preds = %land.lhs.true32 %add35 = add nsw i32 %4, %0 br label %if.end60 if.else37: ; preds = %if.else23, %land.lhs.true32 %5 = load i32, ptr %d, align 4 %cmp40 = icmp eq i32 %.pre.pre.pre.pre.pre, %5 %or.cond = select i1 %cmp10, i1 %cmp40, i1 false br i1 %or.cond, label %if.then41, label %if.else44 if.then41: ; preds = %if.else37 %add42 = add nsw i32 %.pre.pre.pre.pre.pre, %1 br label %if.end60 if.else44: ; preds = %if.else37 %6 = load i32, ptr %d, align 4 %cmp47 = icmp eq i32 %.pre.pre.pre.pre.pre, %6 %or.cond76 = select i1 %cmp, i1 %cmp47, i1 false br i1 %or.cond76, label %if.then48, label %if.else51 if.then48: ; preds = %if.else44 %add49 = add nsw i32 %.pre.pre.pre.pre.pre, %0 br label %if.end60 if.else51: ; preds = %if.else44 %add52 = add nsw i32 %.pre.pre.pre.pre.pre, %1 br label %if.end60 if.end60: ; preds = %if.then6, %if.then20, %if.then34, %if.then48, %if.else51, %if.then41, %if.then27, %if.then13, %if.then %add7.sink = phi i32 [ %add7, %if.then6 ], [ %add21, %if.then20 ], [ %add35, %if.then34 ], [ %add49, %if.then48 ], [ %add52, %if.else51 ], [ %add42, %if.then41 ], [ %add28, %if.then27 ], [ %add14, %if.then13 ], [ %add, %if.then ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add7.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c,d,e,f; scanf("%d %d %d %d",&a,&b,&c,&d); if(a>b) e=b; else e=a; if(c>d) f=d; else f=c; printf("%d",e+f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233298/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233298/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %f.0 = call i32 @llvm.smin.i32(i32 %2, i32 %3) %add = add nsw i32 %f.0, %. %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,n) for(ll i=0;i<(n);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-(p))) int cmp(const void *a, const void *b); //your code here! int main(void){ ll A, B, C, D; scanf("%lld %lld %lld %lld", &A, &B, &C, &D); printf("%lld\n", min(A,B)+min(C,D)); return 0; } int cmp(const void *a, const void *b){ ll A=*(ll *)a, B=*(ll *)b; if(A==B)return 0; else return A>B ? 1:-1;//昇順ソート }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233355/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i64, align 8 %B = alloca i64, align 8 %C = alloca i64, align 8 %D = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i64, ptr %A, align 8 %1 = load i64, ptr %B, align 8 %cond = call i64 @llvm.smin.i64(i64 %0, i64 %1) %2 = load i64, ptr %C, align 8 %3 = load i64, ptr %D, align 8 %cond5 = call i64 @llvm.smin.i64(i64 %2, i64 %3) %add = add nsw i64 %cond5, %cond %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %D) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 #3 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp eq i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = select i1 %cmp1, i32 1, i32 -1 %retval.0 = select i1 %cmp, i32 0, i32 %cond ret i32 %retval.0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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"}
#include <stdio.h> int main(void){ int a,b,c,d,x; scanf("%d %d %d %d",&a,&b,&c,&d); if(a<b) x=a; else x=b; if(c<d) x+=c; else x+=d; printf("%d",x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233405/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233405/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %.pn = call i32 @llvm.smin.i32(i32 %2, i32 %3) %x.1 = add nsw i32 %.pn, %. %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int A,B,C,D; scanf("%d",&A); scanf("%d",&B); scanf("%d",&C); scanf("%d",&D); int ans; if(A>=B) ans = B; else ans = A; if(C>=D) ans+=D; else ans+=C; printf("%d",ans); return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233456/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %C, align 4, !tbaa !5 %3 = load i32, ptr %D, align 4, !tbaa !5 %.pn = call i32 @llvm.smin.i32(i32 %2, i32 %3) %ans.1 = add nsw i32 %.pn, %. %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long long n; scanf("%I64d",&n); if(n%4==0||(n+1)%4==0){ printf("0"); } else{ printf("1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2335/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2335/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = and i64 %0, 3 %cmp = icmp eq i64 %1, 0 %add = add nsw i64 %0, 1 %2 = and i64 %add, 3 %cmp2 = icmp eq i64 %2, 0 %3 = select i1 %cmp, i1 true, i1 %cmp2 %.sink = select i1 %3, i32 48, i32 49 %putchar = call i32 @putchar(i32 %.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind 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"}
/* AtCoder Beginner Contest 092 A - Traveling Budget 結果: */ #include<stdio.h> //#define DEBUG1 int main() { int a, b, c, d; int ans = 0; scanf("%d %d %d %d", &a, &b, &c, &d); #ifdef DEBUG1 printf("%d\n%d\n%d\n%d\n", a, b, c, d); #endif if (a > b) { ans += b; } else { ans += a; } if (c > d) { ans += d; } else { ans += c; } printf("%d\n", ans); #ifdef DEBUG1 getch(); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233542/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233542/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %.pn = call i32 @llvm.smin.i32(i32 %2, i32 %3) %ans.1 = add nsw i32 %.pn, %. %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d); int ans = 0; if (a < b) ans += a; else ans += b; if (c < d) ans += c; else ans += d; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233586/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233586/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %. = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %.pn = call i32 @llvm.smin.i32(i32 %2, i32 %3) %ans.1 = add nsw i32 %.pn, %. %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n, k, flag; int b[1000], sr; int i, j; while (scanf("%d %d", &n, &k), n != 0 || k != 0){ for (i = 0; i < k; i++){ scanf("%d", &b[i]); } for (i = 0; i < n; i++){ for (j = 0; j < k; j++){ scanf("%d", &sr); b[j] -= sr; } } for (i = 0; i < k; i++){ if (b[i] < 0){ break; } } if (i == k){ printf("Yes\n"); } else { printf("No\n"); } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233629/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233629/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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 %k = alloca i32, align 4 %b = alloca [1000 x i32], align 16 %sr = 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 void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sr) #4 %call55 = 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 %cmp56 = icmp ne i32 %0, 0 %1 = load i32, ptr %k, align 4 %cmp157 = icmp ne i32 %1, 0 %2 = select i1 %cmp56, i1 true, i1 %cmp157 br i1 %2, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %if.end32 %3 = phi i32 [ %22, %if.end32 ], [ %0, %entry ] %4 = phi i32 [ %23, %if.end32 ], [ %1, %entry ] %cmp244 = icmp sgt i32 %4, 0 br i1 %cmp244, label %for.body, label %for.cond4.preheader for.cond4.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit, %for.cond.preheader %5 = phi i32 [ %8, %for.cond4.preheader.loopexit ], [ %4, %for.cond.preheader ] %6 = phi i32 [ %.pre, %for.cond4.preheader.loopexit ], [ %3, %for.cond.preheader ] %cmp548 = icmp sgt i32 %6, 0 br i1 %cmp548, label %for.cond7.preheader.lr.ph, label %for.cond19.preheader for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader %7 = icmp sgt i32 %5, 0 br i1 %7, label %for.cond7.preheader, label %for.end27 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %k, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body, label %for.cond4.preheader.loopexit, !llvm.loop !9 for.cond19.preheader: ; preds = %for.inc16, %for.cond4.preheader %10 = phi i32 [ %5, %for.cond4.preheader ], [ %18, %for.inc16 ] %cmp2050 = icmp sgt i32 %10, 0 br i1 %cmp2050, label %for.body21.preheader, label %for.end27 for.body21.preheader: ; preds = %for.cond19.preheader %wide.trip.count = zext i32 %10 to i64 br label %for.body21 for.cond7.preheader: ; preds = %for.cond7.preheader.lr.ph, %for.inc16 %11 = phi i32 [ %17, %for.inc16 ], [ %6, %for.cond7.preheader.lr.ph ] %12 = phi i32 [ %18, %for.inc16 ], [ %5, %for.cond7.preheader.lr.ph ] %i.149 = phi i32 [ %inc17, %for.inc16 ], [ 0, %for.cond7.preheader.lr.ph ] %cmp846 = icmp sgt i32 %12, 0 br i1 %cmp846, label %for.body9, label %for.inc16 for.body9: ; preds = %for.cond7.preheader, %for.body9 %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.body9 ], [ 0, %for.cond7.preheader ] %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %sr) %13 = load i32, ptr %sr, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv60 %14 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %sub = sub nsw i32 %14, %13 store i32 %sub, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %15 = load i32, ptr %k, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp8 = icmp slt i64 %indvars.iv.next61, %16 br i1 %cmp8, label %for.body9, label %for.inc16.loopexit, !llvm.loop !11 for.inc16.loopexit: ; preds = %for.body9 %.pre66 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc16 for.inc16: ; preds = %for.inc16.loopexit, %for.cond7.preheader %17 = phi i32 [ %.pre66, %for.inc16.loopexit ], [ %11, %for.cond7.preheader ] %18 = phi i32 [ %15, %for.inc16.loopexit ], [ %12, %for.cond7.preheader ] %inc17 = add nuw nsw i32 %i.149, 1 %cmp5 = icmp slt i32 %inc17, %17 br i1 %cmp5, label %for.cond7.preheader, label %for.cond19.preheader, !llvm.loop !12 for.body21: ; preds = %for.body21.preheader, %for.inc25 %indvars.iv63 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next64, %for.inc25 ] %arrayidx23 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv63 %19 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp slt i32 %19, 0 br i1 %cmp24, label %for.end27.loopexit, label %for.inc25 for.inc25: ; preds = %for.body21 %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count br i1 %exitcond.not, label %if.end32, label %for.body21, !llvm.loop !14 for.end27.loopexit: ; preds = %for.body21 %20 = trunc i64 %indvars.iv63 to i32 br label %for.end27 for.end27: ; preds = %for.end27.loopexit, %for.cond7.preheader.lr.ph, %for.cond19.preheader %21 = phi i32 [ %10, %for.cond19.preheader ], [ %5, %for.cond7.preheader.lr.ph ], [ %10, %for.end27.loopexit ] %i.2.lcssa = phi i32 [ 0, %for.cond19.preheader ], [ 0, %for.cond7.preheader.lr.ph ], [ %20, %for.end27.loopexit ] %cmp28 = icmp eq i32 %i.2.lcssa, %21 %spec.select = select i1 %cmp28, ptr @str.4, ptr @str br label %if.end32 if.end32: ; preds = %for.inc25, %for.end27 %str.sink = phi ptr [ %spec.select, %for.end27 ], [ @str.4, %for.inc25 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %22 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp ne i32 %22, 0 %23 = load i32, ptr %k, align 4 %cmp1 = icmp ne i32 %23, 0 %24 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %24, label %for.cond.preheader, label %while.end, !llvm.loop !15 while.end: ; preds = %if.end32, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sr) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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} !13 = !{!"llvm.loop.unswitch.partial.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> //#include<conio.h> #include<stdbool.h> #include<string.h> #include<limits.h> char str[10005]; bool palin(int i,int j) { //printf("%d%d",i,j); while(i<=j) { //printf("%c%c\n",str[i],str[j]); if(str[i]!=str[j]) {return false;} i++;j--; } return true; } int main() { int i,k,temp; scanf("%s",str); scanf("%d",&k); int n=strlen(str); if(n%k!=0) printf("NO\n"); else { temp=n/k; int flag=0; for(i=0;i<n;i=i+temp) { //printf("%d%d\n",i,i+temp-1); if(palin(i,i+temp-1)==false) {flag=1;break;} } if(flag==1) printf("NO\n"); else printf("YES\n"); } // getch(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @str = dso_local global [10005 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @palin(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %cmp.not10 = icmp sgt i32 %i, %j br i1 %cmp.not10, label %return, label %while.body.preheader while.body.preheader: ; preds = %entry %0 = sext i32 %j to i64 %1 = sext i32 %i to i64 br label %while.body while.body: ; preds = %while.body.preheader, %if.end %indvars.iv15 = phi i64 [ %1, %while.body.preheader ], [ %indvars.iv.next16, %if.end ] %indvars.iv = phi i64 [ %0, %while.body.preheader ], [ %indvars.iv.next, %if.end ] %arrayidx = getelementptr inbounds [10005 x i8], ptr @str, i64 0, i64 %indvars.iv15 %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds [10005 x i8], ptr @str, i64 0, i64 %indvars.iv %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %2, %3 br i1 %cmp4.not, label %if.end, label %return if.end: ; preds = %while.body %indvars.iv.next16 = add nsw i64 %indvars.iv15, 1 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp.not.not = icmp slt i64 %indvars.iv15, %indvars.iv.next br i1 %cmp.not.not, label %while.body, label %return, !llvm.loop !8 return: ; preds = %while.body, %if.end, %entry %cmp.not.lcssa = phi i1 [ true, %entry ], [ %cmp4.not, %if.end ], [ %cmp4.not, %while.body ] ret i1 %cmp.not.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #7 %conv = trunc i64 %call2 to i32 %0 = load i32, ptr %k, align 4, !tbaa !10 %rem = srem i32 %conv, %0 %div = sdiv i32 %conv, %0 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %if.else, label %if.end20 if.else: ; preds = %entry %cmp530 = icmp sgt i32 %conv, 0 %cmp.not10.i.not = icmp sgt i32 %div, 0 %or.cond = and i1 %cmp530, %cmp.not10.i.not br i1 %or.cond, label %for.body.us.preheader, label %if.end20 for.body.us.preheader: ; preds = %if.else %1 = zext i32 %div to i64 %sext = shl i64 %call2, 32 %2 = ashr exact i64 %sext, 32 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %palin.exit.loopexit.us %indvars.iv = phi i64 [ 0, %for.body.us.preheader ], [ %indvars.iv.next, %palin.exit.loopexit.us ] %indvars.iv.next = add i64 %indvars.iv, %1 %3 = add nsw i64 %indvars.iv.next, -1 br label %while.body.i.us while.body.i.us: ; preds = %if.end.i.us, %for.body.us %indvars.iv15.i.us = phi i64 [ %indvars.iv, %for.body.us ], [ %indvars.iv.next16.i.us, %if.end.i.us ] %indvars.iv.i.us = phi i64 [ %3, %for.body.us ], [ %indvars.iv.next.i.us, %if.end.i.us ] %arrayidx.i.us = getelementptr inbounds [10005 x i8], ptr @str, i64 0, i64 %indvars.iv15.i.us %4 = load i8, ptr %arrayidx.i.us, align 1, !tbaa !5 %arrayidx2.i.us = getelementptr inbounds [10005 x i8], ptr @str, i64 0, i64 %indvars.iv.i.us %5 = load i8, ptr %arrayidx2.i.us, align 1, !tbaa !5 %cmp4.not.i.us = icmp eq i8 %4, %5 br i1 %cmp4.not.i.us, label %if.end.i.us, label %if.end20 if.end.i.us: ; preds = %while.body.i.us %indvars.iv.next16.i.us = add nsw i64 %indvars.iv15.i.us, 1 %indvars.iv.next.i.us = add nsw i64 %indvars.iv.i.us, -1 %cmp.not.not.i.us = icmp slt i64 %indvars.iv15.i.us, %indvars.iv.next.i.us br i1 %cmp.not.not.i.us, label %while.body.i.us, label %palin.exit.loopexit.us, !llvm.loop !8 palin.exit.loopexit.us: ; preds = %if.end.i.us %cmp5.us = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp5.us, label %for.body.us, label %if.end20, !llvm.loop !12 if.end20: ; preds = %palin.exit.loopexit.us, %while.body.i.us, %if.else, %entry %str.5.sink = phi ptr [ @str.6, %entry ], [ @str.4, %if.else ], [ @str.6, %while.body.i.us ], [ @str.4, %palin.exit.loopexit.us ] %puts27 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0} !12 = distinct !{!12, !9}
#include <stdio.h> #include <stdlib.h> #include <string.h> int a[505][505]; int r_max[505]; int main() { int n,m,q; scanf("%d%d%d",&n,&m,&q); int i,j; int count,temp,iter; int max=-1; for(i=1;i<=n;i++) { temp=0; r_max[i]=0; for(j=1;j<=m;j++) { scanf("%d",&a[i][j]); if(a[i][j]) { temp+=1; } else { if(r_max[i]<temp) r_max[i]=temp; temp=0; } } if(r_max[i]<temp) r_max[i]=temp; } for(i=1;i<=n;i++) { if(r_max[i]>max) max=r_max[i]; } int k; while(q--) { temp=count=0; scanf("%d%d",&i,&j); a[i][j]^=1; for(k=1;k<=m;k++) { iter=k; temp=0; while(iter<=m && a[i][iter]==1) { temp++; iter++; } if(iter!=k) k=iter-1; if(temp>count) count=temp; } r_max[i]=count; if(count > max) { max=count; printf("%d\n",max); } else { max=-1; for(i=1;i<=n;i++) { if(max<r_max[i]) max=r_max[i]; } printf("%d\n",max); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23373/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23373/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @r_max = dso_local local_unnamed_addr global [505 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @a = dso_local global [505 x [505 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %q = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %q) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not127 = icmp slt i32 %0, 1 br i1 %cmp.not127, label %while.cond.preheader, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %m, align 4, !tbaa !5 %2 = icmp slt i32 %1, 1 br i1 %2, label %for.body.lr.ph.split.us, label %for.body for.body.lr.ph.split.us: ; preds = %for.body.lr.ph %3 = add nuw i32 %0, 1 %4 = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.us.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph.split.us %n.vec = and i64 %4, 4294967288 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %pred.store.continue192, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue192 ] %offset.idx = or i64 %index, 1 %5 = or i64 %index, 5 %6 = shl i64 %offset.idx, 32 %7 = ashr exact i64 %6, 32 %8 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %7 store <4 x i32> zeroinitializer, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> zeroinitializer, ptr %9, align 4, !tbaa !5 %10 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load178 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = icmp slt <4 x i32> %wide.load, zeroinitializer %13 = icmp slt <4 x i32> %wide.load178, zeroinitializer %14 = extractelement <4 x i1> %12, i64 0 br i1 %14, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %15 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %offset.idx store i32 0, ptr %15, align 4, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %16 = extractelement <4 x i1> %12, i64 1 br i1 %16, label %pred.store.if179, label %pred.store.continue180 pred.store.if179: ; preds = %pred.store.continue %17 = or i64 %index, 2 %18 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %17 store i32 0, ptr %18, align 8, !tbaa !5 br label %pred.store.continue180 pred.store.continue180: ; preds = %pred.store.if179, %pred.store.continue %19 = extractelement <4 x i1> %12, i64 2 br i1 %19, label %pred.store.if181, label %pred.store.continue182 pred.store.if181: ; preds = %pred.store.continue180 %20 = or i64 %index, 3 %21 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %20 store i32 0, ptr %21, align 4, !tbaa !5 br label %pred.store.continue182 pred.store.continue182: ; preds = %pred.store.if181, %pred.store.continue180 %22 = extractelement <4 x i1> %12, i64 3 br i1 %22, label %pred.store.if183, label %pred.store.continue184 pred.store.if183: ; preds = %pred.store.continue182 %23 = or i64 %index, 4 %24 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %23 store i32 0, ptr %24, align 16, !tbaa !5 br label %pred.store.continue184 pred.store.continue184: ; preds = %pred.store.if183, %pred.store.continue182 %25 = extractelement <4 x i1> %13, i64 0 br i1 %25, label %pred.store.if185, label %pred.store.continue186 pred.store.if185: ; preds = %pred.store.continue184 %26 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %5 store i32 0, ptr %26, align 4, !tbaa !5 br label %pred.store.continue186 pred.store.continue186: ; preds = %pred.store.if185, %pred.store.continue184 %27 = extractelement <4 x i1> %13, i64 1 br i1 %27, label %pred.store.if187, label %pred.store.continue188 pred.store.if187: ; preds = %pred.store.continue186 %28 = or i64 %index, 6 %29 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %28 store i32 0, ptr %29, align 8, !tbaa !5 br label %pred.store.continue188 pred.store.continue188: ; preds = %pred.store.if187, %pred.store.continue186 %30 = extractelement <4 x i1> %13, i64 2 br i1 %30, label %pred.store.if189, label %pred.store.continue190 pred.store.if189: ; preds = %pred.store.continue188 %31 = or i64 %index, 7 %32 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %31 store i32 0, ptr %32, align 4, !tbaa !5 br label %pred.store.continue190 pred.store.continue190: ; preds = %pred.store.if189, %pred.store.continue188 %33 = extractelement <4 x i1> %13, i64 3 br i1 %33, label %pred.store.if191, label %pred.store.continue192 pred.store.if191: ; preds = %pred.store.continue190 %34 = add i64 %index, 8 %35 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %34 store i32 0, ptr %35, align 16, !tbaa !5 br label %pred.store.continue192 pred.store.continue192: ; preds = %pred.store.if191, %pred.store.continue190 %index.next = add nuw i64 %index, 8 %36 = icmp eq i64 %index.next, %n.vec br i1 %36, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %pred.store.continue192 %cmp.n = icmp eq i64 %n.vec, %4 br i1 %cmp.n, label %for.cond.for.cond30.preheader_crit_edge.split.us, label %for.body.us.preheader for.body.us.preheader: ; preds = %for.body.lr.ph.split.us, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.lr.ph.split.us ], [ %ind.end, %middle.block ] br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %for.inc27.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc27.us ], [ %indvars.iv.ph, %for.body.us.preheader ] %sext = shl i64 %indvars.iv, 32 %idxprom.us = ashr exact i64 %sext, 32 %arrayidx.us = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %idxprom.us store i32 0, ptr %arrayidx.us, align 4, !tbaa !5 %arrayidx21.us = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %indvars.iv %37 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5 %cmp22.us = icmp slt i32 %37, 0 br i1 %cmp22.us, label %if.then23.us, label %for.inc27.us if.then23.us: ; preds = %for.body.us store i32 0, ptr %arrayidx21.us, align 4, !tbaa !5 br label %for.inc27.us for.inc27.us: ; preds = %if.then23.us, %for.body.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %38 = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %3, %38 br i1 %exitcond.not, label %for.cond.for.cond30.preheader_crit_edge.split.us, label %for.body.us, !llvm.loop !13 for.cond.for.cond30.preheader_crit_edge.split.us: ; preds = %for.inc27.us, %middle.block store i32 1, ptr %j, align 4, !tbaa !5 br label %for.cond30.preheader for.cond30.preheader: ; preds = %for.inc27, %for.cond.for.cond30.preheader_crit_edge.split.us %.lcssa = phi i32 [ %0, %for.cond.for.cond30.preheader_crit_edge.split.us ], [ %54, %for.inc27 ] %cmp31.not131 = icmp slt i32 %.lcssa, 1 br i1 %cmp31.not131, label %while.cond.preheader, label %for.body32.preheader for.body32.preheader: ; preds = %for.cond30.preheader %39 = add nuw i32 %.lcssa, 1 %wide.trip.count = zext i32 %39 to i64 %40 = add nsw i64 %wide.trip.count, -1 %min.iters.check195 = icmp ult i32 %.lcssa, 8 br i1 %min.iters.check195, label %for.body32.preheader234, label %vector.ph196 vector.ph196: ; preds = %for.body32.preheader %n.vec198 = and i64 %40, -8 %ind.end199 = or i64 %n.vec198, 1 br label %vector.body202 vector.body202: ; preds = %vector.body202, %vector.ph196 %index203 = phi i64 [ 0, %vector.ph196 ], [ %index.next208, %vector.body202 ] %vec.phi = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph196 ], [ %43, %vector.body202 ] %vec.phi204 = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph196 ], [ %44, %vector.body202 ] %offset.idx205 = or i64 %index203, 1 %41 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %offset.idx205 %wide.load206 = load <4 x i32>, ptr %41, align 4, !tbaa !5 %42 = getelementptr inbounds i32, ptr %41, i64 4 %wide.load207 = load <4 x i32>, ptr %42, align 4, !tbaa !5 %43 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load206, <4 x i32> %vec.phi) %44 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load207, <4 x i32> %vec.phi204) %index.next208 = add nuw i64 %index203, 8 %45 = icmp eq i64 %index.next208, %n.vec198 br i1 %45, label %middle.block193, label %vector.body202, !llvm.loop !14 middle.block193: ; preds = %vector.body202 %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %43, <4 x i32> %44) %46 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n201 = icmp eq i64 %40, %n.vec198 br i1 %cmp.n201, label %while.cond.preheader.loopexit, label %for.body32.preheader234 for.body32.preheader234: ; preds = %for.body32.preheader, %middle.block193 %indvars.iv152.ph = phi i64 [ 1, %for.body32.preheader ], [ %ind.end199, %middle.block193 ] %max.0133.ph = phi i32 [ -1, %for.body32.preheader ], [ %46, %middle.block193 ] br label %for.body32 for.body: ; preds = %for.body.lr.ph, %for.inc27 %47 = phi i32 [ %53, %for.inc27 ], [ %1, %for.body.lr.ph ] %48 = phi i32 [ %inc28, %for.inc27 ], [ 1, %for.body.lr.ph ] %idxprom = zext i32 %48 to i64 %arrayidx = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %idxprom store i32 0, ptr %arrayidx, align 4, !tbaa !5 store i32 1, ptr %j, align 4, !tbaa !5 %cmp2.not124 = icmp slt i32 %47, 1 br i1 %cmp2.not124, label %for.inc27, label %for.body3 for.body3: ; preds = %for.body, %for.inc %temp.0126 = phi i32 [ %temp.1, %for.inc ], [ 0, %for.body ] %49 = phi i32 [ %inc, %for.inc ], [ 1, %for.body ] %idxprom6 = zext i32 %49 to i64 %arrayidx7 = getelementptr inbounds [505 x [505 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom6 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %50 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %tobool.not = icmp eq i32 %50, 0 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %for.body3 %add = add nsw i32 %temp.0126, 1 br label %for.inc if.else: ; preds = %for.body3 %51 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp15 = icmp slt i32 %51, %temp.0126 br i1 %cmp15, label %if.then16, label %for.inc if.then16: ; preds = %if.else store i32 %temp.0126, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.else, %if.then16, %if.then %temp.1 = phi i32 [ %add, %if.then ], [ 0, %if.then16 ], [ 0, %if.else ] %inc = add nuw nsw i32 %49, 1 store i32 %inc, ptr %j, align 4, !tbaa !5 %52 = load i32, ptr %m, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %49, %52 br i1 %cmp2.not.not, label %for.body3, label %for.end, !llvm.loop !15 for.end: ; preds = %for.inc %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp22 = icmp slt i32 %.pre, %temp.1 br i1 %cmp22, label %if.then23, label %for.inc27 if.then23: ; preds = %for.end store i32 %temp.1, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %for.body, %for.end, %if.then23 %53 = phi i32 [ %52, %for.end ], [ %52, %if.then23 ], [ %47, %for.body ] %inc28 = add nuw nsw i32 %48, 1 %54 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %48, %54 br i1 %cmp.not.not, label %for.body, label %for.cond30.preheader, !llvm.loop !16 while.cond.preheader.loopexit: ; preds = %for.body32, %middle.block193 %spec.select.lcssa = phi i32 [ %46, %middle.block193 ], [ %spec.select, %for.body32 ] %55 = add i32 %.lcssa, 1 br label %while.cond.preheader while.cond.preheader: ; preds = %entry, %while.cond.preheader.loopexit, %for.cond30.preheader %storemerge119.lcssa = phi i32 [ 1, %for.cond30.preheader ], [ %55, %while.cond.preheader.loopexit ], [ 1, %entry ] %max.0.lcssa = phi i32 [ -1, %for.cond30.preheader ], [ %spec.select.lcssa, %while.cond.preheader.loopexit ], [ -1, %entry ] store i32 %storemerge119.lcssa, ptr %i, align 4, !tbaa !5 %56 = load i32, ptr %q, align 4, !tbaa !5 %dec147 = add nsw i32 %56, -1 store i32 %dec147, ptr %q, align 4, !tbaa !5 %tobool43.not148 = icmp eq i32 %56, 0 br i1 %tobool43.not148, label %while.end92, label %while.body for.body32: ; preds = %for.body32.preheader234, %for.body32 %indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.body32 ], [ %indvars.iv152.ph, %for.body32.preheader234 ] %max.0133 = phi i32 [ %spec.select, %for.body32 ], [ %max.0133.ph, %for.body32.preheader234 ] %arrayidx34 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %indvars.iv152 %57 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %57, i32 %max.0133) %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %exitcond155.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count br i1 %exitcond155.not, label %while.cond.preheader.loopexit, label %for.body32, !llvm.loop !18 while.body: ; preds = %while.cond.preheader, %if.end91 %max.2149 = phi i32 [ %max.3.lcssa.sink, %if.end91 ], [ %max.0.lcssa, %while.cond.preheader ] %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i, ptr noundef nonnull %j) %58 = load i32, ptr %i, align 4, !tbaa !5 %idxprom45 = sext i32 %58 to i64 %59 = load i32, ptr %j, align 4, !tbaa !5 %idxprom47 = sext i32 %59 to i64 %arrayidx48 = getelementptr inbounds [505 x [505 x i32]], ptr @a, i64 0, i64 %idxprom45, i64 %idxprom47 %60 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %xor = xor i32 %60, 1 store i32 %xor, ptr %arrayidx48, align 4, !tbaa !5 %61 = load i32, ptr %m, align 4, !tbaa !5 %cmp50.not138 = icmp slt i32 %61, 1 br i1 %cmp50.not138, label %for.end70, label %while.cond52.preheader.preheader while.cond52.preheader.preheader: ; preds = %while.body %62 = zext i32 %61 to i64 br label %while.cond52.preheader while.cond52.preheader: ; preds = %while.cond52.preheader.preheader, %while.end %k.0140 = phi i32 [ %inc69, %while.end ], [ 1, %while.cond52.preheader.preheader ] %count.0139 = phi i32 [ %count.1, %while.end ], [ 0, %while.cond52.preheader.preheader ] %63 = sext i32 %k.0140 to i64 %smax158 = call i32 @llvm.smax.i32(i32 %k.0140, i32 %61) %64 = add i32 %smax158, 1 br label %land.rhs land.rhs: ; preds = %while.cond52.preheader, %while.body59 %indvars.iv156 = phi i64 [ %63, %while.cond52.preheader ], [ %indvars.iv.next157, %while.body59 ] %temp.2136 = phi i32 [ 0, %while.cond52.preheader ], [ %inc60, %while.body59 ] %arrayidx57 = getelementptr inbounds [505 x [505 x i32]], ptr @a, i64 0, i64 %idxprom45, i64 %indvars.iv156 %65 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %cmp58 = icmp eq i32 %65, 1 br i1 %cmp58, label %while.body59, label %while.end.split.loop.exit171 while.body59: ; preds = %land.rhs %inc60 = add nuw nsw i32 %temp.2136, 1 %indvars.iv.next157 = add nsw i64 %indvars.iv156, 1 %cmp53.not.not = icmp slt i64 %indvars.iv156, %62 br i1 %cmp53.not.not, label %land.rhs, label %while.end, !llvm.loop !19 while.end.split.loop.exit171: ; preds = %land.rhs %66 = trunc i64 %indvars.iv156 to i32 br label %while.end while.end: ; preds = %while.body59, %while.end.split.loop.exit171 %temp.2.lcssa = phi i32 [ %temp.2136, %while.end.split.loop.exit171 ], [ %inc60, %while.body59 ] %iter.0.lcssa = phi i32 [ %66, %while.end.split.loop.exit171 ], [ %64, %while.body59 ] %cmp62.not = icmp eq i32 %iter.0.lcssa, %k.0140 %sub = add nsw i32 %iter.0.lcssa, -1 %spec.select122 = select i1 %cmp62.not, i32 %k.0140, i32 %sub %count.1 = call i32 @llvm.smax.i32(i32 %temp.2.lcssa, i32 %count.0139) %inc69 = add nsw i32 %spec.select122, 1 %cmp50.not.not = icmp slt i32 %spec.select122, %61 br i1 %cmp50.not.not, label %while.cond52.preheader, label %for.end70, !llvm.loop !20 for.end70: ; preds = %while.end, %while.body %count.0.lcssa = phi i32 [ 0, %while.body ], [ %count.1, %while.end ] %arrayidx72 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %idxprom45 store i32 %count.0.lcssa, ptr %arrayidx72, align 4, !tbaa !5 %cmp73 = icmp sgt i32 %count.0.lcssa, %max.2149 br i1 %cmp73, label %if.end91, label %for.cond77.preheader for.cond77.preheader: ; preds = %for.end70 %67 = load i32, ptr %n, align 4, !tbaa !5 %cmp78.not142 = icmp slt i32 %67, 1 br i1 %cmp78.not142, label %for.end89, label %for.body79.preheader for.body79.preheader: ; preds = %for.cond77.preheader %68 = add nuw i32 %67, 1 %wide.trip.count163 = zext i32 %68 to i64 %69 = add nsw i64 %wide.trip.count163, -1 %min.iters.check211 = icmp ult i32 %67, 8 br i1 %min.iters.check211, label %for.body79.preheader228, label %vector.ph212 vector.ph212: ; preds = %for.body79.preheader %n.vec214 = and i64 %69, -8 %ind.end215 = or i64 %n.vec214, 1 br label %vector.body218 vector.body218: ; preds = %vector.body218, %vector.ph212 %index219 = phi i64 [ 0, %vector.ph212 ], [ %index.next225, %vector.body218 ] %vec.phi220 = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph212 ], [ %72, %vector.body218 ] %vec.phi221 = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph212 ], [ %73, %vector.body218 ] %offset.idx222 = or i64 %index219, 1 %70 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %offset.idx222 %wide.load223 = load <4 x i32>, ptr %70, align 4, !tbaa !5 %71 = getelementptr inbounds i32, ptr %70, i64 4 %wide.load224 = load <4 x i32>, ptr %71, align 4, !tbaa !5 %72 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi220, <4 x i32> %wide.load223) %73 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi221, <4 x i32> %wide.load224) %index.next225 = add nuw i64 %index219, 8 %74 = icmp eq i64 %index.next225, %n.vec214 br i1 %74, label %middle.block209, label %vector.body218, !llvm.loop !21 middle.block209: ; preds = %vector.body218 %rdx.minmax226 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %72, <4 x i32> %73) %75 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax226) %cmp.n217 = icmp eq i64 %69, %n.vec214 br i1 %cmp.n217, label %for.end89.loopexit, label %for.body79.preheader228 for.body79.preheader228: ; preds = %for.body79.preheader, %middle.block209 %indvars.iv160.ph = phi i64 [ 1, %for.body79.preheader ], [ %ind.end215, %middle.block209 ] %max.3144.ph = phi i32 [ -1, %for.body79.preheader ], [ %75, %middle.block209 ] br label %for.body79 for.body79: ; preds = %for.body79.preheader228, %for.body79 %indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.body79 ], [ %indvars.iv160.ph, %for.body79.preheader228 ] %max.3144 = phi i32 [ %spec.select123, %for.body79 ], [ %max.3144.ph, %for.body79.preheader228 ] %arrayidx81 = getelementptr inbounds [505 x i32], ptr @r_max, i64 0, i64 %indvars.iv160 %76 = load i32, ptr %arrayidx81, align 4, !tbaa !5 %spec.select123 = call i32 @llvm.smax.i32(i32 %max.3144, i32 %76) %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1 %exitcond164.not = icmp eq i64 %indvars.iv.next161, %wide.trip.count163 br i1 %exitcond164.not, label %for.end89.loopexit, label %for.body79, !llvm.loop !22 for.end89.loopexit: ; preds = %for.body79, %middle.block209 %spec.select123.lcssa = phi i32 [ %75, %middle.block209 ], [ %spec.select123, %for.body79 ] %77 = add i32 %67, 1 br label %for.end89 for.end89: ; preds = %for.end89.loopexit, %for.cond77.preheader %storemerge120.lcssa = phi i32 [ 1, %for.cond77.preheader ], [ %77, %for.end89.loopexit ] %max.3.lcssa = phi i32 [ -1, %for.cond77.preheader ], [ %spec.select123.lcssa, %for.end89.loopexit ] store i32 %storemerge120.lcssa, ptr %i, align 4, !tbaa !5 br label %if.end91 if.end91: ; preds = %for.end70, %for.end89 %max.3.lcssa.sink = phi i32 [ %max.3.lcssa, %for.end89 ], [ %count.0.lcssa, %for.end70 ] %call90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %max.3.lcssa.sink) %78 = load i32, ptr %q, align 4, !tbaa !5 %dec = add nsw i32 %78, -1 store i32 %dec, ptr %q, align 4, !tbaa !5 %tobool43.not = icmp eq i32 %78, 0 br i1 %tobool43.not, label %while.end92, label %while.body, !llvm.loop !23 while.end92: ; preds = %if.end91, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.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, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !17} !17 = !{!"llvm.loop.unswitch.partial.disable"} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !11, !12} !22 = distinct !{!22, !10, !12, !11} !23 = distinct !{!23, !10}
#include <stdio.h> int main(void){ int i,a; int x,y,z,w; scanf("%d",&a); x=a/1000;y=(a-x*1000)/100;z=(a-x*1000-y*100)/10; w=(a-x*1000-y*100-z*10); if(x==y||y==z||z==w) printf("Bad"); else printf("Good"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233773/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233773/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %div = sdiv i32 %0, 1000 %mul.neg = mul nsw i32 %div, -1000 %sub = add i32 %mul.neg, %0 %div1 = sdiv i32 %sub, 100 %mul4.neg = mul nsw i32 %div1, -100 %sub5 = add i32 %mul4.neg, %sub %div6 = sdiv i32 %sub5, 10 %mul11.neg = mul nsw i32 %div6, -10 %sub12 = add i32 %mul11.neg, %sub5 %cmp = icmp eq i32 %div, %div1 %cmp13 = icmp eq i32 %div1, %div6 %or.cond = or i1 %cmp, %cmp13 %cmp15 = icmp eq i32 %div6, %sub12 %or.cond26 = or i1 %or.cond, %cmp15 %.str.1..str.2 = select i1 %or.cond26, ptr @.str.1, ptr @.str.2 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void){ char s[4]; int i,j; scanf("%s",s); for(i=0;i<3;i++){ if(s[i]==s[i+1]){ printf("Bad"); return 0; } } printf("Good"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233816/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233816/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\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) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4 = icmp eq i8 %0, %1 br i1 %cmp4, label %cleanup, label %for.cond.1, !llvm.loop !8 for.cond.1: ; preds = %entry %arrayidx2.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx2.1, align 1, !tbaa !5 %cmp4.1 = icmp eq i8 %1, %2 %arrayidx2.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx2.2, align 1 %cmp4.2 = icmp eq i8 %2, %3 %or.cond = select i1 %cmp4.1, i1 true, i1 %cmp4.2 %spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2 br label %cleanup, !llvm.loop !8 cleanup: ; preds = %for.cond.1, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %for.cond.1 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { char s[100]; scanf("%s",&s); if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]||s[3]==s[4]) { printf("Bad\n"); } else { printf("Good\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233867/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233867/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [5 x i8] c"Good\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %arrayidx1 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %arrayidx6 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 2, !tbaa !5 %cmp8 = icmp eq i8 %1, %2 br i1 %cmp8, label %if.end, label %lor.lhs.false10 lor.lhs.false10: ; preds = %lor.lhs.false %arrayidx13 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1, !tbaa !5 %cmp15 = icmp eq i8 %2, %3 %arrayidx20 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx20, align 4 %cmp22 = icmp eq i8 %3, %4 %or.cond = select i1 %cmp15, i1 true, i1 %cmp22 %spec.select = select i1 %or.cond, ptr @str.3, ptr @str br label %if.end if.end: ; preds = %lor.lhs.false10, %entry, %lor.lhs.false %str.sink = phi ptr [ @str.3, %lor.lhs.false ], [ @str.3, %entry ], [ %spec.select, %lor.lhs.false10 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main() { char a[10000]; int b; scanf("%s%d",a,&b); int c=strlen(a); int check=0; int i,j; if(c%b==0) { int d=c/b; int e=0; int w=0; for(j=0;j<b;j++) { if(j>0) { e=e+d; } w=0; for(i=e;i<e+d;i++) { w++; if(a[i]==a[e+d-w]) { } else { check=1; break; } } if(check==1) { break; } } if(check==0) printf("YES\n"); else printf("NO\n"); } else { printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23391/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23391/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10000 x i8], align 16 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 10000, 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 %a, ptr noundef nonnull %b) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6 %conv = trunc i64 %call2 to i32 %0 = load i32, ptr %b, align 4, !tbaa !5 %rem = srem i32 %conv, %0 %div = sdiv i32 %conv, %0 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.then, label %if.end40 if.then: ; preds = %entry %cmp4.not58 = icmp sgt i32 %0, 0 br i1 %cmp4.not58, label %for.body.preheader, label %if.end40 for.body.preheader: ; preds = %if.then %cmp1155 = icmp sgt i32 %div, 0 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc28 %e.060 = phi i32 [ %spec.select, %for.inc28 ], [ 0, %for.body.preheader ] %j.059 = phi i32 [ %inc29, %for.inc28 ], [ 0, %for.body.preheader ] %cmp6.not = icmp eq i32 %j.059, 0 %add = select i1 %cmp6.not, i32 0, i32 %div %spec.select = add i32 %add, %e.060 br i1 %cmp1155, label %for.body13.preheader, label %for.inc28 for.body13.preheader: ; preds = %for.body %add10 = add nsw i32 %spec.select, %div %1 = sext i32 %add10 to i64 %2 = sext i32 %spec.select to i64 br label %for.body13 for.cond9: ; preds = %for.body13 %indvars.iv.next63 = add nsw i64 %indvars.iv62, 1 %cmp11 = icmp slt i64 %indvars.iv.next63, %1 br i1 %cmp11, label %for.body13, label %for.inc28, !llvm.loop !9 for.body13: ; preds = %for.body13.preheader, %for.cond9 %indvars.iv62 = phi i64 [ %2, %for.body13.preheader ], [ %indvars.iv.next63, %for.cond9 ] %indvars.iv = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next, %for.cond9 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [10000 x i8], ptr %a, i64 0, i64 %indvars.iv62 %3 = load i8, ptr %arrayidx, align 1, !tbaa !11 %4 = sub nsw i64 %1, %indvars.iv.next %arrayidx17 = getelementptr inbounds [10000 x i8], ptr %a, i64 0, i64 %4 %5 = load i8, ptr %arrayidx17, align 1, !tbaa !11 %cmp19 = icmp eq i8 %3, %5 br i1 %cmp19, label %for.cond9, label %if.end40 for.inc28: ; preds = %for.cond9, %for.body %inc29 = add nuw nsw i32 %j.059, 1 %exitcond.not = icmp eq i32 %inc29, %0 br i1 %exitcond.not, label %if.end40, label %for.body, !llvm.loop !12 if.end40: ; preds = %for.inc28, %for.body13, %entry, %if.then %str.4.sink = phi ptr [ @str.4, %if.then ], [ @str.3, %entry ], [ @str.3, %for.body13 ], [ @str.4, %for.inc28 ] %puts54 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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}
#include<stdio.h> int main() { long n,i,d,c=0,a[5],k=0,dig=0; scanf("%ld",&n); while(dig<4) { d=n%10; a[k]=d; k++; n=n/10; dig++; } for(i=0;i<3;i++) { if(a[i]==a[i+1]) { c++; break; } } if(c>0) { printf("Bad"); } else { printf("Good"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233960/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233960/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %n.promoted = load i64, ptr %n, align 8, !tbaa !5 %rem = srem i64 %n.promoted, 10 %div = sdiv i64 %n.promoted, 10 %rem.1 = srem i64 %div, 10 %div.1 = sdiv i64 %n.promoted, 100 %rem.2 = srem i64 %div.1, 10 %div.2 = sdiv i64 %n.promoted, 1000 %rem.3 = srem i64 %div.2, 10 %div.3 = sdiv i64 %n.promoted, 10000 store i64 %div.3, ptr %n, align 8, !tbaa !5 %cmp5 = icmp eq i64 %rem, %rem.1 %cmp5.1 = icmp eq i64 %rem.1, %rem.2 %or.cond = or i1 %cmp5, %cmp5.1 %cmp5.2 = icmp eq i64 %rem.2, %rem.3 %or.cond25 = or i1 %or.cond, %cmp5.2 %.str.1..str.2 = select i1 %or.cond25, ptr @.str.1, ptr @.str.2 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char p[5]; scanf("%s",p); if(p[0]==p[1]||p[1]==p[2]||p[2]==p[3]){ puts("Bad"); }else{ puts("Good"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234002/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234002/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %p) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p) %0 = load i8, ptr %p, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [5 x i8], ptr %p, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %arrayidx6 = getelementptr inbounds [5 x i8], ptr %p, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, %2 %arrayidx13 = getelementptr inbounds [5 x i8], ptr %p, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1 %cmp15 = icmp eq i8 %2, %3 %or.cond = select i1 %cmp8, i1 true, i1 %cmp15 %spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2 br label %if.end if.end: ; preds = %lor.lhs.false, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false ] %call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %p) #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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main (void){ int S,i,s[5]; scanf("%d",&S); for(i=0;i<4;i++){ s[i]=S%10; S=(int)S/10; } if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]){ printf("Bad"); }else{ printf("Good"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234046/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234046/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %S.promoted = load i32, ptr %S, align 4, !tbaa !5 %rem = srem i32 %S.promoted, 10 %div = sdiv i32 %S.promoted, 10 %rem.1 = srem i32 %div, 10 %div.3 = sdiv i32 %S.promoted, 10000 store i32 %div.3, ptr %S, align 4, !tbaa !5 %cmp3 = icmp eq i32 %rem, %rem.1 br i1 %cmp3, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %div.2 = sdiv i32 %S.promoted, 1000 %rem.3 = srem i32 %div.2, 10 %div.1 = sdiv i32 %S.promoted, 100 %rem.2 = srem i32 %div.1, 10 %cmp6 = icmp eq i32 %rem.1, %rem.2 %cmp10 = icmp eq i32 %rem.2, %rem.3 %or.cond = or i1 %cmp6, %cmp10 %spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2 br label %if.end if.end: ; preds = %lor.lhs.false, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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){ char S[5],i; scanf("%s",S); for(i = 0;i < 4;i++){ if(S[i] == S[i + 1]){ printf("Bad"); return 0; } } printf("Good"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234097/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234097/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %arrayidx5 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %0, %1 br i1 %cmp7, label %if.then, label %for.cond for.cond: ; preds = %entry %arrayidx5.1 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 2 %2 = load i8, ptr %arrayidx5.1, align 1, !tbaa !5 %cmp7.1 = icmp eq i8 %1, %2 br i1 %cmp7.1, label %if.then, label %for.cond.1 for.cond.1: ; preds = %for.cond %arrayidx5.2 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3 %3 = load i8, ptr %arrayidx5.2, align 1, !tbaa !5 %cmp7.2 = icmp eq i8 %2, %3 %arrayidx5.3 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 4 %4 = load i8, ptr %arrayidx5.3, align 1 %cmp7.3 = icmp eq i8 %3, %4 %or.cond = select i1 %cmp7.2, i1 true, i1 %cmp7.3 br i1 %or.cond, label %if.then, label %cleanup if.then: ; preds = %for.cond.1, %for.cond, %entry br label %cleanup cleanup: ; preds = %for.cond.1, %if.then %.str.2.sink = phi ptr [ @.str.1, %if.then ], [ @.str.2, %for.cond.1 ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 5, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char s[256]; scanf("%s",s); if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3] || s[3] == s[4] ){ printf("Bad"); }else{ printf("Good"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234147/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Bad\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [256 x i8], align 16 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %arrayidx1 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %arrayidx6 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 2, !tbaa !5 %cmp8 = icmp eq i8 %1, %2 br i1 %cmp8, label %if.end, label %lor.lhs.false10 lor.lhs.false10: ; preds = %lor.lhs.false %arrayidx13 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1, !tbaa !5 %cmp15 = icmp eq i8 %2, %3 %arrayidx20 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx20, align 4 %cmp22 = icmp eq i8 %3, %4 %or.cond = select i1 %cmp15, i1 true, i1 %cmp22 %spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2 br label %if.end if.end: ; preds = %lor.lhs.false10, %entry, %lor.lhs.false %.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false10 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 256, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<string.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0) #define MOD 1000000007 int main(void){ int N; scanf("%d",&N); char Map[2][N+1]; scanf("%s",Map[0]); scanf("%s",Map[1]); long ans=1; for(int i=0;i<N;i++){ //縦置きのとき if(Map[0][i]==Map[1][i]){ if(i==0) ans=(ans*3)%MOD; else{ //一個前も縦置きなら if(Map[0][i-1]==Map[1][i-1]) ans=(ans*2)%MOD; } } //横置きのとき else{ if(i==0) ans=6; else{ //一個前も縦置きなら if(Map[0][i-1]==Map[1][i-1]) ans=(ans*2)%MOD; else{ if(Map[0][i]!=Map[0][i-1]) ans=(ans*3)%MOD; } } } } printf("%ld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %3 = shl nuw nsw i64 %1, 1 %vla = alloca i8, i64 %3, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %arrayidx2 = getelementptr inbounds i8, ptr %vla, i64 %1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2) %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp85 = icmp sgt i32 %4, 0 br i1 %cmp85, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %4 to i64 %5 = load i8, ptr %vla, align 16, !tbaa !9 %6 = load i8, ptr %arrayidx2, align 1, !tbaa !9 %cmp10.peel = icmp eq i8 %5, %6 %spec.select = select i1 %cmp10.peel, i64 3, i64 6 %exitcond.peel.not = icmp eq i32 %4, 1 br i1 %exitcond.peel.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.inc, %for.body.preheader, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body.preheader ], [ %ans.1, %for.inc ] %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.body.preheader ] %ans.086 = phi i64 [ %ans.1, %for.inc ], [ %spec.select, %for.body.preheader ] %arrayidx5 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %7 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %arrayidx8 = getelementptr inbounds i8, ptr %arrayidx2, i64 %indvars.iv %8 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %cmp10 = icmp eq i8 %7, %8 %9 = add nsw i64 %indvars.iv, -1 %arrayidx17 = getelementptr inbounds i8, ptr %vla, i64 %9 %10 = load i8, ptr %arrayidx17, align 1, !tbaa !9 %arrayidx22 = getelementptr inbounds i8, ptr %arrayidx2, i64 %9 %11 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %cmp24 = icmp eq i8 %10, %11 br i1 %cmp10, label %if.else, label %if.else34 if.else: ; preds = %for.body br i1 %cmp24, label %if.then26, label %for.inc if.then26: ; preds = %if.else %mul27 = shl nsw i64 %ans.086, 1 %rem28 = srem i64 %mul27, 1000000007 br label %for.inc if.else34: ; preds = %for.body br i1 %cmp24, label %if.then47, label %if.else50 if.then47: ; preds = %if.else34 %mul48 = shl nsw i64 %ans.086, 1 %rem49 = srem i64 %mul48, 1000000007 br label %for.inc if.else50: ; preds = %if.else34 %cmp60.not = icmp eq i8 %7, %10 br i1 %cmp60.not, label %for.inc, label %if.then62 if.then62: ; preds = %if.else50 %mul63 = mul nsw i64 %ans.086, 3 %rem64 = srem i64 %mul63, 1000000007 br label %for.inc for.inc: ; preds = %if.else, %if.then26, %if.then47, %if.then62, %if.else50 %ans.1 = phi i64 [ %rem28, %if.then26 ], [ %ans.086, %if.else ], [ %rem49, %if.then47 ], [ %rem64, %if.then62 ], [ %ans.086, %if.else50 ] %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 !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main(void) { long long X; scanf("%lld", &X); long long sum = 0; long long time = 0; // add unless exceed while (sum < X) { sum += (time++) + 1; } printf("%lld\n", time); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234240/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234240/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i64, ptr %X, align 8, !tbaa !5 %cmp5 = icmp sgt i64 %0, 0 br i1 %cmp5, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %time.07 = phi i64 [ %inc, %while.body ], [ 0, %entry ] %sum.06 = phi i64 [ %add1, %while.body ], [ 0, %entry ] %inc = add nuw nsw i64 %time.07, 1 %add1 = add nuw nsw i64 %inc, %sum.06 %cmp = icmp slt i64 %add1, %0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %time.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %while.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %time.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int a[6]; for(int i = 0;i < 6;i++) scanf("%d",&a[i]); int counter[4] = {0,0,0,0}; for(int i = 0;i < 6;i++){ counter[a[i]-1]++; } for(int i = 0;i < 4;i++){ if(counter[i] >= 3){ printf("NO\n"); return 0; } } printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234284/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234284/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [6 x i32], align 16 %counter = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %a, 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 %a, 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 %a, 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 %a, 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 %a, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %counter) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %counter, i8 0, i64 16, i1 false) %0 = load i32, ptr %a, align 16, !tbaa !5 %sub = add nsw i32 %0, -1 %idxprom8 = sext i32 %sub to i64 %arrayidx9 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %inc10 = add nsw i32 %1, 1 store i32 %inc10, ptr %arrayidx9, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %sub.1 = add nsw i32 %2, -1 %idxprom8.1 = sext i32 %sub.1 to i64 %arrayidx9.1 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8.1 %3 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %inc10.1 = add nsw i32 %3, 1 store i32 %inc10.1, ptr %arrayidx9.1, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %sub.2 = add nsw i32 %4, -1 %idxprom8.2 = sext i32 %sub.2 to i64 %arrayidx9.2 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8.2 %5 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5 %inc10.2 = add nsw i32 %5, 1 store i32 %inc10.2, ptr %arrayidx9.2, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %sub.3 = add nsw i32 %6, -1 %idxprom8.3 = sext i32 %sub.3 to i64 %arrayidx9.3 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8.3 %7 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5 %inc10.3 = add nsw i32 %7, 1 store i32 %inc10.3, ptr %arrayidx9.3, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %sub.4 = add nsw i32 %8, -1 %idxprom8.4 = sext i32 %sub.4 to i64 %arrayidx9.4 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8.4 %9 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5 %inc10.4 = add nsw i32 %9, 1 store i32 %inc10.4, ptr %arrayidx9.4, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %sub.5 = add nsw i32 %10, -1 %idxprom8.5 = sext i32 %sub.5 to i64 %arrayidx9.5 = getelementptr inbounds [4 x i32], ptr %counter, i64 0, i64 %idxprom8.5 %11 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5 %inc10.5 = add nsw i32 %11, 1 store i32 %inc10.5, ptr %arrayidx9.5, align 4, !tbaa !5 %12 = load <4 x i32>, ptr %counter, align 16 %.fr = freeze <4 x i32> %12 %13 = icmp sgt <4 x i32> %.fr, <i32 2, i32 2, i32 2, i32 2> %14 = bitcast <4 x i1> %13 to i4 %.not = icmp eq i4 %14, 0 %str.str.3 = select i1 %.not, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %counter) #5 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree 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"}
#include <stdio.h> int main(void){ int a[4]={0,0,0,0}; int b[6]; int i; for(i=0;i<6;i++){ scanf("%d",&b[i]); } int k; for(k=0;k<6;k++){ a[b[k]-1]=a[b[k]-1]+1; } if(a[0]>0 && a[0]<3 && a[1]>0 && a[1]<3 && a[2]>0 && a[2]<3 && a[3]>0 && a[3]<3){ printf("YES\n"); }else{ printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234327/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i32], align 16 %b = alloca [6 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %a, i8 0, i64 16, i1 false) call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %b, 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 %b, 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 %b, 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 %b, 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 %b, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %0 = load i32, ptr %b, align 16, !tbaa !5 %sub = add nsw i32 %0, -1 %idxprom6 = sext i32 %sub to i64 %arrayidx7 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6 %1 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %1, 1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %sub.1 = add nsw i32 %2, -1 %idxprom6.1 = sext i32 %sub.1 to i64 %arrayidx7.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6.1 %3 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %add.1 = add nsw i32 %3, 1 store i32 %add.1, ptr %arrayidx7.1, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %sub.2 = add nsw i32 %4, -1 %idxprom6.2 = sext i32 %sub.2 to i64 %arrayidx7.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6.2 %5 = load i32, ptr %arrayidx7.2, align 4, !tbaa !5 %add.2 = add nsw i32 %5, 1 store i32 %add.2, ptr %arrayidx7.2, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %sub.3 = add nsw i32 %6, -1 %idxprom6.3 = sext i32 %sub.3 to i64 %arrayidx7.3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6.3 %7 = load i32, ptr %arrayidx7.3, align 4, !tbaa !5 %add.3 = add nsw i32 %7, 1 store i32 %add.3, ptr %arrayidx7.3, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %sub.4 = add nsw i32 %8, -1 %idxprom6.4 = sext i32 %sub.4 to i64 %arrayidx7.4 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6.4 %9 = load i32, ptr %arrayidx7.4, align 4, !tbaa !5 %add.4 = add nsw i32 %9, 1 store i32 %add.4, ptr %arrayidx7.4, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %sub.5 = add nsw i32 %10, -1 %idxprom6.5 = sext i32 %sub.5 to i64 %arrayidx7.5 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 %idxprom6.5 %11 = load i32, ptr %arrayidx7.5, align 4, !tbaa !5 %add.5 = add nsw i32 %11, 1 store i32 %add.5, ptr %arrayidx7.5, align 4, !tbaa !5 %12 = load i32, ptr %a, align 16 %13 = add i32 %12, -1 %or.cond = icmp ult i32 %13, 2 %arrayidx21 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1 %14 = load i32, ptr %arrayidx21, align 4 %cmp22 = icmp sgt i32 %14, 0 %or.cond40 = select i1 %or.cond, i1 %cmp22, i1 false %cmp25 = icmp slt i32 %14, 3 %or.cond41 = select i1 %or.cond40, i1 %cmp25, i1 false %arrayidx27 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2 %15 = load i32, ptr %arrayidx27, align 8 %cmp28 = icmp sgt i32 %15, 0 %or.cond42 = select i1 %or.cond41, i1 %cmp28, i1 false %cmp31 = icmp slt i32 %15, 3 %or.cond43 = select i1 %or.cond42, i1 %cmp31, i1 false %arrayidx33 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3 %16 = load i32, ptr %arrayidx33, align 4 %cmp34 = icmp sgt i32 %16, 0 %or.cond44 = select i1 %or.cond43, i1 %cmp34, i1 false %cmp37 = icmp slt i32 %16, 3 %or.cond45 = select i1 %or.cond44, i1 %cmp37, i1 false %str.3.str = select i1 %or.cond45, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #define df 0 int cost[8]; int val[8]; typedef long int li ; int main (){ int i,n,ga,sa,ba,gb,sb,bb; scanf("%d%d%d%d%d%d%d",&n,&ga,&sa,&ba,&gb,&sb,&bb); cost[0]=1; cost[1]=ga; cost[2]=sa; cost[3]=ba; cost[4]=gb; cost[5]=sb; cost[6]=bb; cost[7]=1; val[0]=1; val[1]=gb; val[2]=sb; val[3]=bb; val[4]=ga; val[5]=sa; val[6]=ba; val[7]=1; int* dp; dp=(int*)malloc(sizeof(int)*(n+1)); dp[0]=0; for(i=1;i<=n;i++){ dp[i]=0; int j; for(j=0;j<4;j++){ if(i>=cost[j]){ if(dp[i]<dp[i-cost[j]]+val[j])dp[i]=dp[i-cost[j]]+val[j]; } } } n=dp[n]; li* dp2; dp2=(li*)malloc(sizeof(li)*(n+1)); dp2[0]=0; for(i=1;i<=n;i++){ dp2[i]=0; int j; for(j=4;j<8;j++){ if(i>=cost[j]){ if(dp2[i]<dp2[i-cost[j]]+val[j])dp2[i]=dp2[i-cost[j]]+val[j]; } } } if(df){ for(i=0;i<=n;i++) printf("%ld ",dp2[i]); printf("\n"); } printf("%ld",dp2[n]); free(dp); free(dp2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234370/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d%d%d%d%d%d%d\00", align 1 @cost = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @val = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %ga = alloca i32, align 4 %sa = alloca i32, align 4 %ba = alloca i32, align 4 %gb = alloca i32, align 4 %sb = alloca i32, align 4 %bb = 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 %ga) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sa) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ba) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %gb) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sb) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %bb) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %ga, ptr noundef nonnull %sa, ptr noundef nonnull %ba, ptr noundef nonnull %gb, ptr noundef nonnull %sb, ptr noundef nonnull %bb) store i32 1, ptr @cost, align 16, !tbaa !5 %0 = load i32, ptr %ga, align 4, !tbaa !5 store i32 %0, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 1), align 4, !tbaa !5 %1 = load i32, ptr %sa, align 4, !tbaa !5 store i32 %1, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 2), align 8, !tbaa !5 %2 = load i32, ptr %ba, align 4, !tbaa !5 store i32 %2, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 3), align 4, !tbaa !5 %3 = load i32, ptr %gb, align 4, !tbaa !5 store i32 %3, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 4), align 16, !tbaa !5 %4 = load i32, ptr %sb, align 4, !tbaa !5 store i32 %4, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 5), align 4, !tbaa !5 %5 = load i32, ptr %bb, align 4, !tbaa !5 store i32 %5, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 6), align 8, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @cost, i64 0, i64 7), align 4, !tbaa !5 store i32 1, ptr @val, align 16, !tbaa !5 store i32 %3, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 1), align 4, !tbaa !5 store i32 %4, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 2), align 8, !tbaa !5 store i32 %5, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 3), align 4, !tbaa !5 store i32 %0, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 4), align 16, !tbaa !5 store i32 %1, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 5), align 4, !tbaa !5 store i32 %2, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 6), align 8, !tbaa !5 store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @val, i64 0, i64 7), align 4, !tbaa !5 %6 = load i32, ptr %n, align 4, !tbaa !5 %add = add i32 %6, 1 %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 %cmp.not142 = icmp slt i32 %6, 1 br i1 %cmp.not142, label %for.end37, label %for.body.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %add to i64 %7 = sext i32 %0 to i64 %8 = sext i32 %1 to i64 %9 = sext i32 %2 to i64 br label %if.then if.then: ; preds = %for.inc.3, %for.body.preheader %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc.3 ] %arrayidx3 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv store i32 0, ptr %arrayidx3, align 4, !tbaa !5 %sub = shl i64 %indvars.iv, 32 %sext = add i64 %sub, -4294967296 %idxprom16 = ashr exact i64 %sext, 32 %arrayidx17 = getelementptr inbounds i32, ptr %call1, i64 %idxprom16 %10 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %10, -1 br i1 %cmp21, label %if.then23, label %for.inc if.then23: ; preds = %if.then %add20 = add nuw nsw i32 %10, 1 store i32 %add20, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then23, %if.then %11 = phi i32 [ %add20, %if.then23 ], [ 0, %if.then ] %cmp10.not.1 = icmp slt i64 %indvars.iv, %7 br i1 %cmp10.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %12 = trunc i64 %indvars.iv to i32 %sub.1 = sub nsw i32 %12, %0 %idxprom16.1 = sext i32 %sub.1 to i64 %arrayidx17.1 = getelementptr inbounds i32, ptr %call1, i64 %idxprom16.1 %13 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %add20.1 = add nsw i32 %3, %13 %cmp21.1 = icmp slt i32 %11, %add20.1 br i1 %cmp21.1, label %if.then23.1, label %for.inc.1 if.then23.1: ; preds = %if.then.1 store i32 %add20.1, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then23.1, %if.then.1, %for.inc %14 = phi i32 [ %add20.1, %if.then23.1 ], [ %11, %if.then.1 ], [ %11, %for.inc ] %cmp10.not.2 = icmp slt i64 %indvars.iv, %8 br i1 %cmp10.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %15 = trunc i64 %indvars.iv to i32 %sub.2 = sub nsw i32 %15, %1 %idxprom16.2 = sext i32 %sub.2 to i64 %arrayidx17.2 = getelementptr inbounds i32, ptr %call1, i64 %idxprom16.2 %16 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %add20.2 = add nsw i32 %4, %16 %cmp21.2 = icmp slt i32 %14, %add20.2 br i1 %cmp21.2, label %if.then23.2, label %for.inc.2 if.then23.2: ; preds = %if.then.2 store i32 %add20.2, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then23.2, %if.then.2, %for.inc.1 %17 = phi i32 [ %add20.2, %if.then23.2 ], [ %14, %if.then.2 ], [ %14, %for.inc.1 ] %cmp10.not.3 = icmp slt i64 %indvars.iv, %9 br i1 %cmp10.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %18 = trunc i64 %indvars.iv to i32 %sub.3 = sub nsw i32 %18, %2 %idxprom16.3 = sext i32 %sub.3 to i64 %arrayidx17.3 = getelementptr inbounds i32, ptr %call1, i64 %idxprom16.3 %19 = load i32, ptr %arrayidx17.3, align 4, !tbaa !5 %add20.3 = add nsw i32 %5, %19 %cmp21.3 = icmp slt i32 %17, %add20.3 br i1 %cmp21.3, label %if.then23.3, label %for.inc.3 if.then23.3: ; preds = %if.then.3 store i32 %add20.3, ptr %arrayidx3, align 4, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then23.3, %if.then.3, %for.inc.2 %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.end37, label %if.then, !llvm.loop !9 for.end37: ; preds = %for.inc.3, %entry %idxprom38 = sext i32 %6 to i64 %arrayidx39 = getelementptr inbounds i32, ptr %call1, i64 %idxprom38 %20 = load i32, ptr %arrayidx39, align 4, !tbaa !5 store i32 %20, ptr %n, align 4, !tbaa !5 %add40 = add i32 %20, 1 %conv41 = sext i32 %add40 to i64 %mul42 = shl nsw i64 %conv41, 3 %call43 = call noalias ptr @malloc(i64 noundef %mul42) #6 store i64 0, ptr %call43, align 8, !tbaa !11 %cmp46.not145 = icmp slt i32 %20, 1 br i1 %cmp46.not145, label %for.end93, label %for.body48.preheader for.body48.preheader: ; preds = %for.end37 %wide.trip.count156 = zext i32 %add40 to i64 %21 = sext i32 %3 to i64 %conv70 = sext i32 %0 to i64 %22 = sext i32 %4 to i64 %conv70.1 = sext i32 %1 to i64 %23 = sext i32 %5 to i64 %conv70.2 = sext i32 %2 to i64 br label %for.body48 for.body48: ; preds = %for.body48.preheader, %for.inc88.3 %indvars.iv153 = phi i64 [ 1, %for.body48.preheader ], [ %indvars.iv.next154, %for.inc88.3 ] %arrayidx50 = getelementptr inbounds i64, ptr %call43, i64 %indvars.iv153 store i64 0, ptr %arrayidx50, align 8, !tbaa !11 %cmp58.not = icmp slt i64 %indvars.iv153, %21 br i1 %cmp58.not, label %for.inc88, label %if.then60 if.then60: ; preds = %for.body48 %24 = trunc i64 %indvars.iv153 to i32 %sub65 = sub nsw i32 %24, %3 %idxprom66 = sext i32 %sub65 to i64 %arrayidx67 = getelementptr inbounds i64, ptr %call43, i64 %idxprom66 %25 = load i64, ptr %arrayidx67, align 8, !tbaa !11 %add71 = add nsw i64 %25, %conv70 %cmp72 = icmp sgt i64 %add71, 0 br i1 %cmp72, label %if.then74, label %for.inc88 if.then74: ; preds = %if.then60 store i64 %add71, ptr %arrayidx50, align 8, !tbaa !11 br label %for.inc88 for.inc88: ; preds = %for.body48, %if.then74, %if.then60 %26 = phi i64 [ 0, %for.body48 ], [ %add71, %if.then74 ], [ 0, %if.then60 ] %cmp58.not.1 = icmp slt i64 %indvars.iv153, %22 br i1 %cmp58.not.1, label %for.inc88.1, label %if.then60.1 if.then60.1: ; preds = %for.inc88 %27 = trunc i64 %indvars.iv153 to i32 %sub65.1 = sub nsw i32 %27, %4 %idxprom66.1 = sext i32 %sub65.1 to i64 %arrayidx67.1 = getelementptr inbounds i64, ptr %call43, i64 %idxprom66.1 %28 = load i64, ptr %arrayidx67.1, align 8, !tbaa !11 %add71.1 = add nsw i64 %28, %conv70.1 %cmp72.1 = icmp slt i64 %26, %add71.1 br i1 %cmp72.1, label %if.then74.1, label %for.inc88.1 if.then74.1: ; preds = %if.then60.1 store i64 %add71.1, ptr %arrayidx50, align 8, !tbaa !11 br label %for.inc88.1 for.inc88.1: ; preds = %if.then74.1, %if.then60.1, %for.inc88 %29 = phi i64 [ %add71.1, %if.then74.1 ], [ %26, %if.then60.1 ], [ %26, %for.inc88 ] %cmp58.not.2 = icmp slt i64 %indvars.iv153, %23 br i1 %cmp58.not.2, label %if.then60.3, label %if.then60.2 if.then60.2: ; preds = %for.inc88.1 %30 = trunc i64 %indvars.iv153 to i32 %sub65.2 = sub nsw i32 %30, %5 %idxprom66.2 = sext i32 %sub65.2 to i64 %arrayidx67.2 = getelementptr inbounds i64, ptr %call43, i64 %idxprom66.2 %31 = load i64, ptr %arrayidx67.2, align 8, !tbaa !11 %add71.2 = add nsw i64 %31, %conv70.2 %cmp72.2 = icmp slt i64 %29, %add71.2 br i1 %cmp72.2, label %if.then74.2, label %if.then60.3 if.then74.2: ; preds = %if.then60.2 store i64 %add71.2, ptr %arrayidx50, align 8, !tbaa !11 br label %if.then60.3 if.then60.3: ; preds = %for.inc88.1, %if.then60.2, %if.then74.2 %32 = phi i64 [ %add71.2, %if.then74.2 ], [ %29, %if.then60.2 ], [ %29, %for.inc88.1 ] %sub65.3 = shl i64 %indvars.iv153, 32 %sext158 = add i64 %sub65.3, -4294967296 %idxprom66.3 = ashr exact i64 %sext158, 32 %arrayidx67.3 = getelementptr inbounds i64, ptr %call43, i64 %idxprom66.3 %33 = load i64, ptr %arrayidx67.3, align 8, !tbaa !11 %cmp72.3.not = icmp sgt i64 %32, %33 br i1 %cmp72.3.not, label %for.inc88.3, label %if.then74.3 if.then74.3: ; preds = %if.then60.3 %add71.3 = add nsw i64 %33, 1 store i64 %add71.3, ptr %arrayidx50, align 8, !tbaa !11 br label %for.inc88.3 for.inc88.3: ; preds = %if.then74.3, %if.then60.3 %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.end93, label %for.body48, !llvm.loop !13 for.end93: ; preds = %for.inc88.3, %for.end37 %idxprom94 = sext i32 %20 to i64 %arrayidx95 = getelementptr inbounds i64, ptr %call43, i64 %idxprom94 %34 = load i64, ptr %arrayidx95, align 8, !tbaa !11 %call96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %34) call void @free(ptr noundef %call1) #5 call void @free(ptr noundef nonnull %call43) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %bb) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sb) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %gb) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ba) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sa) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ga) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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 #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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10}
#include<stdio.h> #define P 998244353 int main(void){ int n,k; int l[100],r[100]; int a[400400]={0}; int i,j; scanf("%d%d",&n,&k); for(i=0;i<k;i++){ scanf("%d%d",&l[i],&r[i]); } a[0]=1; for(i=0;i<n;i++){ for(j=0;j<k;j++){ a[i+l[j]]=(a[i+l[j]]+a[i])%P; a[i+r[j]+1]=(a[i+r[j]+1]-a[i]+P)%P; } a[i+2]=(a[i+2]+a[i+1])%P; } printf("%d\n",a[n-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234413/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234413/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %n = alloca i32, align 4 %k = alloca i32, align 4 %l = alloca [100 x i32], align 16 %r = alloca [100 x i32], align 16 %a = alloca [400400 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %r) #4 call void @llvm.lifetime.start.p0(i64 1601600, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1601600) %a, i8 0, i64 1601600, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %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 [100 x i32], ptr %l, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i32], ptr %r, 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 %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, %entry %.lcssa79 = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr %a, align 16, !tbaa !5 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp684 = icmp sgt i32 %3, 0 br i1 %cmp684, label %for.cond8.preheader.lr.ph, label %for.end55 for.cond8.preheader.lr.ph: ; preds = %for.end %cmp982 = icmp sgt i32 %.lcssa79, 0 %wide.trip.count102 = zext i32 %3 to i64 br i1 %cmp982, label %for.cond8.preheader.us.preheader, label %for.cond8.preheader.preheader for.cond8.preheader.preheader: ; preds = %for.cond8.preheader.lr.ph %xtraiter = and i64 %wide.trip.count102, 1 %4 = icmp eq i32 %3, 1 br i1 %4, label %for.end55.loopexit106.unr-lcssa, label %for.cond8.preheader.preheader.new for.cond8.preheader.preheader.new: ; preds = %for.cond8.preheader.preheader %unroll_iter = and i64 %wide.trip.count102, 4294967294 br label %for.cond8.preheader for.cond8.preheader.us.preheader: ; preds = %for.cond8.preheader.lr.ph %wide.trip.count96 = zext i32 %.lcssa79 to i64 br label %for.cond8.preheader.us for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.end41_crit_edge.us %indvars.iv98 = phi i64 [ 0, %for.cond8.preheader.us.preheader ], [ %indvars.iv.next99, %for.cond8.for.end41_crit_edge.us ] %arrayidx16.us = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %indvars.iv98 %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %5 = trunc i64 %indvars.iv98 to i32 %6 = trunc i64 %indvars.iv.next99 to i32 br label %for.body10.us for.body10.us: ; preds = %for.cond8.preheader.us, %for.body10.us %indvars.iv93 = phi i64 [ 0, %for.cond8.preheader.us ], [ %indvars.iv.next94, %for.body10.us ] %arrayidx12.us = getelementptr inbounds [100 x i32], ptr %l, i64 0, i64 %indvars.iv93 %7 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %add.us = add nsw i32 %7, %5 %idxprom13.us = sext i32 %add.us to i64 %arrayidx14.us = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %idxprom13.us %8 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %add17.us = add nsw i32 %9, %8 %rem.us = srem i32 %add17.us, 998244353 store i32 %rem.us, ptr %arrayidx14.us, align 4, !tbaa !5 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %indvars.iv93 %10 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5 %add26.us = add i32 %10, %6 %idxprom27.us = sext i32 %add26.us to i64 %arrayidx28.us = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %idxprom27.us %11 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %12 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %sub.us = add i32 %11, 998244353 %add31.us = sub i32 %sub.us, %12 %rem32.us = srem i32 %add31.us, 998244353 store i32 %rem32.us, ptr %arrayidx28.us, align 4, !tbaa !5 %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96 br i1 %exitcond97.not, label %for.cond8.for.end41_crit_edge.us, label %for.body10.us, !llvm.loop !11 for.cond8.for.end41_crit_edge.us: ; preds = %for.body10.us %13 = add nuw nsw i64 %indvars.iv98, 2 %arrayidx44.us = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %13 %14 = load i32, ptr %arrayidx44.us, align 4, !tbaa !5 %arrayidx47.us = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %indvars.iv.next99 %15 = load i32, ptr %arrayidx47.us, align 4, !tbaa !5 %add48.us = add nsw i32 %15, %14 %rem49.us = srem i32 %add48.us, 998244353 store i32 %rem49.us, ptr %arrayidx44.us, align 4, !tbaa !5 %exitcond103.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count102 br i1 %exitcond103.not, label %for.end55, label %for.cond8.preheader.us, !llvm.loop !12 for.cond8.preheader: ; preds = %for.cond8.preheader, %for.cond8.preheader.preheader.new %16 = phi i32 [ 0, %for.cond8.preheader.preheader.new ], [ %rem49.1, %for.cond8.preheader ] %indvars.iv89 = phi i64 [ 0, %for.cond8.preheader.preheader.new ], [ %indvars.iv.next90.1, %for.cond8.preheader ] %niter = phi i64 [ 0, %for.cond8.preheader.preheader.new ], [ %niter.next.1, %for.cond8.preheader ] %17 = add nuw nsw i64 %indvars.iv89, 2 %arrayidx44 = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %17 %18 = load i32, ptr %arrayidx44, align 8, !tbaa !5 %add48 = add nsw i32 %16, %18 %rem49 = srem i32 %add48, 998244353 store i32 %rem49, ptr %arrayidx44, align 8, !tbaa !5 %19 = add nuw nsw i64 %indvars.iv89, 3 %arrayidx44.1 = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %19 %20 = load i32, ptr %arrayidx44.1, align 4, !tbaa !5 %indvars.iv.next90.1 = add nuw nsw i64 %indvars.iv89, 2 %add48.1 = add nsw i32 %rem49, %20 %rem49.1 = srem i32 %add48.1, 998244353 store i32 %rem49.1, ptr %arrayidx44.1, align 4, !tbaa !5 %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.end55.loopexit106.unr-lcssa.loopexit, label %for.cond8.preheader, !llvm.loop !12 for.end55.loopexit106.unr-lcssa.loopexit: ; preds = %for.cond8.preheader %21 = add nuw nsw i64 %indvars.iv89, 4 br label %for.end55.loopexit106.unr-lcssa for.end55.loopexit106.unr-lcssa: ; preds = %for.end55.loopexit106.unr-lcssa.loopexit, %for.cond8.preheader.preheader %.unr = phi i32 [ 0, %for.cond8.preheader.preheader ], [ %rem49.1, %for.end55.loopexit106.unr-lcssa.loopexit ] %indvars.iv89.unr = phi i64 [ 2, %for.cond8.preheader.preheader ], [ %21, %for.end55.loopexit106.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end55, label %for.cond8.preheader.epil for.cond8.preheader.epil: ; preds = %for.end55.loopexit106.unr-lcssa %arrayidx44.epil = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %indvars.iv89.unr %22 = load i32, ptr %arrayidx44.epil, align 4, !tbaa !5 %add48.epil = add nsw i32 %.unr, %22 %rem49.epil = srem i32 %add48.epil, 998244353 store i32 %rem49.epil, ptr %arrayidx44.epil, align 4, !tbaa !5 br label %for.end55 for.end55: ; preds = %for.cond8.preheader.epil, %for.end55.loopexit106.unr-lcssa, %for.cond8.for.end41_crit_edge.us, %for.end %sub56 = add nsw i32 %3, -1 %idxprom57 = sext i32 %sub56 to i64 %arrayidx58 = getelementptr inbounds [400400 x i32], ptr %a, i64 0, i64 %idxprom57 %23 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23) call void @llvm.lifetime.end.p0(i64 1601600, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> int n,m,x; int ans=0; int c[12]={0}; int a[12][12]={{0}}; int ability[12]={0}; int sel[12]={0}; int tmp; void sum(int p[]) { tmp=0; for(int j=0;j<m;j++) ability[j]=0; for(int i=0;i<n;i++) { if(p[i]==1) { tmp+=c[i]; for(int j=0;j<m;j++) { ability[j]+=a[i][j]; } } } } void search(int i) { for(int k=0;k<=1;k++) { sel[i]=k; if(i==n-1) { sum(sel); int flag=0; for(int j=0;j<m;j++) { if(ability[j]<x) { flag=1; break; } } if(flag==0 && ans>tmp) ans=tmp; } else search(i+1); } } int main(void) { scanf("%d %d %d",&n,&m,&x); for(int i=0;i<n;i++) { scanf("%d",&c[i]); ans+=c[i]; for(int j=0;j<m;j++) { scanf("%d",&a[i][j]); ability[j]+=a[i][j]; } } for(int j=0;j<m;j++) { if(ability[j]<x) { printf("-1\n"); return 0; } } search(0); printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234558/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234558/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ans = dso_local local_unnamed_addr global i32 0, align 4 @c = dso_local global [12 x i32] zeroinitializer, align 16 @a = dso_local global [12 x [12 x i32]] zeroinitializer, align 16 @ability = dso_local local_unnamed_addr global [12 x i32] zeroinitializer, align 16 @sel = dso_local local_unnamed_addr global [12 x i32] zeroinitializer, align 16 @tmp = dso_local local_unnamed_addr global i32 0, align 4 @m = dso_local global i32 0, align 4 @n = dso_local global i32 0, align 4 @x = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @sum(ptr nocapture noundef readonly %p) local_unnamed_addr #0 { entry: store i32 0, ptr @tmp, align 4, !tbaa !5 %0 = load i32, ptr @m, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp37 = icmp sgt i32 %.fr, 0 br i1 %cmp37, label %for.cond1.preheader, label %for.cond1.preheader.thread for.cond1.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @ability, i8 0, i64 %2, i1 false), !tbaa !5 %3 = load i32, ptr @n, align 4, !tbaa !5 %cmp243 = icmp sgt i32 %3, 0 br i1 %cmp243, label %for.body4.us.preheader, label %for.cond.cleanup3 for.cond1.preheader.thread: ; preds = %entry %4 = load i32, ptr @n, align 4, !tbaa !5 %cmp24359 = icmp sgt i32 %4, 0 br i1 %cmp24359, label %for.body4.preheader, label %for.cond.cleanup3 for.body4.preheader: ; preds = %for.cond1.preheader.thread %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %4, 1 br i1 %5, label %for.cond.cleanup3.loopexit65.unr-lcssa, label %for.body4.preheader.new for.body4.preheader.new: ; preds = %for.body4.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body4 for.body4.us.preheader: ; preds = %for.cond1.preheader %wide.trip.count57 = zext i32 %3 to i64 %wide.trip.count52 = zext i32 %.fr to i64 %min.iters.check = icmp ult i32 %.fr, 8 %n.vec = and i64 %wide.trip.count52, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count52 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.preheader, %for.inc25.us %indvars.iv54 = phi i64 [ 0, %for.body4.us.preheader ], [ %indvars.iv.next55, %for.inc25.us ] %add4244.us = phi i32 [ 0, %for.body4.us.preheader ], [ %add41.us, %for.inc25.us ] %arrayidx6.us = getelementptr inbounds i32, ptr %p, i64 %indvars.iv54 %6 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %cmp7.us = icmp eq i32 %6, 1 br i1 %cmp7.us, label %if.then.us, label %for.inc25.us if.then.us: ; preds = %for.body4.us %arrayidx9.us = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv54 %7 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %add.us = add nsw i32 %add4244.us, %7 store i32 %add.us, ptr @tmp, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body14.us.preheader, label %vector.body vector.body: ; preds = %if.then.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %if.then.us ] %8 = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load62 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %index %wide.load63 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load64 = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = add nsw <4 x i32> %wide.load63, %wide.load %13 = add nsw <4 x i32> %wide.load64, %wide.load62 store <4 x i32> %12, ptr %10, align 16, !tbaa !5 store <4 x i32> %13, ptr %11, align 16, !tbaa !5 %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 br i1 %cmp.n, label %for.inc25.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %if.then.us, %middle.block %indvars.iv49.ph = phi i64 [ 0, %if.then.us ], [ %n.vec, %middle.block ] br label %for.body14.us for.inc25.us: ; preds = %for.body14.us, %middle.block, %for.body4.us %add41.us = phi i32 [ %add4244.us, %for.body4.us ], [ %add.us, %middle.block ], [ %add.us, %for.body14.us ] %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57 br i1 %exitcond58.not, label %for.cond.cleanup3, label %for.body4.us, !llvm.loop !13 for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body14.us ], [ %indvars.iv49.ph, %for.body14.us.preheader ] %arrayidx18.us = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54, i64 %indvars.iv49 %15 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %arrayidx20.us = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv49 %16 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5 %add21.us = add nsw i32 %16, %15 store i32 %add21.us, ptr %arrayidx20.us, align 4, !tbaa !5 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %exitcond53.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count52 br i1 %exitcond53.not, label %for.inc25.us, label %for.body14.us, !llvm.loop !14 for.cond.cleanup3.loopexit65.unr-lcssa: ; preds = %for.inc25.1, %for.body4.preheader %indvars.iv.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next.1, %for.inc25.1 ] %add4244.unr = phi i32 [ 0, %for.body4.preheader ], [ %add41.1, %for.inc25.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup3, label %for.body4.epil for.body4.epil: ; preds = %for.cond.cleanup3.loopexit65.unr-lcssa %arrayidx6.epil = getelementptr inbounds i32, ptr %p, i64 %indvars.iv.unr %17 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %cmp7.epil = icmp eq i32 %17, 1 br i1 %cmp7.epil, label %if.then.epil, label %for.cond.cleanup3 if.then.epil: ; preds = %for.body4.epil %arrayidx9.epil = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.unr %18 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %add4244.unr, %18 store i32 %add.epil, ptr @tmp, align 4, !tbaa !5 br label %for.cond.cleanup3 for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit65.unr-lcssa, %if.then.epil, %for.body4.epil, %for.inc25.us, %for.cond1.preheader.thread, %for.cond1.preheader ret void for.body4: ; preds = %for.inc25.1, %for.body4.preheader.new %indvars.iv = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next.1, %for.inc25.1 ] %add4244 = phi i32 [ 0, %for.body4.preheader.new ], [ %add41.1, %for.inc25.1 ] %niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.inc25.1 ] %arrayidx6 = getelementptr inbounds i32, ptr %p, i64 %indvars.iv %19 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %19, 1 br i1 %cmp7, label %if.then, label %for.inc25 if.then: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv %20 = load i32, ptr %arrayidx9, align 8, !tbaa !5 %add = add nsw i32 %add4244, %20 store i32 %add, ptr @tmp, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %if.then, %for.body4 %add41 = phi i32 [ %add, %if.then ], [ %add4244, %for.body4 ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx6.1 = getelementptr inbounds i32, ptr %p, i64 %indvars.iv.next %21 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %cmp7.1 = icmp eq i32 %21, 1 br i1 %cmp7.1, label %if.then.1, label %for.inc25.1 if.then.1: ; preds = %for.inc25 %arrayidx9.1 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.next %22 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %add.1 = add nsw i32 %add41, %22 store i32 %add.1, ptr @tmp, align 4, !tbaa !5 br label %for.inc25.1 for.inc25.1: ; preds = %if.then.1, %for.inc25 %add41.1 = phi i32 [ %add.1, %if.then.1 ], [ %add41, %for.inc25 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup3.loopexit65.unr-lcssa, label %for.body4, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @search(i32 noundef %i) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %for.inc15, %entry %i.tr = phi i32 [ %i, %entry ], [ %add, %for.inc15 ] %idxprom = sext i32 %i.tr to i64 %arrayidx = getelementptr inbounds [12 x i32], ptr @sel, i64 0, i64 %idxprom %add = add nsw i32 %i.tr, 1 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %cmp1 = icmp eq i32 %sub, %i.tr br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %tailrecurse store i32 0, ptr @tmp, align 4, !tbaa !5 %1 = load i32, ptr @m, align 4, !tbaa !5 %.fr.i = freeze i32 %1 %cmp37.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp37.i, label %for.cond1.preheader.i, label %for.cond1.preheader.thread.i for.cond1.preheader.i: ; preds = %if.then %2 = zext i32 %.fr.i to i64 %3 = shl nuw nsw i64 %2, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @ability, i8 0, i64 %3, i1 false), !tbaa !5 %cmp243.i = icmp sgt i32 %0, 0 br i1 %cmp243.i, label %for.body4.us.preheader.i, label %for.body5.lr.ph for.cond1.preheader.thread.i: ; preds = %if.then %cmp24359.i = icmp sgt i32 %0, 0 br i1 %cmp24359.i, label %for.body4.preheader.i, label %land.lhs.true for.body4.preheader.i: ; preds = %for.cond1.preheader.thread.i %wide.trip.count.i = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %4 = icmp eq i32 %0, 1 br i1 %4, label %sum.exit.loopexit56.unr-lcssa, label %for.body4.preheader.i.new for.body4.preheader.i.new: ; preds = %for.body4.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body4.i for.body4.us.preheader.i: ; preds = %for.cond1.preheader.i %wide.trip.count57.i = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %.fr.i, 8 %n.vec = and i64 %2, 4294967288 %cmp.n = icmp eq i64 %n.vec, %2 br label %for.body4.us.i for.body4.us.i: ; preds = %for.inc25.us.i, %for.body4.us.preheader.i %indvars.iv54.i = phi i64 [ 0, %for.body4.us.preheader.i ], [ %indvars.iv.next55.i, %for.inc25.us.i ] %add4244.us.i = phi i32 [ 0, %for.body4.us.preheader.i ], [ %add41.us.i, %for.inc25.us.i ] %arrayidx6.us.i = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv54.i %5 = load i32, ptr %arrayidx6.us.i, align 4, !tbaa !5 %cmp7.us.i = icmp eq i32 %5, 1 br i1 %cmp7.us.i, label %if.then.us.i, label %for.inc25.us.i if.then.us.i: ; preds = %for.body4.us.i %arrayidx9.us.i = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv54.i %6 = load i32, ptr %arrayidx9.us.i, align 4, !tbaa !5 %add.us.i = add nsw i32 %6, %add4244.us.i store i32 %add.us.i, ptr @tmp, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body14.us.i.preheader, label %vector.body vector.body: ; preds = %if.then.us.i, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %if.then.us.i ] %7 = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54.i, i64 %index %wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load37 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %index %wide.load38 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load39 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = add nsw <4 x i32> %wide.load38, %wide.load %12 = add nsw <4 x i32> %wide.load39, %wide.load37 store <4 x i32> %11, ptr %9, align 16, !tbaa !5 store <4 x i32> %12, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc25.us.i, label %for.body14.us.i.preheader for.body14.us.i.preheader: ; preds = %if.then.us.i, %middle.block %indvars.iv49.i.ph = phi i64 [ 0, %if.then.us.i ], [ %n.vec, %middle.block ] br label %for.body14.us.i for.inc25.us.i: ; preds = %for.body14.us.i, %middle.block, %for.body4.us.i %add41.us.i = phi i32 [ %add4244.us.i, %for.body4.us.i ], [ %add.us.i, %middle.block ], [ %add.us.i, %for.body14.us.i ] %indvars.iv.next55.i = add nuw nsw i64 %indvars.iv54.i, 1 %exitcond58.not.i = icmp eq i64 %indvars.iv.next55.i, %wide.trip.count57.i br i1 %exitcond58.not.i, label %sum.exit, label %for.body4.us.i, !llvm.loop !13 for.body14.us.i: ; preds = %for.body14.us.i.preheader, %for.body14.us.i %indvars.iv49.i = phi i64 [ %indvars.iv.next50.i, %for.body14.us.i ], [ %indvars.iv49.i.ph, %for.body14.us.i.preheader ] %arrayidx18.us.i = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54.i, i64 %indvars.iv49.i %14 = load i32, ptr %arrayidx18.us.i, align 4, !tbaa !5 %arrayidx20.us.i = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv49.i %15 = load i32, ptr %arrayidx20.us.i, align 4, !tbaa !5 %add21.us.i = add nsw i32 %15, %14 store i32 %add21.us.i, ptr %arrayidx20.us.i, align 4, !tbaa !5 %indvars.iv.next50.i = add nuw nsw i64 %indvars.iv49.i, 1 %exitcond53.not.i = icmp eq i64 %indvars.iv.next50.i, %2 br i1 %exitcond53.not.i, label %for.inc25.us.i, label %for.body14.us.i, !llvm.loop !16 for.body4.i: ; preds = %for.inc25.i.169, %for.body4.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body4.preheader.i.new ], [ %indvars.iv.next.i.167, %for.inc25.i.169 ] %add4244.i = phi i32 [ 0, %for.body4.preheader.i.new ], [ %add41.i.166, %for.inc25.i.169 ] %niter = phi i64 [ 0, %for.body4.preheader.i.new ], [ %niter.next.1, %for.inc25.i.169 ] %arrayidx6.i = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.i %16 = load i32, ptr %arrayidx6.i, align 8, !tbaa !5 %cmp7.i = icmp eq i32 %16, 1 br i1 %cmp7.i, label %if.then.i, label %for.inc25.i if.then.i: ; preds = %for.body4.i %arrayidx9.i = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.i %17 = load i32, ptr %arrayidx9.i, align 8, !tbaa !5 %add.i = add nsw i32 %17, %add4244.i store i32 %add.i, ptr @tmp, align 4, !tbaa !5 br label %for.inc25.i for.inc25.i: ; preds = %if.then.i, %for.body4.i %add41.i = phi i32 [ %add.i, %if.then.i ], [ %add4244.i, %for.body4.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx6.i.160 = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.next.i %18 = load i32, ptr %arrayidx6.i.160, align 4, !tbaa !5 %cmp7.i.161 = icmp eq i32 %18, 1 br i1 %cmp7.i.161, label %if.then.i.165, label %for.inc25.i.169 if.then.i.165: ; preds = %for.inc25.i %arrayidx9.i.163 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.next.i %19 = load i32, ptr %arrayidx9.i.163, align 4, !tbaa !5 %add.i.164 = add nsw i32 %19, %add41.i store i32 %add.i.164, ptr @tmp, align 4, !tbaa !5 br label %for.inc25.i.169 for.inc25.i.169: ; preds = %if.then.i.165, %for.inc25.i %add41.i.166 = phi i32 [ %add.i.164, %if.then.i.165 ], [ %add41.i, %for.inc25.i ] %indvars.iv.next.i.167 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %sum.exit.loopexit56.unr-lcssa, label %for.body4.i, !llvm.loop !13 sum.exit.loopexit56.unr-lcssa: ; preds = %for.inc25.i.169, %for.body4.preheader.i %add41.i.lcssa.ph = phi i32 [ undef, %for.body4.preheader.i ], [ %add41.i.166, %for.inc25.i.169 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body4.preheader.i ], [ %indvars.iv.next.i.167, %for.inc25.i.169 ] %add4244.i.unr = phi i32 [ 0, %for.body4.preheader.i ], [ %add41.i.166, %for.inc25.i.169 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %sum.exit, label %for.body4.i.epil for.body4.i.epil: ; preds = %sum.exit.loopexit56.unr-lcssa %arrayidx6.i.epil = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.i.unr %20 = load i32, ptr %arrayidx6.i.epil, align 4, !tbaa !5 %cmp7.i.epil = icmp eq i32 %20, 1 br i1 %cmp7.i.epil, label %if.then.i.epil, label %sum.exit if.then.i.epil: ; preds = %for.body4.i.epil %arrayidx9.i.epil = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.i.unr %21 = load i32, ptr %arrayidx9.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %21, %add4244.i.unr store i32 %add.i.epil, ptr @tmp, align 4, !tbaa !5 br label %sum.exit sum.exit: ; preds = %sum.exit.loopexit56.unr-lcssa, %if.then.i.epil, %for.body4.i.epil, %for.inc25.us.i %22 = phi i32 [ %add41.us.i, %for.inc25.us.i ], [ %add41.i.lcssa.ph, %sum.exit.loopexit56.unr-lcssa ], [ %add.i.epil, %if.then.i.epil ], [ %add4244.i.unr, %for.body4.i.epil ] br i1 %cmp37.i, label %for.body5.lr.ph, label %land.lhs.true for.body5.lr.ph: ; preds = %for.cond1.preheader.i, %sum.exit %23 = phi i32 [ %22, %sum.exit ], [ 0, %for.cond1.preheader.i ] %24 = load i32, ptr @x, align 4, !tbaa !5 %wide.trip.count = zext i32 %.fr.i to i64 br label %for.body5 for.cond2: ; preds = %for.body5 %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 %land.lhs.true, label %for.body5, !llvm.loop !17 for.body5: ; preds = %for.body5.lr.ph, %for.cond2 %indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.cond2 ] %arrayidx7 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv %25 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp slt i32 %25, %24 br i1 %cmp8, label %for.inc15, label %for.cond2 land.lhs.true: ; preds = %for.cond2, %for.cond1.preheader.thread.i, %sum.exit %26 = phi i32 [ %22, %sum.exit ], [ 0, %for.cond1.preheader.thread.i ], [ %23, %for.cond2 ] %27 = load i32, ptr @ans, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %27, %26 br i1 %cmp11, label %if.then12, label %for.inc15 if.then12: ; preds = %land.lhs.true store i32 %26, ptr @ans, align 4, !tbaa !5 br label %for.inc15 if.else: ; preds = %tailrecurse tail call void @search(i32 noundef %add) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc15 for.inc15: ; preds = %for.body5, %land.lhs.true, %if.then12, %if.else %28 = phi i32 [ %0, %land.lhs.true ], [ %0, %if.then12 ], [ %.pre, %if.else ], [ %0, %for.body5 ] store i32 1, ptr %arrayidx, align 4, !tbaa !5 %sub.1 = add nsw i32 %28, -1 %cmp1.1 = icmp eq i32 %sub.1, %i.tr br i1 %cmp1.1, label %if.then.1, label %tailrecurse if.then.1: ; preds = %for.inc15 store i32 0, ptr @tmp, align 4, !tbaa !5 %29 = load i32, ptr @m, align 4, !tbaa !5 %.fr.i.1 = freeze i32 %29 %cmp37.i.1 = icmp sgt i32 %.fr.i.1, 0 br i1 %cmp37.i.1, label %for.cond1.preheader.i.1, label %for.cond1.preheader.thread.i.1 for.cond1.preheader.thread.i.1: ; preds = %if.then.1 %cmp24359.i.1 = icmp sgt i32 %28, 0 br i1 %cmp24359.i.1, label %for.body4.preheader.i.1, label %land.lhs.true.1 for.body4.preheader.i.1: ; preds = %for.cond1.preheader.thread.i.1 %wide.trip.count.i.1 = zext i32 %28 to i64 %xtraiter70 = and i64 %wide.trip.count.i.1, 1 %30 = icmp eq i32 %28, 1 br i1 %30, label %sum.exit.1.loopexit55.unr-lcssa, label %for.body4.preheader.i.1.new for.body4.preheader.i.1.new: ; preds = %for.body4.preheader.i.1 %unroll_iter73 = and i64 %wide.trip.count.i.1, 4294967294 br label %for.body4.i.1 for.body4.i.1: ; preds = %for.inc25.i.1.1, %for.body4.preheader.i.1.new %indvars.iv.i.1 = phi i64 [ 0, %for.body4.preheader.i.1.new ], [ %indvars.iv.next.i.1.1, %for.inc25.i.1.1 ] %add4244.i.1 = phi i32 [ 0, %for.body4.preheader.i.1.new ], [ %add41.i.1.1, %for.inc25.i.1.1 ] %niter74 = phi i64 [ 0, %for.body4.preheader.i.1.new ], [ %niter74.next.1, %for.inc25.i.1.1 ] %arrayidx6.i.1 = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.i.1 %31 = load i32, ptr %arrayidx6.i.1, align 8, !tbaa !5 %cmp7.i.1 = icmp eq i32 %31, 1 br i1 %cmp7.i.1, label %if.then.i.1, label %for.inc25.i.1 if.then.i.1: ; preds = %for.body4.i.1 %arrayidx9.i.1 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.i.1 %32 = load i32, ptr %arrayidx9.i.1, align 8, !tbaa !5 %add.i.1 = add nsw i32 %32, %add4244.i.1 store i32 %add.i.1, ptr @tmp, align 4, !tbaa !5 br label %for.inc25.i.1 for.inc25.i.1: ; preds = %if.then.i.1, %for.body4.i.1 %add41.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %add4244.i.1, %for.body4.i.1 ] %indvars.iv.next.i.1 = or i64 %indvars.iv.i.1, 1 %arrayidx6.i.1.1 = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.next.i.1 %33 = load i32, ptr %arrayidx6.i.1.1, align 4, !tbaa !5 %cmp7.i.1.1 = icmp eq i32 %33, 1 br i1 %cmp7.i.1.1, label %if.then.i.1.1, label %for.inc25.i.1.1 if.then.i.1.1: ; preds = %for.inc25.i.1 %arrayidx9.i.1.1 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.next.i.1 %34 = load i32, ptr %arrayidx9.i.1.1, align 4, !tbaa !5 %add.i.1.1 = add nsw i32 %34, %add41.i.1 store i32 %add.i.1.1, ptr @tmp, align 4, !tbaa !5 br label %for.inc25.i.1.1 for.inc25.i.1.1: ; preds = %if.then.i.1.1, %for.inc25.i.1 %add41.i.1.1 = phi i32 [ %add.i.1.1, %if.then.i.1.1 ], [ %add41.i.1, %for.inc25.i.1 ] %indvars.iv.next.i.1.1 = add nuw nsw i64 %indvars.iv.i.1, 2 %niter74.next.1 = add i64 %niter74, 2 %niter74.ncmp.1 = icmp eq i64 %niter74.next.1, %unroll_iter73 br i1 %niter74.ncmp.1, label %sum.exit.1.loopexit55.unr-lcssa, label %for.body4.i.1, !llvm.loop !13 for.cond1.preheader.i.1: ; preds = %if.then.1 %35 = zext i32 %.fr.i.1 to i64 %36 = shl nuw nsw i64 %35, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @ability, i8 0, i64 %36, i1 false), !tbaa !5 %cmp243.i.1 = icmp sgt i32 %28, 0 br i1 %cmp243.i.1, label %for.body4.us.preheader.i.1, label %for.body5.lr.ph.1 for.body4.us.preheader.i.1: ; preds = %for.cond1.preheader.i.1 %wide.trip.count57.i.1 = zext i32 %28 to i64 %min.iters.check42 = icmp ult i32 %.fr.i.1, 8 %n.vec45 = and i64 %35, 4294967288 %cmp.n47 = icmp eq i64 %n.vec45, %35 br label %for.body4.us.i.1 for.body4.us.i.1: ; preds = %for.inc25.us.i.1, %for.body4.us.preheader.i.1 %indvars.iv54.i.1 = phi i64 [ 0, %for.body4.us.preheader.i.1 ], [ %indvars.iv.next55.i.1, %for.inc25.us.i.1 ] %add4244.us.i.1 = phi i32 [ 0, %for.body4.us.preheader.i.1 ], [ %add41.us.i.1, %for.inc25.us.i.1 ] %arrayidx6.us.i.1 = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv54.i.1 %37 = load i32, ptr %arrayidx6.us.i.1, align 4, !tbaa !5 %cmp7.us.i.1 = icmp eq i32 %37, 1 br i1 %cmp7.us.i.1, label %if.then.us.i.1, label %for.inc25.us.i.1 if.then.us.i.1: ; preds = %for.body4.us.i.1 %arrayidx9.us.i.1 = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv54.i.1 %38 = load i32, ptr %arrayidx9.us.i.1, align 4, !tbaa !5 %add.us.i.1 = add nsw i32 %38, %add4244.us.i.1 store i32 %add.us.i.1, ptr @tmp, align 4, !tbaa !5 br i1 %min.iters.check42, label %for.body14.us.i.1.preheader, label %vector.body48 vector.body48: ; preds = %if.then.us.i.1, %vector.body48 %index49 = phi i64 [ %index.next54, %vector.body48 ], [ 0, %if.then.us.i.1 ] %39 = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54.i.1, i64 %index49 %wide.load50 = load <4 x i32>, ptr %39, align 16, !tbaa !5 %40 = getelementptr inbounds i32, ptr %39, i64 4 %wide.load51 = load <4 x i32>, ptr %40, align 16, !tbaa !5 %41 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %index49 %wide.load52 = load <4 x i32>, ptr %41, align 16, !tbaa !5 %42 = getelementptr inbounds i32, ptr %41, i64 4 %wide.load53 = load <4 x i32>, ptr %42, align 16, !tbaa !5 %43 = add nsw <4 x i32> %wide.load52, %wide.load50 %44 = add nsw <4 x i32> %wide.load53, %wide.load51 store <4 x i32> %43, ptr %41, align 16, !tbaa !5 store <4 x i32> %44, ptr %42, align 16, !tbaa !5 %index.next54 = add nuw i64 %index49, 8 %45 = icmp eq i64 %index.next54, %n.vec45 br i1 %45, label %middle.block40, label %vector.body48, !llvm.loop !18 middle.block40: ; preds = %vector.body48 br i1 %cmp.n47, label %for.inc25.us.i.1, label %for.body14.us.i.1.preheader for.body14.us.i.1.preheader: ; preds = %if.then.us.i.1, %middle.block40 %indvars.iv49.i.1.ph = phi i64 [ 0, %if.then.us.i.1 ], [ %n.vec45, %middle.block40 ] br label %for.body14.us.i.1 for.body14.us.i.1: ; preds = %for.body14.us.i.1.preheader, %for.body14.us.i.1 %indvars.iv49.i.1 = phi i64 [ %indvars.iv.next50.i.1, %for.body14.us.i.1 ], [ %indvars.iv49.i.1.ph, %for.body14.us.i.1.preheader ] %arrayidx18.us.i.1 = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv54.i.1, i64 %indvars.iv49.i.1 %46 = load i32, ptr %arrayidx18.us.i.1, align 4, !tbaa !5 %arrayidx20.us.i.1 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv49.i.1 %47 = load i32, ptr %arrayidx20.us.i.1, align 4, !tbaa !5 %add21.us.i.1 = add nsw i32 %47, %46 store i32 %add21.us.i.1, ptr %arrayidx20.us.i.1, align 4, !tbaa !5 %indvars.iv.next50.i.1 = add nuw nsw i64 %indvars.iv49.i.1, 1 %exitcond53.not.i.1 = icmp eq i64 %indvars.iv.next50.i.1, %35 br i1 %exitcond53.not.i.1, label %for.inc25.us.i.1, label %for.body14.us.i.1, !llvm.loop !19 for.inc25.us.i.1: ; preds = %for.body14.us.i.1, %middle.block40, %for.body4.us.i.1 %add41.us.i.1 = phi i32 [ %add4244.us.i.1, %for.body4.us.i.1 ], [ %add.us.i.1, %middle.block40 ], [ %add.us.i.1, %for.body14.us.i.1 ] %indvars.iv.next55.i.1 = add nuw nsw i64 %indvars.iv54.i.1, 1 %exitcond58.not.i.1 = icmp eq i64 %indvars.iv.next55.i.1, %wide.trip.count57.i.1 br i1 %exitcond58.not.i.1, label %sum.exit.1, label %for.body4.us.i.1, !llvm.loop !13 sum.exit.1.loopexit55.unr-lcssa: ; preds = %for.inc25.i.1.1, %for.body4.preheader.i.1 %add41.i.1.lcssa.ph = phi i32 [ undef, %for.body4.preheader.i.1 ], [ %add41.i.1.1, %for.inc25.i.1.1 ] %indvars.iv.i.1.unr = phi i64 [ 0, %for.body4.preheader.i.1 ], [ %indvars.iv.next.i.1.1, %for.inc25.i.1.1 ] %add4244.i.1.unr = phi i32 [ 0, %for.body4.preheader.i.1 ], [ %add41.i.1.1, %for.inc25.i.1.1 ] %lcmp.mod71.not = icmp eq i64 %xtraiter70, 0 br i1 %lcmp.mod71.not, label %sum.exit.1, label %for.body4.i.1.epil for.body4.i.1.epil: ; preds = %sum.exit.1.loopexit55.unr-lcssa %arrayidx6.i.1.epil = getelementptr inbounds i32, ptr @sel, i64 %indvars.iv.i.1.unr %48 = load i32, ptr %arrayidx6.i.1.epil, align 4, !tbaa !5 %cmp7.i.1.epil = icmp eq i32 %48, 1 br i1 %cmp7.i.1.epil, label %if.then.i.1.epil, label %sum.exit.1 if.then.i.1.epil: ; preds = %for.body4.i.1.epil %arrayidx9.i.1.epil = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv.i.1.unr %49 = load i32, ptr %arrayidx9.i.1.epil, align 4, !tbaa !5 %add.i.1.epil = add nsw i32 %49, %add4244.i.1.unr store i32 %add.i.1.epil, ptr @tmp, align 4, !tbaa !5 br label %sum.exit.1 sum.exit.1: ; preds = %sum.exit.1.loopexit55.unr-lcssa, %if.then.i.1.epil, %for.body4.i.1.epil, %for.inc25.us.i.1 %50 = phi i32 [ %add41.us.i.1, %for.inc25.us.i.1 ], [ %add41.i.1.lcssa.ph, %sum.exit.1.loopexit55.unr-lcssa ], [ %add.i.1.epil, %if.then.i.1.epil ], [ %add4244.i.1.unr, %for.body4.i.1.epil ] br i1 %cmp37.i.1, label %for.body5.lr.ph.1, label %land.lhs.true.1 for.body5.lr.ph.1: ; preds = %for.cond1.preheader.i.1, %sum.exit.1 %51 = phi i32 [ %50, %sum.exit.1 ], [ 0, %for.cond1.preheader.i.1 ] %52 = load i32, ptr @x, align 4, !tbaa !5 %wide.trip.count.1 = zext i32 %.fr.i.1 to i64 br label %for.body5.1 for.body5.1: ; preds = %for.cond2.1, %for.body5.lr.ph.1 %indvars.iv.1 = phi i64 [ 0, %for.body5.lr.ph.1 ], [ %indvars.iv.next.1, %for.cond2.1 ] %arrayidx7.1 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv.1 %53 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %cmp8.1 = icmp slt i32 %53, %52 br i1 %cmp8.1, label %for.inc15.1, label %for.cond2.1 for.cond2.1: ; preds = %for.body5.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count.1 br i1 %exitcond.1.not, label %land.lhs.true.1, label %for.body5.1, !llvm.loop !17 land.lhs.true.1: ; preds = %for.cond2.1, %for.cond1.preheader.thread.i.1, %sum.exit.1 %54 = phi i32 [ %50, %sum.exit.1 ], [ 0, %for.cond1.preheader.thread.i.1 ], [ %51, %for.cond2.1 ] %55 = load i32, ptr @ans, align 4, !tbaa !5 %cmp11.1 = icmp sgt i32 %55, %54 br i1 %cmp11.1, label %if.then12.1, label %for.inc15.1 if.then12.1: ; preds = %land.lhs.true.1 store i32 %54, ptr @ans, align 4, !tbaa !5 br label %for.inc15.1 for.inc15.1: ; preds = %for.body5.1, %if.then12.1, %land.lhs.true.1 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 @n, ptr noundef nonnull @m, ptr noundef nonnull @x) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp52 = icmp sgt i32 %0, 0 br i1 %cmp52, label %for.body, label %entry.for.cond24.preheader_crit_edge entry.for.cond24.preheader_crit_edge: ; preds = %entry %.pre = load i32, ptr @m, align 4, !tbaa !5 br label %for.cond24.preheader for.cond24.preheader: ; preds = %for.cond.cleanup6, %entry.for.cond24.preheader_crit_edge %1 = phi i32 [ %.pre, %entry.for.cond24.preheader_crit_edge ], [ %6, %for.cond.cleanup6 ] %cmp2554 = icmp sgt i32 %1, 0 br i1 %cmp2554, label %for.body27.lr.ph, label %for.end34 for.body27.lr.ph: ; preds = %for.cond24.preheader %2 = load i32, ptr @x, align 4, !tbaa !5 %wide.trip.count = zext i32 %1 to i64 br label %for.body27 for.body: ; preds = %entry, %for.cond.cleanup6 %indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.cond.cleanup6 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [12 x i32], ptr @c, i64 0, i64 %indvars.iv57 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %4 = load i32, ptr @ans, align 4, !tbaa !5 %add = add nsw i32 %4, %3 store i32 %add, ptr @ans, align 4, !tbaa !5 %5 = load i32, ptr @m, align 4, !tbaa !5 %cmp550 = icmp sgt i32 %5, 0 br i1 %cmp550, label %for.body7, label %for.cond.cleanup6 for.cond.cleanup6: ; preds = %for.body7, %for.body %6 = phi i32 [ %5, %for.body ], [ %11, %for.body7 ] %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %7 = load i32, ptr @n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next58, %8 br i1 %cmp, label %for.body, label %for.cond24.preheader, !llvm.loop !20 for.body7: ; preds = %for.body, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.body ] %arrayidx11 = getelementptr inbounds [12 x [12 x i32]], ptr @a, i64 0, i64 %indvars.iv57, i64 %indvars.iv %call12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11) %9 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv %10 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %add19 = add nsw i32 %10, %9 store i32 %add19, ptr %arrayidx18, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = load i32, ptr @m, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !21 for.cond24: ; preds = %for.body27 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count br i1 %exitcond.not, label %for.end34, label %for.body27, !llvm.loop !22 for.body27: ; preds = %for.body27.lr.ph, %for.cond24 %indvars.iv60 = phi i64 [ 0, %for.body27.lr.ph ], [ %indvars.iv.next61, %for.cond24 ] %arrayidx29 = getelementptr inbounds [12 x i32], ptr @ability, i64 0, i64 %indvars.iv60 %13 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp slt i32 %13, %2 br i1 %cmp30, label %cleanup, label %for.cond24 cleanup: ; preds = %for.body27 %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %return for.end34: ; preds = %for.cond24, %for.cond24.preheader tail call void @search(i32 noundef 0) %14 = load i32, ptr @ans, align 4, !tbaa !5 %call35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %14) br label %return return: ; preds = %cleanup, %for.end34 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 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: 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 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10, !11, !12} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#include<stdio.h> int main() { int n; scanf("%d", &n); char ans[102]; int i, j; for (i = 0; i < 2 * n; i++) ans[i] = '?'; int r, b, c; int min, mid, max; char minc; char res[16]; printf("?"); for (i = 0; i < n; i++) printf(" %d", i + 1); printf("\n"); fflush(stdout); scanf("%s", res); minc = res[0]; min = 0; max = n; while (max - min > 1) { mid = (max + min) / 2; printf("?"); for (i = 0; i < n; i++) printf(" %d", i + mid + 1); printf("\n"); fflush(stdout); scanf("%s", res); if (res[0] == minc) min = mid; else max = mid; } ans[min] = minc; if (minc == 'R') ans[max + n - 1] = 'B'; else ans[max + n - 1] = 'R'; for (j = max; j < min + n; j++) { printf("?"); for (i = min; i < max + n; i++) if (i != j) printf(" %d", i + 1); printf("\n"); fflush(stdout); scanf("%s", res); if (res[0] == 'B') ans[j] = 'R'; else ans[j] = 'B'; } for (;;) { c = -1; for (i = 0; i < 2 * n; i++) if (ans[i] == '?') c = i; if (c < 0) break; printf("?"); for (i = max; i < min + n ; i++) printf(" %d", i + 1); printf(" %d\n", c + 1); fflush(stdout); scanf("%s", res); if (res[0] == 'B') ans[c] = 'B'; else ans[c] = 'R'; } printf("! "); for (i = 0; i < 2 * n; i++) printf("%c", ans[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234644/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234644/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.5 = private unnamed_addr constant [5 x i8] c" %d\0A\00", align 1 @.str.6 = private unnamed_addr constant [3 x i8] c"! \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %ans = alloca [102 x i8], align 16 %res = alloca [16 x i8], align 16 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) call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %ans) #6 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp199 = icmp sgt i32 %0, 0 br i1 %cmp199, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %mul = shl nuw i32 %0, 1 %smax = call i32 @llvm.smax.i32(i32 %mul, i32 1) %1 = zext i32 %smax to i64 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %ans, i8 63, i64 %1, i1 false), !tbaa !9 br label %for.end for.end: ; preds = %for.body.preheader, %entry call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %res) #6 %putchar = call i32 @putchar(i32 63) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp3201 = icmp sgt i32 %2, 0 br i1 %cmp3201, label %for.body4, label %for.end8 for.body4: ; preds = %for.end, %for.body4 %i.1202 = phi i32 [ %add, %for.body4 ], [ 0, %for.end ] %add = add nuw nsw i32 %i.1202, 1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %add, %3 br i1 %cmp3, label %for.body4, label %for.end8, !llvm.loop !10 for.end8: ; preds = %for.body4, %for.end %putchar192 = call i32 @putchar(i32 10) %4 = load ptr, ptr @stdout, align 8, !tbaa !12 %call10 = call i32 @fflush(ptr noundef %4) %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %res) %5 = load i8, ptr %res, align 16, !tbaa !9 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp13205 = icmp sgt i32 %6, 1 br i1 %cmp13205, label %while.body, label %while.end while.body: ; preds = %for.end8, %for.end24 %max.0207 = phi i32 [ %max.0.div, %for.end24 ], [ %6, %for.end8 ] %min.0206 = phi i32 [ %div.min.0, %for.end24 ], [ 0, %for.end8 ] %add14 = add nsw i32 %max.0207, %min.0206 %div = sdiv i32 %add14, 2 %putchar197 = call i32 @putchar(i32 63) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp17203 = icmp sgt i32 %7, 0 br i1 %cmp17203, label %for.body18.lr.ph, label %for.end24 for.body18.lr.ph: ; preds = %while.body %add19 = add nsw i32 %div, 1 br label %for.body18 for.body18: ; preds = %for.body18.lr.ph, %for.body18 %i.2204 = phi i32 [ 0, %for.body18.lr.ph ], [ %inc23, %for.body18 ] %add20 = add i32 %add19, %i.2204 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add20) %inc23 = add nuw nsw i32 %i.2204, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp slt i32 %inc23, %8 br i1 %cmp17, label %for.body18, label %for.end24, !llvm.loop !14 for.end24: ; preds = %for.body18, %while.body %putchar198 = call i32 @putchar(i32 10) %9 = load ptr, ptr @stdout, align 8, !tbaa !12 %call26 = call i32 @fflush(ptr noundef %9) %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %res) %10 = load i8, ptr %res, align 16, !tbaa !9 %cmp31 = icmp eq i8 %10, %5 %div.min.0 = select i1 %cmp31, i32 %div, i32 %min.0206 %max.0.div = select i1 %cmp31, i32 %max.0207, i32 %div %sub = sub nsw i32 %max.0.div, %div.min.0 %cmp13 = icmp sgt i32 %sub, 1 br i1 %cmp13, label %while.body, label %while.end, !llvm.loop !15 while.end: ; preds = %for.end24, %for.end8 %min.0.lcssa = phi i32 [ 0, %for.end8 ], [ %div.min.0, %for.end24 ] %max.0.lcssa = phi i32 [ %6, %for.end8 ], [ %max.0.div, %for.end24 ] %idxprom33 = sext i32 %min.0.lcssa to i64 %arrayidx34 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %idxprom33 store i8 %5, ptr %arrayidx34, align 1, !tbaa !9 %cmp36 = icmp eq i8 %5, 82 %11 = load i32, ptr %n, align 4, !tbaa !5 %add39 = add i32 %max.0.lcssa, -1 %sub40 = add i32 %add39, %11 %idxprom41 = sext i32 %sub40 to i64 %arrayidx42 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %idxprom41 %. = select i1 %cmp36, i8 66, i8 82 store i8 %., ptr %arrayidx42, align 1, !tbaa !9 %add50212 = add nsw i32 %11, %min.0.lcssa %cmp51213 = icmp slt i32 %max.0.lcssa, %add50212 br i1 %cmp51213, label %for.body53.preheader, label %for.cond87.preheader for.body53.preheader: ; preds = %while.end %12 = sext i32 %max.0.lcssa to i64 br label %for.body53 for.cond87.preheader: ; preds = %for.end68, %while.end %13 = phi i32 [ %11, %while.end ], [ %21, %for.end68 ] %cmp90215241 = icmp sgt i32 %13, 0 br i1 %cmp90215241, label %for.body92.preheader, label %for.end134 for.body53: ; preds = %for.body53.preheader, %for.end68 %indvars.iv = phi i64 [ %12, %for.body53.preheader ], [ %indvars.iv.next, %for.end68 ] %putchar195 = call i32 @putchar(i32 63) %14 = load i32, ptr %n, align 4, !tbaa !5 %add56209 = add nsw i32 %14, %max.0.lcssa %cmp57210 = icmp slt i32 %min.0.lcssa, %add56209 br i1 %cmp57210, label %for.body59.preheader, label %for.end68 for.body59.preheader: ; preds = %for.body53 %15 = trunc i64 %indvars.iv to i32 br label %for.body59 for.body59: ; preds = %for.body59.preheader, %for.inc66 %16 = phi i32 [ %17, %for.inc66 ], [ %14, %for.body59.preheader ] %i.3211 = phi i32 [ %.pre235, %for.inc66 ], [ %min.0.lcssa, %for.body59.preheader ] %cmp60.not = icmp eq i32 %i.3211, %15 %.pre235 = add nsw i32 %i.3211, 1 br i1 %cmp60.not, label %for.inc66, label %if.then62 if.then62: ; preds = %for.body59 %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre235) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc66 for.inc66: ; preds = %for.body59, %if.then62 %17 = phi i32 [ %.pre, %if.then62 ], [ %16, %for.body59 ] %add56 = add nsw i32 %17, %max.0.lcssa %cmp57 = icmp slt i32 %.pre235, %add56 br i1 %cmp57, label %for.body59, label %for.end68, !llvm.loop !16 for.end68: ; preds = %for.inc66, %for.body53 %putchar196 = call i32 @putchar(i32 10) %18 = load ptr, ptr @stdout, align 8, !tbaa !12 %call70 = call i32 @fflush(ptr noundef %18) %call72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %res) %19 = load i8, ptr %res, align 16, !tbaa !9 %cmp75 = icmp eq i8 %19, 66 %spec.select239 = select i1 %cmp75, i8 82, i8 66 %20 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv store i8 %spec.select239, ptr %20, align 1 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %21 = load i32, ptr %n, align 4, !tbaa !5 %add50 = add nsw i32 %21, %min.0.lcssa %22 = sext i32 %add50 to i64 %cmp51 = icmp slt i64 %indvars.iv.next, %22 br i1 %cmp51, label %for.body53, label %for.cond87.preheader, !llvm.loop !17 for.body92.preheader: ; preds = %for.cond87.preheader, %for.end117 %23 = phi i32 [ %.pre234, %for.end117 ], [ %13, %for.cond87.preheader ] %mul89 = shl nuw i32 %23, 1 %smax230 = call i32 @llvm.smax.i32(i32 %mul89, i32 1) %wide.trip.count = zext i32 %smax230 to i64 %xtraiter = and i64 %wide.trip.count, 3 %24 = icmp ult i32 %smax230, 4 br i1 %24, label %for.end102.unr-lcssa, label %for.body92.preheader.new for.body92.preheader.new: ; preds = %for.body92.preheader %unroll_iter = and i64 %wide.trip.count, 2147483644 br label %for.body92 for.body92: ; preds = %for.body92, %for.body92.preheader.new %indvars.iv227 = phi i64 [ 0, %for.body92.preheader.new ], [ %indvars.iv.next228.3, %for.body92 ] %c.0216 = phi i32 [ -1, %for.body92.preheader.new ], [ %spec.select.3, %for.body92 ] %niter = phi i64 [ 0, %for.body92.preheader.new ], [ %niter.next.3, %for.body92 ] %arrayidx94 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv227 %25 = load i8, ptr %arrayidx94, align 4, !tbaa !9 %cmp96 = icmp eq i8 %25, 63 %26 = trunc i64 %indvars.iv227 to i32 %spec.select = select i1 %cmp96, i32 %26, i32 %c.0216 %indvars.iv.next228 = or i64 %indvars.iv227, 1 %arrayidx94.1 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv.next228 %27 = load i8, ptr %arrayidx94.1, align 1, !tbaa !9 %cmp96.1 = icmp eq i8 %27, 63 %28 = trunc i64 %indvars.iv.next228 to i32 %spec.select.1 = select i1 %cmp96.1, i32 %28, i32 %spec.select %indvars.iv.next228.1 = or i64 %indvars.iv227, 2 %arrayidx94.2 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv.next228.1 %29 = load i8, ptr %arrayidx94.2, align 2, !tbaa !9 %cmp96.2 = icmp eq i8 %29, 63 %30 = trunc i64 %indvars.iv.next228.1 to i32 %spec.select.2 = select i1 %cmp96.2, i32 %30, i32 %spec.select.1 %indvars.iv.next228.2 = or i64 %indvars.iv227, 3 %arrayidx94.3 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv.next228.2 %31 = load i8, ptr %arrayidx94.3, align 1, !tbaa !9 %cmp96.3 = icmp eq i8 %31, 63 %32 = trunc i64 %indvars.iv.next228.2 to i32 %spec.select.3 = select i1 %cmp96.3, i32 %32, i32 %spec.select.2 %indvars.iv.next228.3 = add nuw nsw i64 %indvars.iv227, 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.end102.unr-lcssa, label %for.body92, !llvm.loop !18 for.end102.unr-lcssa: ; preds = %for.body92, %for.body92.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body92.preheader ], [ %spec.select.3, %for.body92 ] %indvars.iv227.unr = phi i64 [ 0, %for.body92.preheader ], [ %indvars.iv.next228.3, %for.body92 ] %c.0216.unr = phi i32 [ -1, %for.body92.preheader ], [ %spec.select.3, %for.body92 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end102, label %for.body92.epil for.body92.epil: ; preds = %for.end102.unr-lcssa, %for.body92.epil %indvars.iv227.epil = phi i64 [ %indvars.iv.next228.epil, %for.body92.epil ], [ %indvars.iv227.unr, %for.end102.unr-lcssa ] %c.0216.epil = phi i32 [ %spec.select.epil, %for.body92.epil ], [ %c.0216.unr, %for.end102.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body92.epil ], [ 0, %for.end102.unr-lcssa ] %arrayidx94.epil = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv227.epil %33 = load i8, ptr %arrayidx94.epil, align 1, !tbaa !9 %cmp96.epil = icmp eq i8 %33, 63 %34 = trunc i64 %indvars.iv227.epil to i32 %spec.select.epil = select i1 %cmp96.epil, i32 %34, i32 %c.0216.epil %indvars.iv.next228.epil = add nuw nsw i64 %indvars.iv227.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.end102, label %for.body92.epil, !llvm.loop !19 for.end102: ; preds = %for.body92.epil, %for.end102.unr-lcssa %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end102.unr-lcssa ], [ %spec.select.epil, %for.body92.epil ] %cmp103 = icmp slt i32 %spec.select.lcssa, 0 br i1 %cmp103, label %for.end134, label %if.end106 if.end106: ; preds = %for.end102 %putchar193 = call i32 @putchar(i32 63) %35 = load i32, ptr %n, align 4, !tbaa !5 %add109219 = add nsw i32 %35, %min.0.lcssa %cmp110220 = icmp slt i32 %max.0.lcssa, %add109219 br i1 %cmp110220, label %for.body112, label %for.end117 for.body112: ; preds = %if.end106, %for.body112 %i.5221 = phi i32 [ %add113, %for.body112 ], [ %max.0.lcssa, %if.end106 ] %add113 = add nsw i32 %i.5221, 1 %call114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add113) %36 = load i32, ptr %n, align 4, !tbaa !5 %add109 = add nsw i32 %36, %min.0.lcssa %cmp110 = icmp slt i32 %add113, %add109 br i1 %cmp110, label %for.body112, label %for.end117, !llvm.loop !21 for.end117: ; preds = %for.body112, %if.end106 %add118 = add nuw nsw i32 %spec.select.lcssa, 1 %call119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add118) %37 = load ptr, ptr @stdout, align 8, !tbaa !12 %call120 = call i32 @fflush(ptr noundef %37) %call122 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %res) %38 = load i8, ptr %res, align 16, !tbaa !9 %cmp125 = icmp eq i8 %38, 66 %idxprom128 = zext i32 %spec.select.lcssa to i64 %arrayidx129 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %idxprom128 %.240 = select i1 %cmp125, i8 66, i8 82 store i8 %.240, ptr %arrayidx129, align 1, !tbaa !9 %.pre234 = load i32, ptr %n, align 4, !tbaa !5 %cmp90215 = icmp sgt i32 %.pre234, 0 br i1 %cmp90215, label %for.body92.preheader, label %for.end134 for.end134: ; preds = %for.end102, %for.end117, %for.cond87.preheader %call135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6) %39 = load i32, ptr %n, align 4, !tbaa !5 %cmp138223 = icmp sgt i32 %39, 0 br i1 %cmp138223, label %for.body140, label %for.end147 for.body140: ; preds = %for.end134, %for.body140 %indvars.iv231 = phi i64 [ %indvars.iv.next232, %for.body140 ], [ 0, %for.end134 ] %arrayidx142 = getelementptr inbounds [102 x i8], ptr %ans, i64 0, i64 %indvars.iv231 %40 = load i8, ptr %arrayidx142, align 1, !tbaa !9 %conv143 = sext i8 %40 to i32 %putchar194 = call i32 @putchar(i32 %conv143) %indvars.iv.next232 = add nuw nsw i64 %indvars.iv231, 1 %41 = load i32, ptr %n, align 4, !tbaa !5 %mul137 = shl nsw i32 %41, 1 %42 = sext i32 %mul137 to i64 %cmp138 = icmp slt i64 %indvars.iv.next232, %42 br i1 %cmp138, label %for.body140, label %for.end147, !llvm.loop !22 for.end147: ; preds = %for.body140, %for.end134 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %res) #6 call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %ans) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11} !17 = distinct !{!17, !11} !18 = distinct !{!18, !11} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !11} !22 = distinct !{!22, !11}
#include <stdlib.h> #include <stdio.h> int cmpf(const void *x, const void *y){ return (*(int*)x-*(int*)y); } int main(){ int N; scanf("%d",&N); int *a; a=malloc(sizeof(int)*N); for(int i=0;i<N;i++) scanf("%d",&a[i]); qsort(a,N,sizeof(int),cmpf); double mid=(double)a[N-1]/2; int malim=N-2,milim=0; while(malim-milim>1) { int now=(malim+milim)/2; if(a[now]>mid){ malim=now; } else if(a[now+1]<mid){ milim=now+1; } else{ malim=now+1; milim=now; } } printf("%d %d",a[N-1],((mid-(double)a[milim])<((double)a[malim]-mid)?a[milim]:a[malim])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234701/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234701/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpf(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, 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) #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 %cmp72 = icmp sgt i32 %0, 0 br i1 %cmp72, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %conv4.pre-phi = phi i64 [ %conv, %entry ], [ %4, %for.body ] call void @qsort(ptr noundef %call1, i64 noundef %conv4.pre-phi, i64 noundef 4, ptr noundef nonnull @cmpf) #6 %1 = load i32, ptr %N, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %idxprom5 = sext i32 %sub to i64 %arrayidx6 = getelementptr inbounds i32, ptr %call1, i64 %idxprom5 %2 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %conv7 = sitofp i32 %2 to double %div = fmul double %conv7, 5.000000e-01 %sub8 = add nsw i32 %1, -2 %cmp1074 = icmp sgt i32 %1, 3 br i1 %cmp1074, label %while.body, label %while.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds 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 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 while.body: ; preds = %for.cond.cleanup, %if.end28 %milim.076 = phi i32 [ %milim.1, %if.end28 ], [ 0, %for.cond.cleanup ] %malim.075 = phi i32 [ %malim.1, %if.end28 ], [ %sub8, %for.cond.cleanup ] %add = add nsw i32 %milim.076, %malim.075 %div12 = sdiv i32 %add, 2 %idxprom13 = sext i32 %div12 to i64 %arrayidx14 = getelementptr inbounds i32, ptr %call1, i64 %idxprom13 %5 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %conv15 = sitofp i32 %5 to double %cmp16 = fcmp olt double %div, %conv15 br i1 %cmp16, label %if.end28, label %if.else if.else: ; preds = %while.body %add18 = add nsw i32 %div12, 1 %idxprom19 = sext i32 %add18 to i64 %arrayidx20 = getelementptr inbounds i32, ptr %call1, i64 %idxprom19 %6 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %conv21 = sitofp i32 %6 to double %cmp22 = fcmp ogt double %div, %conv21 %malim.0.add18 = select i1 %cmp22, i32 %malim.075, i32 %add18 %add18.div12 = select i1 %cmp22, i32 %add18, i32 %div12 br label %if.end28 if.end28: ; preds = %if.else, %while.body %malim.1 = phi i32 [ %div12, %while.body ], [ %malim.0.add18, %if.else ] %milim.1 = phi i32 [ %milim.076, %while.body ], [ %add18.div12, %if.else ] %sub9 = sub nsw i32 %malim.1, %milim.1 %cmp10 = icmp sgt i32 %sub9, 1 br i1 %cmp10, label %while.body, label %while.end.loopexit, !llvm.loop !11 while.end.loopexit: ; preds = %if.end28 %7 = sext i32 %milim.1 to i64 br label %while.end while.end: ; preds = %while.end.loopexit, %for.cond.cleanup %malim.0.lcssa = phi i32 [ %sub8, %for.cond.cleanup ], [ %malim.1, %while.end.loopexit ] %milim.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %7, %while.end.loopexit ] %arrayidx33 = getelementptr inbounds i32, ptr %call1, i64 %milim.0.lcssa %8 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %conv34 = sitofp i32 %8 to double %sub35 = fsub double %div, %conv34 %idxprom36 = sext i32 %malim.0.lcssa to i64 %arrayidx37 = getelementptr inbounds i32, ptr %call1, i64 %idxprom36 %9 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %conv38 = sitofp i32 %9 to double %sub39 = fsub double %conv38, %div %cmp40 = fcmp olt double %sub35, %sub39 %. = select i1 %cmp40, i32 %8, i32 %9 %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree 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 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn 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 #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } 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}
//D - Road to Millionaire / //Hiia #include <stdio.h> typedef long long ll; int main(){ ll n; scanf("%lld", &n); ll a[200010]={}; for(ll i = 1; i <= n; i++){ scanf("%lld", &a[i]); } ll money=1000,tmp; for(ll i = 1; i <= n-1; i++){ if(a[i]<a[i+1]){ tmp=money/a[i]; money=money%a[i] + tmp*a[i+1]; } } printf("%lld\n", money); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234745/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234745/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca [200010 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, 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 1600080, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600080) %a, i8 0, i64 1600080, i1 false) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not30 = icmp slt i64 %0, 1 br i1 %cmp.not30, label %for.cond.cleanup5, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not.not32 = icmp sgt i64 %1, 1 br i1 %cmp4.not.not32, label %for.body6.preheader, label %for.cond.cleanup5 for.body6.preheader: ; preds = %for.cond3.preheader %arrayidx7.phi.trans.insert = getelementptr inbounds [200010 x i64], ptr %a, i64 0, i64 1 %.pre = load i64, ptr %arrayidx7.phi.trans.insert, align 8, !tbaa !5 br label %for.body6 for.body: ; preds = %entry, %for.body %i.031 = phi i64 [ %inc, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [200010 x i64], ptr %a, i64 0, i64 %i.031 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.031, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not.not = icmp slt i64 %i.031, %1 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.inc15, %entry, %for.cond3.preheader %money.0.lcssa = phi i64 [ 1000, %for.cond3.preheader ], [ 1000, %entry ], [ %money.1, %for.inc15 ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %money.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600080, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 for.body6: ; preds = %for.body6.preheader, %for.inc15 %2 = phi i64 [ %3, %for.inc15 ], [ %.pre, %for.body6.preheader ] %i2.034 = phi i64 [ %add, %for.inc15 ], [ 1, %for.body6.preheader ] %money.033 = phi i64 [ %money.1, %for.inc15 ], [ 1000, %for.body6.preheader ] %add = add nuw nsw i64 %i2.034, 1 %arrayidx8 = getelementptr inbounds [200010 x i64], ptr %a, i64 0, i64 %add %3 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %cmp9 = icmp slt i64 %2, %3 br i1 %cmp9, label %if.then, label %for.inc15 if.then: ; preds = %for.body6 %div = sdiv i64 %money.033, %2 %rem = srem i64 %money.033, %2 %mul = mul nsw i64 %div, %3 %add14 = add nsw i64 %rem, %mul br label %for.inc15 for.inc15: ; preds = %for.body6, %if.then %money.1 = phi i64 [ %add14, %if.then ], [ %money.033, %for.body6 ] %exitcond.not = icmp eq i64 %add, %1 br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> void upheap(int *buff, int n) { while (1) { int p = (n - 1) / 2; if (p < 0 || buff[p] >= buff[n]) break; int temp = buff[n]; buff[n] = buff[p]; buff[p] = temp; n = p; } } void downheap(int *buff, int n, int size) { while (1) { int c = 2 * n + 1; if (c >= size) break; if (c + 1 < size && buff[c] < buff[c + 1]) c++; if (buff[n] >= buff[c]) break; int temp = buff[n]; buff[n] = buff[c]; buff[c] = temp; n = c; } } int main(void) { char line[20]; fgets(line, 20, stdin); int n = atoi(line); int **Q; int *Q_i; Q = malloc(sizeof(int *) * n); Q_i = malloc(sizeof(int) * n * 200000); int i; for (i = 0; i < n; i++) { Q[i] = Q_i + i * 200000; } int *size; size = calloc(n, sizeof(int)); char *a; a = line; while (*a >= '0') a++; int q; q = atoi(a + 1); int op, t, x, s; while (q--) { fgets(line, 20, stdin); op = atoi(line); a = line + 2; t = atoi(a); s = size[t]; if (op == 0) { while (*a >= '0') a++; x = atoi(a + 1); Q[t][s] = x; upheap(Q[t], s); size[t] += 1; } else if (s != 0) { if (op == 1) printf("%d\n", Q[t][0]); else { Q[t][0] = Q[t][s-1]; downheap(Q[t], 0, s); size[t] -= 1; } } } free(Q); free(Q_i); free(size); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234789/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234789/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @upheap(ptr nocapture noundef %buff, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp30 = icmp slt i32 %n, 0 br i1 %cmp30, label %while.end, label %lor.lhs.false.preheader lor.lhs.false.preheader: ; preds = %entry %idxprom1.phi.trans.insert = zext i32 %n to i64 %arrayidx2.phi.trans.insert = getelementptr inbounds i32, ptr %buff, i64 %idxprom1.phi.trans.insert %.pre = load i32, ptr %arrayidx2.phi.trans.insert, align 4, !tbaa !5 br label %lor.lhs.false lor.lhs.false: ; preds = %lor.lhs.false.preheader, %cleanup %n.addr.031 = phi i32 [ %div32, %cleanup ], [ %n, %lor.lhs.false.preheader ] %div32.in = add nsw i32 %n.addr.031, -1 %div32 = sdiv i32 %div32.in, 2 %idxprom = zext i32 %div32 to i64 %arrayidx = getelementptr inbounds i32, ptr %buff, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp3.not = icmp slt i32 %0, %.pre br i1 %cmp3.not, label %cleanup, label %while.end cleanup: ; preds = %lor.lhs.false %idxprom1 = zext i32 %n.addr.031 to i64 %arrayidx2 = getelementptr inbounds i32, ptr %buff, i64 %idxprom1 store i32 %0, ptr %arrayidx2, align 4, !tbaa !5 store i32 %.pre, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp slt i32 %n.addr.031, 0 br i1 %cmp, label %while.end, label %lor.lhs.false while.end: ; preds = %cleanup, %lor.lhs.false, %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(argmem: readwrite) uwtable define dso_local void @downheap(ptr nocapture noundef %buff, i32 noundef %n, i32 noundef %size) local_unnamed_addr #0 { entry: %mul47 = shl nsw i32 %n, 1 %add48 = or i32 %mul47, 1 %cmp.not49 = icmp slt i32 %add48, %size br i1 %cmp.not49, label %if.end, label %while.end if.end: ; preds = %entry, %cleanup %add52 = phi i32 [ %add, %cleanup ], [ %add48, %entry ] %mul51 = phi i32 [ %mul, %cleanup ], [ %mul47, %entry ] %n.addr.050 = phi i32 [ %c.0, %cleanup ], [ %n, %entry ] %add1 = add i32 %mul51, 2 %cmp2 = icmp slt i32 %add1, %size br i1 %cmp2, label %land.lhs.true, label %if.end8 land.lhs.true: ; preds = %if.end %idxprom = sext i32 %add52 to i64 %arrayidx = getelementptr inbounds i32, ptr %buff, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom4 = sext i32 %add1 to i64 %arrayidx5 = getelementptr inbounds i32, ptr %buff, i64 %idxprom4 %1 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp slt i32 %0, %1 %spec.select = select i1 %cmp6, i32 %add1, i32 %add52 br label %if.end8 if.end8: ; preds = %land.lhs.true, %if.end %c.0 = phi i32 [ %add52, %if.end ], [ %spec.select, %land.lhs.true ] %idxprom9 = sext i32 %n.addr.050 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %buff, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %idxprom11 = sext i32 %c.0 to i64 %arrayidx12 = getelementptr inbounds i32, ptr %buff, i64 %idxprom11 %3 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13.not = icmp slt i32 %2, %3 br i1 %cmp13.not, label %cleanup, label %while.end cleanup: ; preds = %if.end8 store i32 %3, ptr %arrayidx10, align 4, !tbaa !5 store i32 %2, ptr %arrayidx12, align 4, !tbaa !5 %mul = shl nsw i32 %c.0, 1 %add = or i32 %mul, 1 %cmp.not = icmp slt i32 %add, %size br i1 %cmp.not, label %if.end, label %while.end while.end: ; preds = %if.end8, %cleanup, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %line = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %line) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %0) %call.i = call i64 @strtol(ptr nocapture noundef nonnull %line, ptr noundef null, i32 noundef 10) #8 %conv.i = trunc i64 %call.i to i32 %sext = shl i64 %call.i, 32 %conv = ashr exact i64 %sext, 32 %mul = ashr exact i64 %sext, 29 %call3 = call noalias ptr @malloc(i64 noundef %mul) #9 %mul6 = mul nsw i64 %conv, 800000 %call7 = call noalias ptr @malloc(i64 noundef %mul6) #9 %cmp122 = icmp sgt i32 %conv.i, 0 br i1 %cmp122, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call.i, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 4 br i1 %min.iters.check, label %for.body.preheader129, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call.i, 3 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %1 = mul <2 x i64> %vec.ind, <i64 200000, i64 200000> %2 = mul <2 x i64> %vec.ind, <i64 200000, i64 200000> %3 = add <2 x i64> %2, <i64 400000, i64 400000> %4 = and <2 x i64> %1, <i64 4294967232, i64 4294967232> %5 = and <2 x i64> %3, <i64 4294967232, i64 4294967232> %6 = getelementptr inbounds i32, ptr %call7, <2 x i64> %4 %7 = getelementptr inbounds i32, ptr %call7, <2 x i64> %5 %8 = getelementptr inbounds ptr, ptr %call3, i64 %index store <2 x ptr> %6, ptr %8, align 8, !tbaa !9 %9 = getelementptr inbounds ptr, ptr %8, i64 2 store <2 x ptr> %7, ptr %9, align 8, !tbaa !9 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %for.body.preheader129 for.body.preheader129: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader129, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader129 ] %mul9 = mul i64 %indvars.iv, 200000 %idx.ext = and i64 %mul9, 4294967232 %add.ptr = getelementptr inbounds i32, ptr %call7, i64 %idx.ext %arrayidx = getelementptr inbounds ptr, ptr %call3, i64 %indvars.iv store ptr %add.ptr, ptr %arrayidx, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %for.body, %middle.block, %entry %call11 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #10 br label %while.cond while.cond: ; preds = %while.cond, %for.end %a.0 = phi ptr [ %line, %for.end ], [ %incdec.ptr, %while.cond ] %11 = load i8, ptr %a.0, align 1, !tbaa !16 %cmp14 = icmp sgt i8 %11, 47 %incdec.ptr = getelementptr inbounds i8, ptr %a.0, i64 1 br i1 %cmp14, label %while.cond, label %while.end, !llvm.loop !17 while.end: ; preds = %while.cond %call.i110 = call i64 @strtol(ptr nocapture noundef nonnull %incdec.ptr, ptr noundef null, i32 noundef 10) #8 %conv.i111 = trunc i64 %call.i110 to i32 %tobool.not125 = icmp eq i32 %conv.i111, 0 br i1 %tobool.not125, label %while.end73, label %while.body19.lr.ph while.body19.lr.ph: ; preds = %while.end %add.ptr25 = getelementptr inbounds i8, ptr %line, i64 2 br label %while.body19 while.body19: ; preds = %while.body19.lr.ph, %if.end72 %dec126.in = phi i32 [ %conv.i111, %while.body19.lr.ph ], [ %dec126, %if.end72 ] %dec126 = add nsw i32 %dec126.in, -1 %12 = load ptr, ptr @stdin, align 8, !tbaa !9 %call21 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %12) %call.i112 = call i64 @strtol(ptr nocapture noundef nonnull %line, ptr noundef null, i32 noundef 10) #8 %conv.i113 = trunc i64 %call.i112 to i32 %call.i114 = call i64 @strtol(ptr nocapture noundef nonnull %add.ptr25, ptr noundef null, i32 noundef 10) #8 %sext121 = shl i64 %call.i114, 32 %idxprom27 = ashr exact i64 %sext121, 32 %arrayidx28 = getelementptr inbounds i32, ptr %call11, i64 %idxprom27 %13 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp eq i32 %conv.i113, 0 br i1 %cmp29, label %while.cond31, label %if.else while.cond31: ; preds = %while.body19, %while.cond31 %a.1 = phi ptr [ %incdec.ptr36, %while.cond31 ], [ %add.ptr25, %while.body19 ] %14 = load i8, ptr %a.1, align 1, !tbaa !16 %cmp33 = icmp sgt i8 %14, 47 %incdec.ptr36 = getelementptr inbounds i8, ptr %a.1, i64 1 br i1 %cmp33, label %while.cond31, label %while.end37, !llvm.loop !18 while.end37: ; preds = %while.cond31 %call.i116 = call i64 @strtol(ptr nocapture noundef nonnull %incdec.ptr36, ptr noundef null, i32 noundef 10) #8 %conv.i117 = trunc i64 %call.i116 to i32 %arrayidx41 = getelementptr inbounds ptr, ptr %call3, i64 %idxprom27 %15 = load ptr, ptr %arrayidx41, align 8, !tbaa !9 %idxprom42 = sext i32 %13 to i64 %arrayidx43 = getelementptr inbounds i32, ptr %15, i64 %idxprom42 store i32 %conv.i117, ptr %arrayidx43, align 4, !tbaa !5 %cmp30.i = icmp slt i32 %13, 0 br i1 %cmp30.i, label %upheap.exit, label %lor.lhs.false.preheader.i lor.lhs.false.preheader.i: ; preds = %while.end37 %idxprom1.phi.trans.insert.i = zext i32 %13 to i64 %arrayidx2.phi.trans.insert.i = getelementptr inbounds i32, ptr %15, i64 %idxprom1.phi.trans.insert.i %.pre.i = load i32, ptr %arrayidx2.phi.trans.insert.i, align 4, !tbaa !5 br label %lor.lhs.false.i lor.lhs.false.i: ; preds = %cleanup.i, %lor.lhs.false.preheader.i %n.addr.031.i = phi i32 [ %div32.i, %cleanup.i ], [ %13, %lor.lhs.false.preheader.i ] %div32.in.i = add nsw i32 %n.addr.031.i, -1 %div32.i = sdiv i32 %div32.in.i, 2 %idxprom.i = zext i32 %div32.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %15, i64 %idxprom.i %16 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp3.not.i = icmp slt i32 %16, %.pre.i br i1 %cmp3.not.i, label %cleanup.i, label %upheap.exit cleanup.i: ; preds = %lor.lhs.false.i %idxprom1.i = zext i32 %n.addr.031.i to i64 %arrayidx2.i = getelementptr inbounds i32, ptr %15, i64 %idxprom1.i store i32 %16, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %.pre.i, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.i = icmp slt i32 %n.addr.031.i, 0 br i1 %cmp.i, label %upheap.exit, label %lor.lhs.false.i upheap.exit: ; preds = %lor.lhs.false.i, %cleanup.i, %while.end37 %add = add nsw i32 %13, 1 store i32 %add, ptr %arrayidx28, align 4, !tbaa !5 br label %if.end72 if.else: ; preds = %while.body19 %cmp48.not = icmp eq i32 %13, 0 br i1 %cmp48.not, label %if.end72, label %if.then50 if.then50: ; preds = %if.else %cmp51 = icmp eq i32 %conv.i113, 1 %arrayidx55 = getelementptr inbounds ptr, ptr %call3, i64 %idxprom27 %17 = load ptr, ptr %arrayidx55, align 8, !tbaa !9 br i1 %cmp51, label %if.then53, label %if.else58 if.then53: ; preds = %if.then50 %18 = load i32, ptr %17, align 4, !tbaa !5 %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18) br label %if.end72 if.else58: ; preds = %if.then50 %sub = add nsw i32 %13, -1 %idxprom61 = sext i32 %sub to i64 %arrayidx62 = getelementptr inbounds i32, ptr %17, i64 %idxprom61 %19 = load i32, ptr %arrayidx62, align 4, !tbaa !5 store i32 %19, ptr %17, align 4, !tbaa !5 %cmp.not49.i = icmp sgt i32 %13, 1 br i1 %cmp.not49.i, label %if.end.i, label %downheap.exit if.end.i: ; preds = %if.else58, %cleanup.i118 %add52.i = phi i32 [ %add.i, %cleanup.i118 ], [ 1, %if.else58 ] %mul51.i = phi i32 [ %mul.i, %cleanup.i118 ], [ 0, %if.else58 ] %n.addr.050.i = phi i32 [ %c.0.i, %cleanup.i118 ], [ 0, %if.else58 ] %add1.i = add i32 %mul51.i, 2 %cmp2.i = icmp slt i32 %add1.i, %13 br i1 %cmp2.i, label %land.lhs.true.i, label %if.end8.i land.lhs.true.i: ; preds = %if.end.i %idxprom.i119 = sext i32 %add52.i to i64 %arrayidx.i120 = getelementptr inbounds i32, ptr %17, i64 %idxprom.i119 %20 = load i32, ptr %arrayidx.i120, align 4, !tbaa !5 %idxprom4.i = sext i32 %add1.i to i64 %arrayidx5.i = getelementptr inbounds i32, ptr %17, i64 %idxprom4.i %21 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp slt i32 %20, %21 %spec.select.i = select i1 %cmp6.i, i32 %add1.i, i32 %add52.i br label %if.end8.i if.end8.i: ; preds = %land.lhs.true.i, %if.end.i %c.0.i = phi i32 [ %add52.i, %if.end.i ], [ %spec.select.i, %land.lhs.true.i ] %idxprom11.i = sext i32 %c.0.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %17, i64 %idxprom11.i %22 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5 %cmp13.not.i = icmp slt i32 %19, %22 br i1 %cmp13.not.i, label %cleanup.i118, label %downheap.exit cleanup.i118: ; preds = %if.end8.i %idxprom9.i = sext i32 %n.addr.050.i to i64 %arrayidx10.i = getelementptr inbounds i32, ptr %17, i64 %idxprom9.i store i32 %22, ptr %arrayidx10.i, align 4, !tbaa !5 store i32 %19, ptr %arrayidx12.i, align 4, !tbaa !5 %mul.i = shl nsw i32 %c.0.i, 1 %add.i = or i32 %mul.i, 1 %cmp.not.i = icmp slt i32 %add.i, %13 br i1 %cmp.not.i, label %if.end.i, label %downheap.exit downheap.exit: ; preds = %if.end8.i, %cleanup.i118, %if.else58 store i32 %sub, ptr %arrayidx28, align 4, !tbaa !5 br label %if.end72 if.end72: ; preds = %if.else, %downheap.exit, %if.then53, %upheap.exit %tobool.not = icmp eq i32 %dec126, 0 br i1 %tobool.not, label %while.end73, label %while.body19, !llvm.loop !19 while.end73: ; preds = %if.end72, %while.end call void @free(ptr noundef %call3) #8 call void @free(ptr noundef %call7) #8 call void @free(ptr noundef %call11) #8 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %line) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4 ; 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 #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #7 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 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 #5 = { 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 #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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind } attributes #9 = { nounwind allocsize(0) } attributes #10 = { 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 = !{!"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, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12, !14, !13} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12}
#include <math.h> #include <stdio.h> #include <stdlib.h> typedef long long ll; ll n, p, i, j, ans, l; int main() { scanf("%lld%lld",&n,&p); if(n==1)printf("%lld\n",p); else if(p==1)printf("1\n"); else { ans=1; j=0;while(p%2==0){p/=2;j++;} if(j/n>0) ans*=pow(2,j/n); for(i=3, l=sqrt(p)+1;i<l;i+=4){ j=0;while(p%i==0){p/=i;j++;} if(j/n>0) ans*=pow(i,j/n); j=0;while(p%(i+2)==0){p/=(i+2);j++;} if(j/n>0) ans*=pow((i+2),j/n); } printf("%lld\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234831/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234831/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @n = dso_local global i64 0, align 8 @p = dso_local global i64 0, align 8 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @ans = dso_local local_unnamed_addr global i64 0, align 8 @j = dso_local local_unnamed_addr global i64 0, align 8 @i = dso_local local_unnamed_addr global i64 0, align 8 @l = dso_local local_unnamed_addr global i64 0, align 8 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: 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 @n, ptr noundef nonnull @p) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 %1 = load i64, ptr @p, align 8, !tbaa !5 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1) br label %if.end65 if.else: ; preds = %entry %cmp2 = icmp eq i64 %1, 1 br i1 %cmp2, label %if.then3, label %if.else5 if.then3: ; preds = %if.else %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end65 if.else5: ; preds = %if.else store i64 1, ptr @ans, align 8, !tbaa !5 %2 = and i64 %1, 1 %cmp671 = icmp eq i64 %2, 0 br i1 %cmp671, label %while.body, label %while.end while.body: ; preds = %if.else5, %while.body %storemerge73 = phi i64 [ %inc, %while.body ], [ 0, %if.else5 ] %div7072 = phi i64 [ %div, %while.body ], [ %1, %if.else5 ] %div = sdiv i64 %div7072, 2 %inc = add nuw nsw i64 %storemerge73, 1 %3 = and i64 %div, 1 %cmp6 = icmp eq i64 %3, 0 br i1 %cmp6, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i64 %div, ptr @p, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %if.else5 %4 = phi i64 [ %div, %while.cond.while.end_crit_edge ], [ %1, %if.else5 ] %storemerge.lcssa69 = phi i64 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %if.else5 ] store i64 %storemerge.lcssa69, ptr @j, align 8, !tbaa !5 %div7 = sdiv i64 %storemerge.lcssa69, %0 %cmp8 = icmp sgt i64 %div7, 0 br i1 %cmp8, label %if.then9, label %if.end if.then9: ; preds = %while.end %conv = sitofp i64 %div7 to double %exp2 = tail call double @exp2(double %conv) #4 %5 = load i64, ptr @ans, align 8, !tbaa !5 %conv12 = sitofp i64 %5 to double %mul = fmul double %exp2, %conv12 %conv13 = fptosi double %mul to i64 store i64 %conv13, ptr @ans, align 8, !tbaa !5 %.pre = load i64, ptr @p, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then9, %while.end %6 = phi i64 [ %.pre, %if.then9 ], [ %4, %while.end ] store i64 3, ptr @i, align 8, !tbaa !5 %conv14 = sitofp i64 %6 to double %call15 = tail call double @sqrt(double noundef %conv14) #4 %add = fadd double %call15, 1.000000e+00 %conv16 = fptosi double %add to i64 store i64 %conv16, ptr @l, align 8, !tbaa !5 %7 = load i64, ptr @i, align 8, !tbaa !5 %cmp1794 = icmp slt i64 %7, %conv16 br i1 %cmp1794, label %while.cond19.preheader.preheader, label %for.end while.cond19.preheader.preheader: ; preds = %if.end %p.promoted76.pre95 = load i64, ptr @p, align 8, !tbaa !5 br label %while.cond19.preheader while.cond19.preheader: ; preds = %while.cond19.preheader.preheader, %for.inc %p.promoted85101 = phi i64 [ %p.promoted85102, %for.inc ], [ %p.promoted76.pre95, %while.cond19.preheader.preheader ] %8 = phi i64 [ %add62, %for.inc ], [ %7, %while.cond19.preheader.preheader ] %rem2078 = srem i64 %p.promoted85101, %8 %cmp2179 = icmp eq i64 %rem2078, 0 br i1 %cmp2179, label %while.body23, label %while.end26 while.body23: ; preds = %while.cond19.preheader, %while.body23 %storemerge6781 = phi i64 [ %inc25, %while.body23 ], [ 0, %while.cond19.preheader ] %div247780 = phi i64 [ %div24, %while.body23 ], [ %p.promoted85101, %while.cond19.preheader ] %div24 = sdiv i64 %div247780, %8 %inc25 = add nuw nsw i64 %storemerge6781, 1 %rem20 = srem i64 %div24, %8 %cmp21 = icmp eq i64 %rem20, 0 br i1 %cmp21, label %while.body23, label %while.cond19.while.end26_crit_edge, !llvm.loop !11 while.cond19.while.end26_crit_edge: ; preds = %while.body23 store i64 %div24, ptr @p, align 8, !tbaa !5 br label %while.end26 while.end26: ; preds = %while.cond19.while.end26_crit_edge, %while.cond19.preheader %p.promoted85100 = phi i64 [ %div24, %while.cond19.while.end26_crit_edge ], [ %p.promoted85101, %while.cond19.preheader ] %storemerge67.lcssa75 = phi i64 [ %inc25, %while.cond19.while.end26_crit_edge ], [ 0, %while.cond19.preheader ] %9 = load i64, ptr @n, align 8, !tbaa !5 %div27 = sdiv i64 %storemerge67.lcssa75, %9 %cmp28 = icmp sgt i64 %div27, 0 br i1 %cmp28, label %if.then30, label %if.end38 if.then30: ; preds = %while.end26 %conv31 = sitofp i64 %8 to double %conv33 = sitofp i64 %div27 to double %call34 = tail call double @pow(double noundef %conv31, double noundef %conv33) #4 %10 = load i64, ptr @ans, align 8, !tbaa !5 %conv35 = sitofp i64 %10 to double %mul36 = fmul double %call34, %conv35 %conv37 = fptosi double %mul36 to i64 store i64 %conv37, ptr @ans, align 8, !tbaa !5 %.pre99 = load i64, ptr @i, align 8, !tbaa !5 %p.promoted85.pre = load i64, ptr @p, align 8, !tbaa !5 br label %if.end38 if.end38: ; preds = %if.then30, %while.end26 %p.promoted85 = phi i64 [ %p.promoted85.pre, %if.then30 ], [ %p.promoted85100, %while.end26 ] %11 = phi i64 [ %.pre99, %if.then30 ], [ %8, %while.end26 ] %add40 = add nsw i64 %11, 2 %rem4187 = srem i64 %p.promoted85, %add40 %cmp4288 = icmp eq i64 %rem4187, 0 br i1 %cmp4288, label %while.body44, label %while.end48 while.body44: ; preds = %if.end38, %while.body44 %storemerge6890 = phi i64 [ %inc47, %while.body44 ], [ 0, %if.end38 ] %div468689 = phi i64 [ %div46, %while.body44 ], [ %p.promoted85, %if.end38 ] %div46 = sdiv i64 %div468689, %add40 %inc47 = add nuw nsw i64 %storemerge6890, 1 %rem41 = srem i64 %div46, %add40 %cmp42 = icmp eq i64 %rem41, 0 br i1 %cmp42, label %while.body44, label %while.cond39.while.end48_crit_edge, !llvm.loop !12 while.cond39.while.end48_crit_edge: ; preds = %while.body44 store i64 %div46, ptr @p, align 8, !tbaa !5 br label %while.end48 while.end48: ; preds = %while.cond39.while.end48_crit_edge, %if.end38 %p.promoted85103 = phi i64 [ %div46, %while.cond39.while.end48_crit_edge ], [ %p.promoted85, %if.end38 ] %storemerge68.lcssa84 = phi i64 [ %inc47, %while.cond39.while.end48_crit_edge ], [ 0, %if.end38 ] store i64 %storemerge68.lcssa84, ptr @j, align 8, !tbaa !5 %12 = load i64, ptr @n, align 8, !tbaa !5 %div49 = sdiv i64 %storemerge68.lcssa84, %12 %cmp50 = icmp sgt i64 %div49, 0 br i1 %cmp50, label %if.then52, label %for.inc if.then52: ; preds = %while.end48 %conv54 = sitofp i64 %add40 to double %conv56 = sitofp i64 %div49 to double %call57 = tail call double @pow(double noundef %conv54, double noundef %conv56) #4 %13 = load i64, ptr @ans, align 8, !tbaa !5 %conv58 = sitofp i64 %13 to double %mul59 = fmul double %call57, %conv58 %conv60 = fptosi double %mul59 to i64 store i64 %conv60, ptr @ans, align 8, !tbaa !5 %p.promoted76.pre = load i64, ptr @p, align 8, !tbaa !5 %.pre105 = load i64, ptr @i, align 8, !tbaa !5 br label %for.inc for.inc: ; preds = %while.end48, %if.then52 %14 = phi i64 [ %11, %while.end48 ], [ %.pre105, %if.then52 ] %p.promoted85102 = phi i64 [ %p.promoted85103, %while.end48 ], [ %p.promoted76.pre, %if.then52 ] %add62 = add nsw i64 %14, 4 store i64 %add62, ptr @i, align 8, !tbaa !5 %15 = load i64, ptr @l, align 8, !tbaa !5 %cmp17 = icmp slt i64 %add62, %15 br i1 %cmp17, label %while.cond19.preheader, label %for.end, !llvm.loop !13 for.end: ; preds = %for.inc, %if.end %16 = load i64, ptr @ans, align 8, !tbaa !5 %call63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %16) br label %if.end65 if.end65: ; preds = %if.then3, %for.end, %if.then ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #2 declare double @exp2(double) local_unnamed_addr ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nounwind willreturn memory(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 #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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(){ int n; scanf("%d",&n); float p; int a; a=n/2; float b; b=a; float c; c=n; p=1-b/c; printf("%f",p); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234875/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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 %div = sdiv i32 %0, 2 %conv = sitofp i32 %div to float %conv1 = sitofp i32 %0 to float %div2 = fdiv float %conv, %conv1 %sub = fsub float 1.000000e+00, %div2 %conv3 = fpext float %sub to double %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int N; double a,x; scanf("%d",&N); if(N%2==0) { x=(double)(N/2)/N; printf("%0.10lf",x); } else if(N%2!=0) { a=(N+1)/2; x=(double)a/N; printf("%0.10lf",x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234932/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234932/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%0.10lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, 1 %add.sink = add i32 %0, %1 %div8 = sdiv i32 %add.sink, 2 %conv9 = sitofp i32 %div8 to double %conv10 = sitofp i32 %0 to double %div11 = fdiv double %conv9, %conv10 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div11) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n; scanf("%d",&n); int count=0; for(int i=1;i<=n;i++){ if(i%2!=0) count++; } double n1=n; double p=count/n1; printf("%f\n",p); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234976/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not8 = icmp slt i32 %0, 1 br i1 %cmp.not8, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %0, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %2 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %3 = add <4 x i32> %vec.phi, %1 %4 = add <4 x i32> %vec.phi12, %2 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i32 %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 i32 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup.loopexit, label %for.body.preheader14 for.body.preheader14: ; preds = %for.body.preheader, %middle.block %count.010.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ] %i.09.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.cond.cleanup.loopexit: ; preds = %for.body, %middle.block %spec.select.lcssa = phi i32 [ %6, %middle.block ], [ %spec.select, %for.body ] %7 = sitofp i32 %spec.select.lcssa to double br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %count.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %7, %for.cond.cleanup.loopexit ] %conv = sitofp i32 %0 to double %div = fdiv double %count.0.lcssa, %conv %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body: ; preds = %for.body.preheader14, %for.body %count.010 = phi i32 [ %spec.select, %for.body ], [ %count.010.ph, %for.body.preheader14 ] %i.09 = phi i32 [ %inc2, %for.body ], [ %i.09.ph, %for.body.preheader14 ] %rem = and i32 %i.09, 1 %spec.select = add i32 %count.010, %rem %inc2 = add nuw i32 %i.09, 1 %exitcond.not = icmp eq i32 %i.09, %0 br i1 %exitcond.not, label %for.cond.cleanup.loopexit, 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: 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, !12, !11}
#include<stdio.h> int main() { int n , i , a=0; scanf("%d",&n); for(i=1; i<=n; i++) { if(i%2==1) a++; } printf("%f",(double)a/n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235018/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235018/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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 %cmp.not8 = icmp slt i32 %0, 1 br i1 %cmp.not8, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %0, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %2 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %3 = add <4 x i32> %vec.phi, %1 %4 = add <4 x i32> %vec.phi12, %2 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i32 %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 i32 %0, %n.vec br i1 %cmp.n, label %for.end.loopexit, label %for.body.preheader14 for.body.preheader14: ; preds = %for.body.preheader, %middle.block %a.010.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ] %i.09.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader14, %for.body %a.010 = phi i32 [ %spec.select, %for.body ], [ %a.010.ph, %for.body.preheader14 ] %i.09 = phi i32 [ %inc2, %for.body ], [ %i.09.ph, %for.body.preheader14 ] %rem = and i32 %i.09, 1 %spec.select = add i32 %a.010, %rem %inc2 = add nuw i32 %i.09, 1 %exitcond.not = icmp eq i32 %i.09, %0 br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13 for.end.loopexit: ; preds = %for.body, %middle.block %spec.select.lcssa = phi i32 [ %6, %middle.block ], [ %spec.select, %for.body ] %7 = sitofp i32 %spec.select.lcssa to double br label %for.end for.end: ; preds = %for.end.loopexit, %entry %a.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %7, %for.end.loopexit ] %conv3 = sitofp i32 %0 to double %div = fdiv double %a.0.lcssa, %conv3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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, !12, !11}