Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #define num_element 256 int main(void) { int i,n,m; char array[num_element]; char a[2]; char b[2]; char input[2]; while(1) { for(i=0;i<num_element;i++) { array[i] = i; } scanf("%d",&n); if(n == 0)return 0; for(i=0;i<n;i++) { scanf("%s %s",a,b); array[a[0]] = b[0]; } scanf("%d",&m); for(i=0;i<m;i++) { scanf("%s",input); printf("%c",array[input[0]]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175525/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175525/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.2 = 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: %n = alloca i32, align 4 %m = alloca i32, align 4 %array = alloca [256 x i8], align 16 %a = alloca [2 x i8], align 1 %b = alloca [2 x i8], align 1 %input = alloca [2 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %array) #4 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %input) #4 br label %vector.body vector.body: ; preds = %vector.body.backedge, %entry %index = phi i64 [ 0, %entry ], [ %index.be, %vector.body.backedge ] %vec.ind = phi <16 x i8> [ <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, %entry ], [ %vec.ind.be, %vector.body.backedge ] %0 = getelementptr inbounds [256 x i8], ptr %array, i64 0, i64 %index store <16 x i8> %vec.ind, ptr %0, align 16, !tbaa !5 %index.next = add nuw i64 %index, 16 %vec.ind.next = add <16 x i8> %vec.ind, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16> %1 = icmp eq i64 %index.next, 256 br i1 %1, label %for.end, label %vector.body.backedge vector.body.backedge: ; preds = %vector.body, %for.end30 %index.be = phi i64 [ %index.next, %vector.body ], [ 0, %for.end30 ] %vec.ind.be = phi <16 x i8> [ %vec.ind.next, %vector.body ], [ <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, %for.end30 ] br label %vector.body, !llvm.loop !8 for.end: ; preds = %vector.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %2 = load i32, ptr %n, align 4, !tbaa !12 %cmp1 = icmp eq i32 %2, 0 br i1 %cmp1, label %if.then, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.end %cmp441 = icmp sgt i32 %2, 0 br i1 %cmp441, label %for.body6, label %for.end15 if.then: ; preds = %for.end call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %input) #4 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %array) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body6: ; preds = %for.cond3.preheader, %for.body6 %i.142 = phi i32 [ %inc14, %for.body6 ], [ 0, %for.cond3.preheader ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i8, ptr %b, align 1, !tbaa !5 %4 = load i8, ptr %a, align 1, !tbaa !5 %idxprom11 = sext i8 %4 to i64 %arrayidx12 = getelementptr inbounds [256 x i8], ptr %array, i64 0, i64 %idxprom11 store i8 %3, ptr %arrayidx12, align 1, !tbaa !5 %inc14 = add nuw nsw i32 %i.142, 1 %5 = load i32, ptr %n, align 4, !tbaa !12 %cmp4 = icmp slt i32 %inc14, %5 br i1 %cmp4, label %for.body6, label %for.end15, !llvm.loop !14 for.end15: ; preds = %for.body6, %for.cond3.preheader %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %6 = load i32, ptr %m, align 4, !tbaa !12 %cmp1843 = icmp sgt i32 %6, 0 br i1 %cmp1843, label %for.body20, label %for.end30 for.body20: ; preds = %for.end15, %for.body20 %i.244 = phi i32 [ %inc29, %for.body20 ], [ 0, %for.end15 ] %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %input) %7 = load i8, ptr %input, align 1, !tbaa !5 %idxprom24 = sext i8 %7 to i64 %arrayidx25 = getelementptr inbounds [256 x i8], ptr %array, i64 0, i64 %idxprom24 %8 = load i8, ptr %arrayidx25, align 1, !tbaa !5 %conv26 = sext i8 %8 to i32 %putchar39 = call i32 @putchar(i32 %conv26) %inc29 = add nuw nsw i32 %i.244, 1 %9 = load i32, ptr %m, align 4, !tbaa !12 %cmp18 = icmp slt i32 %inc29, %9 br i1 %cmp18, label %for.body20, label %for.end30, !llvm.loop !15 for.end30: ; preds = %for.body20, %for.end15 %putchar = call i32 @putchar(i32 10) br label %vector.body.backedge } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0} !14 = distinct !{!14, !9} !15 = distinct !{!15, !9}
#include <stdio.h> int main(void){ char ch, C; for(;;){ scanf("%c",&ch); if(ch == '\n'){ break; } else if(ch == ' '){ printf(" "); } else if('A' <= ch && ch <= 'Z'){ C = ch + 32; printf("%c",C); } else if('a' <= ch && ch <= 'z'){ C = ch - 32; printf("%c",C); } else{ printf("%c",ch); } } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175569/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 br label %for.cond for.cond: ; preds = %if.end37, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 1 %conv = sext i8 %0 to i32 switch i8 %0, label %if.else7 [ i8 10, label %for.end i8 32, label %if.end37 ] if.else7: ; preds = %for.cond %1 = add i8 %0, -65 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.then14, label %if.else19 if.then14: ; preds = %if.else7 %add = add nuw nsw i8 %0, 32 %conv17 = zext i8 %add to i32 br label %if.end37 if.else19: ; preds = %if.else7 %2 = add i8 %0, -97 %or.cond39 = icmp ult i8 %2, 26 br i1 %or.cond39, label %if.then27, label %if.end37 if.then27: ; preds = %if.else19 %sub = add nsw i8 %0, -32 %conv30 = zext i8 %sub to i32 br label %if.end37 if.end37: ; preds = %if.else19, %for.cond, %if.then27, %if.then14 %.sink = phi i32 [ %conv30, %if.then27 ], [ %conv17, %if.then14 ], [ 32, %for.cond ], [ %conv, %if.else19 ] %putchar43 = call i32 @putchar(i32 %.sink) br label %for.cond for.end: ; preds = %for.cond %putchar44 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #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)"}
#include <stdio.h> #include <ctype.h> int main() { int i; //Input int ch; char s[1200]; for( i = 0; (ch = getchar()); ++i ){ if( ch == '\n' ){ s[i] = '\0'; break; } else s[i] = ch; } //Processing for( i = 0; s[i]; ++i ){ if( isalpha(s[i]) ){ if( islower(s[i]) ) s[i] = toupper(s[i]); else s[i] = tolower(s[i]); } } //Output printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175633/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175633/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %s) #5 br label %for.cond for.cond: ; preds = %if.else, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %if.else ], [ 0, %entry ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) switch i32 %call.i, label %if.else [ i32 0, label %for.end i32 10, label %if.then ] if.then: ; preds = %for.cond %idxprom = and i64 %indvars.iv, 4294967295 %arrayidx = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %idxprom store i8 0, ptr %arrayidx, align 1, !tbaa !9 br label %for.end if.else: ; preds = %for.cond %conv = trunc i32 %call.i to i8 %arrayidx2 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 %conv, ptr %arrayidx2, align 1, !tbaa !9 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond, !llvm.loop !10 for.end: ; preds = %for.cond, %if.then %1 = load i8, ptr %s, align 16, !tbaa !9 %tobool6.not66 = icmp eq i8 %1, 0 br i1 %tobool6.not66, label %for.end52, label %for.body7.lr.ph for.body7.lr.ph: ; preds = %for.end %call8 = tail call ptr @__ctype_b_loc() #6 %2 = load ptr, ptr %call8, align 8, !tbaa !5 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc50 %indvars.iv71 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next72, %for.inc50 ] %3 = phi i8 [ %1, %for.body7.lr.ph ], [ %7, %for.inc50 ] %arrayidx568 = phi ptr [ %s, %for.body7.lr.ph ], [ %arrayidx5, %for.inc50 ] %idxprom12 = sext i8 %3 to i64 %arrayidx13 = getelementptr inbounds i16, ptr %2, i64 %idxprom12 %4 = load i16, ptr %arrayidx13, align 2, !tbaa !12 %conv14 = zext i16 %4 to i32 %and = and i32 %conv14, 1024 %tobool15.not = icmp eq i32 %and, 0 br i1 %tobool15.not, label %for.inc50, label %if.then16 if.then16: ; preds = %for.body7 %and24 = and i32 %conv14, 512 %tobool25.not = icmp eq i32 %and24, 0 br i1 %tobool25.not, label %if.else36, label %if.then26 if.then26: ; preds = %if.then16 %call27 = tail call ptr @__ctype_toupper_loc() #6 br label %for.inc50.sink.split if.else36: ; preds = %if.then16 %call38 = tail call ptr @__ctype_tolower_loc() #6 br label %for.inc50.sink.split for.inc50.sink.split: ; preds = %if.then26, %if.else36 %call38.sink = phi ptr [ %call38, %if.else36 ], [ %call27, %if.then26 ] %5 = load ptr, ptr %call38.sink, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds i32, ptr %5, i64 %idxprom12 %6 = load i32, ptr %arrayidx43, align 4, !tbaa !14 %conv45 = trunc i32 %6 to i8 store i8 %conv45, ptr %arrayidx568, align 1, !tbaa !9 br label %for.inc50 for.inc50: ; preds = %for.inc50.sink.split, %for.body7 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %arrayidx5 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv.next72 %7 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %tobool6.not = icmp eq i8 %7, 0 br i1 %tobool6.not, label %for.end52, label %for.body7, !llvm.loop !16 for.end52: ; preds = %for.inc50, %for.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 1200, 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: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_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 nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !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 = !{!"short", !7, i64 0} !14 = !{!15, !15, i64 0} !15 = !{!"int", !7, i64 0} !16 = distinct !{!16, !11}
#include <stdio.h> #include <ctype.h> int main(void){ char c; for (;;){ scanf("%c", &c); if (isupper(c) != 0){ printf("%c", tolower(c)); }else{ printf("%c", toupper(c)); } if (c == '\n'){ break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175677/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175677/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5 br label %for.cond for.cond: ; preds = %if.end, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %call1 = tail call ptr @__ctype_b_loc() #6 %0 = load ptr, ptr %call1, align 8, !tbaa !5 %1 = load i8, ptr %c, align 1, !tbaa !9 %idxprom = sext i8 %1 to i64 %arrayidx = getelementptr inbounds i16, ptr %0, i64 %idxprom %2 = load i16, ptr %arrayidx, align 2, !tbaa !10 %3 = and i16 %2, 256 %cmp.not = icmp eq i16 %3, 0 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %for.cond %call4 = tail call ptr @__ctype_tolower_loc() #6 br label %if.end if.else: ; preds = %for.cond %call10 = tail call ptr @__ctype_toupper_loc() #6 br label %if.end if.end: ; preds = %if.else, %if.then %call10.sink = phi ptr [ %call10, %if.else ], [ %call4, %if.then ] %4 = load ptr, ptr %call10.sink, align 8, !tbaa !5 %arrayidx13 = getelementptr inbounds i32, ptr %4, i64 %idxprom %5 = load i32, ptr %arrayidx13, align 4, !tbaa !12 %putchar = call i32 @putchar(i32 %5) %6 = load i8, ptr %c, align 1, !tbaa !9 %cmp17 = icmp eq i8 %6, 10 br i1 %cmp17, label %for.end, label %for.cond for.end: ; preds = %if.end call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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) declare ptr @__ctype_b_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() 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: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"short", !7, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"int", !7, i64 0}
#include<stdio.h> long long int gcd(long long int a, long long int b) { if (a == b) return a; if (a > b) return gcd(a-b, b); return gcd(a, b-a); } int main() { long long int n, m , z; scanf("%lld %lld %lld", &n, &m, &z); long long int max = m > n ? m : n; long long int min = m < n ? m : n; long long int l = gcd(max, min); long long int f = max * min / l; long long int ans = z / f; printf("%lld", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17572/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17572/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp1619 = icmp eq i64 %a, %b br i1 %cmp1619, label %return, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry, %if.then2 %b.tr.ph21 = phi i64 [ %b.tr17, %if.then2 ], [ %b, %entry ] %a.tr.ph20 = phi i64 [ %sub, %if.then2 ], [ %a, %entry ] br label %if.end if.end: ; preds = %if.end.lr.ph, %if.end3 %b.tr17 = phi i64 [ %b.tr.ph21, %if.end.lr.ph ], [ %sub4, %if.end3 ] %cmp1 = icmp sgt i64 %a.tr.ph20, %b.tr17 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end %sub = sub nsw i64 %a.tr.ph20, %b.tr17 %cmp16 = icmp eq i64 %sub, %b.tr17 br i1 %cmp16, label %return, label %if.end.lr.ph if.end3: ; preds = %if.end %sub4 = sub nsw i64 %b.tr17, %a.tr.ph20 %cmp = icmp eq i64 %a.tr.ph20, %sub4 br i1 %cmp, label %return, label %if.end return: ; preds = %if.then2, %if.end3, %entry %a.tr.ph.lcssa = phi i64 [ %a, %entry ], [ %a.tr.ph20, %if.end3 ], [ %b.tr17, %if.then2 ] ret i64 %a.tr.ph.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 %z = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %z) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %z) %0 = load i64, ptr %m, align 8 %1 = load i64, ptr %n, align 8 %cond = call i64 @llvm.smax.i64(i64 %0, i64 %1) %cond5 = call i64 @llvm.smin.i64(i64 %0, i64 %1) %cmp1619.i = icmp eq i64 %cond, %cond5 br i1 %cmp1619.i, label %gcd.exit, label %if.end.lr.ph.i if.end.lr.ph.i: ; preds = %entry, %if.then2.i %b.tr.ph21.i = phi i64 [ %b.tr17.i, %if.then2.i ], [ %cond5, %entry ] %a.tr.ph20.i = phi i64 [ %sub.i, %if.then2.i ], [ %cond, %entry ] br label %if.end.i if.end.i: ; preds = %if.end3.i, %if.end.lr.ph.i %b.tr17.i = phi i64 [ %b.tr.ph21.i, %if.end.lr.ph.i ], [ %sub4.i, %if.end3.i ] %cmp1.i = icmp sgt i64 %a.tr.ph20.i, %b.tr17.i br i1 %cmp1.i, label %if.then2.i, label %if.end3.i if.then2.i: ; preds = %if.end.i %sub.i = sub nsw i64 %a.tr.ph20.i, %b.tr17.i %cmp16.i = icmp eq i64 %sub.i, %b.tr17.i br i1 %cmp16.i, label %gcd.exit, label %if.end.lr.ph.i if.end3.i: ; preds = %if.end.i %sub4.i = sub nsw i64 %b.tr17.i, %a.tr.ph20.i %cmp.i = icmp eq i64 %a.tr.ph20.i, %sub4.i br i1 %cmp.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.then2.i, %if.end3.i, %entry %a.tr.ph.lcssa.i = phi i64 [ %cond, %entry ], [ %a.tr.ph20.i, %if.end3.i ], [ %b.tr17.i, %if.then2.i ] %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %a.tr.ph.lcssa.i %2 = load i64, ptr %z, align 8, !tbaa !5 %div7 = sdiv i64 %2, %div %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div7) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %z) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <ctype.h> int main(void) { char s[1200]; int i = 0; char c; while ((c = getchar()) != EOF) { char u_c, l_c; u_c = toupper(c); l_c = tolower(c); if (c != u_c) s[i] = u_c; else if (c != l_c) s[i] = l_c; else s[i] = c; i++; } s[i] = '\0'; printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175770/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @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 [1200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %s) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i45 = tail call i32 @getc(ptr noundef %0) %sext47 = shl i32 %call.i45, 24 %cmp.not49 = icmp eq i32 %sext47, -16777216 br i1 %cmp.not49, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %call3 = tail call ptr @__ctype_toupper_loc() #5 %call7 = tail call ptr @__ctype_tolower_loc() #5 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end29 %indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %if.end29 ] %conv152.in = phi i32 [ %sext47, %while.body.lr.ph ], [ %sext, %if.end29 ] %conv51.in = phi i32 [ %call.i45, %while.body.lr.ph ], [ %call.i, %if.end29 ] %conv51 = trunc i32 %conv51.in to i8 %conv152 = ashr exact i32 %conv152.in, 24 %1 = load ptr, ptr %call3, align 8, !tbaa !5 %idxprom = sext i32 %conv152 to i64 %arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !9 %3 = load ptr, ptr %call7, align 8, !tbaa !5 %arrayidx10 = getelementptr inbounds i32, ptr %3, i64 %idxprom %4 = load i32, ptr %arrayidx10, align 4, !tbaa !9 %conv12 = trunc i32 %4 to i8 %sext43 = shl i32 %2, 24 %conv14 = ashr exact i32 %sext43, 24 %cmp15.not = icmp eq i32 %conv152, %conv14 br i1 %cmp15.not, label %if.else, label %if.then if.then: ; preds = %while.body %conv5 = trunc i32 %2 to i8 %arrayidx18 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 %conv5, ptr %arrayidx18, align 1, !tbaa !11 br label %if.end29 if.else: ; preds = %while.body %sext44 = shl i32 %4, 24 %conv20 = ashr exact i32 %sext44, 24 %cmp21.not = icmp eq i32 %conv152, %conv20 %arrayidx28 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv br i1 %cmp21.not, label %if.else26, label %if.then23 if.then23: ; preds = %if.else store i8 %conv12, ptr %arrayidx28, align 1, !tbaa !11 br label %if.end29 if.else26: ; preds = %if.else store i8 %conv51, ptr %arrayidx28, align 1, !tbaa !11 br label %if.end29 if.end29: ; preds = %if.then23, %if.else26, %if.then %indvars.iv.next = add nuw i64 %indvars.iv, 1 %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %5) %sext = shl i32 %call.i, 24 %cmp.not = icmp eq i32 %sext, -16777216 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !12 while.end.loopexit: ; preds = %if.end29 %6 = and i64 %indvars.iv.next, 4294967295 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %i.0.lcssa = phi i64 [ 0, %entry ], [ %6, %while.end.loopexit ] %arrayidx31 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %i.0.lcssa store i8 0, ptr %arrayidx31, align 1, !tbaa !11 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_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 nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture 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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="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 } attributes #5 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <ctype.h> int main() { char str[1200]; char c; int i=0; while(1) { scanf("%c",&c); if(c== '\n' ) break; if(isupper(c)) str[i]=tolower(c); else { str[i]=toupper(c); } i++; } str[i] = '\0'; printf("%s\n", str); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175835/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175835/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1200 x i8], align 16 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %str) #5 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %cmp30 = icmp eq i8 %0, 10 br i1 %cmp30, label %while.end, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry %call2 = tail call ptr @__ctype_b_loc() #6 br label %if.end if.end: ; preds = %if.end.lr.ph, %if.end22 %indvars.iv = phi i64 [ 0, %if.end.lr.ph ], [ %indvars.iv.next, %if.end22 ] %1 = phi i8 [ %0, %if.end.lr.ph ], [ %6, %if.end22 ] %2 = load ptr, ptr %call2, align 8, !tbaa !8 %idxprom = sext i8 %1 to i64 %arrayidx = getelementptr inbounds i16, ptr %2, i64 %idxprom %3 = load i16, ptr %arrayidx, align 2, !tbaa !10 %4 = and i16 %3, 256 %tobool.not = icmp eq i16 %4, 0 br i1 %tobool.not, label %if.else, label %if.then5 if.then5: ; preds = %if.end %call6 = tail call ptr @__ctype_tolower_loc() #6 br label %if.end22 if.else: ; preds = %if.end %call14 = tail call ptr @__ctype_toupper_loc() #6 br label %if.end22 if.end22: ; preds = %if.else, %if.then5 %.pn.in = phi ptr [ %call14, %if.else ], [ %call6, %if.then5 ] %.pn = load ptr, ptr %.pn.in, align 8, !tbaa !8 %conv10.sink.in.in = getelementptr inbounds i32, ptr %.pn, i64 %idxprom %conv10.sink.in = load i32, ptr %conv10.sink.in.in, align 4, !tbaa !12 %conv10.sink = trunc i32 %conv10.sink.in to i8 %5 = getelementptr inbounds [1200 x i8], ptr %str, i64 0, i64 %indvars.iv store i8 %conv10.sink, ptr %5, align 1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %6 = load i8, ptr %c, align 1, !tbaa !5 %cmp = icmp eq i8 %6, 10 br i1 %cmp, label %while.end.loopexit, label %if.end while.end.loopexit: ; preds = %if.end22 %7 = and i64 %indvars.iv.next, 4294967295 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %i.0.lcssa = phi i64 [ 0, %entry ], [ %7, %while.end.loopexit ] %arrayidx24 = getelementptr inbounds [1200 x i8], ptr %str, i64 0, i64 %i.0.lcssa store i8 0, ptr %arrayidx24, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %str) #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) declare ptr @__ctype_b_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() 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: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"any pointer", !6, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"short", !6, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0}
#include <stdio.h> int main(){ char txt; while(1){ scanf("%c",&txt); if(txt>96 && txt<123)txt-=32; else if(txt>64 && txt<91)txt+=32; printf("%c",txt); if(txt=='\n')break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175886/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175886/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %txt = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %txt) #4 br label %while.cond while.cond: ; preds = %if.end17, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %txt) %0 = load i8, ptr %txt, align 1 %1 = add i8 %0, -97 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.cond %sub = add nsw i8 %0, -32 store i8 %sub, ptr %txt, align 1, !tbaa !5 br label %if.end17 if.else: ; preds = %while.cond %2 = add i8 %0, -65 %or.cond25 = icmp ult i8 %2, 26 br i1 %or.cond25, label %if.then14, label %if.end17 if.then14: ; preds = %if.else %add = add nuw nsw i8 %0, 32 store i8 %add, ptr %txt, align 1, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.else, %if.then14, %if.then %3 = phi i8 [ %0, %if.else ], [ %add, %if.then14 ], [ %sub, %if.then ] %conv18 = sext i8 %3 to i32 %putchar = call i32 @putchar(i32 %conv18) %4 = load i8, ptr %txt, align 1, !tbaa !5 %cmp21 = icmp eq i8 %4, 10 br i1 %cmp21, label %while.end, label %while.cond while.end: ; preds = %if.end17 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %txt) #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"}
#include <stdio.h> int main(void) { int x; char a[1201]; fgets(a, 1200, stdin); for(x = 0; a[x] != 0x00; x++){ if(('A' <= a[x]) && (a[x] <= 'Z')){ a[x] |= 0x20; }else if(('a' <= a[x]) && (a[x] <= 'z')){ a[x] &= 0xdf; }else{ } } printf("%s", a); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_175936/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_175936/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [1201 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1201, ptr nonnull %a) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %a, i32 noundef 1200, ptr noundef %0) %1 = load i8, ptr %a, align 16, !tbaa !9 %cmp.not44 = icmp eq i8 %1, 0 br i1 %cmp.not44, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %2 = phi i8 [ %7, %for.inc ], [ %1, %entry ] %arrayidx46 = phi ptr [ %arrayidx, %for.inc ], [ %a, %entry ] %3 = add i8 %2, -65 %or.cond = icmp ult i8 %3, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body %4 = or i8 %2, 32 br label %for.inc.sink.split if.else: ; preds = %for.body %5 = add i8 %2, -97 %or.cond43 = icmp ult i8 %5, 26 br i1 %or.cond43, label %if.then27, label %for.inc if.then27: ; preds = %if.else %6 = and i8 %2, -33 br label %for.inc.sink.split for.inc.sink.split: ; preds = %if.then27, %if.then %.sink = phi i8 [ %4, %if.then ], [ %6, %if.then27 ] store i8 %.sink, ptr %arrayidx46, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1201 x i8], ptr %a, i64 0, i64 %indvars.iv.next %7 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp.not = icmp eq i8 %7, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.inc, %entry %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %a) call void @llvm.lifetime.end.p0(i64 1201, 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int n, temp, i; scanf("%d", &n); int arr[n+1]; for(i = 1; i <= n; i++) scanf("%d", &arr[i]); for(i = 1; i <= n/2; i = i + 2){ temp = arr[i]; arr[i] = arr[n - i + 1]; arr[n - i + 1] = temp; } for(i = 1; i <= n; i++) printf("%d ", arr[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17598/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17598/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %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 %cmp.not39 = icmp slt i32 %3, 1 br i1 %cmp.not39, label %for.end27, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not41 = icmp slt i32 %5, 2 br i1 %cmp3.not41, label %for.cond19.preheader, label %for.body4.lr.ph for.body4.lr.ph: ; preds = %for.cond2.preheader %div5556 = lshr i32 %5, 1 %sub = add nuw i32 %5, 1 %4 = zext i32 %div5556 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond19.preheader: ; preds = %for.body4, %for.cond2.preheader %cmp20.not43 = icmp slt i32 %5, 1 br i1 %cmp20.not43, label %for.end27, label %for.body21 for.body4: ; preds = %for.body4.lr.ph, %for.body4 %indvars.iv47 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next48, %for.body4 ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv47 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %8 = trunc i64 %indvars.iv47 to i32 %add7 = sub i32 %sub, %8 %idxprom8 = sext i32 %add7 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 store i32 %9, ptr %arrayidx6, align 4, !tbaa !5 store i32 %7, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 2 %cmp3.not = icmp ugt i64 %indvars.iv.next48, %4 br i1 %cmp3.not, label %for.cond19.preheader, label %for.body4, !llvm.loop !11 for.body21: ; preds = %for.cond19.preheader, %for.body21 %indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.body21 ], [ 1, %for.cond19.preheader ] %arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv50 %10 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp20.not.not = icmp slt i64 %indvars.iv50, %12 br i1 %cmp20.not.not, label %for.body21, label %for.end27, !llvm.loop !12 for.end27: ; preds = %for.body21, %entry, %for.cond19.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include<string.h> char exchange(char c) { if('A' <= c && c <= 'Z') { return c + ('a' - 'A'); } /* 同様に c が小文字なら大文字に変換する条件を追加 */ else if ('a' <= c && c <= 'z') { return c - ('a' - 'A'); } return c; } int main(void) { int i, len; char s[4096]; /* 1200バイト以上 */ // scanf("%s", s) は セキュリティ上よろしくない fgets(s, sizeof(s), stdin); len = strlen(s); // 文字列の長さをえる for(int i = 0; i < len;i++) { s[i] = exchange(s[i]); } printf("%s",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176021/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176021/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local signext i8 @exchange(i8 noundef signext %c) local_unnamed_addr #0 { entry: %0 = add i8 %c, -65 %or.cond = icmp ult i8 %0, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %add = add nuw nsw i8 %c, 32 br label %return if.else: ; preds = %entry %1 = add i8 %c, -97 %or.cond18 = icmp ult i8 %1, 26 %sub = add i8 %c, -32 %spec.select = select i1 %or.cond18, i8 %sub, i8 %c br label %return return: ; preds = %if.else, %if.then %retval.0 = phi i8 [ %add, %if.then ], [ %spec.select, %if.else ] ret i8 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %s = alloca [4096 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %s) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 4096, ptr noundef %0) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp13 = icmp sgt i32 %conv, 0 br i1 %cmp13, label %iter.check, label %for.cond.cleanup iter.check: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check16 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check16, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call2, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = getelementptr inbounds [4096 x i8], ptr %s, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %1, align 16, !tbaa !9 %2 = getelementptr inbounds i8, ptr %1, i64 16 %wide.load17 = load <16 x i8>, ptr %2, align 16, !tbaa !9 %3 = add <16 x i8> %wide.load, <i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91> %4 = icmp ult <16 x i8> %3, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %5 = add <16 x i8> %wide.load17, <i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91> %6 = icmp ult <16 x i8> %5, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %7 = add <16 x i8> %wide.load, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97> %8 = add <16 x i8> %wide.load17, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97> %9 = icmp ult <16 x i8> %7, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %10 = icmp ult <16 x i8> %8, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %11 = add <16 x i8> %wide.load, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32> %12 = add <16 x i8> %wide.load17, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32> %13 = select <16 x i1> %9, <16 x i8> %11, <16 x i8> %wide.load %14 = select <16 x i1> %10, <16 x i8> %12, <16 x i8> %wide.load17 %15 = add nuw nsw <16 x i8> %wide.load, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32> %16 = add nuw nsw <16 x i8> %wide.load17, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32> %predphi = select <16 x i1> %4, <16 x i8> %13, <16 x i8> %15 %predphi18 = select <16 x i1> %6, <16 x i8> %14, <16 x i8> %16 store <16 x i8> %predphi, ptr %1, align 16, !tbaa !9 store <16 x i8> %predphi18, ptr %2, align 16, !tbaa !9 %index.next = add nuw i64 %index, 32 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf19 = and i64 %call2, 7 %n.vec20 = sub nsw i64 %wide.trip.count, %n.mod.vf19 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index22 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next25, %vec.epilog.vector.body ] %18 = getelementptr inbounds [4096 x i8], ptr %s, i64 0, i64 %index22 %wide.load23 = load <8 x i8>, ptr %18, align 1, !tbaa !9 %19 = add <8 x i8> %wide.load23, <i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91, i8 -91> %20 = icmp ult <8 x i8> %19, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %21 = add <8 x i8> %wide.load23, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97> %22 = icmp ult <8 x i8> %21, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %23 = add <8 x i8> %wide.load23, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32> %24 = select <8 x i1> %22, <8 x i8> %23, <8 x i8> %wide.load23 %25 = add nuw nsw <8 x i8> %wide.load23, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32> %predphi24 = select <8 x i1> %20, <8 x i8> %24, <8 x i8> %25 store <8 x i8> %predphi24, ptr %18, align 1, !tbaa !9 %index.next25 = add nuw i64 %index22, 8 %26 = icmp eq i64 %index.next25, %n.vec20 br i1 %26, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n21 = icmp eq i64 %n.mod.vf19, 0 br i1 %cmp.n21, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec20, %vec.epilog.middle.block ] br label %for.body for.cond.cleanup: ; preds = %exchange.exit, %middle.block, %vec.epilog.middle.block, %entry %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %for.body.preheader, %exchange.exit %indvars.iv = phi i64 [ %indvars.iv.next, %exchange.exit ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds [4096 x i8], ptr %s, i64 0, i64 %indvars.iv %27 = load i8, ptr %arrayidx, align 1, !tbaa !9 %28 = add i8 %27, -65 %or.cond.i = icmp ult i8 %28, 26 br i1 %or.cond.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %for.body %add.i = add nuw nsw i8 %27, 32 br label %exchange.exit if.else.i: ; preds = %for.body %29 = add i8 %27, -97 %or.cond18.i = icmp ult i8 %29, 26 %sub.i = add i8 %27, -32 %spec.select.i = select i1 %or.cond18.i, i8 %sub.i, i8 %27 br label %exchange.exit exchange.exit: ; preds = %if.then.i, %if.else.i %retval.0.i = phi i8 [ %add.i, %if.then.i ], [ %spec.select.i, %if.else.i ] store i8 %retval.0.i, ptr %arrayidx, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !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, !13, !12}
#include <stdio.h> int main(void) { int c; while (1) { c = getchar(); if (c == EOF) break; if ('A' <= c && c <= 'Z') putchar(c + 0x20); else if ('a' <= c && c <= 'z') putchar(c - 0x20); else putchar(c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176065/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176065/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i25 = tail call i32 @getc(ptr noundef %0) %cmp26 = icmp eq i32 %call.i25, -1 br i1 %cmp26, label %while.end, label %if.end if.end: ; preds = %entry, %if.end13 %call.i27 = phi i32 [ %call.i, %if.end13 ], [ %call.i25, %entry ] %1 = add i32 %call.i27, -65 %or.cond = icmp ult i32 %1, 26 br i1 %or.cond, label %if.then3, label %if.else if.then3: ; preds = %if.end %add = add nuw nsw i32 %call.i27, 32 br label %if.end13 if.else: ; preds = %if.end %2 = add i32 %call.i27, -97 %or.cond14 = icmp ult i32 %2, 26 %sub = add nsw i32 %call.i27, -32 %spec.select = select i1 %or.cond14, i32 %sub, i32 %call.i27 br label %if.end13 if.end13: ; preds = %if.else, %if.then3 %sub.sink = phi i32 [ %add, %if.then3 ], [ %spec.select, %if.else ] %3 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i23 = tail call i32 @putc(i32 noundef %sub.sink, ptr noundef %3) %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %4) %cmp = icmp eq i32 %call.i, -1 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %if.end13, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(){ char ch; do { scanf("%c", &ch); if(ch >= 'A' && ch <= 'Z') { ch = ch + 32; } else if (ch >= 'a' && ch <= 'z') { ch = ch - 32; } printf("%c", ch); } while (ch != '\n'); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176151/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176151/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 br label %do.body do.body: ; preds = %if.end17, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 1 %1 = add i8 %0, -65 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %do.body %add = add nuw nsw i8 %0, 32 store i8 %add, ptr %ch, align 1, !tbaa !5 br label %if.end17 if.else: ; preds = %do.body %2 = add i8 %0, -97 %or.cond23 = icmp ult i8 %2, 26 br i1 %or.cond23, label %if.then14, label %if.end17 if.then14: ; preds = %if.else %sub = add nsw i8 %0, -32 store i8 %sub, ptr %ch, align 1, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.else, %if.then14, %if.then %3 = phi i8 [ %0, %if.else ], [ %sub, %if.then14 ], [ %add, %if.then ] %conv18 = sext i8 %3 to i32 %putchar = call i32 @putchar(i32 %conv18) %4 = load i8, ptr %ch, align 1, !tbaa !5 %cmp21.not = icmp eq i8 %4, 10 br i1 %cmp21.not, label %do.end, label %do.body, !llvm.loop !8 do.end: ; preds = %if.end17 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #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"}
#include <stdio.h> int main(void){ char str[1201] ; scanf("%[^\n]" , str) ; int p = 0 ; while(str[p] != '\0'){ p++; } for(int i = 0 ; i < p ; i++){ if(str[i] >= 'a' && str[i] <= 'z'){ str[i] = str[i] - 32; } else if(str[i] >= 'A' && str[i] <= 'Z'){ str[i] = str[i] + 32; } } printf("%s" , str); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176195/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176195/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^\0A]\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: %str = alloca [1201 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1201, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv61 = phi i32 [ %indvars.iv.next62, %while.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next62 = add i32 %indvars.iv61, 1 br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !8 for.cond.preheader: ; preds = %while.cond %1 = and i64 %indvars.iv, 4294967295 %cmp255.not = icmp eq i64 %1, 0 br i1 %cmp255.not, label %for.cond.cleanup, label %iter.check iter.check: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv61 to i64 %min.iters.check = icmp ult i32 %indvars.iv61, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check63 = icmp ult i32 %indvars.iv61, 16 br i1 %min.iters.check63, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967280 br label %vector.body vector.body: ; preds = %pred.store.continue93, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue93 ] %2 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %2, align 16, !tbaa !5 %3 = add <16 x i8> %wide.load, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97> %4 = icmp ult <16 x i8> %3, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %5 = add <16 x i8> %wide.load, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65> %6 = icmp ult <16 x i8> %5, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %7 = xor <16 x i1> %4, <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true> %8 = select <16 x i1> %7, <16 x i1> %6, <16 x i1> zeroinitializer %predphi = select <16 x i1> %8, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32> %9 = or <16 x i1> %8, %4 %10 = extractelement <16 x i1> %9, i64 0 br i1 %10, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %11 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %index %12 = add nsw <16 x i8> %wide.load, %predphi %13 = extractelement <16 x i8> %12, i64 0 store i8 %13, ptr %11, align 16, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %14 = extractelement <16 x i1> %9, i64 1 br i1 %14, label %pred.store.if64, label %pred.store.continue65 pred.store.if64: ; preds = %pred.store.continue %15 = or i64 %index, 1 %16 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %15 %17 = add nsw <16 x i8> %wide.load, %predphi %18 = extractelement <16 x i8> %17, i64 1 store i8 %18, ptr %16, align 1, !tbaa !5 br label %pred.store.continue65 pred.store.continue65: ; preds = %pred.store.if64, %pred.store.continue %19 = extractelement <16 x i1> %9, i64 2 br i1 %19, label %pred.store.if66, label %pred.store.continue67 pred.store.if66: ; preds = %pred.store.continue65 %20 = or i64 %index, 2 %21 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %20 %22 = add nsw <16 x i8> %wide.load, %predphi %23 = extractelement <16 x i8> %22, i64 2 store i8 %23, ptr %21, align 2, !tbaa !5 br label %pred.store.continue67 pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65 %24 = extractelement <16 x i1> %9, i64 3 br i1 %24, label %pred.store.if68, label %pred.store.continue69 pred.store.if68: ; preds = %pred.store.continue67 %25 = or i64 %index, 3 %26 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %25 %27 = add nsw <16 x i8> %wide.load, %predphi %28 = extractelement <16 x i8> %27, i64 3 store i8 %28, ptr %26, align 1, !tbaa !5 br label %pred.store.continue69 pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67 %29 = extractelement <16 x i1> %9, i64 4 br i1 %29, label %pred.store.if70, label %pred.store.continue71 pred.store.if70: ; preds = %pred.store.continue69 %30 = or i64 %index, 4 %31 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %30 %32 = add nsw <16 x i8> %wide.load, %predphi %33 = extractelement <16 x i8> %32, i64 4 store i8 %33, ptr %31, align 4, !tbaa !5 br label %pred.store.continue71 pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69 %34 = extractelement <16 x i1> %9, i64 5 br i1 %34, label %pred.store.if72, label %pred.store.continue73 pred.store.if72: ; preds = %pred.store.continue71 %35 = or i64 %index, 5 %36 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %35 %37 = add nsw <16 x i8> %wide.load, %predphi %38 = extractelement <16 x i8> %37, i64 5 store i8 %38, ptr %36, align 1, !tbaa !5 br label %pred.store.continue73 pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71 %39 = extractelement <16 x i1> %9, i64 6 br i1 %39, label %pred.store.if74, label %pred.store.continue75 pred.store.if74: ; preds = %pred.store.continue73 %40 = or i64 %index, 6 %41 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %40 %42 = add nsw <16 x i8> %wide.load, %predphi %43 = extractelement <16 x i8> %42, i64 6 store i8 %43, ptr %41, align 2, !tbaa !5 br label %pred.store.continue75 pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73 %44 = extractelement <16 x i1> %9, i64 7 br i1 %44, label %pred.store.if76, label %pred.store.continue77 pred.store.if76: ; preds = %pred.store.continue75 %45 = or i64 %index, 7 %46 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %45 %47 = add nsw <16 x i8> %wide.load, %predphi %48 = extractelement <16 x i8> %47, i64 7 store i8 %48, ptr %46, align 1, !tbaa !5 br label %pred.store.continue77 pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75 %49 = extractelement <16 x i1> %9, i64 8 br i1 %49, label %pred.store.if78, label %pred.store.continue79 pred.store.if78: ; preds = %pred.store.continue77 %50 = or i64 %index, 8 %51 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %50 %52 = add nsw <16 x i8> %wide.load, %predphi %53 = extractelement <16 x i8> %52, i64 8 store i8 %53, ptr %51, align 8, !tbaa !5 br label %pred.store.continue79 pred.store.continue79: ; preds = %pred.store.if78, %pred.store.continue77 %54 = extractelement <16 x i1> %9, i64 9 br i1 %54, label %pred.store.if80, label %pred.store.continue81 pred.store.if80: ; preds = %pred.store.continue79 %55 = or i64 %index, 9 %56 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %55 %57 = add nsw <16 x i8> %wide.load, %predphi %58 = extractelement <16 x i8> %57, i64 9 store i8 %58, ptr %56, align 1, !tbaa !5 br label %pred.store.continue81 pred.store.continue81: ; preds = %pred.store.if80, %pred.store.continue79 %59 = extractelement <16 x i1> %9, i64 10 br i1 %59, label %pred.store.if82, label %pred.store.continue83 pred.store.if82: ; preds = %pred.store.continue81 %60 = or i64 %index, 10 %61 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %60 %62 = add nsw <16 x i8> %wide.load, %predphi %63 = extractelement <16 x i8> %62, i64 10 store i8 %63, ptr %61, align 2, !tbaa !5 br label %pred.store.continue83 pred.store.continue83: ; preds = %pred.store.if82, %pred.store.continue81 %64 = extractelement <16 x i1> %9, i64 11 br i1 %64, label %pred.store.if84, label %pred.store.continue85 pred.store.if84: ; preds = %pred.store.continue83 %65 = or i64 %index, 11 %66 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %65 %67 = add nsw <16 x i8> %wide.load, %predphi %68 = extractelement <16 x i8> %67, i64 11 store i8 %68, ptr %66, align 1, !tbaa !5 br label %pred.store.continue85 pred.store.continue85: ; preds = %pred.store.if84, %pred.store.continue83 %69 = extractelement <16 x i1> %9, i64 12 br i1 %69, label %pred.store.if86, label %pred.store.continue87 pred.store.if86: ; preds = %pred.store.continue85 %70 = or i64 %index, 12 %71 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %70 %72 = add nsw <16 x i8> %wide.load, %predphi %73 = extractelement <16 x i8> %72, i64 12 store i8 %73, ptr %71, align 4, !tbaa !5 br label %pred.store.continue87 pred.store.continue87: ; preds = %pred.store.if86, %pred.store.continue85 %74 = extractelement <16 x i1> %9, i64 13 br i1 %74, label %pred.store.if88, label %pred.store.continue89 pred.store.if88: ; preds = %pred.store.continue87 %75 = or i64 %index, 13 %76 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %75 %77 = add nsw <16 x i8> %wide.load, %predphi %78 = extractelement <16 x i8> %77, i64 13 store i8 %78, ptr %76, align 1, !tbaa !5 br label %pred.store.continue89 pred.store.continue89: ; preds = %pred.store.if88, %pred.store.continue87 %79 = extractelement <16 x i1> %9, i64 14 br i1 %79, label %pred.store.if90, label %pred.store.continue91 pred.store.if90: ; preds = %pred.store.continue89 %80 = or i64 %index, 14 %81 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %80 %82 = add nsw <16 x i8> %wide.load, %predphi %83 = extractelement <16 x i8> %82, i64 14 store i8 %83, ptr %81, align 2, !tbaa !5 br label %pred.store.continue91 pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue89 %84 = extractelement <16 x i1> %9, i64 15 br i1 %84, label %pred.store.if92, label %pred.store.continue93 pred.store.if92: ; preds = %pred.store.continue91 %85 = or i64 %index, 15 %86 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %85 %87 = add nsw <16 x i8> %wide.load, %predphi %88 = extractelement <16 x i8> %87, i64 15 store i8 %88, ptr %86, align 1, !tbaa !5 br label %pred.store.continue93 pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91 %index.next = add nuw i64 %index, 16 %89 = icmp eq i64 %index.next, %n.vec br i1 %89, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %pred.store.continue93 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 8 %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check.not.not, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec95 = and i64 %wide.trip.count, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %pred.store.continue115, %vec.epilog.ph %index97 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next116, %pred.store.continue115 ] %90 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %index97 %wide.load98 = load <8 x i8>, ptr %90, align 8, !tbaa !5 %91 = add <8 x i8> %wide.load98, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97> %92 = icmp ult <8 x i8> %91, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %93 = add <8 x i8> %wide.load98, <i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65, i8 -65> %94 = icmp ult <8 x i8> %93, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26> %95 = xor <8 x i1> %92, <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true> %96 = select <8 x i1> %95, <8 x i1> %94, <8 x i1> zeroinitializer %predphi99 = select <8 x i1> %96, <8 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <8 x i8> <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32> %97 = or <8 x i1> %96, %92 %98 = extractelement <8 x i1> %97, i64 0 br i1 %98, label %pred.store.if100, label %pred.store.continue101 pred.store.if100: ; preds = %vec.epilog.vector.body %99 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %index97 %100 = add nsw <8 x i8> %wide.load98, %predphi99 %101 = extractelement <8 x i8> %100, i64 0 store i8 %101, ptr %99, align 8, !tbaa !5 br label %pred.store.continue101 pred.store.continue101: ; preds = %pred.store.if100, %vec.epilog.vector.body %102 = extractelement <8 x i1> %97, i64 1 br i1 %102, label %pred.store.if102, label %pred.store.continue103 pred.store.if102: ; preds = %pred.store.continue101 %103 = or i64 %index97, 1 %104 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %103 %105 = add nsw <8 x i8> %wide.load98, %predphi99 %106 = extractelement <8 x i8> %105, i64 1 store i8 %106, ptr %104, align 1, !tbaa !5 br label %pred.store.continue103 pred.store.continue103: ; preds = %pred.store.if102, %pred.store.continue101 %107 = extractelement <8 x i1> %97, i64 2 br i1 %107, label %pred.store.if104, label %pred.store.continue105 pred.store.if104: ; preds = %pred.store.continue103 %108 = or i64 %index97, 2 %109 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %108 %110 = add nsw <8 x i8> %wide.load98, %predphi99 %111 = extractelement <8 x i8> %110, i64 2 store i8 %111, ptr %109, align 2, !tbaa !5 br label %pred.store.continue105 pred.store.continue105: ; preds = %pred.store.if104, %pred.store.continue103 %112 = extractelement <8 x i1> %97, i64 3 br i1 %112, label %pred.store.if106, label %pred.store.continue107 pred.store.if106: ; preds = %pred.store.continue105 %113 = or i64 %index97, 3 %114 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %113 %115 = add nsw <8 x i8> %wide.load98, %predphi99 %116 = extractelement <8 x i8> %115, i64 3 store i8 %116, ptr %114, align 1, !tbaa !5 br label %pred.store.continue107 pred.store.continue107: ; preds = %pred.store.if106, %pred.store.continue105 %117 = extractelement <8 x i1> %97, i64 4 br i1 %117, label %pred.store.if108, label %pred.store.continue109 pred.store.if108: ; preds = %pred.store.continue107 %118 = or i64 %index97, 4 %119 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %118 %120 = add nsw <8 x i8> %wide.load98, %predphi99 %121 = extractelement <8 x i8> %120, i64 4 store i8 %121, ptr %119, align 4, !tbaa !5 br label %pred.store.continue109 pred.store.continue109: ; preds = %pred.store.if108, %pred.store.continue107 %122 = extractelement <8 x i1> %97, i64 5 br i1 %122, label %pred.store.if110, label %pred.store.continue111 pred.store.if110: ; preds = %pred.store.continue109 %123 = or i64 %index97, 5 %124 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %123 %125 = add nsw <8 x i8> %wide.load98, %predphi99 %126 = extractelement <8 x i8> %125, i64 5 store i8 %126, ptr %124, align 1, !tbaa !5 br label %pred.store.continue111 pred.store.continue111: ; preds = %pred.store.if110, %pred.store.continue109 %127 = extractelement <8 x i1> %97, i64 6 br i1 %127, label %pred.store.if112, label %pred.store.continue113 pred.store.if112: ; preds = %pred.store.continue111 %128 = or i64 %index97, 6 %129 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %128 %130 = add nsw <8 x i8> %wide.load98, %predphi99 %131 = extractelement <8 x i8> %130, i64 6 store i8 %131, ptr %129, align 2, !tbaa !5 br label %pred.store.continue113 pred.store.continue113: ; preds = %pred.store.if112, %pred.store.continue111 %132 = extractelement <8 x i1> %97, i64 7 br i1 %132, label %pred.store.if114, label %pred.store.continue115 pred.store.if114: ; preds = %pred.store.continue113 %133 = or i64 %index97, 7 %134 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %133 %135 = add nsw <8 x i8> %wide.load98, %predphi99 %136 = extractelement <8 x i8> %135, i64 7 store i8 %136, ptr %134, align 1, !tbaa !5 br label %pred.store.continue115 pred.store.continue115: ; preds = %pred.store.if114, %pred.store.continue113 %index.next116 = add nuw i64 %index97, 8 %137 = icmp eq i64 %index.next116, %n.vec95 br i1 %137, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13 vec.epilog.middle.block: ; preds = %pred.store.continue115 %cmp.n96 = icmp eq i64 %n.vec95, %wide.trip.count br i1 %cmp.n96, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv58.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec95, %vec.epilog.middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %for.cond.preheader %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %str) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 1201, ptr nonnull %str) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.inc ], [ %indvars.iv58.ph, %for.body.preheader ] %arrayidx5 = getelementptr inbounds [1201 x i8], ptr %str, i64 0, i64 %indvars.iv58 %138 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %139 = add i8 %138, -97 %or.cond = icmp ult i8 %139, 26 br i1 %or.cond, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %140 = add i8 %138, -65 %or.cond54 = icmp ult i8 %140, 26 br i1 %or.cond54, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %.sink = phi i8 [ -32, %for.body ], [ 32, %if.else ] %sub = add nsw i8 %138, %.sink store i8 %sub, ptr %arrayidx5, align 1, !tbaa !5 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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, !12} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !9, !11, !12} !14 = distinct !{!14, !9, !12, !11}
#include<stdio.h> int main() { char word; while(scanf("%c", &word) != EOF) { if('a' <= word && word <= 'z') { word = word - 'a' + 'A'; } else if('A' <= word && word <= 'Z') { word = word - 'A' + 'a'; } printf("%c", word); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176238/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176238/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %word = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %word) #4 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word) %cmp.not25 = icmp eq i32 %call24, -1 br i1 %cmp.not25, label %while.end, label %while.body while.body: ; preds = %entry, %if.end20 %0 = load i8, ptr %word, align 1 %1 = add i8 %0, -97 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i8 %0, -32 store i8 %add, ptr %word, align 1, !tbaa !5 br label %if.end20 if.else: ; preds = %while.body %2 = add i8 %0, -65 %or.cond23 = icmp ult i8 %2, 26 br i1 %or.cond23, label %if.then15, label %if.end20 if.then15: ; preds = %if.else %add18 = add nuw nsw i8 %0, 32 store i8 %add18, ptr %word, align 1, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.else, %if.then15, %if.then %3 = phi i8 [ %0, %if.else ], [ %add18, %if.then15 ], [ %add, %if.then ] %conv21 = sext i8 %3 to i32 %putchar = call i32 @putchar(i32 %conv21) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %if.end20, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %word) #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"}
#include<stdio.h> int main(){ //準備部分 char ch; //入力・変換・出力部分 while(1){ scanf("%c",&ch); if(ch>='A' && ch<='Z')ch+=32; else if(ch>='a' && ch<='z')ch-=32; printf("%c",ch); if(ch=='\n')break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176281/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176281/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 br label %while.cond while.cond: ; preds = %if.end17, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 1 %1 = add i8 %0, -65 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.cond %add = add nuw nsw i8 %0, 32 store i8 %add, ptr %ch, align 1, !tbaa !5 br label %if.end17 if.else: ; preds = %while.cond %2 = add i8 %0, -97 %or.cond25 = icmp ult i8 %2, 26 br i1 %or.cond25, label %if.then14, label %if.end17 if.then14: ; preds = %if.else %sub = add nsw i8 %0, -32 store i8 %sub, ptr %ch, align 1, !tbaa !5 br label %if.end17 if.end17: ; preds = %if.else, %if.then14, %if.then %3 = phi i8 [ %0, %if.else ], [ %sub, %if.then14 ], [ %add, %if.then ] %conv18 = sext i8 %3 to i32 %putchar = call i32 @putchar(i32 %conv18) %4 = load i8, ptr %ch, align 1, !tbaa !5 %cmp21 = icmp eq i8 %4, 10 br i1 %cmp21, label %while.end, label %while.cond while.end: ; preds = %if.end17 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #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"}
#include <stdio.h> int main(void){ char a[1200]={}; int i=0; while(1){ scanf("%c", &a[i]); if (a[i]==0){ break; } else if (a[i]>='a' && a[i]<='z'){ a[i]=a[i]-32; } else if(a[i]>='A' && a[i]<='Z'){ a[i]=a[i]+32; } printf("%c", a[i]); i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176324/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176324/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [1200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200) %a, i8 0, i64 1200, i1 false) %call58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 16, !tbaa !5 %cmp59 = icmp eq i8 %0, 0 br i1 %cmp59, label %while.end, label %if.else if.else: ; preds = %entry, %if.end41 %indvars.iv = phi i64 [ %indvars.iv.next, %if.end41 ], [ 0, %entry ] %1 = phi i8 [ %5, %if.end41 ], [ %0, %entry ] %arrayidx61 = phi ptr [ %arrayidx, %if.end41 ], [ %a, %entry ] %2 = add i8 %1, -97 %or.cond = icmp ult i8 %2, 26 br i1 %or.cond, label %if.end41.sink.split, label %if.else21 if.else21: ; preds = %if.else %3 = add i8 %1, -65 %or.cond57 = icmp ult i8 %3, 26 br i1 %or.cond57, label %if.end41.sink.split, label %if.end41 if.end41.sink.split: ; preds = %if.else21, %if.else %.sink = phi i8 [ -32, %if.else ], [ 32, %if.else21 ] %add = add nsw i8 %1, %.sink store i8 %add, ptr %arrayidx61, align 1, !tbaa !5 br label %if.end41 if.end41: ; preds = %if.end41.sink.split, %if.else21 %4 = phi i8 [ %1, %if.else21 ], [ %add, %if.end41.sink.split ] %conv44 = sext i8 %4 to i32 %putchar = call i32 @putchar(i32 %conv44) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1200 x i8], ptr %a, i64 0, i64 %indvars.iv.next %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %5 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %5, 0 br i1 %cmp, label %while.end, label %if.else while.end: ; preds = %if.end41, %entry call void @llvm.lifetime.end.p0(i64 1200, 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 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int h, w, k; char map[8][8]; int i, j, mh, mw, b, ans = 0; scanf("%d%d%d", &h, &w, &k); for (i = 0; i < h; i++) { scanf("%s", map[i]); } for (mh = 0; mh < 1<<h; mh++) { for (mw = 0; mw < 1<<w; mw++) { b = 0; for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { if (((mh >> i) & 1) == 0 && ((mw >> j) & 1) == 0 && map[i][j] == '#') b++; } } if (b == k) ans++; } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %k = alloca i32, align 4 %map = alloca [8 x [8 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %map) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %k) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp61 = icmp sgt i32 %0, 0 br i1 %cmp61, label %for.body, label %for.cond5.preheader.lr.ph for.cond2.preheader: ; preds = %for.body %cmp390.not = icmp eq i32 %23, 31 br i1 %cmp390.not, label %for.end43, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %entry, %for.cond2.preheader %.lcssa140 = phi i32 [ %23, %for.cond2.preheader ], [ %0, %entry ] %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp778.not = icmp eq i32 %1, 31 %cmp1363 = icmp sgt i32 %1, 0 %2 = load i32, ptr %k, align 4 %cmp33 = icmp eq i32 %2, 0 br i1 %cmp778.not, label %for.end43, label %for.cond5.preheader.lr.ph.split.us for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph %shl6 = shl nuw i32 1, %1 %shl141 = shl nuw i32 1, %.lcssa140 %cmp1067 = icmp sgt i32 %.lcssa140, 0 %smax133 = call i32 @llvm.smax.i32(i32 %shl6, i32 1) %smax135 = call i32 @llvm.smax.i32(i32 %shl141, i32 1) br i1 %cmp1067, label %for.cond5.preheader.lr.ph.split.us.split.us, label %for.cond5.preheader.us.preheader for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph.split.us %3 = mul i32 %smax133, %smax135 %4 = select i1 %cmp33, i32 %3, i32 0 br label %for.end43 for.cond5.preheader.lr.ph.split.us.split.us: ; preds = %for.cond5.preheader.lr.ph.split.us br i1 %cmp1363, label %for.cond5.preheader.us.us.us.preheader, label %for.cond5.preheader.us.us.preheader for.cond5.preheader.us.us.preheader: ; preds = %for.cond5.preheader.lr.ph.split.us.split.us %5 = mul i32 %smax133, %smax135 %6 = select i1 %cmp33, i32 %5, i32 0 br label %for.end43 for.cond5.preheader.us.us.us.preheader: ; preds = %for.cond5.preheader.lr.ph.split.us.split.us %wide.trip.count131 = zext i32 %.lcssa140 to i64 %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 1 %7 = icmp eq i32 %1, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond5.preheader.us.us.us for.cond5.preheader.us.us.us: ; preds = %for.cond5.preheader.us.us.us.preheader, %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us %ans.094.us.us.us = phi i32 [ %spec.select60.us.us.us.us.us, %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us ], [ 0, %for.cond5.preheader.us.us.us.preheader ] %mh.091.us.us.us = phi i32 [ %inc42.us.us.us, %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us ], [ 0, %for.cond5.preheader.us.us.us.preheader ] br label %for.cond9.preheader.us.us.us.us.us for.cond9.preheader.us.us.us.us.us: ; preds = %for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us, %for.cond5.preheader.us.us.us %ans.181.us.us.us.us.us = phi i32 [ %ans.094.us.us.us, %for.cond5.preheader.us.us.us ], [ %spec.select60.us.us.us.us.us, %for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us ] %mw.079.us.us.us.us.us = phi i32 [ 0, %for.cond5.preheader.us.us.us ], [ %inc39.us.us.us.us.us, %for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us ] br label %for.cond12.preheader.us.us.us.us.us.us for.cond12.preheader.us.us.us.us.us.us: ; preds = %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us, %for.cond9.preheader.us.us.us.us.us %indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us ], [ 0, %for.cond9.preheader.us.us.us.us.us ] %b.069.us.us.us.us.us.us = phi i32 [ %.us-phi.us.us.us.us.us.us, %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us ], [ 0, %for.cond9.preheader.us.us.us.us.us ] %8 = trunc i64 %indvars.iv128 to i32 %9 = shl nuw i32 1, %8 %10 = and i32 %9, %mh.091.us.us.us %cmp15.us.us.us.us.us.us = icmp eq i32 %10, 0 br i1 %cmp15.us.us.us.us.us.us, label %for.body14.us.us.us.us.us.us.us.preheader, label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us for.body14.us.us.us.us.us.us.us.preheader: ; preds = %for.cond12.preheader.us.us.us.us.us.us br i1 %7, label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, label %for.body14.us.us.us.us.us.us.us for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa: ; preds = %for.inc27.us.us.us.us.us.us.us.1, %for.body14.us.us.us.us.us.us.us.preheader %b.2.us.us.us.us.us.us.us.lcssa.ph = phi i32 [ undef, %for.body14.us.us.us.us.us.us.us.preheader ], [ %b.2.us.us.us.us.us.us.us.1, %for.inc27.us.us.us.us.us.us.us.1 ] %indvars.iv125.unr = phi i64 [ 0, %for.body14.us.us.us.us.us.us.us.preheader ], [ %indvars.iv.next126.1, %for.inc27.us.us.us.us.us.us.us.1 ] %b.165.us.us.us.us.us.us.us.unr = phi i32 [ %b.069.us.us.us.us.us.us, %for.body14.us.us.us.us.us.us.us.preheader ], [ %b.2.us.us.us.us.us.us.us.1, %for.inc27.us.us.us.us.us.us.us.1 ] br i1 %lcmp.mod.not, label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us, label %for.body14.us.us.us.us.us.us.us.epil for.body14.us.us.us.us.us.us.us.epil: ; preds = %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa %11 = trunc i64 %indvars.iv125.unr to i32 %12 = shl nuw i32 1, %11 %13 = and i32 %12, %mw.079.us.us.us.us.us %cmp18.us.us.us.us.us.us.us.epil = icmp eq i32 %13, 0 br i1 %cmp18.us.us.us.us.us.us.us.epil, label %land.lhs.true19.us.us.us.us.us.us.us.epil, label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us land.lhs.true19.us.us.us.us.us.us.us.epil: ; preds = %for.body14.us.us.us.us.us.us.us.epil %arrayidx23.us.us.us.us.us.us.us.epil = getelementptr inbounds [8 x [8 x i8]], ptr %map, i64 0, i64 %indvars.iv128, i64 %indvars.iv125.unr %14 = load i8, ptr %arrayidx23.us.us.us.us.us.us.us.epil, align 1, !tbaa !9 %cmp24.us.us.us.us.us.us.us.epil = icmp eq i8 %14, 35 %inc26.us.us.us.us.us.us.us.epil = zext i1 %cmp24.us.us.us.us.us.us.us.epil to i32 %spec.select.us.us.us.us.us.us.us.epil = add nsw i32 %b.165.us.us.us.us.us.us.us.unr, %inc26.us.us.us.us.us.us.us.epil br label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us for.cond12.for.inc30_crit_edge.us.us.us.us.us.us: ; preds = %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, %land.lhs.true19.us.us.us.us.us.us.us.epil, %for.body14.us.us.us.us.us.us.us.epil, %for.cond12.preheader.us.us.us.us.us.us %.us-phi.us.us.us.us.us.us = phi i32 [ %b.069.us.us.us.us.us.us, %for.cond12.preheader.us.us.us.us.us.us ], [ %b.2.us.us.us.us.us.us.us.lcssa.ph, %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa ], [ %b.165.us.us.us.us.us.us.us.unr, %for.body14.us.us.us.us.us.us.us.epil ], [ %spec.select.us.us.us.us.us.us.us.epil, %land.lhs.true19.us.us.us.us.us.us.us.epil ] %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131 br i1 %exitcond132.not, label %for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us, label %for.cond12.preheader.us.us.us.us.us.us, !llvm.loop !10 for.body14.us.us.us.us.us.us.us: ; preds = %for.body14.us.us.us.us.us.us.us.preheader, %for.inc27.us.us.us.us.us.us.us.1 %indvars.iv125 = phi i64 [ %indvars.iv.next126.1, %for.inc27.us.us.us.us.us.us.us.1 ], [ 0, %for.body14.us.us.us.us.us.us.us.preheader ] %b.165.us.us.us.us.us.us.us = phi i32 [ %b.2.us.us.us.us.us.us.us.1, %for.inc27.us.us.us.us.us.us.us.1 ], [ %b.069.us.us.us.us.us.us, %for.body14.us.us.us.us.us.us.us.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc27.us.us.us.us.us.us.us.1 ], [ 0, %for.body14.us.us.us.us.us.us.us.preheader ] %15 = trunc i64 %indvars.iv125 to i32 %16 = shl nuw i32 1, %15 %17 = and i32 %16, %mw.079.us.us.us.us.us %cmp18.us.us.us.us.us.us.us = icmp eq i32 %17, 0 br i1 %cmp18.us.us.us.us.us.us.us, label %land.lhs.true19.us.us.us.us.us.us.us, label %for.inc27.us.us.us.us.us.us.us land.lhs.true19.us.us.us.us.us.us.us: ; preds = %for.body14.us.us.us.us.us.us.us %arrayidx23.us.us.us.us.us.us.us = getelementptr inbounds [8 x [8 x i8]], ptr %map, i64 0, i64 %indvars.iv128, i64 %indvars.iv125 %18 = load i8, ptr %arrayidx23.us.us.us.us.us.us.us, align 2, !tbaa !9 %cmp24.us.us.us.us.us.us.us = icmp eq i8 %18, 35 %inc26.us.us.us.us.us.us.us = zext i1 %cmp24.us.us.us.us.us.us.us to i32 %spec.select.us.us.us.us.us.us.us = add nsw i32 %b.165.us.us.us.us.us.us.us, %inc26.us.us.us.us.us.us.us br label %for.inc27.us.us.us.us.us.us.us for.inc27.us.us.us.us.us.us.us: ; preds = %land.lhs.true19.us.us.us.us.us.us.us, %for.body14.us.us.us.us.us.us.us %b.2.us.us.us.us.us.us.us = phi i32 [ %b.165.us.us.us.us.us.us.us, %for.body14.us.us.us.us.us.us.us ], [ %spec.select.us.us.us.us.us.us.us, %land.lhs.true19.us.us.us.us.us.us.us ] %indvars.iv.next126 = or i64 %indvars.iv125, 1 %19 = trunc i64 %indvars.iv.next126 to i32 %20 = shl nuw i32 1, %19 %21 = and i32 %20, %mw.079.us.us.us.us.us %cmp18.us.us.us.us.us.us.us.1 = icmp eq i32 %21, 0 br i1 %cmp18.us.us.us.us.us.us.us.1, label %land.lhs.true19.us.us.us.us.us.us.us.1, label %for.inc27.us.us.us.us.us.us.us.1 land.lhs.true19.us.us.us.us.us.us.us.1: ; preds = %for.inc27.us.us.us.us.us.us.us %arrayidx23.us.us.us.us.us.us.us.1 = getelementptr inbounds [8 x [8 x i8]], ptr %map, i64 0, i64 %indvars.iv128, i64 %indvars.iv.next126 %22 = load i8, ptr %arrayidx23.us.us.us.us.us.us.us.1, align 1, !tbaa !9 %cmp24.us.us.us.us.us.us.us.1 = icmp eq i8 %22, 35 %inc26.us.us.us.us.us.us.us.1 = zext i1 %cmp24.us.us.us.us.us.us.us.1 to i32 %spec.select.us.us.us.us.us.us.us.1 = add nsw i32 %b.2.us.us.us.us.us.us.us, %inc26.us.us.us.us.us.us.us.1 br label %for.inc27.us.us.us.us.us.us.us.1 for.inc27.us.us.us.us.us.us.us.1: ; preds = %land.lhs.true19.us.us.us.us.us.us.us.1, %for.inc27.us.us.us.us.us.us.us %b.2.us.us.us.us.us.us.us.1 = phi i32 [ %b.2.us.us.us.us.us.us.us, %for.inc27.us.us.us.us.us.us.us ], [ %spec.select.us.us.us.us.us.us.us.1, %land.lhs.true19.us.us.us.us.us.us.us.1 ] %indvars.iv.next126.1 = add nuw nsw i64 %indvars.iv125, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, label %for.body14.us.us.us.us.us.us.us, !llvm.loop !12 for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us: ; preds = %for.cond12.for.inc30_crit_edge.us.us.us.us.us.us %cmp33.us.us.us.us.us = icmp eq i32 %.us-phi.us.us.us.us.us.us, %2 %inc36.us.us.us.us.us = zext i1 %cmp33.us.us.us.us.us to i32 %spec.select60.us.us.us.us.us = add nsw i32 %ans.181.us.us.us.us.us, %inc36.us.us.us.us.us %inc39.us.us.us.us.us = add nuw nsw i32 %mw.079.us.us.us.us.us, 1 %exitcond134.not = icmp eq i32 %inc39.us.us.us.us.us, %smax133 br i1 %exitcond134.not, label %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us, label %for.cond9.preheader.us.us.us.us.us, !llvm.loop !13 for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us: ; preds = %for.cond9.for.end32_crit_edge.split.us.us.us.us.us.us %inc42.us.us.us = add nuw nsw i32 %mh.091.us.us.us, 1 %exitcond136.not = icmp eq i32 %inc42.us.us.us, %smax135 br i1 %exitcond136.not, label %for.end43, label %for.cond5.preheader.us.us.us, !llvm.loop !14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [8 x [8 x i8]], ptr %map, 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 %23 = load i32, ptr %h, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp = icmp slt i64 %indvars.iv.next, %24 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !15 for.end43: ; preds = %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us, %for.cond5.preheader.lr.ph, %for.cond5.preheader.us.preheader, %for.cond5.preheader.us.us.preheader, %for.cond2.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %6, %for.cond5.preheader.us.us.preheader ], [ %4, %for.cond5.preheader.us.preheader ], [ 0, %for.cond5.preheader.lr.ph ], [ %spec.select60.us.us.us.us.us, %for.cond5.for.inc41_crit_edge.split.us.split.us.us.us.us ] %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %map) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11}
#include <stdio.h> int main() { int H, W, K; scanf("%d %d %d", &H, &W, &K); char m[H * W]; for (int i = 0; i < H * W; i++) { scanf(" %c", &m[i]); } int count = 0; for (int h = 0; h < 1 << H; h++) { for (int w = 0; w < 1 << W; w++) { int black = 0; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (h >> i & 1 && w >> j & 1 && m[i * W + j] == '#') { black++; } } } if (black == K) { count++; } } } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176410/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176410/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W, ptr noundef nonnull %K) %0 = load i32, ptr %H, align 4, !tbaa !5 %1 = load i32, ptr %W, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = zext i32 %mul to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %2, align 16 %4 = load i32, ptr %H, align 4, !tbaa !5 %5 = load i32, ptr %W, align 4, !tbaa !5 %mul165 = mul nsw i32 %5, %4 %cmp66 = icmp sgt i32 %mul165, 0 br i1 %cmp66, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %.lcssa64 = phi i32 [ %4, %entry ], [ %29, %for.body ] %.lcssa = phi i32 [ %5, %entry ], [ %30, %for.body ] %shl = shl nuw i32 1, %.lcssa64 %cmp496.not = icmp eq i32 %.lcssa64, 31 br i1 %cmp496.not, label %for.cond.cleanup5, label %for.cond7.preheader.lr.ph for.cond7.preheader.lr.ph: ; preds = %for.cond3.preheader %shl8 = shl nuw i32 1, %.lcssa %cmp984.not = icmp eq i32 %.lcssa, 31 %cmp1869 = icmp sgt i32 %.lcssa, 0 %6 = load i32, ptr %K, align 4 %cmp37 = icmp eq i32 %6, 0 br i1 %cmp984.not, label %for.cond.cleanup5, label %for.cond7.preheader.lr.ph.split.us for.cond7.preheader.lr.ph.split.us: ; preds = %for.cond7.preheader.lr.ph %cmp1473 = icmp sgt i32 %.lcssa64, 0 br i1 %cmp1473, label %for.cond7.preheader.lr.ph.split.us.split.us, label %for.cond7.preheader.us.preheader for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph.split.us %smax = call i32 @llvm.smax.i32(i32 %shl8, i32 1) %smax129 = call i32 @llvm.smax.i32(i32 %shl, i32 1) %7 = mul i32 %smax, %smax129 %8 = select i1 %cmp37, i32 %7, i32 0 br label %for.cond.cleanup5 for.cond7.preheader.lr.ph.split.us.split.us: ; preds = %for.cond7.preheader.lr.ph.split.us br i1 %cmp1869, label %for.cond7.preheader.us.us.us.preheader, label %for.cond7.preheader.us.us.preheader for.cond7.preheader.us.us.preheader: ; preds = %for.cond7.preheader.lr.ph.split.us.split.us %smax130 = call i32 @llvm.smax.i32(i32 %shl8, i32 1) %smax131 = call i32 @llvm.smax.i32(i32 %shl, i32 1) %9 = mul i32 %smax130, %smax131 %10 = select i1 %cmp37, i32 %9, i32 0 br label %for.cond.cleanup5 for.cond7.preheader.us.us.us.preheader: ; preds = %for.cond7.preheader.lr.ph.split.us.split.us %11 = zext i32 %.lcssa to i64 %smax142 = call i32 @llvm.smax.i32(i32 %shl8, i32 1) %smax144 = call i32 @llvm.smax.i32(i32 %shl, i32 1) %wide.trip.count140 = zext i32 %.lcssa64 to i64 %wide.trip.count = zext i32 %.lcssa to i64 %xtraiter = and i64 %wide.trip.count, 1 %12 = icmp eq i32 %.lcssa, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond7.preheader.us.us.us for.cond7.preheader.us.us.us: ; preds = %for.cond7.preheader.us.us.us.preheader, %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us %h.098.us.us.us = phi i32 [ %inc46.us.us.us, %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us ], [ 0, %for.cond7.preheader.us.us.us.preheader ] %count.097.us.us.us = phi i32 [ %spec.select.us.us.us.us.us, %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us ], [ 0, %for.cond7.preheader.us.us.us.preheader ] br label %for.cond13.preheader.us.us.us.us.us for.cond13.preheader.us.us.us.us.us: ; preds = %for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us, %for.cond7.preheader.us.us.us %w.086.us.us.us.us.us = phi i32 [ 0, %for.cond7.preheader.us.us.us ], [ %inc43.us.us.us.us.us, %for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us ] %count.185.us.us.us.us.us = phi i32 [ %count.097.us.us.us, %for.cond7.preheader.us.us.us ], [ %spec.select.us.us.us.us.us, %for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us ] br label %for.cond17.preheader.us.us.us.us.us.us for.cond17.preheader.us.us.us.us.us.us: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us, %for.cond13.preheader.us.us.us.us.us %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us ], [ 0, %for.cond13.preheader.us.us.us.us.us ] %black.074.us.us.us.us.us.us = phi i32 [ %.us-phi.us.us.us.us.us.us, %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us ], [ 0, %for.cond13.preheader.us.us.us.us.us ] %13 = trunc i64 %indvars.iv136 to i32 %14 = shl nuw i32 1, %13 %15 = and i32 %14, %h.098.us.us.us %tobool.not.us.us.us.us.us.us = icmp eq i32 %15, 0 br i1 %tobool.not.us.us.us.us.us.us, label %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us, label %for.body20.us77.us.us.us.us.us.preheader for.body20.us77.us.us.us.us.us.preheader: ; preds = %for.cond17.preheader.us.us.us.us.us.us %16 = mul nsw i64 %indvars.iv136, %11 %invariant.gep = getelementptr i8, ptr %vla, i64 %16 br i1 %12, label %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, label %for.body20.us77.us.us.us.us.us for.body20.us77.us.us.us.us.us: ; preds = %for.body20.us77.us.us.us.us.us.preheader, %for.inc31.us.us.us.us.us.us.1 %indvars.iv132 = phi i64 [ %indvars.iv.next133.1, %for.inc31.us.us.us.us.us.us.1 ], [ 0, %for.body20.us77.us.us.us.us.us.preheader ] %black.170.us.us.us.us.us.us = phi i32 [ %black.2.us.us.us.us.us.us.1, %for.inc31.us.us.us.us.us.us.1 ], [ %black.074.us.us.us.us.us.us, %for.body20.us77.us.us.us.us.us.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc31.us.us.us.us.us.us.1 ], [ 0, %for.body20.us77.us.us.us.us.us.preheader ] %17 = trunc i64 %indvars.iv132 to i32 %18 = shl nuw i32 1, %17 %19 = and i32 %18, %w.086.us.us.us.us.us %tobool23.not.us.us.us.us.us.us = icmp eq i32 %19, 0 br i1 %tobool23.not.us.us.us.us.us.us, label %for.inc31.us.us.us.us.us.us, label %land.lhs.true24.us.us.us.us.us.us land.lhs.true24.us.us.us.us.us.us: ; preds = %for.body20.us77.us.us.us.us.us %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv132 %20 = load i8, ptr %gep, align 1, !tbaa !9 %cmp28.us.us.us.us.us.us = icmp eq i8 %20, 35 %inc30.us.us.us.us.us.us = zext i1 %cmp28.us.us.us.us.us.us to i32 %spec.select63.us.us.us.us.us.us = add nsw i32 %black.170.us.us.us.us.us.us, %inc30.us.us.us.us.us.us br label %for.inc31.us.us.us.us.us.us for.inc31.us.us.us.us.us.us: ; preds = %land.lhs.true24.us.us.us.us.us.us, %for.body20.us77.us.us.us.us.us %black.2.us.us.us.us.us.us = phi i32 [ %black.170.us.us.us.us.us.us, %for.body20.us77.us.us.us.us.us ], [ %spec.select63.us.us.us.us.us.us, %land.lhs.true24.us.us.us.us.us.us ] %indvars.iv.next133 = or i64 %indvars.iv132, 1 %21 = trunc i64 %indvars.iv.next133 to i32 %22 = shl nuw i32 1, %21 %23 = and i32 %22, %w.086.us.us.us.us.us %tobool23.not.us.us.us.us.us.us.1 = icmp eq i32 %23, 0 br i1 %tobool23.not.us.us.us.us.us.us.1, label %for.inc31.us.us.us.us.us.us.1, label %land.lhs.true24.us.us.us.us.us.us.1 land.lhs.true24.us.us.us.us.us.us.1: ; preds = %for.inc31.us.us.us.us.us.us %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next133 %24 = load i8, ptr %gep.1, align 1, !tbaa !9 %cmp28.us.us.us.us.us.us.1 = icmp eq i8 %24, 35 %inc30.us.us.us.us.us.us.1 = zext i1 %cmp28.us.us.us.us.us.us.1 to i32 %spec.select63.us.us.us.us.us.us.1 = add nsw i32 %black.2.us.us.us.us.us.us, %inc30.us.us.us.us.us.us.1 br label %for.inc31.us.us.us.us.us.us.1 for.inc31.us.us.us.us.us.us.1: ; preds = %land.lhs.true24.us.us.us.us.us.us.1, %for.inc31.us.us.us.us.us.us %black.2.us.us.us.us.us.us.1 = phi i32 [ %black.2.us.us.us.us.us.us, %for.inc31.us.us.us.us.us.us ], [ %spec.select63.us.us.us.us.us.us.1, %land.lhs.true24.us.us.us.us.us.us.1 ] %indvars.iv.next133.1 = add nuw nsw i64 %indvars.iv132, 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.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, label %for.body20.us77.us.us.us.us.us, !llvm.loop !10 for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa: ; preds = %for.inc31.us.us.us.us.us.us.1, %for.body20.us77.us.us.us.us.us.preheader %black.2.us.us.us.us.us.us.lcssa.ph = phi i32 [ undef, %for.body20.us77.us.us.us.us.us.preheader ], [ %black.2.us.us.us.us.us.us.1, %for.inc31.us.us.us.us.us.us.1 ] %indvars.iv132.unr = phi i64 [ 0, %for.body20.us77.us.us.us.us.us.preheader ], [ %indvars.iv.next133.1, %for.inc31.us.us.us.us.us.us.1 ] %black.170.us.us.us.us.us.us.unr = phi i32 [ %black.074.us.us.us.us.us.us, %for.body20.us77.us.us.us.us.us.preheader ], [ %black.2.us.us.us.us.us.us.1, %for.inc31.us.us.us.us.us.us.1 ] br i1 %lcmp.mod.not, label %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us, label %for.body20.us77.us.us.us.us.us.epil for.body20.us77.us.us.us.us.us.epil: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa %25 = trunc i64 %indvars.iv132.unr to i32 %26 = shl nuw i32 1, %25 %27 = and i32 %26, %w.086.us.us.us.us.us %tobool23.not.us.us.us.us.us.us.epil = icmp eq i32 %27, 0 br i1 %tobool23.not.us.us.us.us.us.us.epil, label %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us, label %land.lhs.true24.us.us.us.us.us.us.epil land.lhs.true24.us.us.us.us.us.us.epil: ; preds = %for.body20.us77.us.us.us.us.us.epil %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv132.unr %28 = load i8, ptr %gep.epil, align 1, !tbaa !9 %cmp28.us.us.us.us.us.us.epil = icmp eq i8 %28, 35 %inc30.us.us.us.us.us.us.epil = zext i1 %cmp28.us.us.us.us.us.us.epil to i32 %spec.select63.us.us.us.us.us.us.epil = add nsw i32 %black.170.us.us.us.us.us.us.unr, %inc30.us.us.us.us.us.us.epil br label %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa, %land.lhs.true24.us.us.us.us.us.us.epil, %for.body20.us77.us.us.us.us.us.epil, %for.cond17.preheader.us.us.us.us.us.us %.us-phi.us.us.us.us.us.us = phi i32 [ %black.074.us.us.us.us.us.us, %for.cond17.preheader.us.us.us.us.us.us ], [ %black.2.us.us.us.us.us.us.lcssa.ph, %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us.loopexit.unr-lcssa ], [ %black.170.us.us.us.us.us.us.unr, %for.body20.us77.us.us.us.us.us.epil ], [ %spec.select63.us.us.us.us.us.us.epil, %land.lhs.true24.us.us.us.us.us.us.epil ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond141.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count140 br i1 %exitcond141.not, label %for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us, label %for.cond17.preheader.us.us.us.us.us.us, !llvm.loop !12 for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us: ; preds = %for.cond17.for.cond.cleanup19_crit_edge.us.us.us.us.us.us %cmp37.us.us.us.us.us = icmp eq i32 %.us-phi.us.us.us.us.us.us, %6 %inc40.us.us.us.us.us = zext i1 %cmp37.us.us.us.us.us to i32 %spec.select.us.us.us.us.us = add nsw i32 %count.185.us.us.us.us.us, %inc40.us.us.us.us.us %inc43.us.us.us.us.us = add nuw nsw i32 %w.086.us.us.us.us.us, 1 %exitcond143.not = icmp eq i32 %inc43.us.us.us.us.us, %smax142 br i1 %exitcond143.not, label %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us, label %for.cond13.preheader.us.us.us.us.us, !llvm.loop !13 for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us: ; preds = %for.cond13.for.cond.cleanup15_crit_edge.split.us.us.us.us.us.us %inc46.us.us.us = add nuw nsw i32 %h.098.us.us.us, 1 %exitcond145.not = icmp eq i32 %inc46.us.us.us, %smax144 br i1 %exitcond145.not, label %for.cond.cleanup5, label %for.cond7.preheader.us.us.us, !llvm.loop !14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %29 = load i32, ptr %H, align 4, !tbaa !5 %30 = load i32, ptr %W, align 4, !tbaa !5 %mul1 = mul nsw i32 %30, %29 %31 = sext i32 %mul1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %31 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !15 for.cond.cleanup5: ; preds = %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us, %for.cond7.preheader.lr.ph, %for.cond7.preheader.us.preheader, %for.cond7.preheader.us.us.preheader, %for.cond3.preheader %count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ %10, %for.cond7.preheader.us.us.preheader ], [ %8, %for.cond7.preheader.us.preheader ], [ 0, %for.cond7.preheader.lr.ph ], [ %spec.select.us.us.us.us.us, %for.cond7.for.cond.cleanup10_crit_edge.split.us.split.us.us.us.us ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11}
#include<stdio.h> int main(){ char s[4]; scanf("%s",s); if(s[0]!=s[1] && s[0]!=s[2] && s[1]!=s[2]) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176461/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176461/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, %1 br i1 %cmp.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %arrayidx6 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8.not = icmp eq i8 %0, %2 %cmp15.not = icmp eq i8 %1, %2 %or.cond = or i1 %cmp8.not, %cmp15.not br i1 %or.cond, label %if.else, label %if.end if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ] %call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char s[4]; int a=0,b=0,c=0,i; scanf("%s",s); for(i=0;i<3;i++){ if(s[i]=='a') a++; if(s[i]=='b') b++; if(s[i]=='c') c++; } if(a==1&&b==1&&c==1) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176504/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176504/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %cmp14 = icmp eq i8 %0, 99 %inc17 = zext i1 %cmp14 to i32 %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp14.1 = icmp eq i8 %1, 99 %inc17.1 = zext i1 %cmp14.1 to i32 %c.1.1 = add nuw nsw i32 %inc17, %inc17.1 %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %cmp14.2 = icmp eq i8 %2, 99 %inc17.2 = zext i1 %cmp14.2 to i32 %c.1.2 = add nuw nsw i32 %c.1.1, %inc17.2 %3 = insertelement <2 x i8> poison, i8 %0, i64 0 %4 = shufflevector <2 x i8> %3, <2 x i8> poison, <2 x i32> zeroinitializer %5 = icmp eq <2 x i8> %4, <i8 98, i8 97> %6 = zext <2 x i1> %5 to <2 x i32> %7 = insertelement <2 x i8> poison, i8 %1, i64 0 %8 = shufflevector <2 x i8> %7, <2 x i8> poison, <2 x i32> zeroinitializer %9 = icmp eq <2 x i8> %8, <i8 98, i8 97> %10 = zext <2 x i1> %9 to <2 x i32> %11 = add nuw nsw <2 x i32> %6, %10 %12 = insertelement <2 x i8> poison, i8 %2, i64 0 %13 = shufflevector <2 x i8> %12, <2 x i8> poison, <2 x i32> zeroinitializer %14 = icmp eq <2 x i8> %13, <i8 98, i8 97> %15 = zext <2 x i1> %14 to <2 x i32> %16 = add nuw nsw <2 x i32> %11, %15 %17 = icmp eq <2 x i32> %16, <i32 1, i32 1> %18 = extractelement <2 x i1> %17, i64 0 %19 = extractelement <2 x i1> %17, i64 1 %or.cond = select i1 %19, i1 %18, i1 false %cmp25 = icmp eq i32 %c.1.2, 1 %or.cond31 = select i1 %or.cond, i1 %cmp25, i1 false %.str.1..str.2 = select i1 %or.cond31, ptr @.str.1, ptr @.str.2 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int judge=0; char s[3]; scanf("%s",s); if(s[0]=='a'){ if(s[1]=='b'){ if(s[2]=='c') judge=1; }else if(s[1]=='c'){ if(s[2]=='b') judge=1; } }else if(s[0]=='b'){ if(s[1]=='a'){ if(s[2]=='c') judge=1; }else if(s[1]=='c'){ if(s[2]=='a') judge=1; } }else if(s[0]=='c'){ if(s[1]=='b'){ if(s[2]=='a') judge=1; }else if(s[1]=='a'){ if(s[2]=='b') judge=1; } } if(judge==0) puts("No"); else if(judge==1) puts("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176548/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176548/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 switch i8 %0, label %if.end100 [ i8 97, label %if.then i8 98, label %if.then30 i8 99, label %if.then61 ] if.then: ; preds = %entry %arrayidx2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4 = icmp eq i8 %1, 98 br i1 %cmp4, label %if.then6, label %if.else if.then6: ; preds = %if.then %arrayidx7 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %cmp9.not = icmp eq i8 %2, 99 br i1 %cmp9.not, label %if.then97, label %if.end100 if.else: ; preds = %if.then %cmp14 = icmp ne i8 %1, 99 %arrayidx17 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %3 = load i8, ptr %arrayidx17, align 1 %cmp19 = icmp ne i8 %3, 98 %or.cond.not = select i1 %cmp14, i1 true, i1 %cmp19 br i1 %or.cond.not, label %if.end100, label %if.then97 if.then30: ; preds = %entry %arrayidx31 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1 %4 = load i8, ptr %arrayidx31, align 1, !tbaa !5 %cmp33 = icmp eq i8 %4, 97 br i1 %cmp33, label %if.then35, label %if.else42 if.then35: ; preds = %if.then30 %arrayidx36 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %5 = load i8, ptr %arrayidx36, align 1, !tbaa !5 %cmp38.not = icmp eq i8 %5, 99 br i1 %cmp38.not, label %if.then97, label %if.end100 if.else42: ; preds = %if.then30 %cmp45 = icmp ne i8 %4, 99 %arrayidx48 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %6 = load i8, ptr %arrayidx48, align 1 %cmp50 = icmp ne i8 %6, 97 %or.cond101.not = select i1 %cmp45, i1 true, i1 %cmp50 br i1 %or.cond101.not, label %if.end100, label %if.then97 if.then61: ; preds = %entry %arrayidx62 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1 %7 = load i8, ptr %arrayidx62, align 1, !tbaa !5 %cmp64 = icmp eq i8 %7, 98 br i1 %cmp64, label %if.then66, label %if.end89 if.then66: ; preds = %if.then61 %arrayidx67 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %8 = load i8, ptr %arrayidx67, align 1, !tbaa !5 %cmp69.not = icmp eq i8 %8, 97 br i1 %cmp69.not, label %if.then97, label %if.end100 if.end89: ; preds = %if.then61 %cmp76 = icmp ne i8 %7, 97 %arrayidx79 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %9 = load i8, ptr %arrayidx79, align 1 %cmp81 = icmp ne i8 %9, 98 %or.cond102.not = select i1 %cmp76, i1 true, i1 %cmp81 br i1 %or.cond102.not, label %if.end100, label %if.then97 if.then97: ; preds = %if.then66, %if.else42, %if.then35, %if.else, %if.then6, %if.end89 br label %if.end100 if.end100: ; preds = %if.end89, %entry, %if.then6, %if.else, %if.then35, %if.else42, %if.then66, %if.then97 %.str.2.sink = phi ptr [ @.str.2, %if.then97 ], [ @.str.1, %if.then66 ], [ @.str.1, %if.else42 ], [ @.str.1, %if.then35 ], [ @.str.1, %if.else ], [ @.str.1, %if.then6 ], [ @.str.1, %entry ], [ @.str.1, %if.end89 ] %call98 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char x[10]; scanf("%s",x); if(x[0] == x[1] || x[1] == x[2] || x[2] == x[0]){ printf("No"); }else{ printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176591/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %arrayidx6 = getelementptr inbounds [10 x i8], ptr %x, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, %2 %cmp15 = icmp eq i8 %2, %0 %or.cond = or i1 %cmp8, %cmp15 %spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2 br label %if.end if.end: ; preds = %lor.lhs.false, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char s[4]; scanf("%s",s); int l[3]={0}; for(int i=0;i<3;i++){ l[s[i]-'a']++; } printf("%s\n",(l[0]==1 && l[1]==1 && l[2]==1)?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176634/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [4 x i8], align 1 %l = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %l) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %l, i8 0, i64 12, i1 false) %0 = load i8, ptr %s, align 1, !tbaa !5 %conv = sext i8 %0 to i64 %sub = add nsw i64 %conv, -97 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %l, i64 0, i64 %sub %1 = load i32, ptr %arrayidx2, align 4, !tbaa !8 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx2, align 4, !tbaa !8 %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv.1 = sext i8 %2 to i64 %sub.1 = add nsw i64 %conv.1, -97 %arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %l, i64 0, i64 %sub.1 %3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !8 %inc.1 = add nsw i32 %3, 1 store i32 %inc.1, ptr %arrayidx2.1, align 4, !tbaa !8 %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %conv.2 = sext i8 %4 to i64 %sub.2 = add nsw i64 %conv.2, -97 %arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %l, i64 0, i64 %sub.2 %5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !8 %inc.2 = add nsw i32 %5, 1 store i32 %inc.2, ptr %arrayidx2.2, align 4, !tbaa !8 %6 = load i32, ptr %l, align 4, !tbaa !8 %cmp5 = icmp eq i32 %6, 1 %arrayidx7 = getelementptr inbounds [3 x i32], ptr %l, i64 0, i64 1 %7 = load i32, ptr %arrayidx7, align 4 %cmp8 = icmp eq i32 %7, 1 %or.cond = select i1 %cmp5, i1 %cmp8, i1 false %arrayidx10 = getelementptr inbounds [3 x i32], ptr %l, i64 0, i64 2 %8 = load i32, ptr %arrayidx10, align 4 %cmp11 = icmp eq i32 %8, 1 %9 = select i1 %or.cond, i1 %cmp11, i1 false %cond = select i1 %9, ptr @.str.2, ptr @.str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include<stdio.h> int main(){ int Ac=0,Bc=0,Cc=0,i; char S[3]; scanf("%s",S); for(i=0;i<3;i++){ if(S[i] == 'a') Ac++; if(S[i] == 'b') Bc++; if(S[i] == 'c') Cc++; } if(Ac==1 && Bc==1 && Cc==1){ printf("Yes\n"); }else{ printf("No\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176685/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176685/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %cmp14 = icmp eq i8 %0, 99 %inc17 = zext i1 %cmp14 to i32 %arrayidx.1 = getelementptr inbounds [3 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp14.1 = icmp eq i8 %1, 99 %inc17.1 = zext i1 %cmp14.1 to i32 %Cc.1.1 = add nuw nsw i32 %inc17, %inc17.1 %arrayidx.2 = getelementptr inbounds [3 x i8], ptr %S, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %cmp14.2 = icmp eq i8 %2, 99 %inc17.2 = zext i1 %cmp14.2 to i32 %Cc.1.2 = add nuw nsw i32 %Cc.1.1, %inc17.2 %3 = insertelement <2 x i8> poison, i8 %0, i64 0 %4 = shufflevector <2 x i8> %3, <2 x i8> poison, <2 x i32> zeroinitializer %5 = icmp eq <2 x i8> %4, <i8 98, i8 97> %6 = zext <2 x i1> %5 to <2 x i32> %7 = insertelement <2 x i8> poison, i8 %1, i64 0 %8 = shufflevector <2 x i8> %7, <2 x i8> poison, <2 x i32> zeroinitializer %9 = icmp eq <2 x i8> %8, <i8 98, i8 97> %10 = zext <2 x i1> %9 to <2 x i32> %11 = add nuw nsw <2 x i32> %6, %10 %12 = insertelement <2 x i8> poison, i8 %2, i64 0 %13 = shufflevector <2 x i8> %12, <2 x i8> poison, <2 x i32> zeroinitializer %14 = icmp eq <2 x i8> %13, <i8 98, i8 97> %15 = zext <2 x i1> %14 to <2 x i32> %16 = add nuw nsw <2 x i32> %11, %15 %17 = icmp eq <2 x i32> %16, <i32 1, i32 1> %18 = extractelement <2 x i1> %17, i64 0 %19 = extractelement <2 x i1> %17, i64 1 %or.cond = select i1 %19, i1 %18, i1 false %cmp25 = icmp eq i32 %Cc.1.2, 1 %or.cond31 = select i1 %or.cond, i1 %cmp25, i1 false %str.3.str = select i1 %or.cond31, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char s[3]; int a = 0, b = 0, c = 0; scanf("%s\n", s); if(s[0] == 'a') a++; if(s[0] == 'b') b++; if(s[0] == 'c') c++; if(s[1] == 'a') a++; if(s[1] == 'b') b++; if(s[1] == 'c') c++; if(s[2] == 'a') a++; if(s[2] == 'b') b++; if(s[2] == 'c') c++; if(a == 1 && b == 1 && c == 1) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176735/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176735/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %cmp11 = icmp eq i8 %0, 99 %c.0 = zext i1 %cmp11 to i32 %arrayidx16 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx16, align 1, !tbaa !5 %cmp32 = icmp eq i8 %1, 99 %inc35 = select i1 %cmp11, i32 2, i32 1 %c.1 = select i1 %cmp32, i32 %inc35, i32 %c.0 %arrayidx37 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx37, align 1, !tbaa !5 %cmp53 = icmp eq i8 %2, 99 %inc56 = zext i1 %cmp53 to i32 %c.2 = add nuw nsw i32 %c.1, %inc56 %3 = insertelement <2 x i8> poison, i8 %0, i64 0 %4 = shufflevector <2 x i8> %3, <2 x i8> poison, <2 x i32> zeroinitializer %5 = icmp eq <2 x i8> %4, <i8 98, i8 97> %6 = zext <2 x i1> %5 to <2 x i32> %7 = insertelement <2 x i8> poison, i8 %1, i64 0 %8 = shufflevector <2 x i8> %7, <2 x i8> poison, <2 x i32> zeroinitializer %9 = icmp eq <2 x i8> %8, <i8 98, i8 97> %10 = select <2 x i1> %5, <2 x i32> <i32 2, i32 2>, <2 x i32> <i32 1, i32 1> %11 = select <2 x i1> %9, <2 x i32> %10, <2 x i32> %6 %12 = insertelement <2 x i8> poison, i8 %2, i64 0 %13 = shufflevector <2 x i8> %12, <2 x i8> poison, <2 x i32> zeroinitializer %14 = icmp eq <2 x i8> %13, <i8 98, i8 97> %15 = zext <2 x i1> %14 to <2 x i32> %16 = add nuw nsw <2 x i32> %11, %15 %17 = icmp eq <2 x i32> %16, <i32 1, i32 1> %18 = extractelement <2 x i1> %17, i64 0 %19 = extractelement <2 x i1> %17, i64 1 %or.cond = select i1 %19, i1 %18, i1 false %cmp63 = icmp eq i32 %c.2, 1 %or.cond69 = select i1 %or.cond, i1 %cmp63, i1 false %str.3.str = select i1 %or.cond69, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int asc(const void *n, const void *m){ return *(long long*) n-*(long long*)m; } long long gcd(long long x,long long y){ if(x%y==0) return y; else return gcd(y,x%y); } int main(void){ long long n,i,j; scanf("%lld",&n); long long a[n]; for(i=0;i<n;i++) scanf("%lld",&a[i]); qsort(a,n,sizeof(a[0]),asc); long long min = a[0]; for(i=1;i<n;i++) min = gcd(min,a[i]); printf("%lld",min); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176786/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176786/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @asc(ptr nocapture noundef readonly %n, ptr nocapture noundef readonly %m) #0 { entry: %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %m, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse ] %y.tr = phi i64 [ %y, %entry ], [ %rem, %tailrecurse ] %rem = srem i64 %x.tr, %y.tr %cmp = icmp eq i64 %rem, 0 br i1 %cmp, label %return, label %tailrecurse return: ; preds = %tailrecurse ret i64 %y.tr } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp18 = icmp sgt i64 %2, 0 br i1 %cmp18, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.019 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.019 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.019, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i64 [ %2, %entry ], [ %3, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @asc) #7 %4 = load i64, ptr %vla, align 16, !tbaa !5 %5 = load i64, ptr %n, align 8, !tbaa !5 %cmp420 = icmp sgt i64 %5, 1 br i1 %cmp420, label %for.body5.preheader, label %for.end10 for.body5.preheader: ; preds = %for.end %6 = add i64 %5, -1 %xtraiter = and i64 %6, 1 %7 = icmp eq i64 %5, 2 br i1 %7, label %for.end10.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %6, -2 %invariant.gep = getelementptr i64, ptr %vla, i64 1 br label %for.body5 for.body5: ; preds = %gcd.exit.1, %for.body5.preheader.new %min.022 = phi i64 [ %4, %for.body5.preheader.new ], [ %y.tr.i.1, %gcd.exit.1 ] %i.121 = phi i64 [ 1, %for.body5.preheader.new ], [ %inc9.1, %gcd.exit.1 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %gcd.exit.1 ] %arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %i.121 %8 = load i64, ptr %arrayidx6, align 8, !tbaa !5 br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %for.body5 %x.tr.i = phi i64 [ %min.022, %for.body5 ], [ %y.tr.i, %tailrecurse.i ] %y.tr.i = phi i64 [ %8, %for.body5 ], [ %rem.i, %tailrecurse.i ] %rem.i = srem i64 %x.tr.i, %y.tr.i %cmp.i = icmp eq i64 %rem.i, 0 br i1 %cmp.i, label %gcd.exit, label %tailrecurse.i gcd.exit: ; preds = %tailrecurse.i %gep = getelementptr i64, ptr %invariant.gep, i64 %i.121 %9 = load i64, ptr %gep, align 8, !tbaa !5 br label %tailrecurse.i.1 tailrecurse.i.1: ; preds = %tailrecurse.i.1, %gcd.exit %x.tr.i.1 = phi i64 [ %y.tr.i, %gcd.exit ], [ %y.tr.i.1, %tailrecurse.i.1 ] %y.tr.i.1 = phi i64 [ %9, %gcd.exit ], [ %rem.i.1, %tailrecurse.i.1 ] %rem.i.1 = srem i64 %x.tr.i.1, %y.tr.i.1 %cmp.i.1 = icmp eq i64 %rem.i.1, 0 br i1 %cmp.i.1, label %gcd.exit.1, label %tailrecurse.i.1 gcd.exit.1: ; preds = %tailrecurse.i.1 %inc9.1 = add nuw nsw i64 %i.121, 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.end10.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11 for.end10.loopexit.unr-lcssa: ; preds = %gcd.exit.1, %for.body5.preheader %y.tr.i.lcssa.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %y.tr.i.1, %gcd.exit.1 ] %min.022.unr = phi i64 [ %4, %for.body5.preheader ], [ %y.tr.i.1, %gcd.exit.1 ] %i.121.unr = phi i64 [ 1, %for.body5.preheader ], [ %inc9.1, %gcd.exit.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end10, label %for.body5.epil for.body5.epil: ; preds = %for.end10.loopexit.unr-lcssa %arrayidx6.epil = getelementptr inbounds i64, ptr %vla, i64 %i.121.unr %10 = load i64, ptr %arrayidx6.epil, align 8, !tbaa !5 br label %tailrecurse.i.epil tailrecurse.i.epil: ; preds = %tailrecurse.i.epil, %for.body5.epil %x.tr.i.epil = phi i64 [ %min.022.unr, %for.body5.epil ], [ %y.tr.i.epil, %tailrecurse.i.epil ] %y.tr.i.epil = phi i64 [ %10, %for.body5.epil ], [ %rem.i.epil, %tailrecurse.i.epil ] %rem.i.epil = srem i64 %x.tr.i.epil, %y.tr.i.epil %cmp.i.epil = icmp eq i64 %rem.i.epil, 0 br i1 %cmp.i.epil, label %for.end10, label %tailrecurse.i.epil for.end10: ; preds = %for.end10.loopexit.unr-lcssa, %tailrecurse.i.epil, %for.end %min.0.lcssa = phi i64 [ %4, %for.end ], [ %y.tr.i.lcssa.lcssa.ph, %for.end10.loopexit.unr-lcssa ], [ %y.tr.i.epil, %tailrecurse.i.epil ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %min.0.lcssa) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #5 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6 ; 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) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #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 norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #6 = { 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 #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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int gdc(int a, int b){ if(a==0 || b==0){ return (a+b); } if(a>b){ return gdc(a%b, b); }else{ return gdc(a, b%a); } } int main(){ int N; int A[100000]; int i, j; int a,b; scanf("%d", &N); for(i=0; i<N; i++){ scanf("%d", &A[i]); } a=A[0]; for(i=1; i<N; i++){ b= A[i]; a=gdc(a, b); } printf("%d", a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176829/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176829/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gdc(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp28 = icmp eq i32 %a, 0 %cmp11729 = icmp eq i32 %b, 0 %or.cond1830 = or i1 %cmp28, %cmp11729 br i1 %or.cond1830, label %if.then, label %if.end.preheader if.end.preheader: ; preds = %entry, %if.then3 %b.tr.ph32 = phi i32 [ %b.tr19, %if.then3 ], [ %b, %entry ] %a.tr.ph31 = phi i32 [ %rem, %if.then3 ], [ %a, %entry ] br label %if.end if.then: ; preds = %if.then3, %if.else, %entry %a.tr.ph.lcssa = phi i32 [ %a, %entry ], [ %a.tr.ph31, %if.else ], [ %rem, %if.then3 ] %b.tr.lcssa = phi i32 [ %b, %entry ], [ 0, %if.else ], [ %b.tr19, %if.then3 ] %add = add nsw i32 %b.tr.lcssa, %a.tr.ph.lcssa ret i32 %add if.end: ; preds = %if.end.preheader, %if.else %b.tr19 = phi i32 [ %rem4, %if.else ], [ %b.tr.ph32, %if.end.preheader ] %cmp2 = icmp sgt i32 %a.tr.ph31, %b.tr19 br i1 %cmp2, label %if.then3, label %if.else if.then3: ; preds = %if.end %rem = srem i32 %a.tr.ph31, %b.tr19 %cmp = icmp eq i32 %rem, 0 %cmp117 = icmp eq i32 %b.tr19, 0 %or.cond18 = or i1 %cmp, %cmp117 br i1 %or.cond18, label %if.then, label %if.end.preheader if.else: ; preds = %if.end %rem4 = srem i32 %b.tr19, %a.tr.ph31 %cmp1 = icmp eq i32 %rem4, 0 br i1 %cmp1, label %if.then, label %if.end } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %A = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 400000, 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 !5 %cmp22 = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %cmp22) br label %for.body 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, 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 %.pre = load i32, ptr %A, align 16, !tbaa !5 %cmp424 = icmp sgt i32 %1, 1 br i1 %cmp424, label %for.body5.preheader, label %for.end11 for.body5.preheader: ; preds = %for.end %wide.trip.count = zext i32 %1 to i64 br label %for.body5 for.body5: ; preds = %for.body5.preheader, %gdc.exit %indvars.iv33 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next34, %gdc.exit ] %a.025 = phi i32 [ %.pre, %for.body5.preheader ], [ %add.i, %gdc.exit ] %arrayidx7 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv33 %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp28.i = icmp eq i32 %a.025, 0 %cmp11729.i = icmp eq i32 %3, 0 %or.cond1830.i = or i1 %cmp28.i, %cmp11729.i br i1 %or.cond1830.i, label %gdc.exit, label %if.end.preheader.i if.end.preheader.i: ; preds = %for.body5, %if.then3.i %b.tr.ph32.i = phi i32 [ %b.tr19.i, %if.then3.i ], [ %3, %for.body5 ] %a.tr.ph31.i = phi i32 [ %rem.i, %if.then3.i ], [ %a.025, %for.body5 ] br label %if.end.i if.end.i: ; preds = %if.else.i, %if.end.preheader.i %b.tr19.i = phi i32 [ %rem4.i, %if.else.i ], [ %b.tr.ph32.i, %if.end.preheader.i ] %cmp2.i = icmp sgt i32 %a.tr.ph31.i, %b.tr19.i br i1 %cmp2.i, label %if.then3.i, label %if.else.i if.then3.i: ; preds = %if.end.i %rem.i = srem i32 %a.tr.ph31.i, %b.tr19.i %cmp.i = icmp eq i32 %rem.i, 0 %cmp117.i = icmp eq i32 %b.tr19.i, 0 %or.cond18.i = or i1 %cmp117.i, %cmp.i br i1 %or.cond18.i, label %gdc.exit, label %if.end.preheader.i if.else.i: ; preds = %if.end.i %rem4.i = srem i32 %b.tr19.i, %a.tr.ph31.i %cmp1.i = icmp eq i32 %rem4.i, 0 br i1 %cmp1.i, label %gdc.exit, label %if.end.i gdc.exit: ; preds = %if.then3.i, %if.else.i, %for.body5 %a.tr.ph.lcssa.i = phi i32 [ %a.025, %for.body5 ], [ %a.tr.ph31.i, %if.else.i ], [ %rem.i, %if.then3.i ] %b.tr.lcssa.i = phi i32 [ %3, %for.body5 ], [ 0, %if.else.i ], [ %b.tr19.i, %if.then3.i ] %add.i = add nsw i32 %b.tr.lcssa.i, %a.tr.ph.lcssa.i %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %exitcond.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count br i1 %exitcond.not, label %for.end11, label %for.body5, !llvm.loop !11 for.end11: ; preds = %gdc.exit, %for.end %a.0.lcssa = phi i32 [ %.pre, %for.end ], [ %add.i, %gdc.exit ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.0.lcssa) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int gcd(int a,int b); int main(void) { int N; int ans; int A[100000]; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d",&A[i]); } for (int i = 0; i < N - 1; i++) { ans = gcd(A[i], A[i + 1]); A[i + 1] = ans; } printf("%d\n",ans); return 0; } int gcd(int a,int b) { int tmp; if (a < b) { tmp = b; b = a; a = tmp; } int r = a%b; while (r!=0) { a = b; b = r; r = a%b; } return b; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176872/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176872/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %for.cond3.preheader for.cond3.preheader.loopexit: ; preds = %for.body %.pre.pre = load i32, ptr %A, align 16, !tbaa !5 br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.loopexit, %entry %.pre = phi i32 [ undef, %entry ], [ %.pre.pre, %for.cond3.preheader.loopexit ] %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.cond3.preheader.loopexit ] %sub = add nsw i32 %.lcssa, -1 %cmp428 = icmp sgt i32 %.lcssa, 1 call void @llvm.assume(i1 %cmp428) %wide.trip.count = zext i32 %sub to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond3.preheader.loopexit, !llvm.loop !9 for.cond.cleanup5: ; preds = %gcd.exit %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %b.addr.1.lcssa.i) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 for.body6: ; preds = %for.cond3.preheader, %gcd.exit %3 = phi i32 [ %.pre, %for.cond3.preheader ], [ %b.addr.1.lcssa.i, %gcd.exit ] %indvars.iv33 = phi i64 [ 0, %for.cond3.preheader ], [ %indvars.iv.next34, %gcd.exit ] %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %arrayidx10 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv.next34 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %spec.select.i = call i32 @llvm.smin.i32(i32 %3, i32 %4) %spec.select12.i = call i32 @llvm.smax.i32(i32 %3, i32 %4) %rem.i = srem i32 %spec.select12.i, %spec.select.i %cmp1.not13.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not13.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %for.body6, %while.body.i %r.015.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %for.body6 ] %b.addr.114.i = phi i32 [ %r.015.i, %while.body.i ], [ %spec.select.i, %for.body6 ] %rem2.i = srem i32 %b.addr.114.i, %r.015.i %cmp1.not.i = icmp eq i32 %rem2.i, 0 br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !11 gcd.exit: ; preds = %while.body.i, %for.body6 %b.addr.1.lcssa.i = phi i32 [ %spec.select.i, %for.body6 ], [ %r.015.i, %while.body.i ] store i32 %b.addr.1.lcssa.i, ptr %arrayidx10, align 4, !tbaa !5 %exitcond.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %spec.select12 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select12, %spec.select %cmp1.not13 = icmp eq i32 %rem, 0 br i1 %cmp1.not13, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.015 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ] %b.addr.114 = phi i32 [ %r.015, %while.body ], [ %spec.select, %entry ] %rem2 = srem i32 %b.addr.114, %r.015 %cmp1.not = icmp eq i32 %rem2, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %b.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %r.015, %while.body ] ret i32 %b.addr.1.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main() { int cnt; int N; int A; int i; int min = 0; int tmp; cnt = scanf("%d", &N); cnt = scanf("%d", &min); for (i=1; i<N; i++) { cnt = scanf("%d", &A); while(1) { if (min > A) { tmp = min; min = A; A = tmp; } if ((A % min) == 0) break; if (min == 1) break; tmp = min; min = (A % min); A = tmp; } if (min == 1) break; } printf("%d", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176915/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176915/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca i32, align 4 %min = 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 %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %min) #3 store i32 0, ptr %min, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %min) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %0, 1 br i1 %cmp20, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = load i32, ptr %min, align 4, !tbaa !5 br label %for.end for.cond: ; preds = %while.end %inc = add nuw nsw i32 %i.021, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %i.021 = phi i32 [ %inc, %for.cond ], [ 1, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %min.promoted = load i32, ptr %min, align 4 %A.promoted = load i32, ptr %A, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %if.end9, %for.body %2 = phi i32 [ %4, %if.end9 ], [ %A.promoted, %for.body ] %rem19 = phi i32 [ %rem, %if.end9 ], [ %min.promoted, %for.body ] %cmp3 = icmp sgt i32 %rem19, %2 br i1 %cmp3, label %if.then, label %if.end if.then: ; preds = %while.cond store i32 %2, ptr %min, align 4, !tbaa !5 store i32 %rem19, ptr %A, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.cond %3 = phi i32 [ %rem19, %if.then ], [ %2, %while.cond ] %4 = phi i32 [ %2, %if.then ], [ %rem19, %while.cond ] %rem = srem i32 %3, %4 %cmp4 = icmp eq i32 %rem, 0 %cmp7 = icmp eq i32 %4, 1 %or.cond = or i1 %cmp7, %cmp4 br i1 %or.cond, label %while.end, label %if.end9 if.end9: ; preds = %if.end store i32 %rem, ptr %min, align 4, !tbaa !5 store i32 %4, ptr %A, align 4, !tbaa !5 br label %while.cond while.end: ; preds = %if.end br i1 %cmp7, label %for.end, label %for.cond for.end: ; preds = %for.cond, %while.end, %entry.for.end_crit_edge %5 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %4, %for.cond ], [ 1, %while.end ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %min) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #define df 0 typedef struct{ int x; int y; }pair; int c(const void* a,const void* b){ if(((pair*)a)->x>((pair*)b)->x) return 1; if(((pair*)a)->x<((pair*)b)->x) return -1; if(((pair*)a)->y>((pair*)b)->y) return 1; if(((pair*)a)->y<((pair*)b)->y) return -1; return 0; } int main (){ int n; scanf("%d",&n); int i,j; pair pos[n],dif[n*n]; for(i=0;i<n;i++){ scanf("%d%d",&pos[i].x,&pos[i].y); } if(n==1) { printf("1"); return 0; } int k=0; for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(i==j)continue; dif[k].x=pos[i].x-pos[j].x; dif[k].y=pos[i].y-pos[j].y; k++; } } qsort(dif,k,sizeof(pair),c); int max=1,temp=1; for(i=1;i<k;i++){ if(c(&(dif[i]),&(dif[i-1]))==0)temp++; else temp=1; if(max<temp)max=temp; } printf("%d",n-max); } /// check df==0 ///
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_176966/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_176966/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.pair = type { i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @c(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %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 %return, label %if.end if.end: ; preds = %entry %cmp4 = icmp slt i32 %0, %1 br i1 %cmp4, label %return, label %if.end6 if.end6: ; preds = %if.end %y = getelementptr inbounds %struct.pair, ptr %a, i64 0, i32 1 %2 = load i32, ptr %y, align 4, !tbaa !10 %y7 = getelementptr inbounds %struct.pair, ptr %b, i64 0, i32 1 %3 = load i32, ptr %y7, align 4, !tbaa !10 %cmp8 = icmp sgt i32 %2, %3 br i1 %cmp8, label %return, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp slt i32 %2, %3 %. = sext i1 %cmp13 to i32 br label %return return: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ 1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: 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) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca %struct.pair, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !11 %mul = mul nsw i32 %3, %3 %4 = zext i32 %mul to i64 %vla1 = alloca %struct.pair, i64 %4, align 16 %cmp96 = icmp sgt i32 %3, 0 br i1 %cmp96, label %for.body, label %for.end41.thread for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv %y = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %.pr = load i32, ptr %n, align 4, !tbaa !11 %5 = sext i32 %.pr to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp5 = icmp eq i32 %.pr, 1 br i1 %cmp5, label %if.then, label %for.cond7.preheader for.cond7.preheader: ; preds = %for.end %cmp8102 = icmp sgt i32 %.pr, 0 br i1 %cmp8102, label %for.cond10.preheader.us.preheader, label %for.end41.thread for.cond10.preheader.us.preheader: ; preds = %for.cond7.preheader %wide.trip.count118 = zext i32 %.pr to i64 %xtraiter = and i64 %wide.trip.count118, 1 %6 = icmp eq i32 %.pr, 1 %unroll_iter = and i64 %wide.trip.count118, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond10.preheader.us for.cond10.preheader.us: ; preds = %for.cond10.preheader.us.preheader, %for.cond10.for.inc39_crit_edge.us %indvars.iv115 = phi i64 [ 0, %for.cond10.preheader.us.preheader ], [ %indvars.iv.next116, %for.cond10.for.inc39_crit_edge.us ] %k.0104.us = phi i32 [ 0, %for.cond10.preheader.us.preheader ], [ %k.2.us.lcssa, %for.cond10.for.inc39_crit_edge.us ] %arrayidx17.us = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv115 br i1 %6, label %for.cond10.for.inc39_crit_edge.us.unr-lcssa, label %for.body12.us for.body12.us: ; preds = %for.cond10.preheader.us, %for.inc36.us.1 %indvars.iv112 = phi i64 [ %indvars.iv.next113.1, %for.inc36.us.1 ], [ 0, %for.cond10.preheader.us ] %k.1100.us = phi i32 [ %k.2.us.1, %for.inc36.us.1 ], [ %k.0104.us, %for.cond10.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc36.us.1 ], [ 0, %for.cond10.preheader.us ] %cmp13.us = icmp eq i64 %indvars.iv115, %indvars.iv112 br i1 %cmp13.us, label %for.inc36.us, label %if.end15.us if.end15.us: ; preds = %for.body12.us %arrayidx20.us = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv112 %idxprom22.us = sext i32 %k.1100.us to i64 %arrayidx23.us = getelementptr inbounds %struct.pair, ptr %vla1, i64 %idxprom22.us %7 = load <2 x i32>, ptr %arrayidx17.us, align 8, !tbaa !11 %8 = load <2 x i32>, ptr %arrayidx20.us, align 16, !tbaa !11 %9 = sub nsw <2 x i32> %7, %8 store <2 x i32> %9, ptr %arrayidx23.us, align 8, !tbaa !11 %inc35.us = add nsw i32 %k.1100.us, 1 br label %for.inc36.us for.inc36.us: ; preds = %if.end15.us, %for.body12.us %k.2.us = phi i32 [ %k.1100.us, %for.body12.us ], [ %inc35.us, %if.end15.us ] %indvars.iv.next113 = or i64 %indvars.iv112, 1 %cmp13.us.1 = icmp eq i64 %indvars.iv115, %indvars.iv.next113 br i1 %cmp13.us.1, label %for.inc36.us.1, label %if.end15.us.1 if.end15.us.1: ; preds = %for.inc36.us %arrayidx20.us.1 = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv.next113 %idxprom22.us.1 = sext i32 %k.2.us to i64 %arrayidx23.us.1 = getelementptr inbounds %struct.pair, ptr %vla1, i64 %idxprom22.us.1 %10 = load <2 x i32>, ptr %arrayidx17.us, align 8, !tbaa !11 %11 = load <2 x i32>, ptr %arrayidx20.us.1, align 8, !tbaa !11 %12 = sub nsw <2 x i32> %10, %11 store <2 x i32> %12, ptr %arrayidx23.us.1, align 8, !tbaa !11 %inc35.us.1 = add nsw i32 %k.2.us, 1 br label %for.inc36.us.1 for.inc36.us.1: ; preds = %if.end15.us.1, %for.inc36.us %k.2.us.1 = phi i32 [ %k.2.us, %for.inc36.us ], [ %inc35.us.1, %if.end15.us.1 ] %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 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.cond10.for.inc39_crit_edge.us.unr-lcssa, label %for.body12.us, !llvm.loop !14 for.cond10.for.inc39_crit_edge.us.unr-lcssa: ; preds = %for.inc36.us.1, %for.cond10.preheader.us %k.2.us.lcssa.ph = phi i32 [ undef, %for.cond10.preheader.us ], [ %k.2.us.1, %for.inc36.us.1 ] %indvars.iv112.unr = phi i64 [ 0, %for.cond10.preheader.us ], [ %indvars.iv.next113.1, %for.inc36.us.1 ] %k.1100.us.unr = phi i32 [ %k.0104.us, %for.cond10.preheader.us ], [ %k.2.us.1, %for.inc36.us.1 ] br i1 %lcmp.mod.not, label %for.cond10.for.inc39_crit_edge.us, label %for.body12.us.epil for.body12.us.epil: ; preds = %for.cond10.for.inc39_crit_edge.us.unr-lcssa %cmp13.us.epil = icmp eq i64 %indvars.iv115, %indvars.iv112.unr br i1 %cmp13.us.epil, label %for.cond10.for.inc39_crit_edge.us, label %if.end15.us.epil if.end15.us.epil: ; preds = %for.body12.us.epil %arrayidx20.us.epil = getelementptr inbounds %struct.pair, ptr %vla, i64 %indvars.iv112.unr %idxprom22.us.epil = sext i32 %k.1100.us.unr to i64 %arrayidx23.us.epil = getelementptr inbounds %struct.pair, ptr %vla1, i64 %idxprom22.us.epil %13 = load <2 x i32>, ptr %arrayidx17.us, align 8, !tbaa !11 %14 = load <2 x i32>, ptr %arrayidx20.us.epil, align 8, !tbaa !11 %15 = sub nsw <2 x i32> %13, %14 store <2 x i32> %15, ptr %arrayidx23.us.epil, align 8, !tbaa !11 %inc35.us.epil = add nsw i32 %k.1100.us.unr, 1 br label %for.cond10.for.inc39_crit_edge.us for.cond10.for.inc39_crit_edge.us: ; preds = %for.body12.us.epil, %if.end15.us.epil, %for.cond10.for.inc39_crit_edge.us.unr-lcssa %k.2.us.lcssa = phi i32 [ %k.2.us.lcssa.ph, %for.cond10.for.inc39_crit_edge.us.unr-lcssa ], [ %k.1100.us.unr, %for.body12.us.epil ], [ %inc35.us.epil, %if.end15.us.epil ] %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1 %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118 br i1 %exitcond119.not, label %for.end41, label %for.cond10.preheader.us, !llvm.loop !15 if.then: ; preds = %for.end %putchar = call i32 @putchar(i32 49) br label %cleanup for.end41.thread: ; preds = %for.cond7.preheader, %entry call void @qsort(ptr noundef nonnull %vla1, i64 noundef 0, i64 noundef 8, ptr noundef nonnull @c) #8 br label %for.end63 for.end41: ; preds = %for.cond10.for.inc39_crit_edge.us %conv = sext i32 %k.2.us.lcssa to i64 call void @qsort(ptr noundef nonnull %vla1, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @c) #8 %cmp43106 = icmp sgt i32 %k.2.us.lcssa, 1 br i1 %cmp43106, label %for.body45.preheader, label %for.end63 for.body45.preheader: ; preds = %for.end41 %wide.trip.count124 = zext i32 %k.2.us.lcssa to i64 %.pre = load i32, ptr %vla1, align 16, !tbaa !5 br label %for.body45 for.body45: ; preds = %for.body45.preheader, %c.exit.thread %16 = phi i32 [ %.pre, %for.body45.preheader ], [ %17, %c.exit.thread ] %indvars.iv120 = phi i64 [ 1, %for.body45.preheader ], [ %indvars.iv.next121, %c.exit.thread ] %temp.0109 = phi i32 [ 1, %for.body45.preheader ], [ %21, %c.exit.thread ] %max.0108 = phi i32 [ 1, %for.body45.preheader ], [ %max.1, %c.exit.thread ] %arrayidx47 = getelementptr inbounds %struct.pair, ptr %vla1, i64 %indvars.iv120 %17 = load i32, ptr %arrayidx47, align 8, !tbaa !5 %or.cond.not = icmp eq i32 %17, %16 br i1 %or.cond.not, label %if.end6.i, label %c.exit.thread if.end6.i: ; preds = %for.body45 %18 = add nsw i64 %indvars.iv120, -1 %y.i = getelementptr inbounds %struct.pair, ptr %vla1, i64 %indvars.iv120, i32 1 %19 = load i32, ptr %y.i, align 4, !tbaa !10 %y7.i = getelementptr inbounds %struct.pair, ptr %vla1, i64 %18, i32 1 %20 = load i32, ptr %y7.i, align 4, !tbaa !10 %cmp8.i = icmp sgt i32 %19, %20 br i1 %cmp8.i, label %c.exit.thread, label %c.exit c.exit: ; preds = %if.end6.i %cmp13.i = icmp sge i32 %19, %20 %inc55 = add nsw i32 %temp.0109, 1 %cond.fr = freeze i1 %cmp13.i %spec.select = select i1 %cond.fr, i32 %inc55, i32 1 br label %c.exit.thread c.exit.thread: ; preds = %c.exit, %if.end6.i, %for.body45 %21 = phi i32 [ 1, %for.body45 ], [ 1, %if.end6.i ], [ %spec.select, %c.exit ] %max.1 = call i32 @llvm.smax.i32(i32 %max.0108, i32 %21) %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %exitcond125.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count124 br i1 %exitcond125.not, label %for.end63, label %for.body45, !llvm.loop !16 for.end63: ; preds = %c.exit.thread, %for.end41.thread, %for.end41 %max.0.lcssa = phi i32 [ 1, %for.end41 ], [ 1, %for.end41.thread ], [ %max.1, %c.exit.thread ] %22 = load i32, ptr %n, align 4, !tbaa !11 %sub64 = sub nsw i32 %22, %max.0.lcssa %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub64) br label %cleanup cleanup: ; preds = %for.end63, %if.then call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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 #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: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"", !7, i64 0, !7, i64 4} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 4} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = distinct !{!15, !13} !16 = distinct !{!16, !13}
#include<stdio.h> #include<string.h> int main(void){ int i; int a=-1, b=-1; int len; char str[100000]; scanf("%s", str); len = strlen(str); for(i = 0; i + 1 < len; i++){ if(str[i] == str[i+1]){ a = i+1; b = i+2; break; } else if(i+2!=len && str[i]==str[i+2]){ a = i+1; b = i+3; break; } } printf("%d %d\n", a, b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177008/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177008/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5 %conv = trunc i64 %call2 to i32 %cmp45 = icmp sgt i32 %conv, 1 br i1 %cmp45, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = and i64 %call2, 4294967295 %1 = add i64 %call2, 4294967295 %wide.trip.count = and i64 %1, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv52 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next53, %for.inc ] %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %arrayidx = getelementptr inbounds [100000 x i8], ptr %str, i64 0, i64 %indvars.iv52 %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx7 = getelementptr inbounds [100000 x i8], ptr %str, i64 0, i64 %indvars.iv %3 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %cmp9 = icmp eq i8 %2, %3 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %for.body %4 = trunc i64 %indvars.iv52 to i32 %5 = trunc i64 %indvars.iv to i32 %add12 = add nuw nsw i32 %4, 2 br label %for.end if.else: ; preds = %for.body %6 = add nuw nsw i64 %indvars.iv52, 2 %cmp14.not = icmp eq i64 %6, %0 br i1 %cmp14.not, label %for.inc, label %land.lhs.true land.lhs.true: ; preds = %if.else %arrayidx21 = getelementptr inbounds [100000 x i8], ptr %str, i64 0, i64 %6 %7 = load i8, ptr %arrayidx21, align 1, !tbaa !5 %cmp23 = icmp eq i8 %2, %7 br i1 %cmp23, label %if.then25, label %for.inc if.then25: ; preds = %land.lhs.true %8 = trunc i64 %indvars.iv52 to i32 %9 = trunc i64 %indvars.iv to i32 %add27 = add nuw nsw i32 %8, 3 br label %for.end for.inc: ; preds = %land.lhs.true, %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.inc, %entry, %if.then25, %if.then %a.0 = phi i32 [ %5, %if.then ], [ %9, %if.then25 ], [ -1, %entry ], [ -1, %for.inc ] %b.0 = phi i32 [ %add12, %if.then ], [ %add27, %if.then25 ], [ -1, %entry ], [ -1, %for.inc ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0, i32 noundef %b.0) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %str) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define N 10000000 int main(void) { int i, n, s, t, ans; static int check[N] = {0}; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s); check[s] = 1; } scanf("%d", &n); ans = 0; for (i = 0; i < n; i++) { scanf("%d", &t); if (check[t] == 1) { ans++; } } printf("%d\n", ans); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177051/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177051/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.check = internal unnamed_addr global [10000000 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca i32, align 4 %t = 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 %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.020 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %1 = load i32, ptr %s, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [10000000 x i32], ptr @main.check, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.020, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp421 = icmp sgt i32 %3, 0 br i1 %cmp421, label %for.body5, label %for.end13 for.body5: ; preds = %for.end, %for.body5 %ans.023 = phi i32 [ %spec.select, %for.body5 ], [ 0, %for.end ] %i.122 = phi i32 [ %inc12, %for.body5 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %4 = load i32, ptr %t, align 4, !tbaa !5 %idxprom7 = sext i32 %4 to i64 %arrayidx8 = getelementptr inbounds [10000000 x i32], ptr @main.check, i64 0, i64 %idxprom7 %5 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp eq i32 %5, 1 %inc10 = zext i1 %cmp9 to i32 %spec.select = add nuw nsw i32 %ans.023, %inc10 %inc12 = add nuw nsw i32 %i.122, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc12, %6 br i1 %cmp4, label %for.body5, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.body5, %for.end %ans.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %for.body5 ] %call14 = 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 %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int hairetu[10000001]={}; int main(void){ int cnt=0,i,n,q,s,t; scanf("%d",&n); for(i = 0;i < n;i++){ scanf("%d",&s); if(hairetu[s]==0){ hairetu[s]+=1; } } scanf("%d",&q); for(i = 0;i < q;i++){ scanf("%d",&t); if(hairetu[t]==1){ hairetu[t]+=1; } } for(i = 0;i < 10000001;i++){ if(hairetu[i]>=2) cnt++; } printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177101/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177101/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @hairetu = dso_local local_unnamed_addr global [10000001 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp42 = icmp sgt i32 %0, 0 br i1 %cmp42, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.043 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %1 = load i32, ptr %s, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [10000001 x i32], ptr @hairetu, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp2 = icmp eq i32 %2, 0 br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body store i32 1, ptr %arrayidx, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %inc = add nuw nsw i32 %i.043, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %4 = load i32, ptr %q, align 4, !tbaa !5 %cmp744 = icmp sgt i32 %4, 0 br i1 %cmp744, label %for.body8, label %vector.body.preheader vector.body.preheader: ; preds = %for.inc18, %for.end br label %vector.body vector.body: ; preds = %vector.body, %vector.body.preheader %index = phi i64 [ 0, %vector.body.preheader ], [ %index.next.1, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %19, %vector.body ] %vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %20, %vector.body ] %5 = getelementptr inbounds [10000001 x i32], ptr @hairetu, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load50 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = icmp sgt <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %8 = icmp sgt <4 x i32> %wide.load50, <i32 1, i32 1, i32 1, i32 1> %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi49, %10 %index.next = or i64 %index, 8 %13 = getelementptr inbounds [10000001 x i32], ptr @hairetu, i64 0, i64 %index.next %wide.load.1 = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load50.1 = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = icmp sgt <4 x i32> %wide.load.1, <i32 1, i32 1, i32 1, i32 1> %16 = icmp sgt <4 x i32> %wide.load50.1, <i32 1, i32 1, i32 1, i32 1> %17 = zext <4 x i1> %15 to <4 x i32> %18 = zext <4 x i1> %16 to <4 x i32> %19 = add <4 x i32> %11, %17 %20 = add <4 x i32> %12, %18 %index.next.1 = add nuw nsw i64 %index, 16 %21 = icmp eq i64 %index.next.1, 10000000 br i1 %21, label %for.body23, label %vector.body, !llvm.loop !11 for.body8: ; preds = %for.end, %for.inc18 %i.145 = phi i32 [ %inc19, %for.inc18 ], [ 0, %for.end ] %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %22 = load i32, ptr %t, align 4, !tbaa !5 %idxprom10 = sext i32 %22 to i64 %arrayidx11 = getelementptr inbounds [10000001 x i32], ptr @hairetu, i64 0, i64 %idxprom10 %23 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp eq i32 %23, 1 br i1 %cmp12, label %if.then13, label %for.inc18 if.then13: ; preds = %for.body8 store i32 2, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc18 for.inc18: ; preds = %for.body8, %if.then13 %inc19 = add nuw nsw i32 %i.145, 1 %24 = load i32, ptr %q, align 4, !tbaa !5 %cmp7 = icmp slt i32 %inc19, %24 br i1 %cmp7, label %for.body8, label %vector.body.preheader, !llvm.loop !14 for.body23: ; preds = %vector.body %bin.rdx = add <4 x i32> %20, %19 %25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %26 = load i32, ptr getelementptr inbounds ([10000001 x i32], ptr @hairetu, i64 0, i64 10000000), align 16, !tbaa !5 %cmp26 = icmp sgt i32 %26, 1 %inc28 = zext i1 %cmp26 to i32 %spec.select = add nuw nsw i32 %25, %inc28 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10}
#include <stdio.h> #include <stdlib.h> int binarySearch( int ); // 見つかったら1、見つからなかったら0を返す int compare( const void *, const void * ); int n, S[ 100000 ]; int main( void ) { int i, q, tmp, C = 0; scanf( "%d", &n ); for ( i = 0; i < n; i++ ) scanf( "%d", &S[ i ] ); qsort( S, n, sizeof(int), &compare ); scanf( "%d", &q ); for ( i = 0; i < q; i++ ) { scanf( "%d", &tmp ); C += binarySearch( tmp ); } printf( "%d\n", C ); return 0; } int compare( const void *a, const void *b ) { return *(int *)a - *(int *)b; } int binarySearch( int key ) { int l, r, m; l = 0; r = n - 1; while ( l <= r ) { m = ( l + r ) / 2; if ( key == S[ m ] ) return 1; else if ( key < S[ m ] ) r = m - 1; else l = m + 1; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177145/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177145/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @S = dso_local global [100000 x i32] zeroinitializer, align 16 @.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: %q = alloca i32, align 4 %tmp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, 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 i32], ptr @S, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.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 ] tail call void @qsort(ptr noundef nonnull @S, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %3 = load i32, ptr %q, align 4, !tbaa !5 %cmp420 = icmp sgt i32 %3, 0 br i1 %cmp420, label %for.body6, label %for.end11 for.body6: ; preds = %for.end, %binarySearch.exit %C.022 = phi i32 [ %add, %binarySearch.exit ], [ 0, %for.end ] %i.121 = phi i32 [ %inc10, %binarySearch.exit ], [ 0, %for.end ] %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp) %4 = load i32, ptr %tmp, align 4, !tbaa !5 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not18.i = icmp slt i32 %5, 1 br i1 %cmp.not18.i, label %binarySearch.exit, label %while.body.preheader.i while.body.preheader.i: ; preds = %for.body6 %sub.i = add nsw i32 %5, -1 br label %while.body.i while.body.i: ; preds = %if.else.i, %while.body.preheader.i %r.020.i = phi i32 [ %r.1.i, %if.else.i ], [ %sub.i, %while.body.preheader.i ] %l.019.i = phi i32 [ %l.1.i, %if.else.i ], [ 0, %while.body.preheader.i ] %add.i = add nsw i32 %l.019.i, %r.020.i %div.i = sdiv i32 %add.i, 2 %idxprom.i = sext i32 %div.i to i64 %arrayidx.i = getelementptr inbounds [100000 x i32], ptr @S, i64 0, i64 %idxprom.i %6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.i = icmp eq i32 %6, %4 br i1 %cmp1.i, label %binarySearch.exit, label %if.else.i if.else.i: ; preds = %while.body.i %cmp4.i = icmp sgt i32 %6, %4 %sub6.i = add nsw i32 %div.i, -1 %add8.i = add nsw i32 %div.i, 1 %l.1.i = select i1 %cmp4.i, i32 %l.019.i, i32 %add8.i %r.1.i = select i1 %cmp4.i, i32 %sub6.i, i32 %r.020.i %cmp.not.i = icmp sgt i32 %l.1.i, %r.1.i br i1 %cmp.not.i, label %binarySearch.exit, label %while.body.i, !llvm.loop !11 binarySearch.exit: ; preds = %while.body.i, %if.else.i, %for.body6 %retval.0.i = phi i32 [ 0, %for.body6 ], [ 1, %while.body.i ], [ 0, %if.else.i ] %add = add nuw nsw i32 %retval.0.i, %C.022 %inc10 = add nuw nsw i32 %i.121, 1 %7 = load i32, ptr %q, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc10, %7 br i1 %cmp4, label %for.body6, label %for.end11, !llvm.loop !12 for.end11: ; preds = %binarySearch.exit, %for.end %C.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %binarySearch.exit ] %call12 = 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 %tmp) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 { 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 norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @binarySearch(i32 noundef %key) local_unnamed_addr #5 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not18 = icmp slt i32 %0, 1 br i1 %cmp.not18, label %cleanup, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %0, -1 br label %while.body while.body: ; preds = %while.body.preheader, %if.else %r.020 = phi i32 [ %r.1, %if.else ], [ %sub, %while.body.preheader ] %l.019 = phi i32 [ %l.1, %if.else ], [ 0, %while.body.preheader ] %add = add nsw i32 %r.020, %l.019 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @S, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %1, %key br i1 %cmp1, label %cleanup, label %if.else if.else: ; preds = %while.body %cmp4 = icmp sgt i32 %1, %key %sub6 = add nsw i32 %div, -1 %add8 = add nsw i32 %div, 1 %l.1 = select i1 %cmp4, i32 %l.019, i32 %add8 %r.1 = select i1 %cmp4, i32 %sub6, i32 %r.020 %cmp.not = icmp sgt i32 %l.1, %r.1 br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !11 cleanup: ; preds = %while.body, %if.else, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %if.else ], [ 1, %while.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <stdbool.h> typedef long long LL; typedef long double Lf; #define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++) #define rep(i,n)Rep(i,0,n) #define Ma(x,y) ((x)>(y)?(x):(y)) #define mi(x,y) ((x)<(y)?(x):(y)) #define MOD 1000000007 int acs(const void* a, const void* b) { return *(int*)a - *(int*)b; } // 1,2,3,4 int des(const void* a, const void* b) { return *(int*)b - *(int*)a; } // 8,7,6,5 int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab //temmie_のsnippet #define N 100009 int main(){ int n,k,r,s,p,i; int cr=0,cs=0,cp=0; char t[N]; scanf("%d%d%d%d%d%s",&n,&k,&r,&s,&p,t); Rep(i,k,n)if(t[i]==t[i-k])t[i]='a'; i=0; while(t[i]){ if(t[i]=='r')cp++; else if(t[i]=='s')cr++; else if(t[i]=='p')cs++; i++; } printf("%d",r*cr+s*cs+p*cp); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177217/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177217/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%s\00", align 1 @.str.1 = 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 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !9 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !10 %1 = load ptr, ptr %b, align 8, !tbaa !10 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #6 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %r = alloca i32, align 4 %s = alloca i32, align 4 %p = alloca i32, align 4 %t = alloca [100009 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #7 call void @llvm.lifetime.start.p0(i64 100009, ptr nonnull %t) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %r, ptr noundef nonnull %s, ptr noundef nonnull %p, ptr noundef nonnull %t) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp52 = icmp slt i32 %0, %1 br i1 %cmp52, label %iter.check, label %while.cond.preheader iter.check: ; preds = %entry %2 = sext i32 %0 to i64 %wide.trip.count = sext i32 %1 to i64 %3 = sub nsw i64 %wide.trip.count, %2 %min.iters.check = icmp ult i64 %3, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %scevgep = getelementptr i8, ptr %t, i64 %2 %scevgep59 = getelementptr i8, ptr %t, i64 %wide.trip.count %4 = sub nsw i64 %wide.trip.count, %2 %scevgep60 = getelementptr i8, ptr %t, i64 %4 %bound0 = icmp ult ptr %scevgep, %scevgep60 %bound1 = icmp ult ptr %t, %scevgep59 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check61 = icmp ult i64 %3, 32 br i1 %min.iters.check61, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %3, -32 br label %vector.body vector.body: ; preds = %pred.store.continue126, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue126 ] %offset.idx = add i64 %index, %2 %5 = add i64 %offset.idx, 16 %6 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %offset.idx %wide.load = load <16 x i8>, ptr %6, align 1, !tbaa !9, !alias.scope !12, !noalias !15 %7 = getelementptr inbounds i8, ptr %6, i64 16 %wide.load62 = load <16 x i8>, ptr %7, align 1, !tbaa !9, !alias.scope !12, !noalias !15 %8 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %index %wide.load63 = load <16 x i8>, ptr %8, align 16, !tbaa !9, !alias.scope !15 %9 = getelementptr inbounds i8, ptr %8, i64 16 %wide.load64 = load <16 x i8>, ptr %9, align 16, !tbaa !9, !alias.scope !15 %10 = icmp eq <16 x i8> %wide.load, %wide.load63 %11 = icmp eq <16 x i8> %wide.load62, %wide.load64 %12 = extractelement <16 x i1> %10, i64 0 br i1 %12, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %13 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %offset.idx store i8 97, ptr %13, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %14 = extractelement <16 x i1> %10, i64 1 br i1 %14, label %pred.store.if65, label %pred.store.continue66 pred.store.if65: ; preds = %pred.store.continue %15 = add i64 %offset.idx, 1 %16 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %15 store i8 97, ptr %16, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue66 pred.store.continue66: ; preds = %pred.store.if65, %pred.store.continue %17 = extractelement <16 x i1> %10, i64 2 br i1 %17, label %pred.store.if67, label %pred.store.continue68 pred.store.if67: ; preds = %pred.store.continue66 %18 = add i64 %offset.idx, 2 %19 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %18 store i8 97, ptr %19, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue68 pred.store.continue68: ; preds = %pred.store.if67, %pred.store.continue66 %20 = extractelement <16 x i1> %10, i64 3 br i1 %20, label %pred.store.if69, label %pred.store.continue70 pred.store.if69: ; preds = %pred.store.continue68 %21 = add i64 %offset.idx, 3 %22 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %21 store i8 97, ptr %22, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue70 pred.store.continue70: ; preds = %pred.store.if69, %pred.store.continue68 %23 = extractelement <16 x i1> %10, i64 4 br i1 %23, label %pred.store.if71, label %pred.store.continue72 pred.store.if71: ; preds = %pred.store.continue70 %24 = add i64 %offset.idx, 4 %25 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %24 store i8 97, ptr %25, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue72 pred.store.continue72: ; preds = %pred.store.if71, %pred.store.continue70 %26 = extractelement <16 x i1> %10, i64 5 br i1 %26, label %pred.store.if73, label %pred.store.continue74 pred.store.if73: ; preds = %pred.store.continue72 %27 = add i64 %offset.idx, 5 %28 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %27 store i8 97, ptr %28, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue74 pred.store.continue74: ; preds = %pred.store.if73, %pred.store.continue72 %29 = extractelement <16 x i1> %10, i64 6 br i1 %29, label %pred.store.if75, label %pred.store.continue76 pred.store.if75: ; preds = %pred.store.continue74 %30 = add i64 %offset.idx, 6 %31 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %30 store i8 97, ptr %31, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue76 pred.store.continue76: ; preds = %pred.store.if75, %pred.store.continue74 %32 = extractelement <16 x i1> %10, i64 7 br i1 %32, label %pred.store.if77, label %pred.store.continue78 pred.store.if77: ; preds = %pred.store.continue76 %33 = add i64 %offset.idx, 7 %34 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %33 store i8 97, ptr %34, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue78 pred.store.continue78: ; preds = %pred.store.if77, %pred.store.continue76 %35 = extractelement <16 x i1> %10, i64 8 br i1 %35, label %pred.store.if79, label %pred.store.continue80 pred.store.if79: ; preds = %pred.store.continue78 %36 = add i64 %offset.idx, 8 %37 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %36 store i8 97, ptr %37, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue80 pred.store.continue80: ; preds = %pred.store.if79, %pred.store.continue78 %38 = extractelement <16 x i1> %10, i64 9 br i1 %38, label %pred.store.if81, label %pred.store.continue82 pred.store.if81: ; preds = %pred.store.continue80 %39 = add i64 %offset.idx, 9 %40 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %39 store i8 97, ptr %40, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue82 pred.store.continue82: ; preds = %pred.store.if81, %pred.store.continue80 %41 = extractelement <16 x i1> %10, i64 10 br i1 %41, label %pred.store.if83, label %pred.store.continue84 pred.store.if83: ; preds = %pred.store.continue82 %42 = add i64 %offset.idx, 10 %43 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %42 store i8 97, ptr %43, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue84 pred.store.continue84: ; preds = %pred.store.if83, %pred.store.continue82 %44 = extractelement <16 x i1> %10, i64 11 br i1 %44, label %pred.store.if85, label %pred.store.continue86 pred.store.if85: ; preds = %pred.store.continue84 %45 = add i64 %offset.idx, 11 %46 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %45 store i8 97, ptr %46, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue86 pred.store.continue86: ; preds = %pred.store.if85, %pred.store.continue84 %47 = extractelement <16 x i1> %10, i64 12 br i1 %47, label %pred.store.if87, label %pred.store.continue88 pred.store.if87: ; preds = %pred.store.continue86 %48 = add i64 %offset.idx, 12 %49 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %48 store i8 97, ptr %49, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue88 pred.store.continue88: ; preds = %pred.store.if87, %pred.store.continue86 %50 = extractelement <16 x i1> %10, i64 13 br i1 %50, label %pred.store.if89, label %pred.store.continue90 pred.store.if89: ; preds = %pred.store.continue88 %51 = add i64 %offset.idx, 13 %52 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %51 store i8 97, ptr %52, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue90 pred.store.continue90: ; preds = %pred.store.if89, %pred.store.continue88 %53 = extractelement <16 x i1> %10, i64 14 br i1 %53, label %pred.store.if91, label %pred.store.continue92 pred.store.if91: ; preds = %pred.store.continue90 %54 = add i64 %offset.idx, 14 %55 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %54 store i8 97, ptr %55, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue92 pred.store.continue92: ; preds = %pred.store.if91, %pred.store.continue90 %56 = extractelement <16 x i1> %10, i64 15 br i1 %56, label %pred.store.if93, label %pred.store.continue94 pred.store.if93: ; preds = %pred.store.continue92 %57 = add i64 %offset.idx, 15 %58 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %57 store i8 97, ptr %58, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue94 pred.store.continue94: ; preds = %pred.store.if93, %pred.store.continue92 %59 = extractelement <16 x i1> %11, i64 0 br i1 %59, label %pred.store.if95, label %pred.store.continue96 pred.store.if95: ; preds = %pred.store.continue94 %60 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %5 store i8 97, ptr %60, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue96 pred.store.continue96: ; preds = %pred.store.if95, %pred.store.continue94 %61 = extractelement <16 x i1> %11, i64 1 br i1 %61, label %pred.store.if97, label %pred.store.continue98 pred.store.if97: ; preds = %pred.store.continue96 %62 = add i64 %offset.idx, 17 %63 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %62 store i8 97, ptr %63, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue98 pred.store.continue98: ; preds = %pred.store.if97, %pred.store.continue96 %64 = extractelement <16 x i1> %11, i64 2 br i1 %64, label %pred.store.if99, label %pred.store.continue100 pred.store.if99: ; preds = %pred.store.continue98 %65 = add i64 %offset.idx, 18 %66 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %65 store i8 97, ptr %66, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue100 pred.store.continue100: ; preds = %pred.store.if99, %pred.store.continue98 %67 = extractelement <16 x i1> %11, i64 3 br i1 %67, label %pred.store.if101, label %pred.store.continue102 pred.store.if101: ; preds = %pred.store.continue100 %68 = add i64 %offset.idx, 19 %69 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %68 store i8 97, ptr %69, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue102 pred.store.continue102: ; preds = %pred.store.if101, %pred.store.continue100 %70 = extractelement <16 x i1> %11, i64 4 br i1 %70, label %pred.store.if103, label %pred.store.continue104 pred.store.if103: ; preds = %pred.store.continue102 %71 = add i64 %offset.idx, 20 %72 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %71 store i8 97, ptr %72, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue104 pred.store.continue104: ; preds = %pred.store.if103, %pred.store.continue102 %73 = extractelement <16 x i1> %11, i64 5 br i1 %73, label %pred.store.if105, label %pred.store.continue106 pred.store.if105: ; preds = %pred.store.continue104 %74 = add i64 %offset.idx, 21 %75 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %74 store i8 97, ptr %75, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue106 pred.store.continue106: ; preds = %pred.store.if105, %pred.store.continue104 %76 = extractelement <16 x i1> %11, i64 6 br i1 %76, label %pred.store.if107, label %pred.store.continue108 pred.store.if107: ; preds = %pred.store.continue106 %77 = add i64 %offset.idx, 22 %78 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %77 store i8 97, ptr %78, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue108 pred.store.continue108: ; preds = %pred.store.if107, %pred.store.continue106 %79 = extractelement <16 x i1> %11, i64 7 br i1 %79, label %pred.store.if109, label %pred.store.continue110 pred.store.if109: ; preds = %pred.store.continue108 %80 = add i64 %offset.idx, 23 %81 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %80 store i8 97, ptr %81, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue110 pred.store.continue110: ; preds = %pred.store.if109, %pred.store.continue108 %82 = extractelement <16 x i1> %11, i64 8 br i1 %82, label %pred.store.if111, label %pred.store.continue112 pred.store.if111: ; preds = %pred.store.continue110 %83 = add i64 %offset.idx, 24 %84 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %83 store i8 97, ptr %84, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue112 pred.store.continue112: ; preds = %pred.store.if111, %pred.store.continue110 %85 = extractelement <16 x i1> %11, i64 9 br i1 %85, label %pred.store.if113, label %pred.store.continue114 pred.store.if113: ; preds = %pred.store.continue112 %86 = add i64 %offset.idx, 25 %87 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %86 store i8 97, ptr %87, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue114 pred.store.continue114: ; preds = %pred.store.if113, %pred.store.continue112 %88 = extractelement <16 x i1> %11, i64 10 br i1 %88, label %pred.store.if115, label %pred.store.continue116 pred.store.if115: ; preds = %pred.store.continue114 %89 = add i64 %offset.idx, 26 %90 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %89 store i8 97, ptr %90, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue116 pred.store.continue116: ; preds = %pred.store.if115, %pred.store.continue114 %91 = extractelement <16 x i1> %11, i64 11 br i1 %91, label %pred.store.if117, label %pred.store.continue118 pred.store.if117: ; preds = %pred.store.continue116 %92 = add i64 %offset.idx, 27 %93 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %92 store i8 97, ptr %93, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue118 pred.store.continue118: ; preds = %pred.store.if117, %pred.store.continue116 %94 = extractelement <16 x i1> %11, i64 12 br i1 %94, label %pred.store.if119, label %pred.store.continue120 pred.store.if119: ; preds = %pred.store.continue118 %95 = add i64 %offset.idx, 28 %96 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %95 store i8 97, ptr %96, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue120 pred.store.continue120: ; preds = %pred.store.if119, %pred.store.continue118 %97 = extractelement <16 x i1> %11, i64 13 br i1 %97, label %pred.store.if121, label %pred.store.continue122 pred.store.if121: ; preds = %pred.store.continue120 %98 = add i64 %offset.idx, 29 %99 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %98 store i8 97, ptr %99, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue122 pred.store.continue122: ; preds = %pred.store.if121, %pred.store.continue120 %100 = extractelement <16 x i1> %11, i64 14 br i1 %100, label %pred.store.if123, label %pred.store.continue124 pred.store.if123: ; preds = %pred.store.continue122 %101 = add i64 %offset.idx, 30 %102 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %101 store i8 97, ptr %102, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue124 pred.store.continue124: ; preds = %pred.store.if123, %pred.store.continue122 %103 = extractelement <16 x i1> %11, i64 15 br i1 %103, label %pred.store.if125, label %pred.store.continue126 pred.store.if125: ; preds = %pred.store.continue124 %104 = add i64 %offset.idx, 31 %105 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %104 store i8 97, ptr %105, align 1, !tbaa !9, !alias.scope !12, !noalias !15 br label %pred.store.continue126 pred.store.continue126: ; preds = %pred.store.if125, %pred.store.continue124 %index.next = add nuw i64 %index, 32 %106 = icmp eq i64 %index.next, %n.vec br i1 %106, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %pred.store.continue126 %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %while.cond.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end129 = add nsw i64 %n.vec, %2 %n.vec.remaining = and i64 %3, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec128 = and i64 %3, -8 %ind.end = add nsw i64 %n.vec128, %2 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %pred.store.continue150, %vec.epilog.ph %index131 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next151, %pred.store.continue150 ] %offset.idx132 = add i64 %index131, %2 %107 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %offset.idx132 %wide.load133 = load <8 x i8>, ptr %107, align 1, !tbaa !9, !alias.scope !21, !noalias !24 %108 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %index131 %wide.load134 = load <8 x i8>, ptr %108, align 8, !tbaa !9, !alias.scope !24 %109 = icmp eq <8 x i8> %wide.load133, %wide.load134 %110 = extractelement <8 x i1> %109, i64 0 br i1 %110, label %pred.store.if135, label %pred.store.continue136 pred.store.if135: ; preds = %vec.epilog.vector.body %111 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %offset.idx132 store i8 97, ptr %111, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue136 pred.store.continue136: ; preds = %pred.store.if135, %vec.epilog.vector.body %112 = extractelement <8 x i1> %109, i64 1 br i1 %112, label %pred.store.if137, label %pred.store.continue138 pred.store.if137: ; preds = %pred.store.continue136 %113 = add i64 %offset.idx132, 1 %114 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %113 store i8 97, ptr %114, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue138 pred.store.continue138: ; preds = %pred.store.if137, %pred.store.continue136 %115 = extractelement <8 x i1> %109, i64 2 br i1 %115, label %pred.store.if139, label %pred.store.continue140 pred.store.if139: ; preds = %pred.store.continue138 %116 = add i64 %offset.idx132, 2 %117 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %116 store i8 97, ptr %117, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue140 pred.store.continue140: ; preds = %pred.store.if139, %pred.store.continue138 %118 = extractelement <8 x i1> %109, i64 3 br i1 %118, label %pred.store.if141, label %pred.store.continue142 pred.store.if141: ; preds = %pred.store.continue140 %119 = add i64 %offset.idx132, 3 %120 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %119 store i8 97, ptr %120, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue142 pred.store.continue142: ; preds = %pred.store.if141, %pred.store.continue140 %121 = extractelement <8 x i1> %109, i64 4 br i1 %121, label %pred.store.if143, label %pred.store.continue144 pred.store.if143: ; preds = %pred.store.continue142 %122 = add i64 %offset.idx132, 4 %123 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %122 store i8 97, ptr %123, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue144 pred.store.continue144: ; preds = %pred.store.if143, %pred.store.continue142 %124 = extractelement <8 x i1> %109, i64 5 br i1 %124, label %pred.store.if145, label %pred.store.continue146 pred.store.if145: ; preds = %pred.store.continue144 %125 = add i64 %offset.idx132, 5 %126 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %125 store i8 97, ptr %126, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue146 pred.store.continue146: ; preds = %pred.store.if145, %pred.store.continue144 %127 = extractelement <8 x i1> %109, i64 6 br i1 %127, label %pred.store.if147, label %pred.store.continue148 pred.store.if147: ; preds = %pred.store.continue146 %128 = add i64 %offset.idx132, 6 %129 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %128 store i8 97, ptr %129, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue148 pred.store.continue148: ; preds = %pred.store.if147, %pred.store.continue146 %130 = extractelement <8 x i1> %109, i64 7 br i1 %130, label %pred.store.if149, label %pred.store.continue150 pred.store.if149: ; preds = %pred.store.continue148 %131 = add i64 %offset.idx132, 7 %132 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %131 store i8 97, ptr %132, align 1, !tbaa !9, !alias.scope !21, !noalias !24 br label %pred.store.continue150 pred.store.continue150: ; preds = %pred.store.if149, %pred.store.continue148 %index.next151 = add nuw i64 %index131, 8 %133 = icmp eq i64 %index.next151, %n.vec128 br i1 %133, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !26 vec.epilog.middle.block: ; preds = %pred.store.continue150 %cmp.n130 = icmp eq i64 %3, %n.vec128 br i1 %cmp.n130, label %while.cond.preheader, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %2, %iter.check ], [ %2, %vector.memcheck ], [ %ind.end129, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %134 = sub nsw i64 %wide.trip.count, %indvars.iv.ph %xtraiter = and i64 %134, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %indvars.iv.ph %135 = load i8, ptr %arrayidx.prol, align 1, !tbaa !9 %136 = sub nsw i64 %indvars.iv.ph, %2 %arrayidx3.prol = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %136 %137 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !9 %cmp5.prol = icmp eq i8 %135, %137 br i1 %cmp5.prol, label %if.then.prol, label %for.inc.prol if.then.prol: ; preds = %for.body.prol store i8 97, ptr %arrayidx.prol, align 1, !tbaa !9 br label %for.inc.prol for.inc.prol: ; preds = %if.then.prol, %for.body.prol %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ] %138 = sub nsw i64 0, %wide.trip.count %139 = xor i64 %indvars.iv.ph, %138 %140 = icmp eq i64 %139, -1 br i1 %140, label %while.cond.preheader, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.inc.1 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %indvars.iv %141 = load i8, ptr %arrayidx, align 1, !tbaa !9 %142 = sub nsw i64 %indvars.iv, %2 %arrayidx3 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %142 %143 = load i8, ptr %arrayidx3, align 1, !tbaa !9 %cmp5 = icmp eq i8 %141, %143 br i1 %cmp5, label %if.then, label %for.inc if.then: ; preds = %for.body store i8 97, ptr %arrayidx, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %indvars.iv.next %144 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %145 = sub nsw i64 %indvars.iv.next, %2 %arrayidx3.1 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %145 %146 = load i8, ptr %arrayidx3.1, align 1, !tbaa !9 %cmp5.1 = icmp eq i8 %144, %146 br i1 %cmp5.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc store i8 97, ptr %arrayidx.1, align 1, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count br i1 %exitcond.not.1, label %while.cond.preheader, label %for.body, !llvm.loop !27 while.cond.preheader: ; preds = %for.body.prol.loopexit, %for.inc.1, %middle.block, %vec.epilog.middle.block, %entry br label %while.cond while.cond: ; preds = %while.cond.preheader, %if.end35 %indvars.iv56 = phi i64 [ %indvars.iv.next57, %if.end35 ], [ 0, %while.cond.preheader ] %cr.0 = phi i32 [ %cr.1, %if.end35 ], [ 0, %while.cond.preheader ] %cs.0 = phi i32 [ %cs.1, %if.end35 ], [ 0, %while.cond.preheader ] %cp.0 = phi i32 [ %cp.1, %if.end35 ], [ 0, %while.cond.preheader ] %arrayidx10 = getelementptr inbounds [100009 x i8], ptr %t, i64 0, i64 %indvars.iv56 %147 = load i8, ptr %arrayidx10, align 1, !tbaa !9 switch i8 %147, label %if.end35 [ i8 0, label %while.end i8 114, label %if.then16 i8 115, label %if.then23 i8 112, label %if.then31 ] if.then16: ; preds = %while.cond %inc17 = add nsw i32 %cp.0, 1 br label %if.end35 if.then23: ; preds = %while.cond %inc24 = add nsw i32 %cr.0, 1 br label %if.end35 if.then31: ; preds = %while.cond %inc32 = add nsw i32 %cs.0, 1 br label %if.end35 if.end35: ; preds = %while.cond, %if.then23, %if.then31, %if.then16 %cr.1 = phi i32 [ %cr.0, %if.then16 ], [ %inc24, %if.then23 ], [ %cr.0, %if.then31 ], [ %cr.0, %while.cond ] %cs.1 = phi i32 [ %cs.0, %if.then16 ], [ %cs.0, %if.then23 ], [ %inc32, %if.then31 ], [ %cs.0, %while.cond ] %cp.1 = phi i32 [ %inc17, %if.then16 ], [ %cp.0, %if.then23 ], [ %cp.0, %if.then31 ], [ %cp.0, %while.cond ] %indvars.iv.next57 = add nuw i64 %indvars.iv56, 1 br label %while.cond, !llvm.loop !28 while.end: ; preds = %while.cond %148 = load i32, ptr %r, align 4, !tbaa !5 %mul = mul nsw i32 %148, %cr.0 %149 = load i32, ptr %s, align 4, !tbaa !5 %mul37 = mul nsw i32 %149, %cs.0 %add = add nsw i32 %mul37, %mul %150 = load i32, ptr %p, align 4, !tbaa !5 %mul38 = mul nsw i32 %150, %cp.0 %add39 = add nsw i32 %add, %mul38 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add39) call void @llvm.lifetime.end.p0(i64 100009, ptr nonnull %t) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind willreturn memory(read) } 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 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !7, i64 0} !12 = !{!13} !13 = distinct !{!13, !14} !14 = distinct !{!14, !"LVerDomain"} !15 = !{!16} !16 = distinct !{!16, !14} !17 = distinct !{!17, !18, !19, !20} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = !{!22} !22 = distinct !{!22, !23} !23 = distinct !{!23, !"LVerDomain"} !24 = !{!25} !25 = distinct !{!25, !23} !26 = distinct !{!26, !18, !19, !20} !27 = distinct !{!27, !18, !19} !28 = distinct !{!28, !18}
#include<stdio.h> #define MOD 1000000009+7 int main(){ int N,i,j,ans=0,tmp; scanf("%d",&N); int a[N],b[N],c[N],d[N]; for(i=0;i<N;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<N;i++){ scanf("%d %d",&c[i],&d[i]); } for(i=0;i<N-1;i++){ for(j=0;j<N-i-1;j++){ if(a[j]>a[j+1]){ tmp=a[j]; a[j]=a[j+1]; a[j+1]=tmp; tmp=b[j]; b[j]=b[j+1]; b[j+1]=tmp; } if(c[j]>c[j+1]){ tmp=c[j]; c[j]=c[j+1]; c[j+1]=tmp; tmp=d[j]; d[j]=d[j+1]; d[j+1]=tmp; } } } for(i=0;i<N;i++){ tmp=-1; for(j=0;a[j]<c[i];j++){ if(b[j]<d[i] && b[j]>(tmp==-1 ? -1 : b[tmp])) tmp=j; } if(tmp>=0){ ans++; b[tmp]=200; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177318/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177318/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %vla2 = alloca i32, i64 %4, align 16 %vla3 = alloca i32, i64 %4, align 16 %cmp173 = icmp sgt i32 %3, 0 br i1 %cmp173, label %for.body, label %for.end119 for.cond7.preheader: ; preds = %for.body %cmp8175 = icmp sgt i32 %5, 0 br i1 %cmp8175, label %for.body9, label %for.end119 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 %arrayidx5 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.cond18.preheader: ; preds = %for.body9 %sub = add i32 %7, -1 %cmp19179 = icmp sgt i32 %7, 1 br i1 %cmp19179, label %for.cond21.preheader, label %for.cond85.preheader for.body9: ; preds = %for.cond7.preheader, %for.body9 %indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.body9 ], [ 0, %for.cond7.preheader ] %arrayidx11 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv192 %arrayidx13 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv192 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11, ptr noundef nonnull %arrayidx13) %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1 %7 = load i32, ptr %N, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp8 = icmp slt i64 %indvars.iv.next193, %8 br i1 %cmp8, label %for.body9, label %for.cond18.preheader, !llvm.loop !11 for.cond21.preheader: ; preds = %for.cond18.preheader, %for.inc82 %indvars.iv198 = phi i32 [ %indvars.iv.next199, %for.inc82 ], [ %sub, %for.cond18.preheader ] %i.2180 = phi i32 [ %inc83, %for.inc82 ], [ 0, %for.cond18.preheader ] %9 = xor i32 %i.2180, -1 %sub23 = add i32 %7, %9 %cmp24177 = icmp sgt i32 %sub23, 0 br i1 %cmp24177, label %for.body25.preheader, label %for.inc82 for.body25.preheader: ; preds = %for.cond21.preheader %wide.trip.count = zext i32 %indvars.iv198 to i64 %.pre = load i32, ptr %vla, align 16, !tbaa !5 br label %for.body25 for.cond85.preheader: ; preds = %for.inc82, %for.cond18.preheader %cmp86186 = icmp sgt i32 %7, 0 br i1 %cmp86186, label %for.cond88.preheader.lr.ph, label %for.end119 for.cond88.preheader.lr.ph: ; preds = %for.cond85.preheader %10 = load i32, ptr %vla, align 16, !tbaa !5 %wide.trip.count207 = zext i32 %7 to i64 br label %for.cond88.preheader for.body25: ; preds = %for.body25.preheader, %for.inc79 %11 = phi i32 [ %.pre, %for.body25.preheader ], [ %15, %for.inc79 ] %indvars.iv195 = phi i64 [ 0, %for.body25.preheader ], [ %indvars.iv.next196, %for.inc79 ] %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1 %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next196 %12 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %11, %12 br i1 %cmp30, label %if.then, label %if.end if.then: ; preds = %for.body25 %arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv195 store i32 %12, ptr %arrayidx27, align 4, !tbaa !5 store i32 %11, ptr %arrayidx29, align 4, !tbaa !5 %arrayidx42 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv195 %13 = load <2 x i32>, ptr %arrayidx42, align 4, !tbaa !5 %14 = shufflevector <2 x i32> %13, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %14, ptr %arrayidx42, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %for.body25 %15 = phi i32 [ %11, %if.then ], [ %12, %for.body25 ] %arrayidx52 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv195 %16 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %arrayidx55 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next196 %17 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %cmp56 = icmp sgt i32 %16, %17 br i1 %cmp56, label %if.then57, label %for.inc79 if.then57: ; preds = %if.end store i32 %17, ptr %arrayidx52, align 4, !tbaa !5 store i32 %16, ptr %arrayidx55, align 4, !tbaa !5 %arrayidx69 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv195 %18 = load <2 x i32>, ptr %arrayidx69, align 4, !tbaa !5 %19 = shufflevector <2 x i32> %18, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %19, ptr %arrayidx69, align 4, !tbaa !5 br label %for.inc79 for.inc79: ; preds = %if.end, %if.then57 %exitcond.not = icmp eq i64 %indvars.iv.next196, %wide.trip.count br i1 %exitcond.not, label %for.inc82, label %for.body25, !llvm.loop !12 for.inc82: ; preds = %for.inc79, %for.cond21.preheader %inc83 = add nuw nsw i32 %i.2180, 1 %indvars.iv.next199 = add i32 %indvars.iv198, -1 %exitcond200.not = icmp eq i32 %inc83, %sub br i1 %exitcond200.not, label %for.cond85.preheader, label %for.cond21.preheader, !llvm.loop !13 for.cond88.preheader: ; preds = %for.cond88.preheader.lr.ph, %for.inc117 %indvars.iv204 = phi i64 [ 0, %for.cond88.preheader.lr.ph ], [ %indvars.iv.next205, %for.inc117 ] %ans.0187 = phi i32 [ 0, %for.cond88.preheader.lr.ph ], [ %ans.1, %for.inc117 ] %arrayidx92 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv204 %20 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %cmp93181 = icmp slt i32 %10, %20 br i1 %cmp93181, label %for.body94.lr.ph, label %for.inc117 for.body94.lr.ph: ; preds = %for.cond88.preheader %arrayidx98 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv204 %21 = load i32, ptr %arrayidx98, align 4, !tbaa !5 br label %for.body94 for.body94: ; preds = %for.body94.lr.ph, %for.inc108 %indvars.iv201 = phi i64 [ 0, %for.body94.lr.ph ], [ %indvars.iv.next202, %for.inc108 ] %tmp.0182 = phi i32 [ -1, %for.body94.lr.ph ], [ %tmp.1, %for.inc108 ] %arrayidx96 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv201 %22 = load i32, ptr %arrayidx96, align 4, !tbaa !5 %cmp99 = icmp slt i32 %22, %21 br i1 %cmp99, label %land.lhs.true, label %for.inc108 land.lhs.true: ; preds = %for.body94 %cmp102 = icmp eq i32 %tmp.0182, -1 br i1 %cmp102, label %cond.end, label %cond.false cond.false: ; preds = %land.lhs.true %idxprom103 = sext i32 %tmp.0182 to i64 %arrayidx104 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom103 %23 = load i32, ptr %arrayidx104, align 4, !tbaa !5 br label %cond.end cond.end: ; preds = %land.lhs.true, %cond.false %cond = phi i32 [ %23, %cond.false ], [ -1, %land.lhs.true ] %cmp105 = icmp sgt i32 %22, %cond %24 = trunc i64 %indvars.iv201 to i32 %spec.select = select i1 %cmp105, i32 %24, i32 %tmp.0182 br label %for.inc108 for.inc108: ; preds = %cond.end, %for.body94 %tmp.1 = phi i32 [ %tmp.0182, %for.body94 ], [ %spec.select, %cond.end ] %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1 %arrayidx90 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next202 %25 = load i32, ptr %arrayidx90, align 4, !tbaa !5 %cmp93 = icmp slt i32 %25, %20 br i1 %cmp93, label %for.body94, label %for.end110, !llvm.loop !14 for.end110: ; preds = %for.inc108 %cmp111 = icmp sgt i32 %tmp.1, -1 br i1 %cmp111, label %if.then112, label %for.inc117 if.then112: ; preds = %for.end110 %inc113 = add nsw i32 %ans.0187, 1 %idxprom114 = zext i32 %tmp.1 to i64 %arrayidx115 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom114 store i32 200, ptr %arrayidx115, align 4, !tbaa !5 br label %for.inc117 for.inc117: ; preds = %for.cond88.preheader, %for.end110, %if.then112 %ans.1 = phi i32 [ %inc113, %if.then112 ], [ %ans.0187, %for.end110 ], [ %ans.0187, %for.cond88.preheader ] %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond208.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count207 br i1 %exitcond208.not, label %for.end119, label %for.cond88.preheader, !llvm.loop !15 for.end119: ; preds = %for.inc117, %for.cond7.preheader, %entry, %for.cond85.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond85.preheader ], [ 0, %entry ], [ 0, %for.cond7.preheader ], [ %ans.1, %for.inc117 ] %call120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int main( void ) { int i, ch, count[ 4 ] = {}, min; while ( ( ch = getchar() ) != EOF ) switch ( ch ) { case 'K': count[ 0 ]++; break; case 'U': count[ 1 ]++; break; case 'P': count[ 2 ]++; break; case 'C': count[ 3 ]++; break; } min = count[ 3 ]; for ( i = 3; i--; ) if ( count[ i ] < min ) min = count[ i ]; printf( "%d\n", min ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177369/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177369/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond.outer while.cond.outer: ; preds = %sw.bb1, %entry %inc324.ph = phi i32 [ %inc3, %sw.bb1 ], [ 0, %entry ] %inc622.ph = phi i32 [ %inc622.ph31, %sw.bb1 ], [ 0, %entry ] %inc920.ph = phi i32 [ %inc920.ph35, %sw.bb1 ], [ 0, %entry ] %.ph = phi i32 [ %.ph38, %sw.bb1 ], [ 0, %entry ] br label %while.cond.outer30 while.cond.outer30: ; preds = %while.cond.outer, %sw.bb4 %inc622.ph31 = phi i32 [ %inc622.ph, %while.cond.outer ], [ %inc6, %sw.bb4 ] %inc920.ph32 = phi i32 [ %inc920.ph, %while.cond.outer ], [ %inc920.ph35, %sw.bb4 ] %.ph33 = phi i32 [ %.ph, %while.cond.outer ], [ %.ph38, %sw.bb4 ] br label %while.cond.outer34 while.cond.outer34: ; preds = %while.cond.outer30, %sw.bb7 %inc920.ph35 = phi i32 [ %inc920.ph32, %while.cond.outer30 ], [ %inc9, %sw.bb7 ] %.ph36 = phi i32 [ %.ph33, %while.cond.outer30 ], [ %.ph38, %sw.bb7 ] br label %while.cond.outer37 while.cond.outer37: ; preds = %while.cond.outer34, %sw.bb %.ph38 = phi i32 [ %.ph36, %while.cond.outer34 ], [ %inc, %sw.bb ] br label %while.cond while.cond: ; preds = %while.cond.outer37, %while.cond %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) switch i32 %call.i, label %while.cond [ i32 -1, label %while.end i32 75, label %sw.bb i32 85, label %sw.bb1 i32 80, label %sw.bb4 i32 67, label %sw.bb7 ], !llvm.loop !9 sw.bb: ; preds = %while.cond %inc = add nsw i32 %.ph38, 1 br label %while.cond.outer37, !llvm.loop !9 sw.bb1: ; preds = %while.cond %inc3 = add nuw nsw i32 %inc324.ph, 1 br label %while.cond.outer, !llvm.loop !9 sw.bb4: ; preds = %while.cond %inc6 = add nsw i32 %inc622.ph31, 1 br label %while.cond.outer30, !llvm.loop !9 sw.bb7: ; preds = %while.cond %inc9 = add nsw i32 %inc920.ph35, 1 br label %while.cond.outer34, !llvm.loop !9 while.end: ; preds = %while.cond %spec.select = tail call i32 @llvm.smin.i32(i32 %inc622.ph31, i32 %inc920.ph35) %spec.select.1 = tail call i32 @llvm.smin.i32(i32 %inc324.ph, i32 %spec.select) %spec.select.2 = tail call i32 @llvm.smin.i32(i32 %.ph38, i32 %spec.select.1) %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select.2) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !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<1 && b>-1) printf("Zero\n"); else if (a > 0) printf("Positive\n"); else if ((b - a) % 2 == 0) printf("Negative\n"); else printf("Positive\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177411/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177411/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [9 x i8] c"Negative\00", align 1 @str.5 = private unnamed_addr constant [9 x i8] c"Positive\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"Zero\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 %cmp = icmp slt i32 %0, 1 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, -1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end13, label %if.else if.else: ; preds = %entry %cmp3 = icmp sgt i32 %0, 0 br i1 %cmp3, label %if.end13, label %if.else6 if.else6: ; preds = %if.else %sub = sub nsw i32 %1, %0 %2 = and i32 %sub, 1 %cmp7 = icmp eq i32 %2, 0 %str.4.str = select i1 %cmp7, ptr @str.4, ptr @str.5 br label %if.end13 if.end13: ; preds = %if.else6, %if.else, %entry %str.5.sink = phi ptr [ @str.6, %entry ], [ @str.5, %if.else ], [ %str.4.str, %if.else6 ] %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.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 main() { long long a, b; scanf("%lld%lld", &a, &b); if (a<=0 && b>=0) printf("Zero\n"); else if (a>0) printf("Positive\n"); else { if ((b-a+1)%2==0) printf("Positive\n"); else printf("Negative\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177455/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177455/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @str = private unnamed_addr constant [9 x i8] c"Negative\00", align 1 @str.5 = private unnamed_addr constant [9 x i8] c"Positive\00", align 1 @str.6 = private unnamed_addr constant [5 x i8] c"Zero\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 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 %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %cmp = icmp slt i64 %0, 1 %1 = load i64, ptr %b, align 8 %cmp1 = icmp sgt i64 %1, -1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end13, label %if.else if.else: ; preds = %entry %cmp3 = icmp sgt i64 %0, 0 br i1 %cmp3, label %if.end13, label %if.else6 if.else6: ; preds = %if.else %sub = sub nsw i64 %1, %0 %2 = and i64 %sub, 1 %cmp7.not = icmp eq i64 %2, 0 %str.str.4 = select i1 %cmp7.not, ptr @str, ptr @str.5 br label %if.end13 if.end13: ; preds = %if.else6, %if.else, %entry %str.5.sink = phi ptr [ @str.6, %entry ], [ @str.5, %if.else ], [ %str.str.4, %if.else6 ] %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a, b; while( scanf("%d %d", &a, &b) != EOF ){ printf("%d\n", a + b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177499/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177499/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ printf("%d\n",a+b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177541/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177541/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b; while( scanf("%d %d", &a, &b) != EOF ){ printf("%d\n", a + b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177585/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177585/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b; while( scanf("%d %d", &a, &b) != EOF ){ printf("%d\n", a + b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177628/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177628/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b; while( scanf("%d %d", &a, &b) != EOF ){ printf("%d\n", a + b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int a,b; while(1){ scanf("%d %d",&a,&b); if(feof(stdin))break; printf("%d\n",a+b); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177743/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177743/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call14 = call i32 @feof(ptr noundef %0) #3 %tobool.not5 = icmp eq i32 %call14, 0 br i1 %tobool.not5, label %if.end, label %while.end if.end: ; preds = %entry, %if.end %1 = load i32, ptr %a, align 4, !tbaa !9 %2 = load i32, ptr %b, align 4, !tbaa !9 %add = add nsw i32 %2, %1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call1 = call i32 @feof(ptr noundef %3) #3 %tobool.not = icmp eq i32 %call1, 0 br i1 %tobool.not, label %if.end, label %while.end while.end: ; preds = %if.end, %entry 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 @feof(ptr nocapture noundef) 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 = !{!"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}
#include<stdio.h> int A,B; int main() { while(scanf("%d%d",&A,&B)==2) { printf("%d\n",A+B); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177794/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177794/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @A = dso_local global i32 0, align 4 @B = dso_local global i32 0, align 4 @.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: %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @A, ptr noundef nonnull @B) %cmp3 = icmp eq i32 %call2, 2 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %0 = load i32, ptr @A, align 4, !tbaa !5 %1 = load i32, ptr @B, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @A, ptr noundef nonnull @B) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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; while( scanf("%d %d", &a, &b) != EOF ){ printf("%d\n", a + b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177844/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177844/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not3 = icmp eq i32 %call2, -1 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int w,h,i,j,jnk; scanf("%d%d",&h,&w); char str[h][w]; jnk=getchar(); for(i=0;i<h;i++){ for(j=0;j<w;j++) str[i][j]=getchar(); jnk=getchar(); } for(i=0;i<=w+1;i++) printf("#"); printf("\n"); for(i=0;i<h;i++){ printf("#"); for(j=0;j<w;j++) printf("%c",str[i][j]); printf("#\n"); } for(i=0;i<=w+1;i++) printf("#"); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177888/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177888/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 @str = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca i32, align 4 %h = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = load i32, ptr %w, align 4, !tbaa !5 %3 = zext i32 %2 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i8, i64 %5, align 16 %6 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = call i32 @getc(ptr noundef %6) %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp76 = icmp sgt i32 %7, 0 br i1 %cmp76, label %for.cond2.preheader, label %for.cond12.preheader for.cond2.preheader: ; preds = %entry, %for.end %indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.end ], [ 0, %entry ] %8 = load i32, ptr %w, align 4, !tbaa !5 %cmp374 = icmp sgt i32 %8, 0 br i1 %cmp374, label %for.body4.lr.ph, label %for.end for.body4.lr.ph: ; preds = %for.cond2.preheader %9 = mul nuw nsw i64 %indvars.iv89, %3 %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %9 br label %for.body4 for.cond12.preheader: ; preds = %for.end, %entry %10 = load i32, ptr %w, align 4, !tbaa !5 %cmp13.not79 = icmp slt i32 %10, -1 br i1 %cmp13.not79, label %for.end19, label %for.body15 for.body4: ; preds = %for.body4.lr.ph, %for.body4 %indvars.iv = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next, %for.body4 ] %11 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i72 = call i32 @getc(ptr noundef %11) %conv = trunc i32 %call.i72 to i8 %arrayidx7 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv store i8 %conv, ptr %arrayidx7, align 1, !tbaa !11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = load i32, ptr %w, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body4, %for.cond2.preheader %14 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i73 = call i32 @getc(ptr noundef %14) %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %15 = load i32, ptr %h, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next90, %16 br i1 %cmp, label %for.cond2.preheader, label %for.cond12.preheader, !llvm.loop !14 for.body15: ; preds = %for.cond12.preheader, %for.body15 %i.180 = phi i32 [ %inc18, %for.body15 ], [ 0, %for.cond12.preheader ] %putchar71 = call i32 @putchar(i32 35) %inc18 = add nuw nsw i32 %i.180, 1 %17 = load i32, ptr %w, align 4, !tbaa !5 %cmp13.not = icmp sgt i32 %i.180, %17 br i1 %cmp13.not, label %for.end19, label %for.body15, !llvm.loop !15 for.end19: ; preds = %for.body15, %for.cond12.preheader %putchar = call i32 @putchar(i32 10) %18 = load i32, ptr %h, align 4, !tbaa !5 %cmp2283 = icmp sgt i32 %18, 0 br i1 %cmp2283, label %for.body24, label %for.cond43.preheader for.cond43.preheader: ; preds = %for.end38, %for.end19 %19 = load i32, ptr %w, align 4, !tbaa !5 %cmp45.not86 = icmp slt i32 %19, -1 br i1 %cmp45.not86, label %for.end51, label %for.body47 for.body24: ; preds = %for.end19, %for.end38 %indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.end38 ], [ 0, %for.end19 ] %putchar69 = call i32 @putchar(i32 35) %20 = load i32, ptr %w, align 4, !tbaa !5 %cmp2781 = icmp sgt i32 %20, 0 br i1 %cmp2781, label %for.body29.lr.ph, label %for.end38 for.body29.lr.ph: ; preds = %for.body24 %21 = mul nuw nsw i64 %indvars.iv95, %3 %arrayidx31 = getelementptr inbounds i8, ptr %vla, i64 %21 br label %for.body29 for.body29: ; preds = %for.body29.lr.ph, %for.body29 %indvars.iv92 = phi i64 [ 0, %for.body29.lr.ph ], [ %indvars.iv.next93, %for.body29 ] %arrayidx33 = getelementptr inbounds i8, ptr %arrayidx31, i64 %indvars.iv92 %22 = load i8, ptr %arrayidx33, align 1, !tbaa !11 %conv34 = sext i8 %22 to i32 %putchar70 = call i32 @putchar(i32 %conv34) %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %23 = load i32, ptr %w, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp27 = icmp slt i64 %indvars.iv.next93, %24 br i1 %cmp27, label %for.body29, label %for.end38, !llvm.loop !16 for.end38: ; preds = %for.body29, %for.body24 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %25 = load i32, ptr %h, align 4, !tbaa !5 %26 = sext i32 %25 to i64 %cmp22 = icmp slt i64 %indvars.iv.next96, %26 br i1 %cmp22, label %for.body24, label %for.cond43.preheader, !llvm.loop !17 for.body47: ; preds = %for.cond43.preheader, %for.body47 %i.387 = phi i32 [ %inc50, %for.body47 ], [ 0, %for.cond43.preheader ] %putchar68 = call i32 @putchar(i32 35) %inc50 = add nuw nsw i32 %i.387, 1 %27 = load i32, ptr %w, align 4, !tbaa !5 %cmp45.not = icmp sgt i32 %i.387, %27 br i1 %cmp45.not, label %for.end51, label %for.body47, !llvm.loop !18 for.end51: ; preds = %for.body47, %for.cond43.preheader %putchar67 = call i32 @putchar(i32 10) call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = distinct !{!15, !13} !16 = distinct !{!16, !13} !17 = distinct !{!17, !13} !18 = distinct !{!18, !13}
#include <stdio.h> #define N 100 int main() { int h, w, w_; scanf("%d%d", &h, &w), w += 2; w_ = w; while (w--) printf("#"); printf("\n"); while (h--) { static char s[N + 1]; scanf("%s", s); printf("#%s#\n", s); } while (w_--) printf("#"); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177938/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177938/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @main.s = internal global [101 x i8] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"#%s#\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %w, align 4, !tbaa !5 %add = add nsw i32 %0, 2 %dec20 = add nsw i32 %0, 1 store i32 %dec20, ptr %w, align 4, !tbaa !5 %tobool.not21 = icmp eq i32 %add, 0 br i1 %tobool.not21, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %putchar19 = call i32 @putchar(i32 35) %.pr = load i32, ptr %w, align 4, !tbaa !5 %dec = add nsw i32 %.pr, -1 store i32 %dec, ptr %w, align 4, !tbaa !5 %tobool.not = icmp eq i32 %.pr, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %putchar = call i32 @putchar(i32 10) %1 = load i32, ptr %h, align 4, !tbaa !5 %dec422 = add nsw i32 %1, -1 store i32 %dec422, ptr %h, align 4, !tbaa !5 %tobool5.not23 = icmp eq i32 %1, 0 br i1 %tobool5.not23, label %while.cond10.preheader, label %while.body6 while.cond10.preheader: ; preds = %while.body6, %while.end br i1 %tobool.not21, label %while.end15, label %while.body13 while.body6: ; preds = %while.end, %while.body6 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @main.s) %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @main.s) %2 = load i32, ptr %h, align 4, !tbaa !5 %dec4 = add nsw i32 %2, -1 store i32 %dec4, ptr %h, align 4, !tbaa !5 %tobool5.not = icmp eq i32 %2, 0 br i1 %tobool5.not, label %while.cond10.preheader, label %while.body6, !llvm.loop !11 while.body13: ; preds = %while.cond10.preheader, %while.body13 %w_.025 = phi i32 [ %dec11, %while.body13 ], [ %add, %while.cond10.preheader ] %dec11 = add nsw i32 %w_.025, -1 %putchar18 = call i32 @putchar(i32 35) %tobool12.not = icmp eq i32 %dec11, 0 br i1 %tobool12.not, label %while.end15, label %while.body13, !llvm.loop !12 while.end15: ; preds = %while.body13, %while.cond10.preheader %putchar17 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main(void) { char str[100][101] = {0}; int h = 0, w = 0; int i;//forのループ scanf("%d%d", &h, &w); for(i=0; i<h; i++){ scanf("%s", str[i]); } //一番上の行 for(i=1; i<=w+2; i++){ printf("#"); } printf("\n"); for(i=0; i<h; i++){ printf("#"); printf("%s", str[i]); printf("#\n"); } //一番下の行 for(i=1; i<=w+2; i++){ printf("#"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_177996/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_177996/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x [101 x i8]], align 16 %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 10100, ptr nonnull %str) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10100) %str, i8 0, i64 10100, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5 store i32 0, ptr %h, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 store i32 0, ptr %w, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, 0 br i1 %cmp44, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp3.not47 = icmp slt i32 %1, -1 br i1 %cmp3.not47, label %for.end8, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x [101 x i8]], ptr %str, 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 %h, 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 %i.148 = phi i32 [ %inc7, %for.body4 ], [ 1, %for.cond2.preheader ] %putchar43 = call i32 @putchar(i32 35) %inc7 = add nuw nsw i32 %i.148, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %add = add nsw i32 %4, 2 %cmp3.not.not = icmp slt i32 %i.148, %add br i1 %cmp3.not.not, label %for.body4, label %for.end8, !llvm.loop !11 for.end8: ; preds = %for.body4, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) %5 = load i32, ptr %h, align 4, !tbaa !5 %cmp1149 = icmp sgt i32 %5, 0 br i1 %cmp1149, label %for.body12, label %for.cond22.preheader for.cond22.preheader: ; preds = %for.body12, %for.end8 %6 = load i32, ptr %w, align 4, !tbaa !5 %cmp24.not52 = icmp slt i32 %6, -1 br i1 %cmp24.not52, label %for.end29, label %for.body25 for.body12: ; preds = %for.end8, %for.body12 %indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.body12 ], [ 0, %for.end8 ] %putchar42 = call i32 @putchar(i32 35) %arrayidx15 = getelementptr inbounds [100 x [101 x i8]], ptr %str, i64 0, i64 %indvars.iv55 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %arrayidx15) %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %7 = load i32, ptr %h, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp11 = icmp slt i64 %indvars.iv.next56, %8 br i1 %cmp11, label %for.body12, label %for.cond22.preheader, !llvm.loop !12 for.body25: ; preds = %for.cond22.preheader, %for.body25 %i.353 = phi i32 [ %inc28, %for.body25 ], [ 1, %for.cond22.preheader ] %putchar41 = call i32 @putchar(i32 35) %inc28 = add nuw nsw i32 %i.353, 1 %9 = load i32, ptr %w, align 4, !tbaa !5 %add23 = add nsw i32 %9, 2 %cmp24.not.not = icmp slt i32 %i.353, %add23 br i1 %cmp24.not.not, label %for.body25, label %for.end29, !llvm.loop !13 for.end29: ; preds = %for.body25, %for.cond22.preheader %putchar40 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 10100, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #include<string.h> int main() { int n,m,v,i,j; while(scanf("%d%d",&n,&m)!=EOF) { char a[n+2][m+2]; v=(n+2)*(m+2); memset(a,'#',sizeof(char)*v); for(i=1;i<n+1;i++) { for(j=1;j<m+1;j++) { scanf("\n%c",&a[i][j]); } } for(i=0;i<n+2;i++) { for(j=0;j<m+2;j++) { printf("%c",a[i][j]); } printf("\n"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178067/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178067/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"\0A%c\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) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 %call63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %cmp.not64 = icmp eq i32 %call63, -1 br i1 %cmp.not64, label %while.end, label %while.body while.body: ; preds = %entry, %for.end41 %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 2 %1 = zext i32 %add to i64 %2 = load i32, ptr %m, align 4, !tbaa !5 %add1 = add nsw i32 %2, 2 %3 = zext i32 %add1 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i8, i64 %5, align 16 %6 = load i32, ptr %n, align 4, !tbaa !5 %add2 = add nsw i32 %6, 2 %7 = load i32, ptr %m, align 4, !tbaa !5 %add3 = add nsw i32 %7, 2 %mul = mul nsw i32 %add3, %add2 %conv = sext i32 %mul to i64 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 35, i64 %conv, i1 false) %cmp6.not55 = icmp slt i32 %6, 1 br i1 %cmp6.not55, label %for.cond19.preheader, label %for.cond8.preheader.lr.ph for.cond8.preheader.lr.ph: ; preds = %while.body %8 = icmp slt i32 %7, 1 br i1 %8, label %for.cond24.preheader.preheader, label %for.cond8.preheader for.cond19.preheader: ; preds = %for.inc16, %while.body %9 = phi i32 [ %6, %while.body ], [ %15, %for.inc16 ] %cmp2161 = icmp sgt i32 %9, -2 br i1 %cmp2161, label %for.cond24.preheader.preheader, label %for.end41 for.cond24.preheader.preheader: ; preds = %for.cond8.preheader.lr.ph, %for.cond19.preheader br label %for.cond24.preheader for.cond8.preheader: ; preds = %for.cond8.preheader.lr.ph, %for.inc16 %10 = phi i32 [ %15, %for.inc16 ], [ %6, %for.cond8.preheader.lr.ph ] %11 = phi i32 [ %16, %for.inc16 ], [ %7, %for.cond8.preheader.lr.ph ] %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.inc16 ], [ 1, %for.cond8.preheader.lr.ph ] %cmp10.not53 = icmp slt i32 %11, 1 br i1 %cmp10.not53, label %for.inc16, label %for.body12.lr.ph for.body12.lr.ph: ; preds = %for.cond8.preheader %12 = mul nuw nsw i64 %indvars.iv67, %3 %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %12 br label %for.body12 for.body12: ; preds = %for.body12.lr.ph, %for.body12 %indvars.iv = phi i64 [ 1, %for.body12.lr.ph ], [ %indvars.iv.next, %for.body12 ] %arrayidx14 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx14) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr %m, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp10.not.not = icmp slt i64 %indvars.iv, %14 br i1 %cmp10.not.not, label %for.body12, label %for.inc16.loopexit, !llvm.loop !9 for.inc16.loopexit: ; preds = %for.body12 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc16 for.inc16: ; preds = %for.inc16.loopexit, %for.cond8.preheader %15 = phi i32 [ %.pre, %for.inc16.loopexit ], [ %10, %for.cond8.preheader ] %16 = phi i32 [ %13, %for.inc16.loopexit ], [ %11, %for.cond8.preheader ] %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %17 = sext i32 %15 to i64 %cmp6.not.not = icmp slt i64 %indvars.iv67, %17 br i1 %cmp6.not.not, label %for.cond8.preheader, label %for.cond19.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond24.preheader.preheader, %for.end37 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.end37 ], [ 0, %for.cond24.preheader.preheader ] %18 = load i32, ptr %m, align 4, !tbaa !5 %cmp2658 = icmp sgt i32 %18, -2 br i1 %cmp2658, label %for.body28.lr.ph, label %for.end37 for.body28.lr.ph: ; preds = %for.cond24.preheader %19 = mul nuw nsw i64 %indvars.iv73, %3 %arrayidx30 = getelementptr inbounds i8, ptr %vla, i64 %19 br label %for.body28 for.body28: ; preds = %for.body28.lr.ph, %for.body28 %indvars.iv70 = phi i64 [ 0, %for.body28.lr.ph ], [ %indvars.iv.next71, %for.body28 ] %arrayidx32 = getelementptr inbounds i8, ptr %arrayidx30, i64 %indvars.iv70 %20 = load i8, ptr %arrayidx32, align 1, !tbaa !13 %conv33 = sext i8 %20 to i32 %putchar52 = call i32 @putchar(i32 %conv33) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %21 = load i32, ptr %m, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp26.not = icmp sgt i64 %indvars.iv70, %22 br i1 %cmp26.not, label %for.end37, label %for.body28, !llvm.loop !14 for.end37: ; preds = %for.body28, %for.cond24.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp21.not = icmp sgt i64 %indvars.iv73, %24 br i1 %cmp21.not, label %for.end41, label %for.cond24.preheader, !llvm.loop !15 for.end41: ; preds = %for.end37, %for.cond19.preheader call void @llvm.stackrestore.p0(ptr %4) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %for.end41, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> int main(void){ int i,h,w; char a[101][101]; scanf( "%d %d",&h,&w ); for( i = 0; i < h; i++ ){ scanf( "%s", &a[i][0] ); } for( i = 0; i < w + 2; i++ ){ printf("#"); } printf("\n"); for( i = 0; i < h; i++){ printf("#%s#\n",a[i]); } for( i = 0; i < w + 2; i++ ){ printf("#"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178117/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178117/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"#%s#\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %a = alloca [101 x [101 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp41 = icmp sgt i32 %0, 0 br i1 %cmp41, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp444 = icmp sgt i32 %1, -2 br i1 %cmp444, label %for.body5, label %for.end9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x [101 x i8]], ptr %a, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %h, 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.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond3.preheader, %for.body5 %i.145 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond3.preheader ] %putchar40 = call i32 @putchar(i32 35) %inc8 = add nuw nsw i32 %i.145, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp4.not = icmp sgt i32 %i.145, %4 br i1 %cmp4.not, label %for.end9, label %for.body5, !llvm.loop !11 for.end9: ; preds = %for.body5, %for.cond3.preheader %putchar = call i32 @putchar(i32 10) %5 = load i32, ptr %h, align 4, !tbaa !5 %cmp1246 = icmp sgt i32 %5, 0 br i1 %cmp1246, label %for.body13, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body13, %for.end9 %6 = load i32, ptr %w, align 4, !tbaa !5 %cmp2249 = icmp sgt i32 %6, -2 br i1 %cmp2249, label %for.body23, label %for.end27 for.body13: ; preds = %for.end9, %for.body13 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body13 ], [ 0, %for.end9 ] %arrayidx15 = getelementptr inbounds [101 x [101 x i8]], ptr %a, i64 0, i64 %indvars.iv52 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %arrayidx15) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %7 = load i32, ptr %h, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp12 = icmp slt i64 %indvars.iv.next53, %8 br i1 %cmp12, label %for.body13, label %for.cond20.preheader, !llvm.loop !12 for.body23: ; preds = %for.cond20.preheader, %for.body23 %i.350 = phi i32 [ %inc26, %for.body23 ], [ 0, %for.cond20.preheader ] %putchar39 = call i32 @putchar(i32 35) %inc26 = add nuw nsw i32 %i.350, 1 %9 = load i32, ptr %w, align 4, !tbaa !5 %cmp22.not = icmp sgt i32 %i.350, %9 br i1 %cmp22.not, label %for.end27, label %for.body23, !llvm.loop !13 for.end27: ; preds = %for.body23, %for.cond20.preheader %putchar38 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void){ // Here your code ! int h,w; char a; int i; int j; scanf("%d %d", &h, &w); for( i = 0; i < h + 2; ++i){ for( j = 0; j < w + 2; ++j ){ if( i == 0 || i == h+1 || j == 0 || j == w+1 ){ printf("#"); }else{ scanf("%c", &a); if( a != '\n'){ printf("%c", a); }else{ scanf("%c", &a); printf("%c", a); } } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178160/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %a = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, -2 br i1 %cmp44, label %for.cond1.preheader, label %for.end28 for.cond1.preheader: ; preds = %entry, %for.end %i.045 = phi i32 [ %inc27, %for.end ], [ 0, %entry ] %1 = load i32, ptr %w, align 4, !tbaa !5 %cmp340 = icmp sgt i32 %1, -2 br i1 %cmp340, label %for.body4.lr.ph, label %for.end for.body4.lr.ph: ; preds = %for.cond1.preheader %cmp5 = icmp eq i32 %i.045, 0 br i1 %cmp5, label %for.body4.us, label %for.body4 for.body4.us: ; preds = %for.body4.lr.ph, %for.body4.us %j.041.us = phi i32 [ %inc.us, %for.body4.us ], [ 0, %for.body4.lr.ph ] %putchar37.us = call i32 @putchar(i32 35) %inc.us = add nuw nsw i32 %j.041.us, 1 %2 = load i32, ptr %w, align 4, !tbaa !5 %cmp3.us.not = icmp sgt i32 %j.041.us, %2 br i1 %cmp3.us.not, label %for.end, label %for.body4.us, !llvm.loop !9 for.body4: ; preds = %for.body4.lr.ph, %for.inc %3 = phi i32 [ %7, %for.inc ], [ %1, %for.body4.lr.ph ] %j.041 = phi i32 [ %inc, %for.inc ], [ 0, %for.body4.lr.ph ] %4 = load i32, ptr %h, align 4, !tbaa !5 %add6 = add nsw i32 %4, 1 %cmp7 = icmp eq i32 %i.045, %add6 %cmp9 = icmp eq i32 %j.041, 0 %or.cond = or i1 %cmp9, %cmp7 %add11 = add nsw i32 %3, 1 %cmp12 = icmp eq i32 %j.041, %add11 %or.cond38 = select i1 %or.cond, i1 true, i1 %cmp12 br i1 %or.cond38, label %for.inc, label %if.else if.else: ; preds = %for.body4 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a) %5 = load i8, ptr %a, align 1, !tbaa !11 %cmp15.not = icmp eq i8 %5, 10 br i1 %cmp15.not, label %if.else20, label %if.then17 if.then17: ; preds = %if.else %conv = sext i8 %5 to i32 br label %for.inc if.else20: ; preds = %if.else %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a) %6 = load i8, ptr %a, align 1, !tbaa !11 %conv22 = sext i8 %6 to i32 br label %for.inc for.inc: ; preds = %for.body4, %if.else20, %if.then17 %.sink = phi i32 [ %conv22, %if.else20 ], [ %conv, %if.then17 ], [ 35, %for.body4 ] %putchar37 = call i32 @putchar(i32 %.sink) %inc = add nuw nsw i32 %j.041, 1 %7 = load i32, ptr %w, align 4, !tbaa !5 %cmp3.not = icmp sgt i32 %j.041, %7 br i1 %cmp3.not, label %for.end, label %for.body4, !llvm.loop !9 for.end: ; preds = %for.inc, %for.body4.us, %for.cond1.preheader %putchar = call i32 @putchar(i32 10) %inc27 = add nuw nsw i32 %i.045, 1 %8 = load i32, ptr %h, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %i.045, %8 br i1 %cmp.not, label %for.end28, label %for.cond1.preheader, !llvm.loop !12 for.end28: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int p = 0; int pmin[1000] = { 0 }; int pminmax = 0; int n = 1, k = 1; int i = 0, j = 0; int sum = 0; int swap = 0; scanf("%d %d", &n, &k); scanf("%d", &p); pmin[0] = p; pminmax = p; for (i = 1; i < k; i++) { scanf("%d", &p); pmin[i] = p; if (pminmax < p)pminmax = p; } for (; i < n; i++) { scanf("%d", &p); if (pminmax <= p)continue; for (j = 0; j < k; j++) { if (pmin[j] > p) { swap = pmin[j]; pmin[j] = p; p = swap; } } pminmax = p; } for (j = 0; j < k; j++) { sum += pmin[j]; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178203/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca i32, align 4 %pmin = alloca [1000 x i32], align 16 %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5 store i32 0, ptr %p, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %pmin) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %pmin, i8 0, i64 4000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 store i32 1, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 store i32 1, ptr %k, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p) %0 = load i32, ptr %p, align 4, !tbaa !5 store i32 %0, ptr %pmin, align 16, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %1, 1 br i1 %cmp54, label %for.body, label %for.cond5.preheader for.cond5.preheader.loopexit: ; preds = %for.body %2 = trunc i64 %indvars.iv.next to i32 br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond5.preheader.loopexit, %entry %3 = phi i32 [ %1, %entry ], [ %6, %for.cond5.preheader.loopexit ] %pminmax.0.lcssa = phi i32 [ %0, %entry ], [ %spec.select, %for.cond5.preheader.loopexit ] %i.0.lcssa = phi i32 [ 1, %entry ], [ %2, %for.cond5.preheader.loopexit ] %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp660 = icmp slt i32 %i.0.lcssa, %4 br i1 %cmp660, label %for.body7, label %for.cond30.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %pminmax.055 = phi i32 [ %spec.select, %for.body ], [ %0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p) %5 = load i32, ptr %p, align 4, !tbaa !5 %arrayidx3 = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %indvars.iv store i32 %5, ptr %arrayidx3, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %pminmax.055, i32 %5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %k, 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.cond5.preheader.loopexit, !llvm.loop !9 for.cond30.preheader.loopexit: ; preds = %for.inc27 %.pre = load i32, ptr %k, align 4, !tbaa !5 br label %for.cond30.preheader for.cond30.preheader: ; preds = %for.cond30.preheader.loopexit, %for.cond5.preheader %8 = phi i32 [ %.pre, %for.cond30.preheader.loopexit ], [ %3, %for.cond5.preheader ] %cmp3163 = icmp sgt i32 %8, 0 br i1 %cmp3163, label %for.body32.preheader, label %for.end37 for.body32.preheader: ; preds = %for.cond30.preheader %wide.trip.count74 = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body32.preheader80, label %vector.ph vector.ph: ; preds = %for.body32.preheader %n.vec = and i64 %wide.trip.count74, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %9 = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load79 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = add <4 x i32> %wide.load, %vec.phi %12 = add <4 x i32> %wide.load79, %vec.phi78 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count74 br i1 %cmp.n, label %for.end37, label %for.body32.preheader80 for.body32.preheader80: ; preds = %for.body32.preheader, %middle.block %indvars.iv71.ph = phi i64 [ 0, %for.body32.preheader ], [ %n.vec, %middle.block ] %sum.065.ph = phi i32 [ 0, %for.body32.preheader ], [ %14, %middle.block ] br label %for.body32 for.body7: ; preds = %for.cond5.preheader, %for.inc27 %i.162 = phi i32 [ %inc28, %for.inc27 ], [ %i.0.lcssa, %for.cond5.preheader ] %pminmax.261 = phi i32 [ %pminmax.3, %for.inc27 ], [ %pminmax.0.lcssa, %for.cond5.preheader ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p) %15 = load i32, ptr %p, align 4, !tbaa !5 %cmp9.not = icmp sgt i32 %pminmax.261, %15 br i1 %cmp9.not, label %for.cond12.preheader, label %for.inc27 for.cond12.preheader: ; preds = %for.body7 %16 = load i32, ptr %k, align 4, !tbaa !5 %cmp1358 = icmp sgt i32 %16, 0 br i1 %cmp1358, label %for.body14.preheader, label %for.inc27 for.body14.preheader: ; preds = %for.cond12.preheader %wide.trip.count = zext i32 %16 to i64 %xtraiter = and i64 %wide.trip.count, 1 %17 = icmp eq i32 %16, 1 br i1 %17, label %for.inc27.loopexit.unr-lcssa, label %for.body14.preheader.new for.body14.preheader.new: ; preds = %for.body14.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body14 for.body14: ; preds = %for.inc24.1, %for.body14.preheader.new %indvars.iv68 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next69.1, %for.inc24.1 ] %18 = phi i32 [ %15, %for.body14.preheader.new ], [ %22, %for.inc24.1 ] %niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.inc24.1 ] %arrayidx16 = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %indvars.iv68 %19 = load i32, ptr %arrayidx16, align 8, !tbaa !5 %cmp17 = icmp sgt i32 %19, %18 br i1 %cmp17, label %if.then18, label %for.inc24 if.then18: ; preds = %for.body14 store i32 %18, ptr %arrayidx16, align 8, !tbaa !5 store i32 %19, ptr %p, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.body14, %if.then18 %20 = phi i32 [ %18, %for.body14 ], [ %19, %if.then18 ] %indvars.iv.next69 = or i64 %indvars.iv68, 1 %arrayidx16.1 = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %indvars.iv.next69 %21 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %cmp17.1 = icmp sgt i32 %21, %20 br i1 %cmp17.1, label %if.then18.1, label %for.inc24.1 if.then18.1: ; preds = %for.inc24 store i32 %20, ptr %arrayidx16.1, align 4, !tbaa !5 store i32 %21, ptr %p, align 4, !tbaa !5 br label %for.inc24.1 for.inc24.1: ; preds = %if.then18.1, %for.inc24 %22 = phi i32 [ %20, %for.inc24 ], [ %21, %if.then18.1 ] %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 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.inc27.loopexit.unr-lcssa, label %for.body14, !llvm.loop !14 for.inc27.loopexit.unr-lcssa: ; preds = %for.inc24.1, %for.body14.preheader %.lcssa82.ph = phi i32 [ undef, %for.body14.preheader ], [ %22, %for.inc24.1 ] %indvars.iv68.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next69.1, %for.inc24.1 ] %.unr = phi i32 [ %15, %for.body14.preheader ], [ %22, %for.inc24.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc27, label %for.body14.epil for.body14.epil: ; preds = %for.inc27.loopexit.unr-lcssa %arrayidx16.epil = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %indvars.iv68.unr %23 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5 %cmp17.epil = icmp sgt i32 %23, %.unr br i1 %cmp17.epil, label %if.then18.epil, label %for.inc27 if.then18.epil: ; preds = %for.body14.epil store i32 %.unr, ptr %arrayidx16.epil, align 4, !tbaa !5 store i32 %23, ptr %p, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %for.inc27.loopexit.unr-lcssa, %if.then18.epil, %for.body14.epil, %for.cond12.preheader, %for.body7 %pminmax.3 = phi i32 [ %pminmax.261, %for.body7 ], [ %15, %for.cond12.preheader ], [ %.lcssa82.ph, %for.inc27.loopexit.unr-lcssa ], [ %.unr, %for.body14.epil ], [ %23, %if.then18.epil ] %inc28 = add nuw nsw i32 %i.162, 1 %24 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc28, %24 br i1 %cmp6, label %for.body7, label %for.cond30.preheader.loopexit, !llvm.loop !15 for.body32: ; preds = %for.body32.preheader80, %for.body32 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body32 ], [ %indvars.iv71.ph, %for.body32.preheader80 ] %sum.065 = phi i32 [ %add, %for.body32 ], [ %sum.065.ph, %for.body32.preheader80 ] %arrayidx34 = getelementptr inbounds [1000 x i32], ptr %pmin, i64 0, i64 %indvars.iv71 %25 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %25, %sum.065 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74 br i1 %exitcond75.not, label %for.end37, label %for.body32, !llvm.loop !16 for.end37: ; preds = %for.body32, %middle.block, %for.cond30.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %14, %middle.block ], [ %add, %for.body32 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) 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 4000, ptr nonnull %pmin) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
#include<stdio.h> #define N 1000 int main(void) { int i,j,n_fruit,k_fruit,price=0,fruit[N],temp; scanf("%d%d",&n_fruit,&k_fruit); for(i=0;i<n_fruit;i++){ scanf("%d",&fruit[i]); } for(i=0;i<n_fruit;i++){ for(j=i+1;j<n_fruit;j++){ if(fruit[i]>fruit[j]){ temp = fruit[i]; fruit[i] = fruit[j]; fruit[j] = temp; } } } for(i=0;i<k_fruit;i++){ price += fruit[i]; } printf("%d\n",price); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178247/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178247/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n_fruit = alloca i32, align 4 %k_fruit = alloca i32, align 4 %fruit = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n_fruit) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k_fruit) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %fruit) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n_fruit, ptr noundef nonnull %k_fruit) %0 = load i32, ptr %n_fruit, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond27.preheader for.cond2.preheader: ; preds = %for.body %cmp358 = icmp sgt i32 %2, 0 br i1 %cmp358, label %for.body4.preheader, label %for.cond27.preheader for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count74 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %fruit, 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 %n_fruit, 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.cond2.loopexit: ; preds = %for.inc21, %for.body4 %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74 br i1 %exitcond75.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11 for.cond27.preheader: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader %4 = load i32, ptr %k_fruit, align 4, !tbaa !5 %cmp2860 = icmp sgt i32 %4, 0 br i1 %cmp2860, label %for.body29.preheader, label %for.end35 for.body29.preheader: ; preds = %for.cond27.preheader %wide.trip.count79 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body29.preheader85, label %vector.ph vector.ph: ; preds = %for.body29.preheader %n.vec = and i64 %wide.trip.count79, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi83 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %5 = getelementptr inbounds [1000 x i32], ptr %fruit, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load84 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = add <4 x i32> %wide.load, %vec.phi %8 = add <4 x i32> %wide.load84, %vec.phi83 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count79 br i1 %cmp.n, label %for.end35, label %for.body29.preheader85 for.body29.preheader85: ; preds = %for.body29.preheader, %middle.block %indvars.iv76.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ] %price.061.ph = phi i32 [ 0, %for.body29.preheader ], [ %10, %middle.block ] br label %for.body29 for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit %indvars.iv71 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next72, %for.cond2.loopexit ] %indvars.iv66 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next67, %for.cond2.loopexit ] %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %cmp656 = icmp ult i64 %indvars.iv.next72, %1 br i1 %cmp656, label %for.body7.lr.ph, label %for.cond2.loopexit for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [1000 x i32], ptr %fruit, i64 0, i64 %indvars.iv71 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv68 = phi i64 [ %indvars.iv66, %for.body7.lr.ph ], [ %indvars.iv.next69, %for.inc21 ] %11 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [1000 x i32], ptr %fruit, i64 0, i64 %indvars.iv68 %12 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %11, %12 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %12, ptr %arrayidx9, align 4, !tbaa !5 store i32 %11, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count74 br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !15 for.body29: ; preds = %for.body29.preheader85, %for.body29 %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body29 ], [ %indvars.iv76.ph, %for.body29.preheader85 ] %price.061 = phi i32 [ %add32, %for.body29 ], [ %price.061.ph, %for.body29.preheader85 ] %arrayidx31 = getelementptr inbounds [1000 x i32], ptr %fruit, i64 0, i64 %indvars.iv76 %13 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %add32 = add nsw i32 %13, %price.061 %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79 br i1 %exitcond80.not, label %for.end35, label %for.body29, !llvm.loop !16 for.end35: ; preds = %for.body29, %middle.block, %for.cond27.preheader %price.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %10, %middle.block ], [ %add32, %for.body29 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %price.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %fruit) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k_fruit) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n_fruit) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13}
#include<stdio.h> #include<stdlib.h> int main(void){ //文字読み取る配列を定義(string) int N,K; int *p; int i,j,atoi; //counter //文字読み取り scanf("%d %d",&N,&K); //printf("%d,%d\n",N,K); //空白ごとに区切って変数に代入(種類、取るやつ) p = (int *)malloc(N * sizeof(char)); for(i=0;i<N;i++) scanf("%d",&p[i]); //printf("これだよ:%d",*p); for(i=0;i<N-1;i++){ for(j=0;j<N-i-1;j++){ if(p[j]>p[j+1]){ atoi = p[j]; p[j] = p[j+1]; p[j+1] = atoi; } } } int sum = 0; for(i=0;i<K;i++) sum += p[i]; printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178290/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178290/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %call1 = call noalias ptr @malloc(i64 noundef %conv) #6 %cmp71 = icmp sgt i32 %0, 0 br i1 %cmp71, label %for.body, label %for.cond36.preheader for.cond4.preheader: ; preds = %for.body %sub = add i32 %1, -1 %cmp575 = icmp sgt i32 %1, 1 br i1 %cmp575, label %for.cond8.preheader.preheader, label %for.cond36.preheader for.cond8.preheader.preheader: ; preds = %for.cond4.preheader %invariant.gep = getelementptr i32, ptr %call1, i64 1 br label %for.cond8.preheader 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.1, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc33 %indvars.iv86 = phi i32 [ %indvars.iv.next87, %for.inc33 ], [ %sub, %for.cond8.preheader.preheader ] %i.176 = phi i32 [ %inc34, %for.inc33 ], [ 0, %for.cond8.preheader.preheader ] %3 = zext i32 %indvars.iv86 to i64 %4 = xor i32 %i.176, -1 %sub10 = add i32 %1, %4 %cmp1173 = icmp sgt i32 %sub10, 0 br i1 %cmp1173, label %for.body13.preheader, label %for.inc33 for.body13.preheader: ; preds = %for.cond8.preheader %.pre = load i32, ptr %call1, align 4, !tbaa !5 %xtraiter = and i64 %3, 1 %5 = icmp eq i32 %indvars.iv86, 1 br i1 %5, label %for.inc33.loopexit.unr-lcssa, label %for.body13.preheader.new for.body13.preheader.new: ; preds = %for.body13.preheader %unroll_iter = and i64 %3, 4294967294 br label %for.body13 for.cond36.preheader: ; preds = %for.inc33, %entry, %for.cond4.preheader %6 = load i32, ptr %K, align 4, !tbaa !5 %cmp3777 = icmp sgt i32 %6, 0 br i1 %cmp3777, label %for.body39.preheader, label %for.end45 for.body39.preheader: ; preds = %for.cond36.preheader %wide.trip.count92 = zext i32 %6 to i64 %min.iters.check = icmp ult i32 %6, 8 br i1 %min.iters.check, label %for.body39.preheader99, label %vector.ph vector.ph: ; preds = %for.body39.preheader %n.vec = and i64 %wide.trip.count92, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi97 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %7 = getelementptr inbounds i32, ptr %call1, i64 %index %wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load98 = load <4 x i32>, ptr %8, align 4, !tbaa !5 %9 = add <4 x i32> %wide.load, %vec.phi %10 = add <4 x i32> %wide.load98, %vec.phi97 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count92 br i1 %cmp.n, label %for.end45, label %for.body39.preheader99 for.body39.preheader99: ; preds = %for.body39.preheader, %middle.block %indvars.iv89.ph = phi i64 [ 0, %for.body39.preheader ], [ %n.vec, %middle.block ] %sum.079.ph = phi i32 [ 0, %for.body39.preheader ], [ %12, %middle.block ] br label %for.body39 for.body13: ; preds = %for.inc30.1, %for.body13.preheader.new %13 = phi i32 [ %.pre, %for.body13.preheader.new ], [ %17, %for.inc30.1 ] %indvars.iv83 = phi i64 [ 0, %for.body13.preheader.new ], [ %indvars.iv.next84.1, %for.inc30.1 ] %niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.1, %for.inc30.1 ] %indvars.iv.next84 = or i64 %indvars.iv83, 1 %arrayidx17 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next84 %14 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %13, %14 br i1 %cmp18, label %if.then, label %for.inc30 if.then: ; preds = %for.body13 %arrayidx15 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv83 store i32 %14, ptr %arrayidx15, align 4, !tbaa !5 store i32 %13, ptr %arrayidx17, align 4, !tbaa !5 br label %for.inc30 for.inc30: ; preds = %for.body13, %if.then %15 = phi i32 [ %14, %for.body13 ], [ %13, %if.then ] %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2 %arrayidx17.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next84.1 %16 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %cmp18.1 = icmp sgt i32 %15, %16 br i1 %cmp18.1, label %if.then.1, label %for.inc30.1 if.then.1: ; preds = %for.inc30 %arrayidx15.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next84 store i32 %16, ptr %arrayidx15.1, align 4, !tbaa !5 store i32 %15, ptr %arrayidx17.1, align 4, !tbaa !5 br label %for.inc30.1 for.inc30.1: ; preds = %if.then.1, %for.inc30 %17 = phi i32 [ %16, %for.inc30 ], [ %15, %if.then.1 ] %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.inc33.loopexit.unr-lcssa, label %for.body13, !llvm.loop !14 for.inc33.loopexit.unr-lcssa: ; preds = %for.inc30.1, %for.body13.preheader %.unr = phi i32 [ %.pre, %for.body13.preheader ], [ %17, %for.inc30.1 ] %indvars.iv83.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next84.1, %for.inc30.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc33, label %for.body13.epil for.body13.epil: ; preds = %for.inc33.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv83.unr %18 = load i32, ptr %gep, align 4, !tbaa !5 %cmp18.epil = icmp sgt i32 %.unr, %18 br i1 %cmp18.epil, label %if.then.epil, label %for.inc33 if.then.epil: ; preds = %for.body13.epil %arrayidx15.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv83.unr store i32 %18, ptr %arrayidx15.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 br label %for.inc33 for.inc33: ; preds = %for.inc33.loopexit.unr-lcssa, %if.then.epil, %for.body13.epil, %for.cond8.preheader %inc34 = add nuw nsw i32 %i.176, 1 %indvars.iv.next87 = add i32 %indvars.iv86, -1 %exitcond88.not = icmp eq i32 %inc34, %sub br i1 %exitcond88.not, label %for.cond36.preheader, label %for.cond8.preheader, !llvm.loop !15 for.body39: ; preds = %for.body39.preheader99, %for.body39 %indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.body39 ], [ %indvars.iv89.ph, %for.body39.preheader99 ] %sum.079 = phi i32 [ %add42, %for.body39 ], [ %sum.079.ph, %for.body39.preheader99 ] %arrayidx41 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv89 %19 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %add42 = add nsw i32 %19, %sum.079 %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92 br i1 %exitcond93.not, label %for.end45, label %for.body39, !llvm.loop !16 for.end45: ; preds = %for.body39, %middle.block, %for.cond36.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond36.preheader ], [ %12, %middle.block ], [ %add42, %for.body39 ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
#include <stdio.h> #include <stdlib.h> int comp(const void * a, const void * b){ return (*(int*)a - *(int*)b); } int main(){ int n,k,p[1010],i,j,w,soma=0; scanf("%d %d",&n,&k); for(j=0;j<n;j++){ scanf("%d",&p[j]); } // preciso de um for p percorrer ate o k qsort(p,n,sizeof(int),comp); // for(i=0;i<n;++i){ // printf("%d\n",p[i]); // } for(w=0;w<k;++w){ soma +=p[w];// to com problema em fzr ele pegar a lista e somar o p[k] } printf("%d\n",soma); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178333/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178333/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: 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: %n = alloca i32, align 4 %k = alloca i32, align 4 %p = alloca [1010 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %p) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, 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 [1010 x i32], ptr %p, 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 %p, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comp) #6 %3 = load i32, ptr %k, align 4, !tbaa !5 %cmp319 = icmp sgt i32 %3, 0 br i1 %cmp319, label %for.body5.preheader, label %for.end10 for.body5.preheader: ; preds = %for.end %wide.trip.count = zext i32 %3 to i64 %min.iters.check = icmp ult i32 %3, 8 br i1 %min.iters.check, label %for.body5.preheader30, label %vector.ph vector.ph: ; preds = %for.body5.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %4 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load29 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load29, %vec.phi28 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end10, label %for.body5.preheader30 for.body5.preheader30: ; preds = %for.body5.preheader, %middle.block %indvars.iv25.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ] %soma.021.ph = phi i32 [ 0, %for.body5.preheader ], [ %9, %middle.block ] br label %for.body5 for.body5: ; preds = %for.body5.preheader30, %for.body5 %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.body5 ], [ %indvars.iv25.ph, %for.body5.preheader30 ] %soma.021 = phi i32 [ %add, %for.body5 ], [ %soma.021.ph, %for.body5.preheader30 ] %arrayidx7 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %indvars.iv25 %10 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %10, %soma.021 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %exitcond.not = icmp eq i64 %indvars.iv.next26, %wide.trip.count br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !14 for.end10: ; preds = %for.body5, %middle.block, %for.end %soma.0.lcssa = phi i32 [ 0, %for.end ], [ %9, %middle.block ], [ %add, %for.body5 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %soma.0.lcssa) call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: 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.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12}
#include<stdio.h> int main(){ int n,k; int a[1000]; int b[1]; int sum=0; scanf("%d %d",&n,&k); for(int i=0;i<n;i++){ scanf("%d",&a[i]); } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(a[i]>a[j]){ b[0]=a[i]; a[i]=a[j]; a[j]=b[0]; }else{ continue; } } } for(int i=0;i<k;i++){ sum=sum+a[i]; } printf("%d\n",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178377/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178377/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.cond33.preheader for.cond3.preheader: ; preds = %for.body %cmp463 = icmp sgt i32 %2, 0 br i1 %cmp463, label %for.body6.preheader, label %for.cond33.preheader for.body6.preheader: ; preds = %for.cond3.preheader %1 = zext i32 %2 to i64 %wide.trip.count79 = zext i32 %2 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond3.loopexit: ; preds = %for.inc26, %for.body6 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79 br i1 %exitcond80.not, label %for.cond33.preheader, label %for.body6, !llvm.loop !11 for.cond33.preheader: ; preds = %for.cond3.loopexit, %entry, %for.cond3.preheader %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp3465 = icmp sgt i32 %4, 0 br i1 %cmp3465, label %for.body36.preheader, label %for.cond.cleanup35 for.body36.preheader: ; preds = %for.cond33.preheader %wide.trip.count84 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body36.preheader90, label %vector.ph vector.ph: ; preds = %for.body36.preheader %n.vec = and i64 %wide.trip.count84, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %5 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load89 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = add <4 x i32> %wide.load, %vec.phi %8 = add <4 x i32> %wide.load89, %vec.phi88 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count84 br i1 %cmp.n, label %for.cond.cleanup35, label %for.body36.preheader90 for.body36.preheader90: ; preds = %for.body36.preheader, %middle.block %indvars.iv81.ph = phi i64 [ 0, %for.body36.preheader ], [ %n.vec, %middle.block ] %sum.066.ph = phi i32 [ 0, %for.body36.preheader ], [ %10, %middle.block ] br label %for.body36 for.body6: ; preds = %for.body6.preheader, %for.cond3.loopexit %indvars.iv76 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next77, %for.cond3.loopexit ] %indvars.iv71 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next72, %for.cond3.loopexit ] %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %cmp861 = icmp ult i64 %indvars.iv.next77, %1 br i1 %cmp861, label %for.body10.lr.ph, label %for.cond3.loopexit for.body10.lr.ph: ; preds = %for.body6 %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv76 br label %for.body10 for.body10: ; preds = %for.body10.lr.ph, %for.inc26 %indvars.iv73 = phi i64 [ %indvars.iv71, %for.body10.lr.ph ], [ %indvars.iv.next74, %for.inc26 ] %11 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv73 %12 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %11, %12 br i1 %cmp15, label %if.then, label %for.inc26 if.then: ; preds = %for.body10 store i32 %12, ptr %arrayidx12, align 4, !tbaa !5 store i32 %11, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.body10, %if.then %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count79 br i1 %exitcond.not, label %for.cond3.loopexit, label %for.body10, !llvm.loop !15 for.cond.cleanup35: ; preds = %for.body36, %middle.block, %for.cond33.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond33.preheader ], [ %10, %middle.block ], [ %add39, %for.body36 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000, 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 %n) #4 ret i32 0 for.body36: ; preds = %for.body36.preheader90, %for.body36 %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body36 ], [ %indvars.iv81.ph, %for.body36.preheader90 ] %sum.066 = phi i32 [ %add39, %for.body36 ], [ %sum.066.ph, %for.body36.preheader90 ] %arrayidx38 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv81 %13 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %add39 = add nsw i32 %13, %sum.066 %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84 br i1 %exitcond85.not, label %for.cond.cleanup35, label %for.body36, !llvm.loop !16 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13}
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { long long int d,n,c=0; scanf("%lld",&n); if(n<2050) printf("-1\n"); else if(n==2050) printf("1\n"); else { if((n%2050)!=0) printf("-1\n"); else{ n=n/2050; long long int sum=0; while(n) { d=n%10; sum+=d; n/=10; } printf("%lld\n",sum); } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17842/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17842/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.6 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = 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 %dec28 = add nsw i32 %0, -1 store i32 %dec28, ptr %t, align 4, !tbaa !5 %tobool.not29 = icmp eq i32 %0, 0 br i1 %tobool.not29, label %while.end19, label %while.body while.body: ; preds = %entry, %if.end18 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %1 = load i64, ptr %n, align 8, !tbaa !9 %cmp = icmp slt i64 %1, 2050 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %puts23 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %if.end18 if.else: ; preds = %while.body %cmp3 = icmp eq i64 %1, 2050 br i1 %cmp3, label %if.then4, label %if.else6 if.then4: ; preds = %if.else %puts22 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end18 if.else6: ; preds = %if.else %rem = urem i64 %1, 2050 %div = udiv i64 %1, 2050 %cmp7.not = icmp eq i64 %rem, 0 br i1 %cmp7.not, label %while.body13, label %if.then8 if.then8: ; preds = %if.else6 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %if.end18 while.body13: ; preds = %if.else6, %while.body13 %sum.026 = phi i64 [ %add, %while.body13 ], [ 0, %if.else6 ] %storemerge25 = phi i64 [ %div15, %while.body13 ], [ %div, %if.else6 ] %rem14 = urem i64 %storemerge25, 10 %add = add nuw nsw i64 %sum.026, %rem14 %div15 = udiv i64 %storemerge25, 10 %tobool12.not = icmp ult i64 %storemerge25, 10 br i1 %tobool12.not, label %while.end, label %while.body13, !llvm.loop !11 while.end: ; preds = %while.body13 store i64 %div15, ptr %n, align 8, !tbaa !9 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %add) br label %if.end18 if.end18: ; preds = %if.then4, %while.end, %if.then8, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end19, label %while.body, !llvm.loop !13 while.end19: ; preds = %if.end18, %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"} !13 = distinct !{!13, !12}
#include<stdio.h> int main(void) { unsigned long int a, b, c[1000], temp; unsigned long int sum = 0; int i, j; scanf("%ld%ld", &a, &b); for (i = 0; i < a; i++) { scanf("%ld", &(c[i])); } for (i = a - 1; i > 0; i--) { for (j = 0; j < i; j++) { if (c[j] > c[j + 1]) { temp = c[j]; c[j] = c[j + 1]; c[j + 1] = temp; } } } for (i = 0; i < b; i++) { sum = sum + c[i]; } printf("%ld", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178470/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178470/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca [1000 x i64], align 16 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 8000, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %cmp63.not = icmp eq i64 %0, 0 br i1 %cmp63.not, label %for.cond33.preheader, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %1 = load i64, ptr %a, align 8, !tbaa !5 %cmp = icmp ugt i64 %1, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %2 = trunc i64 %1 to i32 %3 = add i32 %2, -1 %cmp568 = icmp sgt i32 %3, 0 br i1 %cmp568, label %for.cond8.preheader.preheader, label %for.cond33.preheader for.cond8.preheader.preheader: ; preds = %for.end %4 = zext i32 %3 to i64 br label %for.cond8.preheader for.cond4.loopexit.unr-lcssa: ; preds = %for.inc28.1, %for.cond8.preheader %.unr = phi i64 [ %.pre, %for.cond8.preheader ], [ %18, %for.inc28.1 ] %indvars.iv77.unr = phi i64 [ 0, %for.cond8.preheader ], [ %indvars.iv.next78.1, %for.inc28.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond4.loopexit, label %for.body11.epil for.body11.epil: ; preds = %for.cond4.loopexit.unr-lcssa %indvars.iv.next78.epil = add nuw nsw i64 %indvars.iv77.unr, 1 %arrayidx15.epil = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv.next78.epil %5 = load i64, ptr %arrayidx15.epil, align 8, !tbaa !5 %cmp16.epil = icmp ugt i64 %.unr, %5 br i1 %cmp16.epil, label %if.then.epil, label %for.cond4.loopexit if.then.epil: ; preds = %for.body11.epil %arrayidx13.epil = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv77.unr store i64 %5, ptr %arrayidx13.epil, align 8, !tbaa !5 store i64 %.unr, ptr %arrayidx15.epil, align 8, !tbaa !5 br label %for.cond4.loopexit for.cond4.loopexit: ; preds = %for.body11.epil, %if.then.epil, %for.cond4.loopexit.unr-lcssa %indvars.iv.next81 = add i64 %indvars.iv80, -1 %cmp5 = icmp sgt i64 %indvars.iv80, 1 br i1 %cmp5, label %for.cond8.preheader, label %for.cond33.preheader, !llvm.loop !11 for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.cond4.loopexit %indvars.iv80 = phi i64 [ %4, %for.cond8.preheader.preheader ], [ %indvars.iv.next81, %for.cond4.loopexit ] %smax = call i64 @llvm.smax.i64(i64 %indvars.iv80, i64 1) %.pre = load i64, ptr %c, align 16, !tbaa !5 %xtraiter = and i64 %smax, 1 %6 = icmp slt i64 %indvars.iv80, 2 br i1 %6, label %for.cond4.loopexit.unr-lcssa, label %for.cond8.preheader.new for.cond8.preheader.new: ; preds = %for.cond8.preheader %unroll_iter = and i64 %smax, 9223372036854775806 br label %for.body11 for.cond33.preheader: ; preds = %for.cond4.loopexit, %entry, %for.end %7 = load i64, ptr %b, align 8, !tbaa !5 %cmp3570.not = icmp eq i64 %7, 0 br i1 %cmp3570.not, label %for.end43, label %for.body37.preheader for.body37.preheader: ; preds = %for.cond33.preheader %min.iters.check = icmp ult i64 %7, 4 br i1 %min.iters.check, label %for.body37.preheader90, label %vector.ph vector.ph: ; preds = %for.body37.preheader %n.vec = and i64 %7, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi88 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %8 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %index %wide.load = load <2 x i64>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i64, ptr %8, i64 2 %wide.load89 = load <2 x i64>, ptr %9, align 16, !tbaa !5 %10 = add <2 x i64> %wide.load, %vec.phi %11 = add <2 x i64> %wide.load89, %vec.phi88 %index.next = add nuw i64 %index, 4 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %11, %10 %13 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %for.end43, label %for.body37.preheader90 for.body37.preheader90: ; preds = %for.body37.preheader, %middle.block %indvars.iv83.ph = phi i64 [ 0, %for.body37.preheader ], [ %n.vec, %middle.block ] %sum.071.ph = phi i64 [ 0, %for.body37.preheader ], [ %13, %middle.block ] br label %for.body37 for.body11: ; preds = %for.inc28.1, %for.cond8.preheader.new %14 = phi i64 [ %.pre, %for.cond8.preheader.new ], [ %18, %for.inc28.1 ] %indvars.iv77 = phi i64 [ 0, %for.cond8.preheader.new ], [ %indvars.iv.next78.1, %for.inc28.1 ] %niter = phi i64 [ 0, %for.cond8.preheader.new ], [ %niter.next.1, %for.inc28.1 ] %indvars.iv.next78 = or i64 %indvars.iv77, 1 %arrayidx15 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv.next78 %15 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %cmp16 = icmp ugt i64 %14, %15 br i1 %cmp16, label %if.then, label %for.inc28 if.then: ; preds = %for.body11 %arrayidx13 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv77 store i64 %15, ptr %arrayidx13, align 16, !tbaa !5 store i64 %14, ptr %arrayidx15, align 8, !tbaa !5 br label %for.inc28 for.inc28: ; preds = %for.body11, %if.then %16 = phi i64 [ %15, %for.body11 ], [ %14, %if.then ] %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2 %arrayidx15.1 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv.next78.1 %17 = load i64, ptr %arrayidx15.1, align 16, !tbaa !5 %cmp16.1 = icmp ugt i64 %16, %17 br i1 %cmp16.1, label %if.then.1, label %for.inc28.1 if.then.1: ; preds = %for.inc28 %arrayidx13.1 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv.next78 store i64 %17, ptr %arrayidx13.1, align 8, !tbaa !5 store i64 %16, ptr %arrayidx15.1, align 16, !tbaa !5 br label %for.inc28.1 for.inc28.1: ; preds = %if.then.1, %for.inc28 %18 = phi i64 [ %17, %for.inc28 ], [ %16, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.cond4.loopexit.unr-lcssa, label %for.body11, !llvm.loop !15 for.body37: ; preds = %for.body37.preheader90, %for.body37 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body37 ], [ %indvars.iv83.ph, %for.body37.preheader90 ] %sum.071 = phi i64 [ %add40, %for.body37 ], [ %sum.071.ph, %for.body37.preheader90 ] %arrayidx39 = getelementptr inbounds [1000 x i64], ptr %c, i64 0, i64 %indvars.iv83 %19 = load i64, ptr %arrayidx39, align 8, !tbaa !5 %add40 = add i64 %19, %sum.071 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond.not = icmp eq i64 %indvars.iv.next84, %7 br i1 %exitcond.not, label %for.end43, label %for.body37, !llvm.loop !16 for.end43: ; preds = %for.body37, %middle.block, %for.cond33.preheader %sum.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %13, %middle.block ], [ %add40, %for.body37 ] %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 8000, 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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13}
#include<stdio.h> #include<string.h> #include<math.h> #include<ctype.h> int main() { int n,k,i,j; scanf("%d %d",&n,&k); int num[n]; for(i=0;i<n;i++) { scanf("%d",&num[i]); } int swap; for(i=0;i<n;i++) { for(j=0;j<i;j++) { if(num[i]<num[j]) { swap=num[i]; num[i]=num[j]; num[j]=swap; } } } int sum=0; for(i=0;i<k;i++) { sum=sum+num[i]; } printf("%d\n",sum); return 0; } /* presented by codeRumi thanks for watching & being here,thank me later... :) */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178513/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178513/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp53 = icmp sgt i32 %3, 0 br i1 %cmp53, label %for.body, label %for.cond27.preheader for.cond2.preheader: ; preds = %for.body %cmp357 = icmp sgt i32 %4, 0 br i1 %cmp357, label %for.cond5.preheader.preheader, label %for.cond27.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %wide.trip.count71 = zext i32 %4 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc24 %indvars.iv68 = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %indvars.iv.next69, %for.inc24 ] %cmp655.not = icmp eq i64 %indvars.iv68, 0 br i1 %cmp655.not, label %for.inc24, label %for.body7.lr.ph for.body7.lr.ph: ; preds = %for.cond5.preheader %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv68 %xtraiter = and i64 %indvars.iv68, 1 %6 = icmp eq i64 %indvars.iv68, 1 br i1 %6, label %for.inc24.loopexit.unr-lcssa, label %for.body7.lr.ph.new for.body7.lr.ph.new: ; preds = %for.body7.lr.ph %unroll_iter = and i64 %indvars.iv68, 9223372036854775806 br label %for.body7 for.cond27.preheader: ; preds = %for.inc24, %entry, %for.cond2.preheader %7 = load i32, ptr %k, align 4, !tbaa !5 %cmp2859 = icmp sgt i32 %7, 0 br i1 %cmp2859, label %for.body29.preheader, label %for.end34 for.body29.preheader: ; preds = %for.cond27.preheader %wide.trip.count = zext i32 %7 to i64 %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body29.preheader81, label %vector.ph vector.ph: ; preds = %for.body29.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %8 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load80 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = add <4 x i32> %wide.load, %vec.phi %11 = add <4 x i32> %wide.load80, %vec.phi79 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end34, label %for.body29.preheader81 for.body29.preheader81: ; preds = %for.body29.preheader, %middle.block %indvars.iv73.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ] %sum.061.ph = phi i32 [ 0, %for.body29.preheader ], [ %13, %middle.block ] br label %for.body29 for.body7: ; preds = %for.inc21.1, %for.body7.lr.ph.new %indvars.iv65 = phi i64 [ 0, %for.body7.lr.ph.new ], [ %indvars.iv.next66.1, %for.inc21.1 ] %niter = phi i64 [ 0, %for.body7.lr.ph.new ], [ %niter.next.1, %for.inc21.1 ] %14 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv65 %15 = load i32, ptr %arrayidx11, align 8, !tbaa !5 %cmp12 = icmp slt i32 %14, %15 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %15, ptr %arrayidx9, align 4, !tbaa !5 store i32 %14, ptr %arrayidx11, align 8, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next66 = or i64 %indvars.iv65, 1 %16 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next66 %17 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %cmp12.1 = icmp slt i32 %16, %17 br i1 %cmp12.1, label %if.then.1, label %for.inc21.1 if.then.1: ; preds = %for.inc21 store i32 %17, ptr %arrayidx9, align 4, !tbaa !5 store i32 %16, ptr %arrayidx11.1, align 4, !tbaa !5 br label %for.inc21.1 for.inc21.1: ; preds = %if.then.1, %for.inc21 %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 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.inc24.loopexit.unr-lcssa, label %for.body7, !llvm.loop !14 for.inc24.loopexit.unr-lcssa: ; preds = %for.inc21.1, %for.body7.lr.ph %indvars.iv65.unr = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next66.1, %for.inc21.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc24, label %for.body7.epil for.body7.epil: ; preds = %for.inc24.loopexit.unr-lcssa %18 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv65.unr %19 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5 %cmp12.epil = icmp slt i32 %18, %19 br i1 %cmp12.epil, label %if.then.epil, label %for.inc24 if.then.epil: ; preds = %for.body7.epil store i32 %19, ptr %arrayidx9, align 4, !tbaa !5 store i32 %18, ptr %arrayidx11.epil, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit.unr-lcssa, %if.then.epil, %for.body7.epil, %for.cond5.preheader %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71 br i1 %exitcond72.not, label %for.cond27.preheader, label %for.cond5.preheader, !llvm.loop !15 for.body29: ; preds = %for.body29.preheader81, %for.body29 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body29 ], [ %indvars.iv73.ph, %for.body29.preheader81 ] %sum.061 = phi i32 [ %add, %for.body29 ], [ %sum.061.ph, %for.body29.preheader81 ] %arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv73 %20 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %add = add nsw i32 %20, %sum.061 %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %exitcond76.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count br i1 %exitcond76.not, label %for.end34, label %for.body29, !llvm.loop !16 for.end34: ; preds = %for.body29, %middle.block, %for.cond27.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %13, %middle.block ], [ %add, %for.body29 ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
#include <stdio.h> int main() { int M; scanf("%d", &M); printf("%d\n", 48 - M); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178564/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178564/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M) %0 = load i32, ptr %M, align 4, !tbaa !5 %sub = sub nsw i32 48, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %1 = load ptr, ptr @stdout, align 8, !tbaa !9 %call2 = call i32 @fflush(ptr noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #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: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <stdlib.h> #include <stdbool.h> #define MOD 1000000007 #define INFTY 2147400000 #define END printf("\n");return 0; #define QS09(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09); #define QS90(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90); #define In(a) long a;scanf("%ld",&a); #define Out(a) printf("%ld\n",a); #define MAKE_ARRAY_DATA In(how_data);long data[how_data];input_array(how_data,data); void input_array(long how_data,long *data); void output_array(long how_data,long *data); void input_array2(long first , long second , long data[][2]); void format_array(long how_data ,long *data,long what); long get_random(long min, long max); long factorial(long n); long fibonacci(long n); int qsort_09(const int *sys1 , const int *sys2); int qsort_90(const int *sys1 , const int *sys2); long sel_max(long a , long b); long sel_min(long a , long b); long array_max(long how_data,long *data); long array_min(long how_data,long *data); long array_search(long how_data,long *data,long what); long can_DP(long how_data,long *data,long how_can,bool *can); long array_sum(long how_data,long *data); long Leven_dist(char *now , char *target); long get_digit(long target); long rounding(double target); long roundingdown(double target); long roundingup(double target); long ncr(long n , long r); long npr(long n , long r); long nhr(long n , long r); int fifw(long add,long *data); long fifr(long *data); void GRAPH_input(void); void GRAPH_dfs(long now); //グローバル変数一覧 long fifo[1000]={0};//fifo[0]はデータ件数 long loop1,loop2,loop3,loop4,loop5,i_temp; long g_ans=0; //answerグローバル変数用 typedef struct{ long how_vertex; long how_edge; long edge_data[1000][2]; bool aleady_searched_vertex[500]; bool all_searched; } _GD;//GraphData _GD GRAPH={0,0,{{0}},{0},0}; char c_temp; int main(void){ In(a); printf("%ld",24+24-a); END; } void input_array(long how_data,long *data){ long loop; for(loop=0;loop<how_data;loop++){ scanf("%ld",&data[loop]); } return ; } void output_array(long how_data,long *data){ long loop; for(loop=0;loop<how_data-1;loop++){ printf("%ld ",data[loop]); } return ; } void input_array2(long first,long second,long data[][2]){ long loopA,loopB; for(loopA=0;loopA<first;loopA++){ for(loopB=0;loopB<second;loopB++){ scanf("%ld",&data[loopA][loopB]); } } return ; } void format_array(long how_data ,long *data,long what){ long loopA; for(loopA=0;loopA<how_data;loopA++){ data[loopA]=what; } return ; } long get_random(long min, long max){ //指定の範囲から乱数を1つ返すやつ //srand((unsigned int)time(0)); //現在時刻で疑似乱数初期化 rand();rand();rand();rand(); //乱数を空打ち return (rand()%(max+1-min))+min; } long factorial(long n){//n!のMOD10^9+7を返すやつ unsigned long long int ret=1; for(long i=1;i<=n;i++)ret=(ret*i)%1000000007; return (long)ret; } int qsort_09(const int *sys1 , const int *sys2){ //小さいのが上にくるやつ //qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09); if(*sys1<*sys2){ return -1; }else if(*sys1==*sys2){ return 0; }else{ return 1; } } int qsort_90(const int *sys1 , const int *sys2){ //大きいのが上にくるやつ //qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90); if(*sys1<*sys2){ return 1; }else if(*sys1==*sys2){ return 0; }else{ return -1; } } long fibonacci(long n){ switch(n){ case 0:return 0; case 1:return 1; default :return fibonacci(n-1)+fibonacci(n-2); } } long sel_max(long a,long b){ if(a>b)return a; return b; } long sel_min(long a,long b){ if(a>b)return b; return a; } long can_DP(long how_data,long *data,long how_can,bool *can){//Typical DP Contest A //data内で組み合わせられる和をcanに0 or 1で入れる //返り値はパターン数 long loopA,loopB; long ret=0; for(loopA=0;loopA<how_can;loopA++){//初期化 can[loopA]=0; } can[0]=1;//絶対にありえる for(loopA=0;loopA<how_data;loopA++){ for(loopB=how_can-1;loopB>=0;loopB--){ if(can[loopB]==1 && loopB+data[loopA]<how_can){ can[loopB+data[loopA]]=1; } } } for(loopA=0;loopA<how_can;loopA++){ if(can[loopA]==1){ ret++; } } return ret; } long array_max(long how_data,long *data){ long loop; long ret=data[0]; for(loop=0;loop<how_data;loop++){ if(ret<data[loop])ret=data[loop]; } return ret; } long array_min(long how_data,long *data){ long loop; long ret=data[0]; for(loop=0;loop<how_data;loop++){ if(ret>data[loop])ret=data[loop]; } return ret; } long array_sum(long how_data,long *data){ long ret=0; long loop; for(loop=0;loop<how_data;loop++){ ret+=data[loop]; } return ret; } long array_search(long how_data,long *data,long what){ long loop; for(loop=0;loop<how_data;loop++){ if(data[loop]==what){ return loop; } } return -1; } long Leven_dist(char *now , char *target){ long loopA,loopB; //レーベンシュタイン距離を求める // 参考文献 // http://nw.tsuda.ac.jp/class/algoB/c13.html (アルゴリズム理解) // http://d.hatena.ne.jp/ohnishiakira/20090809/1249845529 (実装) long len_now=strlen(now)+1; long len_target=strlen(target)+1; long d[len_now][len_target]; //計算用 for(loopA=0;loopA<len_now;loopA++) d[loopA][0]=loopA; for(loopA=0;loopA<len_target;loopA++) d[0][loopA]=loopA; for(loopA=1;loopA<len_now;loopA++){ for(loopB=1;loopB<len_target;loopB++){ long cost=(now[loopA-1]==target[loopB-1] ? 0:1); d[loopA][loopB]=sel_min(sel_min(d[loopA-1][loopB]+1,d[loopA][loopB-1]+1),d[loopA-1][loopB-1]+cost); } } return d[len_now-1][len_target-1]; } long get_digit(long target){ return (long)(log10(target)+1); } long ncr(long n , long r){ //パスカルの三角形 long loopA,loopB; long pascal[100][102]={{0}}; pascal[1][0]=1; pascal[1][1]=1; for(loopA=2;loopA<100;loopA++){ pascal[loopA][0]=1; for(loopB=1;loopB<loopA;loopB++){ pascal[loopA][loopB]=pascal[loopA-1][loopB-1]+pascal[loopA-1][loopB]; } pascal[loopA][loopA]=1; } return pascal[n][r]; } long npr(long n, long r){ return ncr(n,r)*factorial(r); } long nhr(long n , long r){ return ncr(n+r-1,r); } long rounding(double target){ return (long)target+0.50; } long roundingup(double target){ return (long)ceil(target); } long roundingdown(double target){ return (long)floor(target); } int fifw(long add,long *data){ data[data[0]+1]=add; data[0]++; return data[0]; //現在のデータ件数を返す } long fifr(long *data){ long ret=data[1]; data[0]--; for(int i=1;i<999;i++){ data[i]=data[i+1]; } return ret; } void GRAPH_input(void){ scanf("%ld %ld\n",&GRAPH.how_vertex,&GRAPH.how_edge); for(long loopA=0;loopA<GRAPH.how_edge;loopA++){ scanf("%ld %ld\n",&GRAPH.edge_data[loopA][0],&GRAPH.edge_data[loopA][1]); } return; } void GRAPH_dfs(long now){ GRAPH.aleady_searched_vertex[now]=1; for(int loopA=0;loopA<GRAPH.how_edge;loopA++){ if(GRAPH.edge_data[loopA][0]==now && GRAPH.aleady_searched_vertex[GRAPH.edge_data[loopA][1]]==0){ GRAPH_dfs(GRAPH.edge_data[loopA][1]); } if(GRAPH.edge_data[loopA][1]==now && GRAPH.aleady_searched_vertex[GRAPH.edge_data[loopA][0]]==0){ GRAPH_dfs(GRAPH.edge_data[loopA][0]); } } return ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178838/source.c" target datalayout = "e-m:e-p270: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._GD = type { i64, i64, [1000 x [2 x i64]], [500 x i8], i8 } @fifo = dso_local local_unnamed_addr global [1000 x i64] zeroinitializer, align 16 @g_ans = dso_local local_unnamed_addr global i64 0, align 8 @GRAPH = dso_local global %struct._GD zeroinitializer, align 8 @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld \00", align 1 @.str.3 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1 @loop1 = dso_local local_unnamed_addr global i64 0, align 8 @loop2 = dso_local local_unnamed_addr global i64 0, align 8 @loop3 = dso_local local_unnamed_addr global i64 0, align 8 @loop4 = dso_local local_unnamed_addr global i64 0, align 8 @loop5 = dso_local local_unnamed_addr global i64 0, align 8 @i_temp = dso_local local_unnamed_addr global i64 0, align 8 @c_temp = dso_local local_unnamed_addr global i8 0, align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #26 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i64, ptr %a, align 8, !tbaa !5 %sub = sub nsw i64 48, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sub) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #26 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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 uwtable define dso_local void @input_array(i64 noundef %how_data, ptr noundef %data) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i64 %how_data, 0 br i1 %cmp3, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %loop.04 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %inc = add nuw nsw i64 %loop.04, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @output_array(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i64 %how_data, 1 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = add i64 %how_data, -2 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %loop.04 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ] %arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04 %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %1) %inc = add nuw nsw i64 %loop.04, 1 %exitcond.not = icmp eq i64 %loop.04, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @input_array2(i64 noundef %first, i64 noundef %second, ptr noundef %data) local_unnamed_addr #0 { entry: %cmp14 = icmp sgt i64 %first, 0 %cmp212 = icmp sgt i64 %second, 0 %or.cond = and i1 %cmp14, %cmp212 br i1 %or.cond, label %for.cond1.preheader.us, label %for.end7 for.cond1.preheader.us: ; preds = %entry, %for.cond1.for.inc5_crit_edge.us %loopA.015.us = phi i64 [ %inc6.us, %for.cond1.for.inc5_crit_edge.us ], [ 0, %entry ] br label %for.body3.us for.body3.us: ; preds = %for.cond1.preheader.us, %for.body3.us %loopB.013.us = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.body3.us ] %arrayidx4.us = getelementptr inbounds [2 x i64], ptr %data, i64 %loopA.015.us, i64 %loopB.013.us %call.us = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx4.us) %inc.us = add nuw nsw i64 %loopB.013.us, 1 %exitcond.not = icmp eq i64 %inc.us, %second br i1 %exitcond.not, label %for.cond1.for.inc5_crit_edge.us, label %for.body3.us, !llvm.loop !12 for.cond1.for.inc5_crit_edge.us: ; preds = %for.body3.us %inc6.us = add nuw nsw i64 %loopA.015.us, 1 %exitcond17.not = icmp eq i64 %inc6.us, %first br i1 %exitcond17.not, label %for.end7, label %for.cond1.preheader.us, !llvm.loop !13 for.end7: ; preds = %for.cond1.for.inc5_crit_edge.us, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable define dso_local void @format_array(i64 noundef %how_data, ptr nocapture noundef writeonly %data, i64 noundef %what) local_unnamed_addr #3 { entry: %cmp3 = icmp sgt i64 %how_data, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %how_data, 4 br i1 %min.iters.check, label %for.body.preheader5, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %how_data, -4 %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %what, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %0 = getelementptr inbounds i64, ptr %data, i64 %index store <2 x i64> %broadcast.splat, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 store <2 x i64> %broadcast.splat, ptr %1, align 8, !tbaa !5 %index.next = add nuw i64 %index, 4 %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %how_data br i1 %cmp.n, label %for.end, label %for.body.preheader5 for.body.preheader5: ; preds = %for.body.preheader, %middle.block %loopA.04.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader5, %for.body %loopA.04 = phi i64 [ %inc, %for.body ], [ %loopA.04.ph, %for.body.preheader5 ] %arrayidx = getelementptr inbounds i64, ptr %data, i64 %loopA.04 store i64 %what, ptr %arrayidx, align 8, !tbaa !5 %inc = add nuw nsw i64 %loopA.04, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17 for.end: ; preds = %for.body, %middle.block, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @get_random(i64 noundef %min, i64 noundef %max) local_unnamed_addr #4 { entry: %call = tail call i32 @rand() #26 %call1 = tail call i32 @rand() #26 %call2 = tail call i32 @rand() #26 %call3 = tail call i32 @rand() #26 %call4 = tail call i32 @rand() #26 %conv = sext i32 %call4 to i64 %reass.sub = sub i64 %max, %min %sub = add i64 %reass.sub, 1 %rem = srem i64 %conv, %sub %add5 = add nsw i64 %rem, %min ret i64 %add5 } ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #5 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @factorial(i64 noundef %n) local_unnamed_addr #6 { entry: %cmp.not4 = icmp slt i64 %n, 1 br i1 %cmp.not4, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %n, 3 %0 = icmp ult i64 %n, 4 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 %n, -4 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ] %i.06.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ] %ret.05.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %i.06.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.06.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %ret.05.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %ret.05.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul i64 %i.06.epil, %ret.05.epil %rem.epil = urem i64 %mul.epil, 1000000007 %inc.epil = add nuw i64 %i.06.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.cleanup, label %for.body.epil, !llvm.loop !18 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %ret.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ] ret i64 %ret.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %i.06 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ] %ret.05 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %mul = mul i64 %i.06, %ret.05 %rem = urem i64 %mul, 1000000007 %inc = add nuw nsw i64 %i.06, 1 %mul.1 = mul i64 %inc, %rem %rem.1 = urem i64 %mul.1, 1000000007 %inc.1 = add nuw nsw i64 %i.06, 2 %mul.2 = mul i64 %inc.1, %rem.1 %rem.2 = urem i64 %mul.2, 1000000007 %inc.2 = add nuw i64 %i.06, 3 %mul.3 = mul i64 %inc.2, %rem.2 %rem.3 = urem i64 %mul.3, 1000000007 %inc.3 = add nuw i64 %i.06, 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.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !20 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @qsort_09(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #7 { entry: %0 = load i32, ptr %sys1, align 4, !tbaa !21 %1 = load i32, ptr %sys2, align 4, !tbaa !21 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @qsort_90(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #7 { entry: %0 = load i32, ptr %sys1, align 4, !tbaa !21 %1 = load i32, ptr %sys2, align 4, !tbaa !21 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @fibonacci(i64 noundef %n) local_unnamed_addr #8 { entry: %switch13 = icmp ult i64 %n, 2 br i1 %switch13, label %return, label %sw.default sw.default: ; preds = %entry, %sw.default %n.tr15 = phi i64 [ %sub2, %sw.default ], [ %n, %entry ] %accumulator.tr14 = phi i64 [ %add, %sw.default ], [ 0, %entry ] %sub = add nsw i64 %n.tr15, -1 %call = tail call i64 @fibonacci(i64 noundef %sub) %sub2 = add nsw i64 %n.tr15, -2 %add = add nsw i64 %call, %accumulator.tr14 %switch = icmp ult i64 %sub2, 2 br i1 %switch, label %return, label %sw.default return: ; preds = %sw.default, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %sw.default ] %n.tr.lcssa = phi i64 [ %n, %entry ], [ %sub2, %sw.default ] %accumulator.ret.tr = add nsw i64 %n.tr.lcssa, %accumulator.tr.lcssa ret i64 %accumulator.ret.tr } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sel_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #9 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sel_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #9 { entry: %b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %b.a } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local i64 @can_DP(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %how_can, ptr nocapture noundef %can) local_unnamed_addr #10 { entry: %cmp59 = icmp sgt i64 %how_can, 0 br i1 %cmp59, label %for.end, label %for.end.thread for.end: ; preds = %entry tail call void @llvm.memset.p0.i64(ptr align 1 %can, i8 0, i64 %how_can, i1 false), !tbaa !23 store i8 1, ptr %can, align 1, !tbaa !23 %cmp364 = icmp sgt i64 %how_data, 0 br i1 %cmp364, label %for.cond5.preheader.us.preheader, label %for.cond22.preheader for.cond5.preheader.us.preheader: ; preds = %for.end %xtraiter = and i64 %how_can, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %loopB.063.us.prol = add nsw i64 %how_can, -1 %arrayidx8.us.prol = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.prol %0 = icmp eq i64 %how_can, 1 br label %for.cond5.preheader.us for.end.thread: ; preds = %entry store i8 1, ptr %can, align 1, !tbaa !23 br label %for.end36 for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc19_crit_edge.us %loopA.165.us = phi i64 [ %inc20.us, %for.cond5.for.inc19_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] %arrayidx11.us = getelementptr inbounds i64, ptr %data, i64 %loopA.165.us br i1 %lcmp.mod.not, label %for.body7.us.prol.loopexit, label %for.body7.us.prol for.body7.us.prol: ; preds = %for.cond5.preheader.us %1 = load i8, ptr %arrayidx8.us.prol, align 1, !tbaa !23, !range !25, !noundef !26 %tobool.not.us.prol = icmp eq i8 %1, 0 br i1 %tobool.not.us.prol, label %for.body7.us.prol.loopexit, label %land.lhs.true.us.prol land.lhs.true.us.prol: ; preds = %for.body7.us.prol %2 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5 %add.us.prol = add nsw i64 %2, %loopB.063.us.prol %cmp12.us.prol = icmp slt i64 %add.us.prol, %how_can br i1 %cmp12.us.prol, label %if.then.us.prol, label %for.body7.us.prol.loopexit if.then.us.prol: ; preds = %land.lhs.true.us.prol %arrayidx16.us.prol = getelementptr inbounds i8, ptr %can, i64 %add.us.prol store i8 1, ptr %arrayidx16.us.prol, align 1, !tbaa !23 br label %for.body7.us.prol.loopexit for.body7.us.prol.loopexit: ; preds = %for.body7.us.prol, %land.lhs.true.us.prol, %if.then.us.prol, %for.cond5.preheader.us %loopB.063.us.in.unr = phi i64 [ %how_can, %for.cond5.preheader.us ], [ %loopB.063.us.prol, %if.then.us.prol ], [ %loopB.063.us.prol, %land.lhs.true.us.prol ], [ %loopB.063.us.prol, %for.body7.us.prol ] br i1 %0, label %for.cond5.for.inc19_crit_edge.us, label %for.body7.us for.body7.us: ; preds = %for.body7.us.prol.loopexit, %for.inc17.us.1 %loopB.063.us.in = phi i64 [ %loopB.063.us.1, %for.inc17.us.1 ], [ %loopB.063.us.in.unr, %for.body7.us.prol.loopexit ] %loopB.063.us = add nsw i64 %loopB.063.us.in, -1 %arrayidx8.us = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us %3 = load i8, ptr %arrayidx8.us, align 1, !tbaa !23, !range !25, !noundef !26 %tobool.not.us = icmp eq i8 %3, 0 br i1 %tobool.not.us, label %for.inc17.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body7.us %4 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5 %add.us = add nsw i64 %4, %loopB.063.us %cmp12.us = icmp slt i64 %add.us, %how_can br i1 %cmp12.us, label %if.then.us, label %for.inc17.us if.then.us: ; preds = %land.lhs.true.us %arrayidx16.us = getelementptr inbounds i8, ptr %can, i64 %add.us store i8 1, ptr %arrayidx16.us, align 1, !tbaa !23 br label %for.inc17.us for.inc17.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body7.us %loopB.063.us.1 = add nsw i64 %loopB.063.us.in, -2 %arrayidx8.us.1 = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.1 %5 = load i8, ptr %arrayidx8.us.1, align 1, !tbaa !23, !range !25, !noundef !26 %tobool.not.us.1 = icmp eq i8 %5, 0 br i1 %tobool.not.us.1, label %for.inc17.us.1, label %land.lhs.true.us.1 land.lhs.true.us.1: ; preds = %for.inc17.us %6 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5 %add.us.1 = add nsw i64 %6, %loopB.063.us.1 %cmp12.us.1 = icmp slt i64 %add.us.1, %how_can br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc17.us.1 if.then.us.1: ; preds = %land.lhs.true.us.1 %arrayidx16.us.1 = getelementptr inbounds i8, ptr %can, i64 %add.us.1 store i8 1, ptr %arrayidx16.us.1, align 1, !tbaa !23 br label %for.inc17.us.1 for.inc17.us.1: ; preds = %if.then.us.1, %land.lhs.true.us.1, %for.inc17.us %cmp6.us.1 = icmp sgt i64 %loopB.063.us.in, 2 br i1 %cmp6.us.1, label %for.body7.us, label %for.cond5.for.inc19_crit_edge.us, !llvm.loop !27 for.cond5.for.inc19_crit_edge.us: ; preds = %for.inc17.us.1, %for.body7.us.prol.loopexit %inc20.us = add nuw nsw i64 %loopA.165.us, 1 %exitcond.not = icmp eq i64 %inc20.us, %how_data br i1 %exitcond.not, label %for.cond22.preheader, label %for.cond5.preheader.us, !llvm.loop !28 for.cond22.preheader: ; preds = %for.cond5.for.inc19_crit_edge.us, %for.end br i1 %cmp59, label %for.body25.preheader, label %for.end36 for.body25.preheader: ; preds = %for.cond22.preheader %xtraiter72 = and i64 %how_can, 7 %7 = icmp ult i64 %how_can, 8 br i1 %7, label %for.end36.loopexit.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter = and i64 %how_can, -8 br label %for.body25 for.body25: ; preds = %for.body25, %for.body25.preheader.new %ret.068 = phi i64 [ 0, %for.body25.preheader.new ], [ %spec.select.7, %for.body25 ] %loopA.267 = phi i64 [ 0, %for.body25.preheader.new ], [ %inc35.7, %for.body25 ] %niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.7, %for.body25 ] %arrayidx26 = getelementptr inbounds i8, ptr %can, i64 %loopA.267 %8 = load i8, ptr %arrayidx26, align 1, !tbaa !23, !range !25, !noundef !26 %inc32 = zext i8 %8 to i64 %spec.select = add nuw nsw i64 %ret.068, %inc32 %inc35 = or i64 %loopA.267, 1 %arrayidx26.1 = getelementptr inbounds i8, ptr %can, i64 %inc35 %9 = load i8, ptr %arrayidx26.1, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.1 = zext i8 %9 to i64 %spec.select.1 = add nuw nsw i64 %spec.select, %inc32.1 %inc35.1 = or i64 %loopA.267, 2 %arrayidx26.2 = getelementptr inbounds i8, ptr %can, i64 %inc35.1 %10 = load i8, ptr %arrayidx26.2, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.2 = zext i8 %10 to i64 %spec.select.2 = add nuw nsw i64 %spec.select.1, %inc32.2 %inc35.2 = or i64 %loopA.267, 3 %arrayidx26.3 = getelementptr inbounds i8, ptr %can, i64 %inc35.2 %11 = load i8, ptr %arrayidx26.3, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.3 = zext i8 %11 to i64 %spec.select.3 = add nuw nsw i64 %spec.select.2, %inc32.3 %inc35.3 = or i64 %loopA.267, 4 %arrayidx26.4 = getelementptr inbounds i8, ptr %can, i64 %inc35.3 %12 = load i8, ptr %arrayidx26.4, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.4 = zext i8 %12 to i64 %spec.select.4 = add nuw nsw i64 %spec.select.3, %inc32.4 %inc35.4 = or i64 %loopA.267, 5 %arrayidx26.5 = getelementptr inbounds i8, ptr %can, i64 %inc35.4 %13 = load i8, ptr %arrayidx26.5, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.5 = zext i8 %13 to i64 %spec.select.5 = add nuw nsw i64 %spec.select.4, %inc32.5 %inc35.5 = or i64 %loopA.267, 6 %arrayidx26.6 = getelementptr inbounds i8, ptr %can, i64 %inc35.5 %14 = load i8, ptr %arrayidx26.6, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.6 = zext i8 %14 to i64 %spec.select.6 = add nuw nsw i64 %spec.select.5, %inc32.6 %inc35.6 = or i64 %loopA.267, 7 %arrayidx26.7 = getelementptr inbounds i8, ptr %can, i64 %inc35.6 %15 = load i8, ptr %arrayidx26.7, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.7 = zext i8 %15 to i64 %spec.select.7 = add nuw nsw i64 %spec.select.6, %inc32.7 %inc35.7 = add nuw nsw i64 %loopA.267, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end36.loopexit.unr-lcssa, label %for.body25, !llvm.loop !29 for.end36.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader %spec.select.lcssa.ph = phi i64 [ undef, %for.body25.preheader ], [ %spec.select.7, %for.body25 ] %ret.068.unr = phi i64 [ 0, %for.body25.preheader ], [ %spec.select.7, %for.body25 ] %loopA.267.unr = phi i64 [ 0, %for.body25.preheader ], [ %inc35.7, %for.body25 ] %lcmp.mod73.not = icmp eq i64 %xtraiter72, 0 br i1 %lcmp.mod73.not, label %for.end36, label %for.body25.epil for.body25.epil: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil %ret.068.epil = phi i64 [ %spec.select.epil, %for.body25.epil ], [ %ret.068.unr, %for.end36.loopexit.unr-lcssa ] %loopA.267.epil = phi i64 [ %inc35.epil, %for.body25.epil ], [ %loopA.267.unr, %for.end36.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end36.loopexit.unr-lcssa ] %arrayidx26.epil = getelementptr inbounds i8, ptr %can, i64 %loopA.267.epil %16 = load i8, ptr %arrayidx26.epil, align 1, !tbaa !23, !range !25, !noundef !26 %inc32.epil = zext i8 %16 to i64 %spec.select.epil = add nuw nsw i64 %ret.068.epil, %inc32.epil %inc35.epil = add nuw nsw i64 %loopA.267.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter72 br i1 %epil.iter.cmp.not, label %for.end36, label %for.body25.epil, !llvm.loop !30 for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil, %for.end.thread, %for.cond22.preheader %ret.0.lcssa = phi i64 [ 0, %for.cond22.preheader ], [ 0, %for.end.thread ], [ %spec.select.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body25.epil ] ret i64 %ret.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @array_max(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #11 { entry: %0 = load i64, ptr %data, align 8, !tbaa !5 %cmp10 = icmp sgt i64 %how_data, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %how_data, 4 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %how_data, -4 %minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0 %minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ] %vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds i64, ptr %data, i64 %index %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %4 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14) %index.next = add nuw i64 %index, 4 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !31 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %3, <2 x i64> %4) %6 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %how_data br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ] %loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ] %loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ] %arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011 %7 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %spec.select = tail call i64 @llvm.smax.i64(i64 %ret.012, i64 %7) %inc = add nuw nsw i64 %loop.011, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !32 for.end: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ] ret i64 %ret.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @array_min(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #11 { entry: %0 = load i64, ptr %data, align 8, !tbaa !5 %cmp10 = icmp sgt i64 %how_data, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %how_data, 4 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %how_data, -4 %minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0 %minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ] %vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds i64, ptr %data, i64 %index %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %4 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14) %index.next = add nuw i64 %index, 4 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %3, <2 x i64> %4) %6 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %how_data br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ] %loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ] %loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ] %arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011 %7 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %spec.select = tail call i64 @llvm.smin.i64(i64 %ret.012, i64 %7) %inc = add nuw nsw i64 %loop.011, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !34 for.end: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ] ret i64 %ret.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @array_sum(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #12 { entry: %cmp4 = icmp sgt i64 %how_data, 0 br i1 %cmp4, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %how_data, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %how_data, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %data, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = add <2 x i64> %wide.load, %vec.phi %3 = add <2 x i64> %wide.load8, %vec.phi7 %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !35 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %3, %2 %5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %how_data br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %loop.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %ret.05.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %loop.06 = phi i64 [ %inc, %for.body ], [ %loop.06.ph, %for.body.preheader9 ] %ret.05 = phi i64 [ %add, %for.body ], [ %ret.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %add = add nsw i64 %6, %ret.05 %inc = add nuw nsw i64 %loop.06, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !36 for.end: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ] ret i64 %ret.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @array_search(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %what) local_unnamed_addr #12 { entry: %cmp5 = icmp sgt i64 %how_data, 0 br i1 %cmp5, label %for.body, label %cleanup for.body: ; preds = %entry, %for.inc %loop.06 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06 %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp1 = icmp eq i64 %0, %what br i1 %cmp1, label %cleanup, label %for.inc for.inc: ; preds = %for.body %inc = add nuw nsw i64 %loop.06, 1 %exitcond.not = icmp eq i64 %inc, %how_data br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !37 cleanup: ; preds = %for.body, %for.inc, %entry %retval.0 = phi i64 [ -1, %entry ], [ -1, %for.inc ], [ %loop.06, %for.body ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @Leven_dist(ptr nocapture noundef readonly %now, ptr nocapture noundef readonly %target) local_unnamed_addr #13 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %now) #27 %add = add i64 %call, 1 %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %target) #27 %add2 = add i64 %call1, 1 %0 = mul nuw i64 %add2, %add %vla = alloca i64, i64 %0, align 16 %cmp81 = icmp ult i64 %call, 9223372036854775807 br i1 %cmp81, label %for.body.preheader, label %for.cond4.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %add, 3 %1 = icmp ult i64 %call, 3 br i1 %1, label %for.cond4.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %add, -4 br label %for.body for.cond4.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %loopA.082.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond4.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil %loopA.082.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %loopA.082.unr, %for.cond4.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond4.preheader.loopexit.unr-lcssa ] %2 = mul nsw i64 %loopA.082.epil, %add2 %arrayidx.epil = getelementptr inbounds i64, ptr %vla, i64 %2 store i64 %loopA.082.epil, ptr %arrayidx.epil, align 8, !tbaa !5 %inc.epil = add nuw nsw i64 %loopA.082.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.cond4.preheader, label %for.body.epil, !llvm.loop !38 for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil, %entry %cmp583 = icmp ult i64 %call1, 9223372036854775807 br i1 %cmp583, label %for.body6.preheader, label %for.cond12.preheader for.body6.preheader: ; preds = %for.cond4.preheader %min.iters.check = icmp ult i64 %add2, 4 br i1 %min.iters.check, label %for.body6.preheader95, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i64 %add2, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %3 = getelementptr inbounds i64, ptr %vla, i64 %index store <2 x i64> %vec.ind, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i64, ptr %3, i64 2 store <2 x i64> %step.add, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !39 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %add2, %n.vec br i1 %cmp.n, label %for.cond12.preheader, label %for.body6.preheader95 for.body6.preheader95: ; preds = %for.body6.preheader, %middle.block %loopA.184.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ] br label %for.body6 for.body: ; preds = %for.body, %for.body.preheader.new %loopA.082 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %6 = mul nsw i64 %loopA.082, %add2 %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %6 store i64 %loopA.082, ptr %arrayidx, align 16, !tbaa !5 %inc = or i64 %loopA.082, 1 %7 = mul nsw i64 %inc, %add2 %arrayidx.1 = getelementptr inbounds i64, ptr %vla, i64 %7 store i64 %inc, ptr %arrayidx.1, align 8, !tbaa !5 %inc.1 = or i64 %loopA.082, 2 %8 = mul nsw i64 %inc.1, %add2 %arrayidx.2 = getelementptr inbounds i64, ptr %vla, i64 %8 store i64 %inc.1, ptr %arrayidx.2, align 16, !tbaa !5 %inc.2 = or i64 %loopA.082, 3 %9 = mul nsw i64 %inc.2, %add2 %arrayidx.3 = getelementptr inbounds i64, ptr %vla, i64 %9 store i64 %inc.2, ptr %arrayidx.3, align 8, !tbaa !5 %inc.3 = add nuw nsw i64 %loopA.082, 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.cond4.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !40 for.cond12.preheader: ; preds = %for.body6, %middle.block, %for.cond4.preheader %cmp1387 = icmp sgt i64 %add, 1 %cmp1685 = icmp sgt i64 %add2, 1 %or.cond = select i1 %cmp1387, i1 %cmp1685, i1 false br i1 %or.cond, label %for.cond15.preheader.us, label %for.end47 for.cond15.preheader.us: ; preds = %for.cond12.preheader, %for.cond15.for.inc45_crit_edge.us %loopA.288.us = phi i64 [ %inc46.us, %for.cond15.for.inc45_crit_edge.us ], [ 1, %for.cond12.preheader ] %sub.us = add nsw i64 %loopA.288.us, -1 %arrayidx18.us = getelementptr inbounds i8, ptr %now, i64 %sub.us %10 = load i8, ptr %arrayidx18.us, align 1, !tbaa !41 %11 = mul nsw i64 %sub.us, %add2 %arrayidx26.us = getelementptr inbounds i64, ptr %vla, i64 %11 %12 = mul nsw i64 %loopA.288.us, %add2 %arrayidx29.us = getelementptr inbounds i64, ptr %vla, i64 %12 %.pre = load i64, ptr %arrayidx29.us, align 8, !tbaa !5 br label %for.body17.us for.body17.us: ; preds = %for.cond15.preheader.us, %for.body17.us %13 = phi i64 [ %.pre, %for.cond15.preheader.us ], [ %b.a.i80.us, %for.body17.us ] %loopB.086.us = phi i64 [ 1, %for.cond15.preheader.us ], [ %inc43.us, %for.body17.us ] %sub19.us = add nsw i64 %loopB.086.us, -1 %arrayidx20.us = getelementptr inbounds i8, ptr %target, i64 %sub19.us %14 = load i8, ptr %arrayidx20.us, align 1, !tbaa !41 %cmp22.us = icmp ne i8 %10, %14 %conv24.us = zext i1 %cmp22.us to i64 %arrayidx27.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %loopB.086.us %15 = load i64, ptr %arrayidx27.us, align 8, !tbaa !5 %add28.us = add nsw i64 %15, 1 %add32.us = add nsw i64 %13, 1 %b.a.i.us = tail call i64 @llvm.smin.i64(i64 %add28.us, i64 %add32.us) %arrayidx37.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %sub19.us %16 = load i64, ptr %arrayidx37.us, align 8, !tbaa !5 %add38.us = add nsw i64 %16, %conv24.us %b.a.i80.us = tail call i64 @llvm.smin.i64(i64 %b.a.i.us, i64 %add38.us) %arrayidx41.us = getelementptr inbounds i64, ptr %arrayidx29.us, i64 %loopB.086.us store i64 %b.a.i80.us, ptr %arrayidx41.us, align 8, !tbaa !5 %inc43.us = add nuw nsw i64 %loopB.086.us, 1 %exitcond92.not = icmp eq i64 %loopB.086.us, %call1 br i1 %exitcond92.not, label %for.cond15.for.inc45_crit_edge.us, label %for.body17.us, !llvm.loop !42 for.cond15.for.inc45_crit_edge.us: ; preds = %for.body17.us %inc46.us = add nuw nsw i64 %loopA.288.us, 1 %exitcond93.not = icmp eq i64 %loopA.288.us, %call br i1 %exitcond93.not, label %for.end47, label %for.cond15.preheader.us, !llvm.loop !43 for.body6: ; preds = %for.body6.preheader95, %for.body6 %loopA.184 = phi i64 [ %inc10, %for.body6 ], [ %loopA.184.ph, %for.body6.preheader95 ] %arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %loopA.184 store i64 %loopA.184, ptr %arrayidx8, align 8, !tbaa !5 %inc10 = add nuw nsw i64 %loopA.184, 1 %exitcond91.not = icmp eq i64 %loopA.184, %call1 br i1 %exitcond91.not, label %for.cond12.preheader, label %for.body6, !llvm.loop !44 for.end47: ; preds = %for.cond15.for.inc45_crit_edge.us, %for.cond12.preheader %17 = mul nsw i64 %add2, %call %arrayidx49 = getelementptr inbounds i64, ptr %vla, i64 %17 %arrayidx51 = getelementptr inbounds i64, ptr %arrayidx49, i64 %call1 %18 = load i64, ptr %arrayidx51, align 8, !tbaa !5 ret i64 %18 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #14 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable define dso_local i64 @get_digit(i64 noundef %target) local_unnamed_addr #15 { entry: %conv = sitofp i64 %target to double %call = tail call double @log10(double noundef %conv) #26 %add = fadd double %call, 1.000000e+00 %conv1 = fptosi double %add to i64 ret i64 %conv1 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @log10(double noundef) local_unnamed_addr #16 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #8 { entry: %pascal = alloca [100 x [102 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal) #26 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal, i8 0, i64 81600, i1 false) %arrayidx = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1 store i64 1, ptr %arrayidx, align 16, !tbaa !5 %arrayidx3 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1, i64 1 store i64 1, ptr %arrayidx3, align 8, !tbaa !5 br label %for.body for.body: ; preds = %entry, %for.end %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.end ] %loopA.037 = phi i64 [ 2, %entry ], [ %inc20, %for.end ] %0 = add i64 %indvar, 1 %arrayidx4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037 store i64 1, ptr %arrayidx4, align 16, !tbaa !5 %sub = add nsw i64 %loopA.037, -1 %arrayidx11.phi.trans.insert = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 0 %.pre = load i64, ptr %arrayidx11.phi.trans.insert, align 16, !tbaa !5 %min.iters.check = icmp ult i64 %0, 2 br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph vector.ph: ; preds = %for.body %n.vec = and i64 %0, -2 %ind.end = or i64 %0, 1 %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2> %3 = add nsw <2 x i64> %wide.load, %2 %4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %offset.idx store <2 x i64> %3, ptr %4, align 8, !tbaa !5 %index.next = add nuw i64 %index, 2 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !45 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %0, %n.vec %vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1 br i1 %cmp.n, label %for.end, label %for.body8.preheader for.body8.preheader: ; preds = %for.body, %middle.block %scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body ] %loopB.036.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body ] br label %for.body8 for.body8: ; preds = %for.body8.preheader, %for.body8 %scalar.recur = phi i64 [ %6, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ] %loopB.036 = phi i64 [ %inc, %for.body8 ], [ %loopB.036.ph, %for.body8.preheader ] %arrayidx14 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %loopB.036 %6 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %add = add nsw i64 %6, %scalar.recur %arrayidx16 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopB.036 store i64 %add, ptr %arrayidx16, align 8, !tbaa !5 %inc = add nuw nsw i64 %loopB.036, 1 %exitcond.not = icmp eq i64 %inc, %loopA.037 br i1 %exitcond.not, label %for.end, label %for.body8, !llvm.loop !46 for.end: ; preds = %for.body8, %middle.block %arrayidx18 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopA.037 store i64 1, ptr %arrayidx18, align 8, !tbaa !5 %inc20 = add nuw nsw i64 %loopA.037, 1 %exitcond38.not = icmp eq i64 %inc20, 100 %indvar.next = add i64 %indvar, 1 br i1 %exitcond38.not, label %for.end21, label %for.body, !llvm.loop !47 for.end21: ; preds = %for.end %arrayidx23 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %n, i64 %r %7 = load i64, ptr %arrayidx23, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal) #26 ret i64 %7 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #17 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @npr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #8 { entry: %pascal.i = alloca [100 x [102 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #26 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false) %arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1 store i64 1, ptr %arrayidx.i, align 16, !tbaa !5 %arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1 store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5 br label %for.body.i for.body.i: ; preds = %for.end.i, %entry %indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ] %loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ] %0 = add i64 %indvar, 1 %arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5 %sub.i = add nsw i64 %loopA.037.i, -1 %arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0 %.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5 %min.iters.check = icmp ult i64 %0, 2 br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.i %n.vec = and i64 %0, -2 %ind.end = or i64 %0, 1 %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2> %3 = add nsw <2 x i64> %wide.load, %2 %4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx store <2 x i64> %3, ptr %4, align 8, !tbaa !5 %index.next = add nuw i64 %index, 2 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !48 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %0, %n.vec %vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1 br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader for.body8.i.preheader: ; preds = %for.body.i, %middle.block %scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ] %loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ] br label %for.body8.i for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i %scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ] %loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ] %arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i %6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5 %add.i = add nsw i64 %6, %scalar.recur %arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5 %inc.i = add nuw nsw i64 %loopB.036.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !49 for.end.i: ; preds = %for.body8.i, %middle.block %arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5 %inc20.i = add nuw nsw i64 %loopA.037.i, 1 %exitcond38.not.i = icmp eq i64 %inc20.i, 100 %indvar.next = add i64 %indvar, 1 br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47 ncr.exit: ; preds = %for.end.i %arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %n, i64 %r %7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #26 %cmp.not4.i = icmp slt i64 %r, 1 br i1 %cmp.not4.i, label %factorial.exit, label %for.body.i3.preheader for.body.i3.preheader: ; preds = %ncr.exit %xtraiter = and i64 %r, 3 %8 = icmp ult i64 %r, 4 br i1 %8, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3.preheader.new for.body.i3.preheader.new: ; preds = %for.body.i3.preheader %unroll_iter = and i64 %r, -4 br label %for.body.i3 for.body.i3: ; preds = %for.body.i3, %for.body.i3.preheader.new %i.06.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %inc.i4.3, %for.body.i3 ] %ret.05.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %rem.i.3, %for.body.i3 ] %niter = phi i64 [ 0, %for.body.i3.preheader.new ], [ %niter.next.3, %for.body.i3 ] %mul.i = mul i64 %ret.05.i, %i.06.i %rem.i = urem i64 %mul.i, 1000000007 %inc.i4 = add nuw nsw i64 %i.06.i, 1 %mul.i.1 = mul i64 %rem.i, %inc.i4 %rem.i.1 = urem i64 %mul.i.1, 1000000007 %inc.i4.1 = add nuw nsw i64 %i.06.i, 2 %mul.i.2 = mul i64 %rem.i.1, %inc.i4.1 %rem.i.2 = urem i64 %mul.i.2, 1000000007 %inc.i4.2 = add nuw i64 %i.06.i, 3 %mul.i.3 = mul i64 %rem.i.2, %inc.i4.2 %rem.i.3 = urem i64 %mul.i.3, 1000000007 %inc.i4.3 = add nuw i64 %i.06.i, 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 %factorial.exit.loopexit.unr-lcssa, label %for.body.i3, !llvm.loop !20 factorial.exit.loopexit.unr-lcssa: ; preds = %for.body.i3, %for.body.i3.preheader %rem.i.lcssa.ph = phi i64 [ undef, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ] %i.06.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %inc.i4.3, %for.body.i3 ] %ret.05.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %factorial.exit, label %for.body.i3.epil for.body.i3.epil: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil %i.06.i.epil = phi i64 [ %inc.i4.epil, %for.body.i3.epil ], [ %i.06.i.unr, %factorial.exit.loopexit.unr-lcssa ] %ret.05.i.epil = phi i64 [ %rem.i.epil, %for.body.i3.epil ], [ %ret.05.i.unr, %factorial.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i3.epil ], [ 0, %factorial.exit.loopexit.unr-lcssa ] %mul.i.epil = mul i64 %ret.05.i.epil, %i.06.i.epil %rem.i.epil = urem i64 %mul.i.epil, 1000000007 %inc.i4.epil = add nuw i64 %i.06.i.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %factorial.exit, label %for.body.i3.epil, !llvm.loop !50 factorial.exit: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil, %ncr.exit %ret.0.lcssa.i = phi i64 [ 1, %ncr.exit ], [ %rem.i.lcssa.ph, %factorial.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i3.epil ] %mul = mul nsw i64 %ret.0.lcssa.i, %7 ret i64 %mul } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @nhr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #8 { entry: %pascal.i = alloca [100 x [102 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #26 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false) %arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1 store i64 1, ptr %arrayidx.i, align 16, !tbaa !5 %arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1 store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5 br label %for.body.i for.body.i: ; preds = %for.end.i, %entry %indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ] %loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ] %0 = add i64 %indvar, 1 %arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5 %sub.i = add nsw i64 %loopA.037.i, -1 %arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0 %.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5 %min.iters.check = icmp ult i64 %0, 2 br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.i %n.vec = and i64 %0, -2 %ind.end = or i64 %0, 1 %vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2> %3 = add nsw <2 x i64> %wide.load, %2 %4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx store <2 x i64> %3, ptr %4, align 8, !tbaa !5 %index.next = add nuw i64 %index, 2 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !51 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %0, %n.vec %vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1 br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader for.body8.i.preheader: ; preds = %for.body.i, %middle.block %scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ] %loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ] br label %for.body8.i for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i %scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ] %loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ] %arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i %6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5 %add.i = add nsw i64 %6, %scalar.recur %arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5 %inc.i = add nuw nsw i64 %loopB.036.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !52 for.end.i: ; preds = %for.body8.i, %middle.block %arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5 %inc20.i = add nuw nsw i64 %loopA.037.i, 1 %exitcond38.not.i = icmp eq i64 %inc20.i, 100 %indvar.next = add i64 %indvar, 1 br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !47 ncr.exit: ; preds = %for.end.i %add = add i64 %n, -1 %sub = add i64 %add, %r %arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub, i64 %r %7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #26 ret i64 %7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @rounding(double noundef %target) local_unnamed_addr #18 { entry: %conv = fptosi double %target to i64 %conv1 = sitofp i64 %conv to double %add = fadd double %conv1, 5.000000e-01 %conv2 = fptosi double %add to i64 ret i64 %conv2 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @roundingup(double noundef %target) local_unnamed_addr #9 { entry: %0 = tail call double @llvm.ceil.f64(double %target) %conv = fptosi double %0 to i64 ret i64 %conv } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #19 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @roundingdown(double noundef %target) local_unnamed_addr #9 { entry: %0 = tail call double @llvm.floor.f64(double %target) %conv = fptosi double %0 to i64 ret i64 %conv } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.floor.f64(double) #19 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @fifw(i64 noundef %add, ptr nocapture noundef %data) local_unnamed_addr #20 { entry: %0 = load i64, ptr %data, align 8, !tbaa !5 %1 = getelementptr i64, ptr %data, i64 %0 %arrayidx2 = getelementptr i64, ptr %1, i64 1 store i64 %add, ptr %arrayidx2, align 8, !tbaa !5 %2 = load i64, ptr %data, align 8, !tbaa !5 %inc = add nsw i64 %2, 1 store i64 %inc, ptr %data, align 8, !tbaa !5 %conv = trunc i64 %inc to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i64 @fifr(ptr nocapture noundef %data) local_unnamed_addr #21 { entry: %arrayidx = getelementptr i64, ptr %data, i64 1 %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %1 = load i64, ptr %data, align 8, !tbaa !5 %dec = add nsw i64 %1, -1 store i64 %dec, ptr %data, align 8, !tbaa !5 %scevgep12 = getelementptr i8, ptr %data, i64 16 tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(7984) %arrayidx, ptr noundef nonnull align 8 dereferenceable(7984) %scevgep12, i64 7984, i1 false), !tbaa !5 ret i64 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @GRAPH_input() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @GRAPH, ptr noundef nonnull getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1)) %0 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !53 %cmp8 = icmp sgt i64 %0, 0 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry ret void for.body: ; preds = %entry, %for.body %loopA.09 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %loopA.09 %arrayidx3 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %loopA.09, i64 1 %call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %inc = add nuw nsw i64 %loopA.09, 1 %1 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !53 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !55 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @GRAPH_dfs(i64 noundef %now) local_unnamed_addr #22 { entry: %arrayidx = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %now store i8 1, ptr %arrayidx, align 1, !tbaa !23 %0 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !53 %cmp44 = icmp sgt i64 %0, 0 br i1 %cmp44, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.inc, %entry ret void for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx2 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv %1 = load i64, ptr %arrayidx2, align 8, !tbaa !5 %cmp4 = icmp eq i64 %1, %now br i1 %cmp4, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %for.body %arrayidx8 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv, i64 1 %2 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %arrayidx9 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %2 %3 = load i8, ptr %arrayidx9, align 1, !tbaa !23, !range !25, !noundef !26 %cmp11 = icmp eq i8 %3, 0 br i1 %cmp11, label %if.then, label %if.end if.then: ; preds = %land.lhs.true tail call void @GRAPH_dfs(i64 noundef %2) br label %if.end if.end: ; preds = %if.then, %land.lhs.true, %for.body %arrayidx18 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv, i64 1 %4 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %cmp19 = icmp eq i64 %4, %now br i1 %cmp19, label %land.lhs.true21, label %for.inc land.lhs.true21: ; preds = %if.end %5 = load i64, ptr %arrayidx2, align 8, !tbaa !5 %arrayidx25 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %5 %6 = load i8, ptr %arrayidx25, align 1, !tbaa !23, !range !25, !noundef !26 %cmp28 = icmp eq i8 %6, 0 br i1 %cmp28, label %if.then30, label %for.inc if.then30: ; preds = %land.lhs.true21 tail call void @GRAPH_dfs(i64 noundef %5) br label %for.inc for.inc: ; preds = %if.end, %land.lhs.true21, %if.then30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !53 %cmp = icmp sgt i64 %7, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !56 } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #23 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #24 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #25 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #24 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #24 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree 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 #9 = { 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 #10 = { 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 #11 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { 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 #13 = { 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 #14 = { 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 #15 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { 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 #17 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #18 = { 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 #19 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #20 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #22 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #23 = { nofree nounwind } attributes #24 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #25 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #26 = { nounwind } attributes #27 = { 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !10, !16, !15} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.unroll.disable"} !20 = distinct !{!20, !10} !21 = !{!22, !22, i64 0} !22 = !{!"int", !7, i64 0} !23 = !{!24, !24, i64 0} !24 = !{!"_Bool", !7, i64 0} !25 = !{i8 0, i8 2} !26 = !{} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10} !30 = distinct !{!30, !19} !31 = distinct !{!31, !10, !15, !16} !32 = distinct !{!32, !10, !16, !15} !33 = distinct !{!33, !10, !15, !16} !34 = distinct !{!34, !10, !16, !15} !35 = distinct !{!35, !10, !15, !16} !36 = distinct !{!36, !10, !16, !15} !37 = distinct !{!37, !10} !38 = distinct !{!38, !19} !39 = distinct !{!39, !10, !15, !16} !40 = distinct !{!40, !10} !41 = !{!7, !7, i64 0} !42 = distinct !{!42, !10} !43 = distinct !{!43, !10} !44 = distinct !{!44, !10, !16, !15} !45 = distinct !{!45, !10, !15, !16} !46 = distinct !{!46, !10, !16, !15} !47 = distinct !{!47, !10} !48 = distinct !{!48, !10, !15, !16} !49 = distinct !{!49, !10, !16, !15} !50 = distinct !{!50, !19} !51 = distinct !{!51, !10, !15, !16} !52 = distinct !{!52, !10, !16, !15} !53 = !{!54, !6, i64 8} !54 = !{!"", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 16016, !24, i64 16516} !55 = distinct !{!55, !10} !56 = distinct !{!56, !10}
#include <stdio.h> #include <string.h> #include <math.h> #define rep(i,l,n) for(i=l;i<n;i++) void print(char str[],int a,int b){ int i; rep(i,a,b+1) printf("%c",str[i]); printf("\n"); } void reverse(char str[],int a,int b){ int i; char str2[1010]; rep(i,0,b-a+1) str2[a+i]=str[b-i]; rep(i,a,b+1) str[i]=str2[i]; } void replace(char str[],int a,int b,char p[]){ int i; rep(i,0,b-a+1) str[a+i]=p[i]; } int main(void){ char str[1010],od[10],p[1010]; int q,i,a,b; scanf("%s",str); scanf("%d",&q); rep(i,0,q){ scanf("%s",od); if(strcmp(od,"print")==0){ scanf("%d %d",&a,&b); print(str,a,b); }else if(strcmp(od,"reverse")==0){ scanf("%d %d",&a,&b); reverse(str,a,b); }else if(strcmp(od,"replace")==0){ scanf("%d %d %s",&a,&b,p); replace(str,a,b,p); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178939/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178939/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1 @.str.7 = private unnamed_addr constant [8 x i8] c"replace\00", align 1 @.str.8 = private unnamed_addr constant [9 x i8] c"%d %d %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp.not5 = icmp sgt i32 %a, %b br i1 %cmp.not5, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %a to i64 %1 = add i32 %b, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv = sext i8 %2 to i32 %putchar4 = tail call i32 @putchar(i32 %conv) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @reverse(ptr nocapture noundef %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %str2 = alloca [1010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %str2) #8 %sub = sub nsw i32 %b, %a %cmp.not28 = icmp slt i32 %sub, 0 br i1 %cmp.not28, label %for.cond5.preheader, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %b to i64 %1 = sext i32 %a to i64 %2 = add i32 %b, 1 %3 = sub i32 %2, %a %wide.trip.count = zext i32 %3 to i64 %min.iters.check = icmp ult i32 %3, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check39 = icmp ult i32 %3, 32 br i1 %min.iters.check39, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = sub nsw i64 %0, %index %5 = getelementptr inbounds i8, ptr %str, i64 %4 %6 = getelementptr inbounds i8, ptr %5, i64 -15 %wide.load = load <16 x i8>, ptr %6, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %7 = getelementptr inbounds i8, ptr %5, i64 -31 %wide.load40 = load <16 x i8>, ptr %7, align 1, !tbaa !5 %reverse41 = shufflevector <16 x i8> %wide.load40, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %8 = add nsw i64 %index, %1 %9 = getelementptr inbounds [1010 x i8], ptr %str2, i64 0, i64 %8 store <16 x i8> %reverse, ptr %9, align 1, !tbaa !5 %10 = getelementptr inbounds i8, ptr %9, i64 16 store <16 x i8> %reverse41, ptr %10, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond5.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec43 = and i64 %wide.trip.count, 4294967288 %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index45 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next48, %vec.epilog.vector.body ] %12 = sub nsw i64 %0, %index45 %gep = getelementptr i8, ptr %invariant.gep, i64 %12 %wide.load46 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse47 = shufflevector <8 x i8> %wide.load46, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %13 = add nsw i64 %index45, %1 %14 = getelementptr inbounds [1010 x i8], ptr %str2, i64 0, i64 %13 store <8 x i8> %reverse47, ptr %14, align 1, !tbaa !5 %index.next48 = add nuw i64 %index45, 8 %15 = icmp eq i64 %index.next48, %n.vec43 br i1 %15, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n44 = icmp eq i64 %n.vec43, %wide.trip.count br i1 %cmp.n44, label %for.cond5.preheader, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec43, %vec.epilog.middle.block ] br label %for.body for.cond5.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %cmp7.not30 = icmp sgt i32 %a, %b br i1 %cmp7.not30, label %for.end15, label %for.body8.preheader for.body8.preheader: ; preds = %for.cond5.preheader %16 = sext i32 %a to i64 %scevgep = getelementptr i8, ptr %str, i64 %16 %scevgep35 = getelementptr i8, ptr %str2, i64 %16 %17 = zext i32 %sub to i64 %18 = add nuw nsw i64 %17, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 1 dereferenceable(1) %scevgep35, i64 %18, i1 false), !tbaa !5 br label %for.end15 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %19 = sub nsw i64 %0, %indvars.iv %arrayidx = getelementptr inbounds i8, ptr %str, i64 %19 %20 = load i8, ptr %arrayidx, align 1, !tbaa !5 %21 = add nsw i64 %indvars.iv, %1 %arrayidx4 = getelementptr inbounds [1010 x i8], ptr %str2, i64 0, i64 %21 store i8 %20, ptr %arrayidx4, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond5.preheader, label %for.body, !llvm.loop !14 for.end15: ; preds = %for.body8.preheader, %for.cond5.preheader call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %str2) #8 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @replace(ptr nocapture noundef writeonly %str, i32 noundef %a, i32 noundef %b, ptr nocapture noundef readonly %p) local_unnamed_addr #3 { entry: %p13 = ptrtoint ptr %p to i64 %str12 = ptrtoint ptr %str to i64 %cmp.not8 = icmp slt i32 %b, %a br i1 %cmp.not8, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %a to i64 %1 = add i32 %b, 1 %2 = sub i32 %1, %a %wide.trip.count = zext i32 %2 to i64 %invariant.gep = getelementptr i8, ptr %str, i64 %0 %min.iters.check = icmp ult i32 %2, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %3 = add i64 %str12, %0 %4 = sub i64 %3, %p13 %diff.check = icmp ult i64 %4, 32 br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check14 = icmp ult i32 %2, 32 br i1 %min.iters.check14, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %5 = getelementptr inbounds i8, ptr %p, i64 %index %wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !5 %6 = getelementptr inbounds i8, ptr %5, i64 16 %wide.load15 = load <16 x i8>, ptr %6, align 1, !tbaa !5 %7 = getelementptr i8, ptr %invariant.gep, i64 %index store <16 x i8> %wide.load, ptr %7, align 1, !tbaa !5 %8 = getelementptr i8, ptr %7, i64 16 store <16 x i8> %wide.load15, ptr %8, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec17 = and i64 %wide.trip.count, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index19 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next21, %vec.epilog.vector.body ] %10 = getelementptr inbounds i8, ptr %p, i64 %index19 %wide.load20 = load <8 x i8>, ptr %10, align 1, !tbaa !5 %11 = getelementptr i8, ptr %invariant.gep, i64 %index19 store <8 x i8> %wide.load20, ptr %11, align 1, !tbaa !5 %index.next21 = add nuw i64 %index19, 8 %12 = icmp eq i64 %index.next21, %n.vec17 br i1 %12, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !16 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n18 = icmp eq i64 %n.vec17, %wide.trip.count br i1 %cmp.n18, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec17, %vec.epilog.middle.block ] %13 = xor i64 %indvars.iv.ph, -1 %14 = add nsw i64 %13, %wide.trip.count %xtraiter = and i64 %wide.trip.count, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ] %arrayidx.prol = getelementptr inbounds i8, ptr %p, i64 %indvars.iv.prol %15 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %gep.prol = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.prol store i8 %15, ptr %gep.prol, align 1, !tbaa !5 %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !17 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %16 = icmp ult i64 %14, 3 br i1 %16, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %p, i64 %indvars.iv %17 = load i8, ptr %arrayidx, align 1, !tbaa !5 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv store i8 %17, ptr %gep, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %p, i64 %indvars.iv.next %18 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next store i8 %18, ptr %gep.1, align 1, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds i8, ptr %p, i64 %indvars.iv.next.1 %19 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %gep.2 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next.1 store i8 %19, ptr %gep.2, align 1, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds i8, ptr %p, i64 %indvars.iv.next.2 %20 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %gep.3 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next.2 store i8 %20, ptr %gep.3, align 1, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count br i1 %exitcond.not.3, label %for.end, label %for.body, !llvm.loop !19 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str2.i = alloca [1010 x i8], align 16 %str = alloca [1010 x i8], align 16 %od = alloca [10 x i8], align 1 %p = alloca [1010 x i8], align 16 %q = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %str) #8 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %od) #8 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %p) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !20 %cmp43 = icmp sgt i32 %0, 0 br i1 %cmp43, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %i.044 = phi i32 [ %inc, %for.inc ], [ 0, %for.body.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %od) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %od, ptr noundef nonnull dereferenceable(6) @.str.4, i64 6) %cmp6 = icmp eq i32 %bcmp, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !20 %2 = load i32, ptr %b, align 4, !tbaa !20 %cmp.not5.i = icmp sgt i32 %1, %2 br i1 %cmp.not5.i, label %print.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %if.then %3 = sext i32 %1 to i64 %4 = add i32 %2, 1 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %5 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %conv.i = sext i8 %5 to i32 %putchar4.i = call i32 @putchar(i32 %conv.i) %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %lftr.wideiv.i = trunc i64 %indvars.iv.next.i to i32 %exitcond.not.i = icmp eq i32 %4, %lftr.wideiv.i br i1 %exitcond.not.i, label %print.exit, label %for.body.i, !llvm.loop !8 print.exit: ; preds = %for.body.i, %if.then %putchar.i = call i32 @putchar(i32 10) br label %for.inc if.else: ; preds = %for.body %bcmp27 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %od, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8) %cmp11 = icmp eq i32 %bcmp27, 0 br i1 %cmp11, label %if.then12, label %if.else15 if.then12: ; preds = %if.else %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b) %6 = load i32, ptr %a, align 4, !tbaa !20 %7 = load i32, ptr %b, align 4, !tbaa !20 call void @llvm.lifetime.start.p0(i64 1010, ptr nonnull %str2.i) #8 %sub.i = sub i32 %7, %6 %cmp.not28.i = icmp slt i32 %sub.i, 0 br i1 %cmp.not28.i, label %for.cond5.preheader.i, label %iter.check iter.check: ; preds = %if.then12 %8 = sext i32 %7 to i64 %9 = sext i32 %6 to i64 %10 = add nuw i32 %sub.i, 1 %wide.trip.count.i = zext i32 %10 to i64 %min.iters.check = icmp ult i32 %sub.i, 7 br i1 %min.iters.check, label %for.body.i30.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check46 = icmp ult i32 %sub.i, 31 br i1 %min.iters.check46, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count.i, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %11 = sub nsw i64 %8, %index %12 = getelementptr inbounds i8, ptr %str, i64 %11 %13 = getelementptr inbounds i8, ptr %12, i64 -15 %wide.load = load <16 x i8>, ptr %13, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds i8, ptr %12, i64 -31 %wide.load47 = load <16 x i8>, ptr %14, align 1, !tbaa !5 %reverse48 = shufflevector <16 x i8> %wide.load47, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %15 = add nsw i64 %index, %9 %16 = getelementptr inbounds [1010 x i8], ptr %str2.i, i64 0, i64 %15 store <16 x i8> %reverse, ptr %16, align 1, !tbaa !5 %17 = getelementptr inbounds i8, ptr %16, i64 16 store <16 x i8> %reverse48, ptr %17, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.cond5.preheader.i, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count.i, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.i30.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec50 = and i64 %wide.trip.count.i, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ] %19 = sub nsw i64 %8, %index52 %gep = getelementptr i8, ptr %invariant.gep, i64 %19 %wide.load53 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse54 = shufflevector <8 x i8> %wide.load53, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %20 = add nsw i64 %index52, %9 %21 = getelementptr inbounds [1010 x i8], ptr %str2.i, i64 0, i64 %20 store <8 x i8> %reverse54, ptr %21, align 1, !tbaa !5 %index.next55 = add nuw i64 %index52, 8 %22 = icmp eq i64 %index.next55, %n.vec50 br i1 %22, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !23 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n51 = icmp eq i64 %n.vec50, %wide.trip.count.i br i1 %cmp.n51, label %for.cond5.preheader.i, label %for.body.i30.preheader for.body.i30.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i31.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ] br label %for.body.i30 for.cond5.preheader.i: ; preds = %for.body.i30, %middle.block, %vec.epilog.middle.block, %if.then12 %cmp7.not30.i = icmp sgt i32 %6, %7 br i1 %cmp7.not30.i, label %reverse.exit, label %for.body8.preheader.i for.body8.preheader.i: ; preds = %for.cond5.preheader.i %23 = sext i32 %6 to i64 %scevgep.i = getelementptr i8, ptr %str, i64 %23 %scevgep35.i = getelementptr i8, ptr %str2.i, i64 %23 %24 = zext i32 %sub.i to i64 %25 = add nuw nsw i64 %24, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep.i, ptr noundef nonnull align 1 dereferenceable(1) %scevgep35.i, i64 %25, i1 false), !tbaa !5 br label %reverse.exit for.body.i30: ; preds = %for.body.i30.preheader, %for.body.i30 %indvars.iv.i31 = phi i64 [ %indvars.iv.next.i33, %for.body.i30 ], [ %indvars.iv.i31.ph, %for.body.i30.preheader ] %26 = sub nsw i64 %8, %indvars.iv.i31 %arrayidx.i32 = getelementptr inbounds i8, ptr %str, i64 %26 %27 = load i8, ptr %arrayidx.i32, align 1, !tbaa !5 %28 = add nsw i64 %indvars.iv.i31, %9 %arrayidx4.i = getelementptr inbounds [1010 x i8], ptr %str2.i, i64 0, i64 %28 store i8 %27, ptr %arrayidx4.i, align 1, !tbaa !5 %indvars.iv.next.i33 = add nuw nsw i64 %indvars.iv.i31, 1 %exitcond.not.i34 = icmp eq i64 %indvars.iv.next.i33, %wide.trip.count.i br i1 %exitcond.not.i34, label %for.cond5.preheader.i, label %for.body.i30, !llvm.loop !24 reverse.exit: ; preds = %for.cond5.preheader.i, %for.body8.preheader.i call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %str2.i) #8 br label %for.inc if.else15: ; preds = %if.else %bcmp28 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %od, ptr noundef nonnull dereferenceable(8) @.str.7, i64 8) %cmp18 = icmp eq i32 %bcmp28, 0 br i1 %cmp18, label %if.then19, label %for.inc if.then19: ; preds = %if.else15 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %p) %29 = load i32, ptr %a, align 4, !tbaa !20 %30 = load i32, ptr %b, align 4, !tbaa !20 %cmp.not8.i = icmp slt i32 %30, %29 br i1 %cmp.not8.i, label %for.inc, label %for.body.preheader.i35 for.body.preheader.i35: ; preds = %if.then19 %31 = sext i32 %29 to i64 %reass.sub = sub i32 %30, %29 %32 = add i32 %reass.sub, 1 %wide.trip.count.i36 = zext i32 %32 to i64 %invariant.gep.i = getelementptr i8, ptr %str, i64 %31 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %invariant.gep.i, ptr nonnull align 16 %p, i64 %wide.trip.count.i36, i1 false), !tbaa !5 br label %for.inc for.inc: ; preds = %for.body.preheader.i35, %if.then19, %print.exit, %if.else15, %reverse.exit %inc = add nuw nsw i32 %i.044, 1 %33 = load i32, ptr %q, align 4, !tbaa !20 %cmp = icmp slt i32 %inc, %33 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !25 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #8 call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %p) #8 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %od) #8 call void @llvm.lifetime.end.p0(i64 1010, ptr nonnull %str) #8 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 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6 ; 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) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree 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 #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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 = { nofree nounwind willreturn memory(argmem: read) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9, !11, !12} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !9, !11, !12} !14 = distinct !{!14, !9, !12, !11} !15 = distinct !{!15, !9, !11, !12} !16 = distinct !{!16, !9, !11, !12} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"} !19 = distinct !{!19, !9, !11} !20 = !{!21, !21, i64 0} !21 = !{!"int", !6, i64 0} !22 = distinct !{!22, !9, !11, !12} !23 = distinct !{!23, !9, !11, !12} !24 = distinct !{!24, !9, !12, !11} !25 = distinct !{!25, !9}
#include<stdio.h> #include<string.h> int main(void) { int q,a,b,i,j,num; char str[1001],S[8],C[1001]; scanf("%s",str); scanf("%d",&q); for(j=0;j<1001;j++){if(str[j]=='\0'){break;}} num=j; for(i=0;i<q;i++) { for(j=0;j<1001;j++){C[j]='\0';} scanf("%s %d %d",S,&a,&b); if(!strcmp(S,"print")){ for(j=a;j<=b;j++){printf("%c",str[j]);} printf("\n"); continue; } else if(!strcmp(S,"reverse")){ for(j=a;j<=b;j++){C[j]=str[b-j+a];} for(j=a;j<=b;j++){str[j]=C[j];} continue; } else if(!strcmp(S,"replace")){ scanf("%s",C); for(j=a;j<=b;j++){str[j]=C[j-a];} continue; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_178997/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_178997/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1 @.str.7 = private unnamed_addr constant [8 x i8] c"replace\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %str = alloca [1001 x i8], align 16 %S = alloca [8 x i8], align 1 %C = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %S) #7 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %C) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp5121 = icmp sgt i32 %0, 0 br i1 %cmp5121, label %for.cond8.preheader.preheader, label %for.end84 for.cond8.preheader.preheader: ; preds = %entry %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc82 %i.0122 = phi i32 [ %inc83, %for.inc82 ], [ 0, %for.cond8.preheader.preheader ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %C, i8 0, i64 1001, i1 false), !tbaa !9 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %S, ptr noundef nonnull %a, ptr noundef nonnull %b) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %S, ptr noundef nonnull dereferenceable(6) @.str.3, i64 6) %tobool.not = icmp eq i32 %bcmp, 0 br i1 %tobool.not, label %if.then21, label %if.else if.then21: ; preds = %for.cond8.preheader %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp23.not119 = icmp sgt i32 %1, %2 br i1 %cmp23.not119, label %for.end32, label %for.body25.preheader for.body25.preheader: ; preds = %if.then21 %3 = sext i32 %1 to i64 br label %for.body25 for.body25: ; preds = %for.body25.preheader, %for.body25 %indvars.iv134 = phi i64 [ %3, %for.body25.preheader ], [ %indvars.iv.next135, %for.body25 ] %arrayidx27 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv134 %4 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %conv28 = sext i8 %4 to i32 %putchar107 = call i32 @putchar(i32 %conv28) %indvars.iv.next135 = add nsw i64 %indvars.iv134, 1 %5 = load i32, ptr %b, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp23.not.not = icmp slt i64 %indvars.iv134, %6 br i1 %cmp23.not.not, label %for.body25, label %for.end32, !llvm.loop !10 for.end32: ; preds = %for.body25, %if.then21 %putchar = call i32 @putchar(i32 10) br label %for.inc82 if.else: ; preds = %for.cond8.preheader %bcmp108 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %S, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8) %tobool36.not = icmp eq i32 %bcmp108, 0 br i1 %tobool36.not, label %if.then37, label %if.else60 if.then37: ; preds = %if.else %7 = load i32, ptr %a, align 4, !tbaa !5 %8 = load i32, ptr %b, align 4, !tbaa !5 %cmp39.not115 = icmp sgt i32 %7, %8 br i1 %cmp39.not115, label %for.inc82, label %iter.check iter.check: ; preds = %if.then37 %9 = sext i32 %7 to i64 %10 = add i32 %8, 1 %11 = sub i32 %8, %7 %12 = zext i32 %11 to i64 %13 = add nuw nsw i64 %12, 1 %min.iters.check = icmp ult i32 %11, 7 br i1 %min.iters.check, label %for.body41.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check137 = icmp ult i32 %11, 31 br i1 %min.iters.check137, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %13, 8589934560 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %14 = trunc i64 %index to i32 %offset.idx138 = add i64 %index, %9 %15 = sub i32 %8, %14 %16 = sext i32 %15 to i64 %17 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %16 %18 = getelementptr inbounds i8, ptr %17, i64 -15 %wide.load = load <16 x i8>, ptr %18, align 1, !tbaa !9 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %19 = getelementptr inbounds i8, ptr %17, i64 -31 %wide.load139 = load <16 x i8>, ptr %19, align 1, !tbaa !9 %reverse140 = shufflevector <16 x i8> %wide.load139, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %20 = getelementptr inbounds [1001 x i8], ptr %C, i64 0, i64 %offset.idx138 store <16 x i8> %reverse, ptr %20, align 1, !tbaa !9 %21 = getelementptr inbounds i8, ptr %20, i64 16 store <16 x i8> %reverse140, ptr %21, align 1, !tbaa !9 %index.next = add nuw i64 %index, 32 %22 = icmp eq i64 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %13, %n.vec br i1 %cmp.n, label %for.cond49.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end143 = add nsw i64 %n.vec, %9 %n.vec.remaining = and i64 %13, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body41.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec142 = and i64 %13, 8589934584 %ind.end = add nsw i64 %n.vec142, %9 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index145 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next150, %vec.epilog.vector.body ] %23 = trunc i64 %index145 to i32 %offset.idx147 = add i64 %index145, %9 %24 = sub i32 %8, %23 %25 = sext i32 %24 to i64 %gep = getelementptr [1001 x i8], ptr %invariant.gep, i64 0, i64 %25 %wide.load148 = load <8 x i8>, ptr %gep, align 1, !tbaa !9 %reverse149 = shufflevector <8 x i8> %wide.load148, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %26 = getelementptr inbounds [1001 x i8], ptr %C, i64 0, i64 %offset.idx147 store <8 x i8> %reverse149, ptr %26, align 1, !tbaa !9 %index.next150 = add nuw i64 %index145, 8 %27 = icmp eq i64 %index.next150, %n.vec142 br i1 %27, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n144 = icmp eq i64 %13, %n.vec142 br i1 %cmp.n144, label %for.cond49.preheader, label %for.body41.preheader for.body41.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %9, %iter.check ], [ %ind.end143, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %28 = add i32 %8, 1 %29 = trunc i64 %indvars.iv.ph to i32 %30 = sub i32 %28, %29 %xtraiter = and i32 %30, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body41.prol.loopexit, label %for.body41.prol for.body41.prol: ; preds = %for.body41.preheader %31 = trunc i64 %indvars.iv.ph to i32 %sub.prol = sub i32 %7, %31 %add.prol = add i32 %sub.prol, %8 %idxprom42.prol = sext i32 %add.prol to i64 %arrayidx43.prol = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom42.prol %32 = load i8, ptr %arrayidx43.prol, align 1, !tbaa !9 %arrayidx45.prol = getelementptr inbounds [1001 x i8], ptr %C, i64 0, i64 %indvars.iv.ph store i8 %32, ptr %arrayidx45.prol, align 1, !tbaa !9 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body41.prol.loopexit for.body41.prol.loopexit: ; preds = %for.body41.prol, %for.body41.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body41.preheader ], [ %indvars.iv.next.prol, %for.body41.prol ] %33 = icmp eq i32 %8, %29 br i1 %33, label %for.cond49.preheader, label %for.body41 for.cond49.preheader: ; preds = %for.body41.prol.loopexit, %for.body41, %vec.epilog.middle.block, %middle.block br i1 %cmp39.not115, label %for.inc82, label %for.body52.preheader for.body52.preheader: ; preds = %for.cond49.preheader %34 = sext i32 %7 to i64 %scevgep129 = getelementptr i8, ptr %str, i64 %34 %scevgep130 = getelementptr i8, ptr %C, i64 %34 %35 = sub i32 %8, %7 %36 = zext i32 %35 to i64 %37 = add nuw nsw i64 %36, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep129, ptr noundef nonnull align 1 dereferenceable(1) %scevgep130, i64 %37, i1 false), !tbaa !9 br label %for.inc82 for.body41: ; preds = %for.body41.prol.loopexit, %for.body41 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body41 ], [ %indvars.iv.unr, %for.body41.prol.loopexit ] %38 = trunc i64 %indvars.iv to i32 %sub = sub i32 %7, %38 %add = add i32 %sub, %8 %idxprom42 = sext i32 %add to i64 %arrayidx43 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom42 %39 = load i8, ptr %arrayidx43, align 1, !tbaa !9 %arrayidx45 = getelementptr inbounds [1001 x i8], ptr %C, i64 0, i64 %indvars.iv store i8 %39, ptr %arrayidx45, align 1, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %40 = trunc i64 %indvars.iv.next to i32 %sub.1 = sub i32 %7, %40 %add.1 = add i32 %sub.1, %8 %idxprom42.1 = sext i32 %add.1 to i64 %arrayidx43.1 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom42.1 %41 = load i8, ptr %arrayidx43.1, align 1, !tbaa !9 %arrayidx45.1 = getelementptr inbounds [1001 x i8], ptr %C, i64 0, i64 %indvars.iv.next store i8 %41, ptr %arrayidx45.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %10, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.cond49.preheader, label %for.body41, !llvm.loop !16 if.else60: ; preds = %if.else %bcmp109 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %S, ptr noundef nonnull dereferenceable(8) @.str.7, i64 8) %tobool63.not = icmp eq i32 %bcmp109, 0 br i1 %tobool63.not, label %if.then64, label %for.inc82 if.then64: ; preds = %if.else60 %call66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %42 = load i32, ptr %a, align 4, !tbaa !5 %43 = load i32, ptr %b, align 4, !tbaa !5 %cmp68.not113 = icmp sgt i32 %42, %43 br i1 %cmp68.not113, label %for.inc82, label %for.body70.preheader for.body70.preheader: ; preds = %if.then64 %44 = sext i32 %42 to i64 %scevgep = getelementptr i8, ptr %str, i64 %44 %45 = sub i32 %43, %42 %46 = zext i32 %45 to i64 %47 = add nuw nsw i64 %46, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %C, i64 %47, i1 false), !tbaa !9 br label %for.inc82 for.inc82: ; preds = %if.then37, %for.body70.preheader, %for.body52.preheader, %if.then64, %for.cond49.preheader, %if.else60, %for.end32 %inc83 = add nuw nsw i32 %i.0122, 1 %48 = load i32, ptr %q, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc83, %48 br i1 %cmp5, label %for.cond8.preheader, label %for.end84, !llvm.loop !17 for.end84: ; preds = %for.inc82, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %C) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %S) #7 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; 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) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !13, !14} !16 = distinct !{!16, !11, !13} !17 = distinct !{!17, !11}
#include <stdio.h> #include <string.h> int main(void){ char s[1001],com[20],p[1001],tmp; int i,j,q,a,b; scanf("%s",s); scanf("%d",&q); for(i=0;i<q;i++){ scanf("%s %d %d",com,&a,&b); if(strcmp(com,"replace")==0){ scanf("%s",p); for(j=0;j<=(b-a);j++) s[a+j]=p[j]; }else if(strcmp(com,"reverse")==0){ for(j=0;j<((b-a+1)/2);j++){ tmp=s[a+j]; s[a+j]=s[b-j]; s[b-j]=tmp; } }else if(strcmp(com,"print")==0){ for(j=0;j<b-a+1;j++) printf("%c",s[a+j]); putchar('\n'); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179053/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179053/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 %com = alloca [20 x i8], align 16 %p = alloca [1001 x i8], align 16 %q = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #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 %s) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp87 = icmp sgt i32 %0, 0 br i1 %cmp87, label %for.body, label %for.end60 for.body: ; preds = %entry, %for.inc58 %i.088 = phi i32 [ %inc59, %for.inc58 ], [ 0, %entry ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com, ptr noundef nonnull %a, ptr noundef nonnull %b) %lhsv = load i64, ptr %com, align 16 switch i64 %lhsv, label %if.else38 [ i64 28538242730059122, label %if.then i64 28555907813500274, label %for.cond18.preheader ] for.cond18.preheader: ; preds = %for.body %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %sub19 = add i32 %1, 1 %add20 = sub i32 %sub19, %2 %cmp2180 = icmp sgt i32 %add20, 1 br i1 %cmp2180, label %for.body22.preheader, label %for.inc58 for.body22.preheader: ; preds = %for.cond18.preheader %div9798 = lshr i32 %add20, 1 %3 = sext i32 %2 to i64 %4 = sext i32 %1 to i64 %wide.trip.count = zext i32 %div9798 to i64 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %div9798, 1 br i1 %5, label %for.inc58.loopexit.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = and i64 %wide.trip.count, 2147483646 br label %for.body22 if.then: ; preds = %for.body %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p) %6 = load i32, ptr %b, align 4, !tbaa !5 %7 = load i32, ptr %a, align 4, !tbaa !5 %cmp10.not82 = icmp slt i32 %6, %7 br i1 %cmp10.not82, label %for.inc58, label %for.body11.preheader for.body11.preheader: ; preds = %if.then %8 = sext i32 %7 to i64 %scevgep = getelementptr i8, ptr %s, i64 %8 %9 = add i32 %6, 1 %10 = sub i32 %9, %7 %11 = zext i32 %10 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %p, i64 %11, i1 false), !tbaa !9 br label %for.inc58 for.body22: ; preds = %for.body22, %for.body22.preheader.new %indvars.iv = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next.1, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.body22 ] %12 = add nsw i64 %indvars.iv, %3 %arrayidx25 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %12 %13 = load i8, ptr %arrayidx25, align 1, !tbaa !9 %14 = sub nsw i64 %4, %indvars.iv %arrayidx28 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %14 %15 = load i8, ptr %arrayidx28, align 1, !tbaa !9 store i8 %15, ptr %arrayidx25, align 1, !tbaa !9 store i8 %13, ptr %arrayidx28, align 1, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %16 = add nsw i64 %indvars.iv.next, %3 %arrayidx25.1 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %16 %17 = load i8, ptr %arrayidx25.1, align 1, !tbaa !9 %18 = sub nsw i64 %4, %indvars.iv.next %arrayidx28.1 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %18 %19 = load i8, ptr %arrayidx28.1, align 1, !tbaa !9 store i8 %19, ptr %arrayidx25.1, align 1, !tbaa !9 store i8 %17, ptr %arrayidx28.1, align 1, !tbaa !9 %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.inc58.loopexit.unr-lcssa, label %for.body22, !llvm.loop !10 if.else38: ; preds = %for.body %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %com, ptr noundef nonnull dereferenceable(6) @.str.5, i64 6) %cmp41 = icmp eq i32 %bcmp, 0 br i1 %cmp41, label %for.cond43.preheader, label %for.inc58 for.cond43.preheader: ; preds = %if.else38 %20 = load i32, ptr %b, align 4, !tbaa !5 %21 = load i32, ptr %a, align 4, !tbaa !5 %cmp46.not85 = icmp slt i32 %20, %21 br i1 %cmp46.not85, label %for.end54, label %for.body47 for.body47: ; preds = %for.cond43.preheader, %for.body47 %22 = phi i32 [ %26, %for.body47 ], [ %21, %for.cond43.preheader ] %j.286 = phi i32 [ %inc53, %for.body47 ], [ 0, %for.cond43.preheader ] %add48 = add nsw i32 %22, %j.286 %idxprom49 = sext i32 %add48 to i64 %arrayidx50 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom49 %23 = load i8, ptr %arrayidx50, align 1, !tbaa !9 %conv = sext i8 %23 to i32 %24 = load ptr, ptr @stdout, align 8, !tbaa !12 %call.i = call noundef i32 @putc(i32 noundef %conv, ptr noundef %24) %inc53 = add nuw nsw i32 %j.286, 1 %25 = load i32, ptr %b, align 4, !tbaa !5 %26 = load i32, ptr %a, align 4, !tbaa !5 %sub44 = sub nsw i32 %25, %26 %cmp46.not.not = icmp slt i32 %j.286, %sub44 br i1 %cmp46.not.not, label %for.body47, label %for.end54, !llvm.loop !14 for.end54: ; preds = %for.body47, %for.cond43.preheader %27 = load ptr, ptr @stdout, align 8, !tbaa !12 %call.i78 = call noundef i32 @putc(i32 noundef 10, ptr noundef %27) br label %for.inc58 for.inc58.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %indvars.iv.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next.1, %for.body22 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc58, label %for.body22.epil for.body22.epil: ; preds = %for.inc58.loopexit.unr-lcssa %28 = add nsw i64 %indvars.iv.unr, %3 %arrayidx25.epil = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %28 %29 = load i8, ptr %arrayidx25.epil, align 1, !tbaa !9 %30 = sub nsw i64 %4, %indvars.iv.unr %arrayidx28.epil = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %30 %31 = load i8, ptr %arrayidx28.epil, align 1, !tbaa !9 store i8 %31, ptr %arrayidx25.epil, align 1, !tbaa !9 store i8 %29, ptr %arrayidx28.epil, align 1, !tbaa !9 br label %for.inc58 for.inc58: ; preds = %for.body22.epil, %for.inc58.loopexit.unr-lcssa, %for.body11.preheader, %for.cond18.preheader, %if.then, %if.else38, %for.end54 %inc59 = add nuw nsw i32 %i.088, 1 %32 = load i32, ptr %q, align 4, !tbaa !5 %cmp = icmp slt i32 %inc59, %32 br i1 %cmp, label %for.body, label %for.end60, !llvm.loop !15 for.end60: ; preds = %for.inc58, %entry 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 %q) #5 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #5 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11}
#include <string.h> #include <stdio.h> void print(char str[1000], int a, int b){ int i; for(i=a; i<=b; i++){ printf("%c",str[i]); } printf("\n"); } void reverse(char str[1000], int a, int b){ int i; char copy[1000]; strcpy(copy,str); for(i=0; i<=b-a; i++){ str[a+i]=copy[b-i]; } } void replace(char str[1000],int a, int b){ int i; char p[1000]; scanf("%s",p); for(i=0; i<=b-a; i++){ str[a+i]=p[i]; } } int main(void){ char str[1000]; char order[10]; int n,i,a,b; scanf("%s",str); scanf("%d",&n); for(i=0; i<n; i++){ scanf("%s %d %d",order,&a,&b); if(strcmp(order,"print") == 0){ print(str,a,b); } else if(strcmp(order,"reverse") == 0){ reverse(str,a,b); } else if(strcmp(order,"replace") == 0){ replace(str,a,b); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179103/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1 @.str.7 = private unnamed_addr constant [8 x i8] c"replace\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp.not5 = icmp sgt i32 %a, %b br i1 %cmp.not5, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %a to i64 %1 = add i32 %b, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv = sext i8 %2 to i32 %putchar4 = tail call i32 @putchar(i32 %conv) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: readwrite) uwtable define dso_local void @reverse(ptr nocapture noundef %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %copy = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %copy) #8 %call = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %copy, ptr noundef nonnull dereferenceable(1) %str) #8 %cmp.not10 = icmp slt i32 %b, %a br i1 %cmp.not10, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %b to i64 %1 = sext i32 %a to i64 %2 = add i32 %b, 1 %3 = sub i32 %2, %a %wide.trip.count = zext i32 %3 to i64 %invariant.gep = getelementptr i8, ptr %str, i64 %1 %min.iters.check = icmp ult i32 %3, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check15 = icmp ult i32 %3, 32 br i1 %min.iters.check15, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = sub nsw i64 %0, %index %5 = getelementptr inbounds [1000 x i8], ptr %copy, i64 0, i64 %4 %6 = getelementptr inbounds i8, ptr %5, i64 -15 %wide.load = load <16 x i8>, ptr %6, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %7 = getelementptr inbounds i8, ptr %5, i64 -31 %wide.load16 = load <16 x i8>, ptr %7, align 1, !tbaa !5 %reverse17 = shufflevector <16 x i8> %wide.load16, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %8 = getelementptr i8, ptr %invariant.gep, i64 %index store <16 x i8> %reverse, ptr %8, align 1, !tbaa !5 %9 = getelementptr i8, ptr %8, i64 16 store <16 x i8> %reverse17, ptr %9, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec19 = and i64 %wide.trip.count, 4294967288 %invariant.gep25 = getelementptr i8, ptr %copy, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index21 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ] %11 = sub nsw i64 %0, %index21 %gep26 = getelementptr [1000 x i8], ptr %invariant.gep25, i64 0, i64 %11 %wide.load22 = load <8 x i8>, ptr %gep26, align 1, !tbaa !5 %reverse23 = shufflevector <8 x i8> %wide.load22, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %12 = getelementptr i8, ptr %invariant.gep, i64 %index21 store <8 x i8> %reverse23, ptr %12, align 1, !tbaa !5 %index.next24 = add nuw i64 %index21, 8 %13 = icmp eq i64 %index.next24, %n.vec19 br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n20 = icmp eq i64 %n.vec19, %wide.trip.count br i1 %cmp.n20, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec19, %vec.epilog.middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %14 = sub nsw i64 %0, %indvars.iv %arrayidx = getelementptr inbounds [1000 x i8], ptr %copy, i64 0, i64 %14 %15 = load i8, ptr %arrayidx, align 1, !tbaa !5 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv store i8 %15, ptr %gep, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %copy) #8 ret void } ; 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: nofree nounwind uwtable define dso_local void @replace(ptr nocapture noundef writeonly %str, i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %p = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %p) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %p) %cmp.not7 = icmp slt i32 %b, %a br i1 %cmp.not7, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %a to i64 %scevgep = getelementptr i8, ptr %str, i64 %0 %1 = add i32 %b, 1 %2 = sub i32 %1, %a %3 = zext i32 %2 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %p, i64 %3, i1 false), !tbaa !5 br label %for.end for.end: ; preds = %for.body.preheader, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %p) #8 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p.i = alloca [1000 x i8], align 16 %copy.i = alloca [1000 x i8], align 16 %str = alloca [1000 x i8], align 16 %order = alloca [10 x i8], align 1 %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str) #8 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %order) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !15 %cmp33 = icmp sgt i32 %0, 0 br i1 %cmp33, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i8, ptr %copy.i, i64 -7 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %i.034 = phi i32 [ %inc, %for.inc ], [ 0, %for.body.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %order, ptr noundef nonnull %a, ptr noundef nonnull %b) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %order, ptr noundef nonnull dereferenceable(6) @.str.5, i64 6) %cmp6 = icmp eq i32 %bcmp, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %1 = load i32, ptr %a, align 4, !tbaa !15 %2 = load i32, ptr %b, align 4, !tbaa !15 %cmp.not5.i = icmp sgt i32 %1, %2 br i1 %cmp.not5.i, label %print.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %if.then %3 = sext i32 %1 to i64 %4 = add i32 %2, 1 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %5 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %conv.i = sext i8 %5 to i32 %putchar4.i = call i32 @putchar(i32 %conv.i) %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %lftr.wideiv.i = trunc i64 %indvars.iv.next.i to i32 %exitcond.not.i = icmp eq i32 %4, %lftr.wideiv.i br i1 %exitcond.not.i, label %print.exit, label %for.body.i, !llvm.loop !8 print.exit: ; preds = %for.body.i, %if.then %putchar.i = call i32 @putchar(i32 10) br label %for.inc if.else: ; preds = %for.body %bcmp22 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8) %cmp10 = icmp eq i32 %bcmp22, 0 br i1 %cmp10, label %if.then11, label %if.else13 if.then11: ; preds = %if.else %6 = load i32, ptr %a, align 4, !tbaa !15 %7 = load i32, ptr %b, align 4, !tbaa !15 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %copy.i) #8 %call.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %copy.i, ptr noundef nonnull dereferenceable(1) %str) #8 %cmp.not10.i = icmp slt i32 %7, %6 br i1 %cmp.not10.i, label %reverse.exit, label %iter.check iter.check: ; preds = %if.then11 %8 = sext i32 %7 to i64 %9 = sext i32 %6 to i64 %reass.sub35 = sub i32 %7, %6 %10 = add i32 %reass.sub35, 1 %wide.trip.count.i = zext i32 %10 to i64 %invariant.gep.i = getelementptr i8, ptr %str, i64 %9 %min.iters.check = icmp ult i32 %10, 8 br i1 %min.iters.check, label %for.body.i25.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check36 = icmp ult i32 %10, 32 br i1 %min.iters.check36, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count.i, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %11 = sub nsw i64 %8, %index %12 = getelementptr inbounds [1000 x i8], ptr %copy.i, i64 0, i64 %11 %13 = getelementptr inbounds i8, ptr %12, i64 -15 %wide.load = load <16 x i8>, ptr %13, align 1, !tbaa !5 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %14 = getelementptr inbounds i8, ptr %12, i64 -31 %wide.load37 = load <16 x i8>, ptr %14, align 1, !tbaa !5 %reverse38 = shufflevector <16 x i8> %wide.load37, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %15 = getelementptr i8, ptr %invariant.gep.i, i64 %index store <16 x i8> %reverse, ptr %15, align 1, !tbaa !5 %16 = getelementptr i8, ptr %15, i64 16 store <16 x i8> %reverse38, ptr %16, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %reverse.exit, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count.i, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.i25.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec40 = and i64 %wide.trip.count.i, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index42 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next45, %vec.epilog.vector.body ] %18 = sub nsw i64 %8, %index42 %gep = getelementptr [1000 x i8], ptr %invariant.gep, i64 0, i64 %18 %wide.load43 = load <8 x i8>, ptr %gep, align 1, !tbaa !5 %reverse44 = shufflevector <8 x i8> %wide.load43, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %19 = getelementptr i8, ptr %invariant.gep.i, i64 %index42 store <8 x i8> %reverse44, ptr %19, align 1, !tbaa !5 %index.next45 = add nuw i64 %index42, 8 %20 = icmp eq i64 %index.next45, %n.vec40 br i1 %20, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !18 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n41 = icmp eq i64 %n.vec40, %wide.trip.count.i br i1 %cmp.n41, label %reverse.exit, label %for.body.i25.preheader for.body.i25.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i26.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec40, %vec.epilog.middle.block ] br label %for.body.i25 for.body.i25: ; preds = %for.body.i25.preheader, %for.body.i25 %indvars.iv.i26 = phi i64 [ %indvars.iv.next.i28, %for.body.i25 ], [ %indvars.iv.i26.ph, %for.body.i25.preheader ] %21 = sub nsw i64 %8, %indvars.iv.i26 %arrayidx.i27 = getelementptr inbounds [1000 x i8], ptr %copy.i, i64 0, i64 %21 %22 = load i8, ptr %arrayidx.i27, align 1, !tbaa !5 %gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i26 store i8 %22, ptr %gep.i, align 1, !tbaa !5 %indvars.iv.next.i28 = add nuw nsw i64 %indvars.iv.i26, 1 %exitcond.not.i29 = icmp eq i64 %indvars.iv.next.i28, %wide.trip.count.i br i1 %exitcond.not.i29, label %reverse.exit, label %for.body.i25, !llvm.loop !19 reverse.exit: ; preds = %for.body.i25, %middle.block, %vec.epilog.middle.block, %if.then11 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %copy.i) #8 br label %for.inc if.else13: ; preds = %if.else %bcmp23 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.7, i64 8) %cmp16 = icmp eq i32 %bcmp23, 0 br i1 %cmp16, label %if.then17, label %for.inc if.then17: ; preds = %if.else13 %23 = load i32, ptr %a, align 4, !tbaa !15 %24 = load i32, ptr %b, align 4, !tbaa !15 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %p.i) #8 %call.i30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %p.i) %cmp.not7.i = icmp slt i32 %24, %23 br i1 %cmp.not7.i, label %replace.exit, label %for.body.preheader.i31 for.body.preheader.i31: ; preds = %if.then17 %25 = sext i32 %23 to i64 %scevgep.i = getelementptr i8, ptr %str, i64 %25 %reass.sub = sub i32 %24, %23 %26 = add i32 %reass.sub, 1 %27 = zext i32 %26 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep.i, ptr nonnull align 16 %p.i, i64 %27, i1 false), !tbaa !5 br label %replace.exit replace.exit: ; preds = %if.then17, %for.body.preheader.i31 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %p.i) #8 br label %for.inc for.inc: ; preds = %print.exit, %if.else13, %replace.exit, %reverse.exit %inc = add nuw nsw i32 %i.034, 1 %28 = load i32, ptr %n, align 4, !tbaa !15 %cmp = icmp slt i32 %inc, %28 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %order) #8 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6 ; 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) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind 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 #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 = { nofree nounwind "no-trapping-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 = { nofree nounwind willreturn memory(argmem: read) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9, !11, !12} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !9, !11, !12} !14 = distinct !{!14, !9, !12, !11} !15 = !{!16, !16, i64 0} !16 = !{!"int", !6, i64 0} !17 = distinct !{!17, !9, !11, !12} !18 = distinct !{!18, !9, !11, !12} !19 = distinct !{!19, !9, !12, !11} !20 = distinct !{!20, !9}
#include <stdio.h> #include <string.h> int main(void){ char str[1001],order[8]; char temp,rep[1001]; int i,j,k,l,n; int a,b; scanf("%s",str); scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s %d %d",order,&a,&b); if(strcmp(order,"print")==0){ for(j=a;j<=b;j++){ printf("%c",str[j]); if(j==b) printf("\n"); } } else if(strcmp(order,"reverse")==0){ k=(b-a)/2; for(j=a;j<=a+k;j++){ temp=str[j]; str[j]=str[a+b-j]; str[a+b-j]=temp; } } else if(strcmp(order,"replace")==0){ scanf("%s",rep); for(j=a,l=0;j<=b;j++,l++){ str[j]=rep[l]; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179147/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%s %d %d\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.6 = private unnamed_addr constant [8 x i8] c"reverse\00", align 1 @.str.7 = private unnamed_addr constant [8 x i8] c"replace\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1001 x i8], align 16 %order = alloca [8 x i8], align 1 %rep = alloca [1001 x i8], align 16 %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %order) #7 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %rep) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp91 = icmp sgt i32 %0, 0 br i1 %cmp91, label %for.body, label %for.end64 for.body: ; preds = %entry, %for.inc62 %i.092 = phi i32 [ %inc63, %for.inc62 ], [ 0, %entry ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %order, ptr noundef nonnull %a, ptr noundef nonnull %b) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %order, ptr noundef nonnull dereferenceable(6) @.str.3, i64 6) %cmp6 = icmp eq i32 %bcmp, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp8.not89 = icmp sgt i32 %1, %2 br i1 %cmp8.not89, label %for.inc62, label %for.body9.preheader for.body9.preheader: ; preds = %if.then %3 = sext i32 %1 to i64 br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.inc %indvars.iv101 = phi i64 [ %3, %for.body9.preheader ], [ %indvars.iv.next102, %for.inc ] %arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv101 %4 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %4 to i32 %putchar = call i32 @putchar(i32 %conv) %5 = load i32, ptr %b, align 4, !tbaa !5 %6 = trunc i64 %indvars.iv101 to i32 %cmp11 = icmp eq i32 %5, %6 br i1 %cmp11, label %if.then13, label %for.inc if.then13: ; preds = %for.body9 %putchar81 = call i32 @putchar(i32 10) %.pre = load i32, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body9, %if.then13 %7 = phi i32 [ %5, %for.body9 ], [ %.pre, %if.then13 ] %indvars.iv.next102 = add nsw i64 %indvars.iv101, 1 %8 = sext i32 %7 to i64 %cmp8.not.not = icmp slt i64 %indvars.iv101, %8 br i1 %cmp8.not.not, label %for.body9, label %for.inc62, !llvm.loop !10 if.else: ; preds = %for.body %bcmp79 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8) %cmp17 = icmp eq i32 %bcmp79, 0 br i1 %cmp17, label %if.then19, label %if.else39 if.then19: ; preds = %if.else %9 = load i32, ptr %b, align 4, !tbaa !5 %10 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %9, %10 %cmp21.not87 = icmp slt i32 %sub, -1 br i1 %cmp21.not87, label %for.inc62, label %for.body23.lr.ph for.body23.lr.ph: ; preds = %if.then19 %div = sdiv i32 %sub, 2 %add = add i32 %div, %10 %add26 = add nsw i32 %10, %9 %11 = sext i32 %10 to i64 %smax = call i32 @llvm.smax.i32(i32 %10, i32 %add) %12 = add i32 %smax, 1 %13 = sub i32 %12, %10 %xtraiter = and i32 %13, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body23.prol.loopexit, label %for.body23.prol for.body23.prol: ; preds = %for.body23.lr.ph %arrayidx25.prol = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %11 %14 = load i8, ptr %arrayidx25.prol, align 1, !tbaa !9 %idxprom28.prol = sext i32 %9 to i64 %arrayidx29.prol = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom28.prol %15 = load i8, ptr %arrayidx29.prol, align 1, !tbaa !9 store i8 %15, ptr %arrayidx25.prol, align 1, !tbaa !9 store i8 %14, ptr %arrayidx29.prol, align 1, !tbaa !9 %indvars.iv.next.prol = add nsw i64 %11, 1 br label %for.body23.prol.loopexit for.body23.prol.loopexit: ; preds = %for.body23.prol, %for.body23.lr.ph %indvars.iv.unr = phi i64 [ %11, %for.body23.lr.ph ], [ %indvars.iv.next.prol, %for.body23.prol ] %.not = icmp slt i32 %10, %add br i1 %.not, label %for.body23, label %for.inc62 for.body23: ; preds = %for.body23.prol.loopexit, %for.body23 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body23 ], [ %indvars.iv.unr, %for.body23.prol.loopexit ] %arrayidx25 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv %16 = load i8, ptr %arrayidx25, align 1, !tbaa !9 %17 = trunc i64 %indvars.iv to i32 %sub27 = sub i32 %add26, %17 %idxprom28 = sext i32 %sub27 to i64 %arrayidx29 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom28 %18 = load i8, ptr %arrayidx29, align 1, !tbaa !9 store i8 %18, ptr %arrayidx25, align 1, !tbaa !9 store i8 %16, ptr %arrayidx29, align 1, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx25.1 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv.next %19 = load i8, ptr %arrayidx25.1, align 1, !tbaa !9 %20 = trunc i64 %indvars.iv.next to i32 %sub27.1 = sub i32 %add26, %20 %idxprom28.1 = sext i32 %sub27.1 to i64 %arrayidx29.1 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom28.1 %21 = load i8, ptr %arrayidx29.1, align 1, !tbaa !9 store i8 %21, ptr %arrayidx25.1, align 1, !tbaa !9 store i8 %19, ptr %arrayidx29.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %12, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.inc62, label %for.body23, !llvm.loop !12 if.else39: ; preds = %if.else %bcmp80 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.7, i64 8) %cmp42 = icmp eq i32 %bcmp80, 0 br i1 %cmp42, label %if.then44, label %for.inc62 if.then44: ; preds = %if.else39 %call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rep) %22 = load i32, ptr %a, align 4, !tbaa !5 %23 = load i32, ptr %b, align 4, !tbaa !5 %cmp48.not84 = icmp sgt i32 %22, %23 br i1 %cmp48.not84, label %for.inc62, label %for.body50.preheader for.body50.preheader: ; preds = %if.then44 %24 = sext i32 %22 to i64 %scevgep = getelementptr i8, ptr %str, i64 %24 %25 = sub i32 %23, %22 %26 = zext i32 %25 to i64 %27 = add nuw nsw i64 %26, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) %rep, i64 %27, i1 false), !tbaa !9 br label %for.inc62 for.inc62: ; preds = %for.body23.prol.loopexit, %for.body23, %for.inc, %for.body50.preheader, %if.then44, %if.then19, %if.then, %if.else39 %inc63 = add nuw nsw i32 %i.092, 1 %28 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc63, %28 br i1 %cmp, label %for.body, label %for.end64, !llvm.loop !13 for.end64: ; preds = %for.inc62, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %rep) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %order) #7 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include <stdio.h> #include <string.h> int main(int argc, char const *argv[]) { char str[1001]; int q; scanf("%s", str); scanf("%d", &q); for (int i = 0; i < q; i++) { char order[8]; int a, b; scanf("%s", order); scanf("%d %d", &a, &b); if (strcmp(order, "print") == 0) { for (int j = a; j <= b; j++) { printf("%c", str[j]); } printf("\n"); } else if (strcmp(order, "reverse") == 0) { char temp[1001]; for (int j = a; j <= b; j++) { temp[j] = str[a+b-j]; } for (int j = a; j <= b; j++) { str[j] = temp[j]; } } else { int p_len = b - a + 1; char p[p_len]; scanf("%s", p); for (int j = 0; j < p_len; j++) { str[a+j] = p[j]; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.6 = private unnamed_addr constant [8 x i8] c"reverse\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: %str = alloca [1001 x i8], align 16 %q = alloca i32, align 4 %order = alloca [8 x i8], align 1 %a = alloca i32, align 4 %b = alloca i32, align 4 %temp = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp90 = icmp sgt i32 %0, 0 br i1 %cmp90, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i8, ptr %str, i64 -7 br label %for.body for.cond.cleanup: ; preds = %if.end63, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #7 ret i32 0 for.body: ; preds = %for.body.preheader, %if.end63 %i.091 = phi i32 [ %inc65, %if.end63 ], [ 0, %for.body.preheader ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %order) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %order) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %order, ptr noundef nonnull dereferenceable(6) @.str.3, i64 6) %cmp7 = icmp eq i32 %bcmp, 0 br i1 %cmp7, label %if.then, label %if.else if.then: ; preds = %for.body %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp9.not88 = icmp sgt i32 %1, %2 br i1 %cmp9.not88, label %for.cond.cleanup10, label %for.body11.preheader for.body11.preheader: ; preds = %if.then %3 = sext i32 %1 to i64 br label %for.body11 for.cond.cleanup10: ; preds = %for.body11, %if.then %putchar = call i32 @putchar(i32 10) br label %if.end63 for.body11: ; preds = %for.body11.preheader, %for.body11 %indvars.iv100 = phi i64 [ %3, %for.body11.preheader ], [ %indvars.iv.next101, %for.body11 ] %arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %indvars.iv100 %4 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %4 to i32 %putchar81 = call i32 @putchar(i32 %conv) %indvars.iv.next101 = add nsw i64 %indvars.iv100, 1 %5 = load i32, ptr %b, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp9.not.not = icmp slt i64 %indvars.iv100, %6 br i1 %cmp9.not.not, label %for.body11, label %for.cond.cleanup10, !llvm.loop !10 if.else: ; preds = %for.body %bcmp80 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %order, ptr noundef nonnull dereferenceable(8) @.str.6, i64 8) %cmp16 = icmp eq i32 %bcmp80, 0 br i1 %cmp16, label %if.then18, label %if.else45 if.then18: ; preds = %if.else call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %temp) #7 %7 = load i32, ptr %a, align 4, !tbaa !5 %8 = load i32, ptr %b, align 4, !tbaa !5 %cmp21.not84 = icmp sgt i32 %7, %8 br i1 %cmp21.not84, label %for.cond.cleanup36, label %iter.check iter.check: ; preds = %if.then18 %9 = sext i32 %7 to i64 %10 = add i32 %8, 1 %11 = sub i32 %8, %7 %12 = zext i32 %11 to i64 %13 = add nuw nsw i64 %12, 1 %min.iters.check = icmp ult i32 %11, 7 br i1 %min.iters.check, label %for.body24.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check103 = icmp ult i32 %11, 31 br i1 %min.iters.check103, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %13, 8589934560 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %14 = trunc i64 %index to i32 %offset.idx104 = add i64 %index, %9 %15 = sub i32 %8, %14 %16 = sext i32 %15 to i64 %17 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %16 %18 = getelementptr inbounds i8, ptr %17, i64 -15 %wide.load = load <16 x i8>, ptr %18, align 1, !tbaa !9 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %19 = getelementptr inbounds i8, ptr %17, i64 -31 %wide.load105 = load <16 x i8>, ptr %19, align 1, !tbaa !9 %reverse106 = shufflevector <16 x i8> %wide.load105, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %20 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %offset.idx104 store <16 x i8> %reverse, ptr %20, align 1, !tbaa !9 %21 = getelementptr inbounds i8, ptr %20, i64 16 store <16 x i8> %reverse106, ptr %21, align 1, !tbaa !9 %index.next = add nuw i64 %index, 32 %22 = icmp eq i64 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %13, %n.vec br i1 %cmp.n, label %for.cond33.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end109 = add nsw i64 %n.vec, %9 %n.vec.remaining = and i64 %13, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body24.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec108 = and i64 %13, 8589934584 %ind.end = add nsw i64 %n.vec108, %9 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index111 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next116, %vec.epilog.vector.body ] %23 = trunc i64 %index111 to i32 %offset.idx113 = add i64 %index111, %9 %24 = sub i32 %8, %23 %25 = sext i32 %24 to i64 %gep = getelementptr [1001 x i8], ptr %invariant.gep, i64 0, i64 %25 %wide.load114 = load <8 x i8>, ptr %gep, align 1, !tbaa !9 %reverse115 = shufflevector <8 x i8> %wide.load114, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %26 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %offset.idx113 store <8 x i8> %reverse115, ptr %26, align 1, !tbaa !9 %index.next116 = add nuw i64 %index111, 8 %27 = icmp eq i64 %index.next116, %n.vec108 br i1 %27, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n110 = icmp eq i64 %13, %n.vec108 br i1 %cmp.n110, label %for.cond33.preheader, label %for.body24.preheader for.body24.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %9, %iter.check ], [ %ind.end109, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %28 = add i32 %8, 1 %29 = trunc i64 %indvars.iv.ph to i32 %30 = sub i32 %28, %29 %xtraiter = and i32 %30, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body24.prol.loopexit, label %for.body24.prol for.body24.prol: ; preds = %for.body24.preheader %31 = trunc i64 %indvars.iv.ph to i32 %add.prol = sub i32 %7, %31 %sub.prol = add i32 %add.prol, %8 %idxprom25.prol = sext i32 %sub.prol to i64 %arrayidx26.prol = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom25.prol %32 = load i8, ptr %arrayidx26.prol, align 1, !tbaa !9 %arrayidx28.prol = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %indvars.iv.ph store i8 %32, ptr %arrayidx28.prol, align 1, !tbaa !9 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body24.prol.loopexit for.body24.prol.loopexit: ; preds = %for.body24.prol, %for.body24.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body24.preheader ], [ %indvars.iv.next.prol, %for.body24.prol ] %33 = icmp eq i32 %8, %29 br i1 %33, label %for.cond33.preheader, label %for.body24 for.cond33.preheader: ; preds = %for.body24.prol.loopexit, %for.body24, %vec.epilog.middle.block, %middle.block br i1 %cmp21.not84, label %for.cond.cleanup36, label %for.body37.preheader for.body37.preheader: ; preds = %for.cond33.preheader %34 = sext i32 %7 to i64 %scevgep95 = getelementptr i8, ptr %str, i64 %34 %scevgep96 = getelementptr i8, ptr %temp, i64 %34 %35 = sub i32 %8, %7 %36 = zext i32 %35 to i64 %37 = add nuw nsw i64 %36, 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep95, ptr noundef nonnull align 1 dereferenceable(1) %scevgep96, i64 %37, i1 false), !tbaa !9 br label %for.cond.cleanup36 for.body24: ; preds = %for.body24.prol.loopexit, %for.body24 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body24 ], [ %indvars.iv.unr, %for.body24.prol.loopexit ] %38 = trunc i64 %indvars.iv to i32 %add = sub i32 %7, %38 %sub = add i32 %add, %8 %idxprom25 = sext i32 %sub to i64 %arrayidx26 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom25 %39 = load i8, ptr %arrayidx26, align 1, !tbaa !9 %arrayidx28 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %indvars.iv store i8 %39, ptr %arrayidx28, align 1, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %40 = trunc i64 %indvars.iv.next to i32 %add.1 = sub i32 %7, %40 %sub.1 = add i32 %add.1, %8 %idxprom25.1 = sext i32 %sub.1 to i64 %arrayidx26.1 = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom25.1 %41 = load i8, ptr %arrayidx26.1, align 1, !tbaa !9 %arrayidx28.1 = getelementptr inbounds [1001 x i8], ptr %temp, i64 0, i64 %indvars.iv.next store i8 %41, ptr %arrayidx28.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %10, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.cond33.preheader, label %for.body24, !llvm.loop !16 for.cond.cleanup36: ; preds = %if.then18, %for.body37.preheader, %for.cond33.preheader call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %temp) #7 br label %if.end63 if.else45: ; preds = %if.else %42 = load i32, ptr %b, align 4, !tbaa !5 %43 = load i32, ptr %a, align 4, !tbaa !5 %sub46 = sub nsw i32 %42, %43 %add47 = add nsw i32 %sub46, 1 %44 = zext i32 %add47 to i64 %45 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %44, align 16 %call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vla) %cmp51.not82 = icmp slt i32 %sub46, 0 br i1 %cmp51.not82, label %for.cond.cleanup53, label %for.body54.lr.ph for.body54.lr.ph: ; preds = %if.else45 %46 = load i32, ptr %a, align 4, !tbaa !5 %47 = sext i32 %46 to i64 %scevgep = getelementptr i8, ptr %str, i64 %47 %48 = add i32 %42, 1 %49 = sub i32 %48, %43 %50 = zext i32 %49 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %vla, i64 %50, i1 false), !tbaa !9 br label %for.cond.cleanup53 for.cond.cleanup53: ; preds = %for.body54.lr.ph, %if.else45 call void @llvm.stackrestore.p0(ptr %45) br label %if.end63 if.end63: ; preds = %for.cond.cleanup36, %for.cond.cleanup53, %for.cond.cleanup10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %order) #7 %inc65 = add nuw nsw i32 %i.091, 1 %51 = load i32, ptr %q, align 4, !tbaa !5 %cmp = icmp slt i32 %inc65, %51 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !17 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; 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) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind willreturn memory(argmem: read) } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !13, !14} !16 = distinct !{!16, !11, !13} !17 = distinct !{!17, !11}
#include <stdio.h> #include <string.h> #define MAX 1000 void func_print(char string[], int start, int end) { for (int i = start; i <= end; i++) { printf("%c", string[i]); } printf("\n"); } void func_reverse(char string[], int start, int end) { // printf("TEST : %d %d\n", start, end); char temp; for (; start < end; start++) { // printf("before %d: %c, %d: %c\n", start, string[start], end, string[end]); temp = string[start]; string[start] = string[end]; string[end] = temp; // printf("after %d: %c, %d: %c\n", start, string[start], end, string[end]); end--; } } void func_replace(char string[], int start, int end, char rep_string[]) { for (int i = 0, j = start; j <= end; i++, j++) { string[j] = rep_string[i]; } } int main(void) { char string[MAX + 1]; int q_num; char question_name[8]; char replace[] = "replace"; char reverse[] = "reverse"; char print[] = "print"; scanf("%s", string); scanf("%d", &q_num); for (int i = 0; i < q_num; i++) { scanf("%s", question_name); if (strcmp(question_name, replace) == 0) { int start, end; scanf("%d %d", &start, &end); char rep_string[end - start + 1]; scanf("%s", rep_string); func_replace(string, start, end, rep_string); } else if (strcmp(question_name, reverse) == 0) { int start, end; scanf("%d %d", &start, &end); func_reverse(string, start, end); } else if (strcmp(question_name, print) == 0) { int start, end; scanf("%d %d", &start, &end); func_print(string, start, end); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.replace = private unnamed_addr constant [8 x i8] c"replace\00", align 1 @__const.main.reverse = private unnamed_addr constant [8 x i8] c"reverse\00", align 1 @__const.main.print = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @func_print(ptr nocapture noundef readonly %string, i32 noundef %start, i32 noundef %end) local_unnamed_addr #0 { entry: %cmp.not5 = icmp sgt i32 %start, %end br i1 %cmp.not5, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %start to i64 %1 = add i32 %end, 1 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %putchar = tail call i32 @putchar(i32 10) ret void for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %string, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv = sext i8 %2 to i32 %putchar4 = tail call i32 @putchar(i32 %conv) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.cond.cleanup, 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) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @func_reverse(ptr nocapture noundef %string, i32 noundef %start, i32 noundef %end) local_unnamed_addr #2 { entry: %cmp16 = icmp slt i32 %start, %end br i1 %cmp16, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %start to i64 %1 = sext i32 %end to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv19 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next20, %for.body ] %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %string, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv19 %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 store i8 %3, ptr %arrayidx, align 1, !tbaa !5 store i8 %2, ptr %arrayidx2, align 1, !tbaa !5 %indvars.iv.next20 = add nsw i64 %indvars.iv19, -1 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %cmp = icmp slt i64 %indvars.iv.next, %indvars.iv.next20 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @func_replace(ptr nocapture noundef writeonly %string, i32 noundef %start, i32 noundef %end, ptr nocapture noundef readonly %rep_string) local_unnamed_addr #2 { entry: %rep_string16 = ptrtoint ptr %rep_string to i64 %string15 = ptrtoint ptr %string to i64 %cmp.not7 = icmp sgt i32 %start, %end br i1 %cmp.not7, label %for.cond.cleanup, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %start to i64 %1 = add i32 %end, 1 %2 = sub i32 %1, %start %wide.trip.count = zext i32 %2 to i64 %min.iters.check = icmp ult i32 %2, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %3 = add i64 %string15, %0 %4 = sub i64 %3, %rep_string16 %diff.check = icmp ult i64 %4, 32 br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check17 = icmp ult i32 %2, 32 br i1 %min.iters.check17, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 %invariant.gep = getelementptr i8, ptr %string, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %5 = getelementptr inbounds i8, ptr %rep_string, i64 %index %wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !5 %6 = getelementptr inbounds i8, ptr %5, i64 16 %wide.load18 = load <16 x i8>, ptr %6, align 1, !tbaa !5 %gep = getelementptr i8, ptr %invariant.gep, i64 %index store <16 x i8> %wide.load, ptr %gep, align 1, !tbaa !5 %7 = getelementptr inbounds i8, ptr %gep, i64 16 store <16 x i8> %wide.load18, ptr %7, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end21 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec20 = and i64 %wide.trip.count, 4294967288 %ind.end = add nsw i64 %n.vec20, %0 %invariant.gep28 = getelementptr i8, ptr %string, i64 %0 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index24 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next27, %vec.epilog.vector.body ] %9 = getelementptr inbounds i8, ptr %rep_string, i64 %index24 %wide.load26 = load <8 x i8>, ptr %9, align 1, !tbaa !5 %gep29 = getelementptr i8, ptr %invariant.gep28, i64 %index24 store <8 x i8> %wide.load26, ptr %gep29, align 1, !tbaa !5 %index.next27 = add nuw i64 %index24, 8 %10 = icmp eq i64 %index.next27, %n.vec20 br i1 %10, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n23 = icmp eq i64 %n.vec20, %wide.trip.count br i1 %cmp.n23, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv10.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec20, %vec.epilog.middle.block ] %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end21, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %11 = xor i64 %indvars.iv10.ph, -1 %12 = add nsw i64 %11, %wide.trip.count %xtraiter = and i64 %wide.trip.count, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader, %for.body.prol %indvars.iv10.prol = phi i64 [ %indvars.iv.next11.prol, %for.body.prol ], [ %indvars.iv10.ph, %for.body.preheader ] %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ] %arrayidx.prol = getelementptr inbounds i8, ptr %rep_string, i64 %indvars.iv10.prol %13 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %arrayidx2.prol = getelementptr inbounds i8, ptr %string, i64 %indvars.iv.prol store i8 %13, ptr %arrayidx2.prol, align 1, !tbaa !5 %indvars.iv.next11.prol = add nuw nsw i64 %indvars.iv10.prol, 1 %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !15 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv10.unr = phi i64 [ %indvars.iv10.ph, %for.body.preheader ], [ %indvars.iv.next11.prol, %for.body.prol ] %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %14 = icmp ult i64 %12, 3 br i1 %14, label %for.cond.cleanup, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.prol.loopexit %invariant.gep30 = getelementptr i8, ptr %rep_string, i64 1 %invariant.gep32 = getelementptr i8, ptr %string, i64 1 %invariant.gep34 = getelementptr i8, ptr %rep_string, i64 2 %invariant.gep36 = getelementptr i8, ptr %string, i64 2 %invariant.gep38 = getelementptr i8, ptr %rep_string, i64 3 %invariant.gep40 = getelementptr i8, ptr %string, i64 3 br label %for.body for.cond.cleanup: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry ret void for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv10 = phi i64 [ %indvars.iv10.unr, %for.body.preheader.new ], [ %indvars.iv.next11.3, %for.body ] %indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %rep_string, i64 %indvars.iv10 %15 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv store i8 %15, ptr %arrayidx2, align 1, !tbaa !5 %gep31 = getelementptr i8, ptr %invariant.gep30, i64 %indvars.iv10 %16 = load i8, ptr %gep31, align 1, !tbaa !5 %gep33 = getelementptr i8, ptr %invariant.gep32, i64 %indvars.iv store i8 %16, ptr %gep33, align 1, !tbaa !5 %gep35 = getelementptr i8, ptr %invariant.gep34, i64 %indvars.iv10 %17 = load i8, ptr %gep35, align 1, !tbaa !5 %gep37 = getelementptr i8, ptr %invariant.gep36, i64 %indvars.iv store i8 %17, ptr %gep37, align 1, !tbaa !5 %gep39 = getelementptr i8, ptr %invariant.gep38, i64 %indvars.iv10 %18 = load i8, ptr %gep39, align 1, !tbaa !5 %gep41 = getelementptr i8, ptr %invariant.gep40, i64 %indvars.iv store i8 %18, ptr %gep41, align 1, !tbaa !5 %indvars.iv.next11.3 = add nuw nsw i64 %indvars.iv10, 4 %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next11.3, %wide.trip.count br i1 %exitcond.not.3, label %for.cond.cleanup, label %for.body, !llvm.loop !17 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %string = alloca [1001 x i8], align 16 %q_num = alloca i32, align 4 %question_name = alloca [8 x i8], align 1 %start = alloca i32, align 4 %end = alloca i32, align 4 %start16 = alloca i32, align 4 %end17 = alloca i32, align 4 %start26 = alloca i32, align 4 %end27 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %string) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q_num) #8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %question_name) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %string) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %q_num) %0 = load i32, ptr %q_num, align 4, !tbaa !18 %cmp48 = icmp sgt i32 %0, 0 br i1 %cmp48, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %question_name) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q_num) #8 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %string) #8 ret i32 0 for.body: ; preds = %entry, %for.inc %i.049 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %question_name) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %question_name, ptr noundef nonnull dereferenceable(8) @__const.main.replace, i64 8) %cmp7 = icmp eq i32 %bcmp, 0 br i1 %cmp7, label %if.then, label %if.else if.then: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end) #8 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %start, ptr noundef nonnull %end) %1 = load i32, ptr %end, align 4, !tbaa !18 %2 = load i32, ptr %start, align 4, !tbaa !18 %sub = add i32 %1, 1 %add = sub i32 %sub, %2 %3 = zext i32 %add to i64 %4 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %3, align 16 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %vla) %5 = load i32, ptr %start, align 4, !tbaa !18 %6 = load i32, ptr %end, align 4, !tbaa !18 %cmp.not7.i = icmp sgt i32 %5, %6 br i1 %cmp.not7.i, label %func_replace.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %if.then %7 = sext i32 %5 to i64 %reass.sub = sub i32 %6, %5 %8 = add i32 %reass.sub, 1 %wide.trip.count.i = zext i32 %8 to i64 %scevgep = getelementptr i8, ptr %string, i64 %7 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %vla, i64 %wide.trip.count.i, i1 false), !tbaa !5 br label %func_replace.exit func_replace.exit: ; preds = %for.body.preheader.i, %if.then call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start) #8 br label %for.inc if.else: ; preds = %for.body %bcmp33 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %question_name, ptr noundef nonnull dereferenceable(8) @__const.main.reverse, i64 8) %cmp14 = icmp eq i32 %bcmp33, 0 br i1 %cmp14, label %if.then15, label %if.else20 if.then15: ; preds = %if.else call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start16) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end17) #8 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %start16, ptr noundef nonnull %end17) %9 = load i32, ptr %start16, align 4, !tbaa !18 %10 = load i32, ptr %end17, align 4, !tbaa !18 %cmp16.i = icmp slt i32 %9, %10 br i1 %cmp16.i, label %for.body.preheader.i35, label %func_reverse.exit for.body.preheader.i35: ; preds = %if.then15 %11 = sext i32 %9 to i64 %12 = sext i32 %10 to i64 br label %for.body.i36 for.body.i36: ; preds = %for.body.i36, %for.body.preheader.i35 %indvars.iv19.i = phi i64 [ %12, %for.body.preheader.i35 ], [ %indvars.iv.next20.i, %for.body.i36 ] %indvars.iv.i37 = phi i64 [ %11, %for.body.preheader.i35 ], [ %indvars.iv.next.i40, %for.body.i36 ] %arrayidx.i38 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv.i37 %13 = load i8, ptr %arrayidx.i38, align 1, !tbaa !5 %arrayidx2.i39 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv19.i %14 = load i8, ptr %arrayidx2.i39, align 1, !tbaa !5 store i8 %14, ptr %arrayidx.i38, align 1, !tbaa !5 store i8 %13, ptr %arrayidx2.i39, align 1, !tbaa !5 %indvars.iv.next20.i = add nsw i64 %indvars.iv19.i, -1 %indvars.iv.next.i40 = add nsw i64 %indvars.iv.i37, 1 %cmp.i = icmp slt i64 %indvars.iv.next.i40, %indvars.iv.next20.i br i1 %cmp.i, label %for.body.i36, label %func_reverse.exit, !llvm.loop !10 func_reverse.exit: ; preds = %for.body.i36, %if.then15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end17) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start16) #8 br label %for.inc if.else20: ; preds = %if.else %bcmp34 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %question_name, ptr noundef nonnull dereferenceable(6) @__const.main.print, i64 6) %cmp24 = icmp eq i32 %bcmp34, 0 br i1 %cmp24, label %if.then25, label %for.inc if.then25: ; preds = %if.else20 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start26) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end27) #8 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %start26, ptr noundef nonnull %end27) %15 = load i32, ptr %start26, align 4, !tbaa !18 %16 = load i32, ptr %end27, align 4, !tbaa !18 %cmp.not5.i = icmp sgt i32 %15, %16 br i1 %cmp.not5.i, label %func_print.exit, label %for.body.preheader.i41 for.body.preheader.i41: ; preds = %if.then25 %17 = sext i32 %15 to i64 %18 = add i32 %16, 1 br label %for.body.i42 for.body.i42: ; preds = %for.body.i42, %for.body.preheader.i41 %indvars.iv.i43 = phi i64 [ %17, %for.body.preheader.i41 ], [ %indvars.iv.next.i45, %for.body.i42 ] %arrayidx.i44 = getelementptr inbounds i8, ptr %string, i64 %indvars.iv.i43 %19 = load i8, ptr %arrayidx.i44, align 1, !tbaa !5 %conv.i = sext i8 %19 to i32 %putchar4.i = call i32 @putchar(i32 %conv.i) %indvars.iv.next.i45 = add nsw i64 %indvars.iv.i43, 1 %lftr.wideiv.i = trunc i64 %indvars.iv.next.i45 to i32 %exitcond.not.i46 = icmp eq i32 %18, %lftr.wideiv.i br i1 %exitcond.not.i46, label %func_print.exit, label %for.body.i42, !llvm.loop !8 func_print.exit: ; preds = %for.body.i42, %if.then25 %putchar.i = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end27) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start26) #8 br label %for.inc for.inc: ; preds = %func_replace.exit, %if.else20, %func_print.exit, %func_reverse.exit %inc = add nuw nsw i32 %i.049, 1 %20 = load i32, ptr %q_num, align 4, !tbaa !18 %cmp = icmp slt i32 %inc, %20 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !20 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #5 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #6 = { nofree nounwind } attributes #7 = { nofree nounwind willreturn memory(argmem: read) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !9, !12, !13} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !9, !12} !18 = !{!19, !19, i64 0} !19 = !{!"int", !6, i64 0} !20 = distinct !{!20, !9}
#include <stdio.h> #include <string.h> char t1[1510]; char t2[1510]; char t3[1510]; int main(){ int n; int a,b; int i,j; char t; scanf("%s",&t1); scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",&t3); if(strcmp(t3,"replace")==0){ scanf("%d %d %s",&a,&b,&t2); for(j=0;j<b-a+1;j++){ t1[a+j]=t2[j]; } } else if(strcmp(t3,"reverse")==0){ scanf("%d %d",&a,&b); while(a<b){ t=t1[a]; t1[a]=t1[b]; t1[b]=t; a++; b--; } } else if(strcmp(t3,"print")==0){ scanf("%d %d",&a,&b); for(j=a;j<b+1;j++){ printf("%c",t1[j]); } puts(""); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179284/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179284/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @t1 = dso_local global [1510 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @t3 = dso_local global [1510 x i8] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [9 x i8] c"%d %d %s\00", align 1 @t2 = dso_local global [1510 x i8] zeroinitializer, align 16 @.str.5 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.6 = private unnamed_addr constant [6 x i8] c"print\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 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t1) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp70 = icmp sgt i32 %0, 0 br i1 %cmp70, label %for.body, label %for.end46 for.body: ; preds = %entry, %for.inc44 %i.071 = phi i32 [ %inc45, %for.inc44 ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t3) %lhsv = load i64, ptr @t3, align 16 switch i64 %lhsv, label %if.else26 [ i64 28538242730059122, label %if.then i64 28555907813500274, label %if.then14 ] if.then: ; preds = %for.body %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull @t2) %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %cmp7.not66 = icmp slt i32 %1, %2 br i1 %cmp7.not66, label %for.inc44, label %for.body8.preheader for.body8.preheader: ; preds = %if.then %3 = sext i32 %2 to i64 %scevgep = getelementptr i8, ptr @t1, i64 %3 %4 = add i32 %1, 1 %5 = sub i32 %4, %2 %6 = zext i32 %5 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 @t2, i64 %6, i1 false), !tbaa !9 br label %for.inc44 if.then14: ; preds = %for.body %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1663 = icmp slt i32 %a.promoted, %b.promoted br i1 %cmp1663, label %while.body.preheader, label %for.inc44 while.body.preheader: ; preds = %if.then14 %7 = sext i32 %a.promoted to i64 %8 = sext i32 %b.promoted to i64 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %indvars.iv72 = phi i64 [ %8, %while.body.preheader ], [ %indvars.iv.next73, %while.body ] %indvars.iv = phi i64 [ %7, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %arrayidx18 = getelementptr inbounds [1510 x i8], ptr @t1, i64 0, i64 %indvars.iv %9 = load i8, ptr %arrayidx18, align 1, !tbaa !9 %arrayidx20 = getelementptr inbounds [1510 x i8], ptr @t1, i64 0, i64 %indvars.iv72 %10 = load i8, ptr %arrayidx20, align 1, !tbaa !9 store i8 %10, ptr %arrayidx18, align 1, !tbaa !9 store i8 %9, ptr %arrayidx20, align 1, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %indvars.iv.next73 = add nsw i64 %indvars.iv72, -1 %cmp16 = icmp slt i64 %indvars.iv.next, %indvars.iv.next73 br i1 %cmp16, label %while.body, label %while.cond.for.inc44.loopexit60_crit_edge, !llvm.loop !10 if.else26: ; preds = %for.body %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) @t3, ptr noundef nonnull dereferenceable(6) @.str.6, i64 6) %cmp28 = icmp eq i32 %bcmp, 0 br i1 %cmp28, label %if.then29, label %for.inc44 if.then29: ; preds = %if.else26 %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %a, ptr noundef nonnull %b) %11 = load i32, ptr %a, align 4, !tbaa !5 %12 = load i32, ptr %b, align 4, !tbaa !5 %cmp33.not68 = icmp sgt i32 %11, %12 br i1 %cmp33.not68, label %for.end40, label %for.body34.preheader for.body34.preheader: ; preds = %if.then29 %13 = sext i32 %11 to i64 br label %for.body34 for.body34: ; preds = %for.body34.preheader, %for.body34 %indvars.iv81 = phi i64 [ %13, %for.body34.preheader ], [ %indvars.iv.next82, %for.body34 ] %arrayidx36 = getelementptr inbounds [1510 x i8], ptr @t1, i64 0, i64 %indvars.iv81 %14 = load i8, ptr %arrayidx36, align 1, !tbaa !9 %conv = sext i8 %14 to i32 %putchar59 = call i32 @putchar(i32 %conv) %indvars.iv.next82 = add nsw i64 %indvars.iv81, 1 %15 = load i32, ptr %b, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp33.not.not = icmp slt i64 %indvars.iv81, %16 br i1 %cmp33.not.not, label %for.body34, label %for.end40, !llvm.loop !12 for.end40: ; preds = %for.body34, %if.then29 %putchar = call i32 @putchar(i32 10) br label %for.inc44 while.cond.for.inc44.loopexit60_crit_edge: ; preds = %while.body %17 = trunc i64 %indvars.iv.next73 to i32 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %a, align 4, !tbaa !5 store i32 %17, ptr %b, align 4, !tbaa !5 br label %for.inc44 for.inc44: ; preds = %for.body8.preheader, %if.then14, %while.cond.for.inc44.loopexit60_crit_edge, %if.then, %if.else26, %for.end40 %inc45 = add nuw nsw i32 %i.071, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc45, %19 br i1 %cmp, label %for.body, label %for.end46, !llvm.loop !13 for.end46: ; preds = %for.inc44, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind willreturn memory(argmem: read) } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include<stdio.h> #include<string.h> int main(void){ char str[1001]; // input; input string , 1<=length<=1000 int n=0; // input; command times, 1<=n<=100 int a=0, b=0; char* p_str=str; // string pointer char cpy[1001]; int i=0, j=0; // loop index scanf("%s", str); scanf("%d", &n); for(i=0;i<n;i++){ scanf("%s", cpy); if(strcmp(cpy, "print") == 0){ scanf("%d %d", &a, &b); p_str = str + a; strncpy(cpy, p_str, b-a+1); cpy[b-a+1] = '\0'; printf("%s\n", cpy); }else if(strcmp(cpy, "reverse") == 0){ scanf("%d %d", &a, &b); p_str = str + b; for(j=0;j<b-a+1;j++){ cpy[j] = *(p_str); p_str--; } p_str = str + a; // ??????¶??????????????? for(j=0;j<b-a+1;j++) *(p_str + j) = cpy[j]; }else if(strcmp(cpy, "replace") == 0){ scanf("%d %d %s", &a, &b, cpy); p_str = str + a; for(j=0;j<b-a+1;j++) *(p_str + j) = cpy[j]; }else{ } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179327/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"print\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.7 = private unnamed_addr constant [9 x i8] c"%d %d %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1001 x i8], align 16 %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %cpy = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 store i32 0, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 store i32 0, ptr %a, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 store i32 0, ptr %b, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %cpy) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp107 = icmp sgt i32 %0, 0 br i1 %cmp107, label %for.body, label %for.end78 for.body: ; preds = %entry, %for.inc76 %i.0108 = phi i32 [ %inc77, %for.inc76 ], [ 0, %entry ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cpy) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %cpy, ptr noundef nonnull dereferenceable(6) @.str.2, i64 6) %cmp7 = icmp eq i32 %bcmp, 0 br i1 %cmp7, label %if.then, label %if.else if.then: ; preds = %for.body %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !5 %idx.ext = sext i32 %1 to i64 %add.ptr = getelementptr inbounds i8, ptr %str, i64 %idx.ext %2 = load i32, ptr %b, align 4, !tbaa !5 %reass.sub = sub i32 %2, %1 %add = add i32 %reass.sub, 1 %conv = sext i32 %add to i64 %call11 = call ptr @strncpy(ptr noundef nonnull %cpy, ptr noundef nonnull %add.ptr, i64 noundef %conv) #7 %arrayidx = getelementptr inbounds [1001 x i8], ptr %cpy, i64 0, i64 %conv store i8 0, ptr %arrayidx, align 1, !tbaa !9 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cpy) br label %for.inc76 if.else: ; preds = %for.body %lhsv = load i64, ptr %cpy, align 16 switch i64 %lhsv, label %for.inc76 [ i64 28555907813500274, label %if.then20 i64 28538242730059122, label %if.then54 ] if.then20: ; preds = %if.else %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a, ptr noundef nonnull %b) %3 = load i32, ptr %b, align 4, !tbaa !5 %4 = load i32, ptr %a, align 4, !tbaa !5 %cmp28.not101 = icmp slt i32 %3, %4 br i1 %cmp28.not101, label %for.inc76, label %iter.check iter.check: ; preds = %if.then20 %idx.ext23 = sext i32 %3 to i64 %add.ptr24 = getelementptr inbounds i8, ptr %str, i64 %idx.ext23 %5 = add i32 %3, 1 %6 = sub i32 %5, %4 %wide.trip.count = zext i32 %6 to i64 %min.iters.check = icmp ult i32 %6, 8 br i1 %min.iters.check, label %for.body30.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check115 = icmp ult i32 %6, 32 br i1 %min.iters.check115, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %7 = sub i64 0, %index %next.gep = getelementptr i8, ptr %add.ptr24, i64 %7 %8 = getelementptr i8, ptr %next.gep, i64 -15 %wide.load = load <16 x i8>, ptr %8, align 1, !tbaa !9 %reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %9 = getelementptr i8, ptr %next.gep, i64 -31 %wide.load117 = load <16 x i8>, ptr %9, align 1, !tbaa !9 %reverse118 = shufflevector <16 x i8> %wide.load117, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %10 = getelementptr inbounds [1001 x i8], ptr %cpy, i64 0, i64 %index store <16 x i8> %reverse, ptr %10, align 16, !tbaa !9 %11 = getelementptr inbounds i8, ptr %10, i64 16 store <16 x i8> %reverse118, ptr %11, align 16, !tbaa !9 %index.next = add nuw i64 %index, 32 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %13 = sub nsw i64 0, %n.vec %ind.end123 = getelementptr i8, ptr %add.ptr24, i64 %13 %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body30.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec120 = and i64 %wide.trip.count, 4294967288 %14 = sub nsw i64 0, %n.vec120 %ind.end122 = getelementptr i8, ptr %add.ptr24, i64 %14 %invariant.gep = getelementptr i8, ptr %add.ptr24, i64 -7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index126 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next130, %vec.epilog.vector.body ] %15 = sub i64 0, %index126 %gep = getelementptr i8, ptr %invariant.gep, i64 %15 %wide.load128 = load <8 x i8>, ptr %gep, align 1, !tbaa !9 %reverse129 = shufflevector <8 x i8> %wide.load128, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0> %16 = getelementptr inbounds [1001 x i8], ptr %cpy, i64 0, i64 %index126 store <8 x i8> %reverse129, ptr %16, align 8, !tbaa !9 %index.next130 = add nuw i64 %index126, 8 %17 = icmp eq i64 %index.next130, %n.vec120 br i1 %17, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n125 = icmp eq i64 %n.vec120, %wide.trip.count br i1 %cmp.n125, label %for.end, label %for.body30.preheader for.body30.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec120, %vec.epilog.middle.block ] %p_str.0102.ph = phi ptr [ %add.ptr24, %iter.check ], [ %ind.end123, %vec.epilog.iter.check ], [ %ind.end122, %vec.epilog.middle.block ] br label %for.body30 for.body30: ; preds = %for.body30.preheader, %for.body30 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body30 ], [ %indvars.iv.ph, %for.body30.preheader ] %p_str.0102 = phi ptr [ %incdec.ptr, %for.body30 ], [ %p_str.0102.ph, %for.body30.preheader ] %18 = load i8, ptr %p_str.0102, align 1, !tbaa !9 %arrayidx32 = getelementptr inbounds [1001 x i8], ptr %cpy, i64 0, i64 %indvars.iv store i8 %18, ptr %arrayidx32, align 1, !tbaa !9 %incdec.ptr = getelementptr inbounds i8, ptr %p_str.0102, i64 -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.body30, !llvm.loop !15 for.end: ; preds = %for.body30, %vec.epilog.middle.block, %middle.block br i1 %cmp28.not101, label %for.inc76, label %for.body41.preheader for.body41.preheader: ; preds = %for.end %idx.ext34 = sext i32 %4 to i64 %add.ptr35 = getelementptr i8, ptr %str, i64 %idx.ext34 %19 = add i32 %3, 1 %20 = sub i32 %19, %4 %21 = zext i32 %20 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %add.ptr35, ptr nonnull align 16 %cpy, i64 %21, i1 false), !tbaa !9 br label %for.inc76 if.then54: ; preds = %if.else %call56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %cpy) %22 = load i32, ptr %a, align 4, !tbaa !5 %23 = load i32, ptr %b, align 4, !tbaa !5 %cmp63.not99 = icmp slt i32 %23, %22 br i1 %cmp63.not99, label %for.inc76, label %for.body65.preheader for.body65.preheader: ; preds = %if.then54 %idx.ext58 = sext i32 %22 to i64 %add.ptr59 = getelementptr i8, ptr %str, i64 %idx.ext58 %24 = add i32 %23, 1 %25 = sub i32 %24, %22 %26 = zext i32 %25 to i64 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %add.ptr59, ptr nonnull align 16 %cpy, i64 %26, i1 false), !tbaa !9 br label %for.inc76 for.inc76: ; preds = %if.then20, %for.body65.preheader, %for.body41.preheader, %if.then54, %for.end, %if.else, %if.then %inc77 = add nuw nsw i32 %i.0108, 1 %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc77, %27 br i1 %cmp, label %for.body, label %for.end78, !llvm.loop !16 for.end78: ; preds = %for.inc76, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %cpy) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str) #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 memory(argmem: readwrite) declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; 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) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree nounwind willreturn memory(argmem: read) } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 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 = !{!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, !13, !12} !16 = distinct !{!16, !11}
#include<stdio.h> #define N 9 void Check1(int); void Check2(int); void Check3(int, int); int data[N][N]; char correct[N][N]; int main(){ int i, j, k, n; scanf("%d", &n); for(k=0; k<n; k++){ for(i=0; i<N; i++){ for(j=0; j<N; j++){ scanf("%d", &data[i][j]); correct[i][j] = ' '; } } for(i=0; i<N; i++){ Check1(i); Check2(i); } for(i=0; i<N; i+=3){ for(j=0; j<N; j+=3) Check3(i, j); } if(k != 0) printf("\n"); for(i=0; i<N; i++){ for(j=0; j<N; j++) printf("%c%d", correct[i][j], data[i][j]); printf("\n"); } } return 0; } void Check1(int n){ int i, j; for(i=0; i<N-1; i++){ for(j=i+1; j<N; j++){ if(data[i][n] == data[j][n]){ correct[i][n] = '*'; correct[j][n] = '*'; } } } } void Check2(int n){ int i, j; for(i=0; i<N-1; i++){ for(j=i+1; j<N; j++){ if(data[n][i] == data[n][j]){ correct[n][i] = '*'; correct[n][j] = '*'; } } } } void Check3(int n, int m){ int i, j, k, check[N]; char _correct[N]; for(i=n, k=0; i<n+3; i++){ for(j=m; j<m+3; j++, k++){ check[k] = data[i][j]; _correct[k] = ' '; } } for(i=0; i<N-1; i++){ for(j=i+1; j<N; j++){ if(check[i] == check[j]){ _correct[i] = '*'; _correct[j] = '*'; } } } for(i=n, k=0; i<n+3; i++){ for(j=m; j<m+3; j++, k++){ if(_correct[k] == '*') correct[i][j] = '*'; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179378/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179378/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @data = dso_local global [9 x [9 x i32]] zeroinitializer, align 16 @correct = dso_local local_unnamed_addr global [9 x [9 x i8]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [5 x i8] c"%c%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp95 = icmp sgt i32 %0, 0 br i1 %cmp95, label %for.cond1.preheader, label %for.end60 for.cond1.preheader: ; preds = %entry, %for.inc58 %k.096 = phi i32 [ %inc59, %for.inc58 ], [ 0, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.preheader %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 0 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8) %arrayidx13 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 0 store i8 32, ptr %arrayidx13, align 1, !tbaa !9 %arrayidx8.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 1 %call9.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.1) %arrayidx13.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 1 store i8 32, ptr %arrayidx13.1, align 1, !tbaa !9 %arrayidx8.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 2 %call9.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.2) %arrayidx13.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 2 store i8 32, ptr %arrayidx13.2, align 1, !tbaa !9 %arrayidx8.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 3 %call9.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.3) %arrayidx13.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 3 store i8 32, ptr %arrayidx13.3, align 1, !tbaa !9 %arrayidx8.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 4 %call9.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.4) %arrayidx13.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 4 store i8 32, ptr %arrayidx13.4, align 1, !tbaa !9 %arrayidx8.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 5 %call9.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.5) %arrayidx13.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 5 store i8 32, ptr %arrayidx13.5, align 1, !tbaa !9 %arrayidx8.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 6 %call9.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.6) %arrayidx13.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 6 store i8 32, ptr %arrayidx13.6, align 1, !tbaa !9 %arrayidx8.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 7 %call9.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.7) %arrayidx13.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 7 store i8 32, ptr %arrayidx13.7, align 1, !tbaa !9 %arrayidx8.8 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv, i64 8 %call9.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.8) %arrayidx13.8 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv, i64 8 store i8 32, ptr %arrayidx13.8, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 9 br i1 %exitcond.not, label %for.body19.preheader, label %for.cond4.preheader, !llvm.loop !10 for.body19.preheader: ; preds = %for.cond4.preheader call void @Check1(i32 noundef 0) call void @Check2(i32 noundef 0) call void @Check1(i32 noundef 1) call void @Check2(i32 noundef 1) call void @Check1(i32 noundef 2) call void @Check2(i32 noundef 2) call void @Check1(i32 noundef 3) call void @Check2(i32 noundef 3) call void @Check1(i32 noundef 4) call void @Check2(i32 noundef 4) call void @Check1(i32 noundef 5) call void @Check2(i32 noundef 5) call void @Check1(i32 noundef 6) call void @Check2(i32 noundef 6) call void @Check1(i32 noundef 7) call void @Check2(i32 noundef 7) call void @Check1(i32 noundef 8) call void @Check2(i32 noundef 8) call void @Check3(i32 noundef 0, i32 noundef 0) call void @Check3(i32 noundef 0, i32 noundef 3) call void @Check3(i32 noundef 0, i32 noundef 6) call void @Check3(i32 noundef 3, i32 noundef 0) call void @Check3(i32 noundef 3, i32 noundef 3) call void @Check3(i32 noundef 3, i32 noundef 6) call void @Check3(i32 noundef 6, i32 noundef 0) call void @Check3(i32 noundef 6, i32 noundef 3) call void @Check3(i32 noundef 6, i32 noundef 6) %cmp34.not = icmp eq i32 %k.096, 0 br i1 %cmp34.not, label %for.cond39.preheader.preheader, label %if.then if.then: ; preds = %for.body19.preheader %putchar = call i32 @putchar(i32 10) br label %for.cond39.preheader.preheader for.cond39.preheader.preheader: ; preds = %if.then, %for.body19.preheader br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.cond39.preheader.preheader, %for.cond39.preheader %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.cond39.preheader ], [ 0, %for.cond39.preheader.preheader ] %arrayidx45 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 0 %1 = load i8, ptr %arrayidx45, align 1, !tbaa !9 %conv = sext i8 %1 to i32 %arrayidx49 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 0 %2 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %2) %arrayidx45.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 1 %3 = load i8, ptr %arrayidx45.1, align 1, !tbaa !9 %conv.1 = sext i8 %3 to i32 %arrayidx49.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 1 %4 = load i32, ptr %arrayidx49.1, align 4, !tbaa !5 %call50.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.1, i32 noundef %4) %arrayidx45.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 2 %5 = load i8, ptr %arrayidx45.2, align 1, !tbaa !9 %conv.2 = sext i8 %5 to i32 %arrayidx49.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 2 %6 = load i32, ptr %arrayidx49.2, align 4, !tbaa !5 %call50.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.2, i32 noundef %6) %arrayidx45.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 3 %7 = load i8, ptr %arrayidx45.3, align 1, !tbaa !9 %conv.3 = sext i8 %7 to i32 %arrayidx49.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 3 %8 = load i32, ptr %arrayidx49.3, align 4, !tbaa !5 %call50.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.3, i32 noundef %8) %arrayidx45.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 4 %9 = load i8, ptr %arrayidx45.4, align 1, !tbaa !9 %conv.4 = sext i8 %9 to i32 %arrayidx49.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 4 %10 = load i32, ptr %arrayidx49.4, align 4, !tbaa !5 %call50.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.4, i32 noundef %10) %arrayidx45.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 5 %11 = load i8, ptr %arrayidx45.5, align 1, !tbaa !9 %conv.5 = sext i8 %11 to i32 %arrayidx49.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 5 %12 = load i32, ptr %arrayidx49.5, align 4, !tbaa !5 %call50.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.5, i32 noundef %12) %arrayidx45.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 6 %13 = load i8, ptr %arrayidx45.6, align 1, !tbaa !9 %conv.6 = sext i8 %13 to i32 %arrayidx49.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 6 %14 = load i32, ptr %arrayidx49.6, align 4, !tbaa !5 %call50.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.6, i32 noundef %14) %arrayidx45.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 7 %15 = load i8, ptr %arrayidx45.7, align 1, !tbaa !9 %conv.7 = sext i8 %15 to i32 %arrayidx49.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 7 %16 = load i32, ptr %arrayidx49.7, align 4, !tbaa !5 %call50.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.7, i32 noundef %16) %arrayidx45.8 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv104, i64 8 %17 = load i8, ptr %arrayidx45.8, align 1, !tbaa !9 %conv.8 = sext i8 %17 to i32 %arrayidx49.8 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %indvars.iv104, i64 8 %18 = load i32, ptr %arrayidx49.8, align 4, !tbaa !5 %call50.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.8, i32 noundef %18) %putchar87 = call i32 @putchar(i32 10) %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %exitcond107.not = icmp eq i64 %indvars.iv.next105, 9 br i1 %exitcond107.not, label %for.inc58, label %for.cond39.preheader, !llvm.loop !12 for.inc58: ; preds = %for.cond39.preheader %inc59 = add nuw nsw i32 %k.096, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc59, %19 br i1 %cmp, label %for.cond1.preheader, label %for.end60, !llvm.loop !13 for.end60: ; preds = %for.inc58, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Check1(i32 noundef %n) local_unnamed_addr #3 { for.body3.lr.ph: %idxprom4 = sext i32 %n to i64 %arrayidx5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 0, i64 %idxprom4 %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 0, i64 %idxprom4 %arrayidx9 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 1, i64 %idxprom4 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %0, %1 br i1 %cmp10, label %if.then, label %for.inc for.body3.lr.ph.1: ; preds = %if.then.782, %for.inc.677 %arrayidx5.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 1, i64 %idxprom4 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %arrayidx14.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 1, i64 %idxprom4 %arrayidx9.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 2, i64 %idxprom4 %3 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %cmp10.1 = icmp eq i32 %2, %3 br i1 %cmp10.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.body3.lr.ph.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 2, i64 %idxprom4 store i8 42, ptr %arrayidx18.1, align 1, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.body3.lr.ph.1 %arrayidx9.1.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 3, i64 %idxprom4 %4 = load i32, ptr %arrayidx9.1.1, align 4, !tbaa !5 %cmp10.1.1 = icmp eq i32 %2, %4 br i1 %cmp10.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 3, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.1, align 1, !tbaa !9 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.1 %arrayidx9.1.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 4, i64 %idxprom4 %5 = load i32, ptr %arrayidx9.1.2, align 4, !tbaa !5 %cmp10.1.2 = icmp eq i32 %2, %5 br i1 %cmp10.1.2, label %if.then.1.2, label %for.inc.1.2 if.then.1.2: ; preds = %for.inc.1.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 4, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.2, align 1, !tbaa !9 br label %for.inc.1.2 for.inc.1.2: ; preds = %if.then.1.2, %for.inc.1.1 %arrayidx9.1.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %6 = load i32, ptr %arrayidx9.1.3, align 4, !tbaa !5 %cmp10.1.3 = icmp eq i32 %2, %6 br i1 %cmp10.1.3, label %if.then.1.3, label %for.inc.1.3 if.then.1.3: ; preds = %for.inc.1.2 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.3, align 1, !tbaa !9 br label %for.inc.1.3 for.inc.1.3: ; preds = %if.then.1.3, %for.inc.1.2 %arrayidx9.1.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %7 = load i32, ptr %arrayidx9.1.4, align 4, !tbaa !5 %cmp10.1.4 = icmp eq i32 %2, %7 br i1 %cmp10.1.4, label %if.then.1.4, label %for.inc.1.4 if.then.1.4: ; preds = %for.inc.1.3 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.4, align 1, !tbaa !9 br label %for.inc.1.4 for.inc.1.4: ; preds = %if.then.1.4, %for.inc.1.3 %arrayidx9.1.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %8 = load i32, ptr %arrayidx9.1.5, align 4, !tbaa !5 %cmp10.1.5 = icmp eq i32 %2, %8 br i1 %cmp10.1.5, label %if.then.1.5, label %for.inc.1.5 if.then.1.5: ; preds = %for.inc.1.4 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.5, align 1, !tbaa !9 br label %for.inc.1.5 for.inc.1.5: ; preds = %if.then.1.5, %for.inc.1.4 %arrayidx9.1.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %9 = load i32, ptr %arrayidx9.1.6, align 4, !tbaa !5 %cmp10.1.6 = icmp eq i32 %2, %9 br i1 %cmp10.1.6, label %if.then.1.6, label %for.body3.lr.ph.2 if.then.1.6: ; preds = %for.inc.1.5 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.1.6, align 1, !tbaa !9 br label %for.body3.lr.ph.2 for.body3.lr.ph.2: ; preds = %if.then.1.6, %for.inc.1.5 %arrayidx5.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 2, i64 %idxprom4 %10 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5 %arrayidx14.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 2, i64 %idxprom4 %arrayidx9.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 3, i64 %idxprom4 %11 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5 %cmp10.2 = icmp eq i32 %10, %11 br i1 %cmp10.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.body3.lr.ph.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 3, i64 %idxprom4 store i8 42, ptr %arrayidx18.2, align 1, !tbaa !9 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.body3.lr.ph.2 %arrayidx9.2.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 4, i64 %idxprom4 %12 = load i32, ptr %arrayidx9.2.1, align 4, !tbaa !5 %cmp10.2.1 = icmp eq i32 %10, %12 br i1 %cmp10.2.1, label %if.then.2.1, label %for.inc.2.1 if.then.2.1: ; preds = %for.inc.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 4, i64 %idxprom4 store i8 42, ptr %arrayidx18.2.1, align 1, !tbaa !9 br label %for.inc.2.1 for.inc.2.1: ; preds = %if.then.2.1, %for.inc.2 %arrayidx9.2.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %13 = load i32, ptr %arrayidx9.2.2, align 4, !tbaa !5 %cmp10.2.2 = icmp eq i32 %10, %13 br i1 %cmp10.2.2, label %if.then.2.2, label %for.inc.2.2 if.then.2.2: ; preds = %for.inc.2.1 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 store i8 42, ptr %arrayidx18.2.2, align 1, !tbaa !9 br label %for.inc.2.2 for.inc.2.2: ; preds = %if.then.2.2, %for.inc.2.1 %arrayidx9.2.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %14 = load i32, ptr %arrayidx9.2.3, align 4, !tbaa !5 %cmp10.2.3 = icmp eq i32 %10, %14 br i1 %cmp10.2.3, label %if.then.2.3, label %for.inc.2.3 if.then.2.3: ; preds = %for.inc.2.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.2.3, align 1, !tbaa !9 br label %for.inc.2.3 for.inc.2.3: ; preds = %if.then.2.3, %for.inc.2.2 %arrayidx9.2.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %15 = load i32, ptr %arrayidx9.2.4, align 4, !tbaa !5 %cmp10.2.4 = icmp eq i32 %10, %15 br i1 %cmp10.2.4, label %if.then.2.4, label %for.inc.2.4 if.then.2.4: ; preds = %for.inc.2.3 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.2.4, align 1, !tbaa !9 br label %for.inc.2.4 for.inc.2.4: ; preds = %if.then.2.4, %for.inc.2.3 %arrayidx9.2.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %16 = load i32, ptr %arrayidx9.2.5, align 4, !tbaa !5 %cmp10.2.5 = icmp eq i32 %10, %16 br i1 %cmp10.2.5, label %if.then.2.5, label %for.body3.lr.ph.3 if.then.2.5: ; preds = %for.inc.2.4 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.2.5, align 1, !tbaa !9 br label %for.body3.lr.ph.3 for.body3.lr.ph.3: ; preds = %if.then.2.5, %for.inc.2.4 %arrayidx5.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 3, i64 %idxprom4 %17 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %arrayidx14.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 3, i64 %idxprom4 %arrayidx9.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 4, i64 %idxprom4 %18 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5 %cmp10.3 = icmp eq i32 %17, %18 br i1 %cmp10.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.body3.lr.ph.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 4, i64 %idxprom4 store i8 42, ptr %arrayidx18.3, align 1, !tbaa !9 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.body3.lr.ph.3 %arrayidx9.3.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %19 = load i32, ptr %arrayidx9.3.1, align 4, !tbaa !5 %cmp10.3.1 = icmp eq i32 %17, %19 br i1 %cmp10.3.1, label %if.then.3.1, label %for.inc.3.1 if.then.3.1: ; preds = %for.inc.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 store i8 42, ptr %arrayidx18.3.1, align 1, !tbaa !9 br label %for.inc.3.1 for.inc.3.1: ; preds = %if.then.3.1, %for.inc.3 %arrayidx9.3.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %20 = load i32, ptr %arrayidx9.3.2, align 4, !tbaa !5 %cmp10.3.2 = icmp eq i32 %17, %20 br i1 %cmp10.3.2, label %if.then.3.2, label %for.inc.3.2 if.then.3.2: ; preds = %for.inc.3.1 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.3.2, align 1, !tbaa !9 br label %for.inc.3.2 for.inc.3.2: ; preds = %if.then.3.2, %for.inc.3.1 %arrayidx9.3.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %21 = load i32, ptr %arrayidx9.3.3, align 4, !tbaa !5 %cmp10.3.3 = icmp eq i32 %17, %21 br i1 %cmp10.3.3, label %if.then.3.3, label %for.inc.3.3 if.then.3.3: ; preds = %for.inc.3.2 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.3.3, align 1, !tbaa !9 br label %for.inc.3.3 for.inc.3.3: ; preds = %if.then.3.3, %for.inc.3.2 %arrayidx9.3.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %22 = load i32, ptr %arrayidx9.3.4, align 4, !tbaa !5 %cmp10.3.4 = icmp eq i32 %17, %22 br i1 %cmp10.3.4, label %if.then.3.4, label %for.body3.lr.ph.4 if.then.3.4: ; preds = %for.inc.3.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.3.4, align 1, !tbaa !9 br label %for.body3.lr.ph.4 for.body3.lr.ph.4: ; preds = %if.then.3.4, %for.inc.3.3 %arrayidx5.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 4, i64 %idxprom4 %23 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5 %arrayidx14.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 4, i64 %idxprom4 %arrayidx9.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %24 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5 %cmp10.4 = icmp eq i32 %23, %24 br i1 %cmp10.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.body3.lr.ph.4 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 store i8 42, ptr %arrayidx18.4, align 1, !tbaa !9 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.body3.lr.ph.4 %arrayidx9.4.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %25 = load i32, ptr %arrayidx9.4.1, align 4, !tbaa !5 %cmp10.4.1 = icmp eq i32 %23, %25 br i1 %cmp10.4.1, label %if.then.4.1, label %for.inc.4.1 if.then.4.1: ; preds = %for.inc.4 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.4.1, align 1, !tbaa !9 br label %for.inc.4.1 for.inc.4.1: ; preds = %if.then.4.1, %for.inc.4 %arrayidx9.4.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %26 = load i32, ptr %arrayidx9.4.2, align 4, !tbaa !5 %cmp10.4.2 = icmp eq i32 %23, %26 br i1 %cmp10.4.2, label %if.then.4.2, label %for.inc.4.2 if.then.4.2: ; preds = %for.inc.4.1 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.4.2, align 1, !tbaa !9 br label %for.inc.4.2 for.inc.4.2: ; preds = %if.then.4.2, %for.inc.4.1 %arrayidx9.4.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %27 = load i32, ptr %arrayidx9.4.3, align 4, !tbaa !5 %cmp10.4.3 = icmp eq i32 %23, %27 br i1 %cmp10.4.3, label %if.then.4.3, label %for.body3.lr.ph.5 if.then.4.3: ; preds = %for.inc.4.2 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.4.3, align 1, !tbaa !9 br label %for.body3.lr.ph.5 for.body3.lr.ph.5: ; preds = %if.then.4.3, %for.inc.4.2 %arrayidx5.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %28 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %arrayidx14.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 %arrayidx9.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %29 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5 %cmp10.5 = icmp eq i32 %28, %29 br i1 %cmp10.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.body3.lr.ph.5 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.5, align 1, !tbaa !9 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.body3.lr.ph.5 %arrayidx9.5.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %30 = load i32, ptr %arrayidx9.5.1, align 4, !tbaa !5 %cmp10.5.1 = icmp eq i32 %28, %30 br i1 %cmp10.5.1, label %if.then.5.1, label %for.inc.5.1 if.then.5.1: ; preds = %for.inc.5 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.5.1, align 1, !tbaa !9 br label %for.inc.5.1 for.inc.5.1: ; preds = %if.then.5.1, %for.inc.5 %arrayidx9.5.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %31 = load i32, ptr %arrayidx9.5.2, align 4, !tbaa !5 %cmp10.5.2 = icmp eq i32 %28, %31 br i1 %cmp10.5.2, label %if.then.5.2, label %for.body3.lr.ph.6 if.then.5.2: ; preds = %for.inc.5.1 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.5.2, align 1, !tbaa !9 br label %for.body3.lr.ph.6 for.body3.lr.ph.6: ; preds = %if.then.5.2, %for.inc.5.1 %arrayidx5.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %32 = load i32, ptr %arrayidx5.6, align 4, !tbaa !5 %arrayidx14.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 %arrayidx9.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %33 = load i32, ptr %arrayidx9.6, align 4, !tbaa !5 %cmp10.6 = icmp eq i32 %32, %33 br i1 %cmp10.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.body3.lr.ph.6 store i8 42, ptr %arrayidx14.6, align 1, !tbaa !9 %arrayidx18.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.6, align 1, !tbaa !9 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.body3.lr.ph.6 %arrayidx9.6.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %34 = load i32, ptr %arrayidx9.6.1, align 4, !tbaa !5 %cmp10.6.1 = icmp eq i32 %32, %34 br i1 %cmp10.6.1, label %if.then.6.1, label %for.body3.lr.ph.7 if.then.6.1: ; preds = %for.inc.6 store i8 42, ptr %arrayidx14.6, align 1, !tbaa !9 %arrayidx18.6.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.6.1, align 1, !tbaa !9 br label %for.body3.lr.ph.7 for.body3.lr.ph.7: ; preds = %if.then.6.1, %for.inc.6 %arrayidx5.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %35 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %arrayidx9.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %36 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5 %cmp10.7 = icmp eq i32 %35, %36 br i1 %cmp10.7, label %if.then.7, label %for.cond.loopexit.7 if.then.7: ; preds = %for.body3.lr.ph.7 %arrayidx14.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx14.7, align 1, !tbaa !9 %arrayidx18.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.7, align 1, !tbaa !9 br label %for.cond.loopexit.7 for.cond.loopexit.7: ; preds = %for.body3.lr.ph.7, %if.then.7 ret void if.then: ; preds = %for.body3.lr.ph store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 1, i64 %idxprom4 store i8 42, ptr %arrayidx18, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body3.lr.ph, %if.then %arrayidx9.142 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 2, i64 %idxprom4 %37 = load i32, ptr %arrayidx9.142, align 4, !tbaa !5 %cmp10.143 = icmp eq i32 %0, %37 br i1 %cmp10.143, label %if.then.146, label %for.inc.147 if.then.146: ; preds = %for.inc store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.145 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 2, i64 %idxprom4 store i8 42, ptr %arrayidx18.145, align 1, !tbaa !9 br label %for.inc.147 for.inc.147: ; preds = %if.then.146, %for.inc %arrayidx9.248 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 3, i64 %idxprom4 %38 = load i32, ptr %arrayidx9.248, align 4, !tbaa !5 %cmp10.249 = icmp eq i32 %0, %38 br i1 %cmp10.249, label %if.then.252, label %for.inc.253 if.then.252: ; preds = %for.inc.147 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.251 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 3, i64 %idxprom4 store i8 42, ptr %arrayidx18.251, align 1, !tbaa !9 br label %for.inc.253 for.inc.253: ; preds = %if.then.252, %for.inc.147 %arrayidx9.354 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 4, i64 %idxprom4 %39 = load i32, ptr %arrayidx9.354, align 4, !tbaa !5 %cmp10.355 = icmp eq i32 %0, %39 br i1 %cmp10.355, label %if.then.358, label %for.inc.359 if.then.358: ; preds = %for.inc.253 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.357 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 4, i64 %idxprom4 store i8 42, ptr %arrayidx18.357, align 1, !tbaa !9 br label %for.inc.359 for.inc.359: ; preds = %if.then.358, %for.inc.253 %arrayidx9.460 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 5, i64 %idxprom4 %40 = load i32, ptr %arrayidx9.460, align 4, !tbaa !5 %cmp10.461 = icmp eq i32 %0, %40 br i1 %cmp10.461, label %if.then.464, label %for.inc.465 if.then.464: ; preds = %for.inc.359 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.463 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 5, i64 %idxprom4 store i8 42, ptr %arrayidx18.463, align 1, !tbaa !9 br label %for.inc.465 for.inc.465: ; preds = %if.then.464, %for.inc.359 %arrayidx9.566 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 6, i64 %idxprom4 %41 = load i32, ptr %arrayidx9.566, align 4, !tbaa !5 %cmp10.567 = icmp eq i32 %0, %41 br i1 %cmp10.567, label %if.then.570, label %for.inc.571 if.then.570: ; preds = %for.inc.465 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.569 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 6, i64 %idxprom4 store i8 42, ptr %arrayidx18.569, align 1, !tbaa !9 br label %for.inc.571 for.inc.571: ; preds = %if.then.570, %for.inc.465 %arrayidx9.672 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 7, i64 %idxprom4 %42 = load i32, ptr %arrayidx9.672, align 4, !tbaa !5 %cmp10.673 = icmp eq i32 %0, %42 br i1 %cmp10.673, label %if.then.676, label %for.inc.677 if.then.676: ; preds = %for.inc.571 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.675 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 7, i64 %idxprom4 store i8 42, ptr %arrayidx18.675, align 1, !tbaa !9 br label %for.inc.677 for.inc.677: ; preds = %if.then.676, %for.inc.571 %arrayidx9.778 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 8, i64 %idxprom4 %43 = load i32, ptr %arrayidx9.778, align 4, !tbaa !5 %cmp10.779 = icmp eq i32 %0, %43 br i1 %cmp10.779, label %if.then.782, label %for.body3.lr.ph.1 if.then.782: ; preds = %for.inc.677 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.781 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 8, i64 %idxprom4 store i8 42, ptr %arrayidx18.781, align 1, !tbaa !9 br label %for.body3.lr.ph.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Check2(i32 noundef %n) local_unnamed_addr #3 { for.body3.lr.ph: %idxprom = sext i32 %n to i64 %arrayidx5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 0 %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 0 %arrayidx9 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 1 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %0, %1 br i1 %cmp10, label %if.then, label %for.inc for.body3.lr.ph.1: ; preds = %if.then.782, %for.inc.677 %arrayidx5.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 1 %2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %arrayidx14.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 1 %arrayidx9.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 2 %3 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %cmp10.1 = icmp eq i32 %2, %3 br i1 %cmp10.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.body3.lr.ph.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 2 store i8 42, ptr %arrayidx18.1, align 1, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.body3.lr.ph.1 %arrayidx9.1.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 3 %4 = load i32, ptr %arrayidx9.1.1, align 4, !tbaa !5 %cmp10.1.1 = icmp eq i32 %2, %4 br i1 %cmp10.1.1, label %if.then.1.1, label %for.inc.1.1 if.then.1.1: ; preds = %for.inc.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 3 store i8 42, ptr %arrayidx18.1.1, align 1, !tbaa !9 br label %for.inc.1.1 for.inc.1.1: ; preds = %if.then.1.1, %for.inc.1 %arrayidx9.1.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 4 %5 = load i32, ptr %arrayidx9.1.2, align 4, !tbaa !5 %cmp10.1.2 = icmp eq i32 %2, %5 br i1 %cmp10.1.2, label %if.then.1.2, label %for.inc.1.2 if.then.1.2: ; preds = %for.inc.1.1 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 4 store i8 42, ptr %arrayidx18.1.2, align 1, !tbaa !9 br label %for.inc.1.2 for.inc.1.2: ; preds = %if.then.1.2, %for.inc.1.1 %arrayidx9.1.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %6 = load i32, ptr %arrayidx9.1.3, align 4, !tbaa !5 %cmp10.1.3 = icmp eq i32 %2, %6 br i1 %cmp10.1.3, label %if.then.1.3, label %for.inc.1.3 if.then.1.3: ; preds = %for.inc.1.2 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 store i8 42, ptr %arrayidx18.1.3, align 1, !tbaa !9 br label %for.inc.1.3 for.inc.1.3: ; preds = %if.then.1.3, %for.inc.1.2 %arrayidx9.1.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %7 = load i32, ptr %arrayidx9.1.4, align 4, !tbaa !5 %cmp10.1.4 = icmp eq i32 %2, %7 br i1 %cmp10.1.4, label %if.then.1.4, label %for.inc.1.4 if.then.1.4: ; preds = %for.inc.1.3 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.1.4, align 1, !tbaa !9 br label %for.inc.1.4 for.inc.1.4: ; preds = %if.then.1.4, %for.inc.1.3 %arrayidx9.1.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %8 = load i32, ptr %arrayidx9.1.5, align 4, !tbaa !5 %cmp10.1.5 = icmp eq i32 %2, %8 br i1 %cmp10.1.5, label %if.then.1.5, label %for.inc.1.5 if.then.1.5: ; preds = %for.inc.1.4 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.1.5, align 1, !tbaa !9 br label %for.inc.1.5 for.inc.1.5: ; preds = %if.then.1.5, %for.inc.1.4 %arrayidx9.1.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %9 = load i32, ptr %arrayidx9.1.6, align 4, !tbaa !5 %cmp10.1.6 = icmp eq i32 %2, %9 br i1 %cmp10.1.6, label %if.then.1.6, label %for.body3.lr.ph.2 if.then.1.6: ; preds = %for.inc.1.5 store i8 42, ptr %arrayidx14.1, align 1, !tbaa !9 %arrayidx18.1.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.1.6, align 1, !tbaa !9 br label %for.body3.lr.ph.2 for.body3.lr.ph.2: ; preds = %if.then.1.6, %for.inc.1.5 %arrayidx5.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 2 %10 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5 %arrayidx14.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 2 %arrayidx9.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 3 %11 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5 %cmp10.2 = icmp eq i32 %10, %11 br i1 %cmp10.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.body3.lr.ph.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 3 store i8 42, ptr %arrayidx18.2, align 1, !tbaa !9 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.body3.lr.ph.2 %arrayidx9.2.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 4 %12 = load i32, ptr %arrayidx9.2.1, align 4, !tbaa !5 %cmp10.2.1 = icmp eq i32 %10, %12 br i1 %cmp10.2.1, label %if.then.2.1, label %for.inc.2.1 if.then.2.1: ; preds = %for.inc.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 4 store i8 42, ptr %arrayidx18.2.1, align 1, !tbaa !9 br label %for.inc.2.1 for.inc.2.1: ; preds = %if.then.2.1, %for.inc.2 %arrayidx9.2.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %13 = load i32, ptr %arrayidx9.2.2, align 4, !tbaa !5 %cmp10.2.2 = icmp eq i32 %10, %13 br i1 %cmp10.2.2, label %if.then.2.2, label %for.inc.2.2 if.then.2.2: ; preds = %for.inc.2.1 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 store i8 42, ptr %arrayidx18.2.2, align 1, !tbaa !9 br label %for.inc.2.2 for.inc.2.2: ; preds = %if.then.2.2, %for.inc.2.1 %arrayidx9.2.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %14 = load i32, ptr %arrayidx9.2.3, align 4, !tbaa !5 %cmp10.2.3 = icmp eq i32 %10, %14 br i1 %cmp10.2.3, label %if.then.2.3, label %for.inc.2.3 if.then.2.3: ; preds = %for.inc.2.2 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.2.3, align 1, !tbaa !9 br label %for.inc.2.3 for.inc.2.3: ; preds = %if.then.2.3, %for.inc.2.2 %arrayidx9.2.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %15 = load i32, ptr %arrayidx9.2.4, align 4, !tbaa !5 %cmp10.2.4 = icmp eq i32 %10, %15 br i1 %cmp10.2.4, label %if.then.2.4, label %for.inc.2.4 if.then.2.4: ; preds = %for.inc.2.3 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.2.4, align 1, !tbaa !9 br label %for.inc.2.4 for.inc.2.4: ; preds = %if.then.2.4, %for.inc.2.3 %arrayidx9.2.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %16 = load i32, ptr %arrayidx9.2.5, align 4, !tbaa !5 %cmp10.2.5 = icmp eq i32 %10, %16 br i1 %cmp10.2.5, label %if.then.2.5, label %for.body3.lr.ph.3 if.then.2.5: ; preds = %for.inc.2.4 store i8 42, ptr %arrayidx14.2, align 1, !tbaa !9 %arrayidx18.2.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.2.5, align 1, !tbaa !9 br label %for.body3.lr.ph.3 for.body3.lr.ph.3: ; preds = %if.then.2.5, %for.inc.2.4 %arrayidx5.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 3 %17 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %arrayidx14.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 3 %arrayidx9.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 4 %18 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5 %cmp10.3 = icmp eq i32 %17, %18 br i1 %cmp10.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.body3.lr.ph.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 4 store i8 42, ptr %arrayidx18.3, align 1, !tbaa !9 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.body3.lr.ph.3 %arrayidx9.3.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %19 = load i32, ptr %arrayidx9.3.1, align 4, !tbaa !5 %cmp10.3.1 = icmp eq i32 %17, %19 br i1 %cmp10.3.1, label %if.then.3.1, label %for.inc.3.1 if.then.3.1: ; preds = %for.inc.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 store i8 42, ptr %arrayidx18.3.1, align 1, !tbaa !9 br label %for.inc.3.1 for.inc.3.1: ; preds = %if.then.3.1, %for.inc.3 %arrayidx9.3.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %20 = load i32, ptr %arrayidx9.3.2, align 4, !tbaa !5 %cmp10.3.2 = icmp eq i32 %17, %20 br i1 %cmp10.3.2, label %if.then.3.2, label %for.inc.3.2 if.then.3.2: ; preds = %for.inc.3.1 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.3.2, align 1, !tbaa !9 br label %for.inc.3.2 for.inc.3.2: ; preds = %if.then.3.2, %for.inc.3.1 %arrayidx9.3.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %21 = load i32, ptr %arrayidx9.3.3, align 4, !tbaa !5 %cmp10.3.3 = icmp eq i32 %17, %21 br i1 %cmp10.3.3, label %if.then.3.3, label %for.inc.3.3 if.then.3.3: ; preds = %for.inc.3.2 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.3.3, align 1, !tbaa !9 br label %for.inc.3.3 for.inc.3.3: ; preds = %if.then.3.3, %for.inc.3.2 %arrayidx9.3.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %22 = load i32, ptr %arrayidx9.3.4, align 4, !tbaa !5 %cmp10.3.4 = icmp eq i32 %17, %22 br i1 %cmp10.3.4, label %if.then.3.4, label %for.body3.lr.ph.4 if.then.3.4: ; preds = %for.inc.3.3 store i8 42, ptr %arrayidx14.3, align 1, !tbaa !9 %arrayidx18.3.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.3.4, align 1, !tbaa !9 br label %for.body3.lr.ph.4 for.body3.lr.ph.4: ; preds = %if.then.3.4, %for.inc.3.3 %arrayidx5.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 4 %23 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5 %arrayidx14.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 4 %arrayidx9.4 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %24 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5 %cmp10.4 = icmp eq i32 %23, %24 br i1 %cmp10.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.body3.lr.ph.4 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 store i8 42, ptr %arrayidx18.4, align 1, !tbaa !9 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.body3.lr.ph.4 %arrayidx9.4.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %25 = load i32, ptr %arrayidx9.4.1, align 4, !tbaa !5 %cmp10.4.1 = icmp eq i32 %23, %25 br i1 %cmp10.4.1, label %if.then.4.1, label %for.inc.4.1 if.then.4.1: ; preds = %for.inc.4 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.4.1, align 1, !tbaa !9 br label %for.inc.4.1 for.inc.4.1: ; preds = %if.then.4.1, %for.inc.4 %arrayidx9.4.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %26 = load i32, ptr %arrayidx9.4.2, align 4, !tbaa !5 %cmp10.4.2 = icmp eq i32 %23, %26 br i1 %cmp10.4.2, label %if.then.4.2, label %for.inc.4.2 if.then.4.2: ; preds = %for.inc.4.1 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.4.2, align 1, !tbaa !9 br label %for.inc.4.2 for.inc.4.2: ; preds = %if.then.4.2, %for.inc.4.1 %arrayidx9.4.3 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %27 = load i32, ptr %arrayidx9.4.3, align 4, !tbaa !5 %cmp10.4.3 = icmp eq i32 %23, %27 br i1 %cmp10.4.3, label %if.then.4.3, label %for.body3.lr.ph.5 if.then.4.3: ; preds = %for.inc.4.2 store i8 42, ptr %arrayidx14.4, align 1, !tbaa !9 %arrayidx18.4.3 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.4.3, align 1, !tbaa !9 br label %for.body3.lr.ph.5 for.body3.lr.ph.5: ; preds = %if.then.4.3, %for.inc.4.2 %arrayidx5.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %28 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5 %arrayidx14.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 %arrayidx9.5 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %29 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5 %cmp10.5 = icmp eq i32 %28, %29 br i1 %cmp10.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.body3.lr.ph.5 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.5, align 1, !tbaa !9 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.body3.lr.ph.5 %arrayidx9.5.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %30 = load i32, ptr %arrayidx9.5.1, align 4, !tbaa !5 %cmp10.5.1 = icmp eq i32 %28, %30 br i1 %cmp10.5.1, label %if.then.5.1, label %for.inc.5.1 if.then.5.1: ; preds = %for.inc.5 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.5.1, align 1, !tbaa !9 br label %for.inc.5.1 for.inc.5.1: ; preds = %if.then.5.1, %for.inc.5 %arrayidx9.5.2 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %31 = load i32, ptr %arrayidx9.5.2, align 4, !tbaa !5 %cmp10.5.2 = icmp eq i32 %28, %31 br i1 %cmp10.5.2, label %if.then.5.2, label %for.body3.lr.ph.6 if.then.5.2: ; preds = %for.inc.5.1 store i8 42, ptr %arrayidx14.5, align 1, !tbaa !9 %arrayidx18.5.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.5.2, align 1, !tbaa !9 br label %for.body3.lr.ph.6 for.body3.lr.ph.6: ; preds = %if.then.5.2, %for.inc.5.1 %arrayidx5.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %32 = load i32, ptr %arrayidx5.6, align 4, !tbaa !5 %arrayidx14.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 %arrayidx9.6 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %33 = load i32, ptr %arrayidx9.6, align 4, !tbaa !5 %cmp10.6 = icmp eq i32 %32, %33 br i1 %cmp10.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.body3.lr.ph.6 store i8 42, ptr %arrayidx14.6, align 1, !tbaa !9 %arrayidx18.6 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.6, align 1, !tbaa !9 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.body3.lr.ph.6 %arrayidx9.6.1 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %34 = load i32, ptr %arrayidx9.6.1, align 4, !tbaa !5 %cmp10.6.1 = icmp eq i32 %32, %34 br i1 %cmp10.6.1, label %if.then.6.1, label %for.body3.lr.ph.7 if.then.6.1: ; preds = %for.inc.6 store i8 42, ptr %arrayidx14.6, align 1, !tbaa !9 %arrayidx18.6.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.6.1, align 1, !tbaa !9 br label %for.body3.lr.ph.7 for.body3.lr.ph.7: ; preds = %if.then.6.1, %for.inc.6 %arrayidx5.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %35 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5 %arrayidx9.7 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %36 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5 %cmp10.7 = icmp eq i32 %35, %36 br i1 %cmp10.7, label %if.then.7, label %for.cond.loopexit.7 if.then.7: ; preds = %for.body3.lr.ph.7 %arrayidx14.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx14.7, align 1, !tbaa !9 %arrayidx18.7 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.7, align 1, !tbaa !9 br label %for.cond.loopexit.7 for.cond.loopexit.7: ; preds = %for.body3.lr.ph.7, %if.then.7 ret void if.then: ; preds = %for.body3.lr.ph store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 1 store i8 42, ptr %arrayidx18, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body3.lr.ph, %if.then %arrayidx9.142 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 2 %37 = load i32, ptr %arrayidx9.142, align 4, !tbaa !5 %cmp10.143 = icmp eq i32 %0, %37 br i1 %cmp10.143, label %if.then.146, label %for.inc.147 if.then.146: ; preds = %for.inc store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.145 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 2 store i8 42, ptr %arrayidx18.145, align 1, !tbaa !9 br label %for.inc.147 for.inc.147: ; preds = %if.then.146, %for.inc %arrayidx9.248 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 3 %38 = load i32, ptr %arrayidx9.248, align 4, !tbaa !5 %cmp10.249 = icmp eq i32 %0, %38 br i1 %cmp10.249, label %if.then.252, label %for.inc.253 if.then.252: ; preds = %for.inc.147 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.251 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 3 store i8 42, ptr %arrayidx18.251, align 1, !tbaa !9 br label %for.inc.253 for.inc.253: ; preds = %if.then.252, %for.inc.147 %arrayidx9.354 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 4 %39 = load i32, ptr %arrayidx9.354, align 4, !tbaa !5 %cmp10.355 = icmp eq i32 %0, %39 br i1 %cmp10.355, label %if.then.358, label %for.inc.359 if.then.358: ; preds = %for.inc.253 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.357 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 4 store i8 42, ptr %arrayidx18.357, align 1, !tbaa !9 br label %for.inc.359 for.inc.359: ; preds = %if.then.358, %for.inc.253 %arrayidx9.460 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 5 %40 = load i32, ptr %arrayidx9.460, align 4, !tbaa !5 %cmp10.461 = icmp eq i32 %0, %40 br i1 %cmp10.461, label %if.then.464, label %for.inc.465 if.then.464: ; preds = %for.inc.359 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.463 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 5 store i8 42, ptr %arrayidx18.463, align 1, !tbaa !9 br label %for.inc.465 for.inc.465: ; preds = %if.then.464, %for.inc.359 %arrayidx9.566 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 6 %41 = load i32, ptr %arrayidx9.566, align 4, !tbaa !5 %cmp10.567 = icmp eq i32 %0, %41 br i1 %cmp10.567, label %if.then.570, label %for.inc.571 if.then.570: ; preds = %for.inc.465 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.569 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 6 store i8 42, ptr %arrayidx18.569, align 1, !tbaa !9 br label %for.inc.571 for.inc.571: ; preds = %if.then.570, %for.inc.465 %arrayidx9.672 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 7 %42 = load i32, ptr %arrayidx9.672, align 4, !tbaa !5 %cmp10.673 = icmp eq i32 %0, %42 br i1 %cmp10.673, label %if.then.676, label %for.inc.677 if.then.676: ; preds = %for.inc.571 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.675 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 7 store i8 42, ptr %arrayidx18.675, align 1, !tbaa !9 br label %for.inc.677 for.inc.677: ; preds = %if.then.676, %for.inc.571 %arrayidx9.778 = getelementptr inbounds [9 x [9 x i32]], ptr @data, i64 0, i64 %idxprom, i64 8 %43 = load i32, ptr %arrayidx9.778, align 4, !tbaa !5 %cmp10.779 = icmp eq i32 %0, %43 br i1 %cmp10.779, label %if.then.782, label %for.body3.lr.ph.1 if.then.782: ; preds = %for.inc.677 store i8 42, ptr %arrayidx14, align 1, !tbaa !9 %arrayidx18.781 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %idxprom, i64 8 store i8 42, ptr %arrayidx18.781, align 1, !tbaa !9 br label %for.body3.lr.ph.1 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Check3(i32 noundef %n, i32 noundef %m) local_unnamed_addr #4 { for.body21.lr.ph: %check = alloca [9 x i32], align 16 %_correct = alloca [9 x i8], align 1 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %check) call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %_correct) #9 %add = add nsw i32 %n, 3 %0 = add i32 %m, 2 %smax = tail call i32 @llvm.smax.i32(i32 %m, i32 %0) %1 = sub i32 %smax, %m %2 = zext i32 %1 to i64 %3 = add nuw nsw i64 %2, 1 %4 = sext i32 %n to i64 %5 = mul nsw i64 %4, 36 %6 = sext i32 %m to i64 %7 = shl nsw i64 %6, 2 %8 = add nsw i64 %5, %7 %9 = shl nuw nsw i64 %2, 2 %10 = add nuw nsw i64 %9, 4 %scevgep103 = getelementptr i8, ptr @data, i64 %8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %_correct, i8 32, i64 %3, i1 false), !tbaa !9 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %check, ptr noundef nonnull align 4 dereferenceable(1) %scevgep103, i64 %10, i1 false), !tbaa !5 %11 = getelementptr i8, ptr @data, i64 %8 %scevgep103.1 = getelementptr i8, ptr %11, i64 36 %scevgep.1 = getelementptr inbounds i8, ptr %_correct, i64 3 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep.1, i8 32, i64 %3, i1 false), !tbaa !9 %check.12.sroa_idx259 = getelementptr inbounds i8, ptr %check, i64 12 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %check.12.sroa_idx259, ptr noundef nonnull align 4 dereferenceable(1) %scevgep103.1, i64 %10, i1 false), !tbaa !5 %12 = getelementptr i8, ptr @data, i64 %8 %scevgep103.2 = getelementptr i8, ptr %12, i64 72 %scevgep.2 = getelementptr inbounds i8, ptr %_correct, i64 6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep.2, i8 32, i64 %3, i1 false), !tbaa !9 %check.24.sroa_idx275 = getelementptr inbounds i8, ptr %check, i64 24 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %check.24.sroa_idx275, ptr noundef nonnull align 4 dereferenceable(1) %scevgep103.2, i64 %10, i1 false), !tbaa !5 %check.0.check.0. = load i32, ptr %check, align 16, !tbaa !5 %check.4.sroa_idx254 = getelementptr inbounds i8, ptr %check, i64 4 %check.4.check.4. = load i32, ptr %check.4.sroa_idx254, align 4, !tbaa !5 %cmp26 = icmp eq i32 %check.0.check.0., %check.4.check.4. br i1 %cmp26, label %if.then, label %for.inc31 for.body21.lr.ph.1: ; preds = %if.then.7160, %for.inc31.6155 %check.4.sroa_idx255 = getelementptr inbounds i8, ptr %check, i64 4 %check.4.check.4.183 = load i32, ptr %check.4.sroa_idx255, align 4, !tbaa !5 %arrayidx28.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 1 %check.8.sroa_idx256 = getelementptr inbounds i8, ptr %check, i64 8 %check.8.check.8. = load i32, ptr %check.8.sroa_idx256, align 8, !tbaa !5 %cmp26.1 = icmp eq i32 %check.4.check.4.183, %check.8.check.8. br i1 %cmp26.1, label %if.then.1, label %for.inc31.1 if.then.1: ; preds = %for.body21.lr.ph.1 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 2 store i8 42, ptr %arrayidx30.1, align 1, !tbaa !9 br label %for.inc31.1 for.inc31.1: ; preds = %if.then.1, %for.body21.lr.ph.1 %check.12.sroa_idx262 = getelementptr inbounds i8, ptr %check, i64 12 %check.12.check.12.192 = load i32, ptr %check.12.sroa_idx262, align 4, !tbaa !5 %cmp26.1.1 = icmp eq i32 %check.4.check.4.183, %check.12.check.12.192 br i1 %cmp26.1.1, label %if.then.1.1, label %for.inc31.1.1 if.then.1.1: ; preds = %for.inc31.1 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 3 store i8 42, ptr %arrayidx30.1.1, align 1, !tbaa !9 br label %for.inc31.1.1 for.inc31.1.1: ; preds = %if.then.1.1, %for.inc31.1 %check.16.sroa_idx267 = getelementptr inbounds i8, ptr %check, i64 16 %check.16.check.16.200 = load i32, ptr %check.16.sroa_idx267, align 16, !tbaa !5 %cmp26.1.2 = icmp eq i32 %check.4.check.4.183, %check.16.check.16.200 br i1 %cmp26.1.2, label %if.then.1.2, label %for.inc31.1.2 if.then.1.2: ; preds = %for.inc31.1.1 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 4 store i8 42, ptr %arrayidx30.1.2, align 1, !tbaa !9 br label %for.inc31.1.2 for.inc31.1.2: ; preds = %if.then.1.2, %for.inc31.1.1 %check.20.sroa_idx273 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20.210 = load i32, ptr %check.20.sroa_idx273, align 4, !tbaa !5 %cmp26.1.3 = icmp eq i32 %check.4.check.4.183, %check.20.check.20.210 br i1 %cmp26.1.3, label %if.then.1.3, label %for.inc31.1.3 if.then.1.3: ; preds = %for.inc31.1.2 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 store i8 42, ptr %arrayidx30.1.3, align 1, !tbaa !9 br label %for.inc31.1.3 for.inc31.1.3: ; preds = %if.then.1.3, %for.inc31.1.2 %check.24.sroa_idx281 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.223 = load i32, ptr %check.24.sroa_idx281, align 8, !tbaa !5 %cmp26.1.4 = icmp eq i32 %check.4.check.4.183, %check.24.check.24.223 br i1 %cmp26.1.4, label %if.then.1.4, label %for.inc31.1.4 if.then.1.4: ; preds = %for.inc31.1.3 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.4 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.1.4, align 1, !tbaa !9 br label %for.inc31.1.4 for.inc31.1.4: ; preds = %if.then.1.4, %for.inc31.1.3 %check.28.sroa_idx289 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.237 = load i32, ptr %check.28.sroa_idx289, align 4, !tbaa !5 %cmp26.1.5 = icmp eq i32 %check.4.check.4.183, %check.28.check.28.237 br i1 %cmp26.1.5, label %if.then.1.5, label %for.inc31.1.5 if.then.1.5: ; preds = %for.inc31.1.4 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.5 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.1.5, align 1, !tbaa !9 br label %for.inc31.1.5 for.inc31.1.5: ; preds = %if.then.1.5, %for.inc31.1.4 %check.32.sroa_idx297 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.251 = load i32, ptr %check.32.sroa_idx297, align 16, !tbaa !5 %cmp26.1.6 = icmp eq i32 %check.4.check.4.183, %check.32.check.32.251 br i1 %cmp26.1.6, label %if.then.1.6, label %for.body21.lr.ph.2 if.then.1.6: ; preds = %for.inc31.1.5 store i8 42, ptr %arrayidx28.1, align 1, !tbaa !9 %arrayidx30.1.6 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.1.6, align 1, !tbaa !9 br label %for.body21.lr.ph.2 for.body21.lr.ph.2: ; preds = %if.then.1.6, %for.inc31.1.5 %check.8.sroa_idx257 = getelementptr inbounds i8, ptr %check, i64 8 %check.8.check.8.185 = load i32, ptr %check.8.sroa_idx257, align 8, !tbaa !5 %arrayidx28.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 2 %check.12.sroa_idx260 = getelementptr inbounds i8, ptr %check, i64 12 %check.12.check.12. = load i32, ptr %check.12.sroa_idx260, align 4, !tbaa !5 %cmp26.2 = icmp eq i32 %check.8.check.8.185, %check.12.check.12. br i1 %cmp26.2, label %if.then.2, label %for.inc31.2 if.then.2: ; preds = %for.body21.lr.ph.2 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 3 store i8 42, ptr %arrayidx30.2, align 1, !tbaa !9 br label %for.inc31.2 for.inc31.2: ; preds = %if.then.2, %for.body21.lr.ph.2 %check.16.sroa_idx266 = getelementptr inbounds i8, ptr %check, i64 16 %check.16.check.16.198 = load i32, ptr %check.16.sroa_idx266, align 16, !tbaa !5 %cmp26.2.1 = icmp eq i32 %check.8.check.8.185, %check.16.check.16.198 br i1 %cmp26.2.1, label %if.then.2.1, label %for.inc31.2.1 if.then.2.1: ; preds = %for.inc31.2 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 4 store i8 42, ptr %arrayidx30.2.1, align 1, !tbaa !9 br label %for.inc31.2.1 for.inc31.2.1: ; preds = %if.then.2.1, %for.inc31.2 %check.20.sroa_idx272 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20.208 = load i32, ptr %check.20.sroa_idx272, align 4, !tbaa !5 %cmp26.2.2 = icmp eq i32 %check.8.check.8.185, %check.20.check.20.208 br i1 %cmp26.2.2, label %if.then.2.2, label %for.inc31.2.2 if.then.2.2: ; preds = %for.inc31.2.1 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 store i8 42, ptr %arrayidx30.2.2, align 1, !tbaa !9 br label %for.inc31.2.2 for.inc31.2.2: ; preds = %if.then.2.2, %for.inc31.2.1 %check.24.sroa_idx280 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.221 = load i32, ptr %check.24.sroa_idx280, align 8, !tbaa !5 %cmp26.2.3 = icmp eq i32 %check.8.check.8.185, %check.24.check.24.221 br i1 %cmp26.2.3, label %if.then.2.3, label %for.inc31.2.3 if.then.2.3: ; preds = %for.inc31.2.2 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.2.3, align 1, !tbaa !9 br label %for.inc31.2.3 for.inc31.2.3: ; preds = %if.then.2.3, %for.inc31.2.2 %check.28.sroa_idx288 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.235 = load i32, ptr %check.28.sroa_idx288, align 4, !tbaa !5 %cmp26.2.4 = icmp eq i32 %check.8.check.8.185, %check.28.check.28.235 br i1 %cmp26.2.4, label %if.then.2.4, label %for.inc31.2.4 if.then.2.4: ; preds = %for.inc31.2.3 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2.4 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.2.4, align 1, !tbaa !9 br label %for.inc31.2.4 for.inc31.2.4: ; preds = %if.then.2.4, %for.inc31.2.3 %check.32.sroa_idx296 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.249 = load i32, ptr %check.32.sroa_idx296, align 16, !tbaa !5 %cmp26.2.5 = icmp eq i32 %check.8.check.8.185, %check.32.check.32.249 br i1 %cmp26.2.5, label %if.then.2.5, label %for.body21.lr.ph.3 if.then.2.5: ; preds = %for.inc31.2.4 store i8 42, ptr %arrayidx28.2, align 1, !tbaa !9 %arrayidx30.2.5 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.2.5, align 1, !tbaa !9 br label %for.body21.lr.ph.3 for.body21.lr.ph.3: ; preds = %if.then.2.5, %for.inc31.2.4 %check.12.sroa_idx261 = getelementptr inbounds i8, ptr %check, i64 12 %check.12.check.12.190 = load i32, ptr %check.12.sroa_idx261, align 4, !tbaa !5 %arrayidx28.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 3 %check.16.sroa_idx264 = getelementptr inbounds i8, ptr %check, i64 16 %check.16.check.16. = load i32, ptr %check.16.sroa_idx264, align 16, !tbaa !5 %cmp26.3 = icmp eq i32 %check.12.check.12.190, %check.16.check.16. br i1 %cmp26.3, label %if.then.3, label %for.inc31.3 if.then.3: ; preds = %for.body21.lr.ph.3 store i8 42, ptr %arrayidx28.3, align 1, !tbaa !9 %arrayidx30.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 4 store i8 42, ptr %arrayidx30.3, align 1, !tbaa !9 br label %for.inc31.3 for.inc31.3: ; preds = %if.then.3, %for.body21.lr.ph.3 %check.20.sroa_idx271 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20.206 = load i32, ptr %check.20.sroa_idx271, align 4, !tbaa !5 %cmp26.3.1 = icmp eq i32 %check.12.check.12.190, %check.20.check.20.206 br i1 %cmp26.3.1, label %if.then.3.1, label %for.inc31.3.1 if.then.3.1: ; preds = %for.inc31.3 store i8 42, ptr %arrayidx28.3, align 1, !tbaa !9 %arrayidx30.3.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 store i8 42, ptr %arrayidx30.3.1, align 1, !tbaa !9 br label %for.inc31.3.1 for.inc31.3.1: ; preds = %if.then.3.1, %for.inc31.3 %check.24.sroa_idx279 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.219 = load i32, ptr %check.24.sroa_idx279, align 8, !tbaa !5 %cmp26.3.2 = icmp eq i32 %check.12.check.12.190, %check.24.check.24.219 br i1 %cmp26.3.2, label %if.then.3.2, label %for.inc31.3.2 if.then.3.2: ; preds = %for.inc31.3.1 store i8 42, ptr %arrayidx28.3, align 1, !tbaa !9 %arrayidx30.3.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.3.2, align 1, !tbaa !9 br label %for.inc31.3.2 for.inc31.3.2: ; preds = %if.then.3.2, %for.inc31.3.1 %check.28.sroa_idx287 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.233 = load i32, ptr %check.28.sroa_idx287, align 4, !tbaa !5 %cmp26.3.3 = icmp eq i32 %check.12.check.12.190, %check.28.check.28.233 br i1 %cmp26.3.3, label %if.then.3.3, label %for.inc31.3.3 if.then.3.3: ; preds = %for.inc31.3.2 store i8 42, ptr %arrayidx28.3, align 1, !tbaa !9 %arrayidx30.3.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.3.3, align 1, !tbaa !9 br label %for.inc31.3.3 for.inc31.3.3: ; preds = %if.then.3.3, %for.inc31.3.2 %check.32.sroa_idx295 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.247 = load i32, ptr %check.32.sroa_idx295, align 16, !tbaa !5 %cmp26.3.4 = icmp eq i32 %check.12.check.12.190, %check.32.check.32.247 br i1 %cmp26.3.4, label %if.then.3.4, label %for.body21.lr.ph.4 if.then.3.4: ; preds = %for.inc31.3.3 store i8 42, ptr %arrayidx28.3, align 1, !tbaa !9 %arrayidx30.3.4 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.3.4, align 1, !tbaa !9 br label %for.body21.lr.ph.4 for.body21.lr.ph.4: ; preds = %if.then.3.4, %for.inc31.3.3 %check.16.sroa_idx265 = getelementptr inbounds i8, ptr %check, i64 16 %check.16.check.16.196 = load i32, ptr %check.16.sroa_idx265, align 16, !tbaa !5 %arrayidx28.4 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 4 %check.20.sroa_idx269 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20. = load i32, ptr %check.20.sroa_idx269, align 4, !tbaa !5 %cmp26.4 = icmp eq i32 %check.16.check.16.196, %check.20.check.20. br i1 %cmp26.4, label %if.then.4, label %for.inc31.4 if.then.4: ; preds = %for.body21.lr.ph.4 store i8 42, ptr %arrayidx28.4, align 1, !tbaa !9 %arrayidx30.4 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 store i8 42, ptr %arrayidx30.4, align 1, !tbaa !9 br label %for.inc31.4 for.inc31.4: ; preds = %if.then.4, %for.body21.lr.ph.4 %check.24.sroa_idx278 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.217 = load i32, ptr %check.24.sroa_idx278, align 8, !tbaa !5 %cmp26.4.1 = icmp eq i32 %check.16.check.16.196, %check.24.check.24.217 br i1 %cmp26.4.1, label %if.then.4.1, label %for.inc31.4.1 if.then.4.1: ; preds = %for.inc31.4 store i8 42, ptr %arrayidx28.4, align 1, !tbaa !9 %arrayidx30.4.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.4.1, align 1, !tbaa !9 br label %for.inc31.4.1 for.inc31.4.1: ; preds = %if.then.4.1, %for.inc31.4 %check.28.sroa_idx286 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.231 = load i32, ptr %check.28.sroa_idx286, align 4, !tbaa !5 %cmp26.4.2 = icmp eq i32 %check.16.check.16.196, %check.28.check.28.231 br i1 %cmp26.4.2, label %if.then.4.2, label %for.inc31.4.2 if.then.4.2: ; preds = %for.inc31.4.1 store i8 42, ptr %arrayidx28.4, align 1, !tbaa !9 %arrayidx30.4.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.4.2, align 1, !tbaa !9 br label %for.inc31.4.2 for.inc31.4.2: ; preds = %if.then.4.2, %for.inc31.4.1 %check.32.sroa_idx294 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.245 = load i32, ptr %check.32.sroa_idx294, align 16, !tbaa !5 %cmp26.4.3 = icmp eq i32 %check.16.check.16.196, %check.32.check.32.245 br i1 %cmp26.4.3, label %if.then.4.3, label %for.body21.lr.ph.5 if.then.4.3: ; preds = %for.inc31.4.2 store i8 42, ptr %arrayidx28.4, align 1, !tbaa !9 %arrayidx30.4.3 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.4.3, align 1, !tbaa !9 br label %for.body21.lr.ph.5 for.body21.lr.ph.5: ; preds = %if.then.4.3, %for.inc31.4.2 %check.20.sroa_idx270 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20.204 = load i32, ptr %check.20.sroa_idx270, align 4, !tbaa !5 %arrayidx28.5 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 %check.24.sroa_idx276 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24. = load i32, ptr %check.24.sroa_idx276, align 8, !tbaa !5 %cmp26.5 = icmp eq i32 %check.20.check.20.204, %check.24.check.24. br i1 %cmp26.5, label %if.then.5, label %for.inc31.5 if.then.5: ; preds = %for.body21.lr.ph.5 store i8 42, ptr %arrayidx28.5, align 1, !tbaa !9 %arrayidx30.5 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.5, align 1, !tbaa !9 br label %for.inc31.5 for.inc31.5: ; preds = %if.then.5, %for.body21.lr.ph.5 %check.28.sroa_idx285 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.229 = load i32, ptr %check.28.sroa_idx285, align 4, !tbaa !5 %cmp26.5.1 = icmp eq i32 %check.20.check.20.204, %check.28.check.28.229 br i1 %cmp26.5.1, label %if.then.5.1, label %for.inc31.5.1 if.then.5.1: ; preds = %for.inc31.5 store i8 42, ptr %arrayidx28.5, align 1, !tbaa !9 %arrayidx30.5.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.5.1, align 1, !tbaa !9 br label %for.inc31.5.1 for.inc31.5.1: ; preds = %if.then.5.1, %for.inc31.5 %check.32.sroa_idx293 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.243 = load i32, ptr %check.32.sroa_idx293, align 16, !tbaa !5 %cmp26.5.2 = icmp eq i32 %check.20.check.20.204, %check.32.check.32.243 br i1 %cmp26.5.2, label %if.then.5.2, label %for.body21.lr.ph.6 if.then.5.2: ; preds = %for.inc31.5.1 store i8 42, ptr %arrayidx28.5, align 1, !tbaa !9 %arrayidx30.5.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.5.2, align 1, !tbaa !9 br label %for.body21.lr.ph.6 for.body21.lr.ph.6: ; preds = %if.then.5.2, %for.inc31.5.1 %check.24.sroa_idx277 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.215 = load i32, ptr %check.24.sroa_idx277, align 8, !tbaa !5 %arrayidx28.6 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 %check.28.sroa_idx283 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28. = load i32, ptr %check.28.sroa_idx283, align 4, !tbaa !5 %cmp26.6 = icmp eq i32 %check.24.check.24.215, %check.28.check.28. br i1 %cmp26.6, label %if.then.6, label %for.inc31.6 if.then.6: ; preds = %for.body21.lr.ph.6 store i8 42, ptr %arrayidx28.6, align 1, !tbaa !9 %arrayidx30.6 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.6, align 1, !tbaa !9 br label %for.inc31.6 for.inc31.6: ; preds = %if.then.6, %for.body21.lr.ph.6 %check.32.sroa_idx292 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.241 = load i32, ptr %check.32.sroa_idx292, align 16, !tbaa !5 %cmp26.6.1 = icmp eq i32 %check.24.check.24.215, %check.32.check.32.241 br i1 %cmp26.6.1, label %if.then.6.1, label %for.body21.lr.ph.7 if.then.6.1: ; preds = %for.inc31.6 store i8 42, ptr %arrayidx28.6, align 1, !tbaa !9 %arrayidx30.6.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.6.1, align 1, !tbaa !9 br label %for.body21.lr.ph.7 for.body21.lr.ph.7: ; preds = %if.then.6.1, %for.inc31.6 %check.28.sroa_idx284 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.227 = load i32, ptr %check.28.sroa_idx284, align 4, !tbaa !5 %check.32.sroa_idx291 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32. = load i32, ptr %check.32.sroa_idx291, align 16, !tbaa !5 %cmp26.7 = icmp eq i32 %check.28.check.28.227, %check.32.check.32. br i1 %cmp26.7, label %if.then.7, label %for.cond15.loopexit.7 if.then.7: ; preds = %for.body21.lr.ph.7 %arrayidx28.7 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx28.7, align 1, !tbaa !9 %arrayidx30.7 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.7, align 1, !tbaa !9 br label %for.cond15.loopexit.7 for.cond15.loopexit.7: ; preds = %for.body21.lr.ph.7, %if.then.7 %13 = add i32 %smax, 1 %14 = sext i32 %add to i64 %15 = load i8, ptr %_correct, align 1, !tbaa !9 %cmp47 = icmp eq i8 %15, 42 br i1 %cmp47, label %if.then49, label %for.inc55 if.then: ; preds = %for.body21.lr.ph store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 1 store i8 42, ptr %arrayidx30, align 1, !tbaa !9 br label %for.inc31 for.inc31: ; preds = %for.body21.lr.ph, %if.then %check.8.sroa_idx258 = getelementptr inbounds i8, ptr %check, i64 8 %check.8.check.8.187 = load i32, ptr %check.8.sroa_idx258, align 8, !tbaa !5 %cmp26.1121 = icmp eq i32 %check.0.check.0., %check.8.check.8.187 br i1 %cmp26.1121, label %if.then.1124, label %for.inc31.1125 if.then.1124: ; preds = %for.inc31 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.1123 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 2 store i8 42, ptr %arrayidx30.1123, align 1, !tbaa !9 br label %for.inc31.1125 for.inc31.1125: ; preds = %if.then.1124, %for.inc31 %check.12.sroa_idx263 = getelementptr inbounds i8, ptr %check, i64 12 %check.12.check.12.194 = load i32, ptr %check.12.sroa_idx263, align 4, !tbaa !5 %cmp26.2127 = icmp eq i32 %check.0.check.0., %check.12.check.12.194 br i1 %cmp26.2127, label %if.then.2130, label %for.inc31.2131 if.then.2130: ; preds = %for.inc31.1125 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.2129 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 3 store i8 42, ptr %arrayidx30.2129, align 1, !tbaa !9 br label %for.inc31.2131 for.inc31.2131: ; preds = %if.then.2130, %for.inc31.1125 %check.16.sroa_idx268 = getelementptr inbounds i8, ptr %check, i64 16 %check.16.check.16.202 = load i32, ptr %check.16.sroa_idx268, align 16, !tbaa !5 %cmp26.3133 = icmp eq i32 %check.0.check.0., %check.16.check.16.202 br i1 %cmp26.3133, label %if.then.3136, label %for.inc31.3137 if.then.3136: ; preds = %for.inc31.2131 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.3135 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 4 store i8 42, ptr %arrayidx30.3135, align 1, !tbaa !9 br label %for.inc31.3137 for.inc31.3137: ; preds = %if.then.3136, %for.inc31.2131 %check.20.sroa_idx274 = getelementptr inbounds i8, ptr %check, i64 20 %check.20.check.20.212 = load i32, ptr %check.20.sroa_idx274, align 4, !tbaa !5 %cmp26.4139 = icmp eq i32 %check.0.check.0., %check.20.check.20.212 br i1 %cmp26.4139, label %if.then.4142, label %for.inc31.4143 if.then.4142: ; preds = %for.inc31.3137 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.4141 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 5 store i8 42, ptr %arrayidx30.4141, align 1, !tbaa !9 br label %for.inc31.4143 for.inc31.4143: ; preds = %if.then.4142, %for.inc31.3137 %check.24.sroa_idx282 = getelementptr inbounds i8, ptr %check, i64 24 %check.24.check.24.225 = load i32, ptr %check.24.sroa_idx282, align 8, !tbaa !5 %cmp26.5145 = icmp eq i32 %check.0.check.0., %check.24.check.24.225 br i1 %cmp26.5145, label %if.then.5148, label %for.inc31.5149 if.then.5148: ; preds = %for.inc31.4143 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.5147 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 6 store i8 42, ptr %arrayidx30.5147, align 1, !tbaa !9 br label %for.inc31.5149 for.inc31.5149: ; preds = %if.then.5148, %for.inc31.4143 %check.28.sroa_idx290 = getelementptr inbounds i8, ptr %check, i64 28 %check.28.check.28.239 = load i32, ptr %check.28.sroa_idx290, align 4, !tbaa !5 %cmp26.6151 = icmp eq i32 %check.0.check.0., %check.28.check.28.239 br i1 %cmp26.6151, label %if.then.6154, label %for.inc31.6155 if.then.6154: ; preds = %for.inc31.5149 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.6153 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 7 store i8 42, ptr %arrayidx30.6153, align 1, !tbaa !9 br label %for.inc31.6155 for.inc31.6155: ; preds = %if.then.6154, %for.inc31.5149 %check.32.sroa_idx298 = getelementptr inbounds i8, ptr %check, i64 32 %check.32.check.32.253 = load i32, ptr %check.32.sroa_idx298, align 16, !tbaa !5 %cmp26.7157 = icmp eq i32 %check.0.check.0., %check.32.check.32.253 br i1 %cmp26.7157, label %if.then.7160, label %for.body21.lr.ph.1 if.then.7160: ; preds = %for.inc31.6155 store i8 42, ptr %_correct, align 1, !tbaa !9 %arrayidx30.7159 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 8 store i8 42, ptr %arrayidx30.7159, align 1, !tbaa !9 br label %for.body21.lr.ph.1 if.then49: ; preds = %for.cond15.loopexit.7 %arrayidx53 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %4, i64 %6 store i8 42, ptr %arrayidx53, align 1, !tbaa !9 br label %for.inc55 for.inc55: ; preds = %for.cond15.loopexit.7, %if.then49 %indvars.iv.next163 = add nsw i64 %6, 1 %lftr.wideiv = trunc i64 %indvars.iv.next163 to i32 %exitcond.not = icmp eq i32 %13, %lftr.wideiv br i1 %exitcond.not, label %for.inc59, label %for.body44.1, !llvm.loop !14 for.body44.1: ; preds = %for.inc55 %arrayidx46.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 1 %16 = load i8, ptr %arrayidx46.1, align 1, !tbaa !9 %cmp47.1 = icmp eq i8 %16, 42 br i1 %cmp47.1, label %if.then49.1, label %for.inc55.1 if.then49.1: ; preds = %for.body44.1 %arrayidx53.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %4, i64 %indvars.iv.next163 store i8 42, ptr %arrayidx53.1, align 1, !tbaa !9 br label %for.inc55.1 for.inc55.1: ; preds = %if.then49.1, %for.body44.1 %arrayidx46.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 2 %17 = load i8, ptr %arrayidx46.2, align 1, !tbaa !9 %cmp47.2 = icmp eq i8 %17, 42 br i1 %cmp47.2, label %if.then49.2, label %for.inc59 if.then49.2: ; preds = %for.inc55.1 %indvars.iv.next163.1 = add nsw i64 %6, 2 %arrayidx53.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %4, i64 %indvars.iv.next163.1 store i8 42, ptr %arrayidx53.2, align 1, !tbaa !9 br label %for.inc59 for.inc59: ; preds = %for.inc55.1, %if.then49.2, %for.inc55 %indvars.iv.next167 = add nsw i64 %4, 1 %cmp39 = icmp slt i64 %indvars.iv.next167, %14 br i1 %cmp39, label %for.cond41.preheader.1, label %for.end61, !llvm.loop !15 for.cond41.preheader.1: ; preds = %for.inc59 %sext = shl i64 %3, 32 %18 = ashr exact i64 %sext, 32 %arrayidx46.1169 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %18 %19 = load i8, ptr %arrayidx46.1169, align 1, !tbaa !9 %cmp47.1170 = icmp eq i8 %19, 42 br i1 %cmp47.1170, label %if.then49.1173, label %for.inc55.1176 if.then49.1173: ; preds = %for.cond41.preheader.1 %arrayidx53.1172 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167, i64 %6 store i8 42, ptr %arrayidx53.1172, align 1, !tbaa !9 br label %for.inc55.1176 for.inc55.1176: ; preds = %if.then49.1173, %for.cond41.preheader.1 br i1 %exitcond.not, label %for.inc59.1, label %for.body44.1.1, !llvm.loop !14 for.body44.1.1: ; preds = %for.inc55.1176 %indvars.iv.next.1175 = add nsw i64 %18, 1 %arrayidx46.1.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %indvars.iv.next.1175 %20 = load i8, ptr %arrayidx46.1.1, align 1, !tbaa !9 %cmp47.1.1 = icmp eq i8 %20, 42 br i1 %cmp47.1.1, label %if.then49.1.1, label %for.inc55.1.1 if.then49.1.1: ; preds = %for.body44.1.1 %arrayidx53.1.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167, i64 %indvars.iv.next163 store i8 42, ptr %arrayidx53.1.1, align 1, !tbaa !9 br label %for.inc55.1.1 for.inc55.1.1: ; preds = %if.then49.1.1, %for.body44.1.1 %indvars.iv.next.1.1 = add nsw i64 %18, 2 %arrayidx46.2.1 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %indvars.iv.next.1.1 %21 = load i8, ptr %arrayidx46.2.1, align 1, !tbaa !9 %cmp47.2.1 = icmp eq i8 %21, 42 br i1 %cmp47.2.1, label %if.then49.2.1, label %for.inc59.1 if.then49.2.1: ; preds = %for.inc55.1.1 %indvars.iv.next163.1.1 = add nsw i64 %6, 2 %arrayidx53.2.1 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167, i64 %indvars.iv.next163.1.1 store i8 42, ptr %arrayidx53.2.1, align 1, !tbaa !9 br label %for.inc59.1 for.inc59.1: ; preds = %for.inc55.1.1, %if.then49.2.1, %for.inc55.1176 %.tr = trunc i64 %3 to i32 %22 = shl i32 %.tr, 1 %indvars.iv.next167.1 = add nsw i64 %4, 2 %23 = sext i32 %22 to i64 %arrayidx46.2177 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %23 %24 = load i8, ptr %arrayidx46.2177, align 1, !tbaa !9 %cmp47.2178 = icmp eq i8 %24, 42 br i1 %cmp47.2178, label %if.then49.2180, label %for.inc55.2181 if.then49.2180: ; preds = %for.inc59.1 %arrayidx53.2179 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167.1, i64 %6 store i8 42, ptr %arrayidx53.2179, align 1, !tbaa !9 br label %for.inc55.2181 for.inc55.2181: ; preds = %if.then49.2180, %for.inc59.1 br i1 %exitcond.not, label %for.end61, label %for.body44.1.2, !llvm.loop !14 for.body44.1.2: ; preds = %for.inc55.2181 %indvars.iv.next.2 = or i64 %23, 1 %arrayidx46.1.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %indvars.iv.next.2 %25 = load i8, ptr %arrayidx46.1.2, align 1, !tbaa !9 %cmp47.1.2 = icmp eq i8 %25, 42 br i1 %cmp47.1.2, label %if.then49.1.2, label %for.inc55.1.2 if.then49.1.2: ; preds = %for.body44.1.2 %arrayidx53.1.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167.1, i64 %indvars.iv.next163 store i8 42, ptr %arrayidx53.1.2, align 1, !tbaa !9 br label %for.inc55.1.2 for.inc55.1.2: ; preds = %if.then49.1.2, %for.body44.1.2 %indvars.iv.next.1.2 = add nsw i64 %23, 2 %arrayidx46.2.2 = getelementptr inbounds [9 x i8], ptr %_correct, i64 0, i64 %indvars.iv.next.1.2 %26 = load i8, ptr %arrayidx46.2.2, align 1, !tbaa !9 %cmp47.2.2 = icmp eq i8 %26, 42 br i1 %cmp47.2.2, label %if.then49.2.2, label %for.end61 if.then49.2.2: ; preds = %for.inc55.1.2 %indvars.iv.next163.1.2 = add nsw i64 %6, 2 %arrayidx53.2.2 = getelementptr inbounds [9 x [9 x i8]], ptr @correct, i64 0, i64 %indvars.iv.next167.1, i64 %indvars.iv.next163.1.2 store i8 42, ptr %arrayidx53.2.2, align 1, !tbaa !9 br label %for.end61 for.end61: ; preds = %for.inc55.2181, %if.then49.2.2, %for.inc55.1.2, %for.inc59 call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %_correct) #9 call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %check) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11}
#include <stdio.h> #include <string.h> int main() { int l; char s[1001]; scanf("%[^\n]",s); l = strlen(s); if(s[l-1]=='s'){ printf("%ses\n",s); } else{ printf("%ss\n",s); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179428/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179428/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^\0A]\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%ses\0A\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ss\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %sub = shl i64 %call2, 32 %sext = add i64 %sub, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 115 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void){ char input[1002]; scanf("%s", input); int len = strlen(input); if( input[len-1] == 's'){ input[len] = 'e'; input[len+1] = 's'; input[len + 2] = '\0'; }else{ input[len] = 's'; input[len + 1] = '\0'; } printf("%s", input); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179493/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %input = alloca [1002 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %input) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %input) #5 %sub = shl i64 %call2, 32 %sext = add i64 %sub, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [1002 x i8], ptr %input, i64 0, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 115 %idxprom5 = ashr exact i64 %sub, 32 %arrayidx6 = getelementptr inbounds [1002 x i8], ptr %input, i64 0, i64 %idxprom5 %sext27 = add i64 %sub, 4294967296 %idxprom7 = ashr exact i64 %sext27, 32 %arrayidx8 = getelementptr inbounds [1002 x i8], ptr %input, i64 0, i64 %idxprom7 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry store i8 101, ptr %arrayidx6, align 1, !tbaa !5 store i8 115, ptr %arrayidx8, align 1, !tbaa !5 %sext28 = add i64 %sub, 8589934592 %idxprom10 = ashr exact i64 %sext28, 32 %arrayidx11 = getelementptr inbounds [1002 x i8], ptr %input, i64 0, i64 %idxprom10 br label %if.end if.else: ; preds = %entry store i8 115, ptr %arrayidx6, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %arrayidx8.sink = phi ptr [ %arrayidx8, %if.else ], [ %arrayidx11, %if.then ] store i8 0, ptr %arrayidx8.sink, align 1, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %input) call void @llvm.lifetime.end.p0(i64 1002, 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(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define ll long long #define mod 1000000007 #define max(p,q)((p)>(q)?(p):(q)) ll powe(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;} int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} ll n; ll a[212345],b[212345]; ll c[212345]; char s[1010]; int main(){ scanf("%s",s); int leng=strlen(s); if(s[leng-1]=='s'){ s[leng]='e'; s[leng+1]='s';} else s[leng]='s'; printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179536/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @s = dso_local global [1010 x i8] zeroinitializer, align 16 @n = dso_local local_unnamed_addr global i64 0, align 8 @a = dso_local local_unnamed_addr global [212345 x i64] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [212345 x i64] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [212345 x i64] zeroinitializer, align 16 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @powe(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #0 { entry: %conv = sext i32 %m to i64 %tobool.not16 = icmp eq i64 %n, 0 br i1 %tobool.not16, label %for.end, label %for.body for.body: ; preds = %entry, %cond.end %mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ] %x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ] %a.addr.019 = srem i64 %mul4.pn, %conv %and = and i64 %n.addr.017, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %cond.end, label %cond.true cond.true: ; preds = %for.body %mul = mul nsw i64 %a.addr.019, %x.018 %rem3 = srem i64 %mul, %conv br label %cond.end cond.end: ; preds = %for.body, %cond.true %x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ] %mul4 = mul nsw i64 %a.addr.019, %a.addr.019 %div = sdiv i64 %n.addr.017, 2 %n.addr.017.off = add i64 %n.addr.017, 1 %tobool.not = icmp ult i64 %n.addr.017.off, 3 br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !5 for.end: ; preds = %cond.end, %entry %x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ] ret i64 %x.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !7 %1 = load i64, ptr %b, align 8, !tbaa !7 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #7 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #8 %sub = shl i64 %call1, 32 %sext = add i64 %sub, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [1010 x i8], ptr @s, i64 0, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !11 %cmp = icmp eq i8 %0, 115 %idxprom4 = ashr exact i64 %sub, 32 %arrayidx5 = getelementptr inbounds [1010 x i8], ptr @s, i64 0, i64 %idxprom4 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i8 101, ptr %arrayidx5, align 1, !tbaa !11 %sext16 = add i64 %sub, 4294967296 %idxprom6 = ashr exact i64 %sext16, 32 %arrayidx7 = getelementptr inbounds [1010 x i8], ptr @s, i64 0, i64 %idxprom6 br label %if.end if.end: ; preds = %entry, %if.then %arrayidx5.sink = phi ptr [ %arrayidx7, %if.then ], [ %arrayidx5, %entry ] store i8 115, ptr %arrayidx5.sink, align 1, !tbaa !11 %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @s) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nounwind } attributes #8 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = !{!9, !9, i64 0}
#include <stdio.h> int main(void) { double n; int ni; int s[4]; int i; while (1){ scanf("%lf", &n); if (n < 0){ break; } ni = n; if (ni > 255){ printf("NA\n"); continue; } s[0] = s[1] = s[2] = s[3] = 0; n -= ni; n *= 2; if (n >= 1){ s[0] = 1; n = n - (int)n; } n *= 2; if (n >= 1){ s[1] = 1; n = n - (int)n; } n *= 2; if (n >= 1){ s[2] = 1; n = n - (int)n; } n *= 2; if (n >= 1){ s[3] = 1; n = n - (int)n; } n *= 2; if (n != 0){ printf("NA\n"); continue; } for (i = 0; i < 8; i++){ if ((ni & (1 << (7 - i))) == 0){ printf("0"); } else{ printf("1"); } } printf("."); for (i = 0; i < 4; i++){ printf("%d", s[i]); } printf("\n"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179594/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179594/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.5 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str.7 = private unnamed_addr constant [3 x i8] c"NA\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load double, ptr %n, align 8, !tbaa !5 %cmp85 = fcmp olt double %0, 0.000000e+00 br i1 %cmp85, label %while.end, label %if.end if.end: ; preds = %entry, %while.cond.backedge %1 = phi double [ %2, %while.cond.backedge ], [ %0, %entry ] %conv = fptosi double %1 to i32 %cmp1 = icmp sgt i32 %conv, 255 br i1 %cmp1, label %if.then3, label %if.end5 if.then3: ; preds = %if.end %puts81 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7) br label %while.cond.backedge while.cond.backedge: ; preds = %if.then3, %if.then48, %for.body.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %2 = load double, ptr %n, align 8, !tbaa !5 %cmp = fcmp olt double %2, 0.000000e+00 br i1 %cmp, label %while.end, label %if.end if.end5: ; preds = %if.end %conv9 = sitofp i32 %conv to double %sub = fsub double %1, %conv9 %mul = fmul double %sub, 2.000000e+00 %cmp10 = fcmp oge double %mul, 1.000000e+00 %conv14 = fptosi double %mul to i32 %conv15 = sitofp i32 %conv14 to double %sub16 = select i1 %cmp10, double %conv15, double 0.000000e+00 %storemerge = fsub double %mul, %sub16 %mul18 = fmul double %storemerge, 2.000000e+00 %cmp19 = fcmp oge double %mul18, 1.000000e+00 %conv23 = fptosi double %mul18 to i32 %conv24 = sitofp i32 %conv23 to double %sub25 = select i1 %cmp19, double %conv24, double 0.000000e+00 %storemerge87 = fsub double %mul18, %sub25 %mul27 = fmul double %storemerge87, 2.000000e+00 %cmp28 = fcmp oge double %mul27, 1.000000e+00 %conv32 = fptosi double %mul27 to i32 %conv33 = sitofp i32 %conv32 to double %sub34 = select i1 %cmp28, double %conv33, double 0.000000e+00 %storemerge88 = fsub double %mul27, %sub34 %mul36 = fmul double %storemerge88, 2.000000e+00 %cmp37 = fcmp oge double %mul36, 1.000000e+00 %conv41 = fptosi double %mul36 to i32 %conv42 = sitofp i32 %conv41 to double %sub43 = select i1 %cmp37, double %conv42, double 0.000000e+00 %storemerge89 = fsub double %mul36, %sub43 %mul45 = fmul double %storemerge89, 2.000000e+00 store double %mul45, ptr %n, align 8, !tbaa !5 %cmp46 = fcmp une double %mul45, 0.000000e+00 br i1 %cmp46, label %if.then48, label %for.body.preheader for.body.preheader: ; preds = %if.end5 %s.sroa.11.0 = zext i1 %cmp37 to i32 %s.sroa.8.0 = zext i1 %cmp28 to i32 %s.sroa.5.0 = zext i1 %cmp19 to i32 %s.sroa.0.0 = zext i1 %cmp10 to i32 %and = and i32 %conv, 128 %cmp54 = icmp eq i32 %and, 0 %. = select i1 %cmp54, i32 48, i32 49 %putchar80 = call i32 @putchar(i32 %.) %and.1 = and i32 %conv, 64 %cmp54.1 = icmp eq i32 %and.1, 0 %.sink90 = select i1 %cmp54.1, i32 48, i32 49 %putchar80.1 = call i32 @putchar(i32 %.sink90) %and.2 = and i32 %conv, 32 %cmp54.2 = icmp eq i32 %and.2, 0 %.sink91 = select i1 %cmp54.2, i32 48, i32 49 %putchar80.2 = call i32 @putchar(i32 %.sink91) %and.3 = and i32 %conv, 16 %cmp54.3 = icmp eq i32 %and.3, 0 %.sink92 = select i1 %cmp54.3, i32 48, i32 49 %putchar80.3 = call i32 @putchar(i32 %.sink92) %and.4 = and i32 %conv, 8 %cmp54.4 = icmp eq i32 %and.4, 0 %.sink93 = select i1 %cmp54.4, i32 48, i32 49 %putchar80.4 = call i32 @putchar(i32 %.sink93) %and.5 = and i32 %conv, 4 %cmp54.5 = icmp eq i32 %and.5, 0 %.sink94 = select i1 %cmp54.5, i32 48, i32 49 %putchar80.5 = call i32 @putchar(i32 %.sink94) %and.6 = and i32 %conv, 2 %cmp54.6 = icmp eq i32 %and.6, 0 %.sink95 = select i1 %cmp54.6, i32 48, i32 49 %putchar80.6 = call i32 @putchar(i32 %.sink95) %and.7 = and i32 %conv, 1 %.sink96 = or i32 %and.7, 48 %putchar80.7 = call i32 @putchar(i32 %.sink96) %putchar = call i32 @putchar(i32 46) %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %s.sroa.0.0) %call66.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %s.sroa.5.0) %call66.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %s.sroa.8.0) %call66.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %s.sroa.11.0) %putchar78 = call i32 @putchar(i32 10) br label %while.cond.backedge if.then48: ; preds = %if.end5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.7) br label %while.cond.backedge while.end: ; preds = %while.cond.backedge, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; 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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include "stdio.h" int sosu(int ); int sosu(int nyuu){ int i; int count = 0; for(i = 0; i <= nyuu;i++){ if(i % 7 == 6 || i % 7 == 1){ if(nyuu % i == 0){ count++; } } } if(count == 2){ return nyuu; } else { return 0; } } int main() { int nyuuryoku; int i,j,k; int ans; while(1){ scanf("%d",&nyuuryoku); if(nyuuryoku == 1){ break; } printf("%d:", nyuuryoku); for(i = 0;i < 300000;i++){ if(i % 7 == 6 || i % 7 == 1){ if(nyuuryoku % i == 0){ ans = sosu(i); //printf("%d\n", ans); if(ans != 0){ printf(" %d", ans); } } } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179651/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179651/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d:\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @sosu(i32 noundef %nyuu) local_unnamed_addr #0 { entry: %cmp.not19 = icmp slt i32 %nyuu, 0 br i1 %cmp.not19, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %count.021 = phi i32 [ %count.1, %for.inc ], [ 0, %entry ] %i.020 = phi i32 [ %inc8, %for.inc ], [ 0, %entry ] %rem = urem i32 %i.020, 7 switch i32 %rem, label %for.inc [ i32 6, label %if.then i32 1, label %if.then ] if.then: ; preds = %for.body, %for.body %rem4 = srem i32 %nyuu, %i.020 %cmp5 = icmp eq i32 %rem4, 0 %inc = zext i1 %cmp5 to i32 %spec.select = add nsw i32 %count.021, %inc br label %for.inc for.inc: ; preds = %if.then, %for.body %count.1 = phi i32 [ %count.021, %for.body ], [ %spec.select, %if.then ] %inc8 = add nuw i32 %i.020, 1 %exitcond.not = icmp eq i32 %i.020, %nyuu br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !5 for.end.loopexit: ; preds = %for.inc %0 = icmp eq i32 %count.1, 2 %1 = select i1 %0, i32 %nyuu, i32 0 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %1, %for.end.loopexit ] ret i32 %count.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %nyuuryoku = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nyuuryoku) #5 %call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nyuuryoku) %0 = load i32, ptr %nyuuryoku, align 4, !tbaa !7 %cmp27 = icmp eq i32 %0, 1 br i1 %cmp27, label %while.end, label %if.end if.end: ; preds = %entry, %for.end %1 = phi i32 [ %4, %for.end ], [ %0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) br label %for.body for.body: ; preds = %if.end, %for.inc %i.025 = phi i32 [ 0, %if.end ], [ %inc, %for.inc ] %rem = urem i32 %i.025, 7 switch i32 %rem, label %for.inc [ i32 6, label %if.then6 i32 1, label %if.then6 ] if.then6: ; preds = %for.body, %for.body %2 = load i32, ptr %nyuuryoku, align 4, !tbaa !7 %rem7 = srem i32 %2, %i.025 %cmp8 = icmp eq i32 %rem7, 0 br i1 %cmp8, label %for.body.i, label %for.inc for.body.i: ; preds = %if.then6, %for.inc.i %count.021.i = phi i32 [ %count.1.i, %for.inc.i ], [ 0, %if.then6 ] %i.020.i = phi i32 [ %inc8.i, %for.inc.i ], [ 0, %if.then6 ] %rem.i = urem i32 %i.020.i, 7 switch i32 %rem.i, label %for.inc.i [ i32 6, label %if.then.i i32 1, label %if.then.i ] if.then.i: ; preds = %for.body.i, %for.body.i %rem4.i.urem = urem i32 %i.025, %i.020.i %cmp5.i = icmp eq i32 %rem4.i.urem, 0 %inc.i = zext i1 %cmp5.i to i32 %spec.select.i = add nsw i32 %count.021.i, %inc.i br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %count.1.i = phi i32 [ %count.021.i, %for.body.i ], [ %spec.select.i, %if.then.i ] %inc8.i = add nuw nsw i32 %i.020.i, 1 %exitcond.not.i = icmp eq i32 %i.020.i, %i.025 br i1 %exitcond.not.i, label %sosu.exit, label %for.body.i, !llvm.loop !5 sosu.exit: ; preds = %for.inc.i %3 = icmp ne i32 %count.1.i, 2 %cmp11.not24 = icmp eq i32 %i.025, 0 %cmp11.not = or i1 %cmp11.not24, %3 br i1 %cmp11.not, label %for.inc, label %if.then12 if.then12: ; preds = %sosu.exit %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.025) br label %for.inc for.inc: ; preds = %for.body, %sosu.exit, %if.then12, %if.then6 %inc = add nuw nsw i32 %i.025, 1 %exitcond.not = icmp eq i32 %inc, 300000 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.inc %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nyuuryoku) %4 = load i32, ptr %nyuuryoku, align 4, !tbaa !7 %cmp = icmp eq i32 %4, 1 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nyuuryoku) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> int main(){ int n; long tt,t,pt,cnt=0; scanf("%d %ld",&n,&tt); scanf("%ld",&pt); cnt+=tt; for(int i=1;i<n;i++){ scanf("%ld",&t); cnt+=tt; if(t-pt<tt) cnt-=tt-(t-pt); pt=t; } printf("%ld\n",cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179701/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179701/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %tt = alloca i64, align 8 %t = alloca i64, align 8 %pt = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tt) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %pt) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %tt) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %pt) %0 = load i64, ptr %tt, align 8, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !9 %cmp13 = icmp sgt i32 %1, 1 br i1 %cmp13, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %cnt.0.lcssa = phi i64 [ %0, %entry ], [ %cnt.1, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %pt) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tt) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body: ; preds = %entry, %for.body %i.015 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %cnt.014 = phi i64 [ %cnt.1, %for.body ], [ %0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t) %2 = load i64, ptr %tt, align 8, !tbaa !5 %3 = load i64, ptr %t, align 8, !tbaa !5 %4 = load i64, ptr %pt, align 8, !tbaa !5 %sub = sub nsw i64 %3, %4 %spec.select = call i64 @llvm.smin.i64(i64 %sub, i64 %2) %cnt.1 = add i64 %spec.select, %cnt.014 store i64 %3, ptr %pt, align 8, !tbaa !5 %inc = add nuw nsw i32 %i.015, 1 %5 = load i32, ptr %n, align 4, !tbaa !9 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#define _CRT_SECURE_NO_WARNINGS #include <ctype.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define true 1 #define false 0 char s[51]; char origin[10] = "AKIHABARA"; int origin_num = 0; int main() { for (int i = 0; i < 51; i++) { s[i] = '0'; } scanf("%s", s); for (int i = 0; i < 50 && origin_num <= 9; i++) { //同じの場合 if (s[i] == origin[origin_num]) { origin_num++; } //Aをひとつ飛ばしたら同じの場合 else if (origin[origin_num] == 'A' && origin_num <= 8 && origin[origin_num + 1] == s[i]) { origin_num += 2; } else { printf("NO\n"); return 0; } } printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179752/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179752/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @origin = dso_local local_unnamed_addr global [10 x i8] c"AKIHABARA\00", align 1 @origin_num = dso_local local_unnamed_addr global i32 0, align 4 @s = dso_local global [51 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(51) @s, i8 48, i64 51, i1 false), !tbaa !5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s) %origin_num.promoted = load i32, ptr @origin_num, align 4 %cmp451 = icmp slt i32 %origin_num.promoted, 10 br i1 %cmp451, label %for.body6, label %return for.body6: ; preds = %entry, %for.inc36 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc36 ], [ 0, %entry ] %storemerge5052 = phi i32 [ %inc14, %for.inc36 ], [ %origin_num.promoted, %entry ] %arrayidx8 = getelementptr inbounds [51 x i8], ptr @s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %idxprom9 = sext i32 %storemerge5052 to i64 %arrayidx10 = getelementptr inbounds [10 x i8], ptr @origin, i64 0, i64 %idxprom9 %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12 = icmp eq i8 %0, %1 br i1 %cmp12, label %for.inc36, label %if.else if.else: ; preds = %for.body6 %cmp18 = icmp eq i8 %1, 65 %cmp20 = icmp slt i32 %storemerge5052, 9 %or.cond = and i1 %cmp18, %cmp20 br i1 %or.cond, label %land.lhs.true22, label %return land.lhs.true22: ; preds = %if.else %add = add nsw i32 %storemerge5052, 1 %idxprom23 = sext i32 %add to i64 %arrayidx24 = getelementptr inbounds [10 x i8], ptr @origin, i64 0, i64 %idxprom23 %2 = load i8, ptr %arrayidx24, align 1, !tbaa !5 %cmp29 = icmp eq i8 %2, %0 br i1 %cmp29, label %for.inc36, label %return for.inc36: ; preds = %land.lhs.true22, %for.body6 %.sink = phi i32 [ 1, %for.body6 ], [ 2, %land.lhs.true22 ] %inc14 = add nsw i32 %storemerge5052, %.sink store i32 %inc14, ptr @origin_num, align 4, !tbaa !8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp3 = icmp ult i64 %indvars.iv, 49 %cmp4 = icmp slt i32 %inc14, 10 %3 = select i1 %cmp3, i1 %cmp4, i1 false br i1 %3, label %for.body6, label %return, !llvm.loop !10 return: ; preds = %for.inc36, %land.lhs.true22, %if.else, %entry %str.sink = phi ptr [ @str.3, %entry ], [ @str, %if.else ], [ @str, %land.lhs.true22 ], [ @str.3, %for.inc36 ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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"}
#include <stdio.h> int main(void){ int line[10][7]={{0,1,1,1,1,1,1},{0,0,0,0,1,1,0},{1,0,1,1,0,1,1},{1,0,0,1,1,1,1},{1,1,0,0,1,1,0},{1,1,0,1,1,0,1},{1,1,1,1,1,0,1},{0,1,0,0,1,1,1},{1,1,1,1,1,1,1},{1,1,0,1,1,1,1}}; int num,i,kazu; while(1){ int map[7]={0}; scanf("%d",&num); if(num == -1) break; while(num){ scanf("%d",&kazu); for(i=0;i<7;i++){ if(map[i] == line[kazu][i]) printf("0"); else printf("1"); map[i]=line[kazu][i]; } printf("\n"); num--; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179796/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179796/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.line = private unnamed_addr constant [10 x [7 x i32]] [[7 x i32] [i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1], [7 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0], [7 x i32] [i32 1, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1], [7 x i32] [i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1], [7 x i32] [i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 0], [7 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 1], [7 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 1], [7 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1, i32 1, i32 1], [7 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1], [7 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1, i32 1, i32 1]], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %kazu = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kazu) #4 %call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp38 = icmp eq i32 %0, -1 br i1 %cmp38, label %while.end21, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %cleanup %1 = phi i32 [ %25, %cleanup ], [ %0, %entry ] %tobool.not36 = icmp eq i32 %1, 0 br i1 %tobool.not36, label %cleanup, label %while.body2 while.body2: ; preds = %while.cond1.preheader, %while.body2 %map.sroa.0.1 = phi i32 [ %5, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.8.1 = phi i32 [ %8, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.10.1 = phi i32 [ %11, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.12.1 = phi i32 [ %14, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.14.1 = phi i32 [ %17, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.16.1 = phi i32 [ %20, %while.body2 ], [ 0, %while.cond1.preheader ] %map.sroa.18.1 = phi i32 [ %23, %while.body2 ], [ 0, %while.cond1.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kazu) %2 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom5 = sext i32 %2 to i64 %arrayidx8 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom5, i64 0 %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp eq i32 %map.sroa.0.1, %3 %. = select i1 %cmp9, i32 48, i32 49 %putchar31 = call i32 @putchar(i32 %.) %4 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14 = sext i32 %4 to i64 %arrayidx17 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14, i64 0 %5 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %arrayidx8.1 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14, i64 1 %6 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %cmp9.1 = icmp eq i32 %map.sroa.8.1, %6 %.sink47 = select i1 %cmp9.1, i32 48, i32 49 %putchar32.1 = call i32 @putchar(i32 %.sink47) %7 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.1 = sext i32 %7 to i64 %arrayidx17.1 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.1, i64 1 %8 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %arrayidx8.2 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.1, i64 2 %9 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5 %cmp9.2 = icmp eq i32 %map.sroa.10.1, %9 %.sink48 = select i1 %cmp9.2, i32 48, i32 49 %putchar32.2 = call i32 @putchar(i32 %.sink48) %10 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.2 = sext i32 %10 to i64 %arrayidx17.2 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.2, i64 2 %11 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %arrayidx8.3 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.2, i64 3 %12 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5 %cmp9.3 = icmp eq i32 %map.sroa.12.1, %12 %.sink49 = select i1 %cmp9.3, i32 48, i32 49 %putchar32.3 = call i32 @putchar(i32 %.sink49) %13 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.3 = sext i32 %13 to i64 %arrayidx17.3 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.3, i64 3 %14 = load i32, ptr %arrayidx17.3, align 4, !tbaa !5 %arrayidx8.4 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.3, i64 4 %15 = load i32, ptr %arrayidx8.4, align 4, !tbaa !5 %cmp9.4 = icmp eq i32 %map.sroa.14.1, %15 %.sink50 = select i1 %cmp9.4, i32 48, i32 49 %putchar32.4 = call i32 @putchar(i32 %.sink50) %16 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.4 = sext i32 %16 to i64 %arrayidx17.4 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.4, i64 4 %17 = load i32, ptr %arrayidx17.4, align 4, !tbaa !5 %arrayidx8.5 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.4, i64 5 %18 = load i32, ptr %arrayidx8.5, align 4, !tbaa !5 %cmp9.5 = icmp eq i32 %map.sroa.16.1, %18 %.sink51 = select i1 %cmp9.5, i32 48, i32 49 %putchar32.5 = call i32 @putchar(i32 %.sink51) %19 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.5 = sext i32 %19 to i64 %arrayidx17.5 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.5, i64 5 %20 = load i32, ptr %arrayidx17.5, align 4, !tbaa !5 %arrayidx8.6 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.5, i64 6 %21 = load i32, ptr %arrayidx8.6, align 4, !tbaa !5 %cmp9.6 = icmp eq i32 %map.sroa.18.1, %21 %.sink52 = select i1 %cmp9.6, i32 48, i32 49 %putchar32.6 = call i32 @putchar(i32 %.sink52) %22 = load i32, ptr %kazu, align 4, !tbaa !5 %idxprom14.6 = sext i32 %22 to i64 %arrayidx17.6 = getelementptr inbounds [10 x [7 x i32]], ptr @__const.main.line, i64 0, i64 %idxprom14.6, i64 6 %23 = load i32, ptr %arrayidx17.6, align 4, !tbaa !5 %putchar = call i32 @putchar(i32 10) %24 = load i32, ptr %num, align 4, !tbaa !5 %dec = add nsw i32 %24, -1 store i32 %dec, ptr %num, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %cleanup, label %while.body2, !llvm.loop !9 cleanup: ; preds = %while.body2, %while.cond1.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %25 = load i32, ptr %num, align 4, !tbaa !5 %cmp = icmp eq i32 %25, -1 br i1 %cmp, label %while.end21, label %while.cond1.preheader while.end21: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kazu) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdlib.h> #include <stdio.h> #define MAXN 100000 struct list { int n, c; int *edges; } verts[MAXN]; void add_list(struct list *l, int v) { if (l->n+1 > l->c) { if (!l->c) l->c = 1; l->c *= 2; l->edges = realloc(l->edges, (size_t)l->c * sizeof *l->edges); } l->edges[l->n++] = v; } void del_list(struct list *l, int v) { int tail = 0; for (int head = 0; head < l->n; head++) { if (l->edges[head] == v) continue; l->edges[tail++] = l->edges[head]; } l->n--; } void add_edge(int a, int b) { add_list(&verts[a], b); add_list(&verts[b], a); } int calc_dists_rec(int c, int dists[MAXN], int dist) { if (dists[c] != -1) return -1; dists[c] = dist; int best = dist; for (int i = 0; i < verts[c].n; i++) { int d = calc_dists_rec(verts[c].edges[i], dists, dist+1); if (d > best) best = d; } return best; } int calc_dists(int s, int dists[MAXN]) { for (int i = 0; i < MAXN; i++) dists[i] = -1; return calc_dists_rec(s, dists, 0); } int udist[MAXN], vdist[MAXN], cdist[MAXN]; int crit_point(int s) { if (udist[s] >= vdist[s]) return s; int bestv = -1, bestd = MAXN; for (int i = 0; i < verts[s].n; i++) { int n = verts[s].edges[i]; if (vdist[n] < bestd) { bestv = n; bestd = vdist[n]; } } return crit_point(bestv); } int main(void) { int n, u, v; scanf("%d%d%d", &n, &u, &v); u--; v--; for (int i = 0; i < n-1; i++) { int a, b; scanf("%d%d", &a, &b); add_edge(a-1, b-1); } calc_dists(u, udist); calc_dists(v, vdist); int crit = crit_point(u); int before; for (before = 0; before < verts[crit].n-1; before++) { int da = udist[verts[crit].edges[before]]; int db = udist[verts[crit].edges[before+1]]; if (da < db) break; } int befv = verts[crit].edges[before]; del_list(&verts[befv], crit); int max = calc_dists(befv, cdist); printf("%d\n", udist[befv] + max + (udist[crit] == vdist[crit])); for (int i = 0; i < n; i++) free(verts[i].edges); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179846/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179846/source.c" target datalayout = "e-m:e-p270: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.list = type { i32, i32, ptr } @verts = dso_local local_unnamed_addr global [100000 x %struct.list] zeroinitializer, align 16 @udist = dso_local global [100000 x i32] zeroinitializer, align 16 @vdist = dso_local global [100000 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @cdist = dso_local global [100000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nounwind willreturn uwtable define dso_local void @add_list(ptr nocapture noundef %l, i32 noundef %v) local_unnamed_addr #0 { entry: %0 = load i32, ptr %l, align 8, !tbaa !5 %c = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 1 %1 = load i32, ptr %c, align 4, !tbaa !11 %cmp.not = icmp slt i32 %0, %1 br i1 %cmp.not, label %entry.if.end8_crit_edge, label %if.then entry.if.end8_crit_edge: ; preds = %entry %edges9.phi.trans.insert = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 2 %.pre = load ptr, ptr %edges9.phi.trans.insert, align 8, !tbaa !12 br label %if.end8 if.then: ; preds = %entry %spec.select = tail call i32 @llvm.umax.i32(i32 %1, i32 1) %mul = shl nsw i32 %spec.select, 1 store i32 %mul, ptr %c, align 4, !tbaa !11 %edges = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 2 %2 = load ptr, ptr %edges, align 8, !tbaa !12 %conv = sext i32 %mul to i64 %mul6 = shl nsw i64 %conv, 2 %call = tail call ptr @realloc(ptr noundef %2, i64 noundef %mul6) #11 store ptr %call, ptr %edges, align 8, !tbaa !12 %.pre20 = load i32, ptr %l, align 8, !tbaa !5 br label %if.end8 if.end8: ; preds = %entry.if.end8_crit_edge, %if.then %3 = phi i32 [ %0, %entry.if.end8_crit_edge ], [ %.pre20, %if.then ] %4 = phi ptr [ %.pre, %entry.if.end8_crit_edge ], [ %call, %if.then ] %inc = add nsw i32 %3, 1 store i32 %inc, ptr %l, align 8, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx = getelementptr inbounds i32, ptr %4, i64 %idxprom store i32 %v, ptr %arrayidx, align 4, !tbaa !13 ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @del_list(ptr nocapture noundef %l, i32 noundef %v) local_unnamed_addr #2 { entry: %0 = load i32, ptr %l, align 8, !tbaa !5 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %edges = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 2 %1 = load ptr, ptr %edges, align 8, !tbaa !12 br label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %.lcssa = phi i32 [ %0, %entry ], [ %4, %for.inc ] %dec = add nsw i32 %.lcssa, -1 store i32 %dec, ptr %l, align 8, !tbaa !5 ret void for.body: ; preds = %for.body.lr.ph, %for.inc %2 = phi i32 [ %0, %for.body.lr.ph ], [ %4, %for.inc ] %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %tail.019 = phi i32 [ 0, %for.body.lr.ph ], [ %tail.1, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %1, i64 %indvars.iv %3 = load i32, ptr %arrayidx, align 4, !tbaa !13 %cmp1 = icmp eq i32 %3, %v br i1 %cmp1, label %for.inc, label %if.end if.end: ; preds = %for.body %inc = add nsw i32 %tail.019, 1 %idxprom6 = sext i32 %tail.019 to i64 %arrayidx7 = getelementptr inbounds i32, ptr %1, i64 %idxprom6 store i32 %3, ptr %arrayidx7, align 4, !tbaa !13 %.pre = load i32, ptr %l, align 8, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.end %4 = phi i32 [ %2, %for.body ], [ %.pre, %if.end ] %tail.1 = phi i32 [ %tail.019, %for.body ], [ %inc, %if.end ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nounwind willreturn uwtable define dso_local void @add_edge(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %idxprom = sext i32 %a to i64 %arrayidx = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 16, !tbaa !5 %c.i = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom, i32 1 %1 = load i32, ptr %c.i, align 4, !tbaa !11 %cmp.not.i = icmp slt i32 %0, %1 br i1 %cmp.not.i, label %entry.if.end8_crit_edge.i, label %if.then.i entry.if.end8_crit_edge.i: ; preds = %entry %edges9.phi.trans.insert.i = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom, i32 2 %.pre.i = load ptr, ptr %edges9.phi.trans.insert.i, align 8, !tbaa !12 br label %add_list.exit if.then.i: ; preds = %entry %spec.select.i = tail call i32 @llvm.umax.i32(i32 %1, i32 1) %mul.i = shl nsw i32 %spec.select.i, 1 store i32 %mul.i, ptr %c.i, align 4, !tbaa !11 %edges.i = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom, i32 2 %2 = load ptr, ptr %edges.i, align 8, !tbaa !12 %conv.i = sext i32 %mul.i to i64 %mul6.i = shl nsw i64 %conv.i, 2 %call.i = tail call ptr @realloc(ptr noundef %2, i64 noundef %mul6.i) #11 store ptr %call.i, ptr %edges.i, align 8, !tbaa !12 %.pre20.i = load i32, ptr %arrayidx, align 16, !tbaa !5 br label %add_list.exit add_list.exit: ; preds = %entry.if.end8_crit_edge.i, %if.then.i %3 = phi i32 [ %0, %entry.if.end8_crit_edge.i ], [ %.pre20.i, %if.then.i ] %4 = phi ptr [ %.pre.i, %entry.if.end8_crit_edge.i ], [ %call.i, %if.then.i ] %inc.i = add nsw i32 %3, 1 store i32 %inc.i, ptr %arrayidx, align 16, !tbaa !5 %idxprom.i = sext i32 %3 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %4, i64 %idxprom.i store i32 %b, ptr %arrayidx.i, align 4, !tbaa !13 %idxprom1 = sext i32 %b to i64 %arrayidx2 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom1 %5 = load i32, ptr %arrayidx2, align 16, !tbaa !5 %c.i5 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom1, i32 1 %6 = load i32, ptr %c.i5, align 4, !tbaa !11 %cmp.not.i6 = icmp slt i32 %5, %6 br i1 %cmp.not.i6, label %entry.if.end8_crit_edge.i18, label %if.then.i7 entry.if.end8_crit_edge.i18: ; preds = %add_list.exit %edges9.phi.trans.insert.i19 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom1, i32 2 %.pre.i20 = load ptr, ptr %edges9.phi.trans.insert.i19, align 8, !tbaa !12 br label %add_list.exit21 if.then.i7: ; preds = %add_list.exit %spec.select.i8 = tail call i32 @llvm.umax.i32(i32 %6, i32 1) %mul.i9 = shl nsw i32 %spec.select.i8, 1 store i32 %mul.i9, ptr %c.i5, align 4, !tbaa !11 %edges.i10 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom1, i32 2 %7 = load ptr, ptr %edges.i10, align 8, !tbaa !12 %conv.i11 = sext i32 %mul.i9 to i64 %mul6.i12 = shl nsw i64 %conv.i11, 2 %call.i13 = tail call ptr @realloc(ptr noundef %7, i64 noundef %mul6.i12) #11 store ptr %call.i13, ptr %edges.i10, align 8, !tbaa !12 %.pre20.i14 = load i32, ptr %arrayidx2, align 16, !tbaa !5 br label %add_list.exit21 add_list.exit21: ; preds = %entry.if.end8_crit_edge.i18, %if.then.i7 %8 = phi i32 [ %5, %entry.if.end8_crit_edge.i18 ], [ %.pre20.i14, %if.then.i7 ] %9 = phi ptr [ %.pre.i20, %entry.if.end8_crit_edge.i18 ], [ %call.i13, %if.then.i7 ] %inc.i15 = add nsw i32 %8, 1 store i32 %inc.i15, ptr %arrayidx2, align 16, !tbaa !5 %idxprom.i16 = sext i32 %8 to i64 %arrayidx.i17 = getelementptr inbounds i32, ptr %9, i64 %idxprom.i16 store i32 %a, ptr %arrayidx.i17, align 4, !tbaa !13 ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @calc_dists_rec(i32 noundef %c, ptr nocapture noundef %dists, i32 noundef %dist) local_unnamed_addr #4 { entry: %idxprom = sext i32 %c to i64 %arrayidx = getelementptr inbounds i32, ptr %dists, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !13 %cmp.not = icmp eq i32 %0, -1 br i1 %cmp.not, label %if.end, label %return if.end: ; preds = %entry store i32 %dist, ptr %arrayidx, align 4, !tbaa !13 %arrayidx4 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp524 = icmp sgt i32 %1, 0 br i1 %cmp524, label %for.body.lr.ph, label %return for.body.lr.ph: ; preds = %if.end %edges = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom, i32 2 %add = add nsw i32 %dist, 1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %best.025 = phi i32 [ %dist, %for.body.lr.ph ], [ %spec.select, %for.body ] %2 = load ptr, ptr %edges, align 8, !tbaa !12 %arrayidx9 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv %3 = load i32, ptr %arrayidx9, align 4, !tbaa !13 %call = tail call i32 @calc_dists_rec(i32 noundef %3, ptr noundef %dists, i32 noundef %add) %spec.select = tail call i32 @llvm.smax.i32(i32 %call, i32 %best.025) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %5 = sext i32 %4 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp5, label %for.body, label %return, !llvm.loop !16 return: ; preds = %for.body, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ %dist, %if.end ], [ %spec.select, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @calc_dists(i32 noundef %s, ptr nocapture noundef %dists) local_unnamed_addr #4 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400000) %dists, i8 -1, i64 400000, i1 false), !tbaa !13 %call = tail call i32 @calc_dists_rec(i32 noundef %s, ptr noundef %dists, i32 noundef 0) ret i32 %call } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @crit_point(i32 noundef %s) local_unnamed_addr #5 { entry: %idxprom31 = sext i32 %s to i64 %arrayidx32 = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom31 %0 = load i32, ptr %arrayidx32, align 4, !tbaa !13 %arrayidx233 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom31 %1 = load i32, ptr %arrayidx233, align 4, !tbaa !13 %cmp.not34 = icmp slt i32 %0, %1 br i1 %cmp.not34, label %for.cond.preheader, label %return tailrecurse.loopexit.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.body ] %bestd.029.unr = phi i32 [ 100000, %for.body.lr.ph ], [ %spec.select26.1, %for.body ] %bestv.028.unr = phi i32 [ -1, %for.body.lr.ph ], [ %spec.select.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %tailrecurse.loopexit, label %for.body.epil for.body.epil: ; preds = %tailrecurse.loopexit.loopexit.unr-lcssa %arrayidx10.epil = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.unr %2 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !13 %idxprom11.epil = sext i32 %2 to i64 %arrayidx12.epil = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11.epil %3 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !13 %cmp13.epil = icmp slt i32 %3, %bestd.029.unr %spec.select.epil = select i1 %cmp13.epil, i32 %2, i32 %bestv.028.unr br label %tailrecurse.loopexit tailrecurse.loopexit: ; preds = %for.body.epil, %tailrecurse.loopexit.loopexit.unr-lcssa, %for.cond.preheader %bestv.0.lcssa = phi i32 [ -1, %for.cond.preheader ], [ %spec.select.lcssa.ph, %tailrecurse.loopexit.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] %idxprom = sext i32 %bestv.0.lcssa to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom %4 = load i32, ptr %arrayidx, align 4, !tbaa !13 %arrayidx2 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom %5 = load i32, ptr %arrayidx2, align 4, !tbaa !13 %cmp.not = icmp slt i32 %4, %5 br i1 %cmp.not, label %for.cond.preheader, label %return for.cond.preheader: ; preds = %entry, %tailrecurse.loopexit %idxprom35 = phi i64 [ %idxprom, %tailrecurse.loopexit ], [ %idxprom31, %entry ] %arrayidx4 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom35 %6 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %cmp527 = icmp sgt i32 %6, 0 br i1 %cmp527, label %for.body.lr.ph, label %tailrecurse.loopexit for.body.lr.ph: ; preds = %for.cond.preheader %edges = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom35, i32 2 %7 = load ptr, ptr %edges, align 8, !tbaa !12 %wide.trip.count = zext i32 %6 to i64 %xtraiter = and i64 %wide.trip.count, 1 %8 = icmp eq i32 %6, 1 br i1 %8, label %tailrecurse.loopexit.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.body ] %bestd.029 = phi i32 [ 100000, %for.body.lr.ph.new ], [ %spec.select26.1, %for.body ] %bestv.028 = phi i32 [ -1, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %arrayidx10 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv %9 = load i32, ptr %arrayidx10, align 4, !tbaa !13 %idxprom11 = sext i32 %9 to i64 %arrayidx12 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11 %10 = load i32, ptr %arrayidx12, align 4, !tbaa !13 %cmp13 = icmp slt i32 %10, %bestd.029 %spec.select = select i1 %cmp13, i32 %9, i32 %bestv.028 %spec.select26 = tail call i32 @llvm.smin.i32(i32 %10, i32 %bestd.029) %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx10.1 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next %11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !13 %idxprom11.1 = sext i32 %11 to i64 %arrayidx12.1 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11.1 %12 = load i32, ptr %arrayidx12.1, align 4, !tbaa !13 %cmp13.1 = icmp slt i32 %12, %spec.select26 %spec.select.1 = select i1 %cmp13.1, i32 %11, i32 %spec.select %spec.select26.1 = tail call i32 @llvm.smin.i32(i32 %12, i32 %spec.select26) %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 %tailrecurse.loopexit.loopexit.unr-lcssa, label %for.body, !llvm.loop !17 return: ; preds = %tailrecurse.loopexit, %entry %s.tr.lcssa = phi i32 [ %s, %entry ], [ %bestv.0.lcssa, %tailrecurse.loopexit ] ret i32 %s.tr.lcssa } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %n = alloca i32, align 4 %u = alloca i32, align 4 %v = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #12 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %u, ptr noundef nonnull %v) %0 = load i32, ptr %u, align 4, !tbaa !13 %dec = add nsw i32 %0, -1 store i32 %dec, ptr %u, align 4, !tbaa !13 %1 = load i32, ptr %v, align 4, !tbaa !13 %dec1 = add nsw i32 %1, -1 store i32 %dec1, ptr %v, align 4, !tbaa !13 %2 = load i32, ptr %n, align 4, !tbaa !13 %cmp86 = icmp sgt i32 %2, 1 br i1 %cmp86, label %for.body, label %for.cond.cleanup for.cond.cleanup.loopexit: ; preds = %for.body %.pre = load i32, ptr %u, align 4, !tbaa !13 %.pre94 = load i32, ptr %v, align 4, !tbaa !13 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %3 = phi i32 [ %.pre94, %for.cond.cleanup.loopexit ], [ %dec1, %entry ] %4 = phi i32 [ %.pre, %for.cond.cleanup.loopexit ], [ %dec, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @udist, i8 -1, i64 400000, i1 false), !tbaa !13 %call.i = call i32 @calc_dists_rec(i32 noundef %4, ptr noundef nonnull @udist, i32 noundef 0) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @vdist, i8 -1, i64 400000, i1 false), !tbaa !13 %call.i77 = call i32 @calc_dists_rec(i32 noundef %3, ptr noundef nonnull @vdist, i32 noundef 0) %idxprom31.i = sext i32 %4 to i64 %arrayidx32.i = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom31.i %5 = load i32, ptr %arrayidx32.i, align 4, !tbaa !13 %arrayidx233.i = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom31.i %6 = load i32, ptr %arrayidx233.i, align 4, !tbaa !13 %cmp.not34.i = icmp slt i32 %5, %6 br i1 %cmp.not34.i, label %for.cond.preheader.i, label %crit_point.exit tailrecurse.loopexit.i.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.lr.ph.i %spec.select.i.lcssa.ph = phi i32 [ undef, %for.body.lr.ph.i ], [ %spec.select.i.1, %for.body.i ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i.1, %for.body.i ] %bestd.029.i.unr = phi i32 [ 100000, %for.body.lr.ph.i ], [ %spec.select26.i.1, %for.body.i ] %bestv.028.i.unr = phi i32 [ -1, %for.body.lr.ph.i ], [ %spec.select.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %tailrecurse.loopexit.i, label %for.body.i.epil for.body.i.epil: ; preds = %tailrecurse.loopexit.i.loopexit.unr-lcssa %arrayidx10.i.epil = getelementptr inbounds i32, ptr %12, i64 %indvars.iv.i.unr %7 = load i32, ptr %arrayidx10.i.epil, align 4, !tbaa !13 %idxprom11.i.epil = sext i32 %7 to i64 %arrayidx12.i.epil = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11.i.epil %8 = load i32, ptr %arrayidx12.i.epil, align 4, !tbaa !13 %cmp13.i.epil = icmp slt i32 %8, %bestd.029.i.unr %spec.select.i.epil = select i1 %cmp13.i.epil, i32 %7, i32 %bestv.028.i.unr br label %tailrecurse.loopexit.i tailrecurse.loopexit.i: ; preds = %for.body.i.epil, %tailrecurse.loopexit.i.loopexit.unr-lcssa, %for.cond.preheader.i %bestv.0.lcssa.i = phi i32 [ -1, %for.cond.preheader.i ], [ %spec.select.i.lcssa.ph, %tailrecurse.loopexit.i.loopexit.unr-lcssa ], [ %spec.select.i.epil, %for.body.i.epil ] %idxprom.i = sext i32 %bestv.0.lcssa.i to i64 %arrayidx.i = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom.i %9 = load i32, ptr %arrayidx.i, align 4, !tbaa !13 %arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom.i %10 = load i32, ptr %arrayidx2.i, align 4, !tbaa !13 %cmp.not.i = icmp slt i32 %9, %10 br i1 %cmp.not.i, label %for.cond.preheader.i, label %crit_point.exit for.cond.preheader.i: ; preds = %for.cond.cleanup, %tailrecurse.loopexit.i %idxprom35.i = phi i64 [ %idxprom.i, %tailrecurse.loopexit.i ], [ %idxprom31.i, %for.cond.cleanup ] %arrayidx4.i = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom35.i %11 = load i32, ptr %arrayidx4.i, align 16, !tbaa !5 %cmp527.i = icmp sgt i32 %11, 0 br i1 %cmp527.i, label %for.body.lr.ph.i, label %tailrecurse.loopexit.i for.body.lr.ph.i: ; preds = %for.cond.preheader.i %edges.i = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom35.i, i32 2 %12 = load ptr, ptr %edges.i, align 8, !tbaa !12 %wide.trip.count.i = zext i32 %11 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %13 = icmp eq i32 %11, 1 br i1 %13, label %tailrecurse.loopexit.i.loopexit.unr-lcssa, label %for.body.lr.ph.i.new for.body.lr.ph.i.new: ; preds = %for.body.lr.ph.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i.new %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %indvars.iv.next.i.1, %for.body.i ] %bestd.029.i = phi i32 [ 100000, %for.body.lr.ph.i.new ], [ %spec.select26.i.1, %for.body.i ] %bestv.028.i = phi i32 [ -1, %for.body.lr.ph.i.new ], [ %spec.select.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx10.i = getelementptr inbounds i32, ptr %12, i64 %indvars.iv.i %14 = load i32, ptr %arrayidx10.i, align 4, !tbaa !13 %idxprom11.i = sext i32 %14 to i64 %arrayidx12.i = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11.i %15 = load i32, ptr %arrayidx12.i, align 4, !tbaa !13 %cmp13.i = icmp slt i32 %15, %bestd.029.i %spec.select.i = select i1 %cmp13.i, i32 %14, i32 %bestv.028.i %spec.select26.i = call i32 @llvm.smin.i32(i32 %15, i32 %bestd.029.i) %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx10.i.1 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv.next.i %16 = load i32, ptr %arrayidx10.i.1, align 4, !tbaa !13 %idxprom11.i.1 = sext i32 %16 to i64 %arrayidx12.i.1 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom11.i.1 %17 = load i32, ptr %arrayidx12.i.1, align 4, !tbaa !13 %cmp13.i.1 = icmp slt i32 %17, %spec.select26.i %spec.select.i.1 = select i1 %cmp13.i.1, i32 %16, i32 %spec.select.i %spec.select26.i.1 = call i32 @llvm.smin.i32(i32 %17, i32 %spec.select26.i) %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 %tailrecurse.loopexit.i.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17 crit_point.exit: ; preds = %tailrecurse.loopexit.i, %for.cond.cleanup %idxprom.pre-phi = phi i64 [ %idxprom31.i, %for.cond.cleanup ], [ %idxprom.i, %tailrecurse.loopexit.i ] %s.tr.lcssa.i = phi i32 [ %4, %for.cond.cleanup ], [ %bestv.0.lcssa.i, %tailrecurse.loopexit.i ] %edges = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom.pre-phi, i32 2 %arrayidx = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom.pre-phi %18 = load i32, ptr %arrayidx, align 16, !tbaa !5 %19 = call i32 @llvm.smax.i32(i32 %18, i32 1) %smax = add nsw i32 %19, -1 %wide.trip.count = zext i32 %smax to i64 %.pre95.pre = load ptr, ptr %edges, align 8, !tbaa !12 br label %for.cond8 for.body: ; preds = %entry, %for.body %i.087 = phi i32 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #12 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %20 = load i32, ptr %a, align 4, !tbaa !13 %sub3 = add nsw i32 %20, -1 %21 = load i32, ptr %b, align 4, !tbaa !13 %sub4 = add nsw i32 %21, -1 call void @add_edge(i32 noundef %sub3, i32 noundef %sub4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #12 %inc = add nuw nsw i32 %i.087, 1 %22 = load i32, ptr %n, align 4, !tbaa !13 %sub = add nsw i32 %22, -1 %cmp = icmp slt i32 %inc, %sub br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !18 for.cond8: ; preds = %for.body12, %crit_point.exit %indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ 0, %crit_point.exit ] %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count br i1 %exitcond.not, label %for.end30, label %for.body12 for.body12: ; preds = %for.cond8 %arrayidx16 = getelementptr inbounds i32, ptr %.pre95.pre, i64 %indvars.iv %23 = load i32, ptr %arrayidx16, align 4, !tbaa !13 %idxprom17 = sext i32 %23 to i64 %arrayidx18 = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom17 %24 = load i32, ptr %arrayidx18, align 4, !tbaa !13 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx23 = getelementptr inbounds i32, ptr %.pre95.pre, i64 %indvars.iv.next %25 = load i32, ptr %arrayidx23, align 4, !tbaa !13 %idxprom24 = sext i32 %25 to i64 %arrayidx25 = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom24 %26 = load i32, ptr %arrayidx25, align 4, !tbaa !13 %cmp26 = icmp slt i32 %24, %26 br i1 %cmp26, label %for.body12.for.end30_crit_edge, label %for.cond8 for.body12.for.end30_crit_edge: ; preds = %for.body12 %.pre96 = and i64 %indvars.iv, 4294967295 br label %for.end30 for.end30: ; preds = %for.cond8, %for.body12.for.end30_crit_edge %idxprom34.pre-phi = phi i64 [ %.pre96, %for.body12.for.end30_crit_edge ], [ %wide.trip.count, %for.cond8 ] %arrayidx35 = getelementptr inbounds i32, ptr %.pre95.pre, i64 %idxprom34.pre-phi %27 = load i32, ptr %arrayidx35, align 4, !tbaa !13 %idxprom36 = sext i32 %27 to i64 %arrayidx37 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom36 %28 = load i32, ptr %arrayidx37, align 16, !tbaa !5 %cmp18.i = icmp sgt i32 %28, 0 br i1 %cmp18.i, label %for.body.lr.ph.i78, label %del_list.exit for.body.lr.ph.i78: ; preds = %for.end30 %edges.i79 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %idxprom36, i32 2 %29 = load ptr, ptr %edges.i79, align 8, !tbaa !12 br label %for.body.i80 for.body.i80: ; preds = %for.inc.i, %for.body.lr.ph.i78 %30 = phi i32 [ %28, %for.body.lr.ph.i78 ], [ %32, %for.inc.i ] %indvars.iv.i81 = phi i64 [ 0, %for.body.lr.ph.i78 ], [ %indvars.iv.next.i83, %for.inc.i ] %tail.019.i = phi i32 [ 0, %for.body.lr.ph.i78 ], [ %tail.1.i, %for.inc.i ] %arrayidx.i82 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv.i81 %31 = load i32, ptr %arrayidx.i82, align 4, !tbaa !13 %cmp1.i = icmp eq i32 %31, %s.tr.lcssa.i br i1 %cmp1.i, label %for.inc.i, label %if.end.i if.end.i: ; preds = %for.body.i80 %inc.i = add nsw i32 %tail.019.i, 1 %idxprom6.i = sext i32 %tail.019.i to i64 %arrayidx7.i = getelementptr inbounds i32, ptr %29, i64 %idxprom6.i store i32 %31, ptr %arrayidx7.i, align 4, !tbaa !13 %.pre.i = load i32, ptr %arrayidx37, align 16, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.end.i, %for.body.i80 %32 = phi i32 [ %30, %for.body.i80 ], [ %.pre.i, %if.end.i ] %tail.1.i = phi i32 [ %tail.019.i, %for.body.i80 ], [ %inc.i, %if.end.i ] %indvars.iv.next.i83 = add nuw nsw i64 %indvars.iv.i81, 1 %33 = sext i32 %32 to i64 %cmp.i = icmp slt i64 %indvars.iv.next.i83, %33 br i1 %cmp.i, label %for.body.i80, label %del_list.exit, !llvm.loop !14 del_list.exit: ; preds = %for.inc.i, %for.end30 %.lcssa.i = phi i32 [ %28, %for.end30 ], [ %32, %for.inc.i ] %dec.i = add nsw i32 %.lcssa.i, -1 store i32 %dec.i, ptr %arrayidx37, align 16, !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @cdist, i8 -1, i64 400000, i1 false), !tbaa !13 %call.i84 = call i32 @calc_dists_rec(i32 noundef %27, ptr noundef nonnull @cdist, i32 noundef 0) %arrayidx40 = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom36 %34 = load i32, ptr %arrayidx40, align 4, !tbaa !13 %add41 = add nsw i32 %34, %call.i84 %arrayidx43 = getelementptr inbounds [100000 x i32], ptr @udist, i64 0, i64 %idxprom.pre-phi %35 = load i32, ptr %arrayidx43, align 4, !tbaa !13 %arrayidx45 = getelementptr inbounds [100000 x i32], ptr @vdist, i64 0, i64 %idxprom.pre-phi %36 = load i32, ptr %arrayidx45, align 4, !tbaa !13 %cmp46 = icmp eq i32 %35, %36 %conv = zext i1 %cmp46 to i32 %add47 = add nsw i32 %add41, %conv %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add47) %37 = load i32, ptr %n, align 4, !tbaa !13 %cmp5188 = icmp sgt i32 %37, 0 br i1 %cmp5188, label %for.body54, label %for.cond.cleanup53 for.cond.cleanup53: ; preds = %for.body54, %del_list.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #12 ret i32 0 for.body54: ; preds = %del_list.exit, %for.body54 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body54 ], [ 0, %del_list.exit ] %edges57 = getelementptr inbounds [100000 x %struct.list], ptr @verts, i64 0, i64 %indvars.iv91, i32 2 %38 = load ptr, ptr %edges57, align 8, !tbaa !12 call void @free(ptr noundef %38) #12 %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %39 = load i32, ptr %n, align 4, !tbaa !13 %40 = sext i32 %39 to i64 %cmp51 = icmp slt i64 %indvars.iv.next92, %40 br i1 %cmp51, label %for.body54, label %for.cond.cleanup53, !llvm.loop !19 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #9 attributes #0 = { mustprogress 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 #1 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree 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 #6 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-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 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #11 = { nounwind allocsize(1) } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"list", !7, i64 0, !7, i64 4, !10, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"any pointer", !8, i64 0} !11 = !{!6, !7, i64 4} !12 = !{!6, !10, i64 8} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = distinct !{!16, !15} !17 = distinct !{!17, !15} !18 = distinct !{!18, !15} !19 = distinct !{!19, !15}
#include<stdio.h> #include<stdlib.h> #include<string.h> void solve(); int time=0; void solve(int li[],int l){ int t,n; scanf("%d%d",&t,&n); if(t==1){ if(li[n-1]==1&&1-li[n-1]==0){ time--; }else if(li[n-1]==0&&1-li[n-1]==1){ time++; } li[n-1]=1-li[n-1]; }else { if(time>=n){ printf("1\n"); }else printf("0\n"); } } int main(){ int k,q; scanf("%d%d",&k,&q); int arr[k]; int i; for(i=0;i<k;i++){ scanf("%d",&arr[i]); if(arr[i]==1) time++; } while(q--){ solve(arr,k); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17989/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17989/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @time = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 @str.4 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @solve(ptr nocapture noundef %li, i32 noundef %l) local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %n) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.else27 if.then: ; preds = %entry %1 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds i32, ptr %li, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 switch i32 %2, label %if.end19 [ i32 1, label %if.end19.sink.split i32 0, label %if.then18 ] if.then18: ; preds = %if.then br label %if.end19.sink.split if.end19.sink.split: ; preds = %if.then, %if.then18 %.sink41 = phi i32 [ 1, %if.then18 ], [ -1, %if.then ] %3 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %3, %.sink41 store i32 %inc, ptr @time, align 4, !tbaa !5 br label %if.end19 if.end19: ; preds = %if.end19.sink.split, %if.then %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %sub23 = sub nsw i32 1, %4 store i32 %sub23, ptr %arrayidx, align 4, !tbaa !5 br label %if.end34 if.else27: ; preds = %entry %5 = load i32, ptr @time, align 4, !tbaa !5 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp28.not = icmp slt i32 %5, %6 br i1 %cmp28.not, label %if.else31, label %if.then29 if.then29: ; preds = %if.else27 %puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %if.end34 if.else31: ; preds = %if.else27 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end34 if.end34: ; preds = %if.then29, %if.else31, %if.end19 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t.i = alloca i32, align 4 %n.i = alloca i32, align 4 %k = alloca i32, align 4 %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %q) %0 = load i32, ptr %k, 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 %k, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %3, 0 br i1 %cmp9, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.inc, %entry %4 = load i32, ptr %q, align 4, !tbaa !5 %dec11 = add nsw i32 %4, -1 store i32 %dec11, ptr %q, align 4, !tbaa !5 %tobool.not12 = icmp eq i32 %4, 0 br i1 %tobool.not12, label %while.end, label %while.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx) %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp eq i32 %5, 1 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body %6 = load i32, ptr @time, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @time, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %k, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %solve.exit call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t.i) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n.i) #5 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t.i, ptr noundef nonnull %n.i) %9 = load i32, ptr %t.i, align 4, !tbaa !5 %cmp.i = icmp eq i32 %9, 1 br i1 %cmp.i, label %if.then.i, label %if.else27.i if.then.i: ; preds = %while.body %10 = load i32, ptr %n.i, align 4, !tbaa !5 %sub.i = add nsw i32 %10, -1 %idxprom.i = sext i32 %sub.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 switch i32 %11, label %if.end19.i [ i32 1, label %if.end19.sink.split.i i32 0, label %if.then18.i ] if.then18.i: ; preds = %if.then.i br label %if.end19.sink.split.i if.end19.sink.split.i: ; preds = %if.then18.i, %if.then.i %.sink41.i = phi i32 [ 1, %if.then18.i ], [ -1, %if.then.i ] %12 = load i32, ptr @time, align 4, !tbaa !5 %inc.i = add nsw i32 %12, %.sink41.i store i32 %inc.i, ptr @time, align 4, !tbaa !5 br label %if.end19.i if.end19.i: ; preds = %if.end19.sink.split.i, %if.then.i %sub23.i = sub nsw i32 1, %11 store i32 %sub23.i, ptr %arrayidx.i, align 4, !tbaa !5 br label %solve.exit if.else27.i: ; preds = %while.body %13 = load i32, ptr @time, align 4, !tbaa !5 %14 = load i32, ptr %n.i, align 4, !tbaa !5 %cmp28.not.i = icmp slt i32 %13, %14 br i1 %cmp28.not.i, label %if.else31.i, label %if.then29.i if.then29.i: ; preds = %if.else27.i %puts40.i = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %solve.exit if.else31.i: ; preds = %if.else27.i %puts.i = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %solve.exit solve.exit: ; preds = %if.end19.i, %if.then29.i, %if.else31.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n.i) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t.i) #5 %15 = load i32, ptr %q, align 4, !tbaa !5 %dec = add nsw i32 %15, -1 store i32 %dec, ptr %q, align 4, !tbaa !5 %tobool.not = icmp eq i32 %15, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %solve.exit, %while.cond.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
//a.c A-Pair #include<stdio.h> int main(void){ int k; scanf("%d",&k); printf("%d\n",((k/2)*(k%2))+((k/2)*(k/2))); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179932/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179932/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %div = sdiv i32 %0, 2 %rem = srem i32 %0, 2 %mul35 = add nsw i32 %rem, %div %add = mul i32 %mul35, %div %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int k; scanf("%d",&k); int answer=0; if(k%2 == 0) printf("%d",k*k/4); else printf("%d",(k/2)*(k/2+1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_179976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_179976/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i32 %0, %0 %div6 = lshr i32 %mul, 2 br label %if.end if.else: ; preds = %entry %div2 = sdiv i32 %0, 2 %add = add nsw i32 %div2, 1 %mul4 = mul nsw i32 %add, %div2 br label %if.end if.end: ; preds = %if.else, %if.then %mul4.sink = phi i32 [ %mul4, %if.else ], [ %div6, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int k, odd, even; scanf("%d", &k); even = k/2; odd = k - even; printf("%d\n", odd*even); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180017/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %div = sdiv i32 %0, 2 %sub = sub nsw i32 %0, %div %mul = mul nsw i32 %sub, %div %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int k; scanf("%d",&k); if((k%2)==0){ printf("%d",(k/2)*(k/2)); }else{ printf("%d",((k-1)/2)*((k+1)/2)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180068/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180068/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %div = sdiv i32 %0, 2 %mul = mul nsw i32 %div, %div br label %if.end if.else: ; preds = %entry %2 = insertelement <2 x i32> poison, i32 %0, i64 0 %3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> zeroinitializer %4 = add nsw <2 x i32> %3, <i32 -1, i32 1> %5 = sdiv <2 x i32> %4, <i32 2, i32 2> %6 = extractelement <2 x i32> %5, i64 0 %7 = extractelement <2 x i32> %5, i64 1 %mul5 = mul nsw i32 %6, %7 br label %if.end if.end: ; preds = %if.else, %if.then %mul5.sink = phi i32 [ %mul5, %if.else ], [ %mul, %if.then ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul5.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int k; scanf("%d", &k); if(k%2==0) { printf("%d", k/2*k/2); } else printf("%d", k/2*((k/2)+1) ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180110/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180110/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 %div = sdiv i32 %0, 2 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i32 %div, %0 %div1 = sdiv i32 %mul, 2 br label %if.end if.else: ; preds = %entry %add = add nsw i32 %div, 1 %mul5 = mul nsw i32 %add, %div br label %if.end if.end: ; preds = %if.else, %if.then %mul5.sink = phi i32 [ %mul5, %if.else ], [ %div1, %if.then ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul5.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { int n; scanf("%d", &n); int w=n/2; if(n%2==0) { printf("%d\n", w*w); } else printf("%d\n",w*w+w); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180161/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180161/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %div = sdiv i32 %0, 2 %1 = and i32 %0, 1 %div8.sink = add nsw i32 %div, %1 %add = mul i32 %div8.sink, %div %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdlib.h> #include <math.h> #include <string.h> #include <stdio.h> int main() { int a,b,n,k,i,j; scanf("%d",&k); if(k%2==0){a=k/2; a=a*a; printf("%d",a);} else{ a=k/2; a=a*(a+1); printf("%d",a); }return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180204/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180204/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %add.sink = add nsw i32 %div, %1 %mul3 = mul nsw i32 %add.sink, %div %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> //if(strcmp(s[i],"AC")==0) //if(s[l]=='#') /*小文字判定 if((moji>= 'a') && (moji<='z')){ printf("a\n"); return 0; } */ int W_Length(char *str){ int length = 0; while(*str++ != '\0') length++; return length; } void swap(int *a, int *b){ int temp; temp=*a; *a=*b; *b=temp; } //swap(&a, &b) double deg(double theta){//deg to theta return theta*(2*3.14159265359)/360; } int cmp( const void *p, const void *q ) { return *(int*)p - *(int*)q; }//ちいさい順 //qsort(a,n,sizeof(int),cmp); //char s[n][11] int cmp_s(const void * left, const void * right) { char *left_char = (char *)left; char *right_char = (char *)right; return strcmp(left_char, right_char); } //qsort(s,n,sizeof(s[0]),cmp_s); int main (void) { long long int a,b,L,j,n,m=0,i,prime[10000],prime_num[100000]={0},a_prime[100005]={0},b_prime[100005]={0},num=1; scanf("%lld%lld",&a,&b); L=a; if(b>a){ L=b; } for(i=2;i<=L;i++){ if(prime_num[i]==2){ continue; } prime_num[i]=1; //printf("2_%lld\n",i); m++; prime[m]=i; for(j=2;j*i<=L;j++){ prime_num[j*i]=2; } } for(i=1;i<=m&&a!=0;i++){ while(a!=0){ if(a%prime[i]==0){ a_prime[i]++; a=a/prime[i]; //printf("a is %lld now\n",a); } else{ break; } } } for(i=1;i<=m&&b!=0;i++){ while(b!=0){ if(b%prime[i]==0){ b_prime[i]++; b=b/prime[i]; //printf("b is %lld now\n",b); } else{ break; } } } for(i=1;i<=m;i++){ if(a_prime[i]!=0||b_prime[i]!=0){ if(a_prime[i]>b_prime[i]){ //printf("a%lld=>%lld\n",prime[i],a_prime[i]); for(j=0;j<a_prime[i];j++){ num=num*prime[i]; } } else{ //printf("b%lld=>%lld\n",prime[i],b_prime[i]); for(j=0;j<b_prime[i];j++){ num=num*prime[i]; if(num>100000){ //printf("%lld\n",num); } } } } } //printf("%lld\n",a_prime[1]); printf("%lld",num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180255/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180255/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @W_Length(ptr nocapture noundef readonly %str) local_unnamed_addr #0 { entry: %0 = load i8, ptr %str, align 1, !tbaa !5 %cmp.not3 = icmp eq i8 %0, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %length.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %str.addr.04 = phi ptr [ %incdec.ptr, %while.body ], [ %str, %entry ] %incdec.ptr = getelementptr inbounds i8, ptr %str.addr.04, i64 1 %inc = add nuw nsw i32 %length.05, 1 %1 = load i8, ptr %incdec.ptr, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %length.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %length.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %a, align 4, !tbaa !10 %1 = load i32, ptr %b, align 4, !tbaa !10 store i32 %1, ptr %a, align 4, !tbaa !10 store i32 %0, ptr %b, align 4, !tbaa !10 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @deg(double noundef %theta) local_unnamed_addr #3 { entry: %mul = fmul double %theta, 0x401921FB54442EEA %div = fdiv double %mul, 3.600000e+02 ret double %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) local_unnamed_addr #4 { entry: %0 = load i32, ptr %p, align 4, !tbaa !10 %1 = load i32, ptr %q, align 4, !tbaa !10 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_s(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #11 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %prime = alloca [10000 x i64], align 16 %prime_num = alloca [100000 x i64], align 16 %a_prime = alloca [100005 x i64], align 16 %b_prime = alloca [100005 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #12 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #12 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %prime) #12 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %prime_num) #12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %prime_num, i8 0, i64 800000, i1 false) call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %a_prime) #12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %a_prime, i8 0, i64 800040, i1 false) call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %b_prime) #12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %b_prime, i8 0, i64 800040, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8 %1 = load i64, ptr %b, align 8 %spec.select = call i64 @llvm.smax.i64(i64 %1, i64 %0) %cmp1.not142 = icmp slt i64 %spec.select, 2 br i1 %cmp1.not142, label %for.end92, label %for.body for.cond16.preheader: ; preds = %for.inc13 %cmp17148 = icmp sgt i64 %m.1, 0 %cmp18149 = icmp ne i64 %0, 0 %2 = select i1 %cmp17148, i1 %cmp18149, i1 false br i1 %2, label %while.cond.preheader, label %for.cond31.preheader for.body: ; preds = %entry, %for.inc13 %i.0144 = phi i64 [ %inc14, %for.inc13 ], [ 2, %entry ] %m.0143 = phi i64 [ %m.1, %for.inc13 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i64], ptr %prime_num, i64 0, i64 %i.0144 %3 = load i64, ptr %arrayidx, align 8, !tbaa !12 %cmp2 = icmp eq i64 %3, 2 br i1 %cmp2, label %for.inc13, label %if.end4 if.end4: ; preds = %for.body store i64 1, ptr %arrayidx, align 8, !tbaa !12 %inc = add nsw i64 %m.0143, 1 %arrayidx6 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %inc store i64 %i.0144, ptr %arrayidx6, align 8, !tbaa !12 %mul138 = shl nuw nsw i64 %i.0144, 1 %cmp8.not139 = icmp sgt i64 %mul138, %spec.select br i1 %cmp8.not139, label %for.inc13, label %for.body9 for.body9: ; preds = %if.end4, %for.body9 %mul141 = phi i64 [ %mul, %for.body9 ], [ %mul138, %if.end4 ] %j.0140 = phi i64 [ %inc12, %for.body9 ], [ 2, %if.end4 ] %arrayidx11 = getelementptr inbounds [100000 x i64], ptr %prime_num, i64 0, i64 %mul141 store i64 2, ptr %arrayidx11, align 8, !tbaa !12 %inc12 = add nuw nsw i64 %j.0140, 1 %mul = mul nsw i64 %inc12, %i.0144 %cmp8.not = icmp sgt i64 %mul, %spec.select br i1 %cmp8.not, label %for.inc13, label %for.body9, !llvm.loop !14 for.inc13: ; preds = %for.body9, %if.end4, %for.body %m.1 = phi i64 [ %m.0143, %for.body ], [ %inc, %if.end4 ], [ %inc, %for.body9 ] %inc14 = add nuw i64 %i.0144, 1 %exitcond.not = icmp eq i64 %i.0144, %spec.select br i1 %exitcond.not, label %for.cond16.preheader, label %for.body, !llvm.loop !15 while.cond.preheader: ; preds = %for.cond16.preheader, %for.inc28 %i.1151 = phi i64 [ %inc29, %for.inc28 ], [ 1, %for.cond16.preheader ] %div147150 = phi i64 [ %div146, %for.inc28 ], [ %0, %for.cond16.preheader ] %arrayidx21 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %i.1151 %4 = load i64, ptr %arrayidx21, align 8, !tbaa !12 %arrayidx24 = getelementptr inbounds [100005 x i64], ptr %a_prime, i64 0, i64 %i.1151 br label %while.body for.cond31.preheader: ; preds = %for.inc28, %if.then23, %for.cond16.preheader %cmp34156 = icmp ne i64 %1, 0 %5 = select i1 %cmp17148, i1 %cmp34156, i1 false br i1 %5, label %while.cond37.preheader, label %for.cond54.preheader while.body: ; preds = %while.cond.preheader, %if.then23 %div146 = phi i64 [ %div147150, %while.cond.preheader ], [ %div, %if.then23 ] %rem = srem i64 %div146, %4 %div = sdiv i64 %div146, %4 %cmp22 = icmp eq i64 %rem, 0 br i1 %cmp22, label %if.then23, label %for.inc28 if.then23: ; preds = %while.body %6 = load i64, ptr %arrayidx24, align 8, !tbaa !12 %inc25 = add nsw i64 %6, 1 store i64 %inc25, ptr %arrayidx24, align 8, !tbaa !12 store i64 %div, ptr %a, align 8, !tbaa !12 %cmp20.not = icmp eq i64 %div, 0 br i1 %cmp20.not, label %for.cond31.preheader, label %while.body, !llvm.loop !16 for.inc28: ; preds = %while.body %inc29 = add nuw nsw i64 %i.1151, 1 %cmp17 = icmp slt i64 %i.1151, %m.1 br i1 %cmp17, label %while.cond.preheader, label %for.cond31.preheader, !llvm.loop !17 while.cond37.preheader: ; preds = %for.cond31.preheader, %for.inc51 %i.2158 = phi i64 [ %inc52, %for.inc51 ], [ 1, %for.cond31.preheader ] %div47154157 = phi i64 [ %div47153, %for.inc51 ], [ %1, %for.cond31.preheader ] %arrayidx40 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %i.2158 %7 = load i64, ptr %arrayidx40, align 8, !tbaa !12 %arrayidx44 = getelementptr inbounds [100005 x i64], ptr %b_prime, i64 0, i64 %i.2158 br label %while.body39 for.cond54.preheader: ; preds = %for.inc51, %if.then43, %for.cond31.preheader %cmp55.not167 = icmp slt i64 %m.1, 1 br i1 %cmp55.not167, label %for.end92, label %for.body56 while.body39: ; preds = %while.cond37.preheader, %if.then43 %div47153 = phi i64 [ %div47154157, %while.cond37.preheader ], [ %div47, %if.then43 ] %rem41 = srem i64 %div47153, %7 %div47 = sdiv i64 %div47153, %7 %cmp42 = icmp eq i64 %rem41, 0 br i1 %cmp42, label %if.then43, label %for.inc51 if.then43: ; preds = %while.body39 %8 = load i64, ptr %arrayidx44, align 8, !tbaa !12 %inc45 = add nsw i64 %8, 1 store i64 %inc45, ptr %arrayidx44, align 8, !tbaa !12 store i64 %div47, ptr %b, align 8, !tbaa !12 %cmp38.not = icmp eq i64 %div47, 0 br i1 %cmp38.not, label %for.cond54.preheader, label %while.body39, !llvm.loop !18 for.inc51: ; preds = %while.body39 %inc52 = add nuw nsw i64 %i.2158, 1 %cmp32 = icmp slt i64 %i.2158, %m.1 br i1 %cmp32, label %while.cond37.preheader, label %for.cond54.preheader, !llvm.loop !19 for.body56: ; preds = %for.cond54.preheader, %for.inc90 %num.0170 = phi i64 [ %num.3, %for.inc90 ], [ 1, %for.cond54.preheader ] %i.3168 = phi i64 [ %inc91, %for.inc90 ], [ 1, %for.cond54.preheader ] %arrayidx57 = getelementptr inbounds [100005 x i64], ptr %a_prime, i64 0, i64 %i.3168 %9 = load i64, ptr %arrayidx57, align 8, !tbaa !12 %cmp58.not = icmp eq i64 %9, 0 %arrayidx59 = getelementptr inbounds [100005 x i64], ptr %b_prime, i64 0, i64 %i.3168 %10 = load i64, ptr %arrayidx59, align 8, !tbaa !12 br i1 %cmp58.not, label %lor.lhs.false, label %if.then61 lor.lhs.false: ; preds = %for.body56 %cmp64195 = icmp sle i64 %9, %10 %cmp78159 = icmp sgt i64 %10, 0 %or.cond202 = and i1 %cmp78159, %cmp64195 br i1 %or.cond202, label %for.body79.lr.ph, label %for.inc90 if.then61: ; preds = %for.body56 %cmp64 = icmp sgt i64 %9, %10 br i1 %cmp64, label %for.cond66.preheader, label %for.cond76.preheader for.cond76.preheader: ; preds = %if.then61 %cmp78159.old = icmp sgt i64 %10, 0 br i1 %cmp78159.old, label %for.body79.lr.ph, label %for.inc90 for.body79.lr.ph: ; preds = %lor.lhs.false, %for.cond76.preheader %arrayidx80 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %i.3168 %11 = load i64, ptr %arrayidx80, align 8, !tbaa !12 %12 = add i64 %10, -1 %xtraiter215 = and i64 %10, 7 %13 = icmp ult i64 %12, 7 br i1 %13, label %for.inc90.loopexit.unr-lcssa, label %for.body79.lr.ph.new for.body79.lr.ph.new: ; preds = %for.body79.lr.ph %unroll_iter219 = and i64 %10, -8 br label %for.body79 for.cond66.preheader: ; preds = %if.then61 %cmp68163 = icmp sgt i64 %9, 0 br i1 %cmp68163, label %for.body69.lr.ph, label %for.inc90 for.body69.lr.ph: ; preds = %for.cond66.preheader %arrayidx70 = getelementptr inbounds [10000 x i64], ptr %prime, i64 0, i64 %i.3168 %14 = load i64, ptr %arrayidx70, align 8, !tbaa !12 %xtraiter = and i64 %9, 7 %15 = icmp ult i64 %9, 8 br i1 %15, label %for.inc90.loopexit209.unr-lcssa, label %for.body69.lr.ph.new for.body69.lr.ph.new: ; preds = %for.body69.lr.ph %unroll_iter = and i64 %9, -8 br label %for.body69 for.body69: ; preds = %for.body69, %for.body69.lr.ph.new %num.1165 = phi i64 [ %num.0170, %for.body69.lr.ph.new ], [ %mul71.7, %for.body69 ] %niter = phi i64 [ 0, %for.body69.lr.ph.new ], [ %niter.next.7, %for.body69 ] %mul71 = mul nsw i64 %14, %num.1165 %mul71.1 = mul nsw i64 %14, %mul71 %mul71.2 = mul nsw i64 %14, %mul71.1 %mul71.3 = mul nsw i64 %14, %mul71.2 %mul71.4 = mul nsw i64 %14, %mul71.3 %mul71.5 = mul nsw i64 %14, %mul71.4 %mul71.6 = mul nsw i64 %14, %mul71.5 %mul71.7 = mul nsw i64 %14, %mul71.6 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.inc90.loopexit209.unr-lcssa, label %for.body69, !llvm.loop !20 for.body79: ; preds = %for.body79, %for.body79.lr.ph.new %num.2161 = phi i64 [ %num.0170, %for.body79.lr.ph.new ], [ %mul81.7, %for.body79 ] %niter220 = phi i64 [ 0, %for.body79.lr.ph.new ], [ %niter220.next.7, %for.body79 ] %mul81 = mul nsw i64 %11, %num.2161 %mul81.1 = mul nsw i64 %11, %mul81 %mul81.2 = mul nsw i64 %11, %mul81.1 %mul81.3 = mul nsw i64 %11, %mul81.2 %mul81.4 = mul nsw i64 %11, %mul81.3 %mul81.5 = mul nsw i64 %11, %mul81.4 %mul81.6 = mul nsw i64 %11, %mul81.5 %mul81.7 = mul nsw i64 %11, %mul81.6 %niter220.next.7 = add i64 %niter220, 8 %niter220.ncmp.7 = icmp eq i64 %niter220.next.7, %unroll_iter219 br i1 %niter220.ncmp.7, label %for.inc90.loopexit.unr-lcssa, label %for.body79, !llvm.loop !21 for.inc90.loopexit.unr-lcssa: ; preds = %for.body79, %for.body79.lr.ph %mul81.lcssa.ph = phi i64 [ undef, %for.body79.lr.ph ], [ %mul81.7, %for.body79 ] %num.2161.unr = phi i64 [ %num.0170, %for.body79.lr.ph ], [ %mul81.7, %for.body79 ] %lcmp.mod217.not = icmp eq i64 %xtraiter215, 0 br i1 %lcmp.mod217.not, label %for.inc90, label %for.body79.epil for.body79.epil: ; preds = %for.inc90.loopexit.unr-lcssa, %for.body79.epil %num.2161.epil = phi i64 [ %mul81.epil, %for.body79.epil ], [ %num.2161.unr, %for.inc90.loopexit.unr-lcssa ] %epil.iter216 = phi i64 [ %epil.iter216.next, %for.body79.epil ], [ 0, %for.inc90.loopexit.unr-lcssa ] %mul81.epil = mul nsw i64 %11, %num.2161.epil %epil.iter216.next = add i64 %epil.iter216, 1 %epil.iter216.cmp.not = icmp eq i64 %epil.iter216.next, %xtraiter215 br i1 %epil.iter216.cmp.not, label %for.inc90, label %for.body79.epil, !llvm.loop !22 for.inc90.loopexit209.unr-lcssa: ; preds = %for.body69, %for.body69.lr.ph %mul71.lcssa.ph = phi i64 [ undef, %for.body69.lr.ph ], [ %mul71.7, %for.body69 ] %num.1165.unr = phi i64 [ %num.0170, %for.body69.lr.ph ], [ %mul71.7, %for.body69 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc90, label %for.body69.epil for.body69.epil: ; preds = %for.inc90.loopexit209.unr-lcssa, %for.body69.epil %num.1165.epil = phi i64 [ %mul71.epil, %for.body69.epil ], [ %num.1165.unr, %for.inc90.loopexit209.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body69.epil ], [ 0, %for.inc90.loopexit209.unr-lcssa ] %mul71.epil = mul nsw i64 %14, %num.1165.epil %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.inc90, label %for.body69.epil, !llvm.loop !24 for.inc90: ; preds = %for.inc90.loopexit209.unr-lcssa, %for.body69.epil, %for.inc90.loopexit.unr-lcssa, %for.body79.epil, %for.cond76.preheader, %for.cond66.preheader, %lor.lhs.false %num.3 = phi i64 [ %num.0170, %lor.lhs.false ], [ %num.0170, %for.cond66.preheader ], [ %num.0170, %for.cond76.preheader ], [ %mul81.lcssa.ph, %for.inc90.loopexit.unr-lcssa ], [ %mul81.epil, %for.body79.epil ], [ %mul71.lcssa.ph, %for.inc90.loopexit209.unr-lcssa ], [ %mul71.epil, %for.body69.epil ] %inc91 = add nuw i64 %i.3168, 1 %exitcond175.not = icmp eq i64 %i.3168, %m.1 br i1 %exitcond175.not, label %for.end92, label %for.body56, !llvm.loop !25 for.end92: ; preds = %for.inc90, %entry, %for.cond54.preheader %num.0.lcssa = phi i64 [ 1, %for.cond54.preheader ], [ 1, %entry ], [ %num.3, %for.inc90 ] %call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %b_prime) #12 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %a_prime) #12 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %prime_num) #12 call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %prime) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #12 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #10 attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nounwind willreturn memory(read) } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 = !{!13, !13, i64 0} !13 = !{!"long long", !6, i64 0} !14 = distinct !{!14, !9} !15 = distinct !{!15, !9} !16 = distinct !{!16, !9} !17 = distinct !{!17, !9} !18 = distinct !{!18, !9} !19 = distinct !{!19, !9} !20 = distinct !{!20, !9} !21 = distinct !{!21, !9} !22 = distinct !{!22, !23} !23 = !{!"llvm.loop.unroll.disable"} !24 = distinct !{!24, !23} !25 = distinct !{!25, !9}
#include <stdio.h> #include <string.h> #include <math.h> long gcd(long x, long y) { if (x < y) { long tmp = x; x = y; y = tmp; } if (x % y == 0)return y; else { gcd(y, x % y); } } int main(void) { long a, b; scanf("%ld %ld", &a, &b); printf("%ld", a*b/gcd(a, b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180299/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180299/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %spec.select15 = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) %spec.select1316 = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) %rem17 = srem i64 %spec.select15, %spec.select1316 %cmp118.not = icmp eq i64 %rem17, 0 br i1 %cmp118.not, label %if.end4, label %if.else if.else: ; preds = %entry, %if.else %rem22 = phi i64 [ %rem, %if.else ], [ %rem17, %entry ] %spec.select1321 = phi i64 [ %spec.select13, %if.else ], [ %spec.select1316, %entry ] %spec.select = tail call i64 @llvm.smax.i64(i64 %spec.select1321, i64 %rem22) %spec.select13 = tail call i64 @llvm.smin.i64(i64 %spec.select1321, i64 %rem22) %rem = srem i64 %spec.select, %spec.select13 %cmp1 = icmp eq i64 %rem, 0 br i1 %cmp1, label %if.end4, label %if.else if.end4: ; preds = %if.else, %entry ret i64 %spec.select1316 } ; 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 i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %spec.select15.i = call i64 @llvm.smax.i64(i64 %0, i64 %1) %spec.select1316.i = call i64 @llvm.smin.i64(i64 %0, i64 %1) %rem17.i = srem i64 %spec.select15.i, %spec.select1316.i %cmp118.not.i = icmp eq i64 %rem17.i, 0 br i1 %cmp118.not.i, label %gcd.exit, label %if.else.i if.else.i: ; preds = %entry, %if.else.i %rem22.i = phi i64 [ %rem.i, %if.else.i ], [ %rem17.i, %entry ] %spec.select1321.i = phi i64 [ %spec.select13.i, %if.else.i ], [ %spec.select1316.i, %entry ] %spec.select.i = call i64 @llvm.smax.i64(i64 %spec.select1321.i, i64 %rem22.i) %spec.select13.i = call i64 @llvm.smin.i64(i64 %spec.select1321.i, i64 %rem22.i) %rem.i = srem i64 %spec.select.i, %spec.select13.i %cmp1.i = icmp eq i64 %rem.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.else.i gcd.exit: ; preds = %if.else.i, %entry %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %spec.select1316.i %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int Euclid(int x, int y); int main(void) { long A,B; /*input var*/ long lcm; /*least common multiple*/ scanf("%ld %ld",&A,&B); lcm = A*B/Euclid(A,B); printf("%ld \n",lcm); return 0; } int Euclid(int x, int y) { if(y==0) return x; else return Euclid(y,x%y); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%ld \0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i64, align 8 %B = alloca i64, align 8 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 %A, ptr noundef nonnull %B) %0 = load i64, ptr %A, align 8, !tbaa !5 %1 = load i64, ptr %B, align 8, !tbaa !5 %conv = trunc i64 %0 to i32 %conv1 = trunc i64 %1 to i32 %cmp4.i = icmp eq i32 %conv1, 0 br i1 %cmp4.i, label %Euclid.exit, label %if.else.i if.else.i: ; preds = %entry, %if.else.i %y.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %conv1, %entry ] %x.tr5.i = phi i32 [ %y.tr6.i, %if.else.i ], [ %conv, %entry ] %rem.i = srem i32 %x.tr5.i, %y.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %Euclid.exit, label %if.else.i Euclid.exit: ; preds = %if.else.i, %entry %x.tr.lcssa.i = phi i32 [ %conv, %entry ], [ %y.tr6.i, %if.else.i ] %mul = mul nsw i64 %1, %0 %conv3 = sext i32 %x.tr.lcssa.i to i64 %div = sdiv i64 %mul, %conv3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 8, 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @Euclid(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 { entry: %cmp4 = icmp eq i32 %y, 0 br i1 %cmp4, label %return, label %if.else if.else: ; preds = %entry, %if.else %y.tr6 = phi i32 [ %rem, %if.else ], [ %y, %entry ] %x.tr5 = phi i32 [ %y.tr6, %if.else ], [ %x, %entry ] %rem = srem i32 %x.tr5, %y.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.else return: ; preds = %if.else, %entry %x.tr.lcssa = phi i32 [ %x, %entry ], [ %y.tr6, %if.else ] ret i32 %x.tr.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int i; long long gcd, lcm,n1,n2; scanf("%lld %lld", &n1, &n2); for (i = 1; i <= n1 && i <= n2; ++i) { if (n1 % i == 0 && n2 % i == 0) gcd = i; } lcm = (n1 * n2) / gcd; printf("%lld\n", lcm); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180385/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n1 = alloca i64, align 8 %n2 = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n1) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2) %0 = load i64, ptr %n1, align 8, !tbaa !5 %1 = load i64, ptr %n2, align 8 %.fr = freeze i64 %1 %invariant.smin = call i64 @llvm.smin.i64(i64 %0, i64 %.fr) %2 = icmp sgt i64 %invariant.smin, 0 br i1 %2, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %gcd.021 = phi i64 [ %gcd.1, %for.inc ], [ undef, %entry ] %rem = srem i64 %0, %indvars.iv %cmp6 = icmp eq i64 %rem, 0 br i1 %cmp6, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %rem9 = srem i64 %.fr, %indvars.iv %cmp10 = icmp eq i64 %rem9, 0 %spec.select = select i1 %cmp10, i64 %indvars.iv, i64 %gcd.021 br label %for.inc for.inc: ; preds = %land.lhs.true, %for.body %gcd.1 = phi i64 [ %gcd.021, %for.body ], [ %spec.select, %land.lhs.true ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv, %invariant.smin br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %gcd.0.lcssa = phi i64 [ undef, %entry ], [ %gcd.1, %for.inc ] %mul = mul nsw i64 %.fr, %0 %div = sdiv i64 %mul, %gcd.0.lcssa %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n2) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int gcd(int x, int y) { if(y == 0) { return x; } else { return gcd(y, x%y); } } int main(void) { long long int a, b; scanf("%lld %lld", &a, &b); printf("%lld\n", a*b/gcd(a,b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180435/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %y, 0 br i1 %cmp4, label %return, label %if.else if.else: ; preds = %entry, %if.else %y.tr6 = phi i32 [ %rem, %if.else ], [ %y, %entry ] %x.tr5 = phi i32 [ %y.tr6, %if.else ], [ %x, %entry ] %rem = srem i32 %x.tr5, %y.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.else return: ; preds = %if.else, %entry %x.tr.lcssa = phi i32 [ %x, %entry ], [ %y.tr6, %if.else ] ret i32 %x.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #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 %a, ptr noundef nonnull %b) %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %conv = trunc i64 %0 to i32 %conv1 = trunc i64 %1 to i32 %cmp4.i = icmp eq i32 %conv1, 0 br i1 %cmp4.i, label %gcd.exit, label %if.else.i if.else.i: ; preds = %entry, %if.else.i %y.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %conv1, %entry ] %x.tr5.i = phi i32 [ %y.tr6.i, %if.else.i ], [ %conv, %entry ] %rem.i = srem i32 %x.tr5.i, %y.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %gcd.exit, label %if.else.i gcd.exit: ; preds = %if.else.i, %entry %x.tr.lcssa.i = phi i32 [ %conv, %entry ], [ %y.tr6.i, %if.else.i ] %mul = mul nsw i64 %1, %0 %conv3 = sext i32 %x.tr.lcssa.i to i64 %div = sdiv i64 %mul, %conv3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ long long int A, B, r, p, tmp; scanf("%lld %lld", &A, &B); p = A * B; if(A < B){ tmp = A; A = B; B = tmp; } r = A % B; while(r != 0){ A = B; B = r; r = A % B; } printf("%lld", p/B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180479/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180479/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i64, align 8 %B = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i64, ptr %A, align 8, !tbaa !5 %1 = load i64, ptr %B, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i64 %1, ptr %A, align 8, !tbaa !5 store i64 %0, ptr %B, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i64 [ %0, %if.then ], [ %1, %entry ] %3 = phi i64 [ %1, %if.then ], [ %0, %entry ] %rem = srem i64 %3, %2 %cmp1.not7 = icmp eq i64 %rem, 0 br i1 %cmp1.not7, label %while.end, label %while.body while.body: ; preds = %if.end, %while.body %r.09 = phi i64 [ %rem2, %while.body ], [ %rem, %if.end ] %r.068 = phi i64 [ %r.09, %while.body ], [ %2, %if.end ] %rem2 = srem i64 %r.068, %r.09 %cmp1.not = icmp eq i64 %rem2, 0 br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i64 %r.068, ptr %A, align 8, !tbaa !5 store i64 %r.09, ptr %B, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %if.end %4 = phi i64 [ %r.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ] %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %4 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<math.h> int main(void){ double ax,ay,bx,by,dx,dy,ans; scanf("%lf%lf%lf%lf",&ax,&ay,&bx,&by); dx=ax-bx; dy=ay-by; ans=sqrt(dx*dx+dy*dy); printf("%lf\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180536/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lf%lf%lf%lf\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ax = alloca double, align 8 %ay = alloca double, align 8 %bx = alloca double, align 8 %by = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ax) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ay) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %bx) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %by) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ax, ptr noundef nonnull %ay, ptr noundef nonnull %bx, ptr noundef nonnull %by) %0 = load double, ptr %ax, align 8, !tbaa !5 %1 = load double, ptr %bx, align 8, !tbaa !5 %sub = fsub double %0, %1 %2 = load double, ptr %ay, align 8, !tbaa !5 %3 = load double, ptr %by, align 8, !tbaa !5 %sub1 = fsub double %2, %3 %mul2 = fmul double %sub1, %sub1 %4 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul2) %sqrt = call double @llvm.sqrt.f64(double %4) %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sqrt) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %by) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %bx) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ay) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ax) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.sqrt.f64(double) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !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> typedef struct node{ long long int data; struct node*next; }fair; int main() { long long int n,t; scanf("%I64d %I64d",&n,&t); long long int a[n],i,sum=0,min=1e9+1,s=0,ans=0,u; for(i=0;i<n;i++) { scanf("%I64d",&a[i]); if(min>a[i]) min=a[i]; } while(t>=min) { s=0;sum=0;u=t; for(i=0;i<n;i++) { if(a[i]<=u) { sum+=a[i];s++;u-=a[i]; } } ans+=s*(t/sum);t%=sum; } printf("%I64d\n",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18058/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18058/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%I64d %I64d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %t = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp38 = icmp sgt i64 %2, 0 br i1 %cmp38, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %min.0.lcssa = phi i64 [ 1000000001, %entry ], [ %spec.select, %for.body ] %.lcssa = phi i64 [ %2, %entry ], [ %8, %for.body ] %t.promoted = load i64, ptr %t, align 8, !tbaa !5 %cmp5.not50 = icmp slt i64 %t.promoted, %min.0.lcssa br i1 %cmp5.not50, label %while.end, label %for.cond6.preheader.lr.ph for.cond6.preheader.lr.ph: ; preds = %while.cond.preheader %cmp742 = icmp sgt i64 %.lcssa, 0 br i1 %cmp742, label %for.cond6.preheader.us.preheader, label %while.cond.while.end_crit_edge for.cond6.preheader.us.preheader: ; preds = %for.cond6.preheader.lr.ph %xtraiter = and i64 %.lcssa, 1 %3 = icmp eq i64 %.lcssa, 1 %unroll_iter = and i64 %.lcssa, -2 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond6.preheader.us for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.end18_crit_edge.us %ans.052.us = phi i64 [ %add19.us, %for.cond6.for.end18_crit_edge.us ], [ 0, %for.cond6.preheader.us.preheader ] %rem4951.us = phi i64 [ %rem.us, %for.cond6.for.end18_crit_edge.us ], [ %t.promoted, %for.cond6.preheader.us.preheader ] br i1 %3, label %for.cond6.for.end18_crit_edge.us.unr-lcssa, label %for.body8.us for.body8.us: ; preds = %for.cond6.preheader.us, %for.body8.us %u.046.us = phi i64 [ %u.1.us.1, %for.body8.us ], [ %rem4951.us, %for.cond6.preheader.us ] %s.045.us = phi i64 [ %s.1.us.1, %for.body8.us ], [ 0, %for.cond6.preheader.us ] %sum.044.us = phi i64 [ %sum.1.us.1, %for.body8.us ], [ 0, %for.cond6.preheader.us ] %i.143.us = phi i64 [ %inc17.us.1, %for.body8.us ], [ 0, %for.cond6.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.body8.us ], [ 0, %for.cond6.preheader.us ] %arrayidx9.us = getelementptr inbounds i64, ptr %vla, i64 %i.143.us %4 = load i64, ptr %arrayidx9.us, align 16, !tbaa !5 %cmp10.not.us = icmp sle i64 %4, %u.046.us %add.us = select i1 %cmp10.not.us, i64 %4, i64 0 %sum.1.us = add nsw i64 %add.us, %sum.044.us %inc13.us = zext i1 %cmp10.not.us to i64 %s.1.us = add nuw nsw i64 %s.045.us, %inc13.us %u.1.us = sub nsw i64 %u.046.us, %add.us %inc17.us = or i64 %i.143.us, 1 %arrayidx9.us.1 = getelementptr inbounds i64, ptr %vla, i64 %inc17.us %5 = load i64, ptr %arrayidx9.us.1, align 8, !tbaa !5 %cmp10.not.us.1 = icmp sle i64 %5, %u.1.us %add.us.1 = select i1 %cmp10.not.us.1, i64 %5, i64 0 %sum.1.us.1 = add nsw i64 %add.us.1, %sum.1.us %inc13.us.1 = zext i1 %cmp10.not.us.1 to i64 %s.1.us.1 = add nuw nsw i64 %s.1.us, %inc13.us.1 %u.1.us.1 = sub nsw i64 %u.1.us, %add.us.1 %inc17.us.1 = add nuw nsw i64 %i.143.us, 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.cond6.for.end18_crit_edge.us.unr-lcssa, label %for.body8.us, !llvm.loop !9 for.cond6.for.end18_crit_edge.us.unr-lcssa: ; preds = %for.body8.us, %for.cond6.preheader.us %sum.1.us.lcssa.ph = phi i64 [ undef, %for.cond6.preheader.us ], [ %sum.1.us.1, %for.body8.us ] %s.1.us.lcssa.ph = phi i64 [ undef, %for.cond6.preheader.us ], [ %s.1.us.1, %for.body8.us ] %u.046.us.unr = phi i64 [ %rem4951.us, %for.cond6.preheader.us ], [ %u.1.us.1, %for.body8.us ] %s.045.us.unr = phi i64 [ 0, %for.cond6.preheader.us ], [ %s.1.us.1, %for.body8.us ] %sum.044.us.unr = phi i64 [ 0, %for.cond6.preheader.us ], [ %sum.1.us.1, %for.body8.us ] %i.143.us.unr = phi i64 [ 0, %for.cond6.preheader.us ], [ %inc17.us.1, %for.body8.us ] br i1 %lcmp.mod.not, label %for.cond6.for.end18_crit_edge.us, label %for.body8.us.epil for.body8.us.epil: ; preds = %for.cond6.for.end18_crit_edge.us.unr-lcssa %arrayidx9.us.epil = getelementptr inbounds i64, ptr %vla, i64 %i.143.us.unr %6 = load i64, ptr %arrayidx9.us.epil, align 8, !tbaa !5 %cmp10.not.us.epil = icmp sle i64 %6, %u.046.us.unr %add.us.epil = select i1 %cmp10.not.us.epil, i64 %6, i64 0 %sum.1.us.epil = add nsw i64 %add.us.epil, %sum.044.us.unr %inc13.us.epil = zext i1 %cmp10.not.us.epil to i64 %s.1.us.epil = add nuw nsw i64 %s.045.us.unr, %inc13.us.epil br label %for.cond6.for.end18_crit_edge.us for.cond6.for.end18_crit_edge.us: ; preds = %for.cond6.for.end18_crit_edge.us.unr-lcssa, %for.body8.us.epil %sum.1.us.lcssa = phi i64 [ %sum.1.us.lcssa.ph, %for.cond6.for.end18_crit_edge.us.unr-lcssa ], [ %sum.1.us.epil, %for.body8.us.epil ] %s.1.us.lcssa = phi i64 [ %s.1.us.lcssa.ph, %for.cond6.for.end18_crit_edge.us.unr-lcssa ], [ %s.1.us.epil, %for.body8.us.epil ] %div.us = sdiv i64 %rem4951.us, %sum.1.us.lcssa %mul.us = mul nsw i64 %div.us, %s.1.us.lcssa %add19.us = add nsw i64 %mul.us, %ans.052.us %rem.us = srem i64 %rem4951.us, %sum.1.us.lcssa %cmp5.not.us = icmp slt i64 %rem.us, %min.0.lcssa br i1 %cmp5.not.us, label %while.cond.while.end_crit_edge, label %for.cond6.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %min.040 = phi i64 [ %spec.select, %for.body ], [ 1000000001, %entry ] %i.039 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.039 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %7 = load i64, ptr %arrayidx, align 8, !tbaa !5 %spec.select = call i64 @llvm.smin.i64(i64 %min.040, i64 %7) %inc = add nuw nsw i64 %i.039, 1 %8 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %8 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !12 while.cond.while.end_crit_edge: ; preds = %for.cond6.for.end18_crit_edge.us, %for.cond6.preheader.lr.ph %.us-phi = phi i64 [ poison, %for.cond6.preheader.lr.ph ], [ %rem.us, %for.cond6.for.end18_crit_edge.us ] %.us-phi54 = phi i64 [ poison, %for.cond6.preheader.lr.ph ], [ %add19.us, %for.cond6.for.end18_crit_edge.us ] store i64 %.us-phi, ptr %t, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %ans.0.lcssa = phi i64 [ %.us-phi54, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <math.h> int main(void){ double x1,x2,y1,y2; scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2); printf("%.6lf\n",sqrt(pow(x1-x2,2.0)+pow(y1-y2,2.0))); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_180622/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_180622/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%.6lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca double, align 8 %x2 = alloca double, align 8 %y1 = alloca double, align 8 %y2 = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load double, ptr %x1, align 8, !tbaa !5 %1 = load double, ptr %x2, align 8, !tbaa !5 %2 = load double, ptr %y1, align 8, !tbaa !5 %3 = load double, ptr %y2, align 8, !tbaa !5 %4 = insertelement <2 x double> poison, double %0, i64 0 %5 = insertelement <2 x double> %4, double %2, i64 1 %6 = insertelement <2 x double> poison, double %1, i64 0 %7 = insertelement <2 x double> %6, double %3, i64 1 %8 = fsub <2 x double> %5, %7 %9 = fmul <2 x double> %8, %8 %shift = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> <i32 1, i32 poison> %10 = fadd <2 x double> %9, %shift %add = extractelement <2 x double> %10, i64 0 %sqrt = call double @llvm.sqrt.f64(double %add) %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sqrt) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.sqrt.f64(double) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}