Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main(void) { int a; int b; scanf("%d",&a); scanf("%d",&b); if(a<b){ printf("a < b\n"); } if(b<a){ printf("a > b\n"); } if(a==b){ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243730/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243730/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre = load i32, ptr %b, align 4, !tbaa !5 %.pre13 = load i32, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre13, %if.then ], [ %0, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %1, %entry ] %cmp3 = icmp slt i32 %3, %2 br i1 %cmp3, label %if.then4, label %if.end6 if.then4: ; preds = %if.end %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) %.pre14 = load i32, ptr %a, align 4, !tbaa !5 %.pre15 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then4, %if.end %4 = phi i32 [ %.pre15, %if.then4 ], [ %3, %if.end ] %5 = phi i32 [ %.pre14, %if.then4 ], [ %2, %if.end ] %cmp7 = icmp eq i32 %5, %4 br i1 %cmp7, label %if.then8, label %if.end10 if.then8: ; preds = %if.end6 %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end10 if.end10: ; preds = %if.then8, %if.end6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a > b){ printf("a > b\n"); } else if (a == b){ printf("a == b\n"); } else { printf("a < b\n"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243774/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243774/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp eq i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a, b; scanf("%d %d", &a, &b); if (a < b) { printf("a < b\n"); } else if (a > b) { printf("a > b\n"); } else { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243817/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243817/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a, b; scanf("%d",&a); scanf("%d",&b); if(a<b){ printf("a < b\n"); }else if(a>b){ printf("a > b\n"); }else if(a==b){ printf("a == b\n"); }else{ } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243860/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243860/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.end12.sink.split, label %if.else if.else: ; preds = %entry %cmp3 = icmp sgt i32 %0, %1 br i1 %cmp3, label %if.end12.sink.split, label %if.else6 if.else6: ; preds = %if.else %cmp7 = icmp eq i32 %0, %1 br i1 %cmp7, label %if.end12.sink.split, label %if.end12 if.end12.sink.split: ; preds = %if.else6, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else6 ] %puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end12 if.end12: ; preds = %if.end12.sink.split, %if.else6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b ; scanf("%d %d",&a,&b); if(a<b){ printf("a < b\n"); } else if(a>b){ printf("a > b\n"); } else{ printf("a == b\n"); } return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243910/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243910/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); if(a < b){ printf("a < b\n"); } else if(a>b){ printf("a > b\n"); } else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243976/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define Min(a,b) (a<b?a:b) #define Max(a,b) (a>b?a:b) #define Swap(a,b) {(a)=(a)^(b); (b)=(a)^(b); (a)=(a)^(b);} #define MAXN 65535 #define INF 1e9 int cmp(const void *a, const void *b){ return *((int *)a) - *((int *)b); } char str[110]; int num[50]; int main(){ int i,j,len; scanf("%s", str); len = strlen(str); for(i = 0, j = 0; i<len; i+=2, j++){ num[j] = str[i]-'0'; } qsort(num, j, sizeof(int), cmp); printf("%d", num[0]); for(i = 1; i<j; i++){ printf("+%d", num[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24404/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24404/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = dso_local global [110 x i8] zeroinitializer, align 16 @num = dso_local global [50 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 [4 x i8] c"+%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #5 %conv = trunc i64 %call1 to i32 %cmp26 = icmp sgt i32 %conv, 0 br i1 %cmp26, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = add nsw i32 %conv, -1 %1 = lshr i32 %0, 1 %2 = add nuw nsw i32 %1, 1 %wide.trip.count = zext i32 %2 to i64 %min.iters.check = icmp ult i32 %conv, 17 br i1 %min.iters.check, label %for.body.preheader42, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %wide.trip.count, 7 %3 = icmp eq i64 %n.mod.vf, 0 %4 = select i1 %3, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count, %4 %ind.end = shl nsw i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = shl i64 %index, 1 %5 = or i64 %offset.idx, 2 %6 = or i64 %offset.idx, 4 %7 = or i64 %offset.idx, 6 %8 = or i64 %offset.idx, 8 %9 = or i64 %offset.idx, 10 %10 = or i64 %offset.idx, 12 %11 = or i64 %offset.idx, 14 %12 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %offset.idx %13 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %5 %14 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %6 %15 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %7 %16 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %8 %17 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %9 %18 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %10 %19 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %11 %20 = load i8, ptr %12, align 16, !tbaa !9 %21 = load i8, ptr %13, align 2, !tbaa !9 %22 = load i8, ptr %14, align 4, !tbaa !9 %23 = load i8, ptr %15, align 2, !tbaa !9 %24 = insertelement <4 x i8> poison, i8 %20, i64 0 %25 = insertelement <4 x i8> %24, i8 %21, i64 1 %26 = insertelement <4 x i8> %25, i8 %22, i64 2 %27 = insertelement <4 x i8> %26, i8 %23, i64 3 %28 = load i8, ptr %16, align 8, !tbaa !9 %29 = load i8, ptr %17, align 2, !tbaa !9 %30 = load i8, ptr %18, align 4, !tbaa !9 %31 = load i8, ptr %19, align 2, !tbaa !9 %32 = insertelement <4 x i8> poison, i8 %28, i64 0 %33 = insertelement <4 x i8> %32, i8 %29, i64 1 %34 = insertelement <4 x i8> %33, i8 %30, i64 2 %35 = insertelement <4 x i8> %34, i8 %31, i64 3 %36 = sext <4 x i8> %27 to <4 x i32> %37 = sext <4 x i8> %35 to <4 x i32> %38 = add nsw <4 x i32> %36, <i32 -48, i32 -48, i32 -48, i32 -48> %39 = add nsw <4 x i32> %37, <i32 -48, i32 -48, i32 -48, i32 -48> %40 = getelementptr inbounds [50 x i32], ptr @num, i64 0, i64 %index store <4 x i32> %38, ptr %40, align 16, !tbaa !5 %41 = getelementptr inbounds i32, ptr %40, i64 4 store <4 x i32> %39, ptr %41, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %for.body.preheader42, label %vector.body, !llvm.loop !10 for.body.preheader42: ; preds = %vector.body, %for.body.preheader %indvars.iv31.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %vector.body ] %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %ind.end, %vector.body ] br label %for.body for.body: ; preds = %for.body.preheader42, %for.body %indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.body ], [ %indvars.iv31.ph, %for.body.preheader42 ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader42 ] %arrayidx = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %indvars.iv %43 = load i8, ptr %arrayidx, align 2, !tbaa !9 %conv3 = sext i8 %43 to i32 %sub = add nsw i32 %conv3, -48 %arrayidx5 = getelementptr inbounds [50 x i32], ptr @num, i64 0, i64 %indvars.iv31 store i32 %sub, ptr %arrayidx5, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2 %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1 %exitcond.not = icmp eq i64 %indvars.iv.next32, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %entry %j.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.body ] %conv6 = zext i32 %j.0.lcssa to i64 tail call void @qsort(ptr noundef nonnull @num, i64 noundef %conv6, i64 noundef 4, ptr noundef nonnull @cmp) #6 %44 = load i32, ptr @num, align 16, !tbaa !5 %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %44) %cmp929 = icmp ugt i32 %j.0.lcssa, 1 br i1 %cmp929, label %for.body11, label %for.end17 for.body11: ; preds = %for.end, %for.body11 %indvars.iv36 = phi i64 [ %indvars.iv.next37, %for.body11 ], [ 1, %for.end ] %arrayidx13 = getelementptr inbounds [50 x i32], ptr @num, i64 0, i64 %indvars.iv36 %45 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45) %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1 %exitcond40.not = icmp eq i64 %indvars.iv.next37, %conv6 br i1 %exitcond40.not, label %for.end17, label %for.body11, !llvm.loop !15 for.end17: ; preds = %for.body11, %for.end ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 "no-trapping-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 willreturn memory(read) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12} !15 = distinct !{!15, !11}
#include<stdio.h> int main(void){ int a, b; scanf("%d %d", &a, &b); if(a > b){ printf("a > b\n"); }else if(a < b){ printf("a < b\n"); }else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244083/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244083/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d%d" ,&a,&b); if(a>b||a<b){ if(a>b){ printf("a > b\n"); } else if(a<b){ printf("a < b\n"); } } else if(a==b){ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244126/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %or.cond.not = icmp eq i32 %0, %1 %cmp = icmp sgt i32 %0, %1 %str.5.mux = select i1 %cmp, ptr @str.5, ptr @str.4 %str.sink = select i1 %or.cond.not, ptr @str, ptr %str.5.mux %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b ; scanf("%d%d",&a,&b); if(a<b) printf("a < b\n"); if(a>b) printf("a > b\n"); if(a == b) printf("a == b\n"); return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244177/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244177/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre = load i32, ptr %a, align 4, !tbaa !5 %.pre12 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %cmp2 = icmp sgt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) %.pre13 = load i32, ptr %a, align 4, !tbaa !5 %.pre14 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then3, %if.end %4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ] %cmp6 = icmp eq i32 %5, %4 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end5 %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end9 if.end9: ; preds = %if.then7, %if.end5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include <math.h> #include <string.h> int main() { int m,n,i,j,k,sum,a1,a2,a3; char c[200]; while(scanf("%s",c)!=EOF){ a1 = a2 = a3 = m = 0; for(i=0;c[i]!='\0';i++){ if(c[i]=='1') a1++; if(c[i]=='2') a2++; if(c[i]=='3') a3++; if(c[i]=='+') m++; } for(i=a1;i>0;i--){ printf("1");if(m){printf("+");m--;} } for(i=a2;i>0;i--){ printf("2");if(m){printf("+");m--;} } for(i=a3;i>0;i--){ printf("3");if(m){printf("+");m--;} } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %c) #4 %call107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %cmp.not108 = icmp eq i32 %call107, -1 br i1 %cmp.not108, label %while.end, label %for.cond for.cond: ; preds = %entry, %for.cond.backedge %indvars.iv = phi i64 [ %indvars.iv.be, %for.cond.backedge ], [ 0, %entry ] %m.0 = phi i32 [ %m.0.be, %for.cond.backedge ], [ 0, %entry ] %a1.0 = phi i32 [ %a1.0.be, %for.cond.backedge ], [ 0, %entry ] %a2.0 = phi i32 [ %a2.0.be, %for.cond.backedge ], [ 0, %entry ] %a3.0 = phi i32 [ %a3.0.be, %for.cond.backedge ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200 x i8], ptr %c, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %if.end [ i8 0, label %for.cond33.preheader i8 49, label %if.then ] for.cond33.preheader: ; preds = %for.cond %cmp3497 = icmp sgt i32 %a1.0, 0 br i1 %cmp3497, label %for.body36, label %for.cond44.preheader if.then: ; preds = %for.cond %inc = add nsw i32 %a1.0, 1 br label %if.end if.end: ; preds = %for.cond, %if.then %a1.1 = phi i32 [ %inc, %if.then ], [ %a1.0, %for.cond ] %cmp11 = icmp eq i8 %0, 50 %inc14 = zext i1 %cmp11 to i32 %spec.select = add nuw nsw i32 %a2.0, %inc14 %cmp19 = icmp eq i8 %0, 51 %inc22 = zext i1 %cmp19 to i32 %a3.1 = add nuw nsw i32 %a3.0, %inc22 %cmp27 = icmp eq i8 %0, 43 %inc30 = zext i1 %cmp27 to i32 %m.1 = add nuw nsw i32 %m.0, %inc30 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond.backedge for.cond.backedge: ; preds = %if.end, %for.end69 %indvars.iv.be = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %for.end69 ] %m.0.be = phi i32 [ %m.1, %if.end ], [ 0, %for.end69 ] %a1.0.be = phi i32 [ %a1.1, %if.end ], [ 0, %for.end69 ] %a2.0.be = phi i32 [ %spec.select, %if.end ], [ 0, %for.end69 ] %a3.0.be = phi i32 [ %a3.1, %if.end ], [ 0, %for.end69 ] br label %for.cond, !llvm.loop !8 for.cond44.preheader: ; preds = %for.inc41, %for.cond33.preheader %m.2.lcssa = phi i32 [ %m.0, %for.cond33.preheader ], [ %m.3, %for.inc41 ] %cmp45100.not = icmp eq i32 %a2.0, 0 br i1 %cmp45100.not, label %for.cond57.preheader, label %for.body47 for.body36: ; preds = %for.cond33.preheader, %for.inc41 %m.299 = phi i32 [ %m.3, %for.inc41 ], [ %m.0, %for.cond33.preheader ] %i.198 = phi i32 [ %dec42, %for.inc41 ], [ %a1.0, %for.cond33.preheader ] %putchar95 = call i32 @putchar(i32 49) %tobool.not = icmp eq i32 %m.299, 0 br i1 %tobool.not, label %for.inc41, label %if.then38 if.then38: ; preds = %for.body36 %putchar96 = call i32 @putchar(i32 43) %dec = add nsw i32 %m.299, -1 br label %for.inc41 for.inc41: ; preds = %for.body36, %if.then38 %m.3 = phi i32 [ %dec, %if.then38 ], [ 0, %for.body36 ] %dec42 = add nsw i32 %i.198, -1 %cmp34 = icmp sgt i32 %i.198, 1 br i1 %cmp34, label %for.body36, label %for.cond44.preheader, !llvm.loop !10 for.cond57.preheader: ; preds = %for.inc54, %for.cond44.preheader %m.4.lcssa = phi i32 [ %m.2.lcssa, %for.cond44.preheader ], [ %m.5, %for.inc54 ] %cmp58104.not = icmp eq i32 %a3.0, 0 br i1 %cmp58104.not, label %for.end69, label %for.body60 for.body47: ; preds = %for.cond44.preheader, %for.inc54 %m.4102 = phi i32 [ %m.5, %for.inc54 ], [ %m.2.lcssa, %for.cond44.preheader ] %i.2101 = phi i32 [ %dec55, %for.inc54 ], [ %a2.0, %for.cond44.preheader ] %putchar93 = call i32 @putchar(i32 50) %tobool49.not = icmp eq i32 %m.4102, 0 br i1 %tobool49.not, label %for.inc54, label %if.then50 if.then50: ; preds = %for.body47 %putchar94 = call i32 @putchar(i32 43) %dec52 = add nsw i32 %m.4102, -1 br label %for.inc54 for.inc54: ; preds = %for.body47, %if.then50 %m.5 = phi i32 [ %dec52, %if.then50 ], [ 0, %for.body47 ] %dec55 = add nsw i32 %i.2101, -1 %cmp45 = icmp sgt i32 %i.2101, 1 br i1 %cmp45, label %for.body47, label %for.cond57.preheader, !llvm.loop !11 for.body60: ; preds = %for.cond57.preheader, %for.inc67 %m.6106 = phi i32 [ %m.7, %for.inc67 ], [ %m.4.lcssa, %for.cond57.preheader ] %i.3105 = phi i32 [ %dec68, %for.inc67 ], [ %a3.0, %for.cond57.preheader ] %putchar91 = call i32 @putchar(i32 51) %tobool62.not = icmp eq i32 %m.6106, 0 br i1 %tobool62.not, label %for.inc67, label %if.then63 if.then63: ; preds = %for.body60 %putchar92 = call i32 @putchar(i32 43) %dec65 = add nsw i32 %m.6106, -1 br label %for.inc67 for.inc67: ; preds = %for.body60, %if.then63 %m.7 = phi i32 [ %dec65, %if.then63 ], [ 0, %for.body60 ] %dec68 = add nsw i32 %i.3105, -1 %cmp58 = icmp sgt i32 %i.3105, 1 br i1 %cmp58, label %for.body60, label %for.end69, !llvm.loop !12 for.end69: ; preds = %for.inc67, %for.cond57.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.backedge while.end: ; preds = %for.end69, %entry call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %c) #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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9}
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); if(a<b){ printf("a < b\n"); } else if(a>b) {printf("a > b\n");} else if(a==b) {printf("a == b\n");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244263/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244263/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp sgt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); if(a<b)printf("a < b\n"); else if(a>b)printf("a > b\n"); else printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244313/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244313/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a,&b); if(a<b) { printf("a < b\n"); } if (a > b) { printf("a > b\n"); } if (a == b) { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244357/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244357/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre = load i32, ptr %a, align 4, !tbaa !5 %.pre12 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %cmp2 = icmp sgt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) %.pre13 = load i32, ptr %a, align 4, !tbaa !5 %.pre14 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then3, %if.end %4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ] %cmp6 = icmp eq i32 %5, %4 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end5 %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end9 if.end9: ; preds = %if.then7, %if.end5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b; scanf("%d",&a); scanf("%d",&b); if(a<b) printf("a < b\n"); else if(a>b) printf("a > b\n"); else printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244407/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244407/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp3 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp3, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b; scanf("%d %d", &a, &b); if(a < b) printf("a < b\n"); else if(a > b) printf("a > b\n"); else printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if ( a < b ) { printf("a < b\n"); } else if(a > b){ printf("a > b\n"); } else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244508/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244508/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if (a>b){ printf("a > b\n"); } else if(a<b){ printf("a < b\n"); } else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244551/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244551/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a=0; int b=0; scanf("%d %d",&a, &b); if (a < b){ printf("a < b\n"); }else if (a > b){ printf("a > b\n"); }else if (a == b){ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244601/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244601/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 store i32 0, ptr %a, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 store i32 0, ptr %b, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp sgt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a, b; scanf("%d %d", &a, &b); if(a>b) printf("a > b\n"); else if(a<b) printf("a < b\n"); else printf("a == b\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244645/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244645/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d",&a); scanf("%d",&b); if(a<b) printf("a < b\n"); else if(a>b) printf("a > b\n"); else printf("a == b\n"); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244689/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244689/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp3 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp3, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a, b; scanf("%d%d", &a, &b); if(a<b){ printf("a < b\n"); } else if(a>b){ printf("a > b\n"); } else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244731/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244731/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a, b; scanf("%d %d", &a, &b); if (a < b) printf("a < b\n"); else if (a > b) printf("a > b\n"); else printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244782/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244782/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int x,y; scanf("%d%d",&x,&y); if(x>y){ printf("a > b\n",y,x); } else if(x<y){ printf("a < b\n"); } else if(x==y){ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244832/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244832/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts13 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); if(a < b) { printf("a < b\n"); } if(a > b) { printf("a > b\n"); } if(a == b) { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244876/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244876/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pre = load i32, ptr %a, align 4, !tbaa !5 %.pre12 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %cmp2 = icmp sgt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) %.pre13 = load i32, ptr %a, align 4, !tbaa !5 %.pre14 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then3, %if.end %4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ] %cmp6 = icmp eq i32 %5, %4 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end5 %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end9 if.end9: ; preds = %if.then7, %if.end5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b; scanf("%d", &a); scanf("%d", &b); -1000<=a,b<=1000; if (a > b ) printf("a > b\n"); else if (a < b) printf("a < b\n"); else printf ("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244926/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244926/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, %1 %cmp7 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp7, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp4, ptr @str.5, ptr %str.4.str %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int comp(const void *a,const void *b){ return ((int *)a)[0]-((int *)b)[0]; } int main() { char s[100],ch; int i=0,a[100],j=0; while((ch=getchar())!='\n') { s[i++]=ch; if(ch!='+') a[j++]=ch-48; } qsort(a,j,sizeof(a[0]),comp); i=0; printf("%d",a[i]); i++; while(i<j) { printf("+"); printf("%d",a[i]); i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24497/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24497/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #6 br label %while.cond.outer while.cond.outer: ; preds = %if.then, %entry %j.0.ph = phi i32 [ %inc7, %if.then ], [ 0, %entry ] br label %while.cond while.cond: ; preds = %while.cond.outer, %while.cond %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i, 24 switch i32 %sext, label %if.then [ i32 167772160, label %while.end i32 721420288, label %while.cond ], !llvm.loop !11 if.then: ; preds = %while.cond %conv1 = ashr exact i32 %sext, 24 %sub = add nsw i32 %conv1, -48 %inc7 = add nuw nsw i32 %j.0.ph, 1 %idxprom8 = zext i32 %j.0.ph to i64 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom8 store i32 %sub, ptr %arrayidx9, align 4, !tbaa !5 br label %while.cond.outer, !llvm.loop !11 while.end: ; preds = %while.cond %conv10 = zext i32 %j.0.ph to i64 call void @qsort(ptr noundef nonnull %a, i64 noundef %conv10, i64 noundef 4, ptr noundef nonnull @comp) #6 %1 = load i32, ptr %a, align 16, !tbaa !5 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) %cmp1634 = icmp ugt i32 %j.0.ph, 1 br i1 %cmp1634, label %while.body18.preheader, label %while.end24 while.body18.preheader: ; preds = %while.end %wide.trip.count = zext i32 %j.0.ph to i64 br label %while.body18 while.body18: ; preds = %while.body18.preheader, %while.body18 %indvars.iv = phi i64 [ 1, %while.body18.preheader ], [ %indvars.iv.next, %while.body18 ] %putchar = call i32 @putchar(i32 43) %arrayidx21 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %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 %while.end24, label %while.body18, !llvm.loop !13 while.end24: ; preds = %while.body18, %while.end call void @llvm.lifetime.end.p0(i64 400, 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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree "no-trapping-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 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include<stdio.h> int main(void) { int a,b; scanf("%d %d\n",&a,&b); if(a>b){ printf("a > b\n"); }else if(a<b){ printf("a < b\n"); }else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245019/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b; scanf("%d %d",&a,&b); if(a>b) printf("a > b\n"); else if(a<b) printf("a < b\n"); else printf("a == b\n"); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245062/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { char a[101],b[100],c[101],v; int i=0,j,k,n=0,temp; scanf("%s",a); while(a[i]!='\0') { n++; i++;} for(i=0;i<n;i++) { if(a[i]!='+') { b[j]=a[i]; j++; } } for(i=0;i<j-1;i++) { for(k=0;k<j-1-i;k++) { if(b[k]>b[k+1]) { temp=b[k]; b[k]=b[k+1]; b[k+1]=temp; } } } v='+'; if(j==1) printf("%c",b[0]); else{ for(k=0;k<j-1;k++) { printf("%c%c",b[k],v); } printf("%c",b[j-1]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24512/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24512/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [101 x i8], align 16 %b = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 16, !tbaa !5 %cmp.not105 = icmp eq i8 %0, 0 br i1 %cmp.not105, label %if.end78, label %while.body for.cond.preheader: ; preds = %while.body %1 = and i64 %indvars.iv.next, 4294967295 %cmp3108.not = icmp eq i64 %1, 0 br i1 %cmp3108.not, label %if.end78, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 %xtraiter = and i64 %indvars.iv.next, 1 %2 = icmp eq i64 %wide.trip.count, 1 br i1 %2, label %for.cond16.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %3, 0 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !8 for.cond16.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %indvars.iv122.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next123.1, %for.inc.1 ] %j.0109.unr = phi i32 [ undef, %for.body.preheader ], [ %j.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 %arrayidx6.epil = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv122.unr %4 = load i8, ptr %arrayidx6.epil, align 1, !tbaa !5 %cmp8.not.epil = icmp eq i8 %4, 43 br i1 %cmp8.not.epil, label %for.cond16.preheader, label %if.then.epil if.then.epil: ; preds = %for.body.epil %idxprom12.epil = sext i32 %j.0109.unr to i64 %arrayidx13.epil = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom12.epil store i8 %4, ptr %arrayidx13.epil, align 1, !tbaa !5 %inc14.epil = add nsw i32 %j.0109.unr, 1 br label %for.cond16.preheader for.cond16.preheader: ; preds = %for.body.epil, %if.then.epil, %for.cond16.preheader.unr-lcssa %j.1.lcssa = phi i32 [ %j.0109.unr, %for.cond16.preheader.unr-lcssa ], [ %inc14.epil, %if.then.epil ], [ %j.0109.unr, %for.body.epil ] %sub = add i32 %j.1.lcssa, -1 %cmp17114 = icmp sgt i32 %j.1.lcssa, 1 br i1 %cmp17114, label %for.cond20.preheader, label %for.end53 for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv122 = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next123.1, %for.inc.1 ] %j.0109 = phi i32 [ undef, %for.body.preheader.new ], [ %j.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx6 = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv122 %5 = load i8, ptr %arrayidx6, align 2, !tbaa !5 %cmp8.not = icmp eq i8 %5, 43 br i1 %cmp8.not, label %for.inc, label %if.then if.then: ; preds = %for.body %idxprom12 = sext i32 %j.0109 to i64 %arrayidx13 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom12 store i8 %5, ptr %arrayidx13, align 1, !tbaa !5 %inc14 = add nsw i32 %j.0109, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %j.1 = phi i32 [ %inc14, %if.then ], [ %j.0109, %for.body ] %indvars.iv.next123 = or i64 %indvars.iv122, 1 %arrayidx6.1 = getelementptr inbounds [101 x i8], ptr %a, i64 0, i64 %indvars.iv.next123 %6 = load i8, ptr %arrayidx6.1, align 1, !tbaa !5 %cmp8.not.1 = icmp eq i8 %6, 43 br i1 %cmp8.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %idxprom12.1 = sext i32 %j.1 to i64 %arrayidx13.1 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom12.1 store i8 %6, ptr %arrayidx13.1, align 1, !tbaa !5 %inc14.1 = add nsw i32 %j.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %j.1.1 = phi i32 [ %inc14.1, %if.then.1 ], [ %j.1, %for.inc ] %indvars.iv.next123.1 = add nuw nsw i64 %indvars.iv122, 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.cond20.preheader: ; preds = %for.cond16.preheader, %for.inc51 %indvars.iv128 = phi i32 [ %indvars.iv.next129, %for.inc51 ], [ %sub, %for.cond16.preheader ] %i.2115 = phi i32 [ %inc52, %for.inc51 ], [ 0, %for.cond16.preheader ] %7 = zext i32 %indvars.iv128 to i64 %cmp23112 = icmp sgt i32 %sub, %i.2115 br i1 %cmp23112, label %for.body25.preheader, label %for.inc51 for.body25.preheader: ; preds = %for.cond20.preheader %.pre = load i8, ptr %b, align 16, !tbaa !5 %xtraiter151 = and i64 %7, 1 %8 = icmp eq i32 %indvars.iv128, 1 br i1 %8, label %for.inc51.loopexit.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter153 = and i64 %7, 4294967294 br label %for.body25 for.body25: ; preds = %for.inc48.1, %for.body25.preheader.new %9 = phi i8 [ %.pre, %for.body25.preheader.new ], [ %13, %for.inc48.1 ] %indvars.iv125 = phi i64 [ 0, %for.body25.preheader.new ], [ %indvars.iv.next126.1, %for.inc48.1 ] %niter154 = phi i64 [ 0, %for.body25.preheader.new ], [ %niter154.next.1, %for.inc48.1 ] %indvars.iv.next126 = or i64 %indvars.iv125, 1 %arrayidx30 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv.next126 %10 = load i8, ptr %arrayidx30, align 1, !tbaa !5 %cmp32 = icmp sgt i8 %9, %10 br i1 %cmp32, label %if.then34, label %for.inc48 if.then34: ; preds = %for.body25 %arrayidx27 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv125 store i8 %10, ptr %arrayidx27, align 2, !tbaa !5 store i8 %9, ptr %arrayidx30, align 1, !tbaa !5 br label %for.inc48 for.inc48: ; preds = %for.body25, %if.then34 %11 = phi i8 [ %10, %for.body25 ], [ %9, %if.then34 ] %indvars.iv.next126.1 = add nuw nsw i64 %indvars.iv125, 2 %arrayidx30.1 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv.next126.1 %12 = load i8, ptr %arrayidx30.1, align 2, !tbaa !5 %cmp32.1 = icmp sgt i8 %11, %12 br i1 %cmp32.1, label %if.then34.1, label %for.inc48.1 if.then34.1: ; preds = %for.inc48 %arrayidx27.1 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv.next126 store i8 %12, ptr %arrayidx27.1, align 1, !tbaa !5 store i8 %11, ptr %arrayidx30.1, align 2, !tbaa !5 br label %for.inc48.1 for.inc48.1: ; preds = %if.then34.1, %for.inc48 %13 = phi i8 [ %12, %for.inc48 ], [ %11, %if.then34.1 ] %niter154.next.1 = add i64 %niter154, 2 %niter154.ncmp.1 = icmp eq i64 %niter154.next.1, %unroll_iter153 br i1 %niter154.ncmp.1, label %for.inc51.loopexit.unr-lcssa, label %for.body25, !llvm.loop !11 for.inc51.loopexit.unr-lcssa: ; preds = %for.inc48.1, %for.body25.preheader %.unr = phi i8 [ %.pre, %for.body25.preheader ], [ %13, %for.inc48.1 ] %indvars.iv125.unr = phi i64 [ 0, %for.body25.preheader ], [ %indvars.iv.next126.1, %for.inc48.1 ] %lcmp.mod152.not = icmp eq i64 %xtraiter151, 0 br i1 %lcmp.mod152.not, label %for.inc51, label %for.body25.epil for.body25.epil: ; preds = %for.inc51.loopexit.unr-lcssa %indvars.iv.next126.epil = add nuw nsw i64 %indvars.iv125.unr, 1 %arrayidx30.epil = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv.next126.epil %14 = load i8, ptr %arrayidx30.epil, align 1, !tbaa !5 %cmp32.epil = icmp sgt i8 %.unr, %14 br i1 %cmp32.epil, label %if.then34.epil, label %for.inc51 if.then34.epil: ; preds = %for.body25.epil %arrayidx27.epil = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv125.unr store i8 %14, ptr %arrayidx27.epil, align 1, !tbaa !5 store i8 %.unr, ptr %arrayidx30.epil, align 1, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %for.inc51.loopexit.unr-lcssa, %if.then34.epil, %for.body25.epil, %for.cond20.preheader %inc52 = add nuw nsw i32 %i.2115, 1 %indvars.iv.next129 = add i32 %indvars.iv128, -1 %exitcond132.not = icmp eq i32 %inc52, %sub br i1 %exitcond132.not, label %for.end53, label %for.cond20.preheader, !llvm.loop !12 for.end53: ; preds = %for.inc51, %for.cond16.preheader %cmp17114145 = phi i1 [ false, %for.cond16.preheader ], [ %cmp17114, %for.inc51 ] %cmp54 = icmp eq i32 %j.1.lcssa, 1 br i1 %cmp54, label %if.end78, label %for.cond60.preheader for.cond60.preheader: ; preds = %for.end53 br i1 %cmp17114145, label %for.body64.preheader, label %for.end72 for.body64.preheader: ; preds = %for.cond60.preheader %wide.trip.count136 = zext i32 %sub to i64 br label %for.body64 for.body64: ; preds = %for.body64.preheader, %for.body64 %indvars.iv133 = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next134, %for.body64 ] %arrayidx66 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv133 %15 = load i8, ptr %arrayidx66, align 1, !tbaa !5 %conv67 = sext i8 %15 to i32 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv67, i32 noundef 43) %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136 br i1 %exitcond137.not, label %for.end72, label %for.body64, !llvm.loop !13 for.end72: ; preds = %for.body64, %for.cond60.preheader %idxprom74 = sext i32 %sub to i64 %arrayidx75 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom74 br label %if.end78 if.end78: ; preds = %for.end53, %entry, %for.cond.preheader, %for.end72 %.sink.in = phi ptr [ %arrayidx75, %for.end72 ], [ %b, %for.cond.preheader ], [ %b, %entry ], [ %b, %for.end53 ] %.sink = load i8, ptr %.sink.in, align 1, !tbaa !5 %conv76 = sext i8 %.sink to i32 %putchar = call i32 @putchar(i32 %conv76) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(a==b) printf("a == b\n"); else if(a > b) printf("a > b\n"); else if(a<b) printf("a < b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245163/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245163/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp sgt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp slt i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a, b; scanf("%d %d",&a,&b); if(a < b){ printf("a < b\n"); } else if(a > b){ printf("a > b\n"); } else { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245206/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245206/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int T; int x, y, a, b; int D; int R; scanf("%d", &T); while (T--) { scanf("%d %d %d %d", &x, &y, &a, &b); R = y - x; D = a + b; if (R % D) { printf("-1\n"); } else { R /= D; printf("%d\n", R); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24525/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24525/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %dec8 = add nsw i32 %0, -1 store i32 %dec8, ptr %T, align 4, !tbaa !5 %tobool.not9 = icmp eq i32 %0, 0 br i1 %tobool.not9, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %y, align 4, !tbaa !5 %2 = load i32, ptr %x, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %4, %3 %rem = srem i32 %sub, %add %div = sdiv i32 %sub, %add %tobool2.not = icmp eq i32 %rem, 0 br i1 %tobool2.not, label %if.else, label %if.then if.then: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %while.body %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %div) br label %if.end if.end: ; preds = %if.else, %if.then %5 = load i32, ptr %T, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %T, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b; scanf("%d%d", &a, &b); if(a < b)printf("a < b\n"); else if(a > b)printf("a > b\n"); else printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245293/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245293/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(a>b) puts("a > b"); if(a<b) puts("a < b"); if(a==b) puts("a == b"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245336/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a > b\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) %.pre = load i32, ptr %a, align 4, !tbaa !5 %.pre10 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %.pre10, %if.then ], [ %1, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ] %cmp2 = icmp slt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) %.pre11 = load i32, ptr %a, align 4, !tbaa !5 %.pre12 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then3, %if.end %4 = phi i32 [ %.pre12, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %.pre11, %if.then3 ], [ %3, %if.end ] %cmp6 = icmp eq i32 %5, %4 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end5 %call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3) br label %if.end9 if.end9: ; preds = %if.then7, %if.end5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int n; scanf("%d",&n); while(n--) { long long int a,b,c,d; scanf("%lld %lld %lld %lld",&a,&b,&c,&d); if((b-a)%(d+c)==0) printf("%lld\n",(b-a)/(d+c)); else printf("-1\n"); } //printf("Hello world!\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24538/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24538/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %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 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 %dec6 = add nsw i32 %0, -1 store i32 %dec6, ptr %n, align 4, !tbaa !5 %tobool.not7 = icmp eq i32 %0, 0 br i1 %tobool.not7, label %while.end, label %while.body while.body: ; preds = %entry, %if.end call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %1 = load i64, ptr %b, align 8, !tbaa !9 %2 = load i64, ptr %a, align 8, !tbaa !9 %sub = sub nsw i64 %1, %2 %3 = load i64, ptr %d, align 8, !tbaa !9 %4 = load i64, ptr %c, align 8, !tbaa !9 %add = add nsw i64 %4, %3 %rem = srem i64 %sub, %add %div = sdiv i64 %sub, %add %cmp = icmp eq i64 %rem, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div) br label %if.end if.else: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 %5 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end, %entry 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 @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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int a, b; int main(){ scanf("%d %d", &a, &b); if (a < b){ printf("a < b\n"); } else if (a == b){ printf("a == b\n"); } else if (a > b){ printf("a > b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @str = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.4 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b) %0 = load i32, ptr @a, align 4, !tbaa !5 %1 = load i32, ptr @b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp eq i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp sgt i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 = { nofree nounwind "no-trapping-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 } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main( ) { int a,b; scanf("%d %d",&a,&b); if(a > b) { printf("a > b\n"); } else if(a < b) { printf("a < b\n"); } else if(a == b) printf("a == b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a; int b; scanf("%d%d",&a,&b); if(a>b) { printf("a > b\n"); }else if(a<b) { printf("a < b\n"); }else if(a==b) { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.end10.sink.split, label %if.else if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.end10.sink.split, label %if.else5 if.else5: ; preds = %if.else %cmp6 = icmp eq i32 %0, %1 br i1 %cmp6, label %if.end10.sink.split, label %if.end10 if.end10.sink.split: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ] %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end10 if.end10: ; preds = %if.end10.sink.split, %if.else5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(){ int t; scanf("%d",&t); while(t-->0){ long long x,y,a,b; scanf("%lld %lld %lld %lld",&x,&y,&a,&b); long double len=y-x; long double v=a+b; if((int)(len/v)==(len/v)){ printf("%d\n",(int)(len/v)); } else{ printf("-1\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24556/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24556/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.2 = 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %x = alloca i64, align 8 %y = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec16 = add nsw i32 %0, -1 store i32 %dec16, ptr %t, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %while.body, label %while.end while.body: ; preds = %entry, %if.end call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i64, ptr %y, align 8, !tbaa !9 %2 = load i64, ptr %x, align 8, !tbaa !9 %sub = sub nsw i64 %1, %2 %conv = sitofp i64 %sub to x86_fp80 %3 = load i64, ptr %a, align 8, !tbaa !9 %4 = load i64, ptr %b, align 8, !tbaa !9 %add = add nsw i64 %4, %3 %conv2 = sitofp i64 %add to x86_fp80 %div = fdiv x86_fp80 %conv, %conv2 %conv3 = fptosi x86_fp80 %div to i32 %conv4 = sitofp i32 %conv3 to x86_fp80 %cmp6 = fcmp oeq x86_fp80 %div, %conv4 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %while.body %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv3) br label %if.end if.else: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 %5 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %5, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b; scanf("%d %d", &a, &b); if(a==b) printf("a == b\n"); else if(a>b) printf("a > b\n"); else printf("a < b\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245624/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a < b) { printf("a < b\n"); } else if (a > b) { printf("a > b\n"); } else { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245668/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245668/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); if(a>b) { printf("a > b\n"); } else if(a<b) { printf("a < b\n"); } else { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245710/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b; scanf("%d %d",&a,&b); if(a<b){ printf("a < b\n"); } else if(a==b){ printf("a == b\n"); } else{ printf("a > b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245754/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.4 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp eq i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b; scanf("%d %d",&a,&b); if (a>b){ printf("a > b\n"); }else if (a<b){ printf("a < b\n"); }else{ printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245798/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp2 = icmp slt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a<b) { printf("a < b\n"); } else if (a>b) { printf("a > b\n"); } else { printf("a == b\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245840/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245840/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp2 = icmp sgt i32 %0, %1 %str.4.str = select i1 %cmp2, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int cmp1(const void *a, const void *b){ return *((char *)a) - *((char *)b); } int cmp2(const void *a, const void *b){ return *((char *)b) - *((char *)a); } int ff(int a,int b){ int m,mm; int i; char s[13]={0}; /* for(i = 5;i >= 0;i--){ s[i] = a%10 + '0'; a /= 10; if(a==0)break; } for(;i >= 0;i--)s[i] = '0'; */ sprintf(s,"%d000000",a); s[b] = '\0'; qsort(s,b,sizeof(char),cmp1); m = atoi(s); qsort(s,b,sizeof(char),cmp2); mm = atoi(s); return mm-m; } int main(){ int i,j,a[100],l,ii,jj; int q,w,e,r,t,y; while(scanf("%d%d",&a[0],&l),l){ for(i = 1;1;i++){ a[i] = ff(a[i-1],l); q = 0; for(j = 0;j < i;j++){ if(a[i] == a[j]){ ii = i; jj = j; q = 1; break; } } if(q)break; } printf("%d %d %d\n",jj,a[jj],ii-jj); } return 0; } /* 959000 6 95900 6 9590 6 959 6 950900 6 920097 6 920079 6 919600 6 91960 6 9196 6 919060 6 862632 6 750843 6 55555 5 2 1 782464 6 782457 6 782446 6 779944 6 23 2 23 3 23 4 23 5 23 6 631764 6 6174 4 549945 6 495 3 105 3 104642 6 707813 6 191985 6 27605 5 171941 6 859443 6 188265 6 682092 6 94354 6 9983 6 90499 6 904909 6 904099 6 903980 6 90398 6 903908 6 903890 6 90389 6 903809 6 903098 6 903089 6 831701 6 831699 6 831600 6 83160 6 8316 6 831592 6 831570 6 99989 5 99964 5 999794 6 383342 6 383336 6 887 3 960 3 96 3 96 2 50005 6 500005 6 500 3 50 3 5 3 5 1 499994 6 0 0 */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245884/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245884/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d000000\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !5 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i8, ptr %b, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %1 = load i8, ptr %a, align 1, !tbaa !5 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @ff(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %s = alloca [13 x i8], align 1 call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %s) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %s, i8 0, i64 13, i1 false) %call = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a) #7 %idxprom = sext i32 %b to i64 %arrayidx = getelementptr inbounds [13 x i8], ptr %s, i64 0, i64 %idxprom store i8 0, ptr %arrayidx, align 1, !tbaa !5 call void @qsort(ptr noundef nonnull %s, i64 noundef %idxprom, i64 noundef 1, ptr noundef nonnull @cmp1) #7 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %s, ptr noundef null, i32 noundef 10) #7 %conv.i = trunc i64 %call.i to i32 call void @qsort(ptr noundef nonnull %s, i64 noundef %idxprom, i64 noundef 1, ptr noundef nonnull @cmp2) #7 %call.i10 = call i64 @strtol(ptr nocapture noundef nonnull %s, ptr noundef null, i32 noundef 10) #7 %conv.i11 = trunc i64 %call.i10 to i32 %sub = sub nsw i32 %conv.i11, %conv.i call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %s) #7 ret i32 %sub } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree 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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind 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: %s.i = alloca [13 x i8], align 1 %a = alloca [100 x i32], align 16 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 %call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %l) %0 = load i32, ptr %l, align 4, !tbaa !8 %tobool.not39 = icmp eq i32 %0, 0 br i1 %tobool.not39, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end17 %1 = phi i32 [ %8, %for.end17 ], [ %0, %entry ] %.pre = load i32, ptr %a, align 16, !tbaa !8 br label %for.cond for.cond: ; preds = %for.cond.preheader, %for.inc15 %2 = phi i32 [ %1, %for.cond.preheader ], [ %.pre46, %for.inc15 ] %3 = phi i32 [ %.pre, %for.cond.preheader ], [ %sub.i, %for.inc15 ] %indvars.iv42 = phi i64 [ 1, %for.cond.preheader ], [ %indvars.iv.next43, %for.inc15 ] call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %s.i) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %s.i, i8 0, i64 13, i1 false) %call.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s.i, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) #7 %idxprom.i = sext i32 %2 to i64 %arrayidx.i = getelementptr inbounds [13 x i8], ptr %s.i, i64 0, i64 %idxprom.i store i8 0, ptr %arrayidx.i, align 1, !tbaa !5 call void @qsort(ptr noundef nonnull %s.i, i64 noundef %idxprom.i, i64 noundef 1, ptr noundef nonnull @cmp1) #7 %call.i.i = call i64 @strtol(ptr nocapture noundef nonnull %s.i, ptr noundef null, i32 noundef 10) #7 %conv.i.i = trunc i64 %call.i.i to i32 call void @qsort(ptr noundef nonnull %s.i, i64 noundef %idxprom.i, i64 noundef 1, ptr noundef nonnull @cmp2) #7 %call.i10.i = call i64 @strtol(ptr nocapture noundef nonnull %s.i, ptr noundef null, i32 noundef 10) #7 %conv.i11.i = trunc i64 %call.i10.i to i32 %sub.i = sub nsw i32 %conv.i11.i, %conv.i.i call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %s.i) #7 %arrayidx4 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv42 store i32 %sub.i, ptr %arrayidx4, align 4, !tbaa !8 br label %for.body6 for.body6: ; preds = %for.cond, %for.inc %indvars.iv = phi i64 [ 0, %for.cond ], [ %indvars.iv.next, %for.inc ] %arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx10, align 4, !tbaa !8 %cmp11 = icmp eq i32 %sub.i, %4 br i1 %cmp11, label %for.end17, label %for.inc for.inc: ; preds = %for.body6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv42 br i1 %exitcond.not, label %for.inc15, label %for.body6, !llvm.loop !10 for.inc15: ; preds = %for.inc %indvars.iv.next43 = add nuw i64 %indvars.iv42, 1 %.pre46 = load i32, ptr %l, align 4, !tbaa !8 br label %for.cond for.end17: ; preds = %for.body6 %5 = trunc i64 %indvars.iv42 to i32 %6 = trunc i64 %indvars.iv to i32 %idxprom18 = and i64 %indvars.iv, 4294967295 %arrayidx19 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom18 %7 = load i32, ptr %arrayidx19, align 4, !tbaa !8 %sub20 = sub nsw i32 %5, %6 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6, i32 noundef %7, i32 noundef %sub20) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %l) %8 = load i32, ptr %l, align 4, !tbaa !8 %tobool.not = icmp eq i32 %8, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end17, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #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> #define N 1000003 int GetChar(char); long long getkey(char *); int Find(char *); void Insert(char *); int hash1(int); int hash2(int); int n = 0; char Hash[N][13]; int main () { int i; char c[7], str[13]; for(i = 0 ; i < N ; i++) Hash[i][0] = '\0'; scanf("%d",&n); for(i = 0 ; i < n ; i++) { scanf("%s %s",c,str); if(strcmp(c,"insert") == 0) { Insert(str); } else { if(Find(str) == 1) printf("yes\n"); else printf("no\n"); } } return 0; } int Find(char *str) { long long i = 0, j = 0, len = 0; len = getkey(str); while(i < N) { j = (hash1(len) + i * hash2(len)) % N; if(strcmp(Hash[j], str) == 0) return 1; else if(strlen(Hash[j]) == 0) return 0; else i++; } return 0; } void Insert(char *str) { long long i = 0, j = 0, h = 0, len = 0; len = getkey(str); while(i < N) { h = (hash1(len) + i * hash2(len)) % N; if(strcmp(Hash[h],str) == 0) break; else if(strlen(Hash[h]) == 0) { strcpy(Hash[h], str); break; } else i++; } } int hash1(int x) { return x % N; } int hash2(int x) { return 1 + (x % (N - 1)); } int GetChar(char ch) { if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } long long getkey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(GetChar(str[i])); p *= 5; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245941/source.c" target datalayout = "e-m:e-p270: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 @Hash = dso_local global [1000003 x [13 x i8]] 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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"insert\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [7 x i8], align 1 %str = alloca [13 x i8], align 1 call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %c) #11 call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %str) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 1, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 2, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1000003 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !8 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 1, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !10 %cmp365 = icmp sgt i32 %0, 0 br i1 %cmp365, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.166 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %str) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %c, ptr noundef nonnull dereferenceable(7) @.str.2, i64 7) %cmp9 = icmp eq i32 %bcmp, 0 %call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #12 %cmp8.not.i.i = icmp eq i64 %call.i.i, 0 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %getkey.exit.i, label %for.body.i.i.preheader for.body.i.i.preheader: ; preds = %if.then %xtraiter73 = and i64 %call.i.i, 1 %1 = icmp eq i64 %call.i.i, 1 br i1 %1, label %getkey.exit.i.loopexit.unr-lcssa, label %for.body.i.i.preheader.new for.body.i.i.preheader.new: ; preds = %for.body.i.i.preheader %unroll_iter76 = and i64 %call.i.i, -2 br label %for.body.i.i for.body.i.i: ; preds = %GetChar.exit.i.i.1, %for.body.i.i.preheader.new %i.011.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %inc.i.i.1, %GetChar.exit.i.i.1 ] %p.010.i.i = phi i32 [ 1, %for.body.i.i.preheader.new ], [ %mul2.i.i.1, %GetChar.exit.i.i.1 ] %sum.09.i.i = phi i32 [ 0, %for.body.i.i.preheader.new ], [ %add.i.i.1, %GetChar.exit.i.i.1 ] %niter77 = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %niter77.next.1, %GetChar.exit.i.i.1 ] %arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i %2 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5 switch i8 %2, label %GetChar.exit.i.i [ i8 84, label %if.then15.i.i.i i8 67, label %if.then5.i.i.i i8 71, label %if.then10.i.i.i ] if.then5.i.i.i: ; preds = %for.body.i.i br label %GetChar.exit.i.i if.then10.i.i.i: ; preds = %for.body.i.i br label %GetChar.exit.i.i if.then15.i.i.i: ; preds = %for.body.i.i br label %GetChar.exit.i.i GetChar.exit.i.i: ; preds = %if.then15.i.i.i, %if.then10.i.i.i, %if.then5.i.i.i, %for.body.i.i %retval.0.i.i.i = phi i32 [ 2, %if.then5.i.i.i ], [ 3, %if.then10.i.i.i ], [ 4, %if.then15.i.i.i ], [ 1, %for.body.i.i ] %mul.i.i = mul i32 %retval.0.i.i.i, %p.010.i.i %add.i.i = add i32 %mul.i.i, %sum.09.i.i %mul2.i.i = mul i32 %p.010.i.i, 5 %inc.i.i = or i64 %i.011.i.i, 1 %arrayidx.i.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i %3 = load i8, ptr %arrayidx.i.i.1, align 1, !tbaa !5 switch i8 %3, label %GetChar.exit.i.i.1 [ i8 84, label %if.then15.i.i.i.1 i8 67, label %if.then5.i.i.i.1 i8 71, label %if.then10.i.i.i.1 ] if.then10.i.i.i.1: ; preds = %GetChar.exit.i.i br label %GetChar.exit.i.i.1 if.then5.i.i.i.1: ; preds = %GetChar.exit.i.i br label %GetChar.exit.i.i.1 if.then15.i.i.i.1: ; preds = %GetChar.exit.i.i br label %GetChar.exit.i.i.1 GetChar.exit.i.i.1: ; preds = %if.then15.i.i.i.1, %if.then5.i.i.i.1, %if.then10.i.i.i.1, %GetChar.exit.i.i %retval.0.i.i.i.1 = phi i32 [ 2, %if.then5.i.i.i.1 ], [ 3, %if.then10.i.i.i.1 ], [ 4, %if.then15.i.i.i.1 ], [ 1, %GetChar.exit.i.i ] %mul.i.i.1 = mul i32 %retval.0.i.i.i.1, %mul2.i.i %add.i.i.1 = add i32 %mul.i.i.1, %add.i.i %mul2.i.i.1 = mul i32 %p.010.i.i, 25 %inc.i.i.1 = add nuw nsw i64 %i.011.i.i, 2 %niter77.next.1 = add i64 %niter77, 2 %niter77.ncmp.1 = icmp eq i64 %niter77.next.1, %unroll_iter76 br i1 %niter77.ncmp.1, label %getkey.exit.i.loopexit.unr-lcssa, label %for.body.i.i, !llvm.loop !12 getkey.exit.i.loopexit.unr-lcssa: ; preds = %GetChar.exit.i.i.1, %for.body.i.i.preheader %add.i.i.lcssa.ph = phi i32 [ undef, %for.body.i.i.preheader ], [ %add.i.i.1, %GetChar.exit.i.i.1 ] %i.011.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %inc.i.i.1, %GetChar.exit.i.i.1 ] %p.010.i.i.unr = phi i32 [ 1, %for.body.i.i.preheader ], [ %mul2.i.i.1, %GetChar.exit.i.i.1 ] %sum.09.i.i.unr = phi i32 [ 0, %for.body.i.i.preheader ], [ %add.i.i.1, %GetChar.exit.i.i.1 ] %lcmp.mod74.not = icmp eq i64 %xtraiter73, 0 br i1 %lcmp.mod74.not, label %getkey.exit.i, label %for.body.i.i.epil for.body.i.i.epil: ; preds = %getkey.exit.i.loopexit.unr-lcssa %arrayidx.i.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i.unr %4 = load i8, ptr %arrayidx.i.i.epil, align 1, !tbaa !5 switch i8 %4, label %GetChar.exit.i.i.epil [ i8 84, label %if.then15.i.i.i.epil i8 67, label %if.then5.i.i.i.epil i8 71, label %if.then10.i.i.i.epil ] if.then10.i.i.i.epil: ; preds = %for.body.i.i.epil br label %GetChar.exit.i.i.epil if.then5.i.i.i.epil: ; preds = %for.body.i.i.epil br label %GetChar.exit.i.i.epil if.then15.i.i.i.epil: ; preds = %for.body.i.i.epil br label %GetChar.exit.i.i.epil GetChar.exit.i.i.epil: ; preds = %if.then15.i.i.i.epil, %if.then5.i.i.i.epil, %if.then10.i.i.i.epil, %for.body.i.i.epil %retval.0.i.i.i.epil = phi i32 [ 2, %if.then5.i.i.i.epil ], [ 3, %if.then10.i.i.i.epil ], [ 4, %if.then15.i.i.i.epil ], [ 1, %for.body.i.i.epil ] %mul.i.i.epil = mul i32 %retval.0.i.i.i.epil, %p.010.i.i.unr %add.i.i.epil = add i32 %mul.i.i.epil, %sum.09.i.i.unr br label %getkey.exit.i getkey.exit.i: ; preds = %GetChar.exit.i.i.epil, %getkey.exit.i.loopexit.unr-lcssa, %if.then %sum.0.lcssa.i.i = phi i32 [ 0, %if.then ], [ %add.i.i.lcssa.ph, %getkey.exit.i.loopexit.unr-lcssa ], [ %add.i.i.epil, %GetChar.exit.i.i.epil ] %rem.i.i = srem i32 %sum.0.lcssa.i.i, 1000003 %conv2.i = sext i32 %rem.i.i to i64 %rem.i27.i = srem i32 %sum.0.lcssa.i.i, 1000002 %add.i28.i = add nsw i32 %rem.i27.i, 1 %conv5.i = sext i32 %add.i28.i to i64 br label %while.body.i while.cond.i: ; preds = %if.else.i %inc.i = add nuw nsw i64 %i.029.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, 1000003 br i1 %exitcond.not.i, label %for.inc19, label %while.body.i, !llvm.loop !13 while.body.i: ; preds = %while.cond.i, %getkey.exit.i %i.029.i = phi i64 [ 0, %getkey.exit.i ], [ %inc.i, %while.cond.i ] %mul.i = mul nsw i64 %i.029.i, %conv5.i %add.i = add nsw i64 %mul.i, %conv2.i %rem.i = srem i64 %add.i, 1000003 %arrayidx.i = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %rem.i %call6.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %str) #12 %cmp7.i = icmp eq i32 %call6.i, 0 br i1 %cmp7.i, label %for.inc19, label %if.else.i if.else.i: ; preds = %while.body.i %char0.i = load i8, ptr %arrayidx.i, align 1 %cmp12.i = icmp eq i8 %char0.i, 0 br i1 %cmp12.i, label %if.then14.i, label %while.cond.i if.then14.i: ; preds = %if.else.i %call17.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %str) #11 br label %for.inc19 if.else: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %getkey.exit.i42, label %for.body.i.i29.preheader for.body.i.i29.preheader: ; preds = %if.else %xtraiter = and i64 %call.i.i, 1 %5 = icmp eq i64 %call.i.i, 1 br i1 %5, label %getkey.exit.i42.loopexit.unr-lcssa, label %for.body.i.i29.preheader.new for.body.i.i29.preheader.new: ; preds = %for.body.i.i29.preheader %unroll_iter = and i64 %call.i.i, -2 br label %for.body.i.i29 for.body.i.i29: ; preds = %GetChar.exit.i.i35.1, %for.body.i.i29.preheader.new %i.011.i.i30 = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %inc.i.i40.1, %GetChar.exit.i.i35.1 ] %p.010.i.i31 = phi i32 [ 1, %for.body.i.i29.preheader.new ], [ %mul2.i.i39.1, %GetChar.exit.i.i35.1 ] %sum.09.i.i32 = phi i32 [ 0, %for.body.i.i29.preheader.new ], [ %add.i.i38.1, %GetChar.exit.i.i35.1 ] %niter = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %niter.next.1, %GetChar.exit.i.i35.1 ] %arrayidx.i.i33 = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30 %6 = load i8, ptr %arrayidx.i.i33, align 1, !tbaa !5 switch i8 %6, label %GetChar.exit.i.i35 [ i8 84, label %if.then15.i.i.i60 i8 67, label %if.then5.i.i.i59 i8 71, label %if.then10.i.i.i34 ] if.then5.i.i.i59: ; preds = %for.body.i.i29 br label %GetChar.exit.i.i35 if.then10.i.i.i34: ; preds = %for.body.i.i29 br label %GetChar.exit.i.i35 if.then15.i.i.i60: ; preds = %for.body.i.i29 br label %GetChar.exit.i.i35 GetChar.exit.i.i35: ; preds = %if.then15.i.i.i60, %if.then10.i.i.i34, %if.then5.i.i.i59, %for.body.i.i29 %retval.0.i.i.i36 = phi i32 [ 2, %if.then5.i.i.i59 ], [ 3, %if.then10.i.i.i34 ], [ 4, %if.then15.i.i.i60 ], [ 1, %for.body.i.i29 ] %mul.i.i37 = mul i32 %retval.0.i.i.i36, %p.010.i.i31 %add.i.i38 = add i32 %mul.i.i37, %sum.09.i.i32 %mul2.i.i39 = mul i32 %p.010.i.i31, 5 %inc.i.i40 = or i64 %i.011.i.i30, 1 %arrayidx.i.i33.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i40 %7 = load i8, ptr %arrayidx.i.i33.1, align 1, !tbaa !5 switch i8 %7, label %GetChar.exit.i.i35.1 [ i8 84, label %if.then15.i.i.i60.1 i8 67, label %if.then5.i.i.i59.1 i8 71, label %if.then10.i.i.i34.1 ] if.then10.i.i.i34.1: ; preds = %GetChar.exit.i.i35 br label %GetChar.exit.i.i35.1 if.then5.i.i.i59.1: ; preds = %GetChar.exit.i.i35 br label %GetChar.exit.i.i35.1 if.then15.i.i.i60.1: ; preds = %GetChar.exit.i.i35 br label %GetChar.exit.i.i35.1 GetChar.exit.i.i35.1: ; preds = %if.then15.i.i.i60.1, %if.then5.i.i.i59.1, %if.then10.i.i.i34.1, %GetChar.exit.i.i35 %retval.0.i.i.i36.1 = phi i32 [ 2, %if.then5.i.i.i59.1 ], [ 3, %if.then10.i.i.i34.1 ], [ 4, %if.then15.i.i.i60.1 ], [ 1, %GetChar.exit.i.i35 ] %mul.i.i37.1 = mul i32 %retval.0.i.i.i36.1, %mul2.i.i39 %add.i.i38.1 = add i32 %mul.i.i37.1, %add.i.i38 %mul2.i.i39.1 = mul i32 %p.010.i.i31, 25 %inc.i.i40.1 = add nuw nsw i64 %i.011.i.i30, 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 %getkey.exit.i42.loopexit.unr-lcssa, label %for.body.i.i29, !llvm.loop !12 getkey.exit.i42.loopexit.unr-lcssa: ; preds = %GetChar.exit.i.i35.1, %for.body.i.i29.preheader %add.i.i38.lcssa.ph = phi i32 [ undef, %for.body.i.i29.preheader ], [ %add.i.i38.1, %GetChar.exit.i.i35.1 ] %i.011.i.i30.unr = phi i64 [ 0, %for.body.i.i29.preheader ], [ %inc.i.i40.1, %GetChar.exit.i.i35.1 ] %p.010.i.i31.unr = phi i32 [ 1, %for.body.i.i29.preheader ], [ %mul2.i.i39.1, %GetChar.exit.i.i35.1 ] %sum.09.i.i32.unr = phi i32 [ 0, %for.body.i.i29.preheader ], [ %add.i.i38.1, %GetChar.exit.i.i35.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getkey.exit.i42, label %for.body.i.i29.epil for.body.i.i29.epil: ; preds = %getkey.exit.i42.loopexit.unr-lcssa %arrayidx.i.i33.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30.unr %8 = load i8, ptr %arrayidx.i.i33.epil, align 1, !tbaa !5 switch i8 %8, label %GetChar.exit.i.i35.epil [ i8 84, label %if.then15.i.i.i60.epil i8 67, label %if.then5.i.i.i59.epil i8 71, label %if.then10.i.i.i34.epil ] if.then10.i.i.i34.epil: ; preds = %for.body.i.i29.epil br label %GetChar.exit.i.i35.epil if.then5.i.i.i59.epil: ; preds = %for.body.i.i29.epil br label %GetChar.exit.i.i35.epil if.then15.i.i.i60.epil: ; preds = %for.body.i.i29.epil br label %GetChar.exit.i.i35.epil GetChar.exit.i.i35.epil: ; preds = %if.then15.i.i.i60.epil, %if.then5.i.i.i59.epil, %if.then10.i.i.i34.epil, %for.body.i.i29.epil %retval.0.i.i.i36.epil = phi i32 [ 2, %if.then5.i.i.i59.epil ], [ 3, %if.then10.i.i.i34.epil ], [ 4, %if.then15.i.i.i60.epil ], [ 1, %for.body.i.i29.epil ] %mul.i.i37.epil = mul i32 %retval.0.i.i.i36.epil, %p.010.i.i31.unr %add.i.i38.epil = add i32 %mul.i.i37.epil, %sum.09.i.i32.unr br label %getkey.exit.i42 getkey.exit.i42: ; preds = %GetChar.exit.i.i35.epil, %getkey.exit.i42.loopexit.unr-lcssa, %if.else %sum.0.lcssa.i.i43 = phi i32 [ 0, %if.else ], [ %add.i.i38.lcssa.ph, %getkey.exit.i42.loopexit.unr-lcssa ], [ %add.i.i38.epil, %GetChar.exit.i.i35.epil ] %rem.i.i44 = srem i32 %sum.0.lcssa.i.i43, 1000003 %conv2.i45 = sext i32 %rem.i.i44 to i64 %rem.i24.i = srem i32 %sum.0.lcssa.i.i43, 1000002 %add.i25.i = add nsw i32 %rem.i24.i, 1 %conv5.i46 = sext i32 %add.i25.i to i64 br label %while.body.i47 while.body.i47: ; preds = %if.else.i54, %getkey.exit.i42 %i.026.i = phi i64 [ 0, %getkey.exit.i42 ], [ %inc.i57, %if.else.i54 ] %mul.i48 = mul nsw i64 %i.026.i, %conv5.i46 %add.i49 = add nsw i64 %mul.i48, %conv2.i45 %rem.i50 = srem i64 %add.i49, 1000003 %arrayidx.i51 = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %rem.i50 %call6.i52 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i51, ptr noundef nonnull dereferenceable(1) %str) #12 %cmp7.i53 = icmp eq i32 %call6.i52, 0 br i1 %cmp7.i53, label %if.then14, label %if.else.i54 if.else.i54: ; preds = %while.body.i47 %char0.i55 = load i8, ptr %arrayidx.i51, align 1 %cmp12.i56 = icmp eq i8 %char0.i55, 0 %inc.i57 = add nuw nsw i64 %i.026.i, 1 %exitcond.not.i58 = icmp eq i64 %inc.i57, 1000003 %or.cond.i = select i1 %cmp12.i56, i1 true, i1 %exitcond.not.i58 br i1 %or.cond.i, label %if.else16, label %while.body.i47, !llvm.loop !14 if.then14: ; preds = %while.body.i47 %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %for.inc19 if.else16: ; preds = %if.else.i54 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %while.body.i, %while.cond.i, %if.then14.i, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.166, 1 %9 = load i32, ptr @n, align 4, !tbaa !10 %cmp3 = icmp slt i32 %inc20, %9 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !15 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %c) #11 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @Insert(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #12 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getkey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getkey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %GetChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %GetChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %GetChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %GetChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %GetChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %GetChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %GetChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %GetChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %GetChar.exit.i GetChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %GetChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 if.then5.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 if.then15.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 GetChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %GetChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %GetChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getkey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !12 getkey.exit.loopexit.unr-lcssa: ; preds = %GetChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %GetChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %GetChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %GetChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %GetChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getkey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getkey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %GetChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil GetChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getkey.exit getkey.exit: ; preds = %GetChar.exit.i.epil, %getkey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getkey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %GetChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1000003 %conv2 = sext i32 %rem.i to i64 %rem.i27 = srem i32 %sum.0.lcssa.i, 1000002 %add.i28 = add nsw i32 %rem.i27, 1 %conv5 = sext i32 %add.i28 to i64 br label %while.body while.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.029, 1 %exitcond.not = icmp eq i64 %inc, 1000003 br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !13 while.body: ; preds = %getkey.exit, %while.cond %i.029 = phi i64 [ 0, %getkey.exit ], [ %inc, %while.cond ] %mul = mul nsw i64 %i.029, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1000003 %arrayidx = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #12 %cmp7 = icmp eq i32 %call6, 0 br i1 %cmp7, label %while.end, label %if.else if.else: ; preds = %while.body %char0 = load i8, ptr %arrayidx, align 1 %cmp12 = icmp eq i8 %char0, 0 br i1 %cmp12, label %if.then14, label %while.cond if.then14: ; preds = %if.else %call17 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #11 br label %while.end while.end: ; preds = %while.body, %while.cond, %if.then14 ret void } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @Find(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #12 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getkey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getkey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %GetChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %GetChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %GetChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %GetChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %GetChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %GetChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %GetChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %GetChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %GetChar.exit.i GetChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %GetChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 if.then5.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 if.then15.i.i.1: ; preds = %GetChar.exit.i br label %GetChar.exit.i.1 GetChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %GetChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %GetChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getkey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !12 getkey.exit.loopexit.unr-lcssa: ; preds = %GetChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %GetChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %GetChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %GetChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %GetChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getkey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getkey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %GetChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %GetChar.exit.i.epil GetChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getkey.exit getkey.exit: ; preds = %GetChar.exit.i.epil, %getkey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getkey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %GetChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1000003 %conv2 = sext i32 %rem.i to i64 %rem.i24 = srem i32 %sum.0.lcssa.i, 1000002 %add.i25 = add nsw i32 %rem.i24, 1 %conv5 = sext i32 %add.i25 to i64 br label %while.body while.body: ; preds = %if.else, %getkey.exit %i.026 = phi i64 [ 0, %getkey.exit ], [ %inc, %if.else ] %mul = mul nsw i64 %i.026, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1000003 %arrayidx = getelementptr inbounds [1000003 x [13 x i8]], ptr @Hash, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #12 %cmp7 = icmp eq i32 %call6, 0 br i1 %cmp7, label %cleanup, label %if.else if.else: ; preds = %while.body %char0 = load i8, ptr %arrayidx, align 1 %cmp12 = icmp eq i8 %char0, 0 %inc = add nuw nsw i64 %i.026, 1 %exitcond.not = icmp eq i64 %inc, 1000003 %or.cond = select i1 %cmp12, i1 true, i1 %exitcond.not br i1 %or.cond, label %cleanup, label %while.body, !llvm.loop !14 cleanup: ; preds = %if.else, %while.body %retval.0 = phi i32 [ 1, %while.body ], [ 0, %if.else ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getkey(ptr nocapture noundef readonly %str) local_unnamed_addr #6 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #12 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %GetChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %GetChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %GetChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %GetChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %GetChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %GetChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %GetChar.exit if.then10.i: ; preds = %for.body br label %GetChar.exit if.then15.i: ; preds = %for.body br label %GetChar.exit GetChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %GetChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %GetChar.exit br label %GetChar.exit.1 if.then5.i.1: ; preds = %GetChar.exit br label %GetChar.exit.1 if.then15.i.1: ; preds = %GetChar.exit br label %GetChar.exit.1 GetChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %GetChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %GetChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !12 for.end.loopexit.unr-lcssa: ; preds = %GetChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %GetChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %GetChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %GetChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %GetChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %GetChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %GetChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %GetChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %GetChar.exit.epil GetChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %GetChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %GetChar.exit.epil ] ret i64 %sum.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @hash1(i32 noundef %x) local_unnamed_addr #7 { entry: %rem = srem i32 %x, 1000003 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @hash2(i32 noundef %x) local_unnamed_addr #7 { entry: %rem = srem i32 %x, 1000002 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) 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 #8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @GetChar(i8 noundef signext %ch) local_unnamed_addr #7 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #10 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #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 = { 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 #9 = { nofree nounwind willreturn memory(argmem: read) } attributes #10 = { nofree nounwind } attributes #11 = { nounwind } attributes #12 = { 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} !13 = distinct !{!13, !9} !14 = distinct !{!14, !9} !15 = distinct !{!15, !9}
/* * Dictionary.c * * Created on: 2015/02/16 */ #include<stdio.h> #include<string.h> #define M 1000213 void insert(char*); int find(char*); int get_key(char*); int get_keycode(char); int get_hash_num(int,int); char hash[M][13]={"\0"}; int main(void){ int n; int i; char str[13],input[7]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %s",input,str); if(input[0]=='i') insert(str); if(input[0]=='f'){ if(find(str)==1) printf("yes\n"); else printf("no\n"); } } return 0; } void insert(char *str){ int i=0,hash_num,data; data=get_key(str); while(1){ hash_num=get_hash_num(data,i); if(strcmp(hash[hash_num],"\0")==0){ strcpy(hash[hash_num],str); break; } i++; } } int find(char *str){ int data,hash_num,i=0; data=get_key(str); while(1){ hash_num=get_hash_num(data,i); if(strcmp(hash[hash_num],"\0")==0) return 0; if(strcmp(hash[hash_num],str)==0) return 1; i++; } } int get_key(char *str){ int data=0,cnt=0,p=1; while(str[cnt]!='\0'){ data+=p*get_keycode(str[cnt]); p*=5; cnt++; } return data; } int get_keycode(char work){ switch(work){ case 'A': return 1; case 'C': return 2; case 'G': return 3; case 'T': return 4; } } int get_hash_num(int data,int i){ return ((data%M)+i*(data%(M-1)+1))%M; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245985/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @hash = dso_local global [1000213 x [13 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %str = alloca [13 x i8], align 1 %input = alloca [7 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %str) #10 call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %input) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.055 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %input, ptr noundef nonnull %str) %1 = load i8, ptr %input, align 1, !tbaa !9 switch i8 %1, label %for.inc [ i8 105, label %if.then i8 102, label %if.then10 ] if.then: ; preds = %for.body %2 = load i8, ptr %str, align 1, !tbaa !9 %cmp.not10.i.i = icmp eq i8 %2, 0 br i1 %cmp.not10.i.i, label %get_key.exit.i, label %while.body.i.i while.body.i.i: ; preds = %if.then, %get_keycode.exit.i.i %indvars.iv.i.i = phi i64 [ %indvars.iv.next.i.i, %get_keycode.exit.i.i ], [ 0, %if.then ] %3 = phi i8 [ %4, %get_keycode.exit.i.i ], [ %2, %if.then ] %p.013.i.i = phi i32 [ %mul4.i.i, %get_keycode.exit.i.i ], [ 1, %if.then ] %data.011.i.i = phi i32 [ %add.i.i, %get_keycode.exit.i.i ], [ 0, %if.then ] %conv.i.i.i = sext i8 %3 to i32 switch i32 %conv.i.i.i, label %get_keycode.exit.i.i [ i32 84, label %sw.bb3.i.i.i i32 67, label %sw.bb1.i.i.i i32 71, label %sw.bb2.i.i.i ] sw.bb1.i.i.i: ; preds = %while.body.i.i br label %get_keycode.exit.i.i sw.bb2.i.i.i: ; preds = %while.body.i.i br label %get_keycode.exit.i.i sw.bb3.i.i.i: ; preds = %while.body.i.i br label %get_keycode.exit.i.i get_keycode.exit.i.i: ; preds = %sw.bb3.i.i.i, %sw.bb2.i.i.i, %sw.bb1.i.i.i, %while.body.i.i %retval.0.i.i.i = phi i32 [ 4, %sw.bb3.i.i.i ], [ 3, %sw.bb2.i.i.i ], [ 2, %sw.bb1.i.i.i ], [ 1, %while.body.i.i ] %mul.i.i = mul nsw i32 %retval.0.i.i.i, %p.013.i.i %add.i.i = add nuw nsw i32 %mul.i.i, %data.011.i.i %mul4.i.i = mul nsw i32 %p.013.i.i, 5 %indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1 %arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i.i %4 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !9 %cmp.not.i.i = icmp eq i8 %4, 0 br i1 %cmp.not.i.i, label %get_key.exit.i, label %while.body.i.i, !llvm.loop !10 get_key.exit.i: ; preds = %get_keycode.exit.i.i, %if.then %data.0.lcssa.i.i = phi i32 [ 0, %if.then ], [ %add.i.i, %get_keycode.exit.i.i ] %rem.i.i = srem i32 %data.0.lcssa.i.i, 1000213 %rem1.i.i = srem i32 %data.0.lcssa.i.i, 1000212 %add.i10.i = add nsw i32 %rem1.i.i, 1 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %get_key.exit.i %i.0.i = phi i32 [ 0, %get_key.exit.i ], [ %inc.i, %while.cond.i ] %mul.i11.i = mul nsw i32 %i.0.i, %add.i10.i %add2.i.i = add nsw i32 %mul.i11.i, %rem.i.i %rem3.i.i = srem i32 %add2.i.i, 1000213 %idxprom.i = sext i32 %rem3.i.i to i64 %arrayidx.i = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom.i %strcmpload.i = load i8, ptr %arrayidx.i, align 1 %cmp.i = icmp eq i8 %strcmpload.i, 0 %inc.i = add nuw nsw i32 %i.0.i, 1 br i1 %cmp.i, label %insert.exit, label %while.cond.i insert.exit: ; preds = %while.cond.i %call6.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %str) #10 br label %for.inc if.then10: ; preds = %for.body %5 = load i8, ptr %str, align 1, !tbaa !9 %cmp.not10.i.i22 = icmp eq i8 %5, 0 br i1 %cmp.not10.i.i22, label %get_key.exit.i37, label %while.body.i.i23 while.body.i.i23: ; preds = %if.then10, %get_keycode.exit.i.i29 %indvars.iv.i.i24 = phi i64 [ %indvars.iv.next.i.i34, %get_keycode.exit.i.i29 ], [ 0, %if.then10 ] %6 = phi i8 [ %7, %get_keycode.exit.i.i29 ], [ %5, %if.then10 ] %p.013.i.i25 = phi i32 [ %mul4.i.i33, %get_keycode.exit.i.i29 ], [ 1, %if.then10 ] %data.011.i.i26 = phi i32 [ %add.i.i32, %get_keycode.exit.i.i29 ], [ 0, %if.then10 ] %conv.i.i.i27 = sext i8 %6 to i32 switch i32 %conv.i.i.i27, label %get_keycode.exit.i.i29 [ i32 84, label %sw.bb3.i.i.i51 i32 67, label %sw.bb1.i.i.i50 i32 71, label %sw.bb2.i.i.i28 ] sw.bb1.i.i.i50: ; preds = %while.body.i.i23 br label %get_keycode.exit.i.i29 sw.bb2.i.i.i28: ; preds = %while.body.i.i23 br label %get_keycode.exit.i.i29 sw.bb3.i.i.i51: ; preds = %while.body.i.i23 br label %get_keycode.exit.i.i29 get_keycode.exit.i.i29: ; preds = %sw.bb3.i.i.i51, %sw.bb2.i.i.i28, %sw.bb1.i.i.i50, %while.body.i.i23 %retval.0.i.i.i30 = phi i32 [ 4, %sw.bb3.i.i.i51 ], [ 3, %sw.bb2.i.i.i28 ], [ 2, %sw.bb1.i.i.i50 ], [ 1, %while.body.i.i23 ] %mul.i.i31 = mul nsw i32 %retval.0.i.i.i30, %p.013.i.i25 %add.i.i32 = add nuw nsw i32 %mul.i.i31, %data.011.i.i26 %mul4.i.i33 = mul nsw i32 %p.013.i.i25, 5 %indvars.iv.next.i.i34 = add nuw nsw i64 %indvars.iv.i.i24, 1 %arrayidx.i.i35 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i.i34 %7 = load i8, ptr %arrayidx.i.i35, align 1, !tbaa !9 %cmp.not.i.i36 = icmp eq i8 %7, 0 br i1 %cmp.not.i.i36, label %get_key.exit.i37, label %while.body.i.i23, !llvm.loop !10 get_key.exit.i37: ; preds = %get_keycode.exit.i.i29, %if.then10 %data.0.lcssa.i.i38 = phi i32 [ 0, %if.then10 ], [ %add.i.i32, %get_keycode.exit.i.i29 ] %rem.i.i39 = srem i32 %data.0.lcssa.i.i38, 1000213 %rem1.i.i40 = srem i32 %data.0.lcssa.i.i38, 1000212 %add.i15.i = add nsw i32 %rem1.i.i40, 1 %idxprom17.i = sext i32 %rem.i.i39 to i64 %arrayidx18.i = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom17.i %strcmpload19.i = load i8, ptr %arrayidx18.i, align 1 %cmp20.i = icmp eq i8 %strcmpload19.i, 0 br i1 %cmp20.i, label %if.else, label %if.end.i while.cond.i42: ; preds = %if.end.i %inc.i43 = add nuw nsw i32 %i.021.i, 1 %mul.i16.i = mul nsw i32 %inc.i43, %add.i15.i %add2.i.i44 = add nsw i32 %mul.i16.i, %rem.i.i39 %rem3.i.i45 = srem i32 %add2.i.i44, 1000213 %idxprom.i46 = sext i32 %rem3.i.i45 to i64 %arrayidx.i47 = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom.i46 %strcmpload.i48 = load i8, ptr %arrayidx.i47, align 1 %cmp.i49 = icmp eq i8 %strcmpload.i48, 0 br i1 %cmp.i49, label %if.else, label %if.end.i if.end.i: ; preds = %get_key.exit.i37, %while.cond.i42 %arrayidx22.i = phi ptr [ %arrayidx.i47, %while.cond.i42 ], [ %arrayidx18.i, %get_key.exit.i37 ] %i.021.i = phi i32 [ %inc.i43, %while.cond.i42 ], [ 0, %get_key.exit.i37 ] %call6.i41 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx22.i, ptr noundef nonnull dereferenceable(1) %str) #11 %cmp7.i = icmp eq i32 %call6.i41, 0 br i1 %cmp7.i, label %if.then15, label %while.cond.i42 if.then15: ; preds = %if.end.i %puts21 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %for.inc if.else: ; preds = %while.cond.i42, %get_key.exit.i37 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc for.inc: ; preds = %insert.exit, %for.body, %if.else, %if.then15 %inc = add nuw nsw i32 %i.055, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %8 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %input) #10 call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %str) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #3 { entry: %0 = load i8, ptr %str, align 1, !tbaa !9 %cmp.not10.i = icmp eq i8 %0, 0 br i1 %cmp.not10.i, label %get_key.exit, label %while.body.i while.body.i: ; preds = %entry, %get_keycode.exit.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %get_keycode.exit.i ], [ 0, %entry ] %1 = phi i8 [ %2, %get_keycode.exit.i ], [ %0, %entry ] %p.013.i = phi i32 [ %mul4.i, %get_keycode.exit.i ], [ 1, %entry ] %data.011.i = phi i32 [ %add.i, %get_keycode.exit.i ], [ 0, %entry ] %conv.i.i = sext i8 %1 to i32 switch i32 %conv.i.i, label %get_keycode.exit.i [ i32 84, label %sw.bb3.i.i i32 67, label %sw.bb1.i.i i32 71, label %sw.bb2.i.i ] sw.bb1.i.i: ; preds = %while.body.i br label %get_keycode.exit.i sw.bb2.i.i: ; preds = %while.body.i br label %get_keycode.exit.i sw.bb3.i.i: ; preds = %while.body.i br label %get_keycode.exit.i get_keycode.exit.i: ; preds = %sw.bb3.i.i, %sw.bb2.i.i, %sw.bb1.i.i, %while.body.i %retval.0.i.i = phi i32 [ 4, %sw.bb3.i.i ], [ 3, %sw.bb2.i.i ], [ 2, %sw.bb1.i.i ], [ 1, %while.body.i ] %mul.i = mul nsw i32 %retval.0.i.i, %p.013.i %add.i = add nuw nsw i32 %mul.i, %data.011.i %mul4.i = mul nsw i32 %p.013.i, 5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i, align 1, !tbaa !9 %cmp.not.i = icmp eq i8 %2, 0 br i1 %cmp.not.i, label %get_key.exit, label %while.body.i, !llvm.loop !10 get_key.exit: ; preds = %get_keycode.exit.i, %entry %data.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %get_keycode.exit.i ] %rem.i = srem i32 %data.0.lcssa.i, 1000213 %rem1.i = srem i32 %data.0.lcssa.i, 1000212 %add.i10 = add nsw i32 %rem1.i, 1 br label %while.cond while.cond: ; preds = %while.cond, %get_key.exit %i.0 = phi i32 [ 0, %get_key.exit ], [ %inc, %while.cond ] %mul.i11 = mul nsw i32 %i.0, %add.i10 %add2.i = add nsw i32 %mul.i11, %rem.i %rem3.i = srem i32 %add2.i, 1000213 %idxprom = sext i32 %rem3.i to i64 %arrayidx = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom %strcmpload = load i8, ptr %arrayidx, align 1 %cmp = icmp eq i8 %strcmpload, 0 %inc = add nuw nsw i32 %i.0, 1 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %while.cond %call6 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 ret void } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %0 = load i8, ptr %str, align 1, !tbaa !9 %cmp.not10.i = icmp eq i8 %0, 0 br i1 %cmp.not10.i, label %get_key.exit, label %while.body.i while.body.i: ; preds = %entry, %get_keycode.exit.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %get_keycode.exit.i ], [ 0, %entry ] %1 = phi i8 [ %2, %get_keycode.exit.i ], [ %0, %entry ] %p.013.i = phi i32 [ %mul4.i, %get_keycode.exit.i ], [ 1, %entry ] %data.011.i = phi i32 [ %add.i, %get_keycode.exit.i ], [ 0, %entry ] %conv.i.i = sext i8 %1 to i32 switch i32 %conv.i.i, label %get_keycode.exit.i [ i32 84, label %sw.bb3.i.i i32 67, label %sw.bb1.i.i i32 71, label %sw.bb2.i.i ] sw.bb1.i.i: ; preds = %while.body.i br label %get_keycode.exit.i sw.bb2.i.i: ; preds = %while.body.i br label %get_keycode.exit.i sw.bb3.i.i: ; preds = %while.body.i br label %get_keycode.exit.i get_keycode.exit.i: ; preds = %sw.bb3.i.i, %sw.bb2.i.i, %sw.bb1.i.i, %while.body.i %retval.0.i.i = phi i32 [ 4, %sw.bb3.i.i ], [ 3, %sw.bb2.i.i ], [ 2, %sw.bb1.i.i ], [ 1, %while.body.i ] %mul.i = mul nsw i32 %retval.0.i.i, %p.013.i %add.i = add nuw nsw i32 %mul.i, %data.011.i %mul4.i = mul nsw i32 %p.013.i, 5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i, align 1, !tbaa !9 %cmp.not.i = icmp eq i8 %2, 0 br i1 %cmp.not.i, label %get_key.exit, label %while.body.i, !llvm.loop !10 get_key.exit: ; preds = %get_keycode.exit.i, %entry %data.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %get_keycode.exit.i ] %rem.i = srem i32 %data.0.lcssa.i, 1000213 %rem1.i = srem i32 %data.0.lcssa.i, 1000212 %add.i15 = add nsw i32 %rem1.i, 1 %idxprom17 = sext i32 %rem.i to i64 %arrayidx18 = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom17 %strcmpload19 = load i8, ptr %arrayidx18, align 1 %cmp20 = icmp eq i8 %strcmpload19, 0 br i1 %cmp20, label %cleanup, label %if.end while.cond: ; preds = %if.end %inc = add nuw nsw i32 %i.021, 1 %mul.i16 = mul nsw i32 %inc, %add.i15 %add2.i = add nsw i32 %mul.i16, %rem.i %rem3.i = srem i32 %add2.i, 1000213 %idxprom = sext i32 %rem3.i to i64 %arrayidx = getelementptr inbounds [1000213 x [13 x i8]], ptr @hash, i64 0, i64 %idxprom %strcmpload = load i8, ptr %arrayidx, align 1 %cmp = icmp eq i8 %strcmpload, 0 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %get_key.exit, %while.cond %arrayidx22 = phi ptr [ %arrayidx, %while.cond ], [ %arrayidx18, %get_key.exit ] %i.021 = phi i32 [ %inc, %while.cond ], [ 0, %get_key.exit ] %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx22, ptr noundef nonnull dereferenceable(1) %str) #11 %cmp7 = icmp eq i32 %call6, 0 br i1 %cmp7, label %cleanup, label %while.cond cleanup: ; preds = %while.cond, %if.end, %get_key.exit %retval.0 = phi i32 [ 0, %get_key.exit ], [ 1, %if.end ], [ 0, %while.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @get_key(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %0 = load i8, ptr %str, align 1, !tbaa !9 %cmp.not10 = icmp eq i8 %0, 0 br i1 %cmp.not10, label %while.end, label %while.body while.body: ; preds = %entry, %get_keycode.exit %indvars.iv = phi i64 [ %indvars.iv.next, %get_keycode.exit ], [ 0, %entry ] %1 = phi i8 [ %2, %get_keycode.exit ], [ %0, %entry ] %p.013 = phi i32 [ %mul4, %get_keycode.exit ], [ 1, %entry ] %data.011 = phi i32 [ %add, %get_keycode.exit ], [ 0, %entry ] %conv.i = sext i8 %1 to i32 switch i32 %conv.i, label %get_keycode.exit [ i32 84, label %sw.bb3.i i32 67, label %sw.bb1.i i32 71, label %sw.bb2.i ] sw.bb1.i: ; preds = %while.body br label %get_keycode.exit sw.bb2.i: ; preds = %while.body br label %get_keycode.exit sw.bb3.i: ; preds = %while.body br label %get_keycode.exit get_keycode.exit: ; preds = %while.body, %sw.bb1.i, %sw.bb2.i, %sw.bb3.i %retval.0.i = phi i32 [ 4, %sw.bb3.i ], [ 3, %sw.bb2.i ], [ 2, %sw.bb1.i ], [ 1, %while.body ] %mul = mul nsw i32 %retval.0.i, %p.013 %add = add nuw nsw i32 %mul, %data.011 %mul4 = mul nsw i32 %p.013, 5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %get_keycode.exit, %entry %data.0.lcssa = phi i32 [ 0, %entry ], [ %add, %get_keycode.exit ] ret i32 %data.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @get_hash_num(i32 noundef %data, i32 noundef %i) local_unnamed_addr #6 { entry: %rem = srem i32 %data, 1000213 %rem1 = srem i32 %data, 1000212 %add = add nsw i32 %rem1, 1 %mul = mul nsw i32 %add, %i %add2 = add nsw i32 %mul, %rem %rem3 = srem i32 %add2, 1000213 ret i32 %rem3 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; 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 #8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @get_keycode(i8 noundef signext %work) local_unnamed_addr #6 { entry: %conv = sext i8 %work to i32 switch i32 %conv, label %sw.epilog [ i32 84, label %sw.bb3 i32 67, label %sw.bb1 i32 71, label %sw.bb2 ] sw.bb1: ; preds = %entry br label %sw.epilog sw.bb2: ; preds = %entry br label %sw.epilog sw.bb3: ; preds = %entry br label %sw.epilog sw.epilog: ; preds = %sw.bb1, %sw.bb2, %sw.bb3, %entry %retval.0 = phi i32 [ 4, %sw.bb3 ], [ 3, %sw.bb2 ], [ 2, %sw.bb1 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #8 = { 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 #9 = { nofree nounwind } attributes #10 = { nounwind } attributes #11 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#define _CRT_SECURE_NO_WARNINGS #define MaxSize 16777215 #include <stdio.h> #include <stdlib.h> void insert(char *D, char s[]) { int i = -1; char c; int p = -1; while (c = s[++i]) { switch (c) { case 'A': p *= 4; p += 4; break; case 'C': p *= 4; p += 5; break; case 'G': p *= 4; p += 6; break; case 'T': p *= 4; p += 7; break; } } D[p] = 'Y'; } int find(char *D, char s[]) { int i = -1; char c; int p = -1; while (c = s[++i]) { switch (c) { case 'A': p *= 4; p += 4; break; case 'C': p *= 4; p += 5; break; case 'G': p *= 4; p += 6; break; case 'T': p *= 4; p += 7; break; } } return D[p] == 'Y'; } unsigned int conv(char s[]) { int i = -1; unsigned int a = 0u; while (s[++i]) { a *= 5u; if (s[i] == 'A') { a++; } else if (s[i] == 'C') { a += 2u; } else if (s[i] == 'G') { a += 3u; } else { a += 4u; } } return a; } int main() { char *D = (char *)malloc(sizeof(char) * MaxSize); int i; for (i = 0; i < MaxSize; ++i) { D[i] = 'N'; } char com[7]; char s[13]; int n; scanf("%d", &n); for (i = 0; i < n; ++i) { scanf("%s%s", com, s); if (com[0] == 'i') { insert(D, s); } else { if (find(D, s)) { printf("yes\n"); } else { printf("no\n"); } } } free(D); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246027/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 @switch.table.conv = private unnamed_addr constant [7 x i32] [i32 1, i32 4, i32 2, i32 4, i32 4, i32 4, i32 3], align 4 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @insert(ptr nocapture noundef writeonly %D, ptr nocapture noundef readonly %s) local_unnamed_addr #0 { entry: %0 = load i8, ptr %s, align 1, !tbaa !5 %tobool.not20 = icmp eq i8 %0, 0 br i1 %tobool.not20, label %while.end, label %while.body while.body: ; preds = %entry, %sw.epilog %indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ] %1 = phi i8 [ %2, %sw.epilog ], [ %0, %entry ] %p.021 = phi i32 [ %p.1, %sw.epilog ], [ -1, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.bb i32 67, label %sw.bb1 i32 71, label %sw.bb4 i32 84, label %sw.bb7 ] sw.bb: ; preds = %while.body %mul = shl nsw i32 %p.021, 2 %add = add nsw i32 %mul, 4 br label %sw.epilog sw.bb1: ; preds = %while.body %mul2 = shl nsw i32 %p.021, 2 %add3 = add nsw i32 %mul2, 5 br label %sw.epilog sw.bb4: ; preds = %while.body %mul5 = shl nsw i32 %p.021, 2 %add6 = add nsw i32 %mul5, 6 br label %sw.epilog sw.bb7: ; preds = %while.body %mul8 = shl nsw i32 %p.021, 2 %add9 = add nsw i32 %mul8, 7 br label %sw.epilog sw.epilog: ; preds = %while.body, %sw.bb7, %sw.bb4, %sw.bb1, %sw.bb %p.1 = phi i32 [ %p.021, %while.body ], [ %add9, %sw.bb7 ], [ %add6, %sw.bb4 ], [ %add3, %sw.bb1 ], [ %add, %sw.bb ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %2, 0 br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !8 while.end.loopexit: ; preds = %sw.epilog %3 = sext i32 %p.1 to i64 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %p.0.lcssa = phi i64 [ -1, %entry ], [ %3, %while.end.loopexit ] %arrayidx11 = getelementptr inbounds i8, ptr %D, i64 %p.0.lcssa store i8 89, ptr %arrayidx11, align 1, !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 norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %D, ptr nocapture noundef readonly %s) local_unnamed_addr #2 { entry: %0 = load i8, ptr %s, align 1, !tbaa !5 %tobool.not22 = icmp eq i8 %0, 0 br i1 %tobool.not22, label %while.end, label %while.body while.body: ; preds = %entry, %sw.epilog %indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ] %1 = phi i8 [ %2, %sw.epilog ], [ %0, %entry ] %p.023 = phi i32 [ %p.1, %sw.epilog ], [ -1, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.bb i32 67, label %sw.bb1 i32 71, label %sw.bb4 i32 84, label %sw.bb7 ] sw.bb: ; preds = %while.body %mul = shl nsw i32 %p.023, 2 %add = add nsw i32 %mul, 4 br label %sw.epilog sw.bb1: ; preds = %while.body %mul2 = shl nsw i32 %p.023, 2 %add3 = add nsw i32 %mul2, 5 br label %sw.epilog sw.bb4: ; preds = %while.body %mul5 = shl nsw i32 %p.023, 2 %add6 = add nsw i32 %mul5, 6 br label %sw.epilog sw.bb7: ; preds = %while.body %mul8 = shl nsw i32 %p.023, 2 %add9 = add nsw i32 %mul8, 7 br label %sw.epilog sw.epilog: ; preds = %while.body, %sw.bb7, %sw.bb4, %sw.bb1, %sw.bb %p.1 = phi i32 [ %p.023, %while.body ], [ %add9, %sw.bb7 ], [ %add6, %sw.bb4 ], [ %add3, %sw.bb1 ], [ %add, %sw.bb ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %2, 0 br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !10 while.end.loopexit: ; preds = %sw.epilog %3 = sext i32 %p.1 to i64 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %p.0.lcssa = phi i64 [ -1, %entry ], [ %3, %while.end.loopexit ] %arrayidx11 = getelementptr inbounds i8, ptr %D, i64 %p.0.lcssa %4 = load i8, ptr %arrayidx11, align 1, !tbaa !5 %cmp = icmp eq i8 %4, 89 %conv13 = zext i1 %cmp to i32 ret i32 %conv13 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @conv(ptr nocapture noundef readonly %s) local_unnamed_addr #2 { entry: %0 = load i8, ptr %s, align 1, !tbaa !5 %tobool.not34 = icmp eq i8 %0, 0 br i1 %tobool.not34, label %while.end, label %while.body while.body: ; preds = %entry, %if.end22 %indvars.iv = phi i64 [ %indvars.iv.next, %if.end22 ], [ 0, %entry ] %1 = phi i8 [ %4, %if.end22 ], [ %0, %entry ] %a.035 = phi i32 [ %add, %if.end22 ], [ 0, %entry ] %mul = mul i32 %a.035, 5 %switch.tableidx = add i8 %1, -65 %2 = icmp ult i8 %switch.tableidx, 7 br i1 %2, label %switch.lookup, label %if.end22 switch.lookup: ; preds = %while.body %3 = sext i8 %switch.tableidx to i64 %switch.gep = getelementptr inbounds [7 x i32], ptr @switch.table.conv, i64 0, i64 %3 %switch.load = load i32, ptr %switch.gep, align 4 br label %if.end22 if.end22: ; preds = %while.body, %switch.lookup %.sink = phi i32 [ %switch.load, %switch.lookup ], [ 4, %while.body ] %add = add i32 %mul, %.sink %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %4, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end22, %entry %a.0.lcssa = phi i32 [ 0, %entry ], [ %add, %if.end22 ] ret i32 %a.0.lcssa } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %com = alloca [7 x i8], align 1 %s = alloca [13 x i8], align 1 %n = alloca i32, align 4 %call = tail call noalias dereferenceable_or_null(16777215) ptr @malloc(i64 noundef 16777215) #9 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(16777215) %call, i8 78, i64 16777215, i1 false), !tbaa !5 call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %com) #10 call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %s) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !12 %cmp353 = icmp sgt i32 %0, 0 br i1 %cmp353, label %for.body4, label %for.end20 for.body4: ; preds = %entry, %for.inc18 %i.154 = phi i32 [ %inc19, %for.inc18 ], [ 0, %entry ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %s) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 %2 = load i8, ptr %s, align 1, !tbaa !5 %tobool.not20.i = icmp eq i8 %2, 0 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 br i1 %tobool.not20.i, label %insert.exit, label %while.body.i while.body.i: ; preds = %if.then, %sw.epilog.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %sw.epilog.i ], [ 0, %if.then ] %3 = phi i8 [ %4, %sw.epilog.i ], [ %2, %if.then ] %p.021.i = phi i32 [ %p.1.i, %sw.epilog.i ], [ -1, %if.then ] %conv.i = sext i8 %3 to i32 switch i32 %conv.i, label %sw.epilog.i [ i32 65, label %sw.bb.i i32 67, label %sw.bb1.i i32 71, label %sw.bb4.i i32 84, label %sw.bb7.i ] sw.bb.i: ; preds = %while.body.i %mul.i = shl nsw i32 %p.021.i, 2 %add.i = add nsw i32 %mul.i, 4 br label %sw.epilog.i sw.bb1.i: ; preds = %while.body.i %mul2.i = shl nsw i32 %p.021.i, 2 %add3.i = add nsw i32 %mul2.i, 5 br label %sw.epilog.i sw.bb4.i: ; preds = %while.body.i %mul5.i = shl nsw i32 %p.021.i, 2 %add6.i = add nsw i32 %mul5.i, 6 br label %sw.epilog.i sw.bb7.i: ; preds = %while.body.i %mul8.i = shl nsw i32 %p.021.i, 2 %add9.i = add nsw i32 %mul8.i, 7 br label %sw.epilog.i sw.epilog.i: ; preds = %sw.bb7.i, %sw.bb4.i, %sw.bb1.i, %sw.bb.i, %while.body.i %p.1.i = phi i32 [ %p.021.i, %while.body.i ], [ %add9.i, %sw.bb7.i ], [ %add6.i, %sw.bb4.i ], [ %add3.i, %sw.bb1.i ], [ %add.i, %sw.bb.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i %4 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %tobool.not.i = icmp eq i8 %4, 0 br i1 %tobool.not.i, label %while.end.loopexit.i, label %while.body.i, !llvm.loop !8 while.end.loopexit.i: ; preds = %sw.epilog.i %5 = sext i32 %p.1.i to i64 br label %insert.exit insert.exit: ; preds = %if.then, %while.end.loopexit.i %p.0.lcssa.i = phi i64 [ -1, %if.then ], [ %5, %while.end.loopexit.i ] %arrayidx11.i = getelementptr inbounds i8, ptr %call, i64 %p.0.lcssa.i store i8 89, ptr %arrayidx11.i, align 1, !tbaa !5 br label %for.inc18 if.else: ; preds = %for.body4 br i1 %tobool.not20.i, label %find.exit, label %while.body.i29 while.body.i29: ; preds = %if.else, %sw.epilog.i35 %indvars.iv.i30 = phi i64 [ %indvars.iv.next.i37, %sw.epilog.i35 ], [ 0, %if.else ] %6 = phi i8 [ %7, %sw.epilog.i35 ], [ %2, %if.else ] %p.023.i = phi i32 [ %p.1.i36, %sw.epilog.i35 ], [ -1, %if.else ] %conv.i31 = sext i8 %6 to i32 switch i32 %conv.i31, label %sw.epilog.i35 [ i32 65, label %sw.bb.i49 i32 67, label %sw.bb1.i46 i32 71, label %sw.bb4.i43 i32 84, label %sw.bb7.i32 ] sw.bb.i49: ; preds = %while.body.i29 %mul.i50 = shl nsw i32 %p.023.i, 2 %add.i51 = add nsw i32 %mul.i50, 4 br label %sw.epilog.i35 sw.bb1.i46: ; preds = %while.body.i29 %mul2.i47 = shl nsw i32 %p.023.i, 2 %add3.i48 = add nsw i32 %mul2.i47, 5 br label %sw.epilog.i35 sw.bb4.i43: ; preds = %while.body.i29 %mul5.i44 = shl nsw i32 %p.023.i, 2 %add6.i45 = add nsw i32 %mul5.i44, 6 br label %sw.epilog.i35 sw.bb7.i32: ; preds = %while.body.i29 %mul8.i33 = shl nsw i32 %p.023.i, 2 %add9.i34 = add nsw i32 %mul8.i33, 7 br label %sw.epilog.i35 sw.epilog.i35: ; preds = %sw.bb7.i32, %sw.bb4.i43, %sw.bb1.i46, %sw.bb.i49, %while.body.i29 %p.1.i36 = phi i32 [ %p.023.i, %while.body.i29 ], [ %add9.i34, %sw.bb7.i32 ], [ %add6.i45, %sw.bb4.i43 ], [ %add3.i48, %sw.bb1.i46 ], [ %add.i51, %sw.bb.i49 ] %indvars.iv.next.i37 = add nuw nsw i64 %indvars.iv.i30, 1 %arrayidx.i38 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i37 %7 = load i8, ptr %arrayidx.i38, align 1, !tbaa !5 %tobool.not.i39 = icmp eq i8 %7, 0 br i1 %tobool.not.i39, label %while.end.loopexit.i40, label %while.body.i29, !llvm.loop !10 while.end.loopexit.i40: ; preds = %sw.epilog.i35 %8 = sext i32 %p.1.i36 to i64 br label %find.exit find.exit: ; preds = %if.else, %while.end.loopexit.i40 %p.0.lcssa.i41 = phi i64 [ -1, %if.else ], [ %8, %while.end.loopexit.i40 ] %arrayidx11.i42 = getelementptr inbounds i8, ptr %call, i64 %p.0.lcssa.i41 %9 = load i8, ptr %arrayidx11.i42, align 1, !tbaa !5 %cmp.i.not = icmp eq i8 %9, 89 br i1 %cmp.i.not, label %if.then13, label %if.else15 if.then13: ; preds = %find.exit %puts28 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc18 if.else15: ; preds = %find.exit %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc18 for.inc18: ; preds = %insert.exit, %if.else15, %if.then13 %inc19 = add nuw nsw i32 %i.154, 1 %10 = load i32, ptr %n, align 4, !tbaa !12 %cmp3 = icmp slt i32 %inc19, %10 br i1 %cmp3, label %for.body4, label %for.end20, !llvm.loop !14 for.end20: ; preds = %for.inc18, %entry call void @free(ptr noundef nonnull %call) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %s) #10 call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %com) #10 ret i32 0 } ; 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree 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 #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = { nofree nounwind } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind allocsize(0) } 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0} !14 = distinct !{!14, !9}
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct dictionary { char str[12]; struct dictionary *p_left; struct dictionary *p_right; }STR; STR *p_root = NULL; void insert(char value[]); char *find(char value[]); STR *makeNewnode(char value[]); int main(void) { int n; int i = 0; char value[12]; char command[10]; STR *p_root = NULL; scanf("%d", &n); while (scanf("%s", &value) != EOF) { i++; if (value[0] == 'i' || value[0] == 'f') { strcpy(command, value); } else { if (strcmp(command, "insert") == 0) { insert(value); } else { printf("%s\n", find(value)); } } if (i >= 2 * n) { break; } } return 0; } void insert(char value[]) { STR *p_newlist = NULL; STR *p_list; p_newlist = makeNewnode(value); if (p_root == NULL) { p_root = p_newlist; return; } p_list = p_root; while (1) { if (strcmp(p_list->str, value) > 0) { if (p_list->p_left == NULL) { p_list->p_left = p_newlist; break; } else { p_list = p_list->p_left; } } else { if (p_list->p_right == NULL) { p_list->p_right = p_newlist; break; } else { p_list = p_list->p_right; } } } } char *find(char value[]) { STR *p_list; char *ans = NULL; p_list = p_root; if (p_list == NULL) { ans = "no"; return ans; } while (1) { if (strcmp(p_list->str, value) > 0) { if (p_list->p_left == NULL) { ans = "no"; return ans; } else { p_list = p_list->p_left; } } else if(strcmp(p_list->str, value) < 0){ if (p_list->p_right == NULL) { ans = "no"; return ans; } else { p_list = p_list->p_right; } } else { ans = "yes"; return ans; } } } STR *makeNewnode(char value[]) { STR *p_newlist; p_newlist = (STR*)malloc(sizeof(STR)); strcpy(p_newlist->str, value); p_newlist->p_left = NULL; p_newlist->p_right = NULL; return p_newlist; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246070/source.c" target datalayout = "e-m:e-p270: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.dictionary = type { [12 x i8], ptr, ptr } @p_root = dso_local local_unnamed_addr global ptr null, align 8 @.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 [7 x i8] c"insert\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"no\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %value = alloca [12 x i8], align 1 %command = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %value) #11 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %command) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) br label %while.cond while.cond: ; preds = %if.end20, %entry %i.0 = phi i32 [ 0, %entry ], [ %inc, %if.end20 ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %value) %cmp.not = icmp eq i32 %call1, -1 br i1 %cmp.not, label %while.end, label %while.body while.body: ; preds = %while.cond %inc = add nuw nsw i32 %i.0, 1 %0 = load i8, ptr %value, align 1 switch i8 %0, label %if.else [ i8 105, label %if.then i8 102, label %if.then ] if.then: ; preds = %while.body, %while.body %call9 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %command, ptr noundef nonnull dereferenceable(1) %value) #11 br label %if.end20 if.else: ; preds = %while.body %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %command, ptr noundef nonnull dereferenceable(7) @.str.2, i64 7) %cmp12 = icmp eq i32 %bcmp, 0 br i1 %cmp12, label %if.then14, label %if.else16 if.then14: ; preds = %if.else %call.i.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #12 %call1.i.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call.i.i, ptr noundef nonnull dereferenceable(1) %value) #11 %p_left.i.i = getelementptr inbounds %struct.dictionary, ptr %call.i.i, i64 0, i32 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %p_left.i.i, i8 0, i64 16, i1 false) %1 = load ptr, ptr @p_root, align 8, !tbaa !5 %cmp.i = icmp eq ptr %1, null br i1 %cmp.i, label %insert.exit, label %while.cond.i while.cond.i: ; preds = %if.then14, %while.cond.i.backedge %p_list.0.i = phi ptr [ %p_list.0.i.be, %while.cond.i.backedge ], [ %1, %if.then14 ] %call1.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p_list.0.i, ptr noundef nonnull dereferenceable(1) %value) #13 %cmp2.i = icmp sgt i32 %call1.i, 0 br i1 %cmp2.i, label %if.then3.i, label %if.else9.i if.then3.i: ; preds = %while.cond.i %p_left.i = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i, i64 0, i32 1 %2 = load ptr, ptr %p_left.i, align 8, !tbaa !9 %cmp4.i = icmp eq ptr %2, null br i1 %cmp4.i, label %insert.exit.loopexit.split.loop.exit, label %while.cond.i.backedge if.else9.i: ; preds = %while.cond.i %p_right.i = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i, i64 0, i32 2 %3 = load ptr, ptr %p_right.i, align 8, !tbaa !11 %cmp10.i = icmp eq ptr %3, null br i1 %cmp10.i, label %insert.exit.loopexit.split.loop.exit36, label %while.cond.i.backedge while.cond.i.backedge: ; preds = %if.else9.i, %if.then3.i %p_list.0.i.be = phi ptr [ %2, %if.then3.i ], [ %3, %if.else9.i ] br label %while.cond.i insert.exit.loopexit.split.loop.exit: ; preds = %if.then3.i %p_left.i.le = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i, i64 0, i32 1 br label %insert.exit insert.exit.loopexit.split.loop.exit36: ; preds = %if.else9.i %p_right.i.le = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i, i64 0, i32 2 br label %insert.exit insert.exit: ; preds = %insert.exit.loopexit.split.loop.exit, %insert.exit.loopexit.split.loop.exit36, %if.then14 %p_left.le.sink.i = phi ptr [ @p_root, %if.then14 ], [ %p_left.i.le, %insert.exit.loopexit.split.loop.exit ], [ %p_right.i.le, %insert.exit.loopexit.split.loop.exit36 ] store ptr %call.i.i, ptr %p_left.le.sink.i, align 8, !tbaa !5 br label %if.end20 if.else16: ; preds = %if.else %4 = load ptr, ptr @p_root, align 8, !tbaa !5 %cmp.i26 = icmp eq ptr %4, null br i1 %cmp.i26, label %find.exit, label %while.cond.i27 while.cond.i27: ; preds = %if.else16, %while.cond.i27.backedge %p_list.0.i28 = phi ptr [ %p_list.0.i28.be, %while.cond.i27.backedge ], [ %4, %if.else16 ] %call.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p_list.0.i28, ptr noundef nonnull dereferenceable(1) %value) #13 %cmp1.i = icmp sgt i32 %call.i, 0 br i1 %cmp1.i, label %if.then2.i, label %if.else7.i if.then2.i: ; preds = %while.cond.i27 %p_left.i31 = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i28, i64 0, i32 1 %5 = load ptr, ptr %p_left.i31, align 8, !tbaa !9 %cmp3.i = icmp eq ptr %5, null br i1 %cmp3.i, label %find.exit, label %while.cond.i27.backedge if.else7.i: ; preds = %while.cond.i27 %cmp11.i = icmp slt i32 %call.i, 0 br i1 %cmp11.i, label %if.then12.i, label %find.exit if.then12.i: ; preds = %if.else7.i %p_right.i29 = getelementptr inbounds %struct.dictionary, ptr %p_list.0.i28, i64 0, i32 2 %6 = load ptr, ptr %p_right.i29, align 8, !tbaa !11 %cmp13.i = icmp eq ptr %6, null br i1 %cmp13.i, label %find.exit, label %while.cond.i27.backedge while.cond.i27.backedge: ; preds = %if.then12.i, %if.then2.i %p_list.0.i28.be = phi ptr [ %5, %if.then2.i ], [ %6, %if.then12.i ] br label %while.cond.i27 find.exit: ; preds = %if.then2.i, %if.else7.i, %if.then12.i, %if.else16 %retval.0.i = phi ptr [ @.str.4, %if.else16 ], [ @.str.4, %if.then2.i ], [ @.str.4, %if.then12.i ], [ @.str.5, %if.else7.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %retval.0.i) br label %if.end20 if.end20: ; preds = %insert.exit, %find.exit, %if.then %7 = load i32, ptr %n, align 4, !tbaa !12 %mul = shl nsw i32 %7, 1 %cmp21.not = icmp slt i32 %inc, %mul br i1 %cmp21.not, label %while.cond, label %while.end, !llvm.loop !14 while.end: ; preds = %if.end20, %while.cond call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %command) #11 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %value) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local void @insert(ptr nocapture noundef readonly %value) local_unnamed_addr #0 { entry: %call.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #12 %call1.i = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call.i, ptr noundef nonnull dereferenceable(1) %value) #11 %p_left.i = getelementptr inbounds %struct.dictionary, ptr %call.i, i64 0, i32 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %p_left.i, i8 0, i64 16, i1 false) %0 = load ptr, ptr @p_root, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null br i1 %cmp, label %cleanup, label %while.cond while.cond: ; preds = %entry, %while.cond.backedge %p_list.0 = phi ptr [ %p_list.0.be, %while.cond.backedge ], [ %0, %entry ] %call1 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p_list.0, ptr noundef nonnull dereferenceable(1) %value) #13 %cmp2 = icmp sgt i32 %call1, 0 br i1 %cmp2, label %if.then3, label %if.else9 if.then3: ; preds = %while.cond %p_left = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 1 %1 = load ptr, ptr %p_left, align 8, !tbaa !9 %cmp4 = icmp eq ptr %1, null br i1 %cmp4, label %if.then5, label %while.cond.backedge if.then5: ; preds = %if.then3 %p_left.le = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 1 br label %cleanup if.else9: ; preds = %while.cond %p_right = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 2 %2 = load ptr, ptr %p_right, align 8, !tbaa !11 %cmp10 = icmp eq ptr %2, null br i1 %cmp10, label %if.then11, label %while.cond.backedge while.cond.backedge: ; preds = %if.else9, %if.then3 %p_list.0.be = phi ptr [ %1, %if.then3 ], [ %2, %if.else9 ] br label %while.cond if.then11: ; preds = %if.else9 %p_right.le = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 2 br label %cleanup cleanup: ; preds = %entry, %if.then5, %if.then11 %p_left.le.sink = phi ptr [ %p_left.le, %if.then5 ], [ %p_right.le, %if.then11 ], [ @p_root, %entry ] store ptr %call.i, ptr %p_left.le.sink, align 8, !tbaa !5 ret void } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local nonnull ptr @find(ptr nocapture noundef readonly %value) local_unnamed_addr #5 { entry: %0 = load ptr, ptr @p_root, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null br i1 %cmp, label %cleanup, label %while.cond while.cond: ; preds = %entry, %while.cond.backedge %p_list.0 = phi ptr [ %p_list.0.be, %while.cond.backedge ], [ %0, %entry ] %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %p_list.0, ptr noundef nonnull dereferenceable(1) %value) #13 %cmp1 = icmp sgt i32 %call, 0 br i1 %cmp1, label %if.then2, label %if.else7 if.then2: ; preds = %while.cond %p_left = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 1 %1 = load ptr, ptr %p_left, align 8, !tbaa !9 %cmp3 = icmp eq ptr %1, null br i1 %cmp3, label %cleanup, label %while.cond.backedge if.else7: ; preds = %while.cond %cmp11 = icmp slt i32 %call, 0 br i1 %cmp11, label %if.then12, label %cleanup if.then12: ; preds = %if.else7 %p_right = getelementptr inbounds %struct.dictionary, ptr %p_list.0, i64 0, i32 2 %2 = load ptr, ptr %p_right, align 8, !tbaa !11 %cmp13 = icmp eq ptr %2, null br i1 %cmp13, label %cleanup, label %while.cond.backedge while.cond.backedge: ; preds = %if.then12, %if.then2 %p_list.0.be = phi ptr [ %1, %if.then2 ], [ %2, %if.then12 ] br label %while.cond cleanup: ; preds = %if.else7, %if.then12, %if.then2, %entry %retval.0 = phi ptr [ @.str.4, %entry ], [ @.str.5, %if.else7 ], [ @.str.4, %if.then12 ], [ @.str.4, %if.then2 ] ret ptr %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn uwtable define dso_local ptr @makeNewnode(ptr nocapture noundef readonly %value) local_unnamed_addr #6 { entry: %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #12 %call1 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call, ptr noundef nonnull dereferenceable(1) %value) #11 %p_left = getelementptr inbounds %struct.dictionary, ptr %call, i64 0, i32 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %p_left, i8 0, i64 16, i1 false) ret ptr %call } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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: 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 #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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #8 = { nofree nounwind willreturn memory(argmem: read) } attributes #9 = { nofree nounwind } attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #11 = { nounwind } attributes #12 = { nounwind allocsize(0) } attributes #13 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 16} !10 = !{!"dictionary", !7, i64 0, !6, i64 16, !6, i64 24} !11 = !{!10, !6, i64 24} !12 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #define M 1046527 #define L 14 char H[M][L]; int char2int(char c) { switch (c) { case 'A': return 1; case 'C': return 2; case 'G': return 3; case 'T': return 4; default: return 0; } } long long getKey(char str[]) { long long ret = 0, p = 1; int i; for(i = 0; str[i] != '\0'; i++) { ret += p * char2int(str[i]); p *= 5; } return ret; } int h1(int key) { return key % M; } int h2(int key) { return 1 + (key % (M - 1)); } int find(char str[]) { long long key, h, i; key = getKey(str); for(i = 0; ; i++) { h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) { return 1; } else if(strlen(H[h]) == 0) { return 0; } } return 0; } int insert(char str[]) { long long key, h, i; key = getKey(str); for(i = 0; ; i++) { h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) { return 1; } else if(strlen(H[h]) == 0) { strcpy(H[h], str); return 0; } } return 0; } int main(void) { int i, n; char str[L], cmd[9]; for(i = 0; i < M; i++) { /* initialize hash */ H[i][0] = '\0'; } scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%s %s", cmd, str); if(cmd[0] == 'i') { insert(str); } else { if(find(str)) { printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @char2int(i8 noundef signext %c) local_unnamed_addr #0 { entry: %conv = sext i8 %c to i32 switch i32 %conv, label %sw.default [ i32 65, label %return i32 67, label %sw.bb1 i32 71, label %sw.bb2 i32 84, label %sw.bb3 ] sw.bb1: ; preds = %entry br label %return sw.bb2: ; preds = %entry br label %return sw.bb3: ; preds = %entry br label %return sw.default: ; preds = %entry br label %return return: ; preds = %entry, %sw.default, %sw.bb3, %sw.bb2, %sw.bb1 %retval.0 = phi i32 [ 0, %sw.default ], [ 4, %sw.bb3 ], [ 3, %sw.bb2 ], [ 2, %sw.bb1 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %0 = load i8, ptr %str, align 1, !tbaa !5 %cmp.not11 = icmp eq i8 %0, 0 br i1 %cmp.not11, label %for.end, label %for.body for.body: ; preds = %entry, %char2int.exit %indvars.iv = phi i64 [ %indvars.iv.next, %char2int.exit ], [ 0, %entry ] %1 = phi i8 [ %2, %char2int.exit ], [ %0, %entry ] %p.013 = phi i64 [ %mul5, %char2int.exit ], [ 1, %entry ] %ret.012 = phi i64 [ %add, %char2int.exit ], [ 0, %entry ] %conv.i = sext i8 %1 to i32 switch i32 %conv.i, label %sw.default.i [ i32 65, label %char2int.exit i32 67, label %sw.bb1.i i32 71, label %sw.bb2.i i32 84, label %sw.bb3.i ] sw.bb1.i: ; preds = %for.body br label %char2int.exit sw.bb2.i: ; preds = %for.body br label %char2int.exit sw.bb3.i: ; preds = %for.body br label %char2int.exit sw.default.i: ; preds = %for.body br label %char2int.exit char2int.exit: ; preds = %for.body, %sw.bb1.i, %sw.bb2.i, %sw.bb3.i, %sw.default.i %retval.0.i = phi i64 [ 0, %sw.default.i ], [ 4, %sw.bb3.i ], [ 3, %sw.bb2.i ], [ 2, %sw.bb1.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.013 %add = add nuw nsw i64 %mul, %ret.012 %mul5 = mul nsw i64 %p.013, 5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %char2int.exit, %entry %ret.0.lcssa = phi i64 [ 0, %entry ], [ %add, %char2int.exit ] ret i64 %ret.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #3 { entry: %0 = load i8, ptr %str, align 1, !tbaa !5 %cmp.not11.i = icmp eq i8 %0, 0 br i1 %cmp.not11.i, label %getKey.exit, label %for.body.i for.body.i: ; preds = %entry, %char2int.exit.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %char2int.exit.i ], [ 0, %entry ] %1 = phi i8 [ %2, %char2int.exit.i ], [ %0, %entry ] %p.013.i = phi i32 [ %mul5.i, %char2int.exit.i ], [ 1, %entry ] %ret.012.i = phi i32 [ %add.i, %char2int.exit.i ], [ 0, %entry ] %conv.i.i = sext i8 %1 to i32 switch i32 %conv.i.i, label %sw.default.i.i [ i32 65, label %char2int.exit.i i32 67, label %sw.bb1.i.i i32 71, label %sw.bb2.i.i i32 84, label %sw.bb3.i.i ] sw.bb1.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.bb2.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.bb3.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.default.i.i: ; preds = %for.body.i br label %char2int.exit.i char2int.exit.i: ; preds = %sw.default.i.i, %sw.bb3.i.i, %sw.bb2.i.i, %sw.bb1.i.i, %for.body.i %retval.0.i.i = phi i32 [ 0, %sw.default.i.i ], [ 4, %sw.bb3.i.i ], [ 3, %sw.bb2.i.i ], [ 2, %sw.bb1.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.013.i %add.i = add i32 %mul.i, %ret.012.i %mul5.i = mul i32 %p.013.i, 5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %cmp.not.i = icmp eq i8 %2, 0 br i1 %cmp.not.i, label %getKey.exit, label %for.body.i, !llvm.loop !8 getKey.exit: ; preds = %char2int.exit.i, %entry %ret.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %char2int.exit.i ] %rem.i = srem i32 %ret.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %ret.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %0 = load i8, ptr %str, align 1, !tbaa !5 %cmp.not11.i = icmp eq i8 %0, 0 br i1 %cmp.not11.i, label %getKey.exit, label %for.body.i for.body.i: ; preds = %entry, %char2int.exit.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %char2int.exit.i ], [ 0, %entry ] %1 = phi i8 [ %2, %char2int.exit.i ], [ %0, %entry ] %p.013.i = phi i32 [ %mul5.i, %char2int.exit.i ], [ 1, %entry ] %ret.012.i = phi i32 [ %add.i, %char2int.exit.i ], [ 0, %entry ] %conv.i.i = sext i8 %1 to i32 switch i32 %conv.i.i, label %sw.default.i.i [ i32 65, label %char2int.exit.i i32 67, label %sw.bb1.i.i i32 71, label %sw.bb2.i.i i32 84, label %sw.bb3.i.i ] sw.bb1.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.bb2.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.bb3.i.i: ; preds = %for.body.i br label %char2int.exit.i sw.default.i.i: ; preds = %for.body.i br label %char2int.exit.i char2int.exit.i: ; preds = %sw.default.i.i, %sw.bb3.i.i, %sw.bb2.i.i, %sw.bb1.i.i, %for.body.i %retval.0.i.i = phi i32 [ 0, %sw.default.i.i ], [ 4, %sw.bb3.i.i ], [ 3, %sw.bb2.i.i ], [ 2, %sw.bb1.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.013.i %add.i = add i32 %mul.i, %ret.012.i %mul5.i = mul i32 %p.013.i, 5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %cmp.not.i = icmp eq i8 %2, 0 br i1 %cmp.not.i, label %getKey.exit, label %for.body.i, !llvm.loop !8 getKey.exit: ; preds = %char2int.exit.i, %entry %ret.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %char2int.exit.i ] %rem.i = srem i32 %ret.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %ret.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %cmd = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %cmd) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cmd, ptr noundef nonnull %str) %1 = load i8, ptr %cmd, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %cmd) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include <stdio.h> #include <string.h> #define M 1000000 #define L 14 char H[M][L]; int getChar(char ch){ if(ch=='A') return 1; else if(ch=='C') return 2; else if(ch=='G') return 3; else if(ch=='T') return 4; return 0; } long long getKey(char s[]){ long long i,sum=0,p=1; for(i=0;i<strlen(s);i++){ sum+=p*(getChar(s[i])); p*=5; } return sum; } int h1(int key){ return key % M; } int h2(int key){ return 1 + (key%(M-1)); } int find(char s[]){ long long key, i,h; key = getKey(s); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],s)==0)return 1; else if (strlen(H[h])==0)return 0; } return 0; } int insert(char s[]){ long long key,i,h; key=getKey(s); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],s)==0)return 1; else if(strlen(H[h])==0){ strcpy(H[h],s); return 0; } } return 0; } int main(){ int i,n,h; char s[L],com[10]; for(i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %s",com,s); if(com[0]=='i'){ insert(s); } else { if (find(s)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1000000 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.end18: ; preds = %entry br label %return return: ; preds = %entry, %if.end18, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 0, %if.end18 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %s) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %p.011 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.010 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %i.09 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %s, i64 %i.09 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %if.end18.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.end18.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.end18.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 0, %if.end18.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.011 %add = add nuw nsw i64 %mul, %sum.010 %mul2 = mul nsw i64 %p.011, 5 %inc = or i64 %i.09, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %s, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.end18.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.end18.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 0, %if.end18.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.011, 25 %inc.1 = add nuw nsw i64 %i.09, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %p.011.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.010.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.09.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %s, i64 %i.09.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.end18.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.end18.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 0, %if.end18.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.011.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.010.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1000000 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 999999 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %s) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %p.011.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.010.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %i.09.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %i.09.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.end18.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.end18.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.end18.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.end18.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.011.i %add.i = add i32 %mul.i, %sum.010.i %mul2.i = mul i32 %p.011.i, 5 %inc.i = or i64 %i.09.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %s, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.end18.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.end18.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.end18.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.011.i, 25 %inc.i.1 = add nuw nsw i64 %i.09.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %p.011.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.010.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.09.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %s, i64 %i.09.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.end18.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.end18.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.end18.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.011.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.010.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1000000 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 999999 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %s) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1000000 %arrayidx = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %s) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %s) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %p.011.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.010.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %i.09.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %i.09.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.end18.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.end18.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.end18.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.end18.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.011.i %add.i = add i32 %mul.i, %sum.010.i %mul2.i = mul i32 %p.011.i, 5 %inc.i = or i64 %i.09.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %s, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.end18.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.end18.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.end18.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.011.i, 25 %inc.i.1 = add nuw nsw i64 %i.09.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %p.011.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.010.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.09.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %s, i64 %i.09.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.end18.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.end18.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.end18.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.011.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.010.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1000000 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 999999 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %s) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1000000 %arrayidx = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %s) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %s) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %s = alloca [14 x i8], align 1 %com = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %s) #11 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.4, %for.body ] %arrayidx = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 2, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 2, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %arrayidx.4 = getelementptr inbounds [1000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.3 store i8 0, ptr %arrayidx.4, align 2, !tbaa !5 %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5 %exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 1000000 br i1 %exitcond.not.4, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %s) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %s), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %s), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %s) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include<math.h> int main() { int t,x,y,a,b; scanf("%d", &t); for (int i = 0; i < t; i++) { scanf("%d%d%d%d", &x, &y, &a, &b); if ((y - x) % (a + b) == 0) { printf("%d\n", (y - x) / (a + b)); } else printf("-1\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24620/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24620/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 for.body: ; preds = %entry, %for.inc %i.09 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %y, align 4, !tbaa !5 %2 = load i32, ptr %x, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %4, %3 %rem = srem i32 %sub, %add %div = sdiv i32 %sub, %add %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div) br label %for.inc if.else: ; preds = %for.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc for.inc: ; preds = %if.then, %if.else %inc = add nuw nsw i32 %i.09, 1 %5 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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 <string.h> #define HASHTABLEMAX 16777216 unsigned short hashTable[HASHTABLEMAX]; void init(void){ unsigned int i; for( i=0; i<HASHTABLEMAX; i++){ hashTable[i] = 0; } } unsigned int makehash(char *str,unsigned int length){ unsigned int i; unsigned int hash; unsigned int code; hash = 0; code = 0; for( i=0; i<length; i++){ switch(str[i]){ case 'A': code = 0b00; break; case 'C': code = 0b01; break; case 'G': code = 0b10; break; case 'T': code = 0b11; break; default: break; } hash <<= 2; hash += code; } return hash; } void find(unsigned int hash,unsigned int length){ unsigned short lengthBit; lengthBit = 1 << (length - 1); if(hashTable[hash] & lengthBit){ printf("yes\n"); }else{ printf("no\n"); } } void insert(unsigned int hash,unsigned int length){ unsigned short lengthBit; lengthBit = 1 << (length - 1); hashTable[hash] = hashTable[hash] | lengthBit; } int main(void){ unsigned int i; unsigned int n; unsigned int hash; unsigned int length; char command[7]; char str[13]; init(); scanf("%d",&n); for( i=0; i<n; i++){ scanf("%s",command); scanf("%s",str); length = strlen(str); hash = makehash(str,length); if(strcmp(command,"find") == 0){ find(hash,length); }else if(strcmp(command,"insert") == 0){ insert(hash,length); }else{ ; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246243/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246243/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @hashTable = dso_local local_unnamed_addr global [16777216 x i16] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"find\00", align 1 @.str.5 = private unnamed_addr constant [7 x i8] c"insert\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @init() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(33554432) @hashTable, i8 0, i64 33554432, i1 false), !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @makehash(ptr nocapture noundef readonly %str, i32 noundef %length) local_unnamed_addr #2 { entry: %cmp8.not = icmp eq i32 %length, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %length to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %length, 1 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 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %sw.epilog.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %sw.epilog.1 ] %code.011 = phi i32 [ 0, %for.body.preheader.new ], [ %code.1.1, %sw.epilog.1 ] %hash.010 = phi i32 [ 0, %for.body.preheader.new ], [ %add.1, %sw.epilog.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %sw.epilog.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.bb i32 67, label %sw.bb1 i32 71, label %sw.bb2 i32 84, label %sw.bb3 ] sw.bb: ; preds = %for.body br label %sw.epilog sw.bb1: ; preds = %for.body br label %sw.epilog sw.bb2: ; preds = %for.body br label %sw.epilog sw.bb3: ; preds = %for.body br label %sw.epilog sw.epilog: ; preds = %for.body, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb %code.1 = phi i32 [ %code.011, %for.body ], [ 3, %sw.bb3 ], [ 2, %sw.bb2 ], [ 1, %sw.bb1 ], [ 0, %sw.bb ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %conv.1 = sext i8 %2 to i32 switch i32 %conv.1, label %sw.epilog.1 [ i32 65, label %sw.bb.1 i32 67, label %sw.bb1.1 i32 71, label %sw.bb2.1 i32 84, label %sw.bb3.1 ] sw.bb3.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.bb2.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.bb1.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.bb.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.epilog.1: ; preds = %sw.bb.1, %sw.bb1.1, %sw.bb2.1, %sw.bb3.1, %sw.epilog %code.1.1 = phi i32 [ %code.1, %sw.epilog ], [ 3, %sw.bb3.1 ], [ 2, %sw.bb2.1 ], [ 1, %sw.bb1.1 ], [ 0, %sw.bb.1 ] %3 = shl i32 %hash.010, 4 %4 = shl i32 %code.1, 2 %shl.1 = add i32 %3, %4 %add.1 = add nuw i32 %code.1.1, %shl.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.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !10 for.end.loopexit.unr-lcssa.loopexit: ; preds = %sw.epilog.1 %5 = shl i32 %add.1, 2 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %add.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add.1, %for.end.loopexit.unr-lcssa.loopexit ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ] %code.011.unr = phi i32 [ 0, %for.body.preheader ], [ %code.1.1, %for.end.loopexit.unr-lcssa.loopexit ] %hash.010.unr = phi i32 [ 0, %for.body.preheader ], [ %5, %for.end.loopexit.unr-lcssa.loopexit ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.unr %6 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %conv.epil = sext i8 %6 to i32 switch i32 %conv.epil, label %sw.epilog.epil [ i32 65, label %sw.bb.epil i32 67, label %sw.bb1.epil i32 71, label %sw.bb2.epil i32 84, label %sw.bb3.epil ] sw.bb3.epil: ; preds = %for.body.epil br label %sw.epilog.epil sw.bb2.epil: ; preds = %for.body.epil br label %sw.epilog.epil sw.bb1.epil: ; preds = %for.body.epil br label %sw.epilog.epil sw.bb.epil: ; preds = %for.body.epil br label %sw.epilog.epil sw.epilog.epil: ; preds = %sw.bb.epil, %sw.bb1.epil, %sw.bb2.epil, %sw.bb3.epil, %for.body.epil %code.1.epil = phi i32 [ %code.011.unr, %for.body.epil ], [ 3, %sw.bb3.epil ], [ 2, %sw.bb2.epil ], [ 1, %sw.bb1.epil ], [ 0, %sw.bb.epil ] %add.epil = add nuw i32 %code.1.epil, %hash.010.unr br label %for.end for.end: ; preds = %sw.epilog.epil, %for.end.loopexit.unr-lcssa, %entry %hash.0.lcssa = phi i32 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %sw.epilog.epil ] ret i32 %hash.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @find(i32 noundef %hash, i32 noundef %length) local_unnamed_addr #3 { entry: %sub = add i32 %length, -1 %shl = shl nuw i32 1, %sub %idxprom = zext i32 %hash to i64 %arrayidx = getelementptr inbounds [16777216 x i16], ptr @hashTable, i64 0, i64 %idxprom %0 = load i16, ptr %arrayidx, align 2, !tbaa !5 %conv1 = zext i16 %0 to i32 %and = and i32 %shl, %conv1 %tobool.not = icmp eq i32 %and, 0 %str.str.6 = select i1 %tobool.not, ptr @str, ptr @str.6 %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.str.6) ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @insert(i32 noundef %hash, i32 noundef %length) local_unnamed_addr #4 { entry: %sub = add i32 %length, -1 %shl = shl nuw i32 1, %sub %idxprom = zext i32 %hash to i64 %arrayidx = getelementptr inbounds [16777216 x i16], ptr @hashTable, i64 0, i64 %idxprom %0 = load i16, ptr %arrayidx, align 2, !tbaa !5 %1 = trunc i32 %shl to i16 %conv3 = or i16 %0, %1 store i16 %conv3, ptr %arrayidx, align 2, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %command = alloca [7 x i8], align 1 %str = alloca [13 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %command) #10 call void @llvm.lifetime.start.p0(i64 13, ptr nonnull %str) #10 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(33554432) @hashTable, i8 0, i64 33554432, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !12 %cmp30.not = icmp eq i32 %0, 0 br i1 %cmp30.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %i.031 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %command) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %str) %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11 %conv = trunc i64 %call5 to i32 %cmp8.not.i = icmp eq i32 %conv, 0 br i1 %cmp8.not.i, label %makehash.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body %wide.trip.count.i = and i64 %call5, 4294967295 %xtraiter = and i64 %call5, 1 %1 = icmp eq i64 %wide.trip.count.i, 1 br i1 %1, label %makehash.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = sub nsw i64 %wide.trip.count.i, %xtraiter br label %for.body.i for.body.i: ; preds = %sw.epilog.i.1, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %sw.epilog.i.1 ] %code.011.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %code.1.i.1, %sw.epilog.i.1 ] %hash.010.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %add.i.1, %sw.epilog.i.1 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %sw.epilog.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %2 = load i8, ptr %arrayidx.i, align 1, !tbaa !9 %conv.i = sext i8 %2 to i32 switch i32 %conv.i, label %sw.epilog.i [ i32 65, label %sw.bb.i i32 67, label %sw.bb1.i i32 71, label %sw.bb2.i i32 84, label %sw.bb3.i ] sw.bb.i: ; preds = %for.body.i br label %sw.epilog.i sw.bb1.i: ; preds = %for.body.i br label %sw.epilog.i sw.bb2.i: ; preds = %for.body.i br label %sw.epilog.i sw.bb3.i: ; preds = %for.body.i br label %sw.epilog.i sw.epilog.i: ; preds = %sw.bb3.i, %sw.bb2.i, %sw.bb1.i, %sw.bb.i, %for.body.i %code.1.i = phi i32 [ %code.011.i, %for.body.i ], [ 3, %sw.bb3.i ], [ 2, %sw.bb2.i ], [ 1, %sw.bb1.i ], [ 0, %sw.bb.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %3 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !9 %conv.i.1 = sext i8 %3 to i32 switch i32 %conv.i.1, label %sw.epilog.i.1 [ i32 65, label %sw.bb.i.1 i32 67, label %sw.bb1.i.1 i32 71, label %sw.bb2.i.1 i32 84, label %sw.bb3.i.1 ] sw.bb3.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.bb2.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.bb1.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.bb.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.epilog.i.1: ; preds = %sw.bb.i.1, %sw.bb1.i.1, %sw.bb2.i.1, %sw.bb3.i.1, %sw.epilog.i %code.1.i.1 = phi i32 [ %code.1.i, %sw.epilog.i ], [ 3, %sw.bb3.i.1 ], [ 2, %sw.bb2.i.1 ], [ 1, %sw.bb1.i.1 ], [ 0, %sw.bb.i.1 ] %4 = shl i32 %hash.010.i, 4 %5 = shl i32 %code.1.i, 2 %shl.i.1 = add i32 %4, %5 %add.i.1 = add nuw i32 %code.1.i.1, %shl.i.1 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %makehash.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !10 makehash.exit.loopexit.unr-lcssa: ; preds = %sw.epilog.i.1, %for.body.preheader.i %add.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %add.i.1, %sw.epilog.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %sw.epilog.i.1 ] %code.011.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %code.1.i.1, %sw.epilog.i.1 ] %hash.010.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %add.i.1, %sw.epilog.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %makehash.exit, label %for.body.i.epil for.body.i.epil: ; preds = %makehash.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i.unr %6 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !9 %conv.i.epil = sext i8 %6 to i32 switch i32 %conv.i.epil, label %sw.epilog.i.epil [ i32 65, label %sw.bb.i.epil i32 67, label %sw.bb1.i.epil i32 71, label %sw.bb2.i.epil i32 84, label %sw.bb3.i.epil ] sw.bb3.i.epil: ; preds = %for.body.i.epil br label %sw.epilog.i.epil sw.bb2.i.epil: ; preds = %for.body.i.epil br label %sw.epilog.i.epil sw.bb1.i.epil: ; preds = %for.body.i.epil br label %sw.epilog.i.epil sw.bb.i.epil: ; preds = %for.body.i.epil br label %sw.epilog.i.epil sw.epilog.i.epil: ; preds = %sw.bb.i.epil, %sw.bb1.i.epil, %sw.bb2.i.epil, %sw.bb3.i.epil, %for.body.i.epil %code.1.i.epil = phi i32 [ %code.011.i.unr, %for.body.i.epil ], [ 3, %sw.bb3.i.epil ], [ 2, %sw.bb2.i.epil ], [ 1, %sw.bb1.i.epil ], [ 0, %sw.bb.i.epil ] %shl.i.epil = shl i32 %hash.010.i.unr, 2 %add.i.epil = add nuw i32 %code.1.i.epil, %shl.i.epil br label %makehash.exit makehash.exit: ; preds = %sw.epilog.i.epil, %makehash.exit.loopexit.unr-lcssa, %for.body %hash.0.lcssa.i = phi i32 [ 0, %for.body ], [ %add.i.lcssa.ph, %makehash.exit.loopexit.unr-lcssa ], [ %add.i.epil, %sw.epilog.i.epil ] %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) %command, ptr noundef nonnull dereferenceable(5) @.str.4, i64 5) %cmp10 = icmp eq i32 %bcmp, 0 br i1 %cmp10, label %if.then, label %if.else if.then: ; preds = %makehash.exit %sub.i = add i32 %conv, -1 %shl.i24 = shl nuw i32 1, %sub.i %idxprom.i = zext i32 %hash.0.lcssa.i to i64 %arrayidx.i25 = getelementptr inbounds [16777216 x i16], ptr @hashTable, i64 0, i64 %idxprom.i %7 = load i16, ptr %arrayidx.i25, align 2, !tbaa !5 %conv1.i = zext i16 %7 to i32 %and.i = and i32 %shl.i24, %conv1.i %tobool.not.i = icmp eq i32 %and.i, 0 %str.str.6.i = select i1 %tobool.not.i, ptr @str, ptr @str.6 %puts.i = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.6.i) br label %for.inc if.else: ; preds = %makehash.exit %bcmp23 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %command, ptr noundef nonnull dereferenceable(7) @.str.5, i64 7) %cmp14 = icmp eq i32 %bcmp23, 0 br i1 %cmp14, label %if.then16, label %for.inc if.then16: ; preds = %if.else %sub.i26 = add i32 %conv, -1 %shl.i27 = shl nuw i32 1, %sub.i26 %idxprom.i28 = zext i32 %hash.0.lcssa.i to i64 %arrayidx.i29 = getelementptr inbounds [16777216 x i16], ptr @hashTable, i64 0, i64 %idxprom.i28 %8 = load i16, ptr %arrayidx.i29, align 2, !tbaa !5 %9 = trunc i32 %shl.i27 to i16 %conv3.i = or i16 %8, %9 store i16 %conv3.i, ptr %arrayidx.i29, align 2, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else, %if.then16 %inc = add nuw i32 %i.031, 1 %10 = load i32, ptr %n, align 4, !tbaa !12 %cmp = icmp ult i32 %inc, %10 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 13, ptr nonnull %str) #10 call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %command) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: 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 = { nofree nounwind } attributes #8 = { nofree nounwind willreturn memory(argmem: read) } attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nounwind } attributes #11 = { 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 = !{!"short", !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 = !{!"int", !7, i64 0} !14 = distinct !{!14, !11}
#include <stdio.h> #include <string.h> #define M 1046527 #define NIL (-1) #define L 14 char H[M][L]; int getChar(char ch) { if (ch == 'A') return 1; else if (ch == 'C') return 2; else if (ch == 'G') return 3; else if (ch == 'T') return 4; else return 0; } long long getKey(char str[]) { long long sum = 0, p = 1, i; for (int i = 0; i < strlen(str); i++) { sum += p*getChar(str[i]); p *= 5; } return sum; } int h1(int key) { return key % M; } int h2(int key) { return 1 + (key % (M - 1)); } int find(char str[]) { long long key, i, h; key = getKey(str); for (i = 0; ; i++) { h = (h1(key) + i * h2(key)) % M; if (strcmp(H[h], str) == 0) { return 1; } else if (strlen(H[h]) == 0) { return 0; } } return 0; } int insert(char str[]) { long long key, i, h; key = getKey(str); for (i = 0; ; i++) { h = (h1(key) + i * h2(key)) % M; if (strcmp(H[h], str) == 0) { return 1; } else if (strlen(H[h]) == 0) { strcpy(H[h], str); return 0; } } return 0; } int main(int argc, char const *argv[]) { int i, n, h; char str[L], com[9]; for (int i = 0; i < M; i++) { H[i][0] = '\0'; } scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s %s", com, str); if (com[0] == 'i') { insert(str); } else { if (find(str)) { printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246287/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246287/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.else16 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.else16: ; preds = %entry br label %return return: ; preds = %entry, %if.else16, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 0, %if.else16 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp11.not = icmp eq i64 %call, 0 br i1 %cmp11.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 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 %call, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %getChar.exit.1 ] %sum.013.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %p.012.unr = phi i64 [ 1, %for.body.preheader ], [ %mul5.1, %getChar.exit.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.unr %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.else16.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.else16.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 0, %if.else16.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.012.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.013.unr br label %for.cond.cleanup for.cond.cleanup: ; preds = %getChar.exit.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] ret i64 %sum.0.lcssa for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %getChar.exit.1 ] %sum.013 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %p.012 = phi i64 [ 1, %for.body.preheader.new ], [ %mul5.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %2, label %if.else16.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.else16.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.else16.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 0, %if.else16.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.012 %add = add nuw nsw i64 %mul, %sum.013 %mul5 = mul nsw i64 %p.012, 5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.else16.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.else16.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 0, %if.else16.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul5 %add.1 = add nuw nsw i64 %mul.1, %add %mul5.1 = mul i64 %p.012, 25 %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 !8 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress 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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp11.not.i = icmp eq i64 %call.i, 0 br i1 %cmp11.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %getChar.exit.i.1 ] %sum.013.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %p.012.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul5.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.012.i %add.i = add i32 %mul.i, %sum.013.i %mul5.i = mul i32 %p.012.i, 5 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul5.i %add.i.1 = add i32 %mul.i.1, %add.i %mul5.i.1 = mul i32 %p.012.i, 25 %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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %getChar.exit.i.1 ] %sum.013.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %p.012.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul5.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.012.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.013.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp11.not.i = icmp eq i64 %call.i, 0 br i1 %cmp11.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %getChar.exit.i.1 ] %sum.013.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %p.012.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul5.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.012.i %add.i = add i32 %mul.i, %sum.013.i %mul5.i = mul i32 %p.012.i, 5 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul5.i %add.i.1 = add i32 %mul.i.1, %add.i %mul5.i.1 = mul i32 %p.012.i, 25 %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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %getChar.exit.i.1 ] %sum.013.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %p.012.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul5.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.012.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.013.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.cond.cleanup: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp428 = icmp sgt i32 %0, 0 br i1 %cmp428, label %for.body5, label %for.end22 for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.cond.cleanup, label %for.body.3, !llvm.loop !12 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.body5: ; preds = %for.cond.cleanup, %for.inc20 %i.029 = phi i32 [ %inc21, %for.inc20 ], [ 0, %for.cond.cleanup ] %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp9 = icmp eq i8 %1, 105 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %for.body5 %call12 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc20 if.else: ; preds = %for.body5 %call14 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call14, 0 br i1 %tobool.not, label %if.else17, label %if.then15 if.then15: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc20 if.else17: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc20 for.inc20: ; preds = %if.then, %if.else17, %if.then15 %inc21 = add nuw nsw i32 %i.029, 1 %2 = load i32, ptr %n, align 4, !tbaa !10 %cmp4 = icmp slt i32 %inc21, %2 br i1 %cmp4, label %for.body5, label %for.end22, !llvm.loop !14 for.end22: ; preds = %for.inc20, %for.cond.cleanup call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !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} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include<stdio.h> int main() { long long int t,x,y,a,b,i; scanf("%lld",&t); for(i=1;i<=t;i=i+1) { scanf("%lld %lld %lld %lld",&x,&y,&a,&b); long long int p,q; q=y-x; p=a+b; if(q%p!=0) { printf("-1\n"); } else { printf("%lld\n",(q/p)); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24633/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24633/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %x = alloca i64, align 8 %y = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %cmp.not9 = icmp slt i64 %0, 1 br i1 %cmp.not9, label %for.end, label %for.body for.body: ; preds = %entry, %if.end %i.010 = phi i64 [ %add5, %if.end ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i64, ptr %y, align 8, !tbaa !5 %2 = load i64, ptr %x, align 8, !tbaa !5 %sub = sub nsw i64 %1, %2 %3 = load i64, ptr %a, align 8, !tbaa !5 %4 = load i64, ptr %b, align 8, !tbaa !5 %add = add nsw i64 %4, %3 %rem = srem i64 %sub, %add %div = sdiv i64 %sub, %add %cmp2.not = icmp eq i64 %rem, 0 br i1 %cmp2.not, label %if.else, label %if.then if.then: ; preds = %for.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %for.body %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %div) br label %if.end if.end: ; preds = %if.else, %if.then %add5 = add nuw nsw i64 %i.010, 1 %5 = load i64, ptr %t, align 8, !tbaa !5 %cmp.not.not = icmp slt i64 %i.010, %5 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = !{!"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> #include<string.h> #define M 1000007/* your task*/ #define NIL (-1) #define L 14 char H[M][L]; /* Hash Table */ int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; return -1; } /* convert a string into an integer value */ long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key%M; } int h2(int key){ return key%L; } int find(char str[]){ int key = (int)(getKey(str)&0x7fffffff); return (H[h1(key)][h2(key)]=='\0'?0:1); } int insert(char str[]){ int key = (int)(getKey(str)&0x7fffffff); H[h1(key)][h2(key)] = 't'; return 0; } int main(){ int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246395/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246395/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local local_unnamed_addr global [1000007 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.end18: ; preds = %entry br label %return return: ; preds = %entry, %if.end18, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ -1, %if.end18 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #9 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %if.end18.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.end18.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.end18.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ -1, %if.end18.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.end18.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.end18.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ -1, %if.end18.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.end18.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.end18.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ -1, %if.end18.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1000007 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 14 ret i32 %rem } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #9 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.end18.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.end18.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.end18.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ -1, %if.end18.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.end18.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.end18.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ -1, %if.end18.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit.loopexit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.end18.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.end18.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ -1, %if.end18.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit.loopexit getKey.exit.loopexit: ; preds = %getKey.exit.loopexit.unr-lcssa, %getChar.exit.i.epil %add.i.lcssa = phi i32 [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %4 = and i32 %add.i.lcssa, 2147483647 br label %getKey.exit getKey.exit: ; preds = %getKey.exit.loopexit, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %4, %getKey.exit.loopexit ] %rem.i9 = urem i32 %sum.0.lcssa.i, 1000007 %idxprom = zext i32 %rem.i9 to i64 %rem.i810 = urem i32 %sum.0.lcssa.i, 14 %idxprom3 = zext i32 %rem.i810 to i64 %arrayidx4 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %idxprom, i64 %idxprom3 %5 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %cmp = icmp ne i8 %5, 0 %cond = zext i1 %cmp to i32 ret i32 %cond } ; Function Attrs: nofree nounwind memory(write, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #9 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.end18.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.end18.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.end18.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ -1, %if.end18.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.end18.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.end18.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.end18.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ -1, %if.end18.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit.loopexit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.end18.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.end18.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ -1, %if.end18.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit.loopexit getKey.exit.loopexit: ; preds = %getKey.exit.loopexit.unr-lcssa, %getChar.exit.i.epil %add.i.lcssa = phi i32 [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %4 = and i32 %add.i.lcssa, 2147483647 br label %getKey.exit getKey.exit: ; preds = %getKey.exit.loopexit, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %4, %getKey.exit.loopexit ] %rem.i7 = urem i32 %sum.0.lcssa.i, 1000007 %idxprom = zext i32 %rem.i7 to i64 %rem.i68 = urem i32 %sum.0.lcssa.i, 14 %idxprom3 = zext i32 %rem.i68 to i64 %arrayidx4 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %idxprom, i64 %idxprom3 store i8 116, ptr %arrayidx4, align 1, !tbaa !5 ret i32 0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #10 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #10 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1000007 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp351 = icmp sgt i32 %0, 0 br i1 %cmp351, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.152 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 %call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #9 %cmp8.not.i.i = icmp eq i64 %call.i.i, 0 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %insert.exit, label %for.body.i.i.preheader for.body.i.i.preheader: ; preds = %if.then %xtraiter55 = and i64 %call.i.i, 1 %2 = icmp eq i64 %call.i.i, 1 br i1 %2, label %getKey.exit.loopexit.i.unr-lcssa, label %for.body.i.i.preheader.new for.body.i.i.preheader.new: ; preds = %for.body.i.i.preheader %unroll_iter58 = and i64 %call.i.i, -2 br label %for.body.i.i for.body.i.i: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader.new %i.011.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i = phi i32 [ 1, %for.body.i.i.preheader.new ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i = phi i32 [ 0, %for.body.i.i.preheader.new ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %niter59 = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %niter59.next.1, %getChar.exit.i.i.1 ] %arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i %3 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5 switch i8 %3, label %if.end18.i.i.i [ i8 65, label %getChar.exit.i.i i8 67, label %if.then5.i.i.i i8 71, label %if.then10.i.i.i i8 84, label %if.then15.i.i.i ] if.then5.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then10.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then15.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.end18.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i getChar.exit.i.i: ; preds = %if.end18.i.i.i, %if.then15.i.i.i, %if.then10.i.i.i, %if.then5.i.i.i, %for.body.i.i %retval.0.i.i.i = phi i32 [ 2, %if.then5.i.i.i ], [ 3, %if.then10.i.i.i ], [ 4, %if.then15.i.i.i ], [ -1, %if.end18.i.i.i ], [ 1, %for.body.i.i ] %mul.i.i = mul i32 %retval.0.i.i.i, %p.010.i.i %add.i.i = add i32 %mul.i.i, %sum.09.i.i %mul2.i.i = mul i32 %p.010.i.i, 5 %inc.i.i = or i64 %i.011.i.i, 1 %arrayidx.i.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i %4 = load i8, ptr %arrayidx.i.i.1, align 1, !tbaa !5 switch i8 %4, label %if.end18.i.i.i.1 [ i8 65, label %getChar.exit.i.i.1 i8 67, label %if.then5.i.i.i.1 i8 71, label %if.then10.i.i.i.1 i8 84, label %if.then15.i.i.i.1 ] if.then15.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then10.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then5.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.end18.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 getChar.exit.i.i.1: ; preds = %if.end18.i.i.i.1, %if.then5.i.i.i.1, %if.then10.i.i.i.1, %if.then15.i.i.i.1, %getChar.exit.i.i %retval.0.i.i.i.1 = phi i32 [ 2, %if.then5.i.i.i.1 ], [ 3, %if.then10.i.i.i.1 ], [ 4, %if.then15.i.i.i.1 ], [ -1, %if.end18.i.i.i.1 ], [ 1, %getChar.exit.i.i ] %mul.i.i.1 = mul i32 %retval.0.i.i.i.1, %mul2.i.i %add.i.i.1 = add i32 %mul.i.i.1, %add.i.i %mul2.i.i.1 = mul i32 %p.010.i.i, 25 %inc.i.i.1 = add nuw nsw i64 %i.011.i.i, 2 %niter59.next.1 = add i64 %niter59, 2 %niter59.ncmp.1 = icmp eq i64 %niter59.next.1, %unroll_iter58 br i1 %niter59.ncmp.1, label %getKey.exit.loopexit.i.unr-lcssa, label %for.body.i.i, !llvm.loop !8 getKey.exit.loopexit.i.unr-lcssa: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader %add.i.i.lcssa.ph = phi i32 [ undef, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %i.011.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i.unr = phi i32 [ 1, %for.body.i.i.preheader ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i.unr = phi i32 [ 0, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %lcmp.mod56.not = icmp eq i64 %xtraiter55, 0 br i1 %lcmp.mod56.not, label %getKey.exit.loopexit.i, label %for.body.i.i.epil for.body.i.i.epil: ; preds = %getKey.exit.loopexit.i.unr-lcssa %arrayidx.i.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i.unr %5 = load i8, ptr %arrayidx.i.i.epil, align 1, !tbaa !5 switch i8 %5, label %if.end18.i.i.i.epil [ i8 65, label %getChar.exit.i.i.epil i8 67, label %if.then5.i.i.i.epil i8 71, label %if.then10.i.i.i.epil i8 84, label %if.then15.i.i.i.epil ] if.then15.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then10.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then5.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.end18.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil getChar.exit.i.i.epil: ; preds = %if.end18.i.i.i.epil, %if.then5.i.i.i.epil, %if.then10.i.i.i.epil, %if.then15.i.i.i.epil, %for.body.i.i.epil %retval.0.i.i.i.epil = phi i32 [ 2, %if.then5.i.i.i.epil ], [ 3, %if.then10.i.i.i.epil ], [ 4, %if.then15.i.i.i.epil ], [ -1, %if.end18.i.i.i.epil ], [ 1, %for.body.i.i.epil ] %mul.i.i.epil = mul i32 %retval.0.i.i.i.epil, %p.010.i.i.unr %add.i.i.epil = add i32 %mul.i.i.epil, %sum.09.i.i.unr br label %getKey.exit.loopexit.i getKey.exit.loopexit.i: ; preds = %getKey.exit.loopexit.i.unr-lcssa, %getChar.exit.i.i.epil %add.i.i.lcssa = phi i32 [ %add.i.i.lcssa.ph, %getKey.exit.loopexit.i.unr-lcssa ], [ %add.i.i.epil, %getChar.exit.i.i.epil ] %6 = and i32 %add.i.i.lcssa, 2147483647 br label %insert.exit insert.exit: ; preds = %if.then, %getKey.exit.loopexit.i %sum.0.lcssa.i.i = phi i32 [ 0, %if.then ], [ %6, %getKey.exit.loopexit.i ] %rem.i7.i = urem i32 %sum.0.lcssa.i.i, 1000007 %idxprom.i = zext i32 %rem.i7.i to i64 %rem.i68.i = urem i32 %sum.0.lcssa.i.i, 14 %idxprom3.i = zext i32 %rem.i68.i to i64 %arrayidx4.i = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %idxprom.i, i64 %idxprom3.i store i8 116, ptr %arrayidx4.i, align 1, !tbaa !5 br label %for.inc19 if.else: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %find.exit, label %for.body.i.i29.preheader for.body.i.i29.preheader: ; preds = %if.else %xtraiter = and i64 %call.i.i, 1 %7 = icmp eq i64 %call.i.i, 1 br i1 %7, label %getKey.exit.loopexit.i42.unr-lcssa, label %for.body.i.i29.preheader.new for.body.i.i29.preheader.new: ; preds = %for.body.i.i29.preheader %unroll_iter = and i64 %call.i.i, -2 br label %for.body.i.i29 for.body.i.i29: ; preds = %getChar.exit.i.i35.1, %for.body.i.i29.preheader.new %i.011.i.i30 = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %inc.i.i40.1, %getChar.exit.i.i35.1 ] %p.010.i.i31 = phi i32 [ 1, %for.body.i.i29.preheader.new ], [ %mul2.i.i39.1, %getChar.exit.i.i35.1 ] %sum.09.i.i32 = phi i32 [ 0, %for.body.i.i29.preheader.new ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %niter = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %niter.next.1, %getChar.exit.i.i35.1 ] %arrayidx.i.i33 = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30 %8 = load i8, ptr %arrayidx.i.i33, align 1, !tbaa !5 switch i8 %8, label %if.end18.i.i.i49 [ i8 65, label %getChar.exit.i.i35 i8 67, label %if.then5.i.i.i48 i8 71, label %if.then10.i.i.i47 i8 84, label %if.then15.i.i.i34 ] if.then5.i.i.i48: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 if.then10.i.i.i47: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 if.then15.i.i.i34: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 if.end18.i.i.i49: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 getChar.exit.i.i35: ; preds = %if.end18.i.i.i49, %if.then15.i.i.i34, %if.then10.i.i.i47, %if.then5.i.i.i48, %for.body.i.i29 %retval.0.i.i.i36 = phi i32 [ 2, %if.then5.i.i.i48 ], [ 3, %if.then10.i.i.i47 ], [ 4, %if.then15.i.i.i34 ], [ -1, %if.end18.i.i.i49 ], [ 1, %for.body.i.i29 ] %mul.i.i37 = mul i32 %retval.0.i.i.i36, %p.010.i.i31 %add.i.i38 = add i32 %mul.i.i37, %sum.09.i.i32 %mul2.i.i39 = mul i32 %p.010.i.i31, 5 %inc.i.i40 = or i64 %i.011.i.i30, 1 %arrayidx.i.i33.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i40 %9 = load i8, ptr %arrayidx.i.i33.1, align 1, !tbaa !5 switch i8 %9, label %if.end18.i.i.i49.1 [ i8 65, label %getChar.exit.i.i35.1 i8 67, label %if.then5.i.i.i48.1 i8 71, label %if.then10.i.i.i47.1 i8 84, label %if.then15.i.i.i34.1 ] if.then15.i.i.i34.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 if.then10.i.i.i47.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 if.then5.i.i.i48.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 if.end18.i.i.i49.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 getChar.exit.i.i35.1: ; preds = %if.end18.i.i.i49.1, %if.then5.i.i.i48.1, %if.then10.i.i.i47.1, %if.then15.i.i.i34.1, %getChar.exit.i.i35 %retval.0.i.i.i36.1 = phi i32 [ 2, %if.then5.i.i.i48.1 ], [ 3, %if.then10.i.i.i47.1 ], [ 4, %if.then15.i.i.i34.1 ], [ -1, %if.end18.i.i.i49.1 ], [ 1, %getChar.exit.i.i35 ] %mul.i.i37.1 = mul i32 %retval.0.i.i.i36.1, %mul2.i.i39 %add.i.i38.1 = add i32 %mul.i.i37.1, %add.i.i38 %mul2.i.i39.1 = mul i32 %p.010.i.i31, 25 %inc.i.i40.1 = add nuw nsw i64 %i.011.i.i30, 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 %getKey.exit.loopexit.i42.unr-lcssa, label %for.body.i.i29, !llvm.loop !8 getKey.exit.loopexit.i42.unr-lcssa: ; preds = %getChar.exit.i.i35.1, %for.body.i.i29.preheader %add.i.i38.lcssa.ph = phi i32 [ undef, %for.body.i.i29.preheader ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %i.011.i.i30.unr = phi i64 [ 0, %for.body.i.i29.preheader ], [ %inc.i.i40.1, %getChar.exit.i.i35.1 ] %p.010.i.i31.unr = phi i32 [ 1, %for.body.i.i29.preheader ], [ %mul2.i.i39.1, %getChar.exit.i.i35.1 ] %sum.09.i.i32.unr = phi i32 [ 0, %for.body.i.i29.preheader ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit.loopexit.i42, label %for.body.i.i29.epil for.body.i.i29.epil: ; preds = %getKey.exit.loopexit.i42.unr-lcssa %arrayidx.i.i33.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30.unr %10 = load i8, ptr %arrayidx.i.i33.epil, align 1, !tbaa !5 switch i8 %10, label %if.end18.i.i.i49.epil [ i8 65, label %getChar.exit.i.i35.epil i8 67, label %if.then5.i.i.i48.epil i8 71, label %if.then10.i.i.i47.epil i8 84, label %if.then15.i.i.i34.epil ] if.then15.i.i.i34.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil if.then10.i.i.i47.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil if.then5.i.i.i48.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil if.end18.i.i.i49.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil getChar.exit.i.i35.epil: ; preds = %if.end18.i.i.i49.epil, %if.then5.i.i.i48.epil, %if.then10.i.i.i47.epil, %if.then15.i.i.i34.epil, %for.body.i.i29.epil %retval.0.i.i.i36.epil = phi i32 [ 2, %if.then5.i.i.i48.epil ], [ 3, %if.then10.i.i.i47.epil ], [ 4, %if.then15.i.i.i34.epil ], [ -1, %if.end18.i.i.i49.epil ], [ 1, %for.body.i.i29.epil ] %mul.i.i37.epil = mul i32 %retval.0.i.i.i36.epil, %p.010.i.i31.unr %add.i.i38.epil = add i32 %mul.i.i37.epil, %sum.09.i.i32.unr br label %getKey.exit.loopexit.i42 getKey.exit.loopexit.i42: ; preds = %getKey.exit.loopexit.i42.unr-lcssa, %getChar.exit.i.i35.epil %add.i.i38.lcssa = phi i32 [ %add.i.i38.lcssa.ph, %getKey.exit.loopexit.i42.unr-lcssa ], [ %add.i.i38.epil, %getChar.exit.i.i35.epil ] %11 = and i32 %add.i.i38.lcssa, 2147483647 br label %find.exit find.exit: ; preds = %if.else, %getKey.exit.loopexit.i42 %sum.0.lcssa.i.i43 = phi i32 [ 0, %if.else ], [ %11, %getKey.exit.loopexit.i42 ] %rem.i9.i = urem i32 %sum.0.lcssa.i.i43, 1000007 %idxprom.i44 = zext i32 %rem.i9.i to i64 %rem.i810.i = urem i32 %sum.0.lcssa.i.i43, 14 %idxprom3.i45 = zext i32 %rem.i810.i to i64 %arrayidx4.i46 = getelementptr inbounds [1000007 x [14 x i8]], ptr @H, i64 0, i64 %idxprom.i44, i64 %idxprom3.i45 %12 = load i8, ptr %arrayidx4.i46, align 1, !tbaa !5 %cmp.i.not = icmp eq i8 %12, 0 br i1 %cmp.i.not, label %if.else16, label %if.then14 if.then14: ; preds = %find.exit %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %find.exit %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %insert.exit, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.152, 1 %13 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %13 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !13 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #10 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(write, 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = distinct !{!13, !9}
#include<stdio.h> #include<string.h> #define M 1000033 #define L 14 char H[M][L]; /* Hash Table */ int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } /* convert a string into an integer value */ long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key%M; } int h2(int key){ return key%(M-1)+1; } int h(int key,int i){return (h1(key)+i*h2(key))%M;} int find(char str[]){ int i=0; int x=getKey(str); int num = h(x,i); while(H[num][0]!='\0') { if(strcmp(H[num],str)==0) { return 1; } i++; num=h(x,i); } return 0; } int insert(char str[]){ int i=0,x=getKey(str),num=h(x,i); while(1) { num=h(x,i); if( H[num][0] == '\0' ) { strcpy(H[num],str); return 1; } i++; } } int main(){ int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246445/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246445/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1000033 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1000033 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1000032 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h(i32 noundef %key, i32 noundef %i) local_unnamed_addr #0 { entry: %rem.i = srem i32 %key, 1000033 %rem.i3 = srem i32 %key, 1000032 %add.i = add nsw i32 %rem.i3, 1 %mul = mul nsw i32 %add.i, %i %add = add nsw i32 %mul, %rem.i %rem = srem i32 %add, 1000033 ret i32 %rem } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i.i = srem i32 %sum.0.lcssa.i, 1000033 %idxprom23 = sext i32 %rem.i.i to i64 %arrayidx24 = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom23 %4 = load i8, ptr %arrayidx24, align 2, !tbaa !5 %cmp.not25 = icmp eq i8 %4, 0 br i1 %cmp.not25, label %cleanup, label %while.body.lr.ph while.body.lr.ph: ; preds = %getKey.exit %rem.i3.i = srem i32 %sum.0.lcssa.i, 1000032 %add.i.i20 = add nsw i32 %rem.i3.i, 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %arrayidx27 = phi ptr [ %arrayidx24, %while.body.lr.ph ], [ %arrayidx, %if.end ] %i.026 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %if.end ] %call7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx27, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8 = icmp eq i32 %call7, 0 br i1 %cmp8, label %cleanup, label %if.end if.end: ; preds = %while.body %inc = add nuw nsw i32 %i.026, 1 %mul.i21 = mul nsw i32 %inc, %add.i.i20 %add.i22 = add nsw i32 %mul.i21, %rem.i.i %rem.i = srem i32 %add.i22, 1000033 %idxprom = sext i32 %rem.i to i64 %arrayidx = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom %5 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp.not = icmp eq i8 %5, 0 br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !10 cleanup: ; preds = %while.body, %if.end, %getKey.exit %retval.0 = phi i32 [ 0, %getKey.exit ], [ 0, %if.end ], [ 1, %while.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i3.i = srem i32 %sum.0.lcssa.i, 1000032 %rem.i.i14 = srem i32 %sum.0.lcssa.i, 1000033 %add.i.i16 = add nsw i32 %rem.i3.i, 1 br label %while.cond while.cond: ; preds = %while.cond, %getKey.exit %i.0 = phi i32 [ 0, %getKey.exit ], [ %inc, %while.cond ] %mul.i17 = mul nsw i32 %i.0, %add.i.i16 %add.i18 = add nsw i32 %mul.i17, %rem.i.i14 %rem.i = srem i32 %add.i18, 1000033 %idxprom = sext i32 %rem.i to i64 %arrayidx = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom %4 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp = icmp eq i8 %4, 0 %inc = add nuw nsw i32 %i.0, 1 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %while.cond %call8 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #11 ret i32 1 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.1, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.1 ] %arrayidx = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 1000033 br i1 %exitcond.not, label %for.end, label %for.body.1, !llvm.loop !11 for.body.1: ; preds = %for.body %arrayidx.1 = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !12 %cmp354 = icmp sgt i32 %0, 0 br i1 %cmp354, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.155 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 %call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i.i = icmp eq i64 %call.i.i, 0 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %getKey.exit.i, label %for.body.i.i.preheader for.body.i.i.preheader: ; preds = %if.then %xtraiter58 = and i64 %call.i.i, 1 %2 = icmp eq i64 %call.i.i, 1 br i1 %2, label %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i.preheader.new for.body.i.i.preheader.new: ; preds = %for.body.i.i.preheader %unroll_iter61 = and i64 %call.i.i, -2 br label %for.body.i.i for.body.i.i: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader.new %i.011.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i = phi i32 [ 1, %for.body.i.i.preheader.new ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i = phi i32 [ 0, %for.body.i.i.preheader.new ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %niter62 = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %niter62.next.1, %getChar.exit.i.i.1 ] %arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i %3 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.i [ i8 84, label %if.then15.i.i.i i8 67, label %if.then5.i.i.i i8 71, label %if.then10.i.i.i ] if.then5.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then10.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then15.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i getChar.exit.i.i: ; preds = %if.then15.i.i.i, %if.then10.i.i.i, %if.then5.i.i.i, %for.body.i.i %retval.0.i.i.i = phi i32 [ 2, %if.then5.i.i.i ], [ 3, %if.then10.i.i.i ], [ 4, %if.then15.i.i.i ], [ 1, %for.body.i.i ] %mul.i.i = mul i32 %retval.0.i.i.i, %p.010.i.i %add.i.i = add i32 %mul.i.i, %sum.09.i.i %mul2.i.i = mul i32 %p.010.i.i, 5 %inc.i.i = or i64 %i.011.i.i, 1 %arrayidx.i.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i %4 = load i8, ptr %arrayidx.i.i.1, align 1, !tbaa !5 switch i8 %4, label %getChar.exit.i.i.1 [ i8 84, label %if.then15.i.i.i.1 i8 67, label %if.then5.i.i.i.1 i8 71, label %if.then10.i.i.i.1 ] if.then10.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then5.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then15.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 getChar.exit.i.i.1: ; preds = %if.then15.i.i.i.1, %if.then5.i.i.i.1, %if.then10.i.i.i.1, %getChar.exit.i.i %retval.0.i.i.i.1 = phi i32 [ 2, %if.then5.i.i.i.1 ], [ 3, %if.then10.i.i.i.1 ], [ 4, %if.then15.i.i.i.1 ], [ 1, %getChar.exit.i.i ] %mul.i.i.1 = mul i32 %retval.0.i.i.i.1, %mul2.i.i %add.i.i.1 = add i32 %mul.i.i.1, %add.i.i %mul2.i.i.1 = mul i32 %p.010.i.i, 25 %inc.i.i.1 = add nuw nsw i64 %i.011.i.i, 2 %niter62.next.1 = add i64 %niter62, 2 %niter62.ncmp.1 = icmp eq i64 %niter62.next.1, %unroll_iter61 br i1 %niter62.ncmp.1, label %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i, !llvm.loop !8 getKey.exit.i.loopexit.unr-lcssa: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader %add.i.i.lcssa.ph = phi i32 [ undef, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %i.011.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i.unr = phi i32 [ 1, %for.body.i.i.preheader ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i.unr = phi i32 [ 0, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %lcmp.mod59.not = icmp eq i64 %xtraiter58, 0 br i1 %lcmp.mod59.not, label %getKey.exit.i, label %for.body.i.i.epil for.body.i.i.epil: ; preds = %getKey.exit.i.loopexit.unr-lcssa %arrayidx.i.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i.unr %5 = load i8, ptr %arrayidx.i.i.epil, align 1, !tbaa !5 switch i8 %5, label %getChar.exit.i.i.epil [ i8 84, label %if.then15.i.i.i.epil i8 67, label %if.then5.i.i.i.epil i8 71, label %if.then10.i.i.i.epil ] if.then10.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then5.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then15.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil getChar.exit.i.i.epil: ; preds = %if.then15.i.i.i.epil, %if.then5.i.i.i.epil, %if.then10.i.i.i.epil, %for.body.i.i.epil %retval.0.i.i.i.epil = phi i32 [ 2, %if.then5.i.i.i.epil ], [ 3, %if.then10.i.i.i.epil ], [ 4, %if.then15.i.i.i.epil ], [ 1, %for.body.i.i.epil ] %mul.i.i.epil = mul i32 %retval.0.i.i.i.epil, %p.010.i.i.unr %add.i.i.epil = add i32 %mul.i.i.epil, %sum.09.i.i.unr br label %getKey.exit.i getKey.exit.i: ; preds = %getChar.exit.i.i.epil, %getKey.exit.i.loopexit.unr-lcssa, %if.then %sum.0.lcssa.i.i = phi i32 [ 0, %if.then ], [ %add.i.i.lcssa.ph, %getKey.exit.i.loopexit.unr-lcssa ], [ %add.i.i.epil, %getChar.exit.i.i.epil ] %rem.i3.i.i = srem i32 %sum.0.lcssa.i.i, 1000032 %rem.i.i14.i = srem i32 %sum.0.lcssa.i.i, 1000033 %add.i.i16.i = add nsw i32 %rem.i3.i.i, 1 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %getKey.exit.i %i.0.i = phi i32 [ 0, %getKey.exit.i ], [ %inc.i, %while.cond.i ] %mul.i17.i = mul nsw i32 %i.0.i, %add.i.i16.i %add.i18.i = add nsw i32 %mul.i17.i, %rem.i.i14.i %rem.i.i = srem i32 %add.i18.i, 1000033 %idxprom.i = sext i32 %rem.i.i to i64 %arrayidx.i = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom.i %6 = load i8, ptr %arrayidx.i, align 2, !tbaa !5 %cmp.i = icmp eq i8 %6, 0 %inc.i = add nuw nsw i32 %i.0.i, 1 br i1 %cmp.i, label %insert.exit, label %while.cond.i insert.exit: ; preds = %while.cond.i %call8.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %str) #11 br label %for.inc19 if.else: ; preds = %for.body4 br i1 %cmp8.not.i.i, label %getKey.exit.i42, label %for.body.i.i29.preheader for.body.i.i29.preheader: ; preds = %if.else %xtraiter = and i64 %call.i.i, 1 %7 = icmp eq i64 %call.i.i, 1 br i1 %7, label %getKey.exit.i42.loopexit.unr-lcssa, label %for.body.i.i29.preheader.new for.body.i.i29.preheader.new: ; preds = %for.body.i.i29.preheader %unroll_iter = and i64 %call.i.i, -2 br label %for.body.i.i29 for.body.i.i29: ; preds = %getChar.exit.i.i35.1, %for.body.i.i29.preheader.new %i.011.i.i30 = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %inc.i.i40.1, %getChar.exit.i.i35.1 ] %p.010.i.i31 = phi i32 [ 1, %for.body.i.i29.preheader.new ], [ %mul2.i.i39.1, %getChar.exit.i.i35.1 ] %sum.09.i.i32 = phi i32 [ 0, %for.body.i.i29.preheader.new ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %niter = phi i64 [ 0, %for.body.i.i29.preheader.new ], [ %niter.next.1, %getChar.exit.i.i35.1 ] %arrayidx.i.i33 = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30 %8 = load i8, ptr %arrayidx.i.i33, align 1, !tbaa !5 switch i8 %8, label %getChar.exit.i.i35 [ i8 84, label %if.then15.i.i.i50 i8 67, label %if.then5.i.i.i49 i8 71, label %if.then10.i.i.i34 ] if.then5.i.i.i49: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 if.then10.i.i.i34: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 if.then15.i.i.i50: ; preds = %for.body.i.i29 br label %getChar.exit.i.i35 getChar.exit.i.i35: ; preds = %if.then15.i.i.i50, %if.then10.i.i.i34, %if.then5.i.i.i49, %for.body.i.i29 %retval.0.i.i.i36 = phi i32 [ 2, %if.then5.i.i.i49 ], [ 3, %if.then10.i.i.i34 ], [ 4, %if.then15.i.i.i50 ], [ 1, %for.body.i.i29 ] %mul.i.i37 = mul i32 %retval.0.i.i.i36, %p.010.i.i31 %add.i.i38 = add i32 %mul.i.i37, %sum.09.i.i32 %mul2.i.i39 = mul i32 %p.010.i.i31, 5 %inc.i.i40 = or i64 %i.011.i.i30, 1 %arrayidx.i.i33.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i40 %9 = load i8, ptr %arrayidx.i.i33.1, align 1, !tbaa !5 switch i8 %9, label %getChar.exit.i.i35.1 [ i8 84, label %if.then15.i.i.i50.1 i8 67, label %if.then5.i.i.i49.1 i8 71, label %if.then10.i.i.i34.1 ] if.then10.i.i.i34.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 if.then5.i.i.i49.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 if.then15.i.i.i50.1: ; preds = %getChar.exit.i.i35 br label %getChar.exit.i.i35.1 getChar.exit.i.i35.1: ; preds = %if.then15.i.i.i50.1, %if.then5.i.i.i49.1, %if.then10.i.i.i34.1, %getChar.exit.i.i35 %retval.0.i.i.i36.1 = phi i32 [ 2, %if.then5.i.i.i49.1 ], [ 3, %if.then10.i.i.i34.1 ], [ 4, %if.then15.i.i.i50.1 ], [ 1, %getChar.exit.i.i35 ] %mul.i.i37.1 = mul i32 %retval.0.i.i.i36.1, %mul2.i.i39 %add.i.i38.1 = add i32 %mul.i.i37.1, %add.i.i38 %mul2.i.i39.1 = mul i32 %p.010.i.i31, 25 %inc.i.i40.1 = add nuw nsw i64 %i.011.i.i30, 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 %getKey.exit.i42.loopexit.unr-lcssa, label %for.body.i.i29, !llvm.loop !8 getKey.exit.i42.loopexit.unr-lcssa: ; preds = %getChar.exit.i.i35.1, %for.body.i.i29.preheader %add.i.i38.lcssa.ph = phi i32 [ undef, %for.body.i.i29.preheader ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %i.011.i.i30.unr = phi i64 [ 0, %for.body.i.i29.preheader ], [ %inc.i.i40.1, %getChar.exit.i.i35.1 ] %p.010.i.i31.unr = phi i32 [ 1, %for.body.i.i29.preheader ], [ %mul2.i.i39.1, %getChar.exit.i.i35.1 ] %sum.09.i.i32.unr = phi i32 [ 0, %for.body.i.i29.preheader ], [ %add.i.i38.1, %getChar.exit.i.i35.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit.i42, label %for.body.i.i29.epil for.body.i.i29.epil: ; preds = %getKey.exit.i42.loopexit.unr-lcssa %arrayidx.i.i33.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i30.unr %10 = load i8, ptr %arrayidx.i.i33.epil, align 1, !tbaa !5 switch i8 %10, label %getChar.exit.i.i35.epil [ i8 84, label %if.then15.i.i.i50.epil i8 67, label %if.then5.i.i.i49.epil i8 71, label %if.then10.i.i.i34.epil ] if.then10.i.i.i34.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil if.then5.i.i.i49.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil if.then15.i.i.i50.epil: ; preds = %for.body.i.i29.epil br label %getChar.exit.i.i35.epil getChar.exit.i.i35.epil: ; preds = %if.then15.i.i.i50.epil, %if.then5.i.i.i49.epil, %if.then10.i.i.i34.epil, %for.body.i.i29.epil %retval.0.i.i.i36.epil = phi i32 [ 2, %if.then5.i.i.i49.epil ], [ 3, %if.then10.i.i.i34.epil ], [ 4, %if.then15.i.i.i50.epil ], [ 1, %for.body.i.i29.epil ] %mul.i.i37.epil = mul i32 %retval.0.i.i.i36.epil, %p.010.i.i31.unr %add.i.i38.epil = add i32 %mul.i.i37.epil, %sum.09.i.i32.unr br label %getKey.exit.i42 getKey.exit.i42: ; preds = %getChar.exit.i.i35.epil, %getKey.exit.i42.loopexit.unr-lcssa, %if.else %sum.0.lcssa.i.i43 = phi i32 [ 0, %if.else ], [ %add.i.i38.lcssa.ph, %getKey.exit.i42.loopexit.unr-lcssa ], [ %add.i.i38.epil, %getChar.exit.i.i35.epil ] %rem.i.i.i = srem i32 %sum.0.lcssa.i.i43, 1000033 %idxprom23.i = sext i32 %rem.i.i.i to i64 %arrayidx24.i = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom23.i %11 = load i8, ptr %arrayidx24.i, align 2, !tbaa !5 %cmp.not25.i = icmp eq i8 %11, 0 br i1 %cmp.not25.i, label %if.else16, label %while.body.lr.ph.i while.body.lr.ph.i: ; preds = %getKey.exit.i42 %rem.i3.i.i44 = srem i32 %sum.0.lcssa.i.i43, 1000032 %add.i.i20.i = add nsw i32 %rem.i3.i.i44, 1 br label %while.body.i while.body.i: ; preds = %if.end.i, %while.body.lr.ph.i %arrayidx27.i = phi ptr [ %arrayidx24.i, %while.body.lr.ph.i ], [ %arrayidx.i48, %if.end.i ] %i.026.i = phi i32 [ 0, %while.body.lr.ph.i ], [ %inc.i45, %if.end.i ] %call7.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx27.i, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.i = icmp eq i32 %call7.i, 0 br i1 %cmp8.i, label %if.then14, label %if.end.i if.end.i: ; preds = %while.body.i %inc.i45 = add nuw nsw i32 %i.026.i, 1 %mul.i21.i = mul nsw i32 %inc.i45, %add.i.i20.i %add.i22.i = add nsw i32 %mul.i21.i, %rem.i.i.i %rem.i.i46 = srem i32 %add.i22.i, 1000033 %idxprom.i47 = sext i32 %rem.i.i46 to i64 %arrayidx.i48 = getelementptr inbounds [1000033 x [14 x i8]], ptr @H, i64 0, i64 %idxprom.i47 %12 = load i8, ptr %arrayidx.i48, align 2, !tbaa !5 %cmp.not.i = icmp eq i8 %12, 0 br i1 %cmp.not.i, label %if.else16, label %while.body.i, !llvm.loop !10 if.then14: ; preds = %while.body.i %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.end.i, %getKey.exit.i42 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %insert.exit, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.155, 1 %13 = load i32, ptr %n, align 4, !tbaa !12 %cmp3 = icmp slt i32 %inc20, %13 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> #define M 1046527 #define NIL (-1) #define L 14 char H[M][L]; //文字から数値に変換 int getChar(char ch){ if (ch == 'A'){ return 1; } else if(ch == 'C'){ return 2; } else if ( ch == 'G'){ return 3; } else if(ch == 'T'){ return 4; } else return 0; } //文字から数値に変換してkeyを生成する long long getKey(char str[]){ long long sum = 0,p=1,i; for(i = 0; i< strlen(str);i++){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key % M; } int h2(int key){ return 1 + (key % (M-1)); } int find(char str[]){ long long key, i ,h; key = getKey(str); //文字列を数値に変換する for(i = 0; ;i++){ h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h],str) == 0){ return 1; } else if(strlen(H[h]) == 0){ return 0; } } return 0; } int insert(char str[]){ long long key,i, h; key = getKey(str); for(i=0;;i++){ h=(h1(key) + i*h2(key)) % M; if(strcmp(H[h],str) == 0){ return 1; } else if(strlen(H[h]) == 0){ strcpy(H[h],str); return 0; } } return 0; } int main(){ int i, n, h; char str[L], com[9]; for(i =0; i< M; i++){ H[i][0] = '\0'; } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %s",com,str); if(com[0] == 'i'){ insert(str); } else{ if(find(str)){ printf("yes\n"); } else{ printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246489/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246489/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.else16 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.else16: ; preds = %entry br label %return return: ; preds = %entry, %if.else16, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 0, %if.else16 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %if.else16.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.else16.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.else16.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 0, %if.else16.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.else16.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.else16.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 0, %if.else16.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.else16.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.else16.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 0, %if.else16.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include <stdio.h> #include <string.h> #define M 1046527 #define L 14 char H[M][L]; int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key) { return key % M; } int h2(int key) { return 1 + (key % (M-1)); } int find(char str[]){ long long key,i,h; key = getKey(str); for(i=0;;i++) { h = (h1(key) + i*h2(key) )%M; if (strcmp(H[h],str) ==0) { return 1; } else if (strlen(H[h]) == 0) { return 0; } } return 0; } int insert(char str[]){ long long key, i , h; key = getKey(str); for(i=0;;i++) { h = (h1(key) + i*h2(key) )%M; if (strcmp(H[h],str) ==0) { return 1; } else if (strlen(H[h]) == 0) { strcpy(H[h],str); return 0; } } return 0; } int main(){ int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246531/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246531/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include <stdio.h> #include <string.h> #define M 333331/* your task*/ #define L 14 char H[M][L]; /* Hash Table */ int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } /* convert a string into an integer value */ long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key%M; } int h2(int key){ return 1 + key%(M-1); } int find(char str[]){ long long key, i , h; key = getKey(str); for(i = 0; ; i++) { h = (h1(key) + i * h2(key))%M; if(strcmp(H[h],str) == 0)return 1; else if(strlen(H[h]) == 0)return 0; } return 0; } int insert(char str[]){ long long key, i, h; key = getKey(str); for(i = 0; ; i++) { h = (h1(key) + i * h2(key))%M; if(strcmp(H[h],str) == 0)return 1; else if(strlen(H[h]) == 0) { strcpy(H[h],str); return 0; } } return 0; } int main(){ int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246575/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246575/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [333331 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 333331 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 333330 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 333331 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 333330 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 333331 %arrayidx = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 333331 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 333330 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 333331 %arrayidx = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 333331 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [333331 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> #define M 5000000 #define T '0' #define L 14 int getChar(char); long long getKey(char[]); int h1(int); int h2(int); int find(char[]); int insert(char[]); int ll=0; char H[M][L]; /* Hash Table */ int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } /* convert a string into an integer value */ long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key%M; } int h2(int key){ return 1+key%(M-1); } int find(char str[]){ int h,i=0; long long key,j; key=getKey(str); while(1){ j=(h1(key)+h2(key)*i)%M; if(strcmp(str,H[j])==0){ return j; }else if(H[j][0]=='\0'||i>=M){ return 0; }else i++; } return 0; } int insert(char str[]){ int h,i=0; long long key,j; key=getKey(str); while(1){ j=(h1(key)+h2(key)*i)%M; if(H[j][0]=='\0'){ strcpy(H[j],str); return j; }else i++; } return 0; } int main(){ int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246618/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246618/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ll = dso_local local_unnamed_addr global i32 0, align 4 @H = dso_local global [5000000 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 5000000 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 4999999 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 5000000 %rem.i27 = srem i32 %sum.0.lcssa.i, 4999999 %add.i28 = add nsw i32 %rem.i27, 1 %conv429 = sext i32 %rem.i to i64 %arrayidx30 = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %conv429 %call531 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) %arrayidx30) #10 %cmp32 = icmp eq i32 %call531, 0 br i1 %cmp32, label %cleanup, label %if.else while.cond: ; preds = %if.else %inc = add nuw nsw i32 %i.033, 1 %mul = mul nsw i32 %inc, %add.i28 %add = add nsw i32 %mul, %rem.i %rem = srem i32 %add, 5000000 %conv4 = sext i32 %rem to i64 %arrayidx = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %conv4 %call5 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) %arrayidx) #10 %cmp = icmp eq i32 %call5, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %while.cond %arrayidx34 = phi ptr [ %arrayidx, %while.cond ], [ %arrayidx30, %getKey.exit ] %i.033 = phi i32 [ %inc, %while.cond ], [ 0, %getKey.exit ] %4 = load i8, ptr %arrayidx34, align 2, !tbaa !5 %cmp11 = icmp eq i8 %4, 0 %cmp13 = icmp ugt i32 %i.033, 4999999 %or.cond = or i1 %cmp13, %cmp11 br i1 %or.cond, label %cleanup, label %while.cond cleanup: ; preds = %while.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ %rem.i, %getKey.exit ], [ 0, %if.else ], [ %rem, %while.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 5000000 %rem.i16 = srem i32 %sum.0.lcssa.i, 4999999 %add.i17 = add nsw i32 %rem.i16, 1 br label %while.cond while.cond: ; preds = %while.cond, %getKey.exit %i.0 = phi i32 [ 0, %getKey.exit ], [ %inc, %while.cond ] %mul = mul nsw i32 %i.0, %add.i17 %add = add nsw i32 %mul, %rem.i %rem = srem i32 %add, 5000000 %conv4 = sext i32 %rem to i64 %arrayidx = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %conv4 %4 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp = icmp eq i8 %4, 0 %inc = add nuw nsw i32 %i.0, 1 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %while.cond %call9 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #11 ret i32 %rem } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.4, %for.body ] %arrayidx = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 2, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 2, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %arrayidx.4 = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.3 store i8 0, ptr %arrayidx.4, align 2, !tbaa !5 %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5 %exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 5000000 br i1 %exitcond.not.4, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i.i = icmp eq i64 %call.i.i, 0 br i1 %cmp8.not.i.i, label %getKey.exit.i, label %for.body.i.i.preheader for.body.i.i.preheader: ; preds = %if.then %xtraiter = and i64 %call.i.i, 1 %2 = icmp eq i64 %call.i.i, 1 br i1 %2, label %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i.preheader.new for.body.i.i.preheader.new: ; preds = %for.body.i.i.preheader %unroll_iter = and i64 %call.i.i, -2 br label %for.body.i.i for.body.i.i: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader.new %i.011.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i = phi i32 [ 1, %for.body.i.i.preheader.new ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i = phi i32 [ 0, %for.body.i.i.preheader.new ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %niter = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.i.1 ] %arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i %3 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.i [ i8 84, label %if.then15.i.i.i i8 67, label %if.then5.i.i.i i8 71, label %if.then10.i.i.i ] if.then5.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then10.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i if.then15.i.i.i: ; preds = %for.body.i.i br label %getChar.exit.i.i getChar.exit.i.i: ; preds = %if.then15.i.i.i, %if.then10.i.i.i, %if.then5.i.i.i, %for.body.i.i %retval.0.i.i.i = phi i32 [ 2, %if.then5.i.i.i ], [ 3, %if.then10.i.i.i ], [ 4, %if.then15.i.i.i ], [ 1, %for.body.i.i ] %mul.i.i = mul i32 %retval.0.i.i.i, %p.010.i.i %add.i.i = add i32 %mul.i.i, %sum.09.i.i %mul2.i.i = mul i32 %p.010.i.i, 5 %inc.i.i = or i64 %i.011.i.i, 1 %arrayidx.i.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i %4 = load i8, ptr %arrayidx.i.i.1, align 1, !tbaa !5 switch i8 %4, label %getChar.exit.i.i.1 [ i8 84, label %if.then15.i.i.i.1 i8 67, label %if.then5.i.i.i.1 i8 71, label %if.then10.i.i.i.1 ] if.then10.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then5.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 if.then15.i.i.i.1: ; preds = %getChar.exit.i.i br label %getChar.exit.i.i.1 getChar.exit.i.i.1: ; preds = %if.then15.i.i.i.1, %if.then5.i.i.i.1, %if.then10.i.i.i.1, %getChar.exit.i.i %retval.0.i.i.i.1 = phi i32 [ 2, %if.then5.i.i.i.1 ], [ 3, %if.then10.i.i.i.1 ], [ 4, %if.then15.i.i.i.1 ], [ 1, %getChar.exit.i.i ] %mul.i.i.1 = mul i32 %retval.0.i.i.i.1, %mul2.i.i %add.i.i.1 = add i32 %mul.i.i.1, %add.i.i %mul2.i.i.1 = mul i32 %p.010.i.i, 25 %inc.i.i.1 = add nuw nsw i64 %i.011.i.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 %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i, !llvm.loop !8 getKey.exit.i.loopexit.unr-lcssa: ; preds = %getChar.exit.i.i.1, %for.body.i.i.preheader %add.i.i.lcssa.ph = phi i32 [ undef, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %i.011.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %inc.i.i.1, %getChar.exit.i.i.1 ] %p.010.i.i.unr = phi i32 [ 1, %for.body.i.i.preheader ], [ %mul2.i.i.1, %getChar.exit.i.i.1 ] %sum.09.i.i.unr = phi i32 [ 0, %for.body.i.i.preheader ], [ %add.i.i.1, %getChar.exit.i.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit.i, label %for.body.i.i.epil for.body.i.i.epil: ; preds = %getKey.exit.i.loopexit.unr-lcssa %arrayidx.i.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.i.unr %5 = load i8, ptr %arrayidx.i.i.epil, align 1, !tbaa !5 switch i8 %5, label %getChar.exit.i.i.epil [ i8 84, label %if.then15.i.i.i.epil i8 67, label %if.then5.i.i.i.epil i8 71, label %if.then10.i.i.i.epil ] if.then10.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then5.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil if.then15.i.i.i.epil: ; preds = %for.body.i.i.epil br label %getChar.exit.i.i.epil getChar.exit.i.i.epil: ; preds = %if.then15.i.i.i.epil, %if.then5.i.i.i.epil, %if.then10.i.i.i.epil, %for.body.i.i.epil %retval.0.i.i.i.epil = phi i32 [ 2, %if.then5.i.i.i.epil ], [ 3, %if.then10.i.i.i.epil ], [ 4, %if.then15.i.i.i.epil ], [ 1, %for.body.i.i.epil ] %mul.i.i.epil = mul i32 %retval.0.i.i.i.epil, %p.010.i.i.unr %add.i.i.epil = add i32 %mul.i.i.epil, %sum.09.i.i.unr br label %getKey.exit.i getKey.exit.i: ; preds = %getChar.exit.i.i.epil, %getKey.exit.i.loopexit.unr-lcssa, %if.then %sum.0.lcssa.i.i = phi i32 [ 0, %if.then ], [ %add.i.i.lcssa.ph, %getKey.exit.i.loopexit.unr-lcssa ], [ %add.i.i.epil, %getChar.exit.i.i.epil ] %rem.i.i = srem i32 %sum.0.lcssa.i.i, 5000000 %rem.i16.i = srem i32 %sum.0.lcssa.i.i, 4999999 %add.i17.i = add nsw i32 %rem.i16.i, 1 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %getKey.exit.i %i.0.i = phi i32 [ 0, %getKey.exit.i ], [ %inc.i, %while.cond.i ] %mul.i = mul nsw i32 %i.0.i, %add.i17.i %add.i = add nsw i32 %mul.i, %rem.i.i %rem.i = srem i32 %add.i, 5000000 %conv4.i = sext i32 %rem.i to i64 %arrayidx.i = getelementptr inbounds [5000000 x [14 x i8]], ptr @H, i64 0, i64 %conv4.i %6 = load i8, ptr %arrayidx.i, align 2, !tbaa !5 %cmp.i = icmp eq i8 %6, 0 %inc.i = add nuw nsw i32 %i.0.i, 1 br i1 %cmp.i, label %insert.exit, label %while.cond.i insert.exit: ; preds = %while.cond.i %call9.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) %str) #11 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %insert.exit, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %7 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %7 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 -4999999, i32 5000000} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> #define M 1046527 #define L 14 #define NIL -1 char H[M][L]; /* Hash Table */ int getChar(char ch) { if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } /* convert a string into an integer value */ long long getKey(char str[]) { long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ) { sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key) { return key%M; } int h2(int key) { return 1+(key%(M-1)); } int find(char str[]) { long long key,i,h; key=getKey(str); for(i=0;; i++) { h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0) return 0; } return 0; } int insert(char str[]) { long long key,i,h; key=getKey(str); for(i=0;; i++) { h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0) { strcpy(H[h],str); return 0; } } return 0; } int main() { int i, n, h; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ) { scanf("%s %s", com, str); if ( com[0] == 'i' ) { insert(str); } else { if (find(str)) { printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246661/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246661/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #define BUFSIZE (1024) char buf[BUFSIZE]; long readnum() { long ret; char *bp; bp = fgets(buf, BUFSIZE, stdin); if (bp == NULL) goto err; ret = atol(buf); return ret; err: perror("error fgets"); exit(EXIT_FAILURE); } int readnar(char *buf, long *nar, int sz) { int idx; char *rp; char *nrp; long num; rp = buf; for (idx = 0; idx < sz; ++idx) { num = strtol(rp, &nrp, 10); *nar = num; ++nar; if (rp == nrp) break; rp = nrp; } return idx; } void print_arr(int *arr, int sz) { int idx; printf("%d", arr[0]); for (idx = 1; idx < sz; ++idx) { printf(" %d", arr[idx]); } puts(""); } #define MAX(a, b) ((a) < (b) ? (b) : (a)) #define MIN(a, b) ((a) > (b) ? (b) : (a)) #define HAMAX (1000 * 1000) #define VALLEN (12) typedef struct stlist List;; typedef struct stlist { struct stlist *next; char value[VALLEN + 1]; } List; List *har[HAMAX] = {NULL}; bool ListContain(List *iel, char *avalue) { while (iel != NULL) { if (strcmp(iel->value, avalue) == 0) { return true; } iel = iel->next; } return false; } void ListPush(List **head, char *avalue) { List *nel; List *iel; List **pel; nel = malloc(sizeof(List)); strcpy(nel->value, avalue); nel->next = NULL; pel = head; iel = *head; while (iel != NULL) { if (strcmp(iel->value, avalue) == 0) { free(nel); return; } pel = &(iel->next); iel = iel->next; } *pel = nel; return; } const char cmd_insert[] = "insert "; const int cmd_insert_len = sizeof(cmd_insert) - 1; const char cmd_find[] = "find "; const int cmd_find_len = sizeof(cmd_find) - 1; long calcHashValue(char *str) { long hv; bool cont; int len; hv = 0; len = 0; //puts(str); cont = true; while (cont && len < VALLEN) { switch (*str) { case 'A': hv = (hv << 4) + 1; break; case 'C': hv = (hv << 4) + 2; break; case 'G': hv = (hv << 4) + 4; break; case 'T': hv = (hv << 4) + 8; break; default: cont = false; break; } hv %= HAMAX; str++; len++; } //printf("hv = %lx\n", hv); return hv; } int main() { long tn; int idx; long hv; tn = readnum(); //printf("tn = %ld\n", tn); for (idx = 0; idx < tn; idx++) { if (fgets(buf, BUFSIZE, stdin) == NULL) goto err; //printf("inlen = %ld", sizeof(cmd_insert)); if (strncmp(buf, cmd_insert, cmd_insert_len) == 0) { hv = calcHashValue(buf + cmd_insert_len); ListPush(&(har[hv]), buf + cmd_insert_len); } else if (strncmp(buf, cmd_find, cmd_find_len) == 0) { hv = calcHashValue(buf + cmd_find_len); printf("%s\n", ListContain(har[hv], buf + cmd_find_len) ? "yes" : "no"); } else { goto err; } } exit(EXIT_SUCCESS); err: exit(EXIT_FAILURE); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246711/source.c" target datalayout = "e-m:e-p270: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.stlist = type { ptr, [13 x i8] } @buf = dso_local global [1024 x i8] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [12 x i8] c"error fgets\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @har = dso_local local_unnamed_addr global [1000000 x ptr] zeroinitializer, align 16 @cmd_insert = dso_local constant [8 x i8] c"insert \00", align 1 @cmd_insert_len = dso_local local_unnamed_addr constant i32 7, align 4 @cmd_find = dso_local constant [6 x i8] c"find \00", align 1 @cmd_find_len = dso_local local_unnamed_addr constant i32 5, align 4 @.str.5 = 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: nounwind uwtable define dso_local i64 @readnum() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %0) %cmp = icmp eq ptr %call, null br i1 %cmp, label %err, label %if.end if.end: ; preds = %entry %call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #15 ret i64 %call.i err: ; preds = %entry tail call void @perror(ptr noundef nonnull @.str) #16 tail call void @exit(i32 noundef 1) #17 unreachable } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: noreturn nounwind declare void @exit(i32 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 uwtable define dso_local i32 @readnar(ptr noundef %buf, ptr nocapture noundef writeonly %nar, i32 noundef %sz) local_unnamed_addr #4 { entry: %nrp = alloca ptr, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %nrp) #15 %cmp6 = icmp sgt i32 %sz, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %if.end %nar.addr.09 = phi ptr [ %incdec.ptr, %if.end ], [ %nar, %entry ] %rp.08 = phi ptr [ %0, %if.end ], [ %buf, %entry ] %idx.07 = phi i32 [ %inc, %if.end ], [ 0, %entry ] %call = call i64 @strtol(ptr noundef %rp.08, ptr noundef nonnull %nrp, i32 noundef 10) #15 store i64 %call, ptr %nar.addr.09, align 8, !tbaa !9 %0 = load ptr, ptr %nrp, align 8, !tbaa !5 %cmp1 = icmp eq ptr %rp.08, %0 br i1 %cmp1, label %for.end, label %if.end if.end: ; preds = %for.body %incdec.ptr = getelementptr inbounds i64, ptr %nar.addr.09, i64 1 %inc = add nuw nsw i32 %idx.07, 1 %exitcond.not = icmp eq i32 %inc, %sz br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %if.end, %for.body, %entry %idx.0.lcssa = phi i32 [ 0, %entry ], [ %idx.07, %for.body ], [ %sz, %if.end ] call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %nrp) #15 ret i32 %idx.0.lcssa } ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind uwtable define dso_local void @print_arr(ptr nocapture noundef readonly %arr, i32 noundef %sz) local_unnamed_addr #4 { entry: %0 = load i32, ptr %arr, align 4, !tbaa !13 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %cmp7 = icmp sgt i32 %sz, 1 br i1 %cmp7, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %sz to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx1 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv %1 = load i32, ptr %arrayidx1, align 4, !tbaa !13 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %for.body, %entry %putchar = tail call i32 @putchar(i32 10) 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local zeroext i1 @ListContain(ptr noundef readonly %iel, ptr nocapture noundef readonly %avalue) local_unnamed_addr #6 { entry: %cmp.not4.not = icmp eq ptr %iel, null br i1 %cmp.not4.not, label %return, label %while.body while.body: ; preds = %entry, %if.end %iel.addr.05 = phi ptr [ %0, %if.end ], [ %iel, %entry ] %value = getelementptr inbounds %struct.stlist, ptr %iel.addr.05, i64 0, i32 1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %value, ptr noundef nonnull dereferenceable(1) %avalue) #18 %cmp1 = icmp eq i32 %call, 0 br i1 %cmp1, label %return, label %if.end if.end: ; preds = %while.body %0 = load ptr, ptr %iel.addr.05, align 8, !tbaa !16 %cmp.not.not = icmp eq ptr %0, null br i1 %cmp.not.not, label %return, label %while.body, !llvm.loop !18 return: ; preds = %while.body, %if.end, %entry %cmp.not.lcssa = phi i1 [ false, %entry ], [ %cmp1, %if.end ], [ %cmp1, %while.body ] ret i1 %cmp.not.lcssa } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nounwind uwtable define dso_local void @ListPush(ptr nocapture noundef %head, ptr nocapture noundef readonly %avalue) local_unnamed_addr #0 { entry: %call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #19 %value = getelementptr inbounds %struct.stlist, ptr %call, i64 0, i32 1 %call1 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %value, ptr noundef nonnull dereferenceable(1) %avalue) #15 store ptr null, ptr %call, align 8, !tbaa !16 br label %while.cond while.cond: ; preds = %while.body, %entry %pel.0 = phi ptr [ %head, %entry ], [ %iel.0, %while.body ] %iel.0 = load ptr, ptr %pel.0, align 8, !tbaa !5 %cmp.not = icmp eq ptr %iel.0, null br i1 %cmp.not, label %while.end, label %while.body while.body: ; preds = %while.cond %value2 = getelementptr inbounds %struct.stlist, ptr %iel.0, i64 0, i32 1 %call4 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %value2, ptr noundef nonnull dereferenceable(1) %avalue) #18 %cmp5 = icmp eq i32 %call4, 0 br i1 %cmp5, label %if.then, label %while.cond, !llvm.loop !19 if.then: ; preds = %while.body tail call void @free(ptr noundef %call) #15 br label %cleanup while.end: ; preds = %while.cond store ptr %call, ptr %pel.0, align 8, !tbaa !5 br label %cleanup cleanup: ; preds = %while.end, %if.then ret void } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #8 ; 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 #9 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #10 ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i64 @calcHashValue(ptr nocapture noundef readonly %str) local_unnamed_addr #11 { entry: %0 = load i8, ptr %str, align 1, !tbaa !20 %conv = sext i8 %0 to i32 switch i32 %conv, label %while.end [ i32 65, label %sw.epilog i32 67, label %sw.bb1 i32 71, label %sw.bb4 i32 84, label %sw.bb7 ] sw.bb1: ; preds = %entry br label %sw.epilog sw.bb4: ; preds = %entry br label %sw.epilog sw.bb7: ; preds = %entry br label %sw.epilog sw.epilog: ; preds = %entry, %sw.bb7, %sw.bb4, %sw.bb1 %.sink = phi i64 [ 8, %sw.bb7 ], [ 4, %sw.bb4 ], [ 2, %sw.bb1 ], [ 1, %entry ] %incdec.ptr = getelementptr inbounds i8, ptr %str, i64 1 %1 = load i8, ptr %incdec.ptr, align 1, !tbaa !20 %conv.1 = sext i8 %1 to i32 switch i32 %conv.1, label %while.end [ i32 65, label %sw.epilog.1 i32 67, label %sw.bb1.1 i32 71, label %sw.bb4.1 i32 84, label %sw.bb7.1 ] sw.bb7.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.bb4.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.bb1.1: ; preds = %sw.epilog br label %sw.epilog.1 sw.epilog.1: ; preds = %sw.bb1.1, %sw.bb4.1, %sw.bb7.1, %sw.epilog %.sink.1 = phi i64 [ 8, %sw.bb7.1 ], [ 4, %sw.bb4.1 ], [ 2, %sw.bb1.1 ], [ 1, %sw.epilog ] %shl8.1 = shl nuw nsw i64 %.sink, 4 %add9.1 = or i64 %shl8.1, %.sink.1 %incdec.ptr.1 = getelementptr inbounds i8, ptr %str, i64 2 %2 = load i8, ptr %incdec.ptr.1, align 1, !tbaa !20 %conv.2 = sext i8 %2 to i32 switch i32 %conv.2, label %while.end [ i32 65, label %sw.epilog.2 i32 67, label %sw.bb1.2 i32 71, label %sw.bb4.2 i32 84, label %sw.bb7.2 ] sw.bb7.2: ; preds = %sw.epilog.1 br label %sw.epilog.2 sw.bb4.2: ; preds = %sw.epilog.1 br label %sw.epilog.2 sw.bb1.2: ; preds = %sw.epilog.1 br label %sw.epilog.2 sw.epilog.2: ; preds = %sw.bb1.2, %sw.bb4.2, %sw.bb7.2, %sw.epilog.1 %.sink.2 = phi i64 [ 8, %sw.bb7.2 ], [ 4, %sw.bb4.2 ], [ 2, %sw.bb1.2 ], [ 1, %sw.epilog.1 ] %shl8.2 = shl nuw nsw i64 %add9.1, 4 %add9.2 = or i64 %shl8.2, %.sink.2 %incdec.ptr.2 = getelementptr inbounds i8, ptr %str, i64 3 %3 = load i8, ptr %incdec.ptr.2, align 1, !tbaa !20 %conv.3 = sext i8 %3 to i32 switch i32 %conv.3, label %while.end [ i32 65, label %sw.epilog.3 i32 67, label %sw.bb1.3 i32 71, label %sw.bb4.3 i32 84, label %sw.bb7.3 ] sw.bb7.3: ; preds = %sw.epilog.2 br label %sw.epilog.3 sw.bb4.3: ; preds = %sw.epilog.2 br label %sw.epilog.3 sw.bb1.3: ; preds = %sw.epilog.2 br label %sw.epilog.3 sw.epilog.3: ; preds = %sw.bb1.3, %sw.bb4.3, %sw.bb7.3, %sw.epilog.2 %.sink.3 = phi i64 [ 8, %sw.bb7.3 ], [ 4, %sw.bb4.3 ], [ 2, %sw.bb1.3 ], [ 1, %sw.epilog.2 ] %shl8.3 = shl nuw nsw i64 %add9.2, 4 %add9.3 = or i64 %shl8.3, %.sink.3 %rem.3 = urem i64 %add9.3, 1000000 %incdec.ptr.3 = getelementptr inbounds i8, ptr %str, i64 4 %4 = load i8, ptr %incdec.ptr.3, align 1, !tbaa !20 %conv.4 = sext i8 %4 to i32 switch i32 %conv.4, label %while.end [ i32 65, label %sw.epilog.4 i32 67, label %sw.bb1.4 i32 71, label %sw.bb4.4 i32 84, label %sw.bb7.4 ] sw.bb7.4: ; preds = %sw.epilog.3 br label %sw.epilog.4 sw.bb4.4: ; preds = %sw.epilog.3 br label %sw.epilog.4 sw.bb1.4: ; preds = %sw.epilog.3 br label %sw.epilog.4 sw.epilog.4: ; preds = %sw.bb1.4, %sw.bb4.4, %sw.bb7.4, %sw.epilog.3 %.sink.4 = phi i64 [ 8, %sw.bb7.4 ], [ 4, %sw.bb4.4 ], [ 2, %sw.bb1.4 ], [ 1, %sw.epilog.3 ] %shl8.4 = shl nuw nsw i64 %rem.3, 4 %add9.4 = or i64 %shl8.4, %.sink.4 %rem.4 = urem i64 %add9.4, 1000000 %incdec.ptr.4 = getelementptr inbounds i8, ptr %str, i64 5 %5 = load i8, ptr %incdec.ptr.4, align 1, !tbaa !20 %conv.5 = sext i8 %5 to i32 switch i32 %conv.5, label %while.end [ i32 65, label %sw.epilog.5 i32 67, label %sw.bb1.5 i32 71, label %sw.bb4.5 i32 84, label %sw.bb7.5 ] sw.bb7.5: ; preds = %sw.epilog.4 br label %sw.epilog.5 sw.bb4.5: ; preds = %sw.epilog.4 br label %sw.epilog.5 sw.bb1.5: ; preds = %sw.epilog.4 br label %sw.epilog.5 sw.epilog.5: ; preds = %sw.bb1.5, %sw.bb4.5, %sw.bb7.5, %sw.epilog.4 %.sink.5 = phi i64 [ 8, %sw.bb7.5 ], [ 4, %sw.bb4.5 ], [ 2, %sw.bb1.5 ], [ 1, %sw.epilog.4 ] %shl8.5 = shl nuw nsw i64 %rem.4, 4 %add9.5 = or i64 %shl8.5, %.sink.5 %rem.5 = urem i64 %add9.5, 1000000 %incdec.ptr.5 = getelementptr inbounds i8, ptr %str, i64 6 %6 = load i8, ptr %incdec.ptr.5, align 1, !tbaa !20 %conv.6 = sext i8 %6 to i32 switch i32 %conv.6, label %while.end [ i32 65, label %sw.epilog.6 i32 67, label %sw.bb1.6 i32 71, label %sw.bb4.6 i32 84, label %sw.bb7.6 ] sw.bb7.6: ; preds = %sw.epilog.5 br label %sw.epilog.6 sw.bb4.6: ; preds = %sw.epilog.5 br label %sw.epilog.6 sw.bb1.6: ; preds = %sw.epilog.5 br label %sw.epilog.6 sw.epilog.6: ; preds = %sw.bb1.6, %sw.bb4.6, %sw.bb7.6, %sw.epilog.5 %.sink.6 = phi i64 [ 8, %sw.bb7.6 ], [ 4, %sw.bb4.6 ], [ 2, %sw.bb1.6 ], [ 1, %sw.epilog.5 ] %shl8.6 = shl nuw nsw i64 %rem.5, 4 %add9.6 = or i64 %shl8.6, %.sink.6 %rem.6 = urem i64 %add9.6, 1000000 %incdec.ptr.6 = getelementptr inbounds i8, ptr %str, i64 7 %7 = load i8, ptr %incdec.ptr.6, align 1, !tbaa !20 %conv.7 = sext i8 %7 to i32 switch i32 %conv.7, label %while.end [ i32 65, label %sw.epilog.7 i32 67, label %sw.bb1.7 i32 71, label %sw.bb4.7 i32 84, label %sw.bb7.7 ] sw.bb7.7: ; preds = %sw.epilog.6 br label %sw.epilog.7 sw.bb4.7: ; preds = %sw.epilog.6 br label %sw.epilog.7 sw.bb1.7: ; preds = %sw.epilog.6 br label %sw.epilog.7 sw.epilog.7: ; preds = %sw.bb1.7, %sw.bb4.7, %sw.bb7.7, %sw.epilog.6 %.sink.7 = phi i64 [ 8, %sw.bb7.7 ], [ 4, %sw.bb4.7 ], [ 2, %sw.bb1.7 ], [ 1, %sw.epilog.6 ] %shl8.7 = shl nuw nsw i64 %rem.6, 4 %add9.7 = or i64 %shl8.7, %.sink.7 %rem.7 = urem i64 %add9.7, 1000000 %incdec.ptr.7 = getelementptr inbounds i8, ptr %str, i64 8 %8 = load i8, ptr %incdec.ptr.7, align 1, !tbaa !20 %conv.8 = sext i8 %8 to i32 switch i32 %conv.8, label %while.end [ i32 65, label %sw.epilog.8 i32 67, label %sw.bb1.8 i32 71, label %sw.bb4.8 i32 84, label %sw.bb7.8 ] sw.bb7.8: ; preds = %sw.epilog.7 br label %sw.epilog.8 sw.bb4.8: ; preds = %sw.epilog.7 br label %sw.epilog.8 sw.bb1.8: ; preds = %sw.epilog.7 br label %sw.epilog.8 sw.epilog.8: ; preds = %sw.bb1.8, %sw.bb4.8, %sw.bb7.8, %sw.epilog.7 %.sink.8 = phi i64 [ 8, %sw.bb7.8 ], [ 4, %sw.bb4.8 ], [ 2, %sw.bb1.8 ], [ 1, %sw.epilog.7 ] %shl8.8 = shl nuw nsw i64 %rem.7, 4 %add9.8 = or i64 %shl8.8, %.sink.8 %rem.8 = urem i64 %add9.8, 1000000 %incdec.ptr.8 = getelementptr inbounds i8, ptr %str, i64 9 %9 = load i8, ptr %incdec.ptr.8, align 1, !tbaa !20 %conv.9 = sext i8 %9 to i32 switch i32 %conv.9, label %while.end [ i32 65, label %sw.epilog.9 i32 67, label %sw.bb1.9 i32 71, label %sw.bb4.9 i32 84, label %sw.bb7.9 ] sw.bb7.9: ; preds = %sw.epilog.8 br label %sw.epilog.9 sw.bb4.9: ; preds = %sw.epilog.8 br label %sw.epilog.9 sw.bb1.9: ; preds = %sw.epilog.8 br label %sw.epilog.9 sw.epilog.9: ; preds = %sw.bb1.9, %sw.bb4.9, %sw.bb7.9, %sw.epilog.8 %.sink.9 = phi i64 [ 8, %sw.bb7.9 ], [ 4, %sw.bb4.9 ], [ 2, %sw.bb1.9 ], [ 1, %sw.epilog.8 ] %shl8.9 = shl nuw nsw i64 %rem.8, 4 %add9.9 = or i64 %shl8.9, %.sink.9 %rem.9 = urem i64 %add9.9, 1000000 %incdec.ptr.9 = getelementptr inbounds i8, ptr %str, i64 10 %10 = load i8, ptr %incdec.ptr.9, align 1, !tbaa !20 %conv.10 = sext i8 %10 to i32 switch i32 %conv.10, label %while.end [ i32 65, label %sw.epilog.10 i32 67, label %sw.bb1.10 i32 71, label %sw.bb4.10 i32 84, label %sw.bb7.10 ] sw.bb7.10: ; preds = %sw.epilog.9 br label %sw.epilog.10 sw.bb4.10: ; preds = %sw.epilog.9 br label %sw.epilog.10 sw.bb1.10: ; preds = %sw.epilog.9 br label %sw.epilog.10 sw.epilog.10: ; preds = %sw.bb1.10, %sw.bb4.10, %sw.bb7.10, %sw.epilog.9 %.sink.10 = phi i64 [ 8, %sw.bb7.10 ], [ 4, %sw.bb4.10 ], [ 2, %sw.bb1.10 ], [ 1, %sw.epilog.9 ] %shl8.10 = shl nuw nsw i64 %rem.9, 4 %add9.10 = or i64 %shl8.10, %.sink.10 %rem.10 = urem i64 %add9.10, 1000000 %incdec.ptr.10 = getelementptr inbounds i8, ptr %str, i64 11 %11 = load i8, ptr %incdec.ptr.10, align 1, !tbaa !20 %conv.11 = sext i8 %11 to i32 switch i32 %conv.11, label %while.end [ i32 65, label %sw.epilog.11 i32 67, label %sw.bb1.11 i32 71, label %sw.bb4.11 i32 84, label %sw.bb7.11 ] sw.bb7.11: ; preds = %sw.epilog.10 br label %sw.epilog.11 sw.bb4.11: ; preds = %sw.epilog.10 br label %sw.epilog.11 sw.bb1.11: ; preds = %sw.epilog.10 br label %sw.epilog.11 sw.epilog.11: ; preds = %sw.bb1.11, %sw.bb4.11, %sw.bb7.11, %sw.epilog.10 %.sink.11 = phi i64 [ 8, %sw.bb7.11 ], [ 4, %sw.bb4.11 ], [ 2, %sw.bb1.11 ], [ 1, %sw.epilog.10 ] %shl8.11 = shl nuw nsw i64 %rem.10, 4 %add9.11 = or i64 %shl8.11, %.sink.11 %rem.11 = urem i64 %add9.11, 1000000 br label %while.end while.end: ; preds = %sw.epilog.11, %sw.epilog.10, %sw.epilog.9, %sw.epilog.8, %sw.epilog.7, %sw.epilog.6, %sw.epilog.5, %sw.epilog.4, %sw.epilog.3, %sw.epilog.2, %sw.epilog.1, %sw.epilog, %entry %rem28 = phi i64 [ 0, %entry ], [ %.sink, %sw.epilog ], [ %add9.1, %sw.epilog.1 ], [ %add9.2, %sw.epilog.2 ], [ %rem.3, %sw.epilog.3 ], [ %rem.4, %sw.epilog.4 ], [ %rem.5, %sw.epilog.5 ], [ %rem.6, %sw.epilog.6 ], [ %rem.7, %sw.epilog.7 ], [ %rem.8, %sw.epilog.8 ], [ %rem.9, %sw.epilog.9 ], [ %rem.10, %sw.epilog.10 ], [ %rem.11, %sw.epilog.11 ] ret i64 %rem28 } ; Function Attrs: noreturn nounwind uwtable define dso_local i32 @main() local_unnamed_addr #12 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %0) %cmp.i = icmp eq ptr %call.i, null br i1 %cmp.i, label %err.i, label %readnum.exit err.i: ; preds = %entry tail call void @perror(ptr noundef nonnull @.str) #16 tail call void @exit(i32 noundef 1) #17 unreachable readnum.exit: ; preds = %entry %call.i.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #15 %cmp52 = icmp sgt i64 %call.i.i, 0 br i1 %cmp52, label %for.body, label %for.end for.body: ; preds = %readnum.exit, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %readnum.exit ] %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call2 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %1) %cmp3 = icmp eq ptr %call2, null br i1 %cmp3, label %err, label %if.end if.end: ; preds = %for.body %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(7) @buf, ptr noundef nonnull dereferenceable(7) @cmd_insert, i64 7) %cmp6 = icmp eq i32 %bcmp, 0 br i1 %cmp6, label %while.body.i.preheader, label %if.else while.body.i.preheader: ; preds = %if.end %2 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 7), align 1, !tbaa !20 %conv.i = sext i8 %2 to i32 switch i32 %conv.i, label %calcHashValue.exit [ i32 65, label %sw.epilog.i i32 67, label %sw.bb1.i i32 71, label %sw.bb4.i i32 84, label %sw.bb7.i ] sw.bb1.i: ; preds = %while.body.i.preheader br label %sw.epilog.i sw.bb4.i: ; preds = %while.body.i.preheader br label %sw.epilog.i sw.bb7.i: ; preds = %while.body.i.preheader br label %sw.epilog.i sw.epilog.i: ; preds = %sw.bb7.i, %sw.bb4.i, %sw.bb1.i, %while.body.i.preheader %.sink.i = phi i64 [ 8, %sw.bb7.i ], [ 4, %sw.bb4.i ], [ 2, %sw.bb1.i ], [ 1, %while.body.i.preheader ] %3 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 8), align 8, !tbaa !20 %conv.i.1 = sext i8 %3 to i32 switch i32 %conv.i.1, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.1 i32 67, label %sw.bb1.i.1 i32 71, label %sw.bb4.i.1 i32 84, label %sw.bb7.i.1 ] sw.bb7.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.bb4.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.bb1.i.1: ; preds = %sw.epilog.i br label %sw.epilog.i.1 sw.epilog.i.1: ; preds = %sw.bb1.i.1, %sw.bb4.i.1, %sw.bb7.i.1, %sw.epilog.i %.sink.i.1 = phi i64 [ 8, %sw.bb7.i.1 ], [ 4, %sw.bb4.i.1 ], [ 2, %sw.bb1.i.1 ], [ 1, %sw.epilog.i ] %shl8.i.1 = shl nuw nsw i64 %.sink.i, 4 %add9.i.1 = or i64 %.sink.i.1, %shl8.i.1 %4 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 9), align 1, !tbaa !20 %conv.i.2 = sext i8 %4 to i32 switch i32 %conv.i.2, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.2 i32 67, label %sw.bb1.i.2 i32 71, label %sw.bb4.i.2 i32 84, label %sw.bb7.i.2 ] sw.bb7.i.2: ; preds = %sw.epilog.i.1 br label %sw.epilog.i.2 sw.bb4.i.2: ; preds = %sw.epilog.i.1 br label %sw.epilog.i.2 sw.bb1.i.2: ; preds = %sw.epilog.i.1 br label %sw.epilog.i.2 sw.epilog.i.2: ; preds = %sw.bb1.i.2, %sw.bb4.i.2, %sw.bb7.i.2, %sw.epilog.i.1 %.sink.i.2 = phi i64 [ 8, %sw.bb7.i.2 ], [ 4, %sw.bb4.i.2 ], [ 2, %sw.bb1.i.2 ], [ 1, %sw.epilog.i.1 ] %shl8.i.2 = shl nuw nsw i64 %add9.i.1, 4 %add9.i.2 = or i64 %.sink.i.2, %shl8.i.2 %5 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 10), align 2, !tbaa !20 %conv.i.3 = sext i8 %5 to i32 switch i32 %conv.i.3, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.3 i32 67, label %sw.bb1.i.3 i32 71, label %sw.bb4.i.3 i32 84, label %sw.bb7.i.3 ] sw.bb7.i.3: ; preds = %sw.epilog.i.2 br label %sw.epilog.i.3 sw.bb4.i.3: ; preds = %sw.epilog.i.2 br label %sw.epilog.i.3 sw.bb1.i.3: ; preds = %sw.epilog.i.2 br label %sw.epilog.i.3 sw.epilog.i.3: ; preds = %sw.bb1.i.3, %sw.bb4.i.3, %sw.bb7.i.3, %sw.epilog.i.2 %.sink.i.3 = phi i64 [ 8, %sw.bb7.i.3 ], [ 4, %sw.bb4.i.3 ], [ 2, %sw.bb1.i.3 ], [ 1, %sw.epilog.i.2 ] %shl8.i.3 = shl nuw nsw i64 %add9.i.2, 4 %add9.i.3 = or i64 %.sink.i.3, %shl8.i.3 %6 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 11), align 1, !tbaa !20 %conv.i.4 = sext i8 %6 to i32 switch i32 %conv.i.4, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.4 i32 67, label %sw.bb1.i.4 i32 71, label %sw.bb4.i.4 i32 84, label %sw.bb7.i.4 ] sw.bb7.i.4: ; preds = %sw.epilog.i.3 br label %sw.epilog.i.4 sw.bb4.i.4: ; preds = %sw.epilog.i.3 br label %sw.epilog.i.4 sw.bb1.i.4: ; preds = %sw.epilog.i.3 br label %sw.epilog.i.4 sw.epilog.i.4: ; preds = %sw.bb1.i.4, %sw.bb4.i.4, %sw.bb7.i.4, %sw.epilog.i.3 %.sink.i.4 = phi i64 [ 8, %sw.bb7.i.4 ], [ 4, %sw.bb4.i.4 ], [ 2, %sw.bb1.i.4 ], [ 1, %sw.epilog.i.3 ] %shl8.i.4 = shl i64 %add9.i.3, 4 %add9.i.4 = or i64 %.sink.i.4, %shl8.i.4 %rem.i.4.urem = add i64 %add9.i.4, -1000000 %rem.i.4.cmp = icmp ult i64 %add9.i.4, 1000000 %rem.i.4 = select i1 %rem.i.4.cmp, i64 %add9.i.4, i64 %rem.i.4.urem %7 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 12), align 4, !tbaa !20 %conv.i.5 = sext i8 %7 to i32 switch i32 %conv.i.5, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.5 i32 67, label %sw.bb1.i.5 i32 71, label %sw.bb4.i.5 i32 84, label %sw.bb7.i.5 ] sw.bb7.i.5: ; preds = %sw.epilog.i.4 br label %sw.epilog.i.5 sw.bb4.i.5: ; preds = %sw.epilog.i.4 br label %sw.epilog.i.5 sw.bb1.i.5: ; preds = %sw.epilog.i.4 br label %sw.epilog.i.5 sw.epilog.i.5: ; preds = %sw.bb1.i.5, %sw.bb4.i.5, %sw.bb7.i.5, %sw.epilog.i.4 %.sink.i.5 = phi i64 [ 8, %sw.bb7.i.5 ], [ 4, %sw.bb4.i.5 ], [ 2, %sw.bb1.i.5 ], [ 1, %sw.epilog.i.4 ] %shl8.i.5 = shl nuw nsw i64 %rem.i.4, 4 %add9.i.5 = or i64 %.sink.i.5, %shl8.i.5 %rem.i.5.lhs.trunc = trunc i64 %add9.i.5 to i32 %rem.i.556 = urem i32 %rem.i.5.lhs.trunc, 1000000 %rem.i.5.zext = zext i32 %rem.i.556 to i64 %8 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 13), align 1, !tbaa !20 %conv.i.6 = sext i8 %8 to i32 switch i32 %conv.i.6, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.6 i32 67, label %sw.bb1.i.6 i32 71, label %sw.bb4.i.6 i32 84, label %sw.bb7.i.6 ] sw.bb7.i.6: ; preds = %sw.epilog.i.5 br label %sw.epilog.i.6 sw.bb4.i.6: ; preds = %sw.epilog.i.5 br label %sw.epilog.i.6 sw.bb1.i.6: ; preds = %sw.epilog.i.5 br label %sw.epilog.i.6 sw.epilog.i.6: ; preds = %sw.bb1.i.6, %sw.bb4.i.6, %sw.bb7.i.6, %sw.epilog.i.5 %.sink.i.6 = phi i32 [ 8, %sw.bb7.i.6 ], [ 4, %sw.bb4.i.6 ], [ 2, %sw.bb1.i.6 ], [ 1, %sw.epilog.i.5 ] %shl8.i.6 = shl nuw nsw i32 %rem.i.556, 4 %add9.i.6 = or i32 %.sink.i.6, %shl8.i.6 %rem.i.657 = urem i32 %add9.i.6, 1000000 %rem.i.6.zext = zext i32 %rem.i.657 to i64 %9 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 14), align 2, !tbaa !20 %conv.i.7 = sext i8 %9 to i32 switch i32 %conv.i.7, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.7 i32 67, label %sw.bb1.i.7 i32 71, label %sw.bb4.i.7 i32 84, label %sw.bb7.i.7 ] sw.bb7.i.7: ; preds = %sw.epilog.i.6 br label %sw.epilog.i.7 sw.bb4.i.7: ; preds = %sw.epilog.i.6 br label %sw.epilog.i.7 sw.bb1.i.7: ; preds = %sw.epilog.i.6 br label %sw.epilog.i.7 sw.epilog.i.7: ; preds = %sw.bb1.i.7, %sw.bb4.i.7, %sw.bb7.i.7, %sw.epilog.i.6 %.sink.i.7 = phi i32 [ 8, %sw.bb7.i.7 ], [ 4, %sw.bb4.i.7 ], [ 2, %sw.bb1.i.7 ], [ 1, %sw.epilog.i.6 ] %shl8.i.7 = shl nuw nsw i32 %rem.i.657, 4 %add9.i.7 = or i32 %.sink.i.7, %shl8.i.7 %rem.i.758 = urem i32 %add9.i.7, 1000000 %rem.i.7.zext = zext i32 %rem.i.758 to i64 %10 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 15), align 1, !tbaa !20 %conv.i.8 = sext i8 %10 to i32 switch i32 %conv.i.8, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.8 i32 67, label %sw.bb1.i.8 i32 71, label %sw.bb4.i.8 i32 84, label %sw.bb7.i.8 ] sw.bb7.i.8: ; preds = %sw.epilog.i.7 br label %sw.epilog.i.8 sw.bb4.i.8: ; preds = %sw.epilog.i.7 br label %sw.epilog.i.8 sw.bb1.i.8: ; preds = %sw.epilog.i.7 br label %sw.epilog.i.8 sw.epilog.i.8: ; preds = %sw.bb1.i.8, %sw.bb4.i.8, %sw.bb7.i.8, %sw.epilog.i.7 %.sink.i.8 = phi i32 [ 8, %sw.bb7.i.8 ], [ 4, %sw.bb4.i.8 ], [ 2, %sw.bb1.i.8 ], [ 1, %sw.epilog.i.7 ] %shl8.i.8 = shl nuw nsw i32 %rem.i.758, 4 %add9.i.8 = or i32 %.sink.i.8, %shl8.i.8 %rem.i.859 = urem i32 %add9.i.8, 1000000 %rem.i.8.zext = zext i32 %rem.i.859 to i64 %11 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 16), align 16, !tbaa !20 %conv.i.9 = sext i8 %11 to i32 switch i32 %conv.i.9, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.9 i32 67, label %sw.bb1.i.9 i32 71, label %sw.bb4.i.9 i32 84, label %sw.bb7.i.9 ] sw.bb7.i.9: ; preds = %sw.epilog.i.8 br label %sw.epilog.i.9 sw.bb4.i.9: ; preds = %sw.epilog.i.8 br label %sw.epilog.i.9 sw.bb1.i.9: ; preds = %sw.epilog.i.8 br label %sw.epilog.i.9 sw.epilog.i.9: ; preds = %sw.bb1.i.9, %sw.bb4.i.9, %sw.bb7.i.9, %sw.epilog.i.8 %.sink.i.9 = phi i32 [ 8, %sw.bb7.i.9 ], [ 4, %sw.bb4.i.9 ], [ 2, %sw.bb1.i.9 ], [ 1, %sw.epilog.i.8 ] %shl8.i.9 = shl nuw nsw i32 %rem.i.859, 4 %add9.i.9 = or i32 %.sink.i.9, %shl8.i.9 %rem.i.960 = urem i32 %add9.i.9, 1000000 %rem.i.9.zext = zext i32 %rem.i.960 to i64 %12 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 17), align 1, !tbaa !20 %conv.i.10 = sext i8 %12 to i32 switch i32 %conv.i.10, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.10 i32 67, label %sw.bb1.i.10 i32 71, label %sw.bb4.i.10 i32 84, label %sw.bb7.i.10 ] sw.bb7.i.10: ; preds = %sw.epilog.i.9 br label %sw.epilog.i.10 sw.bb4.i.10: ; preds = %sw.epilog.i.9 br label %sw.epilog.i.10 sw.bb1.i.10: ; preds = %sw.epilog.i.9 br label %sw.epilog.i.10 sw.epilog.i.10: ; preds = %sw.bb1.i.10, %sw.bb4.i.10, %sw.bb7.i.10, %sw.epilog.i.9 %.sink.i.10 = phi i32 [ 8, %sw.bb7.i.10 ], [ 4, %sw.bb4.i.10 ], [ 2, %sw.bb1.i.10 ], [ 1, %sw.epilog.i.9 ] %shl8.i.10 = shl nuw nsw i32 %rem.i.960, 4 %add9.i.10 = or i32 %.sink.i.10, %shl8.i.10 %rem.i.1061 = urem i32 %add9.i.10, 1000000 %rem.i.10.zext = zext i32 %rem.i.1061 to i64 %13 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 18), align 2, !tbaa !20 %conv.i.11 = sext i8 %13 to i32 switch i32 %conv.i.11, label %calcHashValue.exit [ i32 65, label %sw.epilog.i.11 i32 67, label %sw.bb1.i.11 i32 71, label %sw.bb4.i.11 i32 84, label %sw.bb7.i.11 ] sw.bb7.i.11: ; preds = %sw.epilog.i.10 br label %sw.epilog.i.11 sw.bb4.i.11: ; preds = %sw.epilog.i.10 br label %sw.epilog.i.11 sw.bb1.i.11: ; preds = %sw.epilog.i.10 br label %sw.epilog.i.11 sw.epilog.i.11: ; preds = %sw.bb1.i.11, %sw.bb4.i.11, %sw.bb7.i.11, %sw.epilog.i.10 %.sink.i.11 = phi i32 [ 8, %sw.bb7.i.11 ], [ 4, %sw.bb4.i.11 ], [ 2, %sw.bb1.i.11 ], [ 1, %sw.epilog.i.10 ] %shl8.i.11 = shl nuw nsw i32 %rem.i.1061, 4 %add9.i.11 = or i32 %.sink.i.11, %shl8.i.11 %rem.i.1162 = urem i32 %add9.i.11, 1000000 %rem.i.11.zext = zext i32 %rem.i.1162 to i64 br label %calcHashValue.exit calcHashValue.exit: ; preds = %sw.epilog.i.11, %sw.epilog.i.10, %sw.epilog.i.9, %sw.epilog.i.8, %sw.epilog.i.7, %sw.epilog.i.6, %sw.epilog.i.5, %sw.epilog.i.4, %sw.epilog.i.3, %sw.epilog.i.2, %sw.epilog.i.1, %sw.epilog.i, %while.body.i.preheader %rem28.i = phi i64 [ 0, %while.body.i.preheader ], [ %.sink.i, %sw.epilog.i ], [ %add9.i.1, %sw.epilog.i.1 ], [ %add9.i.2, %sw.epilog.i.2 ], [ %add9.i.3, %sw.epilog.i.3 ], [ %rem.i.4, %sw.epilog.i.4 ], [ %rem.i.5.zext, %sw.epilog.i.5 ], [ %rem.i.6.zext, %sw.epilog.i.6 ], [ %rem.i.7.zext, %sw.epilog.i.7 ], [ %rem.i.8.zext, %sw.epilog.i.8 ], [ %rem.i.9.zext, %sw.epilog.i.9 ], [ %rem.i.10.zext, %sw.epilog.i.10 ], [ %rem.i.11.zext, %sw.epilog.i.11 ] %arrayidx = getelementptr inbounds [1000000 x ptr], ptr @har, i64 0, i64 %rem28.i %call.i26 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #19 %value.i = getelementptr inbounds %struct.stlist, ptr %call.i26, i64 0, i32 1 %call1.i = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %value.i, ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 7)) #15 store ptr null, ptr %call.i26, align 8, !tbaa !16 br label %while.cond.i while.cond.i: ; preds = %while.body.i27, %calcHashValue.exit %pel.0.i = phi ptr [ %arrayidx, %calcHashValue.exit ], [ %iel.0.i, %while.body.i27 ] %iel.0.i = load ptr, ptr %pel.0.i, align 8, !tbaa !5 %cmp.not.i = icmp eq ptr %iel.0.i, null br i1 %cmp.not.i, label %while.end.i, label %while.body.i27 while.body.i27: ; preds = %while.cond.i %value2.i = getelementptr inbounds %struct.stlist, ptr %iel.0.i, i64 0, i32 1 %call4.i = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %value2.i, ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 7)) #18 %cmp5.i = icmp eq i32 %call4.i, 0 br i1 %cmp5.i, label %if.then.i, label %while.cond.i, !llvm.loop !19 if.then.i: ; preds = %while.body.i27 tail call void @free(ptr noundef %call.i26) #15 br label %for.inc while.end.i: ; preds = %while.cond.i store ptr %call.i26, ptr %pel.0.i, align 8, !tbaa !5 br label %for.inc if.else: ; preds = %if.end %bcmp24 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(5) @buf, ptr noundef nonnull dereferenceable(5) @cmd_find, i64 5) %cmp11 = icmp eq i32 %bcmp24, 0 br i1 %cmp11, label %while.body.i28.preheader, label %err while.body.i28.preheader: ; preds = %if.else %14 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 5), align 1, !tbaa !20 %conv.i32 = sext i8 %14 to i32 switch i32 %conv.i32, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34 i32 67, label %sw.bb1.i45 i32 71, label %sw.bb4.i44 i32 84, label %sw.bb7.i33 ] sw.bb1.i45: ; preds = %while.body.i28.preheader br label %sw.epilog.i34 sw.bb4.i44: ; preds = %while.body.i28.preheader br label %sw.epilog.i34 sw.bb7.i33: ; preds = %while.body.i28.preheader br label %sw.epilog.i34 sw.epilog.i34: ; preds = %sw.bb7.i33, %sw.bb4.i44, %sw.bb1.i45, %while.body.i28.preheader %.sink.i35 = phi i64 [ 8, %sw.bb7.i33 ], [ 4, %sw.bb4.i44 ], [ 2, %sw.bb1.i45 ], [ 1, %while.body.i28.preheader ] %15 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 6), align 2, !tbaa !20 %conv.i32.1 = sext i8 %15 to i32 switch i32 %conv.i32.1, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.1 i32 67, label %sw.bb1.i45.1 i32 71, label %sw.bb4.i44.1 i32 84, label %sw.bb7.i33.1 ] sw.bb7.i33.1: ; preds = %sw.epilog.i34 br label %sw.epilog.i34.1 sw.bb4.i44.1: ; preds = %sw.epilog.i34 br label %sw.epilog.i34.1 sw.bb1.i45.1: ; preds = %sw.epilog.i34 br label %sw.epilog.i34.1 sw.epilog.i34.1: ; preds = %sw.bb1.i45.1, %sw.bb4.i44.1, %sw.bb7.i33.1, %sw.epilog.i34 %.sink.i35.1 = phi i64 [ 8, %sw.bb7.i33.1 ], [ 4, %sw.bb4.i44.1 ], [ 2, %sw.bb1.i45.1 ], [ 1, %sw.epilog.i34 ] %shl8.i36.1 = shl nuw nsw i64 %.sink.i35, 4 %add9.i37.1 = or i64 %.sink.i35.1, %shl8.i36.1 %16 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 7), align 1, !tbaa !20 %conv.i32.2 = sext i8 %16 to i32 switch i32 %conv.i32.2, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.2 i32 67, label %sw.bb1.i45.2 i32 71, label %sw.bb4.i44.2 i32 84, label %sw.bb7.i33.2 ] sw.bb7.i33.2: ; preds = %sw.epilog.i34.1 br label %sw.epilog.i34.2 sw.bb4.i44.2: ; preds = %sw.epilog.i34.1 br label %sw.epilog.i34.2 sw.bb1.i45.2: ; preds = %sw.epilog.i34.1 br label %sw.epilog.i34.2 sw.epilog.i34.2: ; preds = %sw.bb1.i45.2, %sw.bb4.i44.2, %sw.bb7.i33.2, %sw.epilog.i34.1 %.sink.i35.2 = phi i64 [ 8, %sw.bb7.i33.2 ], [ 4, %sw.bb4.i44.2 ], [ 2, %sw.bb1.i45.2 ], [ 1, %sw.epilog.i34.1 ] %shl8.i36.2 = shl nuw nsw i64 %add9.i37.1, 4 %add9.i37.2 = or i64 %.sink.i35.2, %shl8.i36.2 %17 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 8), align 8, !tbaa !20 %conv.i32.3 = sext i8 %17 to i32 switch i32 %conv.i32.3, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.3 i32 67, label %sw.bb1.i45.3 i32 71, label %sw.bb4.i44.3 i32 84, label %sw.bb7.i33.3 ] sw.bb7.i33.3: ; preds = %sw.epilog.i34.2 br label %sw.epilog.i34.3 sw.bb4.i44.3: ; preds = %sw.epilog.i34.2 br label %sw.epilog.i34.3 sw.bb1.i45.3: ; preds = %sw.epilog.i34.2 br label %sw.epilog.i34.3 sw.epilog.i34.3: ; preds = %sw.bb1.i45.3, %sw.bb4.i44.3, %sw.bb7.i33.3, %sw.epilog.i34.2 %.sink.i35.3 = phi i64 [ 8, %sw.bb7.i33.3 ], [ 4, %sw.bb4.i44.3 ], [ 2, %sw.bb1.i45.3 ], [ 1, %sw.epilog.i34.2 ] %shl8.i36.3 = shl nuw nsw i64 %add9.i37.2, 4 %add9.i37.3 = or i64 %.sink.i35.3, %shl8.i36.3 %18 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 9), align 1, !tbaa !20 %conv.i32.4 = sext i8 %18 to i32 switch i32 %conv.i32.4, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.4 i32 67, label %sw.bb1.i45.4 i32 71, label %sw.bb4.i44.4 i32 84, label %sw.bb7.i33.4 ] sw.bb7.i33.4: ; preds = %sw.epilog.i34.3 br label %sw.epilog.i34.4 sw.bb4.i44.4: ; preds = %sw.epilog.i34.3 br label %sw.epilog.i34.4 sw.bb1.i45.4: ; preds = %sw.epilog.i34.3 br label %sw.epilog.i34.4 sw.epilog.i34.4: ; preds = %sw.bb1.i45.4, %sw.bb4.i44.4, %sw.bb7.i33.4, %sw.epilog.i34.3 %.sink.i35.4 = phi i64 [ 8, %sw.bb7.i33.4 ], [ 4, %sw.bb4.i44.4 ], [ 2, %sw.bb1.i45.4 ], [ 1, %sw.epilog.i34.3 ] %shl8.i36.4 = shl i64 %add9.i37.3, 4 %add9.i37.4 = or i64 %.sink.i35.4, %shl8.i36.4 %rem.i38.4.urem = add i64 %add9.i37.4, -1000000 %rem.i38.4.cmp = icmp ult i64 %add9.i37.4, 1000000 %rem.i38.4 = select i1 %rem.i38.4.cmp, i64 %add9.i37.4, i64 %rem.i38.4.urem %19 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 10), align 2, !tbaa !20 %conv.i32.5 = sext i8 %19 to i32 switch i32 %conv.i32.5, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.5 i32 67, label %sw.bb1.i45.5 i32 71, label %sw.bb4.i44.5 i32 84, label %sw.bb7.i33.5 ] sw.bb7.i33.5: ; preds = %sw.epilog.i34.4 br label %sw.epilog.i34.5 sw.bb4.i44.5: ; preds = %sw.epilog.i34.4 br label %sw.epilog.i34.5 sw.bb1.i45.5: ; preds = %sw.epilog.i34.4 br label %sw.epilog.i34.5 sw.epilog.i34.5: ; preds = %sw.bb1.i45.5, %sw.bb4.i44.5, %sw.bb7.i33.5, %sw.epilog.i34.4 %.sink.i35.5 = phi i64 [ 8, %sw.bb7.i33.5 ], [ 4, %sw.bb4.i44.5 ], [ 2, %sw.bb1.i45.5 ], [ 1, %sw.epilog.i34.4 ] %shl8.i36.5 = shl nuw nsw i64 %rem.i38.4, 4 %add9.i37.5 = or i64 %.sink.i35.5, %shl8.i36.5 %rem.i38.5.lhs.trunc = trunc i64 %add9.i37.5 to i32 %rem.i38.563 = urem i32 %rem.i38.5.lhs.trunc, 1000000 %rem.i38.5.zext = zext i32 %rem.i38.563 to i64 %20 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 11), align 1, !tbaa !20 %conv.i32.6 = sext i8 %20 to i32 switch i32 %conv.i32.6, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.6 i32 67, label %sw.bb1.i45.6 i32 71, label %sw.bb4.i44.6 i32 84, label %sw.bb7.i33.6 ] sw.bb7.i33.6: ; preds = %sw.epilog.i34.5 br label %sw.epilog.i34.6 sw.bb4.i44.6: ; preds = %sw.epilog.i34.5 br label %sw.epilog.i34.6 sw.bb1.i45.6: ; preds = %sw.epilog.i34.5 br label %sw.epilog.i34.6 sw.epilog.i34.6: ; preds = %sw.bb1.i45.6, %sw.bb4.i44.6, %sw.bb7.i33.6, %sw.epilog.i34.5 %.sink.i35.6 = phi i32 [ 8, %sw.bb7.i33.6 ], [ 4, %sw.bb4.i44.6 ], [ 2, %sw.bb1.i45.6 ], [ 1, %sw.epilog.i34.5 ] %shl8.i36.6 = shl nuw nsw i32 %rem.i38.563, 4 %add9.i37.6 = or i32 %.sink.i35.6, %shl8.i36.6 %rem.i38.664 = urem i32 %add9.i37.6, 1000000 %rem.i38.6.zext = zext i32 %rem.i38.664 to i64 %21 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 12), align 4, !tbaa !20 %conv.i32.7 = sext i8 %21 to i32 switch i32 %conv.i32.7, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.7 i32 67, label %sw.bb1.i45.7 i32 71, label %sw.bb4.i44.7 i32 84, label %sw.bb7.i33.7 ] sw.bb7.i33.7: ; preds = %sw.epilog.i34.6 br label %sw.epilog.i34.7 sw.bb4.i44.7: ; preds = %sw.epilog.i34.6 br label %sw.epilog.i34.7 sw.bb1.i45.7: ; preds = %sw.epilog.i34.6 br label %sw.epilog.i34.7 sw.epilog.i34.7: ; preds = %sw.bb1.i45.7, %sw.bb4.i44.7, %sw.bb7.i33.7, %sw.epilog.i34.6 %.sink.i35.7 = phi i32 [ 8, %sw.bb7.i33.7 ], [ 4, %sw.bb4.i44.7 ], [ 2, %sw.bb1.i45.7 ], [ 1, %sw.epilog.i34.6 ] %shl8.i36.7 = shl nuw nsw i32 %rem.i38.664, 4 %add9.i37.7 = or i32 %.sink.i35.7, %shl8.i36.7 %rem.i38.765 = urem i32 %add9.i37.7, 1000000 %rem.i38.7.zext = zext i32 %rem.i38.765 to i64 %22 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 13), align 1, !tbaa !20 %conv.i32.8 = sext i8 %22 to i32 switch i32 %conv.i32.8, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.8 i32 67, label %sw.bb1.i45.8 i32 71, label %sw.bb4.i44.8 i32 84, label %sw.bb7.i33.8 ] sw.bb7.i33.8: ; preds = %sw.epilog.i34.7 br label %sw.epilog.i34.8 sw.bb4.i44.8: ; preds = %sw.epilog.i34.7 br label %sw.epilog.i34.8 sw.bb1.i45.8: ; preds = %sw.epilog.i34.7 br label %sw.epilog.i34.8 sw.epilog.i34.8: ; preds = %sw.bb1.i45.8, %sw.bb4.i44.8, %sw.bb7.i33.8, %sw.epilog.i34.7 %.sink.i35.8 = phi i32 [ 8, %sw.bb7.i33.8 ], [ 4, %sw.bb4.i44.8 ], [ 2, %sw.bb1.i45.8 ], [ 1, %sw.epilog.i34.7 ] %shl8.i36.8 = shl nuw nsw i32 %rem.i38.765, 4 %add9.i37.8 = or i32 %.sink.i35.8, %shl8.i36.8 %rem.i38.866 = urem i32 %add9.i37.8, 1000000 %rem.i38.8.zext = zext i32 %rem.i38.866 to i64 %23 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 14), align 2, !tbaa !20 %conv.i32.9 = sext i8 %23 to i32 switch i32 %conv.i32.9, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.9 i32 67, label %sw.bb1.i45.9 i32 71, label %sw.bb4.i44.9 i32 84, label %sw.bb7.i33.9 ] sw.bb7.i33.9: ; preds = %sw.epilog.i34.8 br label %sw.epilog.i34.9 sw.bb4.i44.9: ; preds = %sw.epilog.i34.8 br label %sw.epilog.i34.9 sw.bb1.i45.9: ; preds = %sw.epilog.i34.8 br label %sw.epilog.i34.9 sw.epilog.i34.9: ; preds = %sw.bb1.i45.9, %sw.bb4.i44.9, %sw.bb7.i33.9, %sw.epilog.i34.8 %.sink.i35.9 = phi i32 [ 8, %sw.bb7.i33.9 ], [ 4, %sw.bb4.i44.9 ], [ 2, %sw.bb1.i45.9 ], [ 1, %sw.epilog.i34.8 ] %shl8.i36.9 = shl nuw nsw i32 %rem.i38.866, 4 %add9.i37.9 = or i32 %.sink.i35.9, %shl8.i36.9 %rem.i38.967 = urem i32 %add9.i37.9, 1000000 %rem.i38.9.zext = zext i32 %rem.i38.967 to i64 %24 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 15), align 1, !tbaa !20 %conv.i32.10 = sext i8 %24 to i32 switch i32 %conv.i32.10, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.10 i32 67, label %sw.bb1.i45.10 i32 71, label %sw.bb4.i44.10 i32 84, label %sw.bb7.i33.10 ] sw.bb7.i33.10: ; preds = %sw.epilog.i34.9 br label %sw.epilog.i34.10 sw.bb4.i44.10: ; preds = %sw.epilog.i34.9 br label %sw.epilog.i34.10 sw.bb1.i45.10: ; preds = %sw.epilog.i34.9 br label %sw.epilog.i34.10 sw.epilog.i34.10: ; preds = %sw.bb1.i45.10, %sw.bb4.i44.10, %sw.bb7.i33.10, %sw.epilog.i34.9 %.sink.i35.10 = phi i32 [ 8, %sw.bb7.i33.10 ], [ 4, %sw.bb4.i44.10 ], [ 2, %sw.bb1.i45.10 ], [ 1, %sw.epilog.i34.9 ] %shl8.i36.10 = shl nuw nsw i32 %rem.i38.967, 4 %add9.i37.10 = or i32 %.sink.i35.10, %shl8.i36.10 %rem.i38.1068 = urem i32 %add9.i37.10, 1000000 %rem.i38.10.zext = zext i32 %rem.i38.1068 to i64 %25 = load i8, ptr getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 16), align 16, !tbaa !20 %conv.i32.11 = sext i8 %25 to i32 switch i32 %conv.i32.11, label %calcHashValue.exit46 [ i32 65, label %sw.epilog.i34.11 i32 67, label %sw.bb1.i45.11 i32 71, label %sw.bb4.i44.11 i32 84, label %sw.bb7.i33.11 ] sw.bb7.i33.11: ; preds = %sw.epilog.i34.10 br label %sw.epilog.i34.11 sw.bb4.i44.11: ; preds = %sw.epilog.i34.10 br label %sw.epilog.i34.11 sw.bb1.i45.11: ; preds = %sw.epilog.i34.10 br label %sw.epilog.i34.11 sw.epilog.i34.11: ; preds = %sw.bb1.i45.11, %sw.bb4.i44.11, %sw.bb7.i33.11, %sw.epilog.i34.10 %.sink.i35.11 = phi i32 [ 8, %sw.bb7.i33.11 ], [ 4, %sw.bb4.i44.11 ], [ 2, %sw.bb1.i45.11 ], [ 1, %sw.epilog.i34.10 ] %shl8.i36.11 = shl nuw nsw i32 %rem.i38.1068, 4 %add9.i37.11 = or i32 %.sink.i35.11, %shl8.i36.11 %rem.i38.1169 = urem i32 %add9.i37.11, 1000000 %rem.i38.11.zext = zext i32 %rem.i38.1169 to i64 br label %calcHashValue.exit46 calcHashValue.exit46: ; preds = %sw.epilog.i34.11, %sw.epilog.i34.10, %sw.epilog.i34.9, %sw.epilog.i34.8, %sw.epilog.i34.7, %sw.epilog.i34.6, %sw.epilog.i34.5, %sw.epilog.i34.4, %sw.epilog.i34.3, %sw.epilog.i34.2, %sw.epilog.i34.1, %sw.epilog.i34, %while.body.i28.preheader %rem28.i43 = phi i64 [ 0, %while.body.i28.preheader ], [ %.sink.i35, %sw.epilog.i34 ], [ %add9.i37.1, %sw.epilog.i34.1 ], [ %add9.i37.2, %sw.epilog.i34.2 ], [ %add9.i37.3, %sw.epilog.i34.3 ], [ %rem.i38.4, %sw.epilog.i34.4 ], [ %rem.i38.5.zext, %sw.epilog.i34.5 ], [ %rem.i38.6.zext, %sw.epilog.i34.6 ], [ %rem.i38.7.zext, %sw.epilog.i34.7 ], [ %rem.i38.8.zext, %sw.epilog.i34.8 ], [ %rem.i38.9.zext, %sw.epilog.i34.9 ], [ %rem.i38.10.zext, %sw.epilog.i34.10 ], [ %rem.i38.11.zext, %sw.epilog.i34.11 ] %arrayidx15 = getelementptr inbounds [1000000 x ptr], ptr @har, i64 0, i64 %rem28.i43 %26 = load ptr, ptr %arrayidx15, align 8, !tbaa !5 %cmp.not4.not.i = icmp eq ptr %26, null br i1 %cmp.not4.not.i, label %ListContain.exit, label %while.body.i47 while.body.i47: ; preds = %calcHashValue.exit46, %if.end.i %iel.addr.05.i = phi ptr [ %27, %if.end.i ], [ %26, %calcHashValue.exit46 ] %value.i48 = getelementptr inbounds %struct.stlist, ptr %iel.addr.05.i, i64 0, i32 1 %call.i49 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %value.i48, ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([1024 x i8], ptr @buf, i64 0, i64 5)) #18 %cmp1.i = icmp eq i32 %call.i49, 0 br i1 %cmp1.i, label %ListContain.exit, label %if.end.i if.end.i: ; preds = %while.body.i47 %27 = load ptr, ptr %iel.addr.05.i, align 8, !tbaa !16 %cmp.not.not.i = icmp eq ptr %27, null br i1 %cmp.not.not.i, label %ListContain.exit, label %while.body.i47, !llvm.loop !18 ListContain.exit: ; preds = %if.end.i, %while.body.i47, %calcHashValue.exit46 %28 = phi ptr [ @.str.6, %calcHashValue.exit46 ], [ @.str.6, %if.end.i ], [ @.str.5, %while.body.i47 ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %28) br label %for.inc for.inc: ; preds = %while.end.i, %if.then.i, %ListContain.exit %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call.i.i br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.inc, %readnum.exit tail call void @exit(i32 noundef 0) #17 unreachable err: ; preds = %if.else, %for.body tail call void @exit(i32 noundef 1) #17 unreachable } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #14 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { 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 #6 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #8 = { 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 #9 = { 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 #10 = { 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 #11 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { nofree nounwind } attributes #14 = { nofree nounwind willreturn memory(argmem: read) } attributes #15 = { nounwind } attributes #16 = { cold } attributes #17 = { noreturn nounwind } attributes #18 = { nounwind willreturn memory(read) } attributes #19 = { 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} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14, !14, i64 0} !14 = !{!"int", !7, i64 0} !15 = distinct !{!15, !12} !16 = !{!17, !6, i64 0} !17 = !{!"stlist", !6, i64 0, !7, i64 8} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12} !20 = !{!7, !7, i64 0} !21 = distinct !{!21, !12}
#include<stdio.h> #include<string.h> #define M 1045627 #define L 14 char H[M][L]; // 文字から数値に変換 int getChar(char ch){ if(ch == 'A') return 1; else if(ch == 'C') return 2; else if(ch == 'G') return 3; else if(ch == 'T') return 4; else return 0; } // 文字列から数値へ変換して key を生成する long long getKey(char str[]){ long long sum = 0, p = 1, i; for(i = 0; i < strlen(str); i++){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){return key % M;} int h2(int key){return 1 + (key % (M - 1));} int find(char str[]){ long long key, i, h; key = getKey(str); // 文字列を数値に変換 for(i = 0; ; i++){ h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) return 1; else if(strlen(H[h]) == 0) return 0; } return 0; } int insert(char str[]){ long long key, i, h; key = getKey(str); // 文字列を数値に変換 for(i = 0; ; i++){ h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) return 1; else if(strlen(H[h]) == 0){ strcpy(H[h], str); return 0; } } return 0; } int main(){ int i, n; char str[L], com[9]; for(i = 0; i < M; i++) H[i][0] = '\0'; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%s %s", com, str); if(com[0] == 'i'){ insert(str); }else{ if(find(str)){ printf("yes\n"); }else{ printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246755/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1045627 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.else16 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.else16: ; preds = %entry br label %return return: ; preds = %entry, %if.else16, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 0, %if.else16 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %if.else16.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.else16.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.else16.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 0, %if.else16.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.else16.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.else16.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 0, %if.else16.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.else16.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.else16.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 0, %if.else16.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1045627 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1045626 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1045627 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1045626 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1045627 %arrayidx = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1045627 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1045626 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1045627 %arrayidx = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1045627 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1045627 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> #define M 1046527 #define L 14 char H[M][L]; int getChar(char ch){ if ( ch == 'A') return 1; else if ( ch == 'C') return 2; else if ( ch == 'G') return 3; else if ( ch == 'T') return 4; } long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key % M; } int h2(int key){ return 1 + (key % (M -1)); } int find(char str[]){ long long key,i,h; key = getKey(str); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0)return 0; } } int insert(char str[]){ long long key,i,h; key = getKey(str); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0){ strcpy(H[h],str); return 0; } } } int main(){ int i, n, k; char str[L], com[9]; for ( i = 0; i < M; i++ ) H[i][0] = '\0'; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%s %s", com, str); if ( com[0] == 'i' ){ insert(str); } else { if (find(str)){ printf("yes\n"); } else { printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246805/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246805/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include<stdio.h> #include<string.h> #define M 1046527 #define NIL (-1) #define L 14 char H[M][L]; int getChar(char ch){ if(ch=='A')return 1; else if(ch=='C')return 2; else if(ch=='G')return 3; else if(ch=='T')return 4; else return 0; } long long getKey(char str[]){ long long sum=0,p=1,i; for(i=0;i<strlen(str);i++){ sum+=p*(getChar(str[i])); p*=5; } return sum; } int h1(int key){return key%M;} int h2(int key){return 1+(key%(M-1));} int find(char str[]){ long long key,i,h; key=getKey(str); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0)return 0; } return 0; } int insert(char str[]){ long long key,i,h; key=getKey(str); for(i=0;;i++){ h=(h1(key)+i*h2(key))%M; if(strcmp(H[h],str)==0)return 1; else if(strlen(H[h])==0){ strcpy(H[h],str); return 0; } } return 0; } int main(){ int i,n,h; char str[L],com[9]; for(i=0;i<M;i++)H[i][0]='\0'; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %s",com,str); if(com[0]=='i'){ insert(str); }else{ if(find(str)){ printf("yes\n"); }else{ printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246856/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246856/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.else16 [ i8 65, label %return i8 67, label %if.then5 i8 71, label %if.then10 i8 84, label %if.then15 ] if.then5: ; preds = %entry br label %return if.then10: ; preds = %entry br label %return if.then15: ; preds = %entry br label %return if.else16: ; preds = %entry br label %return return: ; preds = %entry, %if.else16, %if.then15, %if.then10, %if.then5 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 0, %if.else16 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %if.else16.i [ i8 65, label %getChar.exit i8 67, label %if.then5.i i8 71, label %if.then10.i i8 84, label %if.then15.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit if.else16.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i, %if.else16.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 0, %if.else16.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.1 [ i8 65, label %getChar.exit.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 i8 84, label %if.then15.i.1 ] if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.else16.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.else16.i.1, %if.then5.i.1, %if.then10.i.1, %if.then15.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 0, %if.else16.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.epil [ i8 65, label %getChar.exit.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil i8 84, label %if.then15.i.epil ] if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.else16.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.else16.i.epil, %if.then5.i.epil, %if.then10.i.epil, %if.then15.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 0, %if.else16.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx27 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %if.else16.i.i [ i8 65, label %getChar.exit.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i i8 84, label %if.then15.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i if.else16.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.else16.i.i, %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 0, %if.else16.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %if.else16.i.i.1 [ i8 65, label %getChar.exit.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 i8 84, label %if.then15.i.i.1 ] if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.else16.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.else16.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %if.then15.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 0, %if.else16.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %if.else16.i.i.epil [ i8 65, label %getChar.exit.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil i8 84, label %if.then15.i.i.epil ] if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.else16.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.else16.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %if.then15.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 0, %if.else16.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else for.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %for.cond %arrayidx33 = phi ptr [ %arrayidx, %for.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %for.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %for.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %for.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
// Dictionary #include <stdio.h> #include <string.h> #define M 1046527 #define L 14 char H[M][L]; // ハッシュテーブル int getChar(char ch){ if( ch == 'A') return 1; else if(ch == 'C') return 2; else if(ch == 'G') return 3; else if(ch == 'T') return 4; } // 文字列から数値へ変換 long long getKey(char str[]){ long long sum = 0, p = 1, i; for ( i = 0; i < strlen(str); i++ ){ sum += p*(getChar(str[i])); p *= 5; } return sum; } int h1(int key){ return key % M; } int h2(int key){ return 1 + (key % (M-1)); } int find(char str[]){ long long key, i, h; key = getKey(str); i = 0; while(1){ h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) return 1; else if(strlen(H[h]) == 0) return 0; i++; } return 0; } int insert(char str[]){ long long key, i, h; key = getKey(str); i = 0; while(1){ h = (h1(key) + i * h2(key)) % M; if(strcmp(H[h], str) == 0) return 1; else if(strlen(H[h]) == 0){ strcpy(H[h], str); return 0; } i++; } return 0; } int main(){ int i, n, h; char str[L], com[9]; for(i=0; i < M; i++) H[i][0] = '\0'; scanf("%d", &n); for(i=0; i < n; i++){ scanf("%s %s", com, str); if(com[0] == 'i'){ insert(str); }else{ if(find(str)){ printf("yes\n"); }else{ printf("no\n"); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_246906/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_246906/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @H = dso_local global [1046527 x [14 x i8]] 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"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @getChar(i8 noundef signext %ch) local_unnamed_addr #0 { entry: switch i8 %ch, label %if.end18 [ i8 84, label %if.then15 i8 67, label %if.then5 i8 71, label %if.then10 ] if.then5: ; preds = %entry br label %if.end18 if.then10: ; preds = %entry br label %if.end18 if.then15: ; preds = %entry br label %if.end18 if.end18: ; preds = %entry, %if.then5, %if.then10, %if.then15 %retval.0 = phi i32 [ 2, %if.then5 ], [ 3, %if.then10 ], [ 4, %if.then15 ], [ 1, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not = icmp eq i64 %call, 0 br i1 %cmp8.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %call, 1 %0 = icmp eq i64 %call, 1 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 %call, -2 br label %for.body for.body: ; preds = %getChar.exit.1, %for.body.preheader.new %i.011 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %getChar.exit.1 ] %p.010 = phi i64 [ 1, %for.body.preheader.new ], [ %mul2.1, %getChar.exit.1 ] %sum.09 = phi i64 [ 0, %for.body.preheader.new ], [ %add.1, %getChar.exit.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %getChar.exit.1 ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.011 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %1, label %getChar.exit [ i8 84, label %if.then15.i i8 67, label %if.then5.i i8 71, label %if.then10.i ] if.then5.i: ; preds = %for.body br label %getChar.exit if.then10.i: ; preds = %for.body br label %getChar.exit if.then15.i: ; preds = %for.body br label %getChar.exit getChar.exit: ; preds = %for.body, %if.then5.i, %if.then10.i, %if.then15.i %retval.0.i = phi i64 [ 2, %if.then5.i ], [ 3, %if.then10.i ], [ 4, %if.then15.i ], [ 1, %for.body ] %mul = mul nsw i64 %retval.0.i, %p.010 %add = add nuw nsw i64 %mul, %sum.09 %mul2 = mul nsw i64 %p.010, 5 %inc = or i64 %i.011, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.1 [ i8 84, label %if.then15.i.1 i8 67, label %if.then5.i.1 i8 71, label %if.then10.i.1 ] if.then10.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then5.i.1: ; preds = %getChar.exit br label %getChar.exit.1 if.then15.i.1: ; preds = %getChar.exit br label %getChar.exit.1 getChar.exit.1: ; preds = %if.then15.i.1, %if.then5.i.1, %if.then10.i.1, %getChar.exit %retval.0.i.1 = phi i64 [ 2, %if.then5.i.1 ], [ 3, %if.then10.i.1 ], [ 4, %if.then15.i.1 ], [ 1, %getChar.exit ] %mul.1 = mul nsw i64 %retval.0.i.1, %mul2 %add.1 = add nuw nsw i64 %mul.1, %add %mul2.1 = mul i64 %p.010, 25 %inc.1 = add nuw nsw i64 %i.011, 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 !8 for.end.loopexit.unr-lcssa: ; preds = %getChar.exit.1, %for.body.preheader %add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %i.011.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %getChar.exit.1 ] %p.010.unr = phi i64 [ 1, %for.body.preheader ], [ %mul2.1, %getChar.exit.1 ] %sum.09.unr = phi i64 [ 0, %for.body.preheader ], [ %add.1, %getChar.exit.1 ] %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 %arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.epil [ i8 84, label %if.then15.i.epil i8 67, label %if.then5.i.epil i8 71, label %if.then10.i.epil ] if.then10.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then5.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil if.then15.i.epil: ; preds = %for.body.epil br label %getChar.exit.epil getChar.exit.epil: ; preds = %if.then15.i.epil, %if.then5.i.epil, %if.then10.i.epil, %for.body.epil %retval.0.i.epil = phi i64 [ 2, %if.then5.i.epil ], [ 3, %if.then10.i.epil ], [ 4, %if.then15.i.epil ], [ 1, %for.body.epil ] %mul.epil = mul nsw i64 %retval.0.i.epil, %p.010.unr %add.epil = add nuw nsw i64 %mul.epil, %sum.09.unr br label %for.end for.end: ; preds = %getChar.exit.epil, %for.end.loopexit.unr-lcssa, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %getChar.exit.epil ] 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) #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) #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046527 ret i32 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #0 { entry: %rem = srem i32 %key, 1046526 %add = add nsw i32 %rem, 1 ret i32 %add } ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #4 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i21 = srem i32 %sum.0.lcssa.i, 1046526 %add.i22 = add nsw i32 %rem.i21, 1 %conv5 = sext i32 %add.i22 to i64 %arrayidx23 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call624 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx23, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp25 = icmp eq i32 %call624, 0 br i1 %cmp25, label %cleanup, label %if.else while.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.026, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %while.cond %arrayidx27 = phi ptr [ %arrayidx, %while.cond ], [ %arrayidx23, %getKey.exit ] %i.026 = phi i64 [ %inc, %while.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx27, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %cleanup, label %while.cond cleanup: ; preds = %while.cond, %if.else, %getKey.exit %retval.0 = phi i32 [ 1, %getKey.exit ], [ 0, %if.else ], [ 1, %while.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #5 { entry: %call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #10 %cmp8.not.i = icmp eq i64 %call.i, 0 br i1 %cmp8.not.i, label %getKey.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %call.i, 1 br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %call.i, -2 br label %for.body.i for.body.i: ; preds = %getChar.exit.i.1, %for.body.i.preheader.new %i.011.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i = phi i32 [ 0, %for.body.i.preheader.new ], [ %add.i.1, %getChar.exit.i.1 ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %getChar.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.011.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %1, label %getChar.exit.i [ i8 84, label %if.then15.i.i i8 67, label %if.then5.i.i i8 71, label %if.then10.i.i ] if.then5.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then10.i.i: ; preds = %for.body.i br label %getChar.exit.i if.then15.i.i: ; preds = %for.body.i br label %getChar.exit.i getChar.exit.i: ; preds = %if.then15.i.i, %if.then10.i.i, %if.then5.i.i, %for.body.i %retval.0.i.i = phi i32 [ 2, %if.then5.i.i ], [ 3, %if.then10.i.i ], [ 4, %if.then15.i.i ], [ 1, %for.body.i ] %mul.i = mul i32 %retval.0.i.i, %p.010.i %add.i = add i32 %mul.i, %sum.09.i %mul2.i = mul i32 %p.010.i, 5 %inc.i = or i64 %i.011.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i %2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %2, label %getChar.exit.i.1 [ i8 84, label %if.then15.i.i.1 i8 67, label %if.then5.i.i.1 i8 71, label %if.then10.i.i.1 ] if.then10.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then5.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 if.then15.i.i.1: ; preds = %getChar.exit.i br label %getChar.exit.i.1 getChar.exit.i.1: ; preds = %if.then15.i.i.1, %if.then5.i.i.1, %if.then10.i.i.1, %getChar.exit.i %retval.0.i.i.1 = phi i32 [ 2, %if.then5.i.i.1 ], [ 3, %if.then10.i.i.1 ], [ 4, %if.then15.i.i.1 ], [ 1, %getChar.exit.i ] %mul.i.1 = mul i32 %retval.0.i.i.1, %mul2.i %add.i.1 = add i32 %mul.i.1, %add.i %mul2.i.1 = mul i32 %p.010.i, 25 %inc.i.1 = add nuw nsw i64 %i.011.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 %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 getKey.exit.loopexit.unr-lcssa: ; preds = %getChar.exit.i.1, %for.body.i.preheader %add.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %i.011.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.1, %getChar.exit.i.1 ] %p.010.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul2.i.1, %getChar.exit.i.1 ] %sum.09.i.unr = phi i32 [ 0, %for.body.i.preheader ], [ %add.i.1, %getChar.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.011.i.unr %3 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 switch i8 %3, label %getChar.exit.i.epil [ i8 84, label %if.then15.i.i.epil i8 67, label %if.then5.i.i.epil i8 71, label %if.then10.i.i.epil ] if.then10.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then5.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil if.then15.i.i.epil: ; preds = %for.body.i.epil br label %getChar.exit.i.epil getChar.exit.i.epil: ; preds = %if.then15.i.i.epil, %if.then5.i.i.epil, %if.then10.i.i.epil, %for.body.i.epil %retval.0.i.i.epil = phi i32 [ 2, %if.then5.i.i.epil ], [ 3, %if.then10.i.i.epil ], [ 4, %if.then15.i.i.epil ], [ 1, %for.body.i.epil ] %mul.i.epil = mul i32 %retval.0.i.i.epil, %p.010.i.unr %add.i.epil = add i32 %mul.i.epil, %sum.09.i.unr br label %getKey.exit getKey.exit: ; preds = %getChar.exit.i.epil, %getKey.exit.loopexit.unr-lcssa, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %getChar.exit.i.epil ] %rem.i = srem i32 %sum.0.lcssa.i, 1046527 %conv2 = sext i32 %rem.i to i64 %rem.i26 = srem i32 %sum.0.lcssa.i, 1046526 %add.i27 = add nsw i32 %rem.i26, 1 %conv5 = sext i32 %add.i27 to i64 %arrayidx29 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %conv2 %call630 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx29, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp31 = icmp eq i32 %call630, 0 br i1 %cmp31, label %cleanup, label %if.else while.cond: ; preds = %if.else %inc = add nuw nsw i64 %i.032, 1 %mul = mul nsw i64 %inc, %conv5 %add = add nsw i64 %mul, %conv2 %rem = srem i64 %add, 1046527 %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %rem %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %str) #10 %cmp = icmp eq i32 %call6, 0 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %getKey.exit, %while.cond %arrayidx33 = phi ptr [ %arrayidx, %while.cond ], [ %arrayidx29, %getKey.exit ] %i.032 = phi i64 [ %inc, %while.cond ], [ 0, %getKey.exit ] %char0 = load i8, ptr %arrayidx33, align 1 %cmp11 = icmp eq i8 %char0, 0 br i1 %cmp11, label %if.then13, label %while.cond if.then13: ; preds = %if.else %call16 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx33, ptr noundef nonnull dereferenceable(1) %str) #11 br label %cleanup cleanup: ; preds = %while.cond, %getKey.exit, %if.then13 %retval.0 = phi i32 [ 0, %if.then13 ], [ 1, %getKey.exit ], [ 1, %while.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i32, align 4 %str = alloca [14 x i8], align 1 %com = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #11 br label %for.body for.body: ; preds = %for.body.3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.3, %for.body.3 ] %arrayidx = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv store i8 0, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next store i8 0, ptr %arrayidx.1, align 2, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.1 store i8 0, ptr %arrayidx.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 1046527 br i1 %exitcond.not.2, label %for.end, label %for.body.3, !llvm.loop !10 for.body.3: ; preds = %for.body %arrayidx.3 = getelementptr inbounds [1046527 x [14 x i8]], ptr @H, i64 0, i64 %indvars.iv.next.2 store i8 0, ptr %arrayidx.3, align 2, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %for.body for.end: ; preds = %for.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %cmp328 = icmp sgt i32 %0, 0 br i1 %cmp328, label %for.body4, label %for.end21 for.body4: ; preds = %for.end, %for.inc19 %i.129 = phi i32 [ %inc20, %for.inc19 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str) %1 = load i8, ptr %com, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 105 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body4 %call11 = call i32 @insert(ptr noundef nonnull %str), !range !13 br label %for.inc19 if.else: ; preds = %for.body4 %call13 = call i32 @find(ptr noundef nonnull %str), !range !13 %tobool.not = icmp eq i32 %call13, 0 br i1 %tobool.not, label %if.else16, label %if.then14 if.then14: ; preds = %if.else %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %for.inc19 if.else16: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc19 for.inc19: ; preds = %if.then, %if.else16, %if.then14 %inc20 = add nuw nsw i32 %i.129, 1 %2 = load i32, ptr %n, align 4, !tbaa !11 %cmp3 = icmp slt i32 %inc20, %2 br i1 %cmp3, label %for.body4, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.inc19, %for.end call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #11 call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-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 } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = !{i32 0, i32 2} !14 = distinct !{!14, !9}
#include<stdio.h> int main() { char s[100005]; int n,k,a,b,i,j,p=0,fa=0,fb=0,ka,kb; scanf("%d%d%d%d",&n,&k,&a,&b); getchar(); s[n]='\0'; while((a!=0)||(b!=0)) { if(a>b) { i=0; if(fa==1) ka=k-1; else ka=k; while(i<ka&&a>=1) { s[p]='G'; p++; i++; a--; } fb=1; fa=0; if(a>=1&&b==0) { puts("NO"); return 0; } if(a>k&&b<=1) { puts("NO"); return 0; } if(b>=1) { b--; s[p]='B'; p++; } } else { i=0; if(fb==1) kb=k-1; else kb=k; while(i<kb&&b>=1) { s[p]='B'; p++; i++; b--; } if(b>=1&&a==0) { puts("NO"); return 0; } fb=0; fa=1; if(b>k&&a<=1) { puts("NO"); return 0; } if(a>=1) { a--; s[p]='G'; p++; } } if(p>=n) break; } if(p==n) puts(s); else puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24695/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24695/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"NO\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100005 x i8], align 16 %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) %1 = load i32, ptr %n, align 4, !tbaa !9 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %idxprom store i8 0, ptr %arrayidx, align 1, !tbaa !11 %a.promoted124 = load i32, ptr %a, align 4 %b.promoted128 = load i32, ptr %b, align 4 %2 = load i32, ptr %k, align 4 %3 = add i32 %2, -1 %b.promoted128.fr = freeze i32 %b.promoted128 %4 = add i32 %2, -1 %5 = add i32 %2, -1 br label %while.cond while.cond: ; preds = %if.end68, %entry %dec47.lcssa131 = phi i32 [ %b.promoted128.fr, %entry ], [ %dec47.lcssa129, %if.end68 ] %dec.lcssa127 = phi i32 [ %a.promoted124, %entry ], [ %dec.lcssa125, %if.end68 ] %p.0 = phi i32 [ 0, %entry ], [ %p.3, %if.end68 ] %fa.0 = phi i32 [ 0, %entry ], [ %fa.1, %if.end68 ] %fb.0 = phi i32 [ 0, %entry ], [ %fb.1, %if.end68 ] %dec47.lcssa131.fr = freeze i32 %dec47.lcssa131 %6 = or i32 %dec.lcssa127, %dec47.lcssa131.fr %.not = icmp eq i32 %6, 0 br i1 %.not, label %while.end72, label %while.body while.body: ; preds = %while.cond %cmp3 = icmp sgt i32 %dec.lcssa127, %dec47.lcssa131.fr br i1 %cmp3, label %if.then, label %if.else31 if.then: ; preds = %while.body %cmp4 = icmp eq i32 %fa.0, 1 %sub = sext i1 %cmp4 to i32 %ka.0 = add nsw i32 %2, %sub %cmp7116 = icmp sgt i32 %ka.0, 0 %cmp8117 = icmp sgt i32 %dec.lcssa127, 0 %7 = and i1 %cmp7116, %cmp8117 br i1 %7, label %while.body9.preheader, label %while.end while.body9.preheader: ; preds = %if.then %8 = sext i32 %p.0 to i64 %scevgep135 = getelementptr i8, ptr %s, i64 %8 %9 = add i32 %3, %sub %10 = add nsw i32 %dec.lcssa127, -1 %11 = call i32 @llvm.umin.i32(i32 %9, i32 %10) %umin136 = zext i32 %11 to i64 %12 = add nuw nsw i64 %umin136, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep135, i8 71, i64 %12, i1 false), !tbaa !11 %13 = add i32 %4, %sub %14 = add i32 %dec.lcssa127, -1 %umin145 = call i32 @llvm.umin.i32(i32 %13, i32 %14) %15 = add i32 %umin145, 1 %min.iters.check = icmp ult i32 %15, 4 br i1 %min.iters.check, label %while.body9.preheader174, label %vector.ph vector.ph: ; preds = %while.body9.preheader %n.vec = and i32 %15, -4 %ind.end = sub i32 %dec.lcssa127, %n.vec %16 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %8, i64 0 %17 = add i32 %dec.lcssa127, -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 <2 x i64> [ %16, %vector.ph ], [ %19, %vector.body ] %vec.phi147 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ] %18 = phi i32 [ %17, %vector.ph ], [ %21, %vector.body ] %19 = add <2 x i64> %vec.phi, <i64 1, i64 1> %20 = add <2 x i64> %vec.phi147, <i64 1, i64 1> %index.next = add nuw i32 %index, 4 %21 = add i32 %18, -4 %22 = icmp eq i32 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %23 = and i32 %18, -2 %24 = icmp ne i32 %23, 2 %bin.rdx = add <2 x i64> %20, %19 %25 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i32 %15, %n.vec br i1 %cmp.n, label %while.cond6.while.end_crit_edge, label %while.body9.preheader174 while.body9.preheader174: ; preds = %while.body9.preheader, %middle.block %indvars.iv137.ph = phi i64 [ %8, %while.body9.preheader ], [ %25, %middle.block ] %i.0119.ph = phi i32 [ 0, %while.body9.preheader ], [ %n.vec, %middle.block ] %dec115118.ph = phi i32 [ %dec.lcssa127, %while.body9.preheader ], [ %ind.end, %middle.block ] br label %while.body9 while.body9: ; preds = %while.body9.preheader174, %while.body9 %indvars.iv137 = phi i64 [ %indvars.iv.next138, %while.body9 ], [ %indvars.iv137.ph, %while.body9.preheader174 ] %i.0119 = phi i32 [ %inc12, %while.body9 ], [ %i.0119.ph, %while.body9.preheader174 ] %dec115118 = phi i32 [ %dec, %while.body9 ], [ %dec115118.ph, %while.body9.preheader174 ] %indvars.iv.next138 = add nsw i64 %indvars.iv137, 1 %inc12 = add nuw nsw i32 %i.0119, 1 %dec = add nsw i32 %dec115118, -1 %cmp7 = icmp slt i32 %inc12, %ka.0 %cmp8 = icmp ugt i32 %dec115118, 1 %26 = select i1 %cmp7, i1 %cmp8, i1 false br i1 %26, label %while.body9, label %while.cond6.while.end_crit_edge, !llvm.loop !16 while.cond6.while.end_crit_edge: ; preds = %while.body9, %middle.block %indvars.iv.next138.lcssa = phi i64 [ %25, %middle.block ], [ %indvars.iv.next138, %while.body9 ] %dec.lcssa = phi i32 [ %ind.end, %middle.block ], [ %dec, %while.body9 ] %cmp8.lcssa144 = phi i1 [ %24, %middle.block ], [ %cmp8, %while.body9 ] %27 = trunc i64 %indvars.iv.next138.lcssa to i32 store i32 %dec.lcssa, ptr %a, align 4, !tbaa !9 br label %while.end while.end: ; preds = %while.cond6.while.end_crit_edge, %if.then %dec.lcssa126 = phi i32 [ %dec.lcssa, %while.cond6.while.end_crit_edge ], [ %dec.lcssa127, %if.then ] %p.1.lcssa = phi i32 [ %27, %while.cond6.while.end_crit_edge ], [ %p.0, %if.then ] %cmp8.lcssa = phi i1 [ %cmp8.lcssa144, %while.cond6.while.end_crit_edge ], [ %cmp8117, %if.then ] %cmp14 = icmp eq i32 %dec47.lcssa131.fr, 0 %or.cond = and i1 %cmp8.lcssa, %cmp14 br i1 %or.cond, label %cleanup, label %if.end17 if.end17: ; preds = %while.end %cmp18 = icmp sgt i32 %dec.lcssa126, %2 %cmp20 = icmp slt i32 %dec47.lcssa131.fr, 2 %or.cond90 = and i1 %cmp18, %cmp20 br i1 %or.cond90, label %cleanup, label %if.end23 if.end23: ; preds = %if.end17 %cmp24 = icmp sgt i32 %dec47.lcssa131.fr, 0 br i1 %cmp24, label %if.then25, label %if.end68 if.then25: ; preds = %if.end23 %dec26 = add nsw i32 %dec47.lcssa131.fr, -1 store i32 %dec26, ptr %b, align 4, !tbaa !9 br label %if.end68.sink.split if.else31: ; preds = %while.body %cmp32 = icmp eq i32 %fb.0, 1 %sub34 = sext i1 %cmp32 to i32 %kb.0 = add nsw i32 %2, %sub34 %cmp38108 = icmp sgt i32 %kb.0, 0 %cmp40109 = icmp sgt i32 %dec47.lcssa131.fr, 0 %28 = and i1 %cmp38108, %cmp40109 br i1 %28, label %while.body42.preheader, label %while.end48 while.body42.preheader: ; preds = %if.else31 %29 = sext i32 %p.0 to i64 %scevgep = getelementptr i8, ptr %s, i64 %29 %30 = add nsw i32 %dec47.lcssa131.fr, -1 %31 = add i32 %3, %sub34 %32 = call i32 @llvm.umin.i32(i32 %30, i32 %31) %umin = zext i32 %32 to i64 %33 = add nuw nsw i64 %umin, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 66, i64 %33, i1 false), !tbaa !11 %34 = add i32 %dec47.lcssa131.fr, -1 %35 = add i32 %5, %sub34 %umin149 = call i32 @llvm.umin.i32(i32 %34, i32 %35) %36 = add i32 %umin149, 1 %min.iters.check152 = icmp ult i32 %36, 4 br i1 %min.iters.check152, label %while.body42.preheader175, label %vector.ph153 vector.ph153: ; preds = %while.body42.preheader %n.vec155 = and i32 %36, -4 %ind.end157 = sub i32 %dec47.lcssa131.fr, %n.vec155 %37 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %29, i64 0 %38 = add i32 %dec47.lcssa131.fr, -1 br label %vector.body160 vector.body160: ; preds = %vector.body160, %vector.ph153 %index161 = phi i32 [ 0, %vector.ph153 ], [ %index.next171, %vector.body160 ] %vec.phi162 = phi <2 x i64> [ %37, %vector.ph153 ], [ %40, %vector.body160 ] %vec.phi163 = phi <2 x i64> [ zeroinitializer, %vector.ph153 ], [ %41, %vector.body160 ] %39 = phi i32 [ %38, %vector.ph153 ], [ %42, %vector.body160 ] %40 = add <2 x i64> %vec.phi162, <i64 1, i64 1> %41 = add <2 x i64> %vec.phi163, <i64 1, i64 1> %index.next171 = add nuw i32 %index161, 4 %42 = add i32 %39, -4 %43 = icmp eq i32 %index.next171, %n.vec155 br i1 %43, label %middle.block150, label %vector.body160, !llvm.loop !17 middle.block150: ; preds = %vector.body160 %44 = and i32 %39, -2 %45 = icmp ne i32 %44, 2 %bin.rdx172 = add <2 x i64> %41, %40 %46 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx172) %cmp.n159 = icmp eq i32 %36, %n.vec155 br i1 %cmp.n159, label %while.cond37.while.end48_crit_edge, label %while.body42.preheader175 while.body42.preheader175: ; preds = %while.body42.preheader, %middle.block150 %indvars.iv.ph = phi i64 [ %29, %while.body42.preheader ], [ %46, %middle.block150 ] %i.1111.ph = phi i32 [ 0, %while.body42.preheader ], [ %n.vec155, %middle.block150 ] %dec47107110.ph = phi i32 [ %dec47.lcssa131.fr, %while.body42.preheader ], [ %ind.end157, %middle.block150 ] br label %while.body42 while.body42: ; preds = %while.body42.preheader175, %while.body42 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body42 ], [ %indvars.iv.ph, %while.body42.preheader175 ] %i.1111 = phi i32 [ %inc46, %while.body42 ], [ %i.1111.ph, %while.body42.preheader175 ] %dec47107110 = phi i32 [ %dec47, %while.body42 ], [ %dec47107110.ph, %while.body42.preheader175 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %inc46 = add nuw nsw i32 %i.1111, 1 %dec47 = add nsw i32 %dec47107110, -1 %cmp38 = icmp slt i32 %inc46, %kb.0 %cmp40 = icmp ugt i32 %dec47107110, 1 %47 = select i1 %cmp38, i1 %cmp40, i1 false br i1 %47, label %while.body42, label %while.cond37.while.end48_crit_edge, !llvm.loop !18 while.cond37.while.end48_crit_edge: ; preds = %while.body42, %middle.block150 %indvars.iv.next.lcssa = phi i64 [ %46, %middle.block150 ], [ %indvars.iv.next, %while.body42 ] %dec47.lcssa = phi i32 [ %ind.end157, %middle.block150 ], [ %dec47, %while.body42 ] %cmp40.lcssa143 = phi i1 [ %45, %middle.block150 ], [ %cmp40, %while.body42 ] %48 = trunc i64 %indvars.iv.next.lcssa to i32 store i32 %dec47.lcssa, ptr %b, align 4, !tbaa !9 br label %while.end48 while.end48: ; preds = %while.cond37.while.end48_crit_edge, %if.else31 %dec47.lcssa130 = phi i32 [ %dec47.lcssa, %while.cond37.while.end48_crit_edge ], [ %dec47.lcssa131.fr, %if.else31 ] %p.2.lcssa = phi i32 [ %48, %while.cond37.while.end48_crit_edge ], [ %p.0, %if.else31 ] %cmp40.lcssa = phi i1 [ %cmp40.lcssa143, %while.cond37.while.end48_crit_edge ], [ %cmp40109, %if.else31 ] %cmp51 = icmp eq i32 %dec.lcssa127, 0 %or.cond91 = and i1 %cmp51, %cmp40.lcssa br i1 %or.cond91, label %cleanup, label %if.end54 if.end54: ; preds = %while.end48 %cmp55 = icmp sgt i32 %dec47.lcssa130, %2 %cmp57 = icmp slt i32 %dec.lcssa127, 2 %or.cond92 = and i1 %cmp57, %cmp55 br i1 %or.cond92, label %cleanup, label %if.end60 if.end60: ; preds = %if.end54 %cmp61 = icmp sgt i32 %dec.lcssa127, 0 br i1 %cmp61, label %if.then62, label %if.end68 if.then62: ; preds = %if.end60 %dec63 = add nsw i32 %dec.lcssa127, -1 store i32 %dec63, ptr %a, align 4, !tbaa !9 br label %if.end68.sink.split if.end68.sink.split: ; preds = %if.then25, %if.then62 %p.2.lcssa.sink142 = phi i32 [ %p.2.lcssa, %if.then62 ], [ %p.1.lcssa, %if.then25 ] %.sink = phi i8 [ 71, %if.then62 ], [ 66, %if.then25 ] %dec47.lcssa129.ph = phi i32 [ %dec47.lcssa130, %if.then62 ], [ %dec26, %if.then25 ] %dec.lcssa125.ph = phi i32 [ %dec63, %if.then62 ], [ %dec.lcssa126, %if.then25 ] %fa.1.ph = phi i32 [ 1, %if.then62 ], [ 0, %if.then25 ] %fb.1.ph = phi i32 [ 0, %if.then62 ], [ 1, %if.then25 ] %idxprom64 = sext i32 %p.2.lcssa.sink142 to i64 %arrayidx65 = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %idxprom64 store i8 %.sink, ptr %arrayidx65, align 1, !tbaa !11 %inc66 = add nsw i32 %p.2.lcssa.sink142, 1 br label %if.end68 if.end68: ; preds = %if.end68.sink.split, %if.end60, %if.end23 %dec47.lcssa129 = phi i32 [ %dec47.lcssa131.fr, %if.end23 ], [ %dec47.lcssa130, %if.end60 ], [ %dec47.lcssa129.ph, %if.end68.sink.split ] %dec.lcssa125 = phi i32 [ %dec.lcssa126, %if.end23 ], [ %dec.lcssa127, %if.end60 ], [ %dec.lcssa125.ph, %if.end68.sink.split ] %p.3 = phi i32 [ %p.1.lcssa, %if.end23 ], [ %p.2.lcssa, %if.end60 ], [ %inc66, %if.end68.sink.split ] %fa.1 = phi i32 [ 0, %if.end23 ], [ 1, %if.end60 ], [ %fa.1.ph, %if.end68.sink.split ] %fb.1 = phi i32 [ 1, %if.end23 ], [ 0, %if.end60 ], [ %fb.1.ph, %if.end68.sink.split ] %cmp69.not = icmp slt i32 %p.3, %1 br i1 %cmp69.not, label %while.cond, label %while.end72, !llvm.loop !19 while.end72: ; preds = %if.end68, %while.cond %p.4 = phi i32 [ %p.3, %if.end68 ], [ %p.0, %while.cond ] %cmp73 = icmp eq i32 %p.4, %1 %s..str.1 = select i1 %cmp73, ptr %s, ptr @.str.1 br label %cleanup cleanup: ; preds = %if.end54, %while.end48, %if.end17, %while.end, %while.end72 %s.sink = phi ptr [ %s..str.1, %while.end72 ], [ @.str.1, %while.end ], [ @.str.1, %if.end17 ], [ @.str.1, %while.end48 ], [ @.str.1, %if.end54 ] %call75 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %s.sink) 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 %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 100005, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 ; Function Attrs: nofree nounwind declare noundef i32 @getc(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) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x 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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 = !{!7, !7, i64 0} !12 = distinct !{!12, !13, !14, !15} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !13, !15, !14} !17 = distinct !{!17, !13, !14, !15} !18 = distinct !{!18, !13, !15, !14} !19 = distinct !{!19, !13}
#include<stdio.h> #define ll long long int main() { int i,na,nb,m,k; int a[100000],b[100000]; scanf("%d%d%d%d",&na,&nb,&k,&m); for(i=0;i<na;i++) scanf("%d",&a[i]); for(i=0;i<nb;i++) scanf("%d",&b[i]); if(a[k-1]<b[nb-m]) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2470/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2470/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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: %na = alloca i32, align 4 %nb = alloca i32, align 4 %m = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [100000 x i32], align 16 %b = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %na) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nb) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %na, ptr noundef nonnull %nb, ptr noundef nonnull %k, ptr noundef nonnull %m) %0 = load i32, ptr %na, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %nb, align 4, !tbaa !5 %cmp327 = icmp sgt i32 %1, 0 br i1 %cmp327, label %for.body4, label %for.end10 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %na, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100000 x i32], ptr %b, i64 0, i64 %indvars.iv31 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1 %4 = load i32, ptr %nb, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp3 = icmp slt i64 %indvars.iv.next32, %5 br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.body4, %for.cond2.preheader %.lcssa = phi i32 [ %1, %for.cond2.preheader ], [ %4, %for.body4 ] %6 = load i32, ptr %k, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %idxprom11 = sext i32 %sub to i64 %arrayidx12 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %idxprom11 %7 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %8 = load i32, ptr %m, align 4, !tbaa !5 %sub13 = sub nsw i32 %.lcssa, %8 %idxprom14 = sext i32 %sub13 to i64 %arrayidx15 = getelementptr inbounds [100000 x i32], ptr %b, i64 0, i64 %idxprom14 %9 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp slt i32 %7, %9 %str.4.str = select i1 %cmp16, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nb) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %na) #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}
#include <stdio.h> int min3(int, int, int); int main(void) { int l, a, p; int sum; while (~scanf("%d%d%d", &l, &a, &p)) { p /= 4; a /= 2; sum = 7 * min3(l, a, p); printf("%d\n", sum); } return 0; } int min3(int a, int b, int c) { int m; m = (a < b) ? a : b; m = (m < c) ? m : c; return m; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24705/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24705/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i32, align 4 %a = alloca i32, align 4 %p = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %a, ptr noundef nonnull %p) %tobool.not5 = icmp eq i32 %call4, -1 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %p, align 4, !tbaa !5 %div = sdiv i32 %0, 4 store i32 %div, ptr %p, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %div1 = sdiv i32 %1, 2 store i32 %div1, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %l, align 4, !tbaa !5 %cond.i = call i32 @llvm.smin.i32(i32 %2, i32 %div1) %cond5.i = call i32 @llvm.smin.i32(i32 %cond.i, i32 %div) %mul = mul nsw i32 %cond5.i, 7 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %a, ptr noundef nonnull %p) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min3(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #3 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %cond5 = tail call i32 @llvm.smin.i32(i32 %cond, i32 %c) ret i32 %cond5 } ; 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) #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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int min(int a, int b){ return(a < b ? a : b); } int main(void) { int a, b, c; scanf("%d%d%d", &a, &b, &c); int x = min(min(a, b/2), c/4); printf("%d", x*7); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24710/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %1, 2 %cond.i = call i32 @llvm.smin.i32(i32 %0, i32 %div) %2 = load i32, ptr %c, align 4, !tbaa !5 %div2 = sdiv i32 %2, 4 %cond.i5 = call i32 @llvm.smin.i32(i32 %cond.i, i32 %div2) %mul = mul nsw i32 %cond.i5, 7 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<string.h> #include<stdbool.h> #include<math.h> #include<stdlib.h> #include <stdio.h> #include<ctype.h> int compare(const void *p,const void *q){ return *(int *)p - *(int *)q; } int main(int argc, char *argv[]) { int n; scanf("%d",&n); int say[n+1]; for(int i=0;i<n;i++) scanf("%d",say+i); qsort(say,n,sizeof(int),compare); int last = -1,count =0; for(int i=0;i<n;i++) if(say[i]!=last){ count ++; last=say[i]; } else{ count--; last=-1; } printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247150/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247150/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 { entry: %0 = load i32, ptr %p, align 4, !tbaa !5 %1 = load i32, ptr %q, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %3, 0 br i1 %cmp25, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %7, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp427 = icmp sgt i32 %4, 0 br i1 %cmp427, label %for.body7.preheader, label %for.cond.cleanup6 for.body7.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 3 %5 = icmp ult i32 %4, 4 br i1 %5, label %for.cond.cleanup6.loopexit.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup6.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader %count.1.lcssa.ph = phi i32 [ undef, %for.body7.preheader ], [ %count.1.3, %for.body7 ] %indvars.iv34.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next35.3, %for.body7 ] %count.029.unr = phi i32 [ 0, %for.body7.preheader ], [ %count.1.3, %for.body7 ] %last.028.unr = phi i32 [ -1, %for.body7.preheader ], [ %last.1.3, %for.body7 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup6, label %for.body7.epil for.body7.epil: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa, %for.body7.epil %indvars.iv34.epil = phi i64 [ %indvars.iv.next35.epil, %for.body7.epil ], [ %indvars.iv34.unr, %for.cond.cleanup6.loopexit.unr-lcssa ] %count.029.epil = phi i32 [ %count.1.epil, %for.body7.epil ], [ %count.029.unr, %for.cond.cleanup6.loopexit.unr-lcssa ] %last.028.epil = phi i32 [ %last.1.epil, %for.body7.epil ], [ %last.028.unr, %for.cond.cleanup6.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.cond.cleanup6.loopexit.unr-lcssa ] %arrayidx.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv34.epil %8 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp8.not.epil = icmp eq i32 %8, %last.028.epil %last.1.epil = select i1 %cmp8.not.epil, i32 -1, i32 %8 %count.1.v.epil = select i1 %cmp8.not.epil, i32 -1, i32 1 %count.1.epil = add nsw i32 %count.1.v.epil, %count.029.epil %indvars.iv.next35.epil = add nuw nsw i64 %indvars.iv34.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.cond.cleanup6, label %for.body7.epil, !llvm.loop !11 for.cond.cleanup6: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa, %for.body7.epil, %for.cond.cleanup %count.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %count.1.lcssa.ph, %for.cond.cleanup6.loopexit.unr-lcssa ], [ %count.1.epil, %for.body7.epil ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body7: ; preds = %for.body7, %for.body7.preheader.new %indvars.iv34 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next35.3, %for.body7 ] %count.029 = phi i32 [ 0, %for.body7.preheader.new ], [ %count.1.3, %for.body7 ] %last.028 = phi i32 [ -1, %for.body7.preheader.new ], [ %last.1.3, %for.body7 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv34 %9 = load i32, ptr %arrayidx, align 16, !tbaa !5 %cmp8.not = icmp eq i32 %9, %last.028 %last.1 = select i1 %cmp8.not, i32 -1, i32 %9 %count.1.v = select i1 %cmp8.not, i32 -1, i32 1 %count.1 = add nsw i32 %count.1.v, %count.029 %indvars.iv.next35 = or i64 %indvars.iv34, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35 %10 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp8.not.1 = icmp eq i32 %10, %last.1 %last.1.1 = select i1 %cmp8.not.1, i32 -1, i32 %10 %count.1.v.1 = select i1 %cmp8.not.1, i32 -1, i32 1 %count.1.1 = add nsw i32 %count.1.v.1, %count.1 %indvars.iv.next35.1 = or i64 %indvars.iv34, 2 %arrayidx.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35.1 %11 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %cmp8.not.2 = icmp eq i32 %11, %last.1.1 %last.1.2 = select i1 %cmp8.not.2, i32 -1, i32 %11 %count.1.v.2 = select i1 %cmp8.not.2, i32 -1, i32 1 %count.1.2 = add nsw i32 %count.1.v.2, %count.1.1 %indvars.iv.next35.2 = or i64 %indvars.iv34, 3 %arrayidx.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35.2 %12 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %cmp8.not.3 = icmp eq i32 %12, %last.1.2 %last.1.3 = select i1 %cmp8.not.3, i32 -1, i32 %12 %count.1.v.3 = select i1 %cmp8.not.3, i32 -1, i32 1 %count.1.3 = add nsw i32 %count.1.v.3, %count.1.2 %indvars.iv.next35.3 = add nuw nsw i64 %indvars.iv34, 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.cond.cleanup6.loopexit.unr-lcssa, label %for.body7, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> static int cmp(const void *a, const void *b); int main(int argc, char *argv[]) { int i, N, t = 0, n = 0; long long list[100000] = {0LL}, l; scanf("%d", &N); for ( i = 0; i < N; i++ ){ scanf("%lld", &list[i]); } qsort(list, N, sizeof(long long), cmp); l = list[0]; n = 1; for ( i = 1; i < N; i++ ){ if ( l == list[i] ){ n++; } else { if ( n%2 == 1 ){ t++; } l = list[i]; n = 1; } } if ( n%2 == 1 ){ t++; } printf("%d\n", t); return 0; } static int cmp(const void *a, const void *b) { return ( *((long long *)a) - *((long long *)b)) ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247200/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247200/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %list = alloca [100000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %list) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %list, i8 0, i64 800000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i64], ptr %list, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ] call void @qsort(ptr noundef nonnull %list, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @cmp) #6 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp442 = icmp sgt i32 %3, 1 br i1 %cmp442, label %for.body6.preheader, label %for.end21 for.body6.preheader: ; preds = %for.end %4 = load i64, ptr %list, align 16, !tbaa !11 %wide.trip.count = zext i32 %3 to i64 %5 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %5, 1 %6 = icmp eq i32 %3, 2 br i1 %6, label %for.end21.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %5, -2 br label %for.body6 for.body6: ; preds = %for.inc19.1, %for.body6.preheader.new %indvars.iv51 = phi i64 [ 1, %for.body6.preheader.new ], [ %indvars.iv.next52.1, %for.inc19.1 ] %l.046 = phi i64 [ %4, %for.body6.preheader.new ], [ %l.1.1, %for.inc19.1 ] %n.045 = phi i32 [ 1, %for.body6.preheader.new ], [ %n.1.1, %for.inc19.1 ] %t.044 = phi i32 [ 0, %for.body6.preheader.new ], [ %t.2.1, %for.inc19.1 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc19.1 ] %arrayidx8 = getelementptr inbounds [100000 x i64], ptr %list, i64 0, i64 %indvars.iv51 %7 = load i64, ptr %arrayidx8, align 8, !tbaa !11 %cmp9 = icmp eq i64 %l.046, %7 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %for.body6 %inc11 = add nsw i32 %n.045, 1 br label %for.inc19 if.else: ; preds = %for.body6 %8 = and i32 %n.045, -2147483647 %cmp12 = icmp eq i32 %8, 1 %inc15 = zext i1 %cmp12 to i32 %spec.select = add nsw i32 %t.044, %inc15 br label %for.inc19 for.inc19: ; preds = %if.then, %if.else %t.2 = phi i32 [ %t.044, %if.then ], [ %spec.select, %if.else ] %n.1 = phi i32 [ %inc11, %if.then ], [ 1, %if.else ] %l.1 = phi i64 [ %l.046, %if.then ], [ %7, %if.else ] %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %arrayidx8.1 = getelementptr inbounds [100000 x i64], ptr %list, i64 0, i64 %indvars.iv.next52 %9 = load i64, ptr %arrayidx8.1, align 8, !tbaa !11 %cmp9.1 = icmp eq i64 %l.1, %9 br i1 %cmp9.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc19 %10 = and i32 %n.1, -2147483647 %cmp12.1 = icmp eq i32 %10, 1 %inc15.1 = zext i1 %cmp12.1 to i32 %spec.select.1 = add nsw i32 %t.2, %inc15.1 br label %for.inc19.1 if.then.1: ; preds = %for.inc19 %inc11.1 = add nsw i32 %n.1, 1 br label %for.inc19.1 for.inc19.1: ; preds = %if.then.1, %if.else.1 %t.2.1 = phi i32 [ %t.2, %if.then.1 ], [ %spec.select.1, %if.else.1 ] %n.1.1 = phi i32 [ %inc11.1, %if.then.1 ], [ 1, %if.else.1 ] %l.1.1 = phi i64 [ %l.1, %if.then.1 ], [ %9, %if.else.1 ] %indvars.iv.next52.1 = add nuw nsw i64 %indvars.iv51, 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.end21.loopexit.unr-lcssa, label %for.body6, !llvm.loop !13 for.end21.loopexit.unr-lcssa: ; preds = %for.inc19.1, %for.body6.preheader %t.2.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %t.2.1, %for.inc19.1 ] %n.1.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %n.1.1, %for.inc19.1 ] %indvars.iv51.unr = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next52.1, %for.inc19.1 ] %l.046.unr = phi i64 [ %4, %for.body6.preheader ], [ %l.1.1, %for.inc19.1 ] %n.045.unr = phi i32 [ 1, %for.body6.preheader ], [ %n.1.1, %for.inc19.1 ] %t.044.unr = phi i32 [ 0, %for.body6.preheader ], [ %t.2.1, %for.inc19.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end21.loopexit, label %for.body6.epil for.body6.epil: ; preds = %for.end21.loopexit.unr-lcssa %arrayidx8.epil = getelementptr inbounds [100000 x i64], ptr %list, i64 0, i64 %indvars.iv51.unr %11 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !11 %cmp9.epil = icmp eq i64 %l.046.unr, %11 br i1 %cmp9.epil, label %if.then.epil, label %if.else.epil if.else.epil: ; preds = %for.body6.epil %12 = and i32 %n.045.unr, -2147483647 %cmp12.epil = icmp eq i32 %12, 1 %inc15.epil = zext i1 %cmp12.epil to i32 %spec.select.epil = add nsw i32 %t.044.unr, %inc15.epil br label %for.end21.loopexit if.then.epil: ; preds = %for.body6.epil %inc11.epil = add nsw i32 %n.045.unr, 1 br label %for.end21.loopexit for.end21.loopexit: ; preds = %if.else.epil, %if.then.epil, %for.end21.loopexit.unr-lcssa %t.2.lcssa = phi i32 [ %t.2.lcssa.ph, %for.end21.loopexit.unr-lcssa ], [ %t.044.unr, %if.then.epil ], [ %spec.select.epil, %if.else.epil ] %n.1.lcssa = phi i32 [ %n.1.lcssa.ph, %for.end21.loopexit.unr-lcssa ], [ %inc11.epil, %if.then.epil ], [ 1, %if.else.epil ] %13 = and i32 %n.1.lcssa, -2147483647 %14 = icmp eq i32 %13, 1 %15 = zext i1 %14 to i32 %16 = add nsw i32 %t.2.lcssa, %15 br label %for.end21 for.end21: ; preds = %for.end21.loopexit, %for.end %spec.select39 = phi i32 [ 1, %for.end ], [ %16, %for.end21.loopexit ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select39) call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %list) #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: 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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define internal i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 { entry: %0 = load i64, ptr %a, align 8, !tbaa !11 %1 = load i64, ptr %b, align 8, !tbaa !11 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; 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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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 long", !7, i64 0} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void){ while(1){ int n; scanf("%d",&n); if(n==0)return 0; int i=0,sum=0; while(i<n/4){ i++; int a; scanf("%d",&a); sum+=a; } printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247244/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247244/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not14 = icmp eq i32 %0, 0 br i1 %cmp.not14, label %cleanup.thread, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %4, %cleanup ], [ %0, %entry ] %cmp210 = icmp sgt i32 %1, 3 br i1 %cmp210, label %while.body3, label %cleanup cleanup.thread: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 while.body3: ; preds = %while.cond1.preheader, %while.body3 %sum.012 = phi i32 [ %add, %while.body3 ], [ 0, %while.cond1.preheader ] %i.011 = phi i32 [ %inc, %while.body3 ], [ 0, %while.cond1.preheader ] %inc = add nuw nsw i32 %i.011, 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %2, %sum.012 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 %3 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %3, 4 %cmp2 = icmp slt i32 %inc, %div br i1 %cmp2, label %while.body3, label %cleanup, !llvm.loop !9 cleanup: ; preds = %while.body3, %while.cond1.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond1.preheader ], [ %add, %while.body3 ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 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) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not = icmp eq i32 %4, 0 br i1 %cmp.not, label %cleanup.thread, label %while.cond1.preheader } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int n,i,m,z; while(1){ scanf("%d",&n); if(n==0){ break; } z=0; for(i=0;i<n/4;i++){ scanf("%d",&m); z+=m; } printf("%d\n",z); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247309/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247309/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp11 = icmp eq i32 %0, 0 br i1 %cmp11, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %4, %for.end ], [ %0, %entry ] %cmp17 = icmp sgt i32 %1, 3 br i1 %cmp17, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %z.09 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load i32, ptr %m, align 4, !tbaa !5 %add = add nsw i32 %2, %z.09 %inc = add nuw nsw i32 %i.08, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %3, 4 %cmp1 = icmp slt i32 %inc, %div br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %z.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %z.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %4, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #define lop(i, n) for(i=0; i<n; i++) int compare_int(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main() { int n, i; scanf("%d", &n); int A[n]; lop(i, n){ scanf("%d", &A[i]); } qsort(A, n, sizeof(int), compare_int); for(i=0; i<n-1; i++){ if(A[i]==A[i+1]){ printf("NO"); return 0; } } printf("YES"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247352/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247352/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %3, 0 br i1 %cmp25, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #7 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = call i32 @llvm.smax.i32(i32 %6, i32 1) %smax = add nsw i32 %7, -1 %wide.trip.count = zext i32 %smax to i64 br label %for.cond2 for.cond2: ; preds = %for.body5, %for.end %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body5 ], [ 0, %for.end ] %exitcond.not = icmp eq i64 %indvars.iv29, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body5 for.body5: ; preds = %for.cond2 %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv29 %8 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next30 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %8, %9 br i1 %cmp10, label %cleanup, label %for.cond2, !llvm.loop !11 cleanup: ; preds = %for.cond2, %for.body5 %.str.2.sink = phi ptr [ @.str.1, %for.body5 ], [ @.str.2, %for.cond2 ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> void q_sort(long numbers[], int left, int right); int main(void){ int j,N,K,i,min; long A[200000]={}; long ans; if(scanf("%d",&N)>1){ exit(0); } for(i=0;i<N;i++){ if(scanf("%ld",&A[i])>1){ exit(0); } } q_sort(A,0,N-1); for(i=0;i<N;i++){ if(A[i]==A[i+1]){ printf("NO"); goto out; } if(i==N-1){ printf("YES"); } } out: return 0; } void q_sort(long numbers[], int left, int right) { int l_hold, r_hold; long pivot,pa; l_hold = left; r_hold = right; pivot = numbers[left]; while (left < right) { while ((numbers[right] >= pivot) && (left < right)) right--; if (left != right) { numbers[left] = numbers[right]; left++; } while ((numbers[left] <= pivot) && (left < right)) left++; if (left != right) { numbers[right] = numbers[left]; right--; } } numbers[left] = pivot; pivot = left; left = l_hold; right = r_hold; if (left < pivot) q_sort(numbers, left, pivot-1); if (right > pivot) q_sort(numbers, pivot+1, right); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247402/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247402/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [200000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %A) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600000) %A, i8 0, i64 1600000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp = icmp sgt i32 %call, 1 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp134 = icmp sgt i32 %0, 0 br i1 %cmp134, label %for.body, label %for.end.thread for.end.thread: ; preds = %for.cond.preheader %sub43 = add nsw i32 %0, -1 call void @q_sort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub43) br label %out if.then: ; preds = %entry call void @exit(i32 noundef 0) #7 unreachable for.cond: ; preds = %for.body %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 %cmp1 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.body: ; preds = %for.cond.preheader, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %cmp3 = icmp sgt i32 %call2, 1 br i1 %cmp3, label %if.then4, label %for.cond if.then4: ; preds = %for.body call void @exit(i32 noundef 0) #7 unreachable for.end: ; preds = %for.cond %sub = add nsw i32 %1, -1 call void @q_sort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub) %cmp736 = icmp sgt i32 %1, 0 br i1 %cmp736, label %for.body8, label %out for.body8: ; preds = %for.end, %for.inc22 %3 = phi i32 [ %7, %for.inc22 ], [ %1, %for.end ] %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.inc22 ], [ 0, %for.end ] %arrayidx10 = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %indvars.iv40 %4 = load i64, ptr %arrayidx10, align 8, !tbaa !11 %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %arrayidx12 = getelementptr inbounds [200000 x i64], ptr %A, i64 0, i64 %indvars.iv.next41 %5 = load i64, ptr %arrayidx12, align 8, !tbaa !11 %cmp13 = icmp eq i64 %4, %5 br i1 %cmp13, label %if.then14, label %if.end16 if.then14: ; preds = %for.body8 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %out if.end16: ; preds = %for.body8 %sub17 = add nsw i32 %3, -1 %6 = zext i32 %sub17 to i64 %cmp18 = icmp eq i64 %indvars.iv40, %6 br i1 %cmp18, label %if.then19, label %for.inc22 if.then19: ; preds = %if.end16 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %if.end16, %if.then19 %7 = phi i32 [ %3, %if.end16 ], [ %.pre, %if.then19 ] %8 = sext i32 %7 to i64 %cmp7 = icmp slt i64 %indvars.iv.next41, %8 br i1 %cmp7, label %for.body8, label %out, !llvm.loop !13 out: ; preds = %for.inc22, %for.end.thread, %for.end, %if.then14 call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %A) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @q_sort(ptr nocapture noundef %numbers, i32 noundef %left, i32 noundef %right) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end38, %entry %left.tr = phi i32 [ %left, %entry ], [ %add, %if.end38 ] %idxprom = sext i32 %left.tr to i64 %arrayidx = getelementptr inbounds i64, ptr %numbers, i64 %idxprom %0 = load i64, ptr %arrayidx, align 8, !tbaa !11 %cmp88 = icmp slt i32 %left.tr, %right br i1 %cmp88, label %while.cond1.preheader, label %while.end30.thread while.end30.thread: ; preds = %tailrecurse %arrayidx32100 = getelementptr inbounds i64, ptr %numbers, i64 %idxprom store i64 %0, ptr %arrayidx32100, align 8, !tbaa !11 br label %if.end38 while.cond1.preheader: ; preds = %tailrecurse, %if.end29 %left.addr.090 = phi i32 [ %9, %if.end29 ], [ %left.tr, %tailrecurse ] %right.addr.089 = phi i32 [ %right.addr.2, %if.end29 ], [ %right, %tailrecurse ] %1 = sext i32 %right.addr.089 to i64 %2 = sext i32 %left.addr.090 to i64 br label %while.cond1 while.cond1: ; preds = %while.cond1, %while.cond1.preheader %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond1 ], [ %1, %while.cond1.preheader ] %arrayidx3 = getelementptr inbounds i64, ptr %numbers, i64 %indvars.iv %3 = load i64, ptr %arrayidx3, align 8, !tbaa !11 %cmp4 = icmp sge i64 %3, %0 %cmp5 = icmp sgt i64 %indvars.iv, %2 %4 = and i1 %cmp5, %cmp4 %indvars.iv.next = add nsw i64 %indvars.iv, -1 br i1 %4, label %while.cond1, label %while.end, !llvm.loop !14 while.end: ; preds = %while.cond1 %arrayidx3.le = getelementptr inbounds i64, ptr %numbers, i64 %indvars.iv %5 = trunc i64 %indvars.iv to i32 %cmp7.not = icmp eq i32 %left.addr.090, %5 br i1 %cmp7.not, label %if.end, label %if.then if.then: ; preds = %while.end %arrayidx11 = getelementptr inbounds i64, ptr %numbers, i64 %2 store i64 %3, ptr %arrayidx11, align 8, !tbaa !11 %inc = add nsw i32 %left.addr.090, 1 %.pre = sext i32 %inc to i64 br label %if.end if.end: ; preds = %if.then, %while.end %.pre-phi = phi i64 [ %.pre, %if.then ], [ %2, %while.end ] %sext = shl i64 %indvars.iv, 32 %6 = ashr exact i64 %sext, 32 br label %while.cond12 while.cond12: ; preds = %while.cond12, %if.end %indvars.iv93 = phi i64 [ %indvars.iv.next94, %while.cond12 ], [ %.pre-phi, %if.end ] %arrayidx14 = getelementptr inbounds i64, ptr %numbers, i64 %indvars.iv93 %7 = load i64, ptr %arrayidx14, align 8, !tbaa !11 %cmp15 = icmp sle i64 %7, %0 %cmp17 = icmp slt i64 %indvars.iv93, %6 %8 = and i1 %cmp17, %cmp15 %indvars.iv.next94 = add nsw i64 %indvars.iv93, 1 br i1 %8, label %while.cond12, label %while.end21, !llvm.loop !15 while.end21: ; preds = %while.cond12 %9 = trunc i64 %indvars.iv93 to i32 %cmp22.not = icmp eq i32 %9, %5 br i1 %cmp22.not, label %if.end29, label %if.then23 if.then23: ; preds = %while.end21 store i64 %7, ptr %arrayidx3.le, align 8, !tbaa !11 %dec28 = add nsw i32 %5, -1 br label %if.end29 if.end29: ; preds = %if.then23, %while.end21 %right.addr.2 = phi i32 [ %dec28, %if.then23 ], [ %5, %while.end21 ] %cmp = icmp sgt i32 %right.addr.2, %9 br i1 %cmp, label %while.cond1.preheader, label %while.end30, !llvm.loop !16 while.end30: ; preds = %if.end29 %sext97 = shl i64 %indvars.iv93, 32 %.pre96 = ashr exact i64 %sext97, 32 %arrayidx32 = getelementptr inbounds i64, ptr %numbers, i64 %.pre96 store i64 %0, ptr %arrayidx32, align 8, !tbaa !11 %cmp34 = icmp slt i32 %left.tr, %9 br i1 %cmp34, label %if.then36, label %if.end38 if.then36: ; preds = %while.end30 %sub = add nsw i32 %9, -1 tail call void @q_sort(ptr noundef nonnull %numbers, i32 noundef %left.tr, i32 noundef %sub) br label %if.end38 if.end38: ; preds = %while.end30.thread, %if.then36, %while.end30 %left.addr.0.lcssa102 = phi i32 [ %left.tr, %while.end30.thread ], [ %9, %if.then36 ], [ %9, %while.end30 ] %cmp40 = icmp slt i32 %left.addr.0.lcssa102, %right %add = add nsw i32 %left.addr.0.lcssa102, 1 br i1 %cmp40, label %tailrecurse, label %if.end44 if.end44: ; preds = %if.end38 ret void } ; 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } attributes #7 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include<stdio.h> void merge_sort(int array[],int left,int right){ int i,j,k,mid; int work[200000]; if(left < right){ mid = (left + right)/2; merge_sort(array,left,mid); merge_sort(array,mid+1,right); for(i=mid; i>= left;i--){work[i] = array[i];} for(j=mid+1; j<=right; j++){ work[right-(j-(mid+1))] = array[j]; } i = left; j = right; for(k=left; k<=right; k++){ if(work[i] < work[j]){array[k] = work[i++];} else{array[k] = work[j--];} } } } int main(void){ int array[200000]; int a,n,i; a = 0; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&array[i]); } merge_sort(array,0,n-1); for(i=0;i<n-1;i++){ if(array[i] == array[i+1]){ printf("NO"); a = 1; break; } } if(a == 0) printf("YES"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247446/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247446/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @merge_sort(ptr noundef %array, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %work = alloca [200000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %work) #6 %cmp = icmp slt i32 %left, %right br i1 %cmp, label %if.then, label %if.end39 if.then: ; preds = %entry %add = add nsw i32 %right, %left %div = sdiv i32 %add, 2 tail call void @merge_sort(ptr noundef %array, i32 noundef %left, i32 noundef %div) %add1 = add nsw i32 %div, 1 tail call void @merge_sort(ptr noundef %array, i32 noundef %add1, i32 noundef %right) %cmp2.not74 = icmp slt i32 %div, %left br i1 %cmp2.not74, label %for.cond6.preheader, label %for.body.preheader for.body.preheader: ; preds = %if.then %0 = sext i32 %div to i64 %1 = sub i32 %div, %left %2 = zext i32 %1 to i64 %3 = shl nuw nsw i64 %2, 2 %4 = sub nsw i64 %0, %2 %5 = shl nsw i64 %4, 2 %scevgep = getelementptr i8, ptr %work, i64 %5 %scevgep82 = getelementptr i8, ptr %array, i64 %5 %6 = add nuw nsw i64 %3, 4 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, ptr noundef nonnull align 4 dereferenceable(1) %scevgep82, i64 %6, i1 false), !tbaa !5 br label %for.cond6.preheader for.cond6.preheader: ; preds = %for.body.preheader, %if.then %cmp7.not76.not = icmp slt i32 %div, %right br i1 %cmp7.not76.not, label %for.body8.lr.ph, label %for.cond17.preheader for.body8.lr.ph: ; preds = %for.cond6.preheader %sub.neg = add i32 %add1, %right %narrow = add nsw i32 %div, 1 %7 = sext i32 %narrow to i64 %8 = add i32 %right, 1 %9 = xor i32 %div, -1 %10 = add i32 %9, %right %11 = zext i32 %10 to i64 %12 = add nuw nsw i64 %11, 1 %min.iters.check = icmp ugt i32 %10, 10 br i1 %min.iters.check, label %vector.ph, label %for.body8.preheader vector.ph: ; preds = %for.body8.lr.ph %n.vec = and i64 %12, 8589934584 %ind.end = add nsw i64 %n.vec, %7 %invariant.gep = getelementptr i32, ptr %array, i64 %7 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %13 = trunc i64 %index to i32 %14 = add i32 %narrow, %13 %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %15 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load91 = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = sub i32 %sub.neg, %14 %17 = sext i32 %16 to i64 %18 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %17 %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %19 = getelementptr inbounds i32, ptr %18, i64 -3 store <4 x i32> %reverse, ptr %19, align 4, !tbaa !5 %reverse92 = shufflevector <4 x i32> %wide.load91, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %20 = getelementptr inbounds i32, ptr %18, i64 -7 store <4 x i32> %reverse92, ptr %20, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %for.cond17.preheader, label %for.body8.preheader for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ %7, %for.body8.lr.ph ], [ %ind.end, %middle.block ] %22 = add i32 %right, 1 %23 = trunc i64 %indvars.iv.ph to i32 %24 = sub i32 %22, %23 %25 = sub i32 %right, %23 %xtraiter = and i32 %24, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body8.prol.loopexit, label %for.body8.prol for.body8.prol: ; preds = %for.body8.preheader, %for.body8.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body8.prol ], [ %indvars.iv.ph, %for.body8.preheader ] %prol.iter = phi i32 [ %prol.iter.next, %for.body8.prol ], [ 0, %for.body8.preheader ] %arrayidx10.prol = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.prol %26 = load i32, ptr %arrayidx10.prol, align 4, !tbaa !5 %27 = trunc i64 %indvars.iv.prol to i32 %sub12.prol = sub i32 %sub.neg, %27 %idxprom13.prol = sext i32 %sub12.prol to i64 %arrayidx14.prol = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom13.prol store i32 %26, ptr %arrayidx14.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body8.prol.loopexit, label %for.body8.prol, !llvm.loop !13 for.body8.prol.loopexit: ; preds = %for.body8.prol, %for.body8.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body8.preheader ], [ %indvars.iv.next.prol, %for.body8.prol ] %28 = icmp ult i32 %25, 3 br i1 %28, label %for.cond17.preheader, label %for.body8 for.cond17.preheader: ; preds = %for.body8.prol.loopexit, %for.body8, %middle.block, %for.cond6.preheader %cmp18.not78 = icmp sgt i32 %left, %right br i1 %cmp18.not78, label %if.end39, label %for.body19.preheader for.body19.preheader: ; preds = %for.cond17.preheader %29 = sext i32 %left to i64 %30 = add i32 %right, 1 br label %for.body19 for.body8: ; preds = %for.body8.prol.loopexit, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body8 ], [ %indvars.iv.unr, %for.body8.prol.loopexit ] %arrayidx10 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %31 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %32 = trunc i64 %indvars.iv to i32 %sub12 = sub i32 %sub.neg, %32 %idxprom13 = sext i32 %sub12 to i64 %arrayidx14 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom13 store i32 %31, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx10.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %33 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %34 = trunc i64 %indvars.iv.next to i32 %sub12.1 = sub i32 %sub.neg, %34 %idxprom13.1 = sext i32 %sub12.1 to i64 %arrayidx14.1 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom13.1 store i32 %33, ptr %arrayidx14.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %arrayidx10.2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.1 %35 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %36 = trunc i64 %indvars.iv.next.1 to i32 %sub12.2 = sub i32 %sub.neg, %36 %idxprom13.2 = sext i32 %sub12.2 to i64 %arrayidx14.2 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom13.2 store i32 %35, ptr %arrayidx14.2, align 4, !tbaa !5 %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3 %arrayidx10.3 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.2 %37 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %38 = trunc i64 %indvars.iv.next.2 to i32 %sub12.3 = sub i32 %sub.neg, %38 %idxprom13.3 = sext i32 %sub12.3 to i64 %arrayidx14.3 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom13.3 store i32 %37, ptr %arrayidx14.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4 %lftr.wideiv.3 = trunc i64 %indvars.iv.next.3 to i32 %exitcond.not.3 = icmp eq i32 %8, %lftr.wideiv.3 br i1 %exitcond.not.3, label %for.cond17.preheader, label %for.body8, !llvm.loop !15 for.body19: ; preds = %for.body19.preheader, %for.body19 %indvars.iv85 = phi i64 [ %29, %for.body19.preheader ], [ %indvars.iv.next86, %for.body19 ] %i.181 = phi i32 [ %left, %for.body19.preheader ], [ %i.2, %for.body19 ] %j.179 = phi i32 [ %right, %for.body19.preheader ], [ %j.2, %for.body19 ] %idxprom20 = sext i32 %i.181 to i64 %arrayidx21 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom20 %39 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %idxprom22 = sext i32 %j.179 to i64 %arrayidx23 = getelementptr inbounds [200000 x i32], ptr %work, i64 0, i64 %idxprom22 %40 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp sge i32 %39, %40 %.sink = tail call i32 @llvm.smin.i32(i32 %39, i32 %40) %dec31 = sext i1 %cmp24 to i32 %j.2 = add nsw i32 %j.179, %dec31 %not.cmp24 = xor i1 %cmp24, true %inc26 = zext i1 %not.cmp24 to i32 %i.2 = add nsw i32 %i.181, %inc26 %41 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv85 store i32 %.sink, ptr %41, align 4 %indvars.iv.next86 = add nsw i64 %indvars.iv85, 1 %lftr.wideiv88 = trunc i64 %indvars.iv.next86 to i32 %exitcond89.not = icmp eq i32 %30, %lftr.wideiv88 br i1 %exitcond89.not, label %if.end39, label %for.body19, !llvm.loop !16 if.end39: ; preds = %for.body19, %for.cond17.preheader, %entry call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %work) #6 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %array = alloca [200000 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %array) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, 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 %array, 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 !17 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] %sub = add nsw i32 %.lcssa, -1 call void @merge_sort(ptr noundef nonnull %array, i32 noundef 0, i32 noundef %sub) %smax = call i32 @llvm.smax.i32(i32 %sub, i32 0) %wide.trip.count = zext i32 %smax to i64 br label %for.cond2 for.cond2: ; preds = %for.body5, %for.end %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body5 ], [ 0, %for.end ] %exitcond.not = icmp eq i64 %indvars.iv29, %wide.trip.count br i1 %exitcond.not, label %if.end18, label %for.body5 for.body5: ; preds = %for.cond2 %arrayidx7 = getelementptr inbounds [200000 x i32], ptr %array, i64 0, i64 %indvars.iv29 %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %arrayidx9 = getelementptr inbounds [200000 x i32], ptr %array, i64 0, i64 %indvars.iv.next30 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %3, %4 br i1 %cmp10, label %if.end18, label %for.cond2, !llvm.loop !18 if.end18: ; preds = %for.cond2, %for.body5 %.str.1.sink = phi ptr [ @.str.1, %for.body5 ], [ @.str.2, %for.cond2 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %array) #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 @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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-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 = { 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, !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} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> int main() { char a[3000]; int index=0; int index2=0; char b[3000]={0}; int m; scanf("%d",&m); scanf("%s",a); if(m%2==0) { for(int i=m-2;i>=0;i-=2) { b[index]=a[i]; index+=1; } for(int j=1;j<=m-1;j+=2) { b[index]=a[j]; index+=1; } } if(m%2==1) { for(int i=m-2;i>=1;i-=2) { b[index2]=a[i]; index2+=1; } for(int j=0;j<=m-1;j+=2) { b[index2]=a[j]; index2+=1; } } printf("%s",b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24749/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3000 x i8], align 16 %b = alloca [3000 x i8], align 16 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3000) %b, i8 0, i64 3000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %for.cond.preheader, label %if.end for.cond.preheader: ; preds = %entry %cmp267 = icmp sgt i32 %0, 1 br i1 %cmp267, label %for.body, label %if.end for.cond6.preheader: ; preds = %for.body br i1 %cmp267, label %iter.check, label %if.end iter.check: ; preds = %for.cond6.preheader %2 = and i64 %indvars.iv.next, 4294967295 %3 = zext i32 %0 to i64 %4 = add nsw i64 %3, -2 %5 = lshr i64 %4, 1 %6 = add nuw i64 %5, 1 %min.iters.check = icmp ult i64 %4, 16 br i1 %min.iters.check, label %for.body10.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check102 = icmp ult i64 %4, 32 br i1 %min.iters.check102, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %6, 15 %7 = icmp eq i64 %n.mod.vf, 0 %8 = select i1 %7, i64 16, i64 %n.mod.vf %n.vec = sub i64 %6, %8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = shl i64 %index, 1 %offset.idx = or i64 %9, 1 %10 = or i64 %9, 3 %11 = or i64 %9, 5 %12 = or i64 %9, 7 %13 = or i64 %9, 9 %14 = or i64 %9, 11 %15 = or i64 %9, 13 %16 = or i64 %9, 15 %17 = or i64 %9, 17 %18 = or i64 %9, 19 %19 = or i64 %9, 21 %20 = or i64 %9, 23 %21 = or i64 %9, 25 %22 = or i64 %9, 27 %23 = or i64 %9, 29 %24 = or i64 %9, 31 %offset.idx103 = add i64 %2, %index %25 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %offset.idx %26 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %10 %27 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %11 %28 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %12 %29 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %13 %30 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %14 %31 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %15 %32 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %16 %33 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %17 %34 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %18 %35 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %19 %36 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %20 %37 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %21 %38 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %22 %39 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %23 %40 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %24 %41 = load i8, ptr %25, align 1, !tbaa !9 %42 = load i8, ptr %26, align 1, !tbaa !9 %43 = load i8, ptr %27, align 1, !tbaa !9 %44 = load i8, ptr %28, align 1, !tbaa !9 %45 = load i8, ptr %29, align 1, !tbaa !9 %46 = load i8, ptr %30, align 1, !tbaa !9 %47 = load i8, ptr %31, align 1, !tbaa !9 %48 = load i8, ptr %32, align 1, !tbaa !9 %49 = load i8, ptr %33, align 1, !tbaa !9 %50 = load i8, ptr %34, align 1, !tbaa !9 %51 = load i8, ptr %35, align 1, !tbaa !9 %52 = load i8, ptr %36, align 1, !tbaa !9 %53 = load i8, ptr %37, align 1, !tbaa !9 %54 = load i8, ptr %38, align 1, !tbaa !9 %55 = load i8, ptr %39, align 1, !tbaa !9 %56 = load i8, ptr %40, align 1, !tbaa !9 %57 = insertelement <16 x i8> poison, i8 %41, i64 0 %58 = insertelement <16 x i8> %57, i8 %42, i64 1 %59 = insertelement <16 x i8> %58, i8 %43, i64 2 %60 = insertelement <16 x i8> %59, i8 %44, i64 3 %61 = insertelement <16 x i8> %60, i8 %45, i64 4 %62 = insertelement <16 x i8> %61, i8 %46, i64 5 %63 = insertelement <16 x i8> %62, i8 %47, i64 6 %64 = insertelement <16 x i8> %63, i8 %48, i64 7 %65 = insertelement <16 x i8> %64, i8 %49, i64 8 %66 = insertelement <16 x i8> %65, i8 %50, i64 9 %67 = insertelement <16 x i8> %66, i8 %51, i64 10 %68 = insertelement <16 x i8> %67, i8 %52, i64 11 %69 = insertelement <16 x i8> %68, i8 %53, i64 12 %70 = insertelement <16 x i8> %69, i8 %54, i64 13 %71 = insertelement <16 x i8> %70, i8 %55, i64 14 %72 = insertelement <16 x i8> %71, i8 %56, i64 15 %73 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %offset.idx103 store <16 x i8> %72, ptr %73, align 1, !tbaa !9 %index.next = add nuw i64 %index, 16 %74 = icmp eq i64 %index.next, %n.vec br i1 %74, label %vec.epilog.iter.check, label %vector.body, !llvm.loop !10 vec.epilog.iter.check: ; preds = %vector.body %75 = shl i64 %n.vec, 1 %ind.end108 = or i64 %75, 1 %ind.end106 = add i64 %2, %n.vec %min.epilog.iters.check = icmp ult i64 %8, 9 br i1 %min.epilog.iters.check, label %for.body10.preheader, label %vec.epilog.ph for.body10.preheader: ; preds = %vec.epilog.vector.body, %iter.check, %vec.epilog.iter.check %indvars.iv83.ph = phi i64 [ %2, %iter.check ], [ %ind.end106, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.vector.body ] %indvars.iv81.ph = phi i64 [ 1, %iter.check ], [ %ind.end108, %vec.epilog.iter.check ], [ %ind.end107, %vec.epilog.vector.body ] br label %for.body10 vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf104 = and i64 %6, 7 %76 = icmp eq i64 %n.mod.vf104, 0 %77 = select i1 %76, i64 8, i64 %n.mod.vf104 %n.vec105 = sub i64 %6, %77 %ind.end = add i64 %2, %n.vec105 %78 = shl i64 %n.vec105, 1 %ind.end107 = or i64 %78, 1 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index110 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next113, %vec.epilog.vector.body ] %79 = shl i64 %index110, 1 %offset.idx111 = or i64 %79, 1 %80 = add i64 %79, 3 %81 = add i64 %79, 5 %82 = add i64 %79, 7 %83 = add i64 %79, 9 %84 = add i64 %79, 11 %85 = add i64 %79, 13 %86 = add i64 %79, 15 %offset.idx112 = add i64 %2, %index110 %87 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %offset.idx111 %88 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %80 %89 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %81 %90 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %82 %91 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %83 %92 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %84 %93 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %85 %94 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %86 %95 = load i8, ptr %87, align 1, !tbaa !9 %96 = load i8, ptr %88, align 1, !tbaa !9 %97 = load i8, ptr %89, align 1, !tbaa !9 %98 = load i8, ptr %90, align 1, !tbaa !9 %99 = load i8, ptr %91, align 1, !tbaa !9 %100 = load i8, ptr %92, align 1, !tbaa !9 %101 = load i8, ptr %93, align 1, !tbaa !9 %102 = load i8, ptr %94, align 1, !tbaa !9 %103 = insertelement <8 x i8> poison, i8 %95, i64 0 %104 = insertelement <8 x i8> %103, i8 %96, i64 1 %105 = insertelement <8 x i8> %104, i8 %97, i64 2 %106 = insertelement <8 x i8> %105, i8 %98, i64 3 %107 = insertelement <8 x i8> %106, i8 %99, i64 4 %108 = insertelement <8 x i8> %107, i8 %100, i64 5 %109 = insertelement <8 x i8> %108, i8 %101, i64 6 %110 = insertelement <8 x i8> %109, i8 %102, i64 7 %111 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %offset.idx112 store <8 x i8> %110, ptr %111, align 1, !tbaa !9 %index.next113 = add nuw i64 %index110, 8 %112 = icmp eq i64 %index.next113, %n.vec105 br i1 %112, label %for.body10.preheader, label %vec.epilog.vector.body, !llvm.loop !14 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %i.0.in69 = phi i32 [ %i.0, %for.body ], [ %0, %for.cond.preheader ] %i.0 = add nsw i32 %i.0.in69, -2 %idxprom = zext i32 %i.0 to i64 %arrayidx = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %idxprom %113 = load i8, ptr %arrayidx, align 1, !tbaa !9 %arrayidx4 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %indvars.iv store i8 %113, ptr %arrayidx4, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp2 = icmp ugt i32 %i.0.in69, 3 br i1 %cmp2, label %for.body, label %for.cond6.preheader, !llvm.loop !15 for.body10: ; preds = %for.body10.preheader, %for.body10 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body10 ], [ %indvars.iv83.ph, %for.body10.preheader ] %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body10 ], [ %indvars.iv81.ph, %for.body10.preheader ] %arrayidx12 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %indvars.iv81 %114 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %arrayidx14 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %indvars.iv83 store i8 %114, ptr %arrayidx14, align 1, !tbaa !9 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 2 %cmp8.not.not = icmp ult i64 %indvars.iv.next82, %3 br i1 %cmp8.not.not, label %for.body10, label %if.end, !llvm.loop !16 if.end: ; preds = %for.body10, %for.cond.preheader, %for.cond6.preheader, %entry %115 = and i32 %0, -2147483647 %cmp20 = icmp eq i32 %115, 1 br i1 %cmp20, label %for.cond24.preheader, label %if.end50 for.cond24.preheader: ; preds = %if.end %cmp2573 = icmp ugt i32 %0, 2 br i1 %cmp2573, label %for.body27, label %iter.check117 for.cond37.preheader: ; preds = %for.body27 %116 = and i64 %indvars.iv.next89, 4294967295 %cmp39.not.not77 = icmp sgt i32 %0, 0 br i1 %cmp39.not.not77, label %iter.check117, label %if.end50 iter.check117: ; preds = %for.cond24.preheader, %for.cond37.preheader %index2.0.lcssa101 = phi i64 [ %116, %for.cond37.preheader ], [ 0, %for.cond24.preheader ] %117 = zext i32 %0 to i64 %umax = call i64 @llvm.umax.i64(i64 %117, i64 2) %118 = add nsw i64 %umax, -1 %119 = lshr i64 %118, 1 %120 = add nuw nsw i64 %119, 1 %min.iters.check115 = icmp ult i32 %0, 17 br i1 %min.iters.check115, label %for.body41.preheader, label %vector.main.loop.iter.check119 vector.main.loop.iter.check119: ; preds = %iter.check117 %min.iters.check118 = icmp ult i32 %0, 33 br i1 %min.iters.check118, label %vec.epilog.ph131, label %vector.ph120 vector.ph120: ; preds = %vector.main.loop.iter.check119 %n.mod.vf121 = and i64 %120, 15 %121 = icmp eq i64 %n.mod.vf121, 0 %122 = select i1 %121, i64 16, i64 %n.mod.vf121 %n.vec122 = sub nsw i64 %120, %122 br label %vector.body123 vector.body123: ; preds = %vector.body123, %vector.ph120 %index124 = phi i64 [ 0, %vector.ph120 ], [ %index.next127, %vector.body123 ] %offset.idx125 = shl i64 %index124, 1 %123 = or i64 %offset.idx125, 2 %124 = or i64 %offset.idx125, 4 %125 = or i64 %offset.idx125, 6 %126 = or i64 %offset.idx125, 8 %127 = or i64 %offset.idx125, 10 %128 = or i64 %offset.idx125, 12 %129 = or i64 %offset.idx125, 14 %130 = or i64 %offset.idx125, 16 %131 = or i64 %offset.idx125, 18 %132 = or i64 %offset.idx125, 20 %133 = or i64 %offset.idx125, 22 %134 = or i64 %offset.idx125, 24 %135 = or i64 %offset.idx125, 26 %136 = or i64 %offset.idx125, 28 %137 = or i64 %offset.idx125, 30 %offset.idx126 = add i64 %index2.0.lcssa101, %index124 %138 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %offset.idx125 %139 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %123 %140 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %124 %141 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %125 %142 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %126 %143 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %127 %144 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %128 %145 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %129 %146 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %130 %147 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %131 %148 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %132 %149 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %133 %150 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %134 %151 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %135 %152 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %136 %153 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %137 %154 = load i8, ptr %138, align 16, !tbaa !9 %155 = load i8, ptr %139, align 2, !tbaa !9 %156 = load i8, ptr %140, align 4, !tbaa !9 %157 = load i8, ptr %141, align 2, !tbaa !9 %158 = load i8, ptr %142, align 8, !tbaa !9 %159 = load i8, ptr %143, align 2, !tbaa !9 %160 = load i8, ptr %144, align 4, !tbaa !9 %161 = load i8, ptr %145, align 2, !tbaa !9 %162 = load i8, ptr %146, align 16, !tbaa !9 %163 = load i8, ptr %147, align 2, !tbaa !9 %164 = load i8, ptr %148, align 4, !tbaa !9 %165 = load i8, ptr %149, align 2, !tbaa !9 %166 = load i8, ptr %150, align 8, !tbaa !9 %167 = load i8, ptr %151, align 2, !tbaa !9 %168 = load i8, ptr %152, align 4, !tbaa !9 %169 = load i8, ptr %153, align 2, !tbaa !9 %170 = insertelement <16 x i8> poison, i8 %154, i64 0 %171 = insertelement <16 x i8> %170, i8 %155, i64 1 %172 = insertelement <16 x i8> %171, i8 %156, i64 2 %173 = insertelement <16 x i8> %172, i8 %157, i64 3 %174 = insertelement <16 x i8> %173, i8 %158, i64 4 %175 = insertelement <16 x i8> %174, i8 %159, i64 5 %176 = insertelement <16 x i8> %175, i8 %160, i64 6 %177 = insertelement <16 x i8> %176, i8 %161, i64 7 %178 = insertelement <16 x i8> %177, i8 %162, i64 8 %179 = insertelement <16 x i8> %178, i8 %163, i64 9 %180 = insertelement <16 x i8> %179, i8 %164, i64 10 %181 = insertelement <16 x i8> %180, i8 %165, i64 11 %182 = insertelement <16 x i8> %181, i8 %166, i64 12 %183 = insertelement <16 x i8> %182, i8 %167, i64 13 %184 = insertelement <16 x i8> %183, i8 %168, i64 14 %185 = insertelement <16 x i8> %184, i8 %169, i64 15 %186 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %offset.idx126 store <16 x i8> %185, ptr %186, align 1, !tbaa !9 %index.next127 = add nuw i64 %index124, 16 %187 = icmp eq i64 %index.next127, %n.vec122 br i1 %187, label %vec.epilog.iter.check130, label %vector.body123, !llvm.loop !17 vec.epilog.iter.check130: ; preds = %vector.body123 %ind.end141 = shl i64 %n.vec122, 1 %ind.end138 = add i64 %index2.0.lcssa101, %n.vec122 %min.epilog.iters.check133 = icmp ult i64 %122, 9 br i1 %min.epilog.iters.check133, label %for.body41.preheader, label %vec.epilog.ph131 for.body41.preheader: ; preds = %vec.epilog.vector.body143, %iter.check117, %vec.epilog.iter.check130 %indvars.iv93.ph = phi i64 [ %index2.0.lcssa101, %iter.check117 ], [ %ind.end138, %vec.epilog.iter.check130 ], [ %ind.end137, %vec.epilog.vector.body143 ] %indvars.iv91.ph = phi i64 [ 0, %iter.check117 ], [ %ind.end141, %vec.epilog.iter.check130 ], [ %ind.end140, %vec.epilog.vector.body143 ] br label %for.body41 vec.epilog.ph131: ; preds = %vector.main.loop.iter.check119, %vec.epilog.iter.check130 %vec.epilog.resume.val134 = phi i64 [ %n.vec122, %vec.epilog.iter.check130 ], [ 0, %vector.main.loop.iter.check119 ] %n.mod.vf135 = and i64 %120, 7 %188 = icmp eq i64 %n.mod.vf135, 0 %189 = select i1 %188, i64 8, i64 %n.mod.vf135 %n.vec136 = sub nsw i64 %120, %189 %ind.end137 = add i64 %index2.0.lcssa101, %n.vec136 %ind.end140 = shl i64 %n.vec136, 1 br label %vec.epilog.vector.body143 vec.epilog.vector.body143: ; preds = %vec.epilog.vector.body143, %vec.epilog.ph131 %index144 = phi i64 [ %vec.epilog.resume.val134, %vec.epilog.ph131 ], [ %index.next147, %vec.epilog.vector.body143 ] %offset.idx145 = shl i64 %index144, 1 %190 = add i64 %offset.idx145, 2 %191 = add i64 %offset.idx145, 4 %192 = add i64 %offset.idx145, 6 %193 = add i64 %offset.idx145, 8 %194 = add i64 %offset.idx145, 10 %195 = add i64 %offset.idx145, 12 %196 = add i64 %offset.idx145, 14 %offset.idx146 = add i64 %index2.0.lcssa101, %index144 %197 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %offset.idx145 %198 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %190 %199 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %191 %200 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %192 %201 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %193 %202 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %194 %203 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %195 %204 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %196 %205 = load i8, ptr %197, align 2, !tbaa !9 %206 = load i8, ptr %198, align 2, !tbaa !9 %207 = load i8, ptr %199, align 2, !tbaa !9 %208 = load i8, ptr %200, align 2, !tbaa !9 %209 = load i8, ptr %201, align 2, !tbaa !9 %210 = load i8, ptr %202, align 2, !tbaa !9 %211 = load i8, ptr %203, align 2, !tbaa !9 %212 = load i8, ptr %204, align 2, !tbaa !9 %213 = insertelement <8 x i8> poison, i8 %205, i64 0 %214 = insertelement <8 x i8> %213, i8 %206, i64 1 %215 = insertelement <8 x i8> %214, i8 %207, i64 2 %216 = insertelement <8 x i8> %215, i8 %208, i64 3 %217 = insertelement <8 x i8> %216, i8 %209, i64 4 %218 = insertelement <8 x i8> %217, i8 %210, i64 5 %219 = insertelement <8 x i8> %218, i8 %211, i64 6 %220 = insertelement <8 x i8> %219, i8 %212, i64 7 %221 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %offset.idx146 store <8 x i8> %220, ptr %221, align 1, !tbaa !9 %index.next147 = add nuw i64 %index144, 8 %222 = icmp eq i64 %index.next147, %n.vec136 br i1 %222, label %for.body41.preheader, label %vec.epilog.vector.body143, !llvm.loop !18 for.body27: ; preds = %for.cond24.preheader, %for.body27 %indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.body27 ], [ 0, %for.cond24.preheader ] %i22.0.in75 = phi i32 [ %i22.0, %for.body27 ], [ %0, %for.cond24.preheader ] %i22.0 = add nsw i32 %i22.0.in75, -2 %idxprom28 = zext i32 %i22.0 to i64 %arrayidx29 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %idxprom28 %223 = load i8, ptr %arrayidx29, align 1, !tbaa !9 %arrayidx31 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %indvars.iv88 store i8 %223, ptr %arrayidx31, align 1, !tbaa !9 %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %cmp25 = icmp ugt i32 %i22.0.in75, 4 br i1 %cmp25, label %for.body27, label %for.cond37.preheader, !llvm.loop !19 for.body41: ; preds = %for.body41.preheader, %for.body41 %indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body41 ], [ %indvars.iv93.ph, %for.body41.preheader ] %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body41 ], [ %indvars.iv91.ph, %for.body41.preheader ] %arrayidx43 = getelementptr inbounds [3000 x i8], ptr %a, i64 0, i64 %indvars.iv91 %224 = load i8, ptr %arrayidx43, align 2, !tbaa !9 %arrayidx45 = getelementptr inbounds [3000 x i8], ptr %b, i64 0, i64 %indvars.iv93 store i8 %224, ptr %arrayidx45, align 1, !tbaa !9 %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 2 %cmp39.not.not = icmp ult i64 %indvars.iv.next92, %117 br i1 %cmp39.not.not, label %for.body41, label %if.end50, !llvm.loop !20 if.end50: ; preds = %for.body41, %for.cond37.preheader, %if.end %call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %b) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 3000, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !12, !13} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11, !13, !12} !17 = distinct !{!17, !11, !12, !13} !18 = distinct !{!18, !11, !12, !13} !19 = distinct !{!19, !11} !20 = distinct !{!20, !11, !13, !12}
#include <stdio.h> int main() { int a, b, c, sum; scanf("%d %d %d", &a, &b, &c); while(a) { if((a<<1)<=b && (a<<2)<=c) break; else a--; } sum=a+(a<<1)+(a<<2); printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24754/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %.pr = load i32, ptr %a, align 4, !tbaa !5 %tobool.not7 = icmp eq i32 %.pr, 0 br i1 %tobool.not7, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.else %2 = phi i32 [ %.pr, %while.body.lr.ph ], [ %dec, %if.else ] %shl = shl i32 %2, 1 %cmp.not = icmp sgt i32 %shl, %0 %shl1 = shl i32 %2, 2 %cmp2.not = icmp sgt i32 %shl1, %1 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp2.not br i1 %or.cond, label %if.else, label %while.end.loopexit if.else: ; preds = %while.body %dec = add nsw i32 %2, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !9 while.end.loopexit: ; preds = %while.body, %if.else %.lcssa.ph = phi i32 [ 0, %if.else ], [ %2, %while.body ] %3 = mul i32 %.lcssa.ph, 7 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %.lcssa = phi i32 [ 0, %entry ], [ %3, %while.end.loopexit ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int main(void){ /*宣言部*/ unsigned int input, answer=0, x, y, flag; /*input:素数の全体数 answer:素数の総数 x, y:ループ変数 flag:フラグ*/ long prime[10000], limit; /*prime:素数 limit:素数調査のループ最大値*/ /*入力部*/ scanf("%u", &input); /*全体数を読み取る*/ for(x=0; input>x; x++){ /*素数をすべて読み取る*/ scanf("%ld", &prime[x]); } /*計算部*/ /*2から判定対象未満までの数で、割り切れるかどうかで素数か判定する*/ for(x=0; input>x; x++){ limit=sqrt((float)prime[x]); for(y=2, flag=1; limit>=y; y++){ /*割り切れた時点でその数に対しての調査をやめる*/ if(0==prime[x]%y){ flag=0; break; } } if(1==flag){ answer += 1; } } /*表示部*/ printf("%u\n", answer); /*素数の総数を表示する*/ return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247583/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247583/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%u\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %input = alloca i32, align 4 %prime = alloca [10000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %prime) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %0 = load i32, ptr %input, align 4, !tbaa !5 %cmp40.not = icmp eq i32 %0, 0 br i1 %cmp40.not, label %for.end29, label %for.body for.cond2.preheader: ; preds = %for.body %1 = icmp eq i32 %2, 0 br i1 %1, label %for.end29, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %input, align 4, !tbaa !5 %3 = zext i32 %2 to i64 %cmp = icmp ult i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.end22 %answer.049 = phi i32 [ %spec.select, %for.end22 ], [ 0, %for.cond2.preheader ] %x.148 = phi i32 [ %inc28, %for.end22 ], [ 0, %for.cond2.preheader ] %idxprom5 = zext i32 %x.148 to i64 %arrayidx6 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %idxprom5 %4 = load i64, ptr %arrayidx6, align 8, !tbaa !11 %conv = sitofp i64 %4 to float %conv7 = fpext float %conv to double %call8 = call double @sqrt(double noundef %conv7) #4 %conv9 = fptosi double %call8 to i64 %cmp12.not42 = icmp slt i64 %conv9, 2 br i1 %cmp12.not42, label %for.end22, label %for.body14.lr.ph for.body14.lr.ph: ; preds = %for.body4 %5 = load i64, ptr %arrayidx6, align 8, !tbaa !11 br label %for.body14 for.cond10: ; preds = %for.body14 %inc21 = add i32 %y.043, 1 %conv11 = zext i32 %inc21 to i64 %cmp12.not = icmp slt i64 %conv9, %conv11 br i1 %cmp12.not, label %for.end22, label %for.body14, !llvm.loop !13 for.body14: ; preds = %for.body14.lr.ph, %for.cond10 %conv1144 = phi i64 [ 2, %for.body14.lr.ph ], [ %conv11, %for.cond10 ] %y.043 = phi i32 [ 2, %for.body14.lr.ph ], [ %inc21, %for.cond10 ] %rem = srem i64 %5, %conv1144 %cmp18.not = icmp eq i64 %rem, 0 br i1 %cmp18.not, label %for.end22, label %for.cond10 for.end22: ; preds = %for.cond10, %for.body14, %for.body4 %cmp12.not.lcssa = phi i32 [ 1, %for.body4 ], [ 1, %for.cond10 ], [ 0, %for.body14 ] %spec.select = add i32 %answer.049, %cmp12.not.lcssa %inc28 = add nuw i32 %x.148, 1 %6 = load i32, ptr %input, align 4, !tbaa !5 %cmp3 = icmp ugt i32 %6, %inc28 br i1 %cmp3, label %for.body4, label %for.end29, !llvm.loop !14 for.end29: ; preds = %for.end22, %entry, %for.cond2.preheader %answer.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %spec.select, %for.end22 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %answer.0.lcssa) call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %prime) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #include<math.h> int main(){ int i,j,n,sum=0; while(scanf("%d",&n)!=EOF){ j=0; for(i=2;i<=sqrt(n);i++){ if(n%i==0){ j=1; break; } } if(j==0)sum++; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247691/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247691/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not21 = icmp eq i32 %call20, -1 br i1 %cmp.not21, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %if.end11 %sum.022 = phi i32 [ %sum.1, %if.end11 ], [ 0, %entry ] %0 = load i32, ptr %n, align 4, !tbaa !5 %conv116 = sitofp i32 %0 to double %call217 = call double @sqrt(double noundef %conv116) #4 %cmp318 = fcmp ult double %call217, 2.000000e+00 br i1 %cmp318, label %if.then9, label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.019, 1 %conv = sitofp i32 %inc to double %conv1 = sitofp i32 %1 to double %call2 = call double @sqrt(double noundef %conv1) #4 %cmp3 = fcmp ult double %call2, %conv br i1 %cmp3, label %if.then9, label %for.body, !llvm.loop !9 for.body: ; preds = %for.cond.preheader, %for.cond %i.019 = phi i32 [ %inc, %for.cond ], [ 2, %for.cond.preheader ] %1 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %1, %i.019 %cmp5 = icmp eq i32 %rem, 0 br i1 %cmp5, label %if.end11, label %for.cond if.then9: ; preds = %for.cond, %for.cond.preheader %inc10 = add nsw i32 %sum.022, 1 br label %if.end11 if.end11: ; preds = %for.body, %if.then9 %sum.1 = phi i32 [ %inc10, %if.then9 ], [ %sum.022, %for.body ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %if.end11, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %sum.1, %if.end11 ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<stdlib.h> #include<math.h> #define MAX 10000 int main(){ int n,i,j,find,count=0; int num[MAX]; scanf("%d",&n); if( n < 1 || MAX < n ) exit(2); for( i = 0 ; i < n ; i++ ) { scanf("%d",&num[i]); if( num[i] < 2 || 100000000 < num[i]) exit(3); } for( i = 0 ; i < n ; i++ ) { find = 1; if( num[i] % 2 == 0 ) find = 0; else { for( j = 3 ; j <= sqrt(num[i]) ; j+=2) { if( num[i] % j == 0 ) { find = 0; break; } } } if( find == 1 || num[i] == 2 ) count++; } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247734/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247734/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %num = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %num) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4 %1 = add i32 %0, -10001 %or.cond = icmp ult i32 %1, -10000 br i1 %or.cond, label %if.then, label %for.body if.then: ; preds = %entry call void @exit(i32 noundef 2) #6 unreachable for.cond: ; preds = %for.body %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body, label %for.cond13.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.cond %4 = icmp sgt i32 %2, 0 br i1 %4, label %for.body15, label %for.end50 for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %6 = add i32 %5, -100000001 %or.cond65 = icmp ult i32 %6, -99999999 br i1 %or.cond65, label %if.then11, label %for.cond if.then11: ; preds = %for.body call void @exit(i32 noundef 3) #6 unreachable for.body15: ; preds = %for.cond13.preheader, %for.inc48 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.inc48 ], [ 0, %for.cond13.preheader ] %count.074 = phi i32 [ %count.1, %for.inc48 ], [ 0, %for.cond13.preheader ] %arrayidx17 = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv78 %7 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %8 = and i32 %7, 1 %cmp18 = icmp eq i32 %8, 0 br i1 %cmp18, label %lor.lhs.false40, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body15 %conv2368 = sitofp i32 %7 to double %call2469 = call double @sqrt(double noundef %conv2368) #5 %cmp2570 = fcmp ult double %call2469, 3.000000e+00 br i1 %cmp2570, label %if.then45, label %for.body27 for.cond20: ; preds = %for.body27 %add = add nuw nsw i32 %j.071, 2 %conv = sitofp i32 %add to double %conv23 = sitofp i32 %9 to double %call24 = call double @sqrt(double noundef %conv23) #5 %cmp25 = fcmp ult double %call24, %conv br i1 %cmp25, label %if.then45, label %for.body27, !llvm.loop !11 for.body27: ; preds = %for.cond20.preheader, %for.cond20 %j.071 = phi i32 [ %add, %for.cond20 ], [ 3, %for.cond20.preheader ] %9 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %rem30 = srem i32 %9, %j.071 %cmp31 = icmp eq i32 %rem30, 0 br i1 %cmp31, label %lor.lhs.false40, label %for.cond20 lor.lhs.false40: ; preds = %for.body27, %for.body15 %10 = phi i32 [ %7, %for.body15 ], [ %9, %for.body27 ] %cmp43 = icmp eq i32 %10, 2 br i1 %cmp43, label %if.then45, label %for.inc48 if.then45: ; preds = %for.cond20, %for.cond20.preheader, %lor.lhs.false40 %inc46 = add nsw i32 %count.074, 1 br label %for.inc48 for.inc48: ; preds = %lor.lhs.false40, %if.then45 %count.1 = phi i32 [ %inc46, %if.then45 ], [ %count.074, %lor.lhs.false40 ] %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp14 = icmp slt i64 %indvars.iv.next79, %12 br i1 %cmp14, label %for.body15, label %for.end50, !llvm.loop !12 for.end50: ; preds = %for.inc48, %for.cond13.preheader %count.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ %count.1, %for.inc48 ] %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %num) #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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) 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 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 #5 = { nounwind } attributes #6 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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<math.h> #define N 10000 int main(){ int n,num[N],i,j,count=0; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&num[i]); for(i=0;i<n;i++){ if(num[i]==2)continue; if(num[i]%2==0){ count+=1; continue; } for(j=3;j<=sqrt(num[i]);j+=2){ if(num[i]%j==0){ count+=1; break; } } } printf("%d\n",n-count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247778/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247778/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %num = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp49 = icmp sgt i32 %0, 0 br i1 %cmp49, label %for.body, label %for.end34 for.cond2.preheader: ; preds = %for.body %cmp355 = icmp sgt i32 %1, 0 br i1 %cmp355, label %for.body4, label %for.end34 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc32 %indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.inc32 ], [ 0, %for.cond2.preheader ] %count.057 = phi i32 [ %count.1, %for.inc32 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv61 %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 2 br i1 %cmp7, label %for.inc32, label %if.end if.end: ; preds = %for.body4 %4 = and i32 %3, 1 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.cond13.preheader for.cond13.preheader: ; preds = %if.end %conv1651 = sitofp i32 %3 to double %call1752 = call double @sqrt(double noundef %conv1651) #4 %cmp1853 = fcmp ult double %call1752, 3.000000e+00 br i1 %cmp1853, label %for.inc32, label %for.body20 if.then11: ; preds = %if.end %add = add nsw i32 %count.057, 1 br label %for.inc32 for.cond13: ; preds = %for.body20 %add30 = add nuw nsw i32 %j.054, 2 %conv = sitofp i32 %add30 to double %conv16 = sitofp i32 %5 to double %call17 = call double @sqrt(double noundef %conv16) #4 %cmp18 = fcmp ult double %call17, %conv br i1 %cmp18, label %for.inc32, label %for.body20, !llvm.loop !11 for.body20: ; preds = %for.cond13.preheader, %for.cond13 %j.054 = phi i32 [ %add30, %for.cond13 ], [ 3, %for.cond13.preheader ] %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %rem23 = srem i32 %5, %j.054 %cmp24 = icmp eq i32 %rem23, 0 br i1 %cmp24, label %if.then26, label %for.cond13 if.then26: ; preds = %for.body20 %add27 = add nsw i32 %count.057, 1 br label %for.inc32 for.inc32: ; preds = %for.cond13, %for.cond13.preheader, %if.then26, %for.body4, %if.then11 %count.1 = phi i32 [ %count.057, %for.body4 ], [ %add, %if.then11 ], [ %add27, %if.then26 ], [ %count.057, %for.cond13.preheader ], [ %count.057, %for.cond13 ] %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp3 = icmp slt i64 %indvars.iv.next62, %7 br i1 %cmp3, label %for.body4, label %for.end34, !llvm.loop !12 for.end34: ; preds = %for.inc32, %entry, %for.cond2.preheader %count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1, %for.inc32 ] %.lcssa = phi i32 [ %1, %for.cond2.preheader ], [ %0, %entry ], [ %6, %for.inc32 ] %sub = sub nsw i32 %.lcssa, %count.0.lcssa %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int isPrime(int x){ int i; if(x == 2) return 1; if(x < 2 || x % 2 == 0) return 0; for(i = 3; i * i <= x; i = i + 2){ if(x % i == 0) return 0; } return 1; } int main(){ int n, x, i; int cnt = 0; scanf("%d", &n); for ( i = 0; i < n; i++){ scanf("%d", &x); if(isPrime(x))cnt++; } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247820/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247820/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @isPrime(i32 noundef %x) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %x, 2 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp1 = icmp slt i32 %x, 2 %rem = and i32 %x, 1 %cmp2 = icmp eq i32 %rem, 0 %or.cond = or i1 %cmp1, %cmp2 br i1 %or.cond, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %cmp5.not17 = icmp ult i32 %x, 9 br i1 %cmp5.not17, label %cleanup, label %for.body for.cond: ; preds = %for.body %add = add nuw nsw i32 %i.018, 2 %mul = mul nsw i32 %add, %add %cmp5.not = icmp sgt i32 %mul, %x br i1 %cmp5.not, label %cleanup, label %for.body, !llvm.loop !5 for.body: ; preds = %for.cond.preheader, %for.cond %i.018 = phi i32 [ %add, %for.cond ], [ 3, %for.cond.preheader ] %rem6 = srem i32 %x, %i.018 %cmp7 = icmp eq i32 %rem6, 0 br i1 %cmp7, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ 0, %if.end ], [ 1, %for.cond.preheader ], [ 0, %for.body ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %x = 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 %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !7 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body, label %for.end for.body: ; preds = %entry, %for.cond %cnt.012 = phi i32 [ %2, %for.cond ], [ 0, %entry ] %i.011 = phi i32 [ %inc3, %for.cond ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %1 = load i32, ptr %x, align 4, !tbaa !7 %cmp.i = icmp eq i32 %1, 2 br i1 %cmp.i, label %isPrime.exit.thread, label %if.end.i if.end.i: ; preds = %for.body %cmp1.i = icmp slt i32 %1, 2 %rem.i = and i32 %1, 1 %cmp2.i = icmp eq i32 %rem.i, 0 %or.cond.i = or i1 %cmp1.i, %cmp2.i br i1 %or.cond.i, label %for.cond, label %for.cond.preheader.i for.cond.preheader.i: ; preds = %if.end.i %cmp5.not17.i = icmp ult i32 %1, 9 br i1 %cmp5.not17.i, label %isPrime.exit.thread, label %for.body.i for.cond.i: ; preds = %for.body.i %add.i = add nuw nsw i32 %i.018.i, 2 %mul.i = mul nsw i32 %add.i, %add.i %cmp5.not.i = icmp sgt i32 %mul.i, %1 br i1 %cmp5.not.i, label %isPrime.exit.thread, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i %i.018.i = phi i32 [ %add.i, %for.cond.i ], [ 3, %for.cond.preheader.i ] %rem6.i = srem i32 %1, %i.018.i %cmp7.i = icmp eq i32 %rem6.i, 0 br i1 %cmp7.i, label %for.cond, label %for.cond.i isPrime.exit.thread: ; preds = %for.cond.i, %for.body, %for.cond.preheader.i %inc9 = add nsw i32 %cnt.012, 1 br label %for.cond for.cond: ; preds = %for.body.i, %if.end.i, %isPrime.exit.thread %2 = phi i32 [ %inc9, %isPrime.exit.thread ], [ %cnt.012, %if.end.i ], [ %cnt.012, %for.body.i ] %inc3 = add nuw nsw i32 %i.011, 1 %3 = load i32, ptr %n, align 4, !tbaa !7 %cmp = icmp slt i32 %inc3, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.cond, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.cond ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> #include <math.h> // num????´???°??????1, ?´???°??§????????????0???????????¢??° int primenumber(int num) { int i, ans = 1, nmax = (int)sqrt((double)num); if (num == 1) { ans = 0; } else { for (i = 2; i <= nmax; i++) { if (num % i == 0) { ans = 0; break; } } } return ans; } int main(void) { int i, n, num, ans = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &num); if (primenumber(num) == 1) ans++; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247864/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247864/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 memory(write) uwtable define dso_local i32 @primenumber(i32 noundef %num) local_unnamed_addr #0 { entry: %conv = sitofp i32 %num to double %call = tail call double @sqrt(double noundef %conv) #5 %conv1 = fptosi double %call to i32 %cmp = icmp eq i32 %num, 1 br i1 %cmp, label %if.end8, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp3.not13 = icmp slt i32 %conv1, 2 br i1 %cmp3.not13, label %if.end8, label %for.body for.cond: ; preds = %for.body %inc = add nuw i32 %i.014, 1 %exitcond.not = icmp eq i32 %i.014, %conv1 br i1 %exitcond.not, label %if.end8, label %for.body, !llvm.loop !5 for.body: ; preds = %for.cond.preheader, %for.cond %i.014 = phi i32 [ %inc, %for.cond ], [ 2, %for.cond.preheader ] %rem = srem i32 %num, %i.014 %cmp5 = icmp eq i32 %rem, 0 br i1 %cmp5, label %if.end8, label %for.cond if.end8: ; preds = %for.cond, %for.body, %for.cond.preheader, %entry %ans.0 = phi i32 [ 0, %entry ], [ 1, %for.cond.preheader ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %ans.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double 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 uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %num = 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 %num) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !7 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body, label %for.end for.body: ; preds = %entry, %for.cond %ans.013 = phi i32 [ %2, %for.cond ], [ 0, %entry ] %i.012 = phi i32 [ %inc4, %for.cond ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %1 = load i32, ptr %num, align 4, !tbaa !7 %conv.i = sitofp i32 %1 to double %call.i = call double @sqrt(double noundef %conv.i) #5 %conv1.i = fptosi double %call.i to i32 %cmp.i = icmp eq i32 %1, 1 br i1 %cmp.i, label %for.cond, label %for.cond.preheader.i for.cond.preheader.i: ; preds = %for.body %cmp3.not13.i = icmp slt i32 %conv1.i, 2 br i1 %cmp3.not13.i, label %primenumber.exit, label %for.body.i for.cond.i: ; preds = %for.body.i %inc.i = add nuw i32 %i.014.i, 1 %exitcond.not.i = icmp eq i32 %i.014.i, %conv1.i br i1 %exitcond.not.i, label %primenumber.exit, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i %i.014.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.cond.preheader.i ] %rem.i = srem i32 %1, %i.014.i %cmp5.i = icmp eq i32 %rem.i, 0 br i1 %cmp5.i, label %for.cond, label %for.cond.i primenumber.exit: ; preds = %for.cond.i, %for.cond.preheader.i %inc = add nsw i32 %ans.013, 1 br label %for.cond for.cond: ; preds = %for.body.i, %for.body, %primenumber.exit %2 = phi i32 [ %inc, %primenumber.exit ], [ %ans.013, %for.body ], [ %ans.013, %for.body.i ] %inc4 = add nuw nsw i32 %i.012, 1 %3 = load i32, ptr %n, align 4, !tbaa !7 %cmp = icmp slt i32 %inc4, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.cond, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.cond ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> #include<math.h> int judge(int); int main() { int i,a,x[10000],y,c=0; int m; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&x[i]); m=judge(x[i]); if(m==1){ c++; } } printf("%d\n",c); return 0; } int judge(int x){ int i; if (x == 2) return 1; if(x<2 || x%2==0){ return 0; } i=3; while(i<=sqrt(x)){ if(x%i==0)return 0; i=i+2; } return 1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247907/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247907/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %x = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %x) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %for.end for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %c.016 = phi i32 [ %2, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %x, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.i = icmp eq i32 %1, 2 br i1 %cmp.i, label %judge.exit.thread, label %if.end.i if.end.i: ; preds = %for.body %cmp1.i = icmp slt i32 %1, 2 %rem.i = and i32 %1, 1 %cmp2.i = icmp eq i32 %rem.i, 0 %or.cond.i = or i1 %cmp1.i, %cmp2.i br i1 %or.cond.i, label %for.cond, label %while.cond.preheader.i while.cond.preheader.i: ; preds = %if.end.i %conv5.i = sitofp i32 %1 to double %call19.i = call double @sqrt(double noundef %conv5.i) #5 %cmp620.i = fcmp ult double %call19.i, 3.000000e+00 br i1 %cmp620.i, label %judge.exit.thread, label %while.body.i while.cond.i: ; preds = %while.body.i %add.i = add nuw nsw i32 %i.021.i, 2 %conv.i = sitofp i32 %add.i to double %call.i = call double @sqrt(double noundef %conv5.i) #5 %cmp6.i = fcmp ult double %call.i, %conv.i br i1 %cmp6.i, label %judge.exit.thread, label %while.body.i, !llvm.loop !9 while.body.i: ; preds = %while.cond.preheader.i, %while.cond.i %i.021.i = phi i32 [ %add.i, %while.cond.i ], [ 3, %while.cond.preheader.i ] %rem8.i = srem i32 %1, %i.021.i %cmp9.i = icmp eq i32 %rem8.i, 0 br i1 %cmp9.i, label %for.cond, label %while.cond.i judge.exit.thread: ; preds = %while.cond.i, %for.body, %while.cond.preheader.i %inc14 = add nsw i32 %c.016, 1 br label %for.cond for.cond: ; preds = %while.body.i, %if.end.i, %judge.exit.thread %2 = phi i32 [ %inc14, %judge.exit.thread ], [ %c.016, %if.end.i ], [ %c.016, %while.body.i ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %a, 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.end, !llvm.loop !11 for.end: ; preds = %for.cond, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.cond ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %x) #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 memory(write) uwtable define dso_local i32 @judge(i32 noundef %x) local_unnamed_addr #3 { entry: %cmp = icmp eq i32 %x, 2 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp1 = icmp slt i32 %x, 2 %rem = and i32 %x, 1 %cmp2 = icmp eq i32 %rem, 0 %or.cond = or i1 %cmp1, %cmp2 br i1 %or.cond, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %if.end %conv5 = sitofp i32 %x to double %call19 = tail call double @sqrt(double noundef %conv5) #5 %cmp620 = fcmp ult double %call19, 3.000000e+00 br i1 %cmp620, label %cleanup, label %while.body while.cond: ; preds = %while.body %add = add nuw nsw i32 %i.021, 2 %conv = sitofp i32 %add to double %call = tail call double @sqrt(double noundef %conv5) #5 %cmp6 = fcmp ult double %call, %conv br i1 %cmp6, label %cleanup, label %while.body, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %while.cond %i.021 = phi i32 [ %add, %while.cond ], [ 3, %while.cond.preheader ] %rem8 = srem i32 %x, %i.021 %cmp9 = icmp eq i32 %rem8, 0 br i1 %cmp9, label %cleanup, label %while.cond cleanup: ; preds = %while.body, %while.cond, %while.cond.preheader, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ 0, %if.end ], [ 1, %while.cond.preheader ], [ 0, %while.body ], [ 1, %while.cond ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> int prime(int); int main(){ int n,*data,i,count=0,check; scanf("%d",&n); data=(int*)malloc(n*sizeof(int)); for(i=0;i<n;i++) scanf("%d",&data[i]); for(i=0;i<n;i++){ check=0; check=prime(data[i]); if(check==1) count++; } printf("%d\n",count); free(data); return 0; } int prime(int data){ int i; if(data==2) return 1; if(data<2||data%2==0) return 0; i=3; while(i<=sqrt(data)){ if(data%i==0) return 0; i+=2; } return 1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247950/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247950/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #8 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body, label %for.end16 for.cond4.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body7, label %for.end16 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 %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.cond4.preheader, !llvm.loop !9 for.body7: ; preds = %for.cond4.preheader, %for.cond4 %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.cond4 ], [ 0, %for.cond4.preheader ] %count.032 = phi i32 [ %5, %for.cond4 ], [ 0, %for.cond4.preheader ] %arrayidx9 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv35 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp.i = icmp eq i32 %4, 2 br i1 %cmp.i, label %prime.exit.thread, label %if.end.i if.end.i: ; preds = %for.body7 %cmp1.i = icmp slt i32 %4, 2 %rem.i = and i32 %4, 1 %cmp2.i = icmp eq i32 %rem.i, 0 %or.cond.i = or i1 %cmp1.i, %cmp2.i br i1 %or.cond.i, label %for.cond4, label %while.cond.preheader.i while.cond.preheader.i: ; preds = %if.end.i %conv5.i = sitofp i32 %4 to double %call19.i = call double @sqrt(double noundef %conv5.i) #7 %cmp620.i = fcmp ult double %call19.i, 3.000000e+00 br i1 %cmp620.i, label %prime.exit.thread, label %while.body.i while.cond.i: ; preds = %while.body.i %add.i = add nuw nsw i32 %i.021.i, 2 %conv.i = sitofp i32 %add.i to double %call.i = call double @sqrt(double noundef %conv5.i) #7 %cmp6.i = fcmp ult double %call.i, %conv.i br i1 %cmp6.i, label %prime.exit.thread, label %while.body.i, !llvm.loop !11 while.body.i: ; preds = %while.cond.preheader.i, %while.cond.i %i.021.i = phi i32 [ %add.i, %while.cond.i ], [ 3, %while.cond.preheader.i ] %rem8.i = srem i32 %4, %i.021.i %cmp9.i = icmp eq i32 %rem8.i, 0 br i1 %cmp9.i, label %for.cond4, label %while.cond.i prime.exit.thread: ; preds = %while.cond.i, %for.body7, %while.cond.preheader.i %inc1328 = add nsw i32 %count.032, 1 br label %for.cond4 for.cond4: ; preds = %while.body.i, %if.end.i, %prime.exit.thread %5 = phi i32 [ %inc1328, %prime.exit.thread ], [ %count.032, %if.end.i ], [ %count.032, %while.body.i ] %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp5 = icmp slt i64 %indvars.iv.next36, %7 br i1 %cmp5, label %for.body7, label %for.end16, !llvm.loop !12 for.end16: ; preds = %for.cond4, %entry, %for.cond4.preheader %count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %5, %for.cond4 ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @free(ptr noundef %call1) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind memory(write) uwtable define dso_local i32 @prime(i32 noundef %data) local_unnamed_addr #4 { entry: %cmp = icmp eq i32 %data, 2 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp1 = icmp slt i32 %data, 2 %rem = and i32 %data, 1 %cmp2 = icmp eq i32 %rem, 0 %or.cond = or i1 %cmp1, %cmp2 br i1 %or.cond, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %if.end %conv5 = sitofp i32 %data to double %call19 = tail call double @sqrt(double noundef %conv5) #7 %cmp620 = fcmp ult double %call19, 3.000000e+00 br i1 %cmp620, label %cleanup, label %while.body while.cond: ; preds = %while.body %add = add nuw nsw i32 %i.021, 2 %conv = sitofp i32 %add to double %call = tail call double @sqrt(double noundef %conv5) #7 %cmp6 = fcmp ult double %call, %conv br i1 %cmp6, label %cleanup, label %while.body, !llvm.loop !11 while.body: ; preds = %while.cond.preheader, %while.cond %i.021 = phi i32 [ %add, %while.cond ], [ 3, %while.cond.preheader ] %rem8 = srem i32 %data, %i.021 %cmp9 = icmp eq i32 %rem8, 0 br i1 %cmp9, label %cleanup, label %while.cond cleanup: ; preds = %while.body, %while.cond, %while.cond.preheader, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ 0, %if.end ], [ 1, %while.cond.preheader ], [ 0, %while.body ], [ 1, %while.cond ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5 ; 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 memory(write) declare double @sqrt(double noundef) local_unnamed_addr #6 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 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 #6 = { 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 #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 = !{!"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<math.h> int check(int x){ int i; if(x%2==0&&x!=2||x==1)return 0; else if(x%2==1)for(i=3; i<=sqrt(x); i+=2)if(x%i==0)return 0; return 1; } int main(){ int i, n, a, count=0; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d", &a); if(check(a))count++; } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_247994/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_247994/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 memory(write) uwtable define dso_local i32 @check(i32 noundef %x) local_unnamed_addr #0 { entry: %rem = srem i32 %x, 2 %cmp = icmp eq i32 %rem, 0 %cmp1 = icmp ne i32 %x, 2 %or.cond = and i1 %cmp1, %cmp %cmp2 = icmp eq i32 %x, 1 %or.cond15 = or i1 %cmp2, %or.cond br i1 %or.cond15, label %cleanup, label %if.else if.else: ; preds = %entry %cmp4 = icmp eq i32 %rem, 1 br i1 %cmp4, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %if.else %conv6 = sitofp i32 %x to double %call23 = tail call double @sqrt(double noundef %conv6) #5 %cmp724 = fcmp ult double %call23, 3.000000e+00 br i1 %cmp724, label %cleanup, label %for.body for.cond: ; preds = %for.body %add = add nuw nsw i32 %i.025, 2 %conv = sitofp i32 %add to double %call = tail call double @sqrt(double noundef %conv6) #5 %cmp7 = fcmp ult double %call, %conv br i1 %cmp7, label %cleanup, label %for.body, !llvm.loop !5 for.body: ; preds = %for.cond.preheader, %for.cond %i.025 = phi i32 [ %add, %for.cond ], [ 3, %for.cond.preheader ] %rem9 = srem i32 %x, %i.025 %cmp10 = icmp eq i32 %rem9, 0 br i1 %cmp10, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.else, %entry %retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 1, %for.cond.preheader ], [ 0, %for.body ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double 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 uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %a = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !7 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body, label %for.end for.body: ; preds = %entry, %for.cond %count.012 = phi i32 [ %2, %for.cond ], [ 0, %entry ] %i.011 = phi i32 [ %inc3, %for.cond ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !7 %rem.i = srem i32 %1, 2 %cmp.i = icmp eq i32 %rem.i, 0 %cmp1.i = icmp ne i32 %1, 2 %or.cond.i = and i1 %cmp1.i, %cmp.i %cmp2.i = icmp eq i32 %1, 1 %or.cond15.i = or i1 %cmp2.i, %or.cond.i br i1 %or.cond15.i, label %for.cond, label %if.else.i if.else.i: ; preds = %for.body %cmp4.i = icmp eq i32 %rem.i, 1 br i1 %cmp4.i, label %for.cond.preheader.i, label %check.exit.thread for.cond.preheader.i: ; preds = %if.else.i %conv6.i = sitofp i32 %1 to double %call23.i = call double @sqrt(double noundef %conv6.i) #5 %cmp724.i = fcmp ult double %call23.i, 3.000000e+00 br i1 %cmp724.i, label %check.exit.thread, label %for.body.i for.cond.i: ; preds = %for.body.i %add.i = add nuw nsw i32 %i.025.i, 2 %conv.i = sitofp i32 %add.i to double %call.i = call double @sqrt(double noundef %conv6.i) #5 %cmp7.i = fcmp ult double %call.i, %conv.i br i1 %cmp7.i, label %check.exit.thread, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i %i.025.i = phi i32 [ %add.i, %for.cond.i ], [ 3, %for.cond.preheader.i ] %rem9.i = srem i32 %1, %i.025.i %cmp10.i = icmp eq i32 %rem9.i, 0 br i1 %cmp10.i, label %for.cond, label %for.cond.i check.exit.thread: ; preds = %for.cond.i, %if.else.i, %for.cond.preheader.i %inc9 = add nsw i32 %count.012, 1 br label %for.cond for.cond: ; preds = %for.body.i, %for.body, %check.exit.thread %2 = phi i32 [ %inc9, %check.exit.thread ], [ %count.012, %for.body ], [ %count.012, %for.body.i ] %inc3 = add nuw nsw i32 %i.011, 1 %3 = load i32, ptr %n, align 4, !tbaa !7 %cmp = icmp slt i32 %inc3, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.cond, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.cond ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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 #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> #include<math.h> int main(){ int i, j; int n, tmp; int count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", &tmp); for(j = 2; j <= sqrt(tmp); j++){ if (tmp % j == 0) break; } if (j > sqrt(tmp) || sqrt(tmp) < 2){ count++; } } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248043/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248043/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %tmp = 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 %tmp) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %0, 0 br i1 %cmp37, label %for.body, label %for.end24 for.body: ; preds = %entry, %for.inc22 %count.039 = phi i32 [ %count.1, %for.inc22 ], [ 0, %entry ] %i.038 = phi i32 [ %inc23, %for.inc22 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp) %1 = load i32, ptr %tmp, align 4, !tbaa !5 %conv331 = sitofp i32 %1 to double %call432 = call double @sqrt(double noundef %conv331) #4 %cmp533 = fcmp ult double %call432, 2.000000e+00 br i1 %cmp533, label %for.end, label %for.body7.preheader for.body7.preheader: ; preds = %for.body %2 = load i32, ptr %tmp, align 4, !tbaa !5 %3 = and i32 %2, 1 %cmp842 = icmp eq i32 %3, 0 br i1 %cmp842, label %for.end, label %for.cond2 for.cond2: ; preds = %for.body7.preheader, %for.body7 %4 = phi i32 [ %5, %for.body7 ], [ %2, %for.body7.preheader ] %j.03443 = phi i32 [ %inc, %for.body7 ], [ 2, %for.body7.preheader ] %inc = add nuw nsw i32 %j.03443, 1 %conv = sitofp i32 %inc to double %conv3 = sitofp i32 %4 to double %call4 = call double @sqrt(double noundef %conv3) #4 %cmp5 = fcmp ult double %call4, %conv br i1 %cmp5, label %for.end, label %for.body7, !llvm.loop !9 for.body7: ; preds = %for.cond2 %5 = load i32, ptr %tmp, align 4, !tbaa !5 %rem = srem i32 %5, %inc %cmp8 = icmp eq i32 %rem, 0 br i1 %cmp8, label %for.end, label %for.cond2, !llvm.loop !9 for.end: ; preds = %for.body7, %for.cond2, %for.body7.preheader, %for.body %conv.lcssa = phi double [ 2.000000e+00, %for.body ], [ 2.000000e+00, %for.body7.preheader ], [ %conv, %for.cond2 ], [ %conv, %for.body7 ] %6 = load i32, ptr %tmp, align 4, !tbaa !5 %conv11 = sitofp i32 %6 to double %call12 = call double @sqrt(double noundef %conv11) #4 %cmp13 = fcmp olt double %call12, %conv.lcssa br i1 %cmp13, label %if.then19, label %lor.lhs.false lor.lhs.false: ; preds = %for.end %7 = load i32, ptr %tmp, align 4, !tbaa !5 %conv15 = sitofp i32 %7 to double %call16 = call double @sqrt(double noundef %conv15) #4 %cmp17 = fcmp olt double %call16, 2.000000e+00 br i1 %cmp17, label %if.then19, label %for.inc22 if.then19: ; preds = %lor.lhs.false, %for.end %inc20 = add nsw i32 %count.039, 1 br label %for.inc22 for.inc22: ; preds = %lor.lhs.false, %if.then19 %count.1 = phi i32 [ %inc20, %if.then19 ], [ %count.039, %lor.lhs.false ] %inc23 = add nuw nsw i32 %i.038, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc23, %8 br i1 %cmp, label %for.body, label %for.end24, !llvm.loop !11 for.end24: ; preds = %for.inc22, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %for.inc22 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<math.h> int main(){ int n, t, count, i, j; int num[10000]; scanf("%d",&n); for(i=0; i < n; i++){ scanf("%d",&num[i]); } count = n; for (i = 0; i < n; i++){ if (num[i] == 2) { } else if(num[i] % 2 == 0){ count--; } else{ t = sqrt(num[i]); for(j=3; j<=t; j=j+2){ if(num[i] % j == 0){ count--; break; } } } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248087/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248087/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %num = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp49 = icmp sgt i32 %0, 0 br i1 %cmp49, label %for.body, label %for.end34 for.cond2.preheader: ; preds = %for.body %cmp353 = icmp sgt i32 %1, 0 br i1 %cmp353, label %for.body4, label %for.end34 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc32 %indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.inc32 ], [ 0, %for.cond2.preheader ] %count.054 = phi i32 [ %count.1, %for.inc32 ], [ %1, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %indvars.iv59 %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 2 br i1 %cmp7, label %for.inc32, label %if.else if.else: ; preds = %for.body4 %4 = and i32 %3, 1 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %if.else12 if.then11: ; preds = %if.else %dec = add nsw i32 %count.054, -1 br label %for.inc32 if.else12: ; preds = %if.else %conv = sitofp i32 %3 to double %call15 = call double @sqrt(double noundef %conv) #4 %conv16 = fptosi double %call15 to i32 %cmp18.not51 = icmp slt i32 %conv16, 3 br i1 %cmp18.not51, label %for.inc32, label %for.body20.lr.ph for.body20.lr.ph: ; preds = %if.else12 %5 = load i32, ptr %arrayidx6, align 4, !tbaa !5 br label %for.body20 for.cond17: ; preds = %for.body20 %add = add nuw nsw i32 %j.052, 2 %cmp18.not = icmp sgt i32 %add, %conv16 br i1 %cmp18.not, label %for.inc32, label %for.body20, !llvm.loop !11 for.body20: ; preds = %for.body20.lr.ph, %for.cond17 %j.052 = phi i32 [ 3, %for.body20.lr.ph ], [ %add, %for.cond17 ] %rem23 = srem i32 %5, %j.052 %cmp24 = icmp eq i32 %rem23, 0 br i1 %cmp24, label %if.then26, label %for.cond17 if.then26: ; preds = %for.body20 %dec27 = add nsw i32 %count.054, -1 br label %for.inc32 for.inc32: ; preds = %for.cond17, %if.else12, %for.body4, %if.then26, %if.then11 %count.1 = phi i32 [ %count.054, %for.body4 ], [ %dec, %if.then11 ], [ %dec27, %if.then26 ], [ %count.054, %if.else12 ], [ %count.054, %for.cond17 ] %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp3 = icmp slt i64 %indvars.iv.next60, %7 br i1 %cmp3, label %for.body4, label %for.end34, !llvm.loop !12 for.end34: ; preds = %for.inc32, %entry, %for.cond2.preheader %count.0.lcssa = phi i32 [ %1, %for.cond2.preheader ], [ %0, %entry ], [ %count.1, %for.inc32 ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !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,sum=0,i; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { if(b>=2&&c>=4) { for(i=1;i<=a;i++) if(b/i>=2&&c/i>=4) sum++; printf("%d\n",sum*7); } else printf("0\n"); sum=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24813/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24813/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp.not21 = icmp eq i32 %call20, -1 br i1 %cmp.not21, label %while.end, label %while.body while.body: ; preds = %entry, %if.end12 %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %0, 1 %1 = load i32, ptr %c, align 4 %cmp2 = icmp sgt i32 %1, 3 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %for.cond.preheader, label %if.else for.cond.preheader: ; preds = %while.body %2 = load i32, ptr %a, align 4, !tbaa !5 %cmp3.not17 = icmp slt i32 %2, 1 br i1 %cmp3.not17, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.inc %i.019 = phi i32 [ %inc9, %for.inc ], [ 1, %for.cond.preheader ] %sum.118 = phi i32 [ %sum.2, %for.inc ], [ 0, %for.cond.preheader ] %div = sdiv i32 %0, %i.019 %cmp4 = icmp sgt i32 %div, 1 br i1 %cmp4, label %land.lhs.true5, label %for.inc land.lhs.true5: ; preds = %for.body %div6 = sdiv i32 %1, %i.019 %cmp7 = icmp sgt i32 %div6, 3 %inc = zext i1 %cmp7 to i32 %spec.select = add nsw i32 %sum.118, %inc br label %for.inc for.inc: ; preds = %land.lhs.true5, %for.body %sum.2 = phi i32 [ %sum.118, %for.body ], [ %spec.select, %land.lhs.true5 ] %inc9 = add nuw i32 %i.019, 1 %exitcond.not = icmp eq i32 %i.019, %2 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.inc, %for.cond.preheader %sum.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %sum.2, %for.inc ] %mul = mul nsw i32 %sum.1.lcssa, 7 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end12 if.else: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end12 if.end12: ; preds = %if.else, %for.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end12, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> int isPrime(int x){ int i; if (x <= 1) return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3;i*i<=x;i+=2){ if(x%i==0) return 0; } return 1; } int main() { int a,b,i; int c=0; scanf("%d",&a); for(int i = 0;i<a;i++){ scanf("%d",&b); if(isPrime(b)==1){ c++; } } printf("%d\n",c); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248180/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @isPrime(i32 noundef %x) local_unnamed_addr #0 { entry: %cmp = icmp slt i32 %x, 2 br i1 %cmp, label %cleanup, label %if.else if.else: ; preds = %entry %cmp1 = icmp eq i32 %x, 2 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %if.else %rem = and i32 %x, 1 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %if.end3 %cmp7.not19 = icmp ult i32 %x, 9 br i1 %cmp7.not19, label %cleanup, label %for.body for.cond: ; preds = %for.body %add = add nuw nsw i32 %i.020, 2 %mul = mul nsw i32 %add, %add %cmp7.not = icmp sgt i32 %mul, %x br i1 %cmp7.not, label %cleanup, label %for.body, !llvm.loop !5 for.body: ; preds = %for.cond.preheader, %for.cond %i.020 = phi i32 [ %add, %for.cond ], [ 3, %for.cond.preheader ] %rem8 = srem i32 %x, %i.020 %cmp9 = icmp eq i32 %rem8, 0 br i1 %cmp9, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.end3, %if.else, %entry %retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 0, %if.end3 ], [ 1, %for.cond.preheader ], [ 0, %for.body ], [ 1, %for.cond ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !7 %cmp12 = icmp sgt i32 %0, 0 br i1 %cmp12, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.cond ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 for.body: ; preds = %entry, %for.cond %i1.014 = phi i32 [ %inc5, %for.cond ], [ 0, %entry ] %c.013 = phi i32 [ %2, %for.cond ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %1 = load i32, ptr %b, align 4, !tbaa !7 %cmp.i = icmp slt i32 %1, 2 br i1 %cmp.i, label %for.cond, label %if.else.i if.else.i: ; preds = %for.body %cmp1.i = icmp eq i32 %1, 2 br i1 %cmp1.i, label %isPrime.exit, label %if.end3.i if.end3.i: ; preds = %if.else.i %rem.i = and i32 %1, 1 %cmp4.i = icmp eq i32 %rem.i, 0 br i1 %cmp4.i, label %for.cond, label %for.cond.preheader.i for.cond.preheader.i: ; preds = %if.end3.i %cmp7.not19.i = icmp ult i32 %1, 9 br i1 %cmp7.not19.i, label %isPrime.exit, label %for.body.i for.cond.i: ; preds = %for.body.i %add.i = add nuw nsw i32 %i.020.i, 2 %mul.i = mul nsw i32 %add.i, %add.i %cmp7.not.i = icmp sgt i32 %mul.i, %1 br i1 %cmp7.not.i, label %isPrime.exit, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i %i.020.i = phi i32 [ %add.i, %for.cond.i ], [ 3, %for.cond.preheader.i ] %rem8.i = srem i32 %1, %i.020.i %cmp9.i = icmp eq i32 %rem8.i, 0 br i1 %cmp9.i, label %for.cond, label %for.cond.i isPrime.exit: ; preds = %for.cond.i, %if.else.i, %for.cond.preheader.i %inc = add nsw i32 %c.013, 1 br label %for.cond for.cond: ; preds = %for.body.i, %if.end3.i, %for.body, %isPrime.exit %2 = phi i32 [ %inc, %isPrime.exit ], [ %c.013, %for.body ], [ %c.013, %if.end3.i ], [ %c.013, %for.body.i ] %inc5 = add nuw nsw i32 %i1.014, 1 %3 = load i32, ptr %a, align 4, !tbaa !7 %cmp = icmp slt i32 %inc5, %3 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 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int IsPrime(int x) { if (x<2) return 0; else if (x==2) return 1; if (x%2==0) return 0; int i; for (i=3; i*i<=x; i+=2) { if (x%i==0) return 0; } return 1; } int ReadValue() { int value; scanf("%d",&value); return value; } int solve(int n) { int ans=0; for (int i=0; i<n; i++) { int value=ReadValue(); ans+=(IsPrime(value)?1:0); } return ans; } void Display(int n) { printf("%d\n",solve(n)); } int main() { int n=ReadValue(); Display(n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248223/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248223/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @IsPrime(i32 noundef %x) local_unnamed_addr #0 { entry: %cmp = icmp slt i32 %x, 2 br i1 %cmp, label %return, label %if.else if.else: ; preds = %entry %cmp1 = icmp eq i32 %x, 2 br i1 %cmp1, label %return, label %if.end3 if.end3: ; preds = %if.else %rem = and i32 %x, 1 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %return, label %for.cond.preheader for.cond.preheader: ; preds = %if.end3 %cmp7.not19 = icmp ult i32 %x, 9 br i1 %cmp7.not19, label %return, label %for.body for.cond: ; preds = %for.body %add = add nuw nsw i32 %i.020, 2 %mul = mul nsw i32 %add, %add %cmp7.not = icmp sgt i32 %mul, %x br i1 %cmp7.not, label %return, label %for.body, !llvm.loop !5 for.body: ; preds = %for.cond.preheader, %for.cond %i.020 = phi i32 [ %add, %for.cond ], [ 3, %for.cond.preheader ] %rem8 = srem i32 %x, %i.020 %cmp9 = icmp eq i32 %rem8, 0 br i1 %cmp9, label %return, label %for.cond return: ; preds = %for.cond, %for.body, %for.cond.preheader, %if.end3, %if.else, %entry %retval.1 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 0, %if.end3 ], [ 1, %for.cond.preheader ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @ReadValue() local_unnamed_addr #2 { entry: %value = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value) %0 = load i32, ptr %value, align 4, !tbaa !7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value) #4 ret i32 %0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @solve(i32 noundef %n) local_unnamed_addr #2 { entry: %value.i = alloca i32, align 4 %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %IsPrime.exit, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %IsPrime.exit ] ret i32 %ans.0.lcssa for.body: ; preds = %entry, %IsPrime.exit %ans.06 = phi i32 [ %add, %IsPrime.exit ], [ 0, %entry ] %i.05 = phi i32 [ %inc, %IsPrime.exit ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value.i) #4 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value.i) %0 = load i32, ptr %value.i, align 4, !tbaa !7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value.i) #4 %cmp.i = icmp slt i32 %0, 2 br i1 %cmp.i, label %IsPrime.exit, label %if.else.i if.else.i: ; preds = %for.body %cmp1.i = icmp eq i32 %0, 2 br i1 %cmp1.i, label %IsPrime.exit, label %if.end3.i if.end3.i: ; preds = %if.else.i %rem.i = and i32 %0, 1 %cmp4.i = icmp eq i32 %rem.i, 0 br i1 %cmp4.i, label %IsPrime.exit, label %for.cond.preheader.i for.cond.preheader.i: ; preds = %if.end3.i %cmp7.not19.i = icmp ult i32 %0, 9 br i1 %cmp7.not19.i, label %IsPrime.exit, label %for.body.i for.cond.i: ; preds = %for.body.i %add.i = add nuw nsw i32 %i.020.i, 2 %mul.i = mul nsw i32 %add.i, %add.i %cmp7.not.i = icmp sgt i32 %mul.i, %0 br i1 %cmp7.not.i, label %IsPrime.exit, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i %i.020.i = phi i32 [ %add.i, %for.cond.i ], [ 3, %for.cond.preheader.i ] %rem8.i = srem i32 %0, %i.020.i %cmp9.i = icmp eq i32 %rem8.i, 0 br i1 %cmp9.i, label %IsPrime.exit, label %for.cond.i IsPrime.exit: ; preds = %for.cond.i, %for.body.i, %for.body, %if.else.i, %if.end3.i, %for.cond.preheader.i %retval.1.i = phi i32 [ 0, %for.body ], [ 1, %if.else.i ], [ 0, %if.end3.i ], [ 1, %for.cond.preheader.i ], [ 0, %for.body.i ], [ 1, %for.cond.i ] %add = add nuw nsw i32 %retval.1.i, %ans.06 %inc = add nuw nsw i32 %i.05, 1 %exitcond.not = icmp eq i32 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11 } ; Function Attrs: nofree nounwind uwtable define dso_local void @Display(i32 noundef %n) local_unnamed_addr #2 { entry: %value.i.i = alloca i32, align 4 %cmp4.i = icmp sgt i32 %n, 0 br i1 %cmp4.i, label %for.body.i, label %solve.exit for.body.i: ; preds = %entry, %IsPrime.exit.i %ans.06.i = phi i32 [ %add.i, %IsPrime.exit.i ], [ 0, %entry ] %i.05.i = phi i32 [ %inc.i, %IsPrime.exit.i ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value.i.i) #4 %call.i.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value.i.i) %0 = load i32, ptr %value.i.i, align 4, !tbaa !7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value.i.i) #4 %cmp.i.i = icmp slt i32 %0, 2 br i1 %cmp.i.i, label %IsPrime.exit.i, label %if.else.i.i if.else.i.i: ; preds = %for.body.i %cmp1.i.i = icmp eq i32 %0, 2 br i1 %cmp1.i.i, label %IsPrime.exit.i, label %if.end3.i.i if.end3.i.i: ; preds = %if.else.i.i %rem.i.i = and i32 %0, 1 %cmp4.i.i = icmp eq i32 %rem.i.i, 0 br i1 %cmp4.i.i, label %IsPrime.exit.i, label %for.cond.preheader.i.i for.cond.preheader.i.i: ; preds = %if.end3.i.i %cmp7.not19.i.i = icmp ult i32 %0, 9 br i1 %cmp7.not19.i.i, label %IsPrime.exit.i, label %for.body.i.i for.cond.i.i: ; preds = %for.body.i.i %add.i.i = add nuw nsw i32 %i.020.i.i, 2 %mul.i.i = mul nsw i32 %add.i.i, %add.i.i %cmp7.not.i.i = icmp sgt i32 %mul.i.i, %0 br i1 %cmp7.not.i.i, label %IsPrime.exit.i, label %for.body.i.i, !llvm.loop !5 for.body.i.i: ; preds = %for.cond.preheader.i.i, %for.cond.i.i %i.020.i.i = phi i32 [ %add.i.i, %for.cond.i.i ], [ 3, %for.cond.preheader.i.i ] %rem8.i.i = srem i32 %0, %i.020.i.i %cmp9.i.i = icmp eq i32 %rem8.i.i, 0 br i1 %cmp9.i.i, label %IsPrime.exit.i, label %for.cond.i.i IsPrime.exit.i: ; preds = %for.body.i.i, %for.cond.i.i, %for.cond.preheader.i.i, %if.end3.i.i, %if.else.i.i, %for.body.i %retval.1.i.i = phi i32 [ 0, %for.body.i ], [ 1, %if.else.i.i ], [ 0, %if.end3.i.i ], [ 1, %for.cond.preheader.i.i ], [ 1, %for.cond.i.i ], [ 0, %for.body.i.i ] %add.i = add nuw nsw i32 %retval.1.i.i, %ans.06.i %inc.i = add nuw nsw i32 %i.05.i, 1 %exitcond.not.i = icmp eq i32 %inc.i, %n br i1 %exitcond.not.i, label %solve.exit, label %for.body.i, !llvm.loop !11 solve.exit: ; preds = %IsPrime.exit.i, %entry %ans.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %IsPrime.exit.i ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa.i) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %value.i.i.i = alloca i32, align 4 %value.i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value.i) #4 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value.i) %0 = load i32, ptr %value.i, align 4, !tbaa !7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value.i) #4 %cmp4.i.i = icmp sgt i32 %0, 0 br i1 %cmp4.i.i, label %for.body.i.i, label %Display.exit for.body.i.i: ; preds = %entry, %IsPrime.exit.i.i %ans.06.i.i = phi i32 [ %add.i.i, %IsPrime.exit.i.i ], [ 0, %entry ] %i.05.i.i = phi i32 [ %inc.i.i, %IsPrime.exit.i.i ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value.i.i.i) #4 %call.i.i.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value.i.i.i) %1 = load i32, ptr %value.i.i.i, align 4, !tbaa !7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value.i.i.i) #4 %cmp.i.i.i = icmp slt i32 %1, 2 br i1 %cmp.i.i.i, label %IsPrime.exit.i.i, label %if.else.i.i.i if.else.i.i.i: ; preds = %for.body.i.i %cmp1.i.i.i = icmp eq i32 %1, 2 br i1 %cmp1.i.i.i, label %IsPrime.exit.i.i, label %if.end3.i.i.i if.end3.i.i.i: ; preds = %if.else.i.i.i %rem.i.i.i = and i32 %1, 1 %cmp4.i.i.i = icmp eq i32 %rem.i.i.i, 0 br i1 %cmp4.i.i.i, label %IsPrime.exit.i.i, label %for.cond.preheader.i.i.i for.cond.preheader.i.i.i: ; preds = %if.end3.i.i.i %cmp7.not19.i.i.i = icmp ult i32 %1, 9 br i1 %cmp7.not19.i.i.i, label %IsPrime.exit.i.i, label %for.body.i.i.i for.cond.i.i.i: ; preds = %for.body.i.i.i %add.i.i.i = add nuw nsw i32 %i.020.i.i.i, 2 %mul.i.i.i = mul nsw i32 %add.i.i.i, %add.i.i.i %cmp7.not.i.i.i = icmp sgt i32 %mul.i.i.i, %1 br i1 %cmp7.not.i.i.i, label %IsPrime.exit.i.i, label %for.body.i.i.i, !llvm.loop !5 for.body.i.i.i: ; preds = %for.cond.preheader.i.i.i, %for.cond.i.i.i %i.020.i.i.i = phi i32 [ %add.i.i.i, %for.cond.i.i.i ], [ 3, %for.cond.preheader.i.i.i ] %rem8.i.i.i = srem i32 %1, %i.020.i.i.i %cmp9.i.i.i = icmp eq i32 %rem8.i.i.i, 0 br i1 %cmp9.i.i.i, label %IsPrime.exit.i.i, label %for.cond.i.i.i IsPrime.exit.i.i: ; preds = %for.body.i.i.i, %for.cond.i.i.i, %for.cond.preheader.i.i.i, %if.end3.i.i.i, %if.else.i.i.i, %for.body.i.i %retval.1.i.i.i = phi i32 [ 0, %for.body.i.i ], [ 1, %if.else.i.i.i ], [ 0, %if.end3.i.i.i ], [ 1, %for.cond.preheader.i.i.i ], [ 0, %for.body.i.i.i ], [ 1, %for.cond.i.i.i ] %add.i.i = add nuw nsw i32 %retval.1.i.i.i, %ans.06.i.i %inc.i.i = add nuw nsw i32 %i.05.i.i, 1 %exitcond.not.i.i = icmp eq i32 %inc.i.i, %0 br i1 %exitcond.not.i.i, label %Display.exit, label %for.body.i.i, !llvm.loop !11 Display.exit: ; preds = %IsPrime.exit.i.i, %entry %ans.0.lcssa.i.i = phi i32 [ 0, %entry ], [ %add.i.i, %IsPrime.exit.i.i ] %call1.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa.i.i) ret i32 0 } attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> #include<math.h> int main(){ int n,ans1=0,ans2; scanf("%d",&n); if(n<=0||n>10000)return 0; int a,i,j; for(i=0;i<n;i++){ scanf("%d",&a); if(a<2||a>100000000)return 0; if(a==2){ ans1++; } if(a==3){ ans1++; } if(a==5){ ans1++; } if(a%2==0); else if(a%3==0); else if(a%5==0); else{ ans2=0; for(j=7;j<=sqrt(a);j=j+2){ if(a%j==0)ans2++; } if(ans2==0){ans1++; } } } printf("%d\n",ans1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248274/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248274/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a = 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 %1 = add i32 %0, -10001 %or.cond = icmp ult i32 %1, -10000 br i1 %or.cond, label %cleanup56, label %for.body.preheader for.body.preheader: ; preds = %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc50 %i.082 = phi i32 [ %inc51, %for.inc50 ], [ 0, %for.body.preheader ] %ans1.081 = phi i32 [ %ans1.4, %for.inc50 ], [ 0, %for.body.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4 %3 = add i32 %2, -100000001 %or.cond59 = icmp ult i32 %3, -99999999 br i1 %or.cond59, label %cleanup, label %if.end8 if.end8: ; preds = %for.body %cmp9 = icmp eq i32 %2, 2 %inc = zext i1 %cmp9 to i32 %spec.select = add nsw i32 %ans1.081, %inc %cmp12 = icmp eq i32 %2, 3 %inc14 = zext i1 %cmp12 to i32 %ans1.2 = add nsw i32 %spec.select, %inc14 %cmp16 = icmp eq i32 %2, 5 %inc18 = zext i1 %cmp16 to i32 %ans1.3 = add nsw i32 %ans1.2, %inc18 %4 = and i32 %2, 1 %cmp20 = icmp eq i32 %4, 0 %rem2272 = urem i32 %2, 3 %cmp23 = icmp eq i32 %rem2272, 0 %or.cond68 = or i1 %cmp20, %cmp23 %rem2673 = urem i32 %2, 5 %cmp27 = icmp eq i32 %rem2673, 0 %or.cond69 = or i1 %cmp27, %or.cond68 br i1 %or.cond69, label %for.inc50, label %for.cond30.preheader for.cond30.preheader: ; preds = %if.end8 %conv3175 = sitofp i32 %2 to double %call3276 = call double @sqrt(double noundef %conv3175) #4 %cmp3377 = fcmp ult double %call3276, 7.000000e+00 br i1 %cmp3377, label %for.end, label %for.body35 for.body35: ; preds = %for.cond30.preheader, %for.body35 %j.079 = phi i32 [ %add, %for.body35 ], [ 7, %for.cond30.preheader ] %ans2.078 = phi i32 [ %spec.select70, %for.body35 ], [ 0, %for.cond30.preheader ] %5 = load i32, ptr %a, align 4, !tbaa !5 %rem36 = srem i32 %5, %j.079 %cmp37 = icmp eq i32 %rem36, 0 %inc40 = zext i1 %cmp37 to i32 %spec.select70 = add nuw nsw i32 %ans2.078, %inc40 %add = add nuw nsw i32 %j.079, 2 %conv = sitofp i32 %add to double %conv31 = sitofp i32 %5 to double %call32 = call double @sqrt(double noundef %conv31) #4 %cmp33 = fcmp ult double %call32, %conv br i1 %cmp33, label %for.end, label %for.body35, !llvm.loop !9 for.end: ; preds = %for.body35, %for.cond30.preheader %ans2.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %spec.select70, %for.body35 ] %cmp42 = icmp eq i32 %ans2.0.lcssa, 0 %inc45 = zext i1 %cmp42 to i32 %spec.select71 = add nsw i32 %ans1.3, %inc45 br label %for.inc50 for.inc50: ; preds = %for.end, %if.end8 %ans1.4 = phi i32 [ %ans1.3, %if.end8 ], [ %spec.select71, %for.end ] %inc51 = add nuw nsw i32 %i.082, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc51, %6 br i1 %cmp2, label %for.body, label %for.end52, !llvm.loop !11 for.end52: ; preds = %for.inc50 %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans1.4) br label %cleanup cleanup: ; preds = %for.body, %for.end52 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 br label %cleanup56 cleanup56: ; preds = %entry, %cleanup call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<math.h> #define N 10000 #define MAX 100000000 #define MIN 2 int main(){ int i,n,j,num[N],count=0; scanf("%d",&n); if(n>N) return 0; for(i=n;i>0;i--){ scanf("%d",&num[i]); if(num[i]>=MIN&&num[i]<=MAX){ if(num[i]!=2&&num[i]%2==0) count++; else{ for(j=3;j<=sqrt(num[i]);j+=2){ if(num[i]%j==0){ count++; break; } } } } else break; } printf("%d\n",n-count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248317/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248317/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %num = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %num) #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 = icmp sgt i32 %0, 10000 br i1 %cmp, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp162 = icmp sgt i32 %0, 0 br i1 %cmp162, label %for.body, label %for.end38 for.body: ; preds = %for.cond.preheader, %for.inc37 %count.064 = phi i32 [ %count.1, %for.inc37 ], [ 0, %for.cond.preheader ] %i.063 = phi i32 [ %dec, %for.inc37 ], [ %0, %for.cond.preheader ] %idxprom = zext i32 %i.063 to i64 %arrayidx = getelementptr inbounds [10000 x i32], ptr %num, i64 0, i64 %idxprom %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = add i32 %1, -2 %or.cond = icmp ult i32 %2, 99999999 br i1 %or.cond, label %if.then9, label %for.end38.loopexit if.then9: ; preds = %for.body %cmp12.not = icmp ne i32 %1, 2 %rem = and i32 %1, 1 %cmp16 = icmp eq i32 %rem, 0 %or.cond57 = and i1 %cmp12.not, %cmp16 br i1 %or.cond57, label %if.then17, label %for.cond18.preheader for.cond18.preheader: ; preds = %if.then9 %conv2158 = sitofp i32 %1 to double %call2259 = call double @sqrt(double noundef %conv2158) #4 %cmp2360 = fcmp ult double %call2259, 3.000000e+00 br i1 %cmp2360, label %for.inc37, label %for.body25 if.then17: ; preds = %if.then9 %inc = add nsw i32 %count.064, 1 br label %for.inc37 for.cond18: ; preds = %for.body25 %add = add nuw nsw i32 %j.061, 2 %conv = sitofp i32 %add to double %conv21 = sitofp i32 %3 to double %call22 = call double @sqrt(double noundef %conv21) #4 %cmp23 = fcmp ult double %call22, %conv br i1 %cmp23, label %for.inc37, label %for.body25, !llvm.loop !9 for.body25: ; preds = %for.cond18.preheader, %for.cond18 %j.061 = phi i32 [ %add, %for.cond18 ], [ 3, %for.cond18.preheader ] %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %rem28 = srem i32 %3, %j.061 %cmp29 = icmp eq i32 %rem28, 0 br i1 %cmp29, label %if.then31, label %for.cond18 if.then31: ; preds = %for.body25 %inc32 = add nsw i32 %count.064, 1 br label %for.inc37 for.inc37: ; preds = %for.cond18, %for.cond18.preheader, %if.then31, %if.then17 %count.1 = phi i32 [ %inc, %if.then17 ], [ %inc32, %if.then31 ], [ %count.064, %for.cond18.preheader ], [ %count.064, %for.cond18 ] %dec = add nsw i32 %i.063, -1 %cmp1 = icmp sgt i32 %i.063, 1 br i1 %cmp1, label %for.body, label %for.end38.loopexit, !llvm.loop !11 for.end38.loopexit: ; preds = %for.body, %for.inc37 %count.0.lcssa.ph = phi i32 [ %count.1, %for.inc37 ], [ %count.064, %for.body ] %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.end38 for.end38: ; preds = %for.end38.loopexit, %for.cond.preheader %4 = phi i32 [ %0, %for.cond.preheader ], [ %.pre, %for.end38.loopexit ] %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.0.lcssa.ph, %for.end38.loopexit ] %sub = sub nsw i32 %4, %count.0.lcssa %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) br label %cleanup cleanup: ; preds = %entry, %for.end38 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<math.h> int main(){ int i,j=0,l; int x; int count=0; int n[10000]; scanf("%d",&i); while(1){ scanf("%d",&n[j]); if(i == j+1)break; else j++; } for(j=0 ; j<i ; j++){ for(x=2 ; x <= sqrt(n[j]) ; x++){ if(n[j] % x ==0) break; } if(n[j] % x!=0 || n[j]==2 || n[j]==3) count++; } printf("%d\n",count); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %i = alloca i32, align 4 %n = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %n, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i32, ptr %i, align 4, !tbaa !5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %1 = zext i32 %0 to i64 %cmp = icmp eq i64 %indvars.iv.next, %1 br i1 %cmp, label %for.cond.preheader, label %while.cond for.cond.preheader: ; preds = %while.cond %cmp260 = icmp sgt i32 %0, 0 br i1 %cmp260, label %for.cond3.preheader, label %for.end37 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.end ], [ 0, %for.cond.preheader ] %count.062 = phi i32 [ %count.1, %for.end ], [ 0, %for.cond.preheader ] %arrayidx5 = getelementptr inbounds [10000 x i32], ptr %n, i64 0, i64 %indvars.iv65 %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %conv653 = sitofp i32 %2 to double %call754 = call double @sqrt(double noundef %conv653) #4 %cmp855 = fcmp ult double %call754, 2.000000e+00 br i1 %cmp855, label %for.end, label %for.body10 for.body10: ; preds = %for.cond3.preheader, %for.inc %x.056 = phi i32 [ %inc17, %for.inc ], [ 2, %for.cond3.preheader ] %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %rem = srem i32 %3, %x.056 %cmp13 = icmp eq i32 %rem, 0 br i1 %cmp13, label %for.end, label %for.inc for.inc: ; preds = %for.body10 %inc17 = add nuw nsw i32 %x.056, 1 %conv = sitofp i32 %inc17 to double %conv6 = sitofp i32 %3 to double %call7 = call double @sqrt(double noundef %conv6) #4 %cmp8 = fcmp ult double %call7, %conv br i1 %cmp8, label %for.end, label %for.body10, !llvm.loop !9 for.end: ; preds = %for.inc, %for.body10, %for.cond3.preheader %x.0.lcssa = phi i32 [ 2, %for.cond3.preheader ], [ %x.056, %for.body10 ], [ %inc17, %for.inc ] %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %rem20 = srem i32 %4, %x.0.lcssa %cmp21.not = icmp ne i32 %rem20, 0 %5 = and i32 %4, -2 %6 = icmp eq i32 %5, 2 %or.cond52 = or i1 %cmp21.not, %6 %inc33 = zext i1 %or.cond52 to i32 %count.1 = add nuw nsw i32 %count.062, %inc33 %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1 %7 = load i32, ptr %i, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next66, %8 br i1 %cmp2, label %for.cond3.preheader, label %for.end37, !llvm.loop !11 for.end37: ; preds = %for.end, %for.cond.preheader %count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %count.1, %for.end ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> int main(){ int n,N,i=0,j,count=0; double sqrtN; scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d",&N); if(N==2 || N==3){ count++; continue; } else if(N<2 || N%2==0) continue; else{ sqrtN=sqrt(N); for(i=2;i<=sqrtN;i++){ if(N%i==0) break; } if(i==((int)sqrtN+1)) count++; } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_248410/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_248410/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %N = 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 %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 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.body, label %for.end30 for.body: ; preds = %entry, %for.inc28 %count.045 = phi i32 [ %count.1, %for.inc28 ], [ 0, %entry ] %j.044 = phi i32 [ %inc29, %for.inc28 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %1 = load i32, ptr %N, align 4 %2 = and i32 %1, -2 %or.cond = icmp eq i32 %2, 2 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add nsw i32 %count.045, 1 br label %for.inc28 if.else: ; preds = %for.body %cmp4 = icmp slt i32 %1, 2 %rem = and i32 %1, 1 %cmp6 = icmp eq i32 %rem, 0 %or.cond39 = or i1 %cmp4, %cmp6 br i1 %or.cond39, label %for.inc28, label %if.else8 if.else8: ; preds = %if.else %conv = sitofp i32 %1 to double %call9 = call double @sqrt(double noundef %conv) #4 %cmp1240 = fcmp ult double %call9, 2.000000e+00 br i1 %cmp1240, label %for.end, label %for.body14.lr.ph for.body14.lr.ph: ; preds = %if.else8 %3 = load i32, ptr %N, align 4, !tbaa !5 br label %for.body14 for.body14: ; preds = %for.body14.lr.ph, %for.inc %i.041 = phi i32 [ 2, %for.body14.lr.ph ], [ %inc19, %for.inc ] %rem15 = srem i32 %3, %i.041 %cmp16 = icmp eq i32 %rem15, 0 br i1 %cmp16, label %for.end, label %for.inc for.inc: ; preds = %for.body14 %inc19 = add nuw nsw i32 %i.041, 1 %conv11 = sitofp i32 %inc19 to double %cmp12 = fcmp ult double %call9, %conv11 br i1 %cmp12, label %for.end, label %for.body14, !llvm.loop !9 for.end: ; preds = %for.inc, %for.body14, %if.else8 %i.0.lcssa = phi i32 [ 2, %if.else8 ], [ %i.041, %for.body14 ], [ %inc19, %for.inc ] %conv20 = fptosi double %call9 to i32 %add = add nsw i32 %conv20, 1 %cmp21 = icmp eq i32 %i.0.lcssa, %add %inc24 = zext i1 %cmp21 to i32 %spec.select = add nsw i32 %count.045, %inc24 br label %for.inc28 for.inc28: ; preds = %for.end, %if.else, %if.then %count.1 = phi i32 [ %inc, %if.then ], [ %count.045, %if.else ], [ %spec.select, %for.end ] %inc29 = add nuw nsw i32 %j.044, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc29, %4 br i1 %cmp, label %for.body, label %for.end30, !llvm.loop !11 for.end30: ; preds = %for.inc28, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %for.inc28 ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}