Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> #include<string.h> int main(void) { char s[100], p[100], a[200]; scanf("%s",s); strcpy(a,s); strcat(a,s); scanf("%s",p); if(strstr(a,p)){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_331755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_331755/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16 %p = alloca [100 x i8], align 16 %a = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %p) #6 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %a) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call3 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %s) #6 %call6 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %s) #6 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p) %call11 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %p) #7 %tobool.not = icmp eq ptr %call11, null %str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare ptr @strstr(ptr noundef, 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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int rot[5][7] = { {0,1,2,3,4,5,6},{0,2,6,3,4,1,5},{0,4,2,1,6,5,3},{0,3,2,6,1,5,4},{0,5,1,3,4,6,2}}; int assign[7]; // サイコロの1~6の各面に割り当てる数字 int tr['Z']; void dice_init(int *a) { int i; int t[5] = {0,'N','E','W','S'}; for (i = 1; i <= 6; i++) assign[i] = a[i]; for (i = 1; i <= 4; i++) tr[t[i]] = i; } char s[102]; int main() { int i, k1, k2; int a[7], dice[2][7]; char *p; for (i = 1; i <= 6; i++) scanf("%d", a+i); dice_init(a); scanf("%s", p=s); for (i = 1; i <= 6; i++) dice[0][i] = rot[0][i]; for (k1 = 0, k2 = 1; *p; k1 = k2, k2 = !k2) { for (i = 1; i <= 6; i++) dice[k2][i] = dice[k1][rot[tr[*p]][i]]; p++; } printf("%d\n", assign[dice[k1][1]]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_331799/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_331799/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @rot = dso_local local_unnamed_addr global [5 x [7 x i32]] [[7 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6], [7 x i32] [i32 0, i32 2, i32 6, i32 3, i32 4, i32 1, i32 5], [7 x i32] [i32 0, i32 4, i32 2, i32 1, i32 6, i32 5, i32 3], [7 x i32] [i32 0, i32 3, i32 2, i32 6, i32 1, i32 5, i32 4], [7 x i32] [i32 0, i32 5, i32 1, i32 3, i32 4, i32 6, i32 2]], align 16 @assign = dso_local local_unnamed_addr global [7 x i32] zeroinitializer, align 16 @tr = dso_local local_unnamed_addr global [90 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [102 x i8] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: read, inaccessiblemem: none) uwtable define dso_local void @dice_init(ptr nocapture noundef readonly %a) local_unnamed_addr #0 { entry: %arrayidx = getelementptr inbounds i32, ptr %a, i64 1 %0 = load <4 x i32>, ptr %arrayidx, align 4, !tbaa !5 store <4 x i32> %0, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 1), align 4, !tbaa !5 %arrayidx.4 = getelementptr inbounds i32, ptr %a, i64 5 %1 = load <2 x i32>, ptr %arrayidx.4, align 4, !tbaa !5 store <2 x i32> %1, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 5), align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 78), align 8, !tbaa !5 store i32 2, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 69), align 4, !tbaa !5 store i32 3, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 87), align 4, !tbaa !5 store i32 4, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 83), align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %a = alloca [7 x i32], align 16 %dice = alloca [2 x [7 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %dice) #5 %add.ptr = getelementptr inbounds i32, ptr %a, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %add.ptr.1 = getelementptr inbounds i32, ptr %a, i64 2 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1) %add.ptr.2 = getelementptr inbounds i32, ptr %a, i64 3 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2) %add.ptr.3 = getelementptr inbounds i32, ptr %a, i64 4 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3) %add.ptr.4 = getelementptr inbounds i32, ptr %a, i64 5 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4) %add.ptr.5 = getelementptr inbounds i32, ptr %a, i64 6 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.5) %0 = load <4 x i32>, ptr %add.ptr, align 4, !tbaa !5 store <4 x i32> %0, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 1), align 4, !tbaa !5 %1 = load <2 x i32>, ptr %add.ptr.4, align 4, !tbaa !5 store <2 x i32> %1, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 5), align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 78), align 8, !tbaa !5 store i32 2, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 69), align 4, !tbaa !5 store i32 3, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 87), align 4, !tbaa !5 store i32 4, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 83), align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s) %scevgep = getelementptr inbounds i8, ptr %dice, i64 4 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %scevgep, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds ([5 x [7 x i32]], ptr @rot, i64 0, i64 0, i64 1), i64 24, i1 false), !tbaa !5 %2 = load i8, ptr @s, align 16, !tbaa !9 %tobool.not61 = icmp eq i8 %2, 0 br i1 %tobool.not61, label %entry.for.end36_crit_edge, label %for.cond14.preheader entry.for.end36_crit_edge: ; preds = %entry %.pre = load i32, ptr %scevgep, align 4, !tbaa !5 br label %for.end36 for.cond14.preheader: ; preds = %entry, %for.cond14.preheader %3 = phi i8 [ %17, %for.cond14.preheader ], [ %2, %entry ] %p.064 = phi ptr [ %incdec.ptr, %for.cond14.preheader ], [ @s, %entry ] %k2.063 = phi i32 [ %lnot.ext, %for.cond14.preheader ], [ 1, %entry ] %k1.062 = phi i32 [ %k2.063, %for.cond14.preheader ], [ 0, %entry ] %idxprom17 = zext i32 %k1.062 to i64 %idxprom19 = sext i8 %3 to i64 %arrayidx20 = getelementptr inbounds [90 x i32], ptr @tr, i64 0, i64 %idxprom19 %4 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %idxprom21 = sext i32 %4 to i64 %idxprom27 = zext i32 %k2.063 to i64 %arrayidx24 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 1 %5 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %idxprom25 = sext i32 %5 to i64 %arrayidx26 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25 %6 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %arrayidx30 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 1 store i32 %6, ptr %arrayidx30, align 4, !tbaa !5 %arrayidx24.1 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 2 %7 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5 %idxprom25.1 = sext i32 %7 to i64 %arrayidx26.1 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25.1 %8 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5 %arrayidx30.1 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 2 store i32 %8, ptr %arrayidx30.1, align 4, !tbaa !5 %arrayidx24.2 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 3 %9 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5 %idxprom25.2 = sext i32 %9 to i64 %arrayidx26.2 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25.2 %10 = load i32, ptr %arrayidx26.2, align 4, !tbaa !5 %arrayidx30.2 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 3 store i32 %10, ptr %arrayidx30.2, align 4, !tbaa !5 %arrayidx24.3 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 4 %11 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5 %idxprom25.3 = sext i32 %11 to i64 %arrayidx26.3 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25.3 %12 = load i32, ptr %arrayidx26.3, align 4, !tbaa !5 %arrayidx30.3 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 4 store i32 %12, ptr %arrayidx30.3, align 4, !tbaa !5 %arrayidx24.4 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 5 %13 = load i32, ptr %arrayidx24.4, align 4, !tbaa !5 %idxprom25.4 = sext i32 %13 to i64 %arrayidx26.4 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25.4 %14 = load i32, ptr %arrayidx26.4, align 4, !tbaa !5 %arrayidx30.4 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 5 store i32 %14, ptr %arrayidx30.4, align 4, !tbaa !5 %arrayidx24.5 = getelementptr inbounds [5 x [7 x i32]], ptr @rot, i64 0, i64 %idxprom21, i64 6 %15 = load i32, ptr %arrayidx24.5, align 4, !tbaa !5 %idxprom25.5 = sext i32 %15 to i64 %arrayidx26.5 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom17, i64 %idxprom25.5 %16 = load i32, ptr %arrayidx26.5, align 4, !tbaa !5 %arrayidx30.5 = getelementptr inbounds [2 x [7 x i32]], ptr %dice, i64 0, i64 %idxprom27, i64 6 store i32 %16, ptr %arrayidx30.5, align 4, !tbaa !5 %incdec.ptr = getelementptr inbounds i8, ptr %p.064, i64 1 %lnot.ext = xor i32 %k2.063, 1 %17 = load i8, ptr %incdec.ptr, align 1, !tbaa !9 %tobool.not = icmp eq i8 %17, 0 br i1 %tobool.not, label %for.end36, label %for.cond14.preheader, !llvm.loop !10 for.end36: ; preds = %for.cond14.preheader, %entry.for.end36_crit_edge %18 = phi i32 [ %.pre, %entry.for.end36_crit_edge ], [ %6, %for.cond14.preheader ] %idxprom40 = sext i32 %18 to i64 %arrayidx41 = getelementptr inbounds [7 x i32], ptr @assign, i64 0, i64 %idxprom40 %19 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %dice) #5 call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int D[6],i,Top,Front,Right,t; char X[100]; for(i=0;i<6;i++){scanf("%d",D+i);} scanf("%s",X); Top=1;Front=2;Right=3; for(i=0;X[i];i++) { switch(X[i]) { case 'N':t=Top,Top=Front,Front=7-t;break; case 'E':t=Right,Right=Top,Top=7-t;break; case 'W':t=Top,Top=Right,Right=7-t;break; case 'S':t=Front,Front=Top,Top=7-t;break; } } printf("%d\n",D[Top-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_331856/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_331856/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %D = alloca [6 x i32], align 16 %X = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %D) #3 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D) %add.ptr.1 = getelementptr inbounds i32, ptr %D, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1) %add.ptr.2 = getelementptr inbounds i32, ptr %D, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2) %add.ptr.3 = getelementptr inbounds i32, ptr %D, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3) %add.ptr.4 = getelementptr inbounds i32, ptr %D, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4) %add.ptr.5 = getelementptr inbounds i32, ptr %D, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.5) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %X) %0 = load i8, ptr %X, align 16, !tbaa !5 %tobool.not35 = icmp eq i8 %0, 0 br i1 %tobool.not35, label %for.end15, label %for.body4 for.body4: ; preds = %entry, %for.inc13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc13 ], [ 0, %entry ] %1 = phi i8 [ %2, %for.inc13 ], [ %0, %entry ] %Right.039 = phi i32 [ %Right.1, %for.inc13 ], [ 3, %entry ] %Front.038 = phi i32 [ %Front.1, %for.inc13 ], [ 2, %entry ] %Top.037 = phi i32 [ %Top.1, %for.inc13 ], [ 1, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %for.inc13 [ i32 78, label %sw.bb i32 69, label %sw.bb7 i32 87, label %sw.bb9 i32 83, label %sw.bb11 ] sw.bb: ; preds = %for.body4 %sub = sub nuw nsw i32 7, %Top.037 br label %for.inc13 sw.bb7: ; preds = %for.body4 %sub8 = sub nuw nsw i32 7, %Right.039 br label %for.inc13 sw.bb9: ; preds = %for.body4 %sub10 = sub nuw nsw i32 7, %Top.037 br label %for.inc13 sw.bb11: ; preds = %for.body4 %sub12 = sub nuw nsw i32 7, %Front.038 br label %for.inc13 for.inc13: ; preds = %sw.bb, %sw.bb7, %sw.bb9, %sw.bb11, %for.body4 %Top.1 = phi i32 [ %Top.037, %for.body4 ], [ %sub12, %sw.bb11 ], [ %Right.039, %sw.bb9 ], [ %sub8, %sw.bb7 ], [ %Front.038, %sw.bb ] %Front.1 = phi i32 [ %Front.038, %for.body4 ], [ %Top.037, %sw.bb11 ], [ %Front.038, %sw.bb9 ], [ %Front.038, %sw.bb7 ], [ %sub, %sw.bb ] %Right.1 = phi i32 [ %Right.039, %for.body4 ], [ %Right.039, %sw.bb11 ], [ %sub10, %sw.bb9 ], [ %Top.037, %sw.bb7 ], [ %Right.039, %sw.bb ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %X, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %2, 0 br i1 %tobool.not, label %for.end15.loopexit, label %for.body4, !llvm.loop !8 for.end15.loopexit: ; preds = %for.inc13 %3 = add nsw i32 %Top.1, -1 %4 = zext i32 %3 to i64 br label %for.end15 for.end15: ; preds = %for.end15.loopexit, %entry %Top.0.lcssa = phi i64 [ 0, %entry ], [ %4, %for.end15.loopexit ] %arrayidx18 = getelementptr inbounds [6 x i32], ptr %D, i64 0, i64 %Top.0.lcssa %5 = load i32, ptr %arrayidx18, align 4, !tbaa !10 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %X) #3 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %D) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0}
#include <stdio.h> #include <string.h> char B[101]; int A[10]; void Search(int num); int main(void){ int i,n,len; char str[100],*line; fgets(str,sizeof(str),stdin); line = strtok(str," "); sscanf(line,"%d",&n); A[1]=n; for(i=2;i<=6;i++){ line = strtok(NULL," "); sscanf(line,"%d",&n); A[i]=n; } scanf("%s",B); for(i=0;B[i] !='\0';i++){ switch(B[i]){ case 'N': Search(2); break; case 'W': Search(3); break; case 'E': Search(4); break; case 'S': Search(5); break; } } printf("%d\n",A[1]); return 0; } void Search(int num){ int tmp; tmp = A[1]; A[1] = A[num]; A[num] = A[6]; A[6] = A[7-num]; A[7-num] = tmp; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_331913/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_331913/source.c" target datalayout = "e-m:e-p270: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 [2 x i8] c" \00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @A = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @B = dso_local global [101 x i8] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %0) %call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5 %call3 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call2, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %1 = load i32, ptr %n, align 4, !tbaa !9 store i32 %1, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 %call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call5 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %2 = load i32, ptr %n, align 4, !tbaa !9 store i32 %2, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 2), align 8, !tbaa !9 %call4.1 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call5.1 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4.1, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %3 = load i32, ptr %n, align 4, !tbaa !9 store i32 %3, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 3), align 4, !tbaa !9 %call4.2 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call5.2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4.2, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %4 = load i32, ptr %n, align 4, !tbaa !9 store i32 %4, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 4), align 16, !tbaa !9 %call4.3 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call5.3 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4.3, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %5 = load i32, ptr %n, align 4, !tbaa !9 store i32 %5, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 5), align 4, !tbaa !9 %call4.4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5 %call5.4 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4.4, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5 %6 = load i32, ptr %n, align 4, !tbaa !9 store i32 %6, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 6), align 8, !tbaa !9 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @B) %.promoted = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 %7 = load i8, ptr @B, align 16, !tbaa !11 %cmp10.not35 = icmp eq i8 %7, 0 br i1 %cmp10.not35, label %for.end21, label %for.body12.preheader for.body12.preheader: ; preds = %entry %.promoted34 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 3), align 4, !tbaa !9 %.promoted33 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 4), align 16, !tbaa !9 %.promoted32 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 2), align 8, !tbaa !9 %.promoted31 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 6), align 8, !tbaa !9 %.promoted30 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 5), align 4, !tbaa !9 br label %for.body12 for.body12: ; preds = %for.body12.preheader, %for.inc19 %indvars.iv = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next, %for.inc19 ] %8 = phi i8 [ %7, %for.body12.preheader ], [ %21, %for.inc19 ] %9 = phi i32 [ %.promoted, %for.body12.preheader ], [ %20, %for.inc19 ] %10 = phi i32 [ %.promoted30, %for.body12.preheader ], [ %19, %for.inc19 ] %11 = phi i32 [ %.promoted31, %for.body12.preheader ], [ %18, %for.inc19 ] %12 = phi i32 [ %.promoted32, %for.body12.preheader ], [ %17, %for.inc19 ] %13 = phi i32 [ %.promoted33, %for.body12.preheader ], [ %16, %for.inc19 ] %14 = phi i32 [ %.promoted34, %for.body12.preheader ], [ %15, %for.inc19 ] %conv = sext i8 %8 to i32 switch i32 %conv, label %for.inc19 [ i32 78, label %for.inc19.sink.split i32 87, label %sw.bb16 i32 69, label %sw.bb17 i32 83, label %sw.bb18 ] sw.bb16: ; preds = %for.body12 br label %for.inc19.sink.split sw.bb17: ; preds = %for.body12 br label %for.inc19.sink.split sw.bb18: ; preds = %for.body12 br label %for.inc19.sink.split for.inc19.sink.split: ; preds = %for.body12, %sw.bb18, %sw.bb17, %sw.bb16 %.sink45 = phi i32 [ %14, %sw.bb16 ], [ %13, %sw.bb17 ], [ %10, %sw.bb18 ], [ %12, %for.body12 ] %.sink44 = phi ptr [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 3), %sw.bb16 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 4), %sw.bb17 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 5), %sw.bb18 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 2), %for.body12 ] %.sink43 = phi i32 [ %13, %sw.bb16 ], [ %14, %sw.bb17 ], [ %12, %sw.bb18 ], [ %10, %for.body12 ] %.sink = phi ptr [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 4), %sw.bb16 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 3), %sw.bb17 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 2), %sw.bb18 ], [ getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 5), %for.body12 ] %.ph = phi i32 [ %11, %sw.bb16 ], [ %9, %sw.bb17 ], [ %14, %sw.bb18 ], [ %14, %for.body12 ] %.ph38 = phi i32 [ %9, %sw.bb16 ], [ %11, %sw.bb17 ], [ %13, %sw.bb18 ], [ %13, %for.body12 ] %.ph39 = phi i32 [ %12, %sw.bb16 ], [ %12, %sw.bb17 ], [ %9, %sw.bb18 ], [ %11, %for.body12 ] %.ph41 = phi i32 [ %10, %sw.bb16 ], [ %10, %sw.bb17 ], [ %11, %sw.bb18 ], [ %9, %for.body12 ] store i32 %.sink45, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 store i32 %11, ptr %.sink44, align 4, !tbaa !9 store i32 %.sink43, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 6), align 8, !tbaa !9 store i32 %9, ptr %.sink, align 4, !tbaa !9 br label %for.inc19 for.inc19: ; preds = %for.inc19.sink.split, %for.body12 %15 = phi i32 [ %14, %for.body12 ], [ %.ph, %for.inc19.sink.split ] %16 = phi i32 [ %13, %for.body12 ], [ %.ph38, %for.inc19.sink.split ] %17 = phi i32 [ %12, %for.body12 ], [ %.ph39, %for.inc19.sink.split ] %18 = phi i32 [ %11, %for.body12 ], [ %.sink43, %for.inc19.sink.split ] %19 = phi i32 [ %10, %for.body12 ], [ %.ph41, %for.inc19.sink.split ] %20 = phi i32 [ %9, %for.body12 ], [ %.sink45, %for.inc19.sink.split ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx9 = getelementptr inbounds [101 x i8], ptr @B, i64 0, i64 %indvars.iv.next %21 = load i8, ptr %arrayidx9, align 1, !tbaa !11 %cmp10.not = icmp eq i8 %21, 0 br i1 %cmp10.not, label %for.end21, label %for.body12, !llvm.loop !12 for.end21: ; preds = %for.inc19, %entry %22 = phi i32 [ %.promoted, %entry ], [ %20, %for.inc19 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %22) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 @Search(i32 noundef %num) local_unnamed_addr #4 { entry: %0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 %idxprom = sext i32 %num to i64 %arrayidx = getelementptr inbounds [10 x i32], ptr @A, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 store i32 %1, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 1), align 4, !tbaa !9 %2 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 6), align 8, !tbaa !9 store i32 %2, ptr %arrayidx, align 4, !tbaa !9 %sub = sub nsw i32 7, %num %idxprom3 = sext i32 %sub to i64 %arrayidx4 = getelementptr inbounds [10 x i32], ptr @A, i64 0, i64 %idxprom3 %3 = load i32, ptr %arrayidx4, align 4, !tbaa !9 store i32 %3, ptr getelementptr inbounds ([10 x i32], ptr @A, i64 0, i64 6), align 8, !tbaa !9 store i32 %0, ptr %arrayidx4, align 4, !tbaa !9 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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<stdlib.h> #include<string.h> void makecopy(int *saikoro,int *copy){ int i; for(i=1;i<=6;i++){ copy[i]=saikoro[i]; } } int main(){ int *saikoro,*copy,i; saikoro=malloc(7*sizeof(int)); copy=malloc(7*sizeof(int)); for(i=1;i<=6;i++) scanf("%d",&saikoro[i]); makecopy(saikoro,copy); char order[100]; scanf("%s",order); for(i=0;i<strlen(order);i++){ if(order[i]=='S'){ saikoro[2]=copy[1]; saikoro[6]=copy[2]; saikoro[5]=copy[6]; saikoro[1]=copy[5]; makecopy(saikoro,copy); } if(order[i]=='N'){ saikoro[1]=copy[2]; saikoro[2]=copy[6]; saikoro[6]=copy[5]; saikoro[5]=copy[1]; makecopy(saikoro,copy); } if(order[i]=='W'){ saikoro[4]=copy[1]; saikoro[6]=copy[4]; saikoro[3]=copy[6]; saikoro[1]=copy[3]; makecopy(saikoro,copy); } if(order[i]=='E'){ saikoro[1]=copy[4]; saikoro[4]=copy[6]; saikoro[6]=copy[3]; saikoro[3]=copy[1]; makecopy(saikoro,copy); } } printf("%d\n",saikoro[1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_331957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_331957/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @makecopy(ptr nocapture noundef readonly %saikoro, ptr nocapture noundef writeonly %copy) local_unnamed_addr #0 { entry: %arrayidx = getelementptr inbounds i32, ptr %saikoro, i64 1 %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %copy, i64 1 store i32 %0, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx.1 = getelementptr inbounds i32, ptr %saikoro, i64 2 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds i32, ptr %copy, i64 2 store i32 %1, ptr %arrayidx2.1, align 4, !tbaa !5 %arrayidx.2 = getelementptr inbounds i32, ptr %saikoro, i64 3 %2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %arrayidx2.2 = getelementptr inbounds i32, ptr %copy, i64 3 store i32 %2, ptr %arrayidx2.2, align 4, !tbaa !5 %arrayidx.3 = getelementptr inbounds i32, ptr %saikoro, i64 4 %3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %arrayidx2.3 = getelementptr inbounds i32, ptr %copy, i64 4 store i32 %3, ptr %arrayidx2.3, align 4, !tbaa !5 %arrayidx.4 = getelementptr inbounds i32, ptr %saikoro, i64 5 %4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 %arrayidx2.4 = getelementptr inbounds i32, ptr %copy, i64 5 store i32 %4, ptr %arrayidx2.4, align 4, !tbaa !5 %arrayidx.5 = getelementptr inbounds i32, ptr %saikoro, i64 6 %5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %arrayidx2.5 = getelementptr inbounds i32, ptr %copy, i64 6 store i32 %5, ptr %arrayidx2.5, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %order = alloca [100 x i8], align 16 %call = tail call noalias dereferenceable_or_null(28) ptr @malloc(i64 noundef 28) #6 %arrayidx = getelementptr inbounds i32, ptr %call, i64 1 %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx.1 = getelementptr inbounds i32, ptr %call, i64 2 %call2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds i32, ptr %call, i64 3 %call2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds i32, ptr %call, i64 4 %call2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds i32, ptr %call, i64 5 %call2.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds i32, ptr %call, i64 6 %call2.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %order) #7 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %order) %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %order) #8 %cmp7175.not = icmp eq i64 %call6, 0 br i1 %cmp7175.not, label %for.end70, label %for.body9 for.body9: ; preds = %entry, %for.inc68 %6 = phi i32 [ %21, %for.inc68 ], [ %4, %entry ] %7 = phi i32 [ %22, %for.inc68 ], [ %1, %entry ] %8 = phi i32 [ %23, %for.inc68 ], [ %0, %entry ] %9 = phi i32 [ %24, %for.inc68 ], [ %2, %entry ] %10 = phi i32 [ %25, %for.inc68 ], [ %5, %entry ] %11 = phi i32 [ %26, %for.inc68 ], [ %3, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc68 ], [ 0, %entry ] %arrayidx11 = getelementptr inbounds [100 x i8], ptr %order, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx11, align 1, !tbaa !9 switch i8 %12, label %for.inc68 [ i8 83, label %if.end.thread i8 78, label %if.then28 i8 87, label %if.then43 i8 69, label %if.then58 ] if.end.thread: ; preds = %for.body9 store i32 %8, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %7, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.4, align 4, !tbaa !5 store i32 %6, ptr %arrayidx, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc68 if.then28: ; preds = %for.body9 store i32 %7, ptr %arrayidx, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %6, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.4, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc68 if.then43: ; preds = %for.body9 store i32 %8, ptr %arrayidx.3, align 4, !tbaa !5 store i32 %11, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %9, ptr %arrayidx, align 4, !tbaa !5 %17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %18 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc68 if.then58: ; preds = %for.body9 store i32 %11, ptr %arrayidx, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.3, align 4, !tbaa !5 store i32 %9, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.2, align 4, !tbaa !5 %19 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc68 for.inc68: ; preds = %for.body9, %if.then28, %if.end.thread, %if.then43, %if.then58 %21 = phi i32 [ %6, %for.body9 ], [ %8, %if.then28 ], [ %10, %if.end.thread ], [ %18, %if.then43 ], [ %20, %if.then58 ] %22 = phi i32 [ %7, %for.body9 ], [ %10, %if.then28 ], [ %8, %if.end.thread ], [ %17, %if.then43 ], [ %19, %if.then58 ] %23 = phi i32 [ %8, %for.body9 ], [ %7, %if.then28 ], [ %6, %if.end.thread ], [ %9, %if.then43 ], [ %11, %if.then58 ] %24 = phi i32 [ %9, %for.body9 ], [ %15, %if.then28 ], [ %13, %if.end.thread ], [ %10, %if.then43 ], [ %8, %if.then58 ] %25 = phi i32 [ %10, %for.body9 ], [ %6, %if.then28 ], [ %7, %if.end.thread ], [ %11, %if.then43 ], [ %9, %if.then58 ] %26 = phi i32 [ %11, %for.body9 ], [ %16, %if.then28 ], [ %14, %if.end.thread ], [ %8, %if.then43 ], [ %10, %if.then58 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call6 br i1 %exitcond.not, label %for.end70, label %for.body9, !llvm.loop !10 for.end70: ; preds = %for.inc68, %entry %27 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %order) #7 ret i32 0 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = { nounwind allocsize(0) } 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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <string.h> #include <stdio.h> typedef struct _DICE DICE; struct _DICE{ int a[6]; char b[101]; }; int main(int argc, const char * argv[]) { DICE Dice; int i,j,length; int a0,a1,a2,a3,a4,a5; for(i=0;i<6;i++){ scanf("%d",&Dice.a[i]); } scanf("%s",Dice.b); length=(int)strlen(Dice.b); for(j=0;j<length;j++){ if(Dice.b[j]=='N'){ a0=Dice.a[0]; a1=Dice.a[1]; a4=Dice.a[4]; a5=Dice.a[5]; Dice.a[0]=a1; Dice.a[1]=a5; Dice.a[4]=a0; Dice.a[5]=a4; }else if(Dice.b[j]=='E'){ a0=Dice.a[0]; a2=Dice.a[2]; a3=Dice.a[3]; a5=Dice.a[5]; Dice.a[0]=a3; Dice.a[2]=a0; Dice.a[3]=a5; Dice.a[5]=a2; }else if(Dice.b[j]=='S'){ a0=Dice.a[0]; a1=Dice.a[1]; a4=Dice.a[4]; a5=Dice.a[5]; Dice.a[0]=a4; Dice.a[1]=a0; Dice.a[4]=a5; Dice.a[5]=a1; }else if(Dice.b[j]=='W'){ a0=Dice.a[0]; a2=Dice.a[2]; a3=Dice.a[3]; a5=Dice.a[5]; Dice.a[0]=a2; Dice.a[2]=a5; Dice.a[3]=a0; Dice.a[5]=a3; } } printf("%d\n",Dice.a[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332020/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332020/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._DICE = type { [6 x i32], [101 x i8] } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %Dice = alloca %struct._DICE, align 4 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %Dice) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Dice) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %Dice, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [6 x i32], ptr %Dice, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [6 x i32], ptr %Dice, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [6 x i32], ptr %Dice, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [6 x i32], ptr %Dice, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %b = getelementptr inbounds %struct._DICE, ptr %Dice, i64 0, i32 1 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #5 %conv = trunc i64 %call4 to i32 %cmp6129 = icmp sgt i32 %conv, 0 %Dice.promoted = load i32, ptr %Dice, align 4, !tbaa !5 br i1 %cmp6129, label %for.body8.lr.ph, label %for.end107 for.body8.lr.ph: ; preds = %entry %arrayidx89.promoted = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %arrayidx91.promoted = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %arrayidx93.promoted = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %arrayidx65.promoted = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx67.promoted = load i32, ptr %arrayidx.4, align 4, !tbaa !5 %wide.trip.count = and i64 %call4, 4294967295 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %for.inc105 %indvars.iv = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next, %for.inc105 ] %0 = phi i32 [ %arrayidx67.promoted, %for.body8.lr.ph ], [ %7, %for.inc105 ] %1 = phi i32 [ %arrayidx65.promoted, %for.body8.lr.ph ], [ %8, %for.inc105 ] %2 = phi i32 [ %arrayidx93.promoted, %for.body8.lr.ph ], [ %9, %for.inc105 ] %3 = phi i32 [ %arrayidx91.promoted, %for.body8.lr.ph ], [ %10, %for.inc105 ] %4 = phi i32 [ %arrayidx89.promoted, %for.body8.lr.ph ], [ %11, %for.inc105 ] %5 = phi i32 [ %Dice.promoted, %for.body8.lr.ph ], [ %12, %for.inc105 ] %arrayidx11 = getelementptr inbounds %struct._DICE, ptr %Dice, i64 0, i32 1, i64 %indvars.iv %6 = load i8, ptr %arrayidx11, align 1, !tbaa !9 switch i8 %6, label %for.inc105 [ i8 78, label %if.then i8 69, label %if.then37 i8 83, label %if.then61 i8 87, label %if.then85 ] if.then: ; preds = %for.body8 store i32 %1, ptr %Dice, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc105.sink.split if.then37: ; preds = %for.body8 store i32 %3, ptr %Dice, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc105.sink.split if.then61: ; preds = %for.body8 store i32 %0, ptr %Dice, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.4, align 4, !tbaa !5 br label %for.inc105.sink.split if.then85: ; preds = %for.body8 store i32 %4, ptr %Dice, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.2, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc105.sink.split for.inc105.sink.split: ; preds = %if.then37, %if.then85, %if.then61, %if.then %.sink = phi i32 [ %0, %if.then ], [ %1, %if.then61 ], [ %3, %if.then85 ], [ %4, %if.then37 ] %.ph = phi i32 [ %5, %if.then ], [ %2, %if.then61 ], [ %0, %if.then85 ], [ %0, %if.then37 ] %.ph133 = phi i32 [ %2, %if.then ], [ %5, %if.then61 ], [ %1, %if.then85 ], [ %1, %if.then37 ] %.ph135 = phi i32 [ %3, %if.then ], [ %3, %if.then61 ], [ %5, %if.then85 ], [ %2, %if.then37 ] %.ph136 = phi i32 [ %4, %if.then ], [ %4, %if.then61 ], [ %2, %if.then85 ], [ %5, %if.then37 ] %.ph137 = phi i32 [ %1, %if.then ], [ %0, %if.then61 ], [ %4, %if.then85 ], [ %3, %if.then37 ] store i32 %.sink, ptr %arrayidx.5, align 4, !tbaa !5 br label %for.inc105 for.inc105: ; preds = %for.inc105.sink.split, %for.body8 %7 = phi i32 [ %0, %for.body8 ], [ %.ph, %for.inc105.sink.split ] %8 = phi i32 [ %1, %for.body8 ], [ %.ph133, %for.inc105.sink.split ] %9 = phi i32 [ %2, %for.body8 ], [ %.sink, %for.inc105.sink.split ] %10 = phi i32 [ %3, %for.body8 ], [ %.ph135, %for.inc105.sink.split ] %11 = phi i32 [ %4, %for.body8 ], [ %.ph136, %for.inc105.sink.split ] %12 = phi i32 [ %5, %for.body8 ], [ %.ph137, %for.inc105.sink.split ] %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.end107, label %for.body8, !llvm.loop !10 for.end107: ; preds = %for.inc105, %entry %13 = phi i32 [ %Dice.promoted, %entry ], [ %12, %for.inc105 ] %call110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %Dice) #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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<string.h> void rollDice(int faceNumber[], char cmdNow){ switch(cmdNow){ int temp; case 'E': temp = faceNumber[1]; faceNumber[1] = faceNumber[4]; faceNumber[4] = faceNumber[6]; faceNumber[6] = faceNumber[3]; faceNumber[3] = temp; return; case 'N': temp = faceNumber[1]; faceNumber[1] = faceNumber[2]; faceNumber[2] = faceNumber[6]; faceNumber[6] = faceNumber[5]; faceNumber[5] = temp; return; case 'S': temp = faceNumber[1]; faceNumber[1] = faceNumber[5]; faceNumber[5] = faceNumber[6]; faceNumber[6] = faceNumber[2]; faceNumber[2] = temp; return; case 'W': temp = faceNumber[1]; faceNumber[1] = faceNumber[3]; faceNumber[3] = faceNumber[6]; faceNumber[6] = faceNumber[4]; faceNumber[4] = temp; return; } } void doDice(int faceNumber[], char cmd[]){ int cmdLen = strlen(cmd); int i ; int cmdNow; for(i = 0 ; i < cmdLen ; i++){ cmdNow = cmd[i]; rollDice(faceNumber, cmdNow); } } int main(){ /*input 6 faces of number*/ int faceNumber[7]; int i ; for(i = 1 ; i < 7 ; i++){ scanf("%d", &faceNumber[i]); } /*input command*/ char cmd[101]; scanf("%s", &cmd); /*do dice*/ doDice(faceNumber, cmd); /*print the number on top*/ printf("%d\n", faceNumber[1]); return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332064/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332064/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @rollDice(ptr nocapture noundef %faceNumber, i8 noundef signext %cmdNow) local_unnamed_addr #0 { entry: %conv = sext i8 %cmdNow to i32 switch i32 %conv, label %sw.epilog [ i32 69, label %sw.bb i32 78, label %sw.bb8 i32 83, label %sw.bb17 i32 87, label %sw.bb26 ] sw.bb: ; preds = %entry %arrayidx = getelementptr inbounds i32, ptr %faceNumber, i64 1 %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx1 = getelementptr inbounds i32, ptr %faceNumber, i64 4 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 store i32 %1, ptr %arrayidx, align 4, !tbaa !5 %arrayidx3 = getelementptr inbounds i32, ptr %faceNumber, i64 6 %2 = load i32, ptr %arrayidx3, align 4, !tbaa !5 store i32 %2, ptr %arrayidx1, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %faceNumber, i64 3 %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 store i32 %3, ptr %arrayidx3, align 4, !tbaa !5 store i32 %0, ptr %arrayidx5, align 4, !tbaa !5 br label %sw.epilog sw.bb8: ; preds = %entry %arrayidx9 = getelementptr inbounds i32, ptr %faceNumber, i64 1 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds i32, ptr %faceNumber, i64 2 %5 = load i32, ptr %arrayidx10, align 4, !tbaa !5 store i32 %5, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds i32, ptr %faceNumber, i64 6 %6 = load i32, ptr %arrayidx12, align 4, !tbaa !5 store i32 %6, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds i32, ptr %faceNumber, i64 5 %7 = load i32, ptr %arrayidx14, align 4, !tbaa !5 store i32 %7, ptr %arrayidx12, align 4, !tbaa !5 store i32 %4, ptr %arrayidx14, align 4, !tbaa !5 br label %sw.epilog sw.bb17: ; preds = %entry %arrayidx18 = getelementptr inbounds i32, ptr %faceNumber, i64 1 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx19 = getelementptr inbounds i32, ptr %faceNumber, i64 5 %9 = load i32, ptr %arrayidx19, align 4, !tbaa !5 store i32 %9, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx21 = getelementptr inbounds i32, ptr %faceNumber, i64 6 %10 = load i32, ptr %arrayidx21, align 4, !tbaa !5 store i32 %10, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds i32, ptr %faceNumber, i64 2 %11 = load i32, ptr %arrayidx23, align 4, !tbaa !5 store i32 %11, ptr %arrayidx21, align 4, !tbaa !5 store i32 %8, ptr %arrayidx23, align 4, !tbaa !5 br label %sw.epilog sw.bb26: ; preds = %entry %arrayidx27 = getelementptr inbounds i32, ptr %faceNumber, i64 1 %12 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %arrayidx28 = getelementptr inbounds i32, ptr %faceNumber, i64 3 %13 = load i32, ptr %arrayidx28, align 4, !tbaa !5 store i32 %13, ptr %arrayidx27, align 4, !tbaa !5 %arrayidx30 = getelementptr inbounds i32, ptr %faceNumber, i64 6 %14 = load i32, ptr %arrayidx30, align 4, !tbaa !5 store i32 %14, ptr %arrayidx28, align 4, !tbaa !5 %arrayidx32 = getelementptr inbounds i32, ptr %faceNumber, i64 4 %15 = load i32, ptr %arrayidx32, align 4, !tbaa !5 store i32 %15, ptr %arrayidx30, align 4, !tbaa !5 store i32 %12, ptr %arrayidx32, align 4, !tbaa !5 br label %sw.epilog sw.epilog: ; preds = %sw.bb, %sw.bb8, %sw.bb17, %sw.bb26, %entry ret void } ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @doDice(ptr nocapture noundef %faceNumber, ptr nocapture noundef readonly %cmd) local_unnamed_addr #1 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %cmd) #6 %conv = trunc i64 %call to i32 %cmp7 = icmp sgt i32 %conv, 0 br i1 %cmp7, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %arrayidx27.i = getelementptr inbounds i32, ptr %faceNumber, i64 1 %arrayidx28.i = getelementptr inbounds i32, ptr %faceNumber, i64 3 %arrayidx30.i = getelementptr inbounds i32, ptr %faceNumber, i64 6 %arrayidx32.i = getelementptr inbounds i32, ptr %faceNumber, i64 4 %arrayidx19.i = getelementptr inbounds i32, ptr %faceNumber, i64 5 %arrayidx23.i = getelementptr inbounds i32, ptr %faceNumber, i64 2 %wide.trip.count = and i64 %call, 4294967295 br label %for.body for.body: ; preds = %for.body.lr.ph, %rollDice.exit %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %rollDice.exit ] %arrayidx = getelementptr inbounds i8, ptr %cmd, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv.i = sext i8 %0 to i32 switch i32 %conv.i, label %rollDice.exit [ i32 69, label %rollDice.exit.sink.split i32 78, label %sw.bb8.i i32 83, label %sw.bb17.i i32 87, label %sw.bb26.i ] sw.bb8.i: ; preds = %for.body br label %rollDice.exit.sink.split sw.bb17.i: ; preds = %for.body br label %rollDice.exit.sink.split sw.bb26.i: ; preds = %for.body br label %rollDice.exit.sink.split rollDice.exit.sink.split: ; preds = %for.body, %sw.bb26.i, %sw.bb17.i, %sw.bb8.i %arrayidx32.i.sink14 = phi ptr [ %arrayidx23.i, %sw.bb8.i ], [ %arrayidx19.i, %sw.bb17.i ], [ %arrayidx28.i, %sw.bb26.i ], [ %arrayidx32.i, %for.body ] %arrayidx28.i.sink11 = phi ptr [ %arrayidx19.i, %sw.bb8.i ], [ %arrayidx23.i, %sw.bb17.i ], [ %arrayidx32.i, %sw.bb26.i ], [ %arrayidx28.i, %for.body ] %1 = load i32, ptr %arrayidx27.i, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx32.i.sink14, align 4, !tbaa !5 store i32 %2, ptr %arrayidx27.i, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5 store i32 %3, ptr %arrayidx32.i.sink14, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx28.i.sink11, align 4, !tbaa !5 store i32 %4, ptr %arrayidx30.i, align 4, !tbaa !5 store i32 %1, ptr %arrayidx28.i.sink11, align 4, !tbaa !5 br label %rollDice.exit rollDice.exit: ; preds = %rollDice.exit.sink.split, %for.body %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 !10 for.end: ; preds = %rollDice.exit, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %faceNumber = alloca [7 x i32], align 16 %cmd = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %faceNumber) #7 %arrayidx = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx.1 = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 2 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 3 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 4 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 5 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [7 x i32], ptr %faceNumber, i64 0, i64 6 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %cmd) #7 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cmd) %call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %cmd) #6 %conv.i = trunc i64 %call.i to i32 %cmp7.i = icmp sgt i32 %conv.i, 0 br i1 %cmp7.i, label %for.body.lr.ph.i, label %entry.doDice.exit_crit_edge entry.doDice.exit_crit_edge: ; preds = %entry %.pre = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %doDice.exit for.body.lr.ph.i: ; preds = %entry %wide.trip.count.i = and i64 %call.i, 4294967295 %arrayidx27.i.i.promoted = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx30.i.i.promoted = load i32, ptr %arrayidx.5, align 8, !tbaa !5 %xtraiter = and i64 %call.i, 1 %0 = icmp eq i64 %wide.trip.count.i, 1 br i1 %0, label %doDice.exit.loopexit.unr-lcssa, label %for.body.lr.ph.i.new for.body.lr.ph.i.new: ; preds = %for.body.lr.ph.i %unroll_iter = sub nsw i64 %wide.trip.count.i, %xtraiter br label %for.body.i for.body.i: ; preds = %rollDice.exit.i.1, %for.body.lr.ph.i.new %1 = phi i32 [ %arrayidx30.i.i.promoted, %for.body.lr.ph.i.new ], [ %11, %rollDice.exit.i.1 ] %2 = phi i32 [ %arrayidx27.i.i.promoted, %for.body.lr.ph.i.new ], [ %12, %rollDice.exit.i.1 ] %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %indvars.iv.next.i.1, %rollDice.exit.i.1 ] %niter = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %niter.next.1, %rollDice.exit.i.1 ] %arrayidx.i = getelementptr inbounds i8, ptr %cmd, i64 %indvars.iv.i %3 = load i8, ptr %arrayidx.i, align 2, !tbaa !9 %conv.i.i = sext i8 %3 to i32 switch i32 %conv.i.i, label %rollDice.exit.i [ i32 69, label %rollDice.exit.sink.split.i i32 78, label %sw.bb8.i.i i32 83, label %sw.bb17.i.i i32 87, label %sw.bb26.i.i ] sw.bb8.i.i: ; preds = %for.body.i br label %rollDice.exit.sink.split.i sw.bb17.i.i: ; preds = %for.body.i br label %rollDice.exit.sink.split.i sw.bb26.i.i: ; preds = %for.body.i br label %rollDice.exit.sink.split.i rollDice.exit.sink.split.i: ; preds = %sw.bb26.i.i, %sw.bb17.i.i, %sw.bb8.i.i, %for.body.i %arrayidx32.i.sink14.i = phi ptr [ %arrayidx.1, %sw.bb8.i.i ], [ %arrayidx.4, %sw.bb17.i.i ], [ %arrayidx.2, %sw.bb26.i.i ], [ %arrayidx.3, %for.body.i ] %arrayidx28.i.sink11.i = phi ptr [ %arrayidx.4, %sw.bb8.i.i ], [ %arrayidx.1, %sw.bb17.i.i ], [ %arrayidx.3, %sw.bb26.i.i ], [ %arrayidx.2, %for.body.i ] %4 = load i32, ptr %arrayidx32.i.sink14.i, align 4, !tbaa !5 store i32 %4, ptr %arrayidx, align 4, !tbaa !5 store i32 %1, ptr %arrayidx32.i.sink14.i, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx28.i.sink11.i, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.5, align 8, !tbaa !5 store i32 %2, ptr %arrayidx28.i.sink11.i, align 4, !tbaa !5 br label %rollDice.exit.i rollDice.exit.i: ; preds = %rollDice.exit.sink.split.i, %for.body.i %6 = phi i32 [ %5, %rollDice.exit.sink.split.i ], [ %1, %for.body.i ] %7 = phi i32 [ %4, %rollDice.exit.sink.split.i ], [ %2, %for.body.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %cmd, i64 %indvars.iv.next.i %8 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !9 %conv.i.i.1 = sext i8 %8 to i32 switch i32 %conv.i.i.1, label %rollDice.exit.i.1 [ i32 69, label %rollDice.exit.sink.split.i.1 i32 78, label %sw.bb8.i.i.1 i32 83, label %sw.bb17.i.i.1 i32 87, label %sw.bb26.i.i.1 ] sw.bb26.i.i.1: ; preds = %rollDice.exit.i br label %rollDice.exit.sink.split.i.1 sw.bb17.i.i.1: ; preds = %rollDice.exit.i br label %rollDice.exit.sink.split.i.1 sw.bb8.i.i.1: ; preds = %rollDice.exit.i br label %rollDice.exit.sink.split.i.1 rollDice.exit.sink.split.i.1: ; preds = %sw.bb8.i.i.1, %sw.bb17.i.i.1, %sw.bb26.i.i.1, %rollDice.exit.i %arrayidx32.i.sink14.i.1 = phi ptr [ %arrayidx.1, %sw.bb8.i.i.1 ], [ %arrayidx.4, %sw.bb17.i.i.1 ], [ %arrayidx.2, %sw.bb26.i.i.1 ], [ %arrayidx.3, %rollDice.exit.i ] %arrayidx28.i.sink11.i.1 = phi ptr [ %arrayidx.4, %sw.bb8.i.i.1 ], [ %arrayidx.1, %sw.bb17.i.i.1 ], [ %arrayidx.3, %sw.bb26.i.i.1 ], [ %arrayidx.2, %rollDice.exit.i ] %9 = load i32, ptr %arrayidx32.i.sink14.i.1, align 4, !tbaa !5 store i32 %9, ptr %arrayidx, align 4, !tbaa !5 store i32 %6, ptr %arrayidx32.i.sink14.i.1, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx28.i.sink11.i.1, align 4, !tbaa !5 store i32 %10, ptr %arrayidx.5, align 8, !tbaa !5 store i32 %7, ptr %arrayidx28.i.sink11.i.1, align 4, !tbaa !5 br label %rollDice.exit.i.1 rollDice.exit.i.1: ; preds = %rollDice.exit.sink.split.i.1, %rollDice.exit.i %11 = phi i32 [ %10, %rollDice.exit.sink.split.i.1 ], [ %6, %rollDice.exit.i ] %12 = phi i32 [ %9, %rollDice.exit.sink.split.i.1 ], [ %7, %rollDice.exit.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 %doDice.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !10 doDice.exit.loopexit.unr-lcssa: ; preds = %rollDice.exit.i.1, %for.body.lr.ph.i %.lcssa.ph = phi i32 [ undef, %for.body.lr.ph.i ], [ %12, %rollDice.exit.i.1 ] %.unr = phi i32 [ %arrayidx30.i.i.promoted, %for.body.lr.ph.i ], [ %11, %rollDice.exit.i.1 ] %.unr9 = phi i32 [ %arrayidx27.i.i.promoted, %for.body.lr.ph.i ], [ %12, %rollDice.exit.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i.1, %rollDice.exit.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %doDice.exit, label %for.body.i.epil for.body.i.epil: ; preds = %doDice.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %cmd, i64 %indvars.iv.i.unr %13 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !9 %conv.i.i.epil = sext i8 %13 to i32 switch i32 %conv.i.i.epil, label %doDice.exit [ i32 69, label %rollDice.exit.sink.split.i.epil i32 78, label %sw.bb8.i.i.epil i32 83, label %sw.bb17.i.i.epil i32 87, label %sw.bb26.i.i.epil ] sw.bb26.i.i.epil: ; preds = %for.body.i.epil br label %rollDice.exit.sink.split.i.epil sw.bb17.i.i.epil: ; preds = %for.body.i.epil br label %rollDice.exit.sink.split.i.epil sw.bb8.i.i.epil: ; preds = %for.body.i.epil br label %rollDice.exit.sink.split.i.epil rollDice.exit.sink.split.i.epil: ; preds = %sw.bb8.i.i.epil, %sw.bb17.i.i.epil, %sw.bb26.i.i.epil, %for.body.i.epil %arrayidx32.i.sink14.i.epil = phi ptr [ %arrayidx.1, %sw.bb8.i.i.epil ], [ %arrayidx.4, %sw.bb17.i.i.epil ], [ %arrayidx.2, %sw.bb26.i.i.epil ], [ %arrayidx.3, %for.body.i.epil ] %arrayidx28.i.sink11.i.epil = phi ptr [ %arrayidx.4, %sw.bb8.i.i.epil ], [ %arrayidx.1, %sw.bb17.i.i.epil ], [ %arrayidx.3, %sw.bb26.i.i.epil ], [ %arrayidx.2, %for.body.i.epil ] %14 = load i32, ptr %arrayidx32.i.sink14.i.epil, align 4, !tbaa !5 store i32 %14, ptr %arrayidx, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx32.i.sink14.i.epil, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx28.i.sink11.i.epil, align 4, !tbaa !5 store i32 %15, ptr %arrayidx.5, align 8, !tbaa !5 store i32 %.unr9, ptr %arrayidx28.i.sink11.i.epil, align 4, !tbaa !5 br label %doDice.exit doDice.exit: ; preds = %doDice.exit.loopexit.unr-lcssa, %rollDice.exit.sink.split.i.epil, %for.body.i.epil, %entry.doDice.exit_crit_edge %16 = phi i32 [ %.pre, %entry.doDice.exit_crit_edge ], [ %.lcssa.ph, %doDice.exit.loopexit.unr-lcssa ], [ %14, %rollDice.exit.sink.split.i.epil ], [ %.unr9, %for.body.i.epil ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %cmd) #7 call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %faceNumber) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind 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 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int d[6],i,blank; char ENSW[100]; for(i = 0; i < 6; i++){ scanf("%d",&d[i]); } scanf("%s",ENSW); for(i = 0; ENSW[i] != '\0'; i++){ if(ENSW[i] == 'N'){ blank=d[0]; d[0]=d[1]; d[1]=d[5]; d[5]=d[4]; d[4]=blank; } if(ENSW[i] == 'E'){ blank=d[0]; d[0]=d[3]; d[3]=d[5]; d[5]=d[2]; d[2]=blank; } if(ENSW[i] == 'S'){ blank=d[0]; d[0]=d[4]; d[4]=d[5]; d[5]=d[1]; d[1]=blank; } if(ENSW[i] == 'W'){ blank=d[0]; d[0]=d[2]; d[2]=d[5]; d[5]=d[3]; d[3]=blank; } } printf("%d\n",d[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332107/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332107/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca [6 x i32], align 16 %ENSW = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %ENSW) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ENSW) %d.promoted = load i32, ptr %d, align 16, !tbaa !5 %arrayidx58.promoted = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %arrayidx60.promoted = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %arrayidx62.promoted = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %arrayidx43.promoted = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %arrayidx47.promoted = load i32, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.cond2 for.cond2: ; preds = %for.inc66, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc66 ], [ 0, %entry ] %0 = phi i32 [ %7, %for.inc66 ], [ %arrayidx47.promoted, %entry ] %1 = phi i32 [ %8, %for.inc66 ], [ %arrayidx43.promoted, %entry ] %2 = phi i32 [ %9, %for.inc66 ], [ %arrayidx62.promoted, %entry ] %3 = phi i32 [ %10, %for.inc66 ], [ %arrayidx60.promoted, %entry ] %4 = phi i32 [ %11, %for.inc66 ], [ %arrayidx58.promoted, %entry ] %5 = phi i32 [ %12, %for.inc66 ], [ %d.promoted, %entry ] %arrayidx4 = getelementptr inbounds [100 x i8], ptr %ENSW, i64 0, i64 %indvars.iv %6 = load i8, ptr %arrayidx4, align 1, !tbaa !9 switch i8 %6, label %for.inc66 [ i8 0, label %for.end68 i8 78, label %if.end.thread i8 69, label %if.then26 i8 83, label %if.then41 i8 87, label %if.then56 ] if.end.thread: ; preds = %for.cond2 store i32 %0, ptr %d, align 16, !tbaa !5 store i32 %3, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %1, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.4, align 16, !tbaa !5 br label %for.inc66 if.then26: ; preds = %for.cond2 store i32 %2, ptr %d, align 16, !tbaa !5 store i32 %3, ptr %arrayidx.3, align 4, !tbaa !5 store i32 %4, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.2, align 8, !tbaa !5 br label %for.inc66 if.then41: ; preds = %for.cond2 store i32 %1, ptr %d, align 16, !tbaa !5 store i32 %3, ptr %arrayidx.4, align 16, !tbaa !5 store i32 %0, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc66 if.then56: ; preds = %for.cond2 store i32 %4, ptr %d, align 16, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 8, !tbaa !5 store i32 %2, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc66 for.inc66: ; preds = %for.cond2, %if.then26, %if.end.thread, %if.then41, %if.then56 %7 = phi i32 [ %0, %for.cond2 ], [ %0, %if.then26 ], [ %3, %if.end.thread ], [ %5, %if.then41 ], [ %0, %if.then56 ] %8 = phi i32 [ %1, %for.cond2 ], [ %1, %if.then26 ], [ %5, %if.end.thread ], [ %3, %if.then41 ], [ %1, %if.then56 ] %9 = phi i32 [ %2, %for.cond2 ], [ %3, %if.then26 ], [ %2, %if.end.thread ], [ %2, %if.then41 ], [ %5, %if.then56 ] %10 = phi i32 [ %3, %for.cond2 ], [ %4, %if.then26 ], [ %1, %if.end.thread ], [ %0, %if.then41 ], [ %2, %if.then56 ] %11 = phi i32 [ %4, %for.cond2 ], [ %5, %if.then26 ], [ %4, %if.end.thread ], [ %4, %if.then41 ], [ %3, %if.then56 ] %12 = phi i32 [ %5, %for.cond2 ], [ %2, %if.then26 ], [ %0, %if.end.thread ], [ %1, %if.then41 ], [ %4, %if.then56 ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond2, !llvm.loop !10 for.end68: ; preds = %for.cond2 %call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %ENSW) #3 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> typedef struct{ int surface[6]; }Dice; void move_dice(Dice *d,char c){ int temp = d->surface[0]; if(c == 'N'){ d->surface[0] = d->surface[1]; d->surface[1] = d->surface[5]; d->surface[5] = d->surface[4]; d->surface[4] = temp; } else if(c == 'E'){ d->surface[0] = d->surface[3]; d->surface[3] = d->surface[5]; d->surface[5] = d->surface[2]; d->surface[2] = temp; } else if(c == 'S'){ d->surface[0] = d->surface[4]; d->surface[4] = d->surface[5]; d->surface[5] = d->surface[1]; d->surface[1] = temp; } else if(c == 'W'){ d->surface[0] = d->surface[2]; d->surface[2] = d->surface[5]; d->surface[5] = d->surface[3]; d->surface[3] = temp; } } int main(void){ Dice dice; char command[102]; for(int i = 0; i < 6; i++){ int temp; scanf("%d",&temp); dice.surface[i] = temp; } char dump = getchar(); fgets(command,sizeof(command),stdin); for(int i = 0; i < strlen(command); i++){ move_dice(&dice,command[i]); } printf("%d\n",dice.surface[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332158/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332158/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Dice = type { [6 x i32] } @.str = private unnamed_addr constant [3 x i8] c"%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: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @move_dice(ptr nocapture noundef %d, i8 noundef signext %c) local_unnamed_addr #0 { entry: %0 = load i32, ptr %d, align 4, !tbaa !5 switch i8 %c, label %if.end74 [ i8 78, label %if.end74.sink.split i8 69, label %if.then19 i8 83, label %if.then38 i8 87, label %if.then57 ] if.then19: ; preds = %entry br label %if.end74.sink.split if.then38: ; preds = %entry br label %if.end74.sink.split if.then57: ; preds = %entry br label %if.end74.sink.split if.end74.sink.split: ; preds = %entry, %if.then38, %if.then57, %if.then19 %.sink113 = phi i64 [ 4, %if.then38 ], [ 2, %if.then57 ], [ 3, %if.then19 ], [ 1, %entry ] %.sink = phi i64 [ 1, %if.then38 ], [ 3, %if.then57 ], [ 2, %if.then19 ], [ 4, %entry ] %arrayidx3 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 %.sink113 %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 store i32 %1, ptr %d, align 4, !tbaa !5 %arrayidx7.sink = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 5 %2 = load i32, ptr %arrayidx7.sink, align 4, !tbaa !5 store i32 %2, ptr %arrayidx3, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 %.sink %3 = load i32, ptr %arrayidx11, align 4, !tbaa !5 store i32 %3, ptr %arrayidx7.sink, align 4, !tbaa !5 store i32 %0, ptr %arrayidx11, align 4, !tbaa !5 br label %if.end74 if.end74: ; preds = %if.end74.sink.split, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %dice = alloca %struct.Dice, align 4 %command = alloca [102 x i8], align 16 %temp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice) #5 call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %command) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %0 = load i32, ptr %temp, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %1 = load i32, ptr %temp, align 4, !tbaa !5 %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 1 store i32 %1, ptr %arrayidx.1, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %2 = load i32, ptr %temp, align 4, !tbaa !5 %arrayidx.2 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 2 store i32 %2, ptr %arrayidx.2, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %3 = load i32, ptr %temp, align 4, !tbaa !5 %arrayidx.3 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 3 store i32 %3, ptr %arrayidx.3, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %4 = load i32, ptr %temp, align 4, !tbaa !5 %arrayidx.4 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 4 store i32 %4, ptr %arrayidx.4, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp) %5 = load i32, ptr %temp, align 4, !tbaa !5 %arrayidx.5 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5 store i32 %5, ptr %arrayidx.5, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #5 %6 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = call i32 @getc(ptr noundef %6) %7 = load ptr, ptr @stdin, align 8, !tbaa !9 %call2 = call ptr @fgets(ptr noundef nonnull %command, i32 noundef 102, ptr noundef %7) %call7 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %command) #6 %cmp825.not = icmp eq i64 %call7, 0 br i1 %cmp825.not, label %for.cond.cleanup10, label %for.body11 for.cond.cleanup10: ; preds = %move_dice.exit, %entry %.lcssa = phi i32 [ %0, %entry ], [ %13, %move_dice.exit ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %command) #5 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice) #5 ret i32 0 for.body11: ; preds = %entry, %move_dice.exit %indvars.iv = phi i64 [ %indvars.iv.next, %move_dice.exit ], [ 0, %entry ] %8 = phi i32 [ %13, %move_dice.exit ], [ %0, %entry ] %arrayidx13 = getelementptr inbounds [102 x i8], ptr %command, i64 0, i64 %indvars.iv %9 = load i8, ptr %arrayidx13, align 1, !tbaa !11 switch i8 %9, label %move_dice.exit [ i8 78, label %if.end74.sink.split.i i8 69, label %if.then19.i i8 83, label %if.then38.i i8 87, label %if.then57.i ] if.then19.i: ; preds = %for.body11 br label %if.end74.sink.split.i if.then38.i: ; preds = %for.body11 br label %if.end74.sink.split.i if.then57.i: ; preds = %for.body11 br label %if.end74.sink.split.i if.end74.sink.split.i: ; preds = %for.body11, %if.then57.i, %if.then38.i, %if.then19.i %arrayidx.2.sink = phi ptr [ %arrayidx.2, %if.then57.i ], [ %arrayidx.4, %if.then38.i ], [ %arrayidx.3, %if.then19.i ], [ %arrayidx.1, %for.body11 ] %.sink.i = phi i64 [ 3, %if.then57.i ], [ 1, %if.then38.i ], [ 2, %if.then19.i ], [ 4, %for.body11 ] %10 = load i32, ptr %arrayidx.2.sink, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %11, ptr %arrayidx.2.sink, align 4, !tbaa !5 %arrayidx11.i = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 %.sink.i %12 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5 store i32 %12, ptr %arrayidx.5, align 4, !tbaa !5 store i32 %8, ptr %arrayidx11.i, align 4, !tbaa !5 br label %move_dice.exit move_dice.exit: ; preds = %for.body11, %if.end74.sink.split.i %13 = phi i32 [ %8, %for.body11 ], [ %10, %if.end74.sink.split.i ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call7 br i1 %exitcond.not, label %for.cond.cleanup10, label %for.body11, !llvm.loop !12 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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: 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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree 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 = !{!"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"}
#include <stdio.h> #include <stdlib.h> int main(){ int N, i, j, ans; scanf("%d", &N); int *p = (int *)malloc(sizeof(int) * (N + 1)); int *have_pair = (int *)malloc(sizeof(int) * (N + 1)); p[0] = -1; for(i = 1; i <= N; i++){ scanf("%d", &p[i]); } for(i = 1; i <= N; i++){ for(j = 0; j <= N; j++){ have_pair[j] = 0; } ans = 0; for(j = i; j > 0; j--){ if(have_pair[j] == 0 && have_pair[p[j]] == 0){ ans++; have_pair[p[j]] = 1; } } /* printf("i = %d\n", i); for(j = 0; j <= N; j++){ printf("%d ", have_pair[j]); } printf("\n"); */ printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332200/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332200/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #5 %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 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 %call5 = call noalias ptr @malloc(i64 noundef %mul) #6 store i32 -1, ptr %call1, align 4, !tbaa !5 %cmp.not66 = icmp slt i32 %0, 1 br i1 %cmp.not66, label %for.end46, label %for.body for.cond9.preheader: ; preds = %for.body %cmp10.not72 = icmp slt i32 %1, 1 br i1 %cmp10.not72, label %for.end46, label %for.cond13.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx7 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %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.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.cond9.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.cond9.preheader, %for.end42 %indvar = phi i64 [ %indvar.next, %for.end42 ], [ 0, %for.cond9.preheader ] %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.end42 ], [ 1, %for.cond9.preheader ] %3 = phi i32 [ %17, %for.end42 ], [ %1, %for.cond9.preheader ] %indvars83 = trunc i64 %indvars.iv78 to i32 %cmp14.not68 = icmp slt i32 %3, 0 br i1 %cmp14.not68, label %for.body25.preheader, label %for.body16.preheader for.body16.preheader: ; preds = %for.cond13.preheader %4 = add nuw i32 %3, 1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call5, i8 0, i64 %6, i1 false), !tbaa !5 br label %for.body25.preheader for.body25.preheader: ; preds = %for.body16.preheader, %for.cond13.preheader %xtraiter = and i64 %indvars.iv78, 1 %7 = icmp eq i64 %indvar, 0 br i1 %7, label %for.end42.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter = and i64 %indvars.iv78, -2 br label %for.body25 for.body25: ; preds = %for.inc41.1, %for.body25.preheader.new %indvars.iv80 = phi i64 [ %indvars.iv78, %for.body25.preheader.new ], [ %indvars.iv.next81.1, %for.inc41.1 ] %ans.070 = phi i32 [ 0, %for.body25.preheader.new ], [ %ans.1.1, %for.inc41.1 ] %niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.1, %for.inc41.1 ] %arrayidx27 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv80 %8 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp eq i32 %8, 0 br i1 %cmp28, label %land.lhs.true, label %for.inc41 land.lhs.true: ; preds = %for.body25 %arrayidx31 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv80 %9 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %idxprom32 = sext i32 %9 to i64 %arrayidx33 = getelementptr inbounds i32, ptr %call5, i64 %idxprom32 %10 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %cmp34 = icmp eq i32 %10, 0 br i1 %cmp34, label %if.then, label %for.inc41 if.then: ; preds = %land.lhs.true %inc36 = add nsw i32 %ans.070, 1 store i32 1, ptr %arrayidx33, align 4, !tbaa !5 br label %for.inc41 for.inc41: ; preds = %for.body25, %land.lhs.true, %if.then %ans.1 = phi i32 [ %inc36, %if.then ], [ %ans.070, %land.lhs.true ], [ %ans.070, %for.body25 ] %indvars.iv.next81 = add nsw i64 %indvars.iv80, -1 %arrayidx27.1 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv.next81 %11 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %cmp28.1 = icmp eq i32 %11, 0 br i1 %cmp28.1, label %land.lhs.true.1, label %for.inc41.1 land.lhs.true.1: ; preds = %for.inc41 %arrayidx31.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next81 %12 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5 %idxprom32.1 = sext i32 %12 to i64 %arrayidx33.1 = getelementptr inbounds i32, ptr %call5, i64 %idxprom32.1 %13 = load i32, ptr %arrayidx33.1, align 4, !tbaa !5 %cmp34.1 = icmp eq i32 %13, 0 br i1 %cmp34.1, label %if.then.1, label %for.inc41.1 if.then.1: ; preds = %land.lhs.true.1 %inc36.1 = add nsw i32 %ans.1, 1 store i32 1, ptr %arrayidx33.1, align 4, !tbaa !5 br label %for.inc41.1 for.inc41.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc41 %ans.1.1 = phi i32 [ %inc36.1, %if.then.1 ], [ %ans.1, %land.lhs.true.1 ], [ %ans.1, %for.inc41 ] %indvars.iv.next81.1 = add nsw i64 %indvars.iv80, -2 %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.end42.unr-lcssa, label %for.body25, !llvm.loop !11 for.end42.unr-lcssa: ; preds = %for.inc41.1, %for.body25.preheader %ans.1.lcssa.ph = phi i32 [ undef, %for.body25.preheader ], [ %ans.1.1, %for.inc41.1 ] %indvars.iv80.unr = phi i64 [ %indvars.iv78, %for.body25.preheader ], [ %indvars.iv.next81.1, %for.inc41.1 ] %ans.070.unr = phi i32 [ 0, %for.body25.preheader ], [ %ans.1.1, %for.inc41.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end42, label %for.body25.epil for.body25.epil: ; preds = %for.end42.unr-lcssa %arrayidx27.epil = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv80.unr %14 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5 %cmp28.epil = icmp eq i32 %14, 0 br i1 %cmp28.epil, label %land.lhs.true.epil, label %for.end42 land.lhs.true.epil: ; preds = %for.body25.epil %arrayidx31.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv80.unr %15 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5 %idxprom32.epil = sext i32 %15 to i64 %arrayidx33.epil = getelementptr inbounds i32, ptr %call5, i64 %idxprom32.epil %16 = load i32, ptr %arrayidx33.epil, align 4, !tbaa !5 %cmp34.epil = icmp eq i32 %16, 0 br i1 %cmp34.epil, label %if.then.epil, label %for.end42 if.then.epil: ; preds = %land.lhs.true.epil %inc36.epil = add nsw i32 %ans.070.unr, 1 store i32 1, ptr %arrayidx33.epil, align 4, !tbaa !5 br label %for.end42 for.end42: ; preds = %for.body25.epil, %land.lhs.true.epil, %if.then.epil, %for.end42.unr-lcssa %ans.1.lcssa = phi i32 [ %ans.1.lcssa.ph, %for.end42.unr-lcssa ], [ %inc36.epil, %if.then.epil ], [ %ans.070.unr, %land.lhs.true.epil ], [ %ans.070.unr, %for.body25.epil ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.lcssa) %indvars.iv.next79 = add i64 %indvars.iv78, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %cmp10.not.not = icmp sgt i32 %17, %indvars83 %indvar.next = add i64 %indvar, 1 br i1 %cmp10.not.not, label %for.cond13.preheader, label %for.end46, !llvm.loop !12 for.end46: ; preds = %for.end42, %entry, %for.cond9.preheader 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree 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 nounwind willreturn memory(argmem: write) } 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 = distinct !{!12, !10}
/* AOJ 0043 * * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0043 * */ #include <stdio.h> #include <memory.h> #include <assert.h> #define false 0 #define true 1 #define DEBUG 0 int lessthan5times(char* buf){ int i; int count[10]; memset(count, 0, sizeof(count)); while(*buf){ count[*buf - '1']+=1; buf++; } for(i=0;i<10;i++){ if(count[i] > 4){ return false; } } return true; } void make_rest(char* src, int srclen, char*dst, int i, int j, int k){ int m; assert(0<=i); assert(i<j); assert(j<k); assert(k<srclen); for(m=0;m<i;m++){ dst[m] = src[m]; } for(m=i+1;m<j;m++){ dst[m-1] = src[m]; } for(m=j+1;m<k;m++){ dst[m-2] = src[m]; } for(m=k+1;m<srclen;m++){ dst[m-3] = src[m]; } dst[m-3] = '\0'; } int is_seq(char c, char d, char e){ return ( (c+2 == d+1) && (c+2 == e) )||( (c+2 == e+1) && (c+2 == d) )||( (d+2 == c+1) && (d+2 == e) )||( (d+2 == e+1) && (d+2 == c) )||( (e+2 == d+1) && (e+2 == c) )||( (e+2 == c+1) && (e+2 == d) ); } int check(char* buf, int len){ char rest[14]; int i,j,k; assert(!(len%3)); if(len == 0){ return true; } if(DEBUG){ printf("length: %d\n", len); printf("checking %s\n", buf); printf(" 01234567890123\n"); } for(i=0;i<len;i++){ for(j=i+1;j<len;j++){ for(k=j+1;k<len;k++){ if ((buf[i]==buf[j]) && (buf[j]==buf[k])){ if(DEBUG){ printf("set of %c, with %d %d %d\n", buf[i], i,j,k); } make_rest(buf, len, rest, i, j,k); if(check(rest, len -3)){ return true; } } if (is_seq(buf[i], buf[j], buf[k])){ if(DEBUG){ printf("seq, %c %c %c\n", buf[i],buf[j],buf[k]); } make_rest(buf, len, rest, i, j,k); if(check(rest, len -3)){ return true; } } } } } return false; } int is_complete(char* buf){ char rest[14]; int i,j,k; if(!lessthan5times(buf)){ return false; } for(i=0;i<14;i++){ for(j=i+1;j<14;j++){ if(buf[i] == buf[j]){ if(DEBUG){ printf("pair of %c, with %d %d\n", buf[i], i,j); } for(k=0;k<i;k++){ rest[k] = buf[k]; } for(k=i+1;k<j;k++){ rest[k-1] = buf[k]; } for(k=j+1;k<14;k++){ rest[k-2] = buf[k]; } rest[12]='\0'; if(check(rest, 12)){ return true; }else if (DEBUG){ printf("restarting %s.\n", buf); } } } } return false; } int main(){ char buf[15]; char i; int first; while(scanf("%s", buf)==1){ if(DEBUG){ printf("input: %s\n", buf); printf(" 01234567890123\n"); } first = 1; for(i='1';i<='9';i++){ buf[13]=i; buf[14]='\0'; if(DEBUG){ printf("trying %c\n", i); } if(is_complete(buf)){ if(DEBUG){ printf("found %c for %s.\n", i, buf); } if(first){ printf("%c", i); first = 0; }else{ printf(" %c", i); } } } if(first){ printf("0\n"); }else{ printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332266/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332266/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"0<=i\00", align 1 @.str.1 = private unnamed_addr constant [63 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/C/Source_332266/source.c\00", align 1 @__PRETTY_FUNCTION__.make_rest = private unnamed_addr constant [51 x i8] c"void make_rest(char *, int, char *, int, int, int)\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"i<j\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"j<k\00", align 1 @.str.4 = private unnamed_addr constant [9 x i8] c"k<srclen\00", align 1 @.str.5 = private unnamed_addr constant [9 x i8] c"!(len%3)\00", align 1 @__PRETTY_FUNCTION__.check = private unnamed_addr constant [23 x i8] c"int check(char *, int)\00", align 1 @.str.6 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.8 = private unnamed_addr constant [4 x i8] c" %c\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @lessthan5times(ptr nocapture noundef readonly %buf) local_unnamed_addr #0 { entry: %count = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %count) #9 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %count, i8 0, i64 40, i1 false) %0 = load i8, ptr %buf, align 1, !tbaa !5 %tobool.not11 = icmp eq i8 %0, 0 br i1 %tobool.not11, label %for.cond, label %while.body for.cond.preheader: ; preds = %while.body %.pre = load i32, ptr %count, align 16, !tbaa !8 %1 = icmp sgt i32 %.pre, 4 %arrayidx3.1 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 1 %2 = load i32, ptr %arrayidx3.1, align 4 %cmp4.1 = icmp sgt i32 %2, 4 %or.cond = select i1 %1, i1 true, i1 %cmp4.1 br i1 %or.cond, label %cleanup, label %for.cond.1 while.body: ; preds = %entry, %while.body %3 = phi i8 [ %5, %while.body ], [ %0, %entry ] %buf.addr.012 = phi ptr [ %incdec.ptr, %while.body ], [ %buf, %entry ] %conv = sext i8 %3 to i64 %sub = add nsw i64 %conv, -49 %arrayidx = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 %sub %4 = load i32, ptr %arrayidx, align 4, !tbaa !8 %add = add nsw i32 %4, 1 store i32 %add, ptr %arrayidx, align 4, !tbaa !8 %incdec.ptr = getelementptr inbounds i8, ptr %buf.addr.012, i64 1 %5 = load i8, ptr %incdec.ptr, align 1, !tbaa !5 %tobool.not = icmp eq i8 %5, 0 br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !10 for.cond: ; preds = %entry %arrayidx3.1.old = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 1 %.old = load i32, ptr %arrayidx3.1.old, align 4, !tbaa !8 %cmp4.1.old = icmp sgt i32 %.old, 4 br i1 %cmp4.1.old, label %cleanup, label %for.cond.1 for.cond.1: ; preds = %for.cond.preheader, %for.cond %arrayidx3.2 = getelementptr inbounds [10 x i32], ptr %count, i64 0, i64 2 %6 = load <8 x i32>, ptr %arrayidx3.2, align 8 %.fr = freeze <8 x i32> %6 %7 = icmp sgt <8 x i32> %.fr, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4> %8 = bitcast <8 x i1> %7 to i8 %9 = icmp eq i8 %8, 0 %spec.select = zext i1 %9 to i32 br label %cleanup cleanup: ; preds = %for.cond.1, %for.cond, %for.cond.preheader %retval.0 = phi i32 [ 0, %for.cond.preheader ], [ 0, %for.cond ], [ %spec.select, %for.cond.1 ] call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count) #9 ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: nounwind uwtable define dso_local void @make_rest(ptr nocapture noundef readonly %src, i32 noundef %srclen, ptr nocapture noundef writeonly %dst, i32 noundef %i, i32 noundef %j, i32 noundef %k) local_unnamed_addr #3 { entry: %src220 = ptrtoint ptr %src to i64 %dst219 = ptrtoint ptr %dst to i64 %src172 = ptrtoint ptr %src to i64 %dst171 = ptrtoint ptr %dst to i64 %src127 = ptrtoint ptr %src to i64 %dst126 = ptrtoint ptr %dst to i64 %src116 = ptrtoint ptr %src to i64 %dst115 = ptrtoint ptr %dst to i64 %cmp = icmp sgt i32 %i, -1 br i1 %cmp, label %if.end, label %if.else if.else: ; preds = %entry tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 35, ptr noundef nonnull @__PRETTY_FUNCTION__.make_rest) #10 unreachable if.end: ; preds = %entry %cmp1 = icmp slt i32 %i, %j br i1 %cmp1, label %if.end4, label %if.else3 if.else3: ; preds = %if.end tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 36, ptr noundef nonnull @__PRETTY_FUNCTION__.make_rest) #10 unreachable if.end4: ; preds = %if.end %cmp5 = icmp slt i32 %j, %k br i1 %cmp5, label %if.end8, label %if.else7 if.else7: ; preds = %if.end4 tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 37, ptr noundef nonnull @__PRETTY_FUNCTION__.make_rest) #10 unreachable if.end8: ; preds = %if.end4 %cmp9 = icmp slt i32 %k, %srclen br i1 %cmp9, label %for.cond.preheader, label %if.else11 for.cond.preheader: ; preds = %if.end8 %cmp1386.not = icmp eq i32 %i, 0 br i1 %cmp1386.not, label %for.cond16.preheader, label %iter.check iter.check: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %i to i64 %min.iters.check = icmp ult i32 %i, 8 %0 = sub i64 %dst115, %src116 %diff.check = icmp ult i64 %0, 32 %or.cond = or i1 %min.iters.check, %diff.check br i1 %or.cond, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check117 = icmp ult i32 %i, 32 br i1 %min.iters.check117, 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 ] %1 = getelementptr inbounds i8, ptr %src, i64 %index %wide.load = load <16 x i8>, ptr %1, align 1, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 16 %wide.load118 = load <16 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds i8, ptr %dst, i64 %index store <16 x i8> %wide.load, ptr %3, align 1, !tbaa !5 %4 = getelementptr inbounds i8, ptr %3, i64 16 store <16 x i8> %wide.load118, ptr %4, align 1, !tbaa !5 %index.next = add nuw i64 %index, 32 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond16.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.vec120 = and i64 %wide.trip.count, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index122 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next124, %vec.epilog.vector.body ] %6 = getelementptr inbounds i8, ptr %src, i64 %index122 %wide.load123 = load <8 x i8>, ptr %6, align 1, !tbaa !5 %7 = getelementptr inbounds i8, ptr %dst, i64 %index122 store <8 x i8> %wide.load123, ptr %7, align 1, !tbaa !5 %index.next124 = add nuw i64 %index122, 8 %8 = icmp eq i64 %index.next124, %n.vec120 br i1 %8, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n121 = icmp eq i64 %n.vec120, %wide.trip.count br i1 %cmp.n121, label %for.cond16.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.vec120, %vec.epilog.middle.block ] %9 = xor i64 %indvars.iv.ph, -1 %10 = add nsw i64 %9, %wide.trip.count %xtraiter = and i64 %wide.trip.count, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.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 %src, i64 %indvars.iv.prol %11 = load i8, ptr %arrayidx.prol, align 1, !tbaa !5 %arrayidx15.prol = getelementptr inbounds i8, ptr %dst, i64 %indvars.iv.prol store i8 %11, ptr %arrayidx15.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 !16 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 ] %12 = icmp ult i64 %10, 3 br i1 %12, label %for.cond16.preheader, label %for.body if.else11: ; preds = %if.end8 tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 38, ptr noundef nonnull @__PRETTY_FUNCTION__.make_rest) #10 unreachable for.cond16.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %for.cond.preheader %m.188 = add nsw i32 %i, 1 %cmp1789 = icmp slt i32 %m.188, %j br i1 %cmp1789, label %iter.check132, label %for.cond27.preheader iter.check132: ; preds = %for.cond16.preheader %13 = sext i32 %m.188 to i64 %14 = add i32 %j, -2 %15 = sub i32 %14, %i %16 = zext i32 %15 to i64 %17 = add nuw nsw i64 %16, 1 %min.iters.check130 = icmp ult i32 %15, 7 %18 = add i32 %j, -2 %19 = icmp slt i32 %18, %i %or.cond243 = or i1 %min.iters.check130, %19 br i1 %or.cond243, label %for.body18.preheader, label %vector.memcheck125 vector.memcheck125: ; preds = %iter.check132 %20 = sext i32 %i to i64 %21 = add i64 %dst126, %20 %22 = add i64 %src127, %13 %23 = sub i64 %21, %22 %diff.check128 = icmp ult i64 %23, 32 br i1 %diff.check128, label %for.body18.preheader, label %vector.main.loop.iter.check134 vector.main.loop.iter.check134: ; preds = %vector.memcheck125 %min.iters.check133 = icmp ult i32 %15, 31 br i1 %min.iters.check133, label %vec.epilog.ph148, label %vector.ph135 vector.ph135: ; preds = %vector.main.loop.iter.check134 %n.vec137 = and i64 %17, 8589934560 %invariant.gep = getelementptr i8, ptr %src, i64 %13 br label %vector.body139 vector.body139: ; preds = %vector.body139, %vector.ph135 %index140 = phi i64 [ 0, %vector.ph135 ], [ %index.next144, %vector.body139 ] %.cast = trunc i64 %index140 to i32 %offset.idx = add i32 %.cast, %i %gep = getelementptr i8, ptr %invariant.gep, i64 %index140 %wide.load142 = load <16 x i8>, ptr %gep, align 1, !tbaa !5 %24 = getelementptr inbounds i8, ptr %gep, i64 16 %wide.load143 = load <16 x i8>, ptr %24, align 1, !tbaa !5 %25 = sext i32 %offset.idx to i64 %26 = getelementptr inbounds i8, ptr %dst, i64 %25 store <16 x i8> %wide.load142, ptr %26, align 1, !tbaa !5 %27 = getelementptr inbounds i8, ptr %26, i64 16 store <16 x i8> %wide.load143, ptr %27, align 1, !tbaa !5 %index.next144 = add nuw i64 %index140, 32 %28 = icmp eq i64 %index.next144, %n.vec137 br i1 %28, label %middle.block129, label %vector.body139, !llvm.loop !18 middle.block129: ; preds = %vector.body139 %cmp.n138 = icmp eq i64 %17, %n.vec137 br i1 %cmp.n138, label %for.cond27.preheader, label %vec.epilog.iter.check147 vec.epilog.iter.check147: ; preds = %middle.block129 %.cast158 = trunc i64 %n.vec137 to i32 %ind.end159 = add i32 %.cast158, %i %ind.end154 = add nsw i64 %n.vec137, %13 %n.vec.remaining149 = and i64 %17, 24 %min.epilog.iters.check150 = icmp eq i64 %n.vec.remaining149, 0 br i1 %min.epilog.iters.check150, label %for.body18.preheader, label %vec.epilog.ph148 vec.epilog.ph148: ; preds = %vector.main.loop.iter.check134, %vec.epilog.iter.check147 %vec.epilog.resume.val151 = phi i64 [ %n.vec137, %vec.epilog.iter.check147 ], [ 0, %vector.main.loop.iter.check134 ] %n.vec153 = and i64 %17, 8589934584 %ind.end = add nsw i64 %n.vec153, %13 %.cast156 = trunc i64 %n.vec153 to i32 %ind.end157 = add i32 %.cast156, %i %invariant.gep266 = getelementptr i8, ptr %src, i64 %13 br label %vec.epilog.vector.body162 vec.epilog.vector.body162: ; preds = %vec.epilog.vector.body162, %vec.epilog.ph148 %index163 = phi i64 [ %vec.epilog.resume.val151, %vec.epilog.ph148 ], [ %index.next168, %vec.epilog.vector.body162 ] %.cast164 = trunc i64 %index163 to i32 %offset.idx165 = add i32 %.cast164, %i %gep267 = getelementptr i8, ptr %invariant.gep266, i64 %index163 %wide.load167 = load <8 x i8>, ptr %gep267, align 1, !tbaa !5 %29 = sext i32 %offset.idx165 to i64 %30 = getelementptr inbounds i8, ptr %dst, i64 %29 store <8 x i8> %wide.load167, ptr %30, align 1, !tbaa !5 %index.next168 = add nuw i64 %index163, 8 %31 = icmp eq i64 %index.next168, %n.vec153 br i1 %31, label %vec.epilog.middle.block145, label %vec.epilog.vector.body162, !llvm.loop !19 vec.epilog.middle.block145: ; preds = %vec.epilog.vector.body162 %cmp.n161 = icmp eq i64 %17, %n.vec153 br i1 %cmp.n161, label %for.cond27.preheader, label %for.body18.preheader for.body18.preheader: ; preds = %vector.memcheck125, %iter.check132, %vec.epilog.iter.check147, %vec.epilog.middle.block145 %indvars.iv101.ph = phi i64 [ %13, %iter.check132 ], [ %13, %vector.memcheck125 ], [ %ind.end154, %vec.epilog.iter.check147 ], [ %ind.end, %vec.epilog.middle.block145 ] %m.1.in90.ph = phi i32 [ %i, %iter.check132 ], [ %i, %vector.memcheck125 ], [ %ind.end159, %vec.epilog.iter.check147 ], [ %ind.end157, %vec.epilog.middle.block145 ] %32 = trunc i64 %indvars.iv101.ph to i32 %33 = sub i32 %j, %32 %34 = xor i32 %32, -1 %35 = add i32 %34, %j %xtraiter245 = and i32 %33, 3 %lcmp.mod246.not = icmp eq i32 %xtraiter245, 0 br i1 %lcmp.mod246.not, label %for.body18.prol.loopexit, label %for.body18.prol for.body18.prol: ; preds = %for.body18.preheader, %for.body18.prol %indvars.iv101.prol = phi i64 [ %indvars.iv.next102.prol, %for.body18.prol ], [ %indvars.iv101.ph, %for.body18.preheader ] %m.1.in90.prol = phi i32 [ %37, %for.body18.prol ], [ %m.1.in90.ph, %for.body18.preheader ] %prol.iter247 = phi i32 [ %prol.iter247.next, %for.body18.prol ], [ 0, %for.body18.preheader ] %arrayidx20.prol = getelementptr inbounds i8, ptr %src, i64 %indvars.iv101.prol %36 = load i8, ptr %arrayidx20.prol, align 1, !tbaa !5 %idxprom21.prol = sext i32 %m.1.in90.prol to i64 %arrayidx22.prol = getelementptr inbounds i8, ptr %dst, i64 %idxprom21.prol store i8 %36, ptr %arrayidx22.prol, align 1, !tbaa !5 %indvars.iv.next102.prol = add nsw i64 %indvars.iv101.prol, 1 %37 = trunc i64 %indvars.iv101.prol to i32 %prol.iter247.next = add i32 %prol.iter247, 1 %prol.iter247.cmp.not = icmp eq i32 %prol.iter247.next, %xtraiter245 br i1 %prol.iter247.cmp.not, label %for.body18.prol.loopexit, label %for.body18.prol, !llvm.loop !20 for.body18.prol.loopexit: ; preds = %for.body18.prol, %for.body18.preheader %indvars.iv101.unr = phi i64 [ %indvars.iv101.ph, %for.body18.preheader ], [ %indvars.iv.next102.prol, %for.body18.prol ] %m.1.in90.unr = phi i32 [ %m.1.in90.ph, %for.body18.preheader ], [ %37, %for.body18.prol ] %38 = icmp ult i32 %35, 3 br i1 %38, label %for.cond27.preheader, label %for.body18 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 %src, i64 %indvars.iv %39 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx15 = getelementptr inbounds i8, ptr %dst, i64 %indvars.iv store i8 %39, ptr %arrayidx15, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next %40 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx15.1 = getelementptr inbounds i8, ptr %dst, i64 %indvars.iv.next store i8 %40, ptr %arrayidx15.1, align 1, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next.1 %41 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %arrayidx15.2 = getelementptr inbounds i8, ptr %dst, i64 %indvars.iv.next.1 store i8 %41, ptr %arrayidx15.2, align 1, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next.2 %42 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %arrayidx15.3 = getelementptr inbounds i8, ptr %dst, i64 %indvars.iv.next.2 store i8 %42, ptr %arrayidx15.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.cond16.preheader, label %for.body, !llvm.loop !21 for.cond27.preheader: ; preds = %for.body18.prol.loopexit, %for.body18, %middle.block129, %vec.epilog.middle.block145, %for.cond16.preheader %m.292 = add nsw i32 %j, 1 %cmp2893 = icmp slt i32 %m.292, %k br i1 %cmp2893, label %iter.check177, label %for.cond39.preheader iter.check177: ; preds = %for.cond27.preheader %43 = sext i32 %m.292 to i64 %44 = add i32 %k, -2 %45 = sub i32 %44, %j %46 = zext i32 %45 to i64 %47 = add nuw nsw i64 %46, 1 %min.iters.check175 = icmp ult i32 %45, 7 br i1 %min.iters.check175, label %for.body29.preheader, label %vector.scevcheck169 vector.scevcheck169: ; preds = %iter.check177 %48 = add i32 %j, -1 %49 = add i32 %k, -3 %50 = icmp slt i32 %49, %48 br i1 %50, label %for.body29.preheader, label %vector.memcheck170 vector.memcheck170: ; preds = %vector.scevcheck169 %51 = add i32 %j, -1 %52 = sext i32 %51 to i64 %53 = add i64 %dst171, %52 %54 = add i64 %src172, %43 %55 = sub i64 %53, %54 %diff.check173 = icmp ult i64 %55, 32 br i1 %diff.check173, label %for.body29.preheader, label %vector.main.loop.iter.check179 vector.main.loop.iter.check179: ; preds = %vector.memcheck170 %min.iters.check178 = icmp ult i32 %45, 31 br i1 %min.iters.check178, label %vec.epilog.ph195, label %vector.ph180 vector.ph180: ; preds = %vector.main.loop.iter.check179 %n.vec182 = and i64 %47, 8589934560 %invariant.gep268 = getelementptr i8, ptr %src, i64 %43 br label %vector.body184 vector.body184: ; preds = %vector.body184, %vector.ph180 %index185 = phi i64 [ 0, %vector.ph180 ], [ %index.next191, %vector.body184 ] %.cast186 = trunc i64 %index185 to i32 %offset.idx187 = add i32 %.cast186, %j %gep269 = getelementptr i8, ptr %invariant.gep268, i64 %index185 %wide.load189 = load <16 x i8>, ptr %gep269, align 1, !tbaa !5 %56 = getelementptr inbounds i8, ptr %gep269, i64 16 %wide.load190 = load <16 x i8>, ptr %56, align 1, !tbaa !5 %57 = add nsw i32 %offset.idx187, -1 %58 = sext i32 %57 to i64 %59 = getelementptr inbounds i8, ptr %dst, i64 %58 store <16 x i8> %wide.load189, ptr %59, align 1, !tbaa !5 %60 = getelementptr inbounds i8, ptr %59, i64 16 store <16 x i8> %wide.load190, ptr %60, align 1, !tbaa !5 %index.next191 = add nuw i64 %index185, 32 %61 = icmp eq i64 %index.next191, %n.vec182 br i1 %61, label %middle.block174, label %vector.body184, !llvm.loop !22 middle.block174: ; preds = %vector.body184 %cmp.n183 = icmp eq i64 %47, %n.vec182 br i1 %cmp.n183, label %for.cond39.preheader, label %vec.epilog.iter.check194 vec.epilog.iter.check194: ; preds = %middle.block174 %.cast206 = trunc i64 %n.vec182 to i32 %ind.end207 = add i32 %.cast206, %j %ind.end202 = add nsw i64 %n.vec182, %43 %n.vec.remaining196 = and i64 %47, 24 %min.epilog.iters.check197 = icmp eq i64 %n.vec.remaining196, 0 br i1 %min.epilog.iters.check197, label %for.body29.preheader, label %vec.epilog.ph195 vec.epilog.ph195: ; preds = %vector.main.loop.iter.check179, %vec.epilog.iter.check194 %vec.epilog.resume.val198 = phi i64 [ %n.vec182, %vec.epilog.iter.check194 ], [ 0, %vector.main.loop.iter.check179 ] %n.vec200 = and i64 %47, 8589934584 %ind.end201 = add nsw i64 %n.vec200, %43 %.cast204 = trunc i64 %n.vec200 to i32 %ind.end205 = add i32 %.cast204, %j %invariant.gep270 = getelementptr i8, ptr %src, i64 %43 br label %vec.epilog.vector.body210 vec.epilog.vector.body210: ; preds = %vec.epilog.vector.body210, %vec.epilog.ph195 %index211 = phi i64 [ %vec.epilog.resume.val198, %vec.epilog.ph195 ], [ %index.next216, %vec.epilog.vector.body210 ] %.cast212 = trunc i64 %index211 to i32 %offset.idx213 = add i32 %.cast212, %j %gep271 = getelementptr i8, ptr %invariant.gep270, i64 %index211 %wide.load215 = load <8 x i8>, ptr %gep271, align 1, !tbaa !5 %62 = add nsw i32 %offset.idx213, -1 %63 = sext i32 %62 to i64 %64 = getelementptr inbounds i8, ptr %dst, i64 %63 store <8 x i8> %wide.load215, ptr %64, align 1, !tbaa !5 %index.next216 = add nuw i64 %index211, 8 %65 = icmp eq i64 %index.next216, %n.vec200 br i1 %65, label %vec.epilog.middle.block192, label %vec.epilog.vector.body210, !llvm.loop !23 vec.epilog.middle.block192: ; preds = %vec.epilog.vector.body210 %cmp.n209 = icmp eq i64 %47, %n.vec200 br i1 %cmp.n209, label %for.cond39.preheader, label %for.body29.preheader for.body29.preheader: ; preds = %vector.memcheck170, %vector.scevcheck169, %iter.check177, %vec.epilog.iter.check194, %vec.epilog.middle.block192 %indvars.iv105.ph = phi i64 [ %43, %iter.check177 ], [ %43, %vector.memcheck170 ], [ %43, %vector.scevcheck169 ], [ %ind.end202, %vec.epilog.iter.check194 ], [ %ind.end201, %vec.epilog.middle.block192 ] %m.2.in94.ph = phi i32 [ %j, %iter.check177 ], [ %j, %vector.memcheck170 ], [ %j, %vector.scevcheck169 ], [ %ind.end207, %vec.epilog.iter.check194 ], [ %ind.end205, %vec.epilog.middle.block192 ] %66 = trunc i64 %indvars.iv105.ph to i32 %67 = sub i32 %k, %66 %68 = xor i32 %66, -1 %69 = add i32 %68, %k %xtraiter248 = and i32 %67, 3 %lcmp.mod249.not = icmp eq i32 %xtraiter248, 0 br i1 %lcmp.mod249.not, label %for.body29.prol.loopexit, label %for.body29.prol for.body29.prol: ; preds = %for.body29.preheader, %for.body29.prol %indvars.iv105.prol = phi i64 [ %indvars.iv.next106.prol, %for.body29.prol ], [ %indvars.iv105.ph, %for.body29.preheader ] %m.2.in94.prol = phi i32 [ %71, %for.body29.prol ], [ %m.2.in94.ph, %for.body29.preheader ] %prol.iter250 = phi i32 [ %prol.iter250.next, %for.body29.prol ], [ 0, %for.body29.preheader ] %arrayidx31.prol = getelementptr inbounds i8, ptr %src, i64 %indvars.iv105.prol %70 = load i8, ptr %arrayidx31.prol, align 1, !tbaa !5 %sub32.prol = add nsw i32 %m.2.in94.prol, -1 %idxprom33.prol = sext i32 %sub32.prol to i64 %arrayidx34.prol = getelementptr inbounds i8, ptr %dst, i64 %idxprom33.prol store i8 %70, ptr %arrayidx34.prol, align 1, !tbaa !5 %indvars.iv.next106.prol = add nsw i64 %indvars.iv105.prol, 1 %71 = trunc i64 %indvars.iv105.prol to i32 %prol.iter250.next = add i32 %prol.iter250, 1 %prol.iter250.cmp.not = icmp eq i32 %prol.iter250.next, %xtraiter248 br i1 %prol.iter250.cmp.not, label %for.body29.prol.loopexit, label %for.body29.prol, !llvm.loop !24 for.body29.prol.loopexit: ; preds = %for.body29.prol, %for.body29.preheader %indvars.iv105.unr = phi i64 [ %indvars.iv105.ph, %for.body29.preheader ], [ %indvars.iv.next106.prol, %for.body29.prol ] %m.2.in94.unr = phi i32 [ %m.2.in94.ph, %for.body29.preheader ], [ %71, %for.body29.prol ] %72 = icmp ult i32 %69, 3 br i1 %72, label %for.cond39.preheader, label %for.body29.preheader.new for.body29.preheader.new: ; preds = %for.body29.prol.loopexit %invariant.gep272 = getelementptr i8, ptr %src, i64 1 %invariant.gep274 = getelementptr i8, ptr %src, i64 2 br label %for.body29 for.body18: ; preds = %for.body18.prol.loopexit, %for.body18 %indvars.iv101 = phi i64 [ %indvars.iv.next102.3, %for.body18 ], [ %indvars.iv101.unr, %for.body18.prol.loopexit ] %m.1.in90 = phi i32 [ %77, %for.body18 ], [ %m.1.in90.unr, %for.body18.prol.loopexit ] %arrayidx20 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv101 %73 = load i8, ptr %arrayidx20, align 1, !tbaa !5 %idxprom21 = sext i32 %m.1.in90 to i64 %arrayidx22 = getelementptr inbounds i8, ptr %dst, i64 %idxprom21 store i8 %73, ptr %arrayidx22, align 1, !tbaa !5 %indvars.iv.next102 = add nsw i64 %indvars.iv101, 1 %arrayidx20.1 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next102 %74 = load i8, ptr %arrayidx20.1, align 1, !tbaa !5 %sext = shl i64 %indvars.iv101, 32 %idxprom21.1 = ashr exact i64 %sext, 32 %arrayidx22.1 = getelementptr inbounds i8, ptr %dst, i64 %idxprom21.1 store i8 %74, ptr %arrayidx22.1, align 1, !tbaa !5 %indvars.iv.next102.1 = add nsw i64 %indvars.iv101, 2 %arrayidx20.2 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next102.1 %75 = load i8, ptr %arrayidx20.2, align 1, !tbaa !5 %sext254 = shl i64 %indvars.iv.next102, 32 %idxprom21.2 = ashr exact i64 %sext254, 32 %arrayidx22.2 = getelementptr inbounds i8, ptr %dst, i64 %idxprom21.2 store i8 %75, ptr %arrayidx22.2, align 1, !tbaa !5 %indvars.iv.next102.2 = add nsw i64 %indvars.iv101, 3 %arrayidx20.3 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next102.2 %76 = load i8, ptr %arrayidx20.3, align 1, !tbaa !5 %sext255 = shl i64 %indvars.iv.next102.1, 32 %idxprom21.3 = ashr exact i64 %sext255, 32 %arrayidx22.3 = getelementptr inbounds i8, ptr %dst, i64 %idxprom21.3 store i8 %76, ptr %arrayidx22.3, align 1, !tbaa !5 %indvars.iv.next102.3 = add nsw i64 %indvars.iv101, 4 %77 = trunc i64 %indvars.iv.next102.2 to i32 %lftr.wideiv.3 = trunc i64 %indvars.iv.next102.3 to i32 %exitcond104.not.3 = icmp eq i32 %lftr.wideiv.3, %j br i1 %exitcond104.not.3, label %for.cond27.preheader, label %for.body18, !llvm.loop !25 for.cond39.preheader: ; preds = %for.body29.prol.loopexit, %for.body29, %middle.block174, %vec.epilog.middle.block192, %for.cond27.preheader %m.396 = add nsw i32 %k, 1 %cmp4097 = icmp slt i32 %m.396, %srclen br i1 %cmp4097, label %for.body41.preheader, label %for.end49 for.body41.preheader: ; preds = %for.cond39.preheader %78 = sext i32 %m.396 to i64 %79 = add i32 %srclen, -2 %80 = sub i32 %79, %k %81 = zext i32 %80 to i64 %82 = add nuw nsw i64 %81, 1 %min.iters.check223 = icmp ult i32 %80, 31 br i1 %min.iters.check223, label %for.body41.preheader244, label %vector.scevcheck217 vector.scevcheck217: ; preds = %for.body41.preheader %83 = add i32 %k, -2 %84 = add i32 %srclen, -4 %85 = icmp slt i32 %84, %83 br i1 %85, label %for.body41.preheader244, label %vector.memcheck218 vector.memcheck218: ; preds = %vector.scevcheck217 %86 = add i32 %k, -2 %87 = sext i32 %86 to i64 %88 = add i64 %dst219, %87 %89 = add i64 %src220, %78 %90 = sub i64 %88, %89 %diff.check221 = icmp ult i64 %90, 32 br i1 %diff.check221, label %for.body41.preheader244, label %vector.ph224 vector.ph224: ; preds = %vector.memcheck218 %n.vec226 = and i64 %82, 8589934560 %ind.end227 = add nsw i64 %n.vec226, %78 %.cast229 = trunc i64 %n.vec226 to i32 %ind.end230 = add i32 %.cast229, %k %invariant.gep276 = getelementptr i8, ptr %src, i64 %78 br label %vector.body233 vector.body233: ; preds = %vector.body233, %vector.ph224 %index234 = phi i64 [ 0, %vector.ph224 ], [ %index.next241, %vector.body233 ] %.cast236 = trunc i64 %index234 to i32 %offset.idx237 = add i32 %.cast236, %k %gep277 = getelementptr i8, ptr %invariant.gep276, i64 %index234 %wide.load239 = load <16 x i8>, ptr %gep277, align 1, !tbaa !5 %91 = getelementptr inbounds i8, ptr %gep277, i64 16 %wide.load240 = load <16 x i8>, ptr %91, align 1, !tbaa !5 %92 = add nsw i32 %offset.idx237, -2 %93 = sext i32 %92 to i64 %94 = getelementptr inbounds i8, ptr %dst, i64 %93 store <16 x i8> %wide.load239, ptr %94, align 1, !tbaa !5 %95 = getelementptr inbounds i8, ptr %94, i64 16 store <16 x i8> %wide.load240, ptr %95, align 1, !tbaa !5 %index.next241 = add nuw i64 %index234, 32 %96 = icmp eq i64 %index.next241, %n.vec226 br i1 %96, label %middle.block222, label %vector.body233, !llvm.loop !26 middle.block222: ; preds = %vector.body233 %cmp.n232 = icmp eq i64 %82, %n.vec226 br i1 %cmp.n232, label %for.end49, label %for.body41.preheader244 for.body41.preheader244: ; preds = %vector.memcheck218, %vector.scevcheck217, %for.body41.preheader, %middle.block222 %indvars.iv110.ph = phi i64 [ %78, %vector.memcheck218 ], [ %78, %vector.scevcheck217 ], [ %78, %for.body41.preheader ], [ %ind.end227, %middle.block222 ] %m.3.in98.ph = phi i32 [ %k, %vector.memcheck218 ], [ %k, %vector.scevcheck217 ], [ %k, %for.body41.preheader ], [ %ind.end230, %middle.block222 ] %97 = trunc i64 %indvars.iv110.ph to i32 %98 = sub i32 %srclen, %97 %99 = xor i32 %97, -1 %100 = add i32 %99, %srclen %xtraiter251 = and i32 %98, 3 %lcmp.mod252.not = icmp eq i32 %xtraiter251, 0 br i1 %lcmp.mod252.not, label %for.body41.prol.loopexit, label %for.body41.prol for.body41.prol: ; preds = %for.body41.preheader244, %for.body41.prol %indvars.iv110.prol = phi i64 [ %indvars.iv.next111.prol, %for.body41.prol ], [ %indvars.iv110.ph, %for.body41.preheader244 ] %m.3.in98.prol = phi i32 [ %102, %for.body41.prol ], [ %m.3.in98.ph, %for.body41.preheader244 ] %prol.iter253 = phi i32 [ %prol.iter253.next, %for.body41.prol ], [ 0, %for.body41.preheader244 ] %arrayidx43.prol = getelementptr inbounds i8, ptr %src, i64 %indvars.iv110.prol %101 = load i8, ptr %arrayidx43.prol, align 1, !tbaa !5 %sub44.prol = add nsw i32 %m.3.in98.prol, -2 %idxprom45.prol = sext i32 %sub44.prol to i64 %arrayidx46.prol = getelementptr inbounds i8, ptr %dst, i64 %idxprom45.prol store i8 %101, ptr %arrayidx46.prol, align 1, !tbaa !5 %indvars.iv.next111.prol = add nsw i64 %indvars.iv110.prol, 1 %102 = trunc i64 %indvars.iv110.prol to i32 %prol.iter253.next = add i32 %prol.iter253, 1 %prol.iter253.cmp.not = icmp eq i32 %prol.iter253.next, %xtraiter251 br i1 %prol.iter253.cmp.not, label %for.body41.prol.loopexit, label %for.body41.prol, !llvm.loop !27 for.body41.prol.loopexit: ; preds = %for.body41.prol, %for.body41.preheader244 %.lcssa.unr = phi i32 [ undef, %for.body41.preheader244 ], [ %102, %for.body41.prol ] %indvars.iv110.unr = phi i64 [ %indvars.iv110.ph, %for.body41.preheader244 ], [ %indvars.iv.next111.prol, %for.body41.prol ] %m.3.in98.unr = phi i32 [ %m.3.in98.ph, %for.body41.preheader244 ], [ %102, %for.body41.prol ] %103 = icmp ult i32 %100, 3 br i1 %103, label %for.end49, label %for.body41.preheader244.new for.body41.preheader244.new: ; preds = %for.body41.prol.loopexit %invariant.gep278 = getelementptr i8, ptr %src, i64 1 %invariant.gep280 = getelementptr i8, ptr %src, i64 2 br label %for.body41 for.body29: ; preds = %for.body29, %for.body29.preheader.new %indvars.iv105 = phi i64 [ %indvars.iv105.unr, %for.body29.preheader.new ], [ %indvars.iv.next106.3, %for.body29 ] %m.2.in94 = phi i32 [ %m.2.in94.unr, %for.body29.preheader.new ], [ %108, %for.body29 ] %arrayidx31 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv105 %104 = load i8, ptr %arrayidx31, align 1, !tbaa !5 %sub32 = add nsw i32 %m.2.in94, -1 %idxprom33 = sext i32 %sub32 to i64 %arrayidx34 = getelementptr inbounds i8, ptr %dst, i64 %idxprom33 store i8 %104, ptr %arrayidx34, align 1, !tbaa !5 %gep273 = getelementptr i8, ptr %invariant.gep272, i64 %indvars.iv105 %105 = load i8, ptr %gep273, align 1, !tbaa !5 %sub32.1 = shl i64 %indvars.iv105, 32 %sext256 = add i64 %sub32.1, -4294967296 %idxprom33.1 = ashr exact i64 %sext256, 32 %arrayidx34.1 = getelementptr inbounds i8, ptr %dst, i64 %idxprom33.1 store i8 %105, ptr %arrayidx34.1, align 1, !tbaa !5 %gep275 = getelementptr i8, ptr %invariant.gep274, i64 %indvars.iv105 %106 = load i8, ptr %gep275, align 1, !tbaa !5 %sext257 = shl i64 %indvars.iv105, 32 %idxprom33.2 = ashr exact i64 %sext257, 32 %arrayidx34.2 = getelementptr inbounds i8, ptr %dst, i64 %idxprom33.2 store i8 %106, ptr %arrayidx34.2, align 1, !tbaa !5 %indvars.iv.next106.2 = add nsw i64 %indvars.iv105, 3 %arrayidx31.3 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next106.2 %107 = load i8, ptr %arrayidx31.3, align 1, !tbaa !5 %sub32.3 = shl i64 %indvars.iv105, 32 %sext258 = add i64 %sub32.3, 4294967296 %idxprom33.3 = ashr exact i64 %sext258, 32 %arrayidx34.3 = getelementptr inbounds i8, ptr %dst, i64 %idxprom33.3 store i8 %107, ptr %arrayidx34.3, align 1, !tbaa !5 %indvars.iv.next106.3 = add nsw i64 %indvars.iv105, 4 %108 = trunc i64 %indvars.iv.next106.2 to i32 %lftr.wideiv108.3 = trunc i64 %indvars.iv.next106.3 to i32 %exitcond109.not.3 = icmp eq i32 %lftr.wideiv108.3, %k br i1 %exitcond109.not.3, label %for.cond39.preheader, label %for.body29, !llvm.loop !28 for.body41: ; preds = %for.body41, %for.body41.preheader244.new %indvars.iv110 = phi i64 [ %indvars.iv110.unr, %for.body41.preheader244.new ], [ %indvars.iv.next111.3, %for.body41 ] %m.3.in98 = phi i32 [ %m.3.in98.unr, %for.body41.preheader244.new ], [ %113, %for.body41 ] %arrayidx43 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv110 %109 = load i8, ptr %arrayidx43, align 1, !tbaa !5 %sub44 = add nsw i32 %m.3.in98, -2 %idxprom45 = sext i32 %sub44 to i64 %arrayidx46 = getelementptr inbounds i8, ptr %dst, i64 %idxprom45 store i8 %109, ptr %arrayidx46, align 1, !tbaa !5 %gep279 = getelementptr i8, ptr %invariant.gep278, i64 %indvars.iv110 %110 = load i8, ptr %gep279, align 1, !tbaa !5 %sub44.1 = shl i64 %indvars.iv110, 32 %sext259 = add i64 %sub44.1, -8589934592 %idxprom45.1 = ashr exact i64 %sext259, 32 %arrayidx46.1 = getelementptr inbounds i8, ptr %dst, i64 %idxprom45.1 store i8 %110, ptr %arrayidx46.1, align 1, !tbaa !5 %gep281 = getelementptr i8, ptr %invariant.gep280, i64 %indvars.iv110 %111 = load i8, ptr %gep281, align 1, !tbaa !5 %sub44.2 = shl i64 %indvars.iv110, 32 %sext260 = add i64 %sub44.2, -4294967296 %idxprom45.2 = ashr exact i64 %sext260, 32 %arrayidx46.2 = getelementptr inbounds i8, ptr %dst, i64 %idxprom45.2 store i8 %111, ptr %arrayidx46.2, align 1, !tbaa !5 %indvars.iv.next111.2 = add nsw i64 %indvars.iv110, 3 %arrayidx43.3 = getelementptr inbounds i8, ptr %src, i64 %indvars.iv.next111.2 %112 = load i8, ptr %arrayidx43.3, align 1, !tbaa !5 %sext261 = shl i64 %indvars.iv110, 32 %idxprom45.3 = ashr exact i64 %sext261, 32 %arrayidx46.3 = getelementptr inbounds i8, ptr %dst, i64 %idxprom45.3 store i8 %112, ptr %arrayidx46.3, align 1, !tbaa !5 %indvars.iv.next111.3 = add nsw i64 %indvars.iv110, 4 %113 = trunc i64 %indvars.iv.next111.2 to i32 %lftr.wideiv113.3 = trunc i64 %indvars.iv.next111.3 to i32 %exitcond114.not.3 = icmp eq i32 %lftr.wideiv113.3, %srclen br i1 %exitcond114.not.3, label %for.end49, label %for.body41, !llvm.loop !29 for.end49: ; preds = %for.body41.prol.loopexit, %for.body41, %middle.block222, %for.cond39.preheader %m.3.in.lcssa = phi i32 [ %k, %for.cond39.preheader ], [ %ind.end230, %middle.block222 ], [ %.lcssa.unr, %for.body41.prol.loopexit ], [ %113, %for.body41 ] %sub50 = add nsw i32 %m.3.in.lcssa, -2 %idxprom51 = zext i32 %sub50 to i64 %arrayidx52 = getelementptr inbounds i8, ptr %dst, i64 %idxprom51 store i8 0, ptr %arrayidx52, align 1, !tbaa !5 ret void } ; Function Attrs: noreturn nounwind declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @is_seq(i8 noundef signext %c, i8 noundef signext %d, i8 noundef signext %e) local_unnamed_addr #5 { entry: %conv = sext i8 %c to i32 %add = add nsw i32 %conv, 2 %conv1 = sext i8 %d to i32 %add2 = add nsw i32 %conv1, 1 %cmp = icmp eq i32 %add, %add2 %conv6 = sext i8 %e to i32 %cmp7 = icmp eq i32 %add, %conv6 %or.cond = and i1 %cmp, %cmp7 br i1 %or.cond, label %lor.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %add12 = add nsw i32 %conv6, 1 %cmp13 = icmp eq i32 %add, %add12 %cmp19 = icmp eq i32 %add, %conv1 %or.cond92 = and i1 %cmp19, %cmp13 br i1 %or.cond92, label %lor.end, label %lor.lhs.false21 lor.lhs.false21: ; preds = %lor.lhs.false %add23 = add nsw i32 %conv1, 2 %add25 = add nsw i32 %conv, 1 %cmp26 = icmp eq i32 %add23, %add25 %cmp32 = icmp eq i32 %add23, %conv6 %or.cond93 = and i1 %cmp26, %cmp32 br i1 %or.cond93, label %lor.end, label %lor.lhs.false34 lor.lhs.false34: ; preds = %lor.lhs.false21 %cmp39 = icmp eq i32 %add23, %add12 %cmp45 = icmp eq i32 %add23, %conv %or.cond94 = and i1 %cmp45, %cmp39 br i1 %or.cond94, label %lor.end, label %lor.lhs.false47 lor.lhs.false47: ; preds = %lor.lhs.false34 %add49 = add nsw i32 %conv6, 2 %cmp52 = icmp eq i32 %add49, %add2 %cmp58 = icmp eq i32 %add49, %conv %or.cond95 = and i1 %cmp52, %cmp58 br i1 %or.cond95, label %lor.end, label %lor.rhs lor.rhs: ; preds = %lor.lhs.false47 %cmp64 = icmp eq i32 %add49, %add25 %cmp69 = icmp eq i32 %add49, %conv1 %0 = and i1 %cmp64, %cmp69 %1 = zext i1 %0 to i32 br label %lor.end lor.end: ; preds = %lor.lhs.false47, %lor.lhs.false34, %lor.lhs.false21, %lor.lhs.false, %entry, %lor.rhs %lor.ext = phi i32 [ %1, %lor.rhs ], [ 1, %entry ], [ 1, %lor.lhs.false ], [ 1, %lor.lhs.false21 ], [ 1, %lor.lhs.false34 ], [ 1, %lor.lhs.false47 ] ret i32 %lor.ext } ; Function Attrs: nounwind uwtable define dso_local i32 @check(ptr nocapture noundef readonly %buf, i32 noundef %len) local_unnamed_addr #3 { entry: %rest = alloca [14 x i8], align 1 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %rest) #9 %rem = srem i32 %len, 3 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %if.end, label %if.else if.else: ; preds = %entry tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 75, ptr noundef nonnull @__PRETTY_FUNCTION__.check) #10 unreachable if.end: ; preds = %entry %cmp = icmp eq i32 %len, 0 br i1 %cmp, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %cmp397 = icmp sgt i32 %len, 0 br i1 %cmp397, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %for.cond.preheader %sub = add nsw i32 %len, -3 %0 = zext i32 %len to i64 %wide.trip.count113 = zext i32 %len to i64 br label %for.body for.cond.loopexit: ; preds = %for.cond4.loopexit, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count113 br i1 %exitcond114.not, label %cleanup, label %for.body, !llvm.loop !30 for.body: ; preds = %for.body.lr.ph, %for.cond.loopexit %indvars.iv110 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next111, %for.cond.loopexit ] %indvars.iv105 = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next106, %for.cond.loopexit ] %indvars.iv = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond.loopexit ] %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %cmp595 = icmp ult i64 %indvars.iv.next111, %0 br i1 %cmp595, label %for.body6.lr.ph, label %for.cond.loopexit for.body6.lr.ph: ; preds = %for.body %arrayidx = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv110 %1 = trunc i64 %indvars.iv110 to i32 %2 = trunc i64 %indvars.iv110 to i32 br label %for.body6 for.cond4.loopexit: ; preds = %for.inc, %for.body6 %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %exitcond.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count113 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body6, !llvm.loop !31 for.body6: ; preds = %for.body6.lr.ph, %for.cond4.loopexit %indvars.iv107 = phi i64 [ %indvars.iv105, %for.body6.lr.ph ], [ %indvars.iv.next108, %for.cond4.loopexit ] %indvars.iv100 = phi i64 [ %indvars.iv, %for.body6.lr.ph ], [ %indvars.iv.next101, %for.cond4.loopexit ] %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %3 = trunc i64 %indvars.iv.next108 to i32 %cmp993 = icmp slt i32 %3, %len br i1 %cmp993, label %for.body10.lr.ph, label %for.cond4.loopexit for.body10.lr.ph: ; preds = %for.body6 %arrayidx12 = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv107 %4 = trunc i64 %indvars.iv107 to i32 %5 = trunc i64 %indvars.iv107 to i32 br label %for.body10 for.body10: ; preds = %for.body10.lr.ph, %for.inc %indvars.iv102 = phi i64 [ %indvars.iv100, %for.body10.lr.ph ], [ %indvars.iv.next103, %for.inc ] %6 = load i8, ptr %arrayidx, align 1, !tbaa !5 %7 = load i8, ptr %arrayidx12, align 1, !tbaa !5 %cmp14 = icmp eq i8 %6, %7 br i1 %cmp14, label %land.lhs.true, label %if.end29 land.lhs.true: ; preds = %for.body10 %arrayidx20 = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv102 %8 = load i8, ptr %arrayidx20, align 1, !tbaa !5 %cmp22 = icmp eq i8 %6, %8 br i1 %cmp22, label %if.then24, label %if.end29 if.then24: ; preds = %land.lhs.true %9 = trunc i64 %indvars.iv102 to i32 call void @make_rest(ptr noundef nonnull %buf, i32 noundef %len, ptr noundef nonnull %rest, i32 noundef %1, i32 noundef %4, i32 noundef %9) %call = call i32 @check(ptr noundef nonnull %rest, i32 noundef %sub), !range !32 %tobool26.not = icmp eq i32 %call, 0 br i1 %tobool26.not, label %if.then24.if.end29_crit_edge, label %cleanup if.then24.if.end29_crit_edge: ; preds = %if.then24 %.pre = load i8, ptr %arrayidx, align 1, !tbaa !5 %.pre115 = load i8, ptr %arrayidx12, align 1, !tbaa !5 br label %if.end29 if.end29: ; preds = %if.then24.if.end29_crit_edge, %land.lhs.true, %for.body10 %10 = phi i8 [ %.pre115, %if.then24.if.end29_crit_edge ], [ %6, %land.lhs.true ], [ %7, %for.body10 ] %11 = phi i8 [ %.pre, %if.then24.if.end29_crit_edge ], [ %6, %land.lhs.true ], [ %6, %for.body10 ] %arrayidx35 = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv102 %12 = load i8, ptr %arrayidx35, align 1, !tbaa !5 %conv.i = sext i8 %11 to i32 %add.i = add nsw i32 %conv.i, 2 %conv1.i = sext i8 %10 to i32 %add2.i = add nsw i32 %conv1.i, 1 %cmp.i = icmp eq i32 %add.i, %add2.i %conv6.i = sext i8 %12 to i32 %cmp7.i = icmp eq i32 %add.i, %conv6.i %or.cond.i = and i1 %cmp.i, %cmp7.i br i1 %or.cond.i, label %if.then38, label %lor.lhs.false.i lor.lhs.false.i: ; preds = %if.end29 %add12.i = add nsw i32 %conv6.i, 1 %cmp13.i = icmp eq i32 %add.i, %add12.i %cmp19.i = icmp eq i32 %add.i, %conv1.i %or.cond92.i = and i1 %cmp19.i, %cmp13.i br i1 %or.cond92.i, label %if.then38, label %lor.lhs.false21.i lor.lhs.false21.i: ; preds = %lor.lhs.false.i %add23.i = add nsw i32 %conv1.i, 2 %add25.i = add nsw i32 %conv.i, 1 %cmp26.i = icmp eq i32 %add23.i, %add25.i %cmp32.i = icmp eq i32 %add23.i, %conv6.i %or.cond93.i = and i1 %cmp26.i, %cmp32.i br i1 %or.cond93.i, label %if.then38, label %lor.lhs.false34.i lor.lhs.false34.i: ; preds = %lor.lhs.false21.i %cmp39.i = icmp eq i32 %add23.i, %add12.i %cmp45.i = icmp eq i32 %add23.i, %conv.i %or.cond94.i = and i1 %cmp45.i, %cmp39.i br i1 %or.cond94.i, label %if.then38, label %lor.lhs.false47.i lor.lhs.false47.i: ; preds = %lor.lhs.false34.i %add49.i = add nsw i32 %conv6.i, 2 %cmp52.i = icmp eq i32 %add49.i, %add2.i %cmp58.i = icmp eq i32 %add49.i, %conv.i %or.cond95.i = and i1 %cmp52.i, %cmp58.i br i1 %or.cond95.i, label %if.then38, label %is_seq.exit is_seq.exit: ; preds = %lor.lhs.false47.i %cmp64.i = icmp ne i32 %add49.i, %add25.i %cmp69.i = icmp ne i32 %add49.i, %conv1.i %.not = or i1 %cmp64.i, %cmp69.i br i1 %.not, label %for.inc, label %if.then38 if.then38: ; preds = %lor.lhs.false47.i, %lor.lhs.false34.i, %lor.lhs.false21.i, %lor.lhs.false.i, %if.end29, %is_seq.exit %13 = trunc i64 %indvars.iv102 to i32 call void @make_rest(ptr noundef nonnull %buf, i32 noundef %len, ptr noundef nonnull %rest, i32 noundef %2, i32 noundef %5, i32 noundef %13) %call42 = call i32 @check(ptr noundef nonnull %rest, i32 noundef %sub), !range !32 %tobool43.not = icmp eq i32 %call42, 0 br i1 %tobool43.not, label %for.inc, label %cleanup for.inc: ; preds = %is_seq.exit, %if.then38 %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %14 = trunc i64 %indvars.iv.next103 to i32 %cmp9 = icmp slt i32 %14, %len br i1 %cmp9, label %for.body10, label %for.cond4.loopexit, !llvm.loop !33 cleanup: ; preds = %for.cond.loopexit, %if.then38, %if.then24, %for.cond.preheader, %if.end %retval.0 = phi i32 [ 1, %if.end ], [ 0, %for.cond.preheader ], [ 1, %if.then24 ], [ 1, %if.then38 ], [ 0, %for.cond.loopexit ] call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %rest) #9 ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @is_complete(ptr nocapture noundef readonly %buf) local_unnamed_addr #3 { entry: %count.i = alloca [10 x i32], align 16 %rest = alloca [14 x i8], align 1 call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %rest) #9 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %count.i) #9 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %count.i, i8 0, i64 40, i1 false) %0 = load i8, ptr %buf, align 1, !tbaa !5 %tobool.not11.i = icmp eq i8 %0, 0 br i1 %tobool.not11.i, label %lessthan5times.exit.thread158, label %while.body.i lessthan5times.exit.thread158: ; preds = %entry call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count.i) #9 br label %for.cond.preheader for.cond.preheader.i: ; preds = %while.body.i %.pre.i = load i32, ptr %count.i, align 16, !tbaa !8 %1 = icmp sgt i32 %.pre.i, 4 %arrayidx3.1.i = getelementptr inbounds [10 x i32], ptr %count.i, i64 0, i64 1 %2 = load i32, ptr %arrayidx3.1.i, align 4 %cmp4.1.i = icmp sgt i32 %2, 4 %or.cond.i = select i1 %1, i1 true, i1 %cmp4.1.i br i1 %or.cond.i, label %lessthan5times.exit.thread, label %lessthan5times.exit while.body.i: ; preds = %entry, %while.body.i %3 = phi i8 [ %5, %while.body.i ], [ %0, %entry ] %buf.addr.012.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %buf, %entry ] %conv.i = sext i8 %3 to i64 %sub.i = add nsw i64 %conv.i, -49 %arrayidx.i = getelementptr inbounds [10 x i32], ptr %count.i, i64 0, i64 %sub.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !8 %add.i = add nsw i32 %4, 1 store i32 %add.i, ptr %arrayidx.i, align 4, !tbaa !8 %incdec.ptr.i = getelementptr inbounds i8, ptr %buf.addr.012.i, i64 1 %5 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !5 %tobool.not.i = icmp eq i8 %5, 0 br i1 %tobool.not.i, label %for.cond.preheader.i, label %while.body.i, !llvm.loop !10 lessthan5times.exit.thread: ; preds = %for.cond.preheader.i call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count.i) #9 br label %cleanup lessthan5times.exit: ; preds = %for.cond.preheader.i %arrayidx3.2.i.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %count.i, i64 0, i64 2 %6 = load <8 x i32>, ptr %arrayidx3.2.i.phi.trans.insert, align 8 %.fr = freeze <8 x i32> %6 %7 = icmp sgt <8 x i32> %.fr, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4> %8 = bitcast <8 x i1> %7 to i8 %.not = icmp eq i8 %8, 0 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count.i) #9 br i1 %.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %lessthan5times.exit.thread158, %lessthan5times.exit %arrayidx43 = getelementptr inbounds [14 x i8], ptr %rest, i64 0, i64 12 br label %for.body for.cond.loopexit: ; preds = %for.inc49.us, %for.inc49, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %indvars.iv.next146 = add nsw i64 %indvars.iv145, -1 %exitcond150.not = icmp eq i64 %11, 14 br i1 %exitcond150.not, label %cleanup, label %for.body, !llvm.loop !34 for.body: ; preds = %for.cond.preheader, %for.cond.loopexit %indvars.iv145 = phi i64 [ 13, %for.cond.preheader ], [ %indvars.iv.next146, %for.cond.loopexit ] %indvars.iv = phi i64 [ 1, %for.cond.preheader ], [ %indvars.iv.next, %for.cond.loopexit ] %indvar = phi i64 [ 0, %for.cond.preheader ], [ %11, %for.cond.loopexit ] %9 = add nuw nsw i64 %indvar, 2 %10 = sub nsw i64 11, %indvar %scevgep122 = getelementptr i8, ptr %rest, i64 %indvar %scevgep123 = getelementptr i8, ptr %buf, i64 %indvars.iv %11 = add nuw nsw i64 %indvar, 1 %scevgep100 = getelementptr i8, ptr %buf, i64 %11 %cmp292 = icmp ult i64 %indvar, 13 br i1 %cmp292, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %arrayidx = getelementptr inbounds i8, ptr %buf, i64 %indvar %cmp1186.not = icmp eq i64 %indvar, 0 br i1 %cmp1186.not, label %for.body3.preheader, label %for.body3.us.preheader for.body3.us.preheader: ; preds = %for.body3.lr.ph %12 = getelementptr i8, ptr %rest, i64 %indvar %13 = getelementptr i8, ptr %buf, i64 %9 br label %for.body3.us for.body3.preheader: ; preds = %for.body3.lr.ph %14 = getelementptr i8, ptr %buf, i64 %9 br label %for.body3 for.body3.us: ; preds = %for.body3.us.preheader, %for.inc49.us %indvars.iv111 = phi i64 [ %indvars.iv, %for.body3.us.preheader ], [ %indvars.iv.next112, %for.inc49.us ] %indvar107 = phi i64 [ 0, %for.body3.us.preheader ], [ %indvar.next108, %for.inc49.us ] %scevgep109 = getelementptr i8, ptr %12, i64 %indvar107 %scevgep110 = getelementptr i8, ptr %13, i64 %indvar107 %15 = sub i64 %10, %indvar107 %16 = and i64 %15, 4294967295 %17 = add nuw nsw i64 %16, 1 %18 = add nuw i64 %indvar107, 4294967295 %19 = and i64 %18, 4294967295 %20 = add nuw nsw i64 %19, 1 %21 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx5.us = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv111 %22 = load i8, ptr %arrayidx5.us, align 1, !tbaa !5 %cmp7.us = icmp eq i8 %21, %22 br i1 %cmp7.us, label %for.body13.us.preheader, label %for.inc49.us for.body13.us.preheader: ; preds = %for.body3.us call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %rest, ptr nonnull align 1 %buf, i64 %indvar, i1 false), !tbaa !5 %cmp2088.us = icmp ult i64 %11, %indvars.iv111 br i1 %cmp2088.us, label %for.body22.us.preheader, label %for.cond31.preheader.us for.end42.us: ; preds = %for.body34.us.preheader, %for.cond31.preheader.us store i8 0, ptr %arrayidx43, align 1, !tbaa !5 %call44.us = call i32 @check(ptr noundef nonnull %rest, i32 noundef 12), !range !32 %tobool45.not.us = icmp eq i32 %call44.us, 0 br i1 %tobool45.not.us, label %for.inc49.us, label %cleanup for.inc49.us: ; preds = %for.end42.us, %for.body3.us %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %indvar.next108 = add nuw nsw i64 %indvar107, 1 %exitcond.not = icmp eq i64 %indvar.next108, %indvars.iv145 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body3.us, !llvm.loop !35 for.cond31.preheader.us: ; preds = %for.body22.us.preheader, %for.body13.us.preheader %cmp3290.us = icmp ult i64 %indvars.iv111, 13 br i1 %cmp3290.us, label %for.body34.us.preheader, label %for.end42.us for.body34.us.preheader: ; preds = %for.cond31.preheader.us call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep109, ptr noundef nonnull align 1 dereferenceable(1) %scevgep110, i64 %17, i1 false), !tbaa !5 br label %for.end42.us for.body22.us.preheader: ; preds = %for.body13.us.preheader call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep122, ptr noundef nonnull align 1 dereferenceable(1) %scevgep100, i64 %20, i1 false), !tbaa !5 br label %for.cond31.preheader.us for.body3: ; preds = %for.body3.preheader, %for.inc49 %indvars.iv134 = phi i64 [ %indvars.iv, %for.body3.preheader ], [ %indvars.iv.next135, %for.inc49 ] %indvar130 = phi i64 [ 0, %for.body3.preheader ], [ %indvar.next131, %for.inc49 ] %scevgep132 = getelementptr i8, ptr %rest, i64 %indvar130 %scevgep133 = getelementptr i8, ptr %14, i64 %indvar130 %23 = sub i64 %10, %indvar130 %24 = and i64 %23, 4294967295 %25 = add nuw nsw i64 %24, 1 %26 = add nuw i64 %indvar130, 4294967295 %27 = and i64 %26, 4294967295 %28 = add nuw nsw i64 %27, 1 %29 = load i8, ptr %arrayidx, align 1, !tbaa !5 %arrayidx5 = getelementptr inbounds i8, ptr %buf, i64 %indvars.iv134 %30 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %29, %30 br i1 %cmp7, label %for.cond10.preheader, label %for.inc49 for.cond10.preheader: ; preds = %for.body3 %cmp2088 = icmp ult i64 %11, %indvars.iv134 br i1 %cmp2088, label %for.body22.preheader, label %for.cond31.preheader for.body22.preheader: ; preds = %for.cond10.preheader call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep122, ptr noundef nonnull align 1 dereferenceable(1) %scevgep123, i64 %28, i1 false), !tbaa !5 br label %for.cond31.preheader for.cond31.preheader: ; preds = %for.body22.preheader, %for.cond10.preheader %cmp3290 = icmp ult i64 %indvars.iv134, 13 br i1 %cmp3290, label %for.body34.preheader, label %for.end42 for.body34.preheader: ; preds = %for.cond31.preheader call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep132, ptr noundef nonnull align 1 dereferenceable(1) %scevgep133, i64 %25, i1 false), !tbaa !5 br label %for.end42 for.end42: ; preds = %for.body34.preheader, %for.cond31.preheader store i8 0, ptr %arrayidx43, align 1, !tbaa !5 %call44 = call i32 @check(ptr noundef nonnull %rest, i32 noundef 12), !range !32 %tobool45.not = icmp eq i32 %call44, 0 br i1 %tobool45.not, label %for.inc49, label %cleanup for.inc49: ; preds = %for.body3, %for.end42 %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1 %indvar.next131 = add nuw nsw i64 %indvar130, 1 %exitcond144.not = icmp eq i64 %indvar.next131, %indvars.iv145 br i1 %exitcond144.not, label %for.cond.loopexit, label %for.body3, !llvm.loop !35 cleanup: ; preds = %for.cond.loopexit, %for.end42.us, %for.end42, %lessthan5times.exit.thread, %lessthan5times.exit %retval.0 = phi i32 [ 0, %lessthan5times.exit ], [ 0, %lessthan5times.exit.thread ], [ 1, %for.end42 ], [ 1, %for.end42.us ], [ 0, %for.cond.loopexit ] call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %rest) #9 ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %buf = alloca [15 x i8], align 1 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %buf) #9 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %buf) %cmp29 = icmp eq i32 %call28, 1 br i1 %cmp29, label %for.cond.preheader.lr.ph, label %while.end for.cond.preheader.lr.ph: ; preds = %entry %arrayidx = getelementptr inbounds [15 x i8], ptr %buf, i64 0, i64 13 %arrayidx3 = getelementptr inbounds [15 x i8], ptr %buf, i64 0, i64 14 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %if.end18 store i8 49, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.not = icmp eq i32 %call5, 0 br i1 %tobool.not.not, label %for.inc, label %if.then7 if.then7: ; preds = %for.cond.preheader %putchar24 = call i32 @putchar(i32 49) br label %for.inc for.inc: ; preds = %for.cond.preheader, %if.then7 %first.1 = phi i32 [ 0, %if.then7 ], [ 1, %for.cond.preheader ] store i8 50, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.1 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.1 = icmp eq i32 %call5.1, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc br i1 %tobool.not.not, label %if.then7.1, label %if.else.1 if.then7.1: ; preds = %if.then.1 %putchar24.1 = call i32 @putchar(i32 50) br label %for.inc.1 if.else.1: ; preds = %if.then.1 %call11.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 50) br label %for.inc.1 for.inc.1: ; preds = %if.else.1, %if.then7.1, %for.inc %first.1.1 = phi i32 [ 0, %if.then7.1 ], [ 0, %if.else.1 ], [ %first.1, %for.inc ] store i8 51, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.2 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.2 = icmp eq i32 %call5.2, 0 br i1 %tobool.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 %tobool6.not.2 = icmp eq i32 %first.1.1, 0 br i1 %tobool6.not.2, label %if.else.2, label %if.then7.2 if.then7.2: ; preds = %if.then.2 %putchar24.2 = call i32 @putchar(i32 51) br label %for.inc.2 if.else.2: ; preds = %if.then.2 %call11.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 51) br label %for.inc.2 for.inc.2: ; preds = %if.else.2, %if.then7.2, %for.inc.1 %first.1.2 = phi i32 [ 0, %if.then7.2 ], [ 0, %if.else.2 ], [ %first.1.1, %for.inc.1 ] store i8 52, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.3 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.3 = icmp eq i32 %call5.3, 0 br i1 %tobool.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 %tobool6.not.3 = icmp eq i32 %first.1.2, 0 br i1 %tobool6.not.3, label %if.else.3, label %if.then7.3 if.then7.3: ; preds = %if.then.3 %putchar24.3 = call i32 @putchar(i32 52) br label %for.inc.3 if.else.3: ; preds = %if.then.3 %call11.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 52) br label %for.inc.3 for.inc.3: ; preds = %if.else.3, %if.then7.3, %for.inc.2 %first.1.3 = phi i32 [ 0, %if.then7.3 ], [ 0, %if.else.3 ], [ %first.1.2, %for.inc.2 ] store i8 53, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.4 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.4 = icmp eq i32 %call5.4, 0 br i1 %tobool.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 %tobool6.not.4 = icmp eq i32 %first.1.3, 0 br i1 %tobool6.not.4, label %if.else.4, label %if.then7.4 if.then7.4: ; preds = %if.then.4 %putchar24.4 = call i32 @putchar(i32 53) br label %for.inc.4 if.else.4: ; preds = %if.then.4 %call11.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 53) br label %for.inc.4 for.inc.4: ; preds = %if.else.4, %if.then7.4, %for.inc.3 %first.1.4 = phi i32 [ 0, %if.then7.4 ], [ 0, %if.else.4 ], [ %first.1.3, %for.inc.3 ] store i8 54, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.5 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.5 = icmp eq i32 %call5.5, 0 br i1 %tobool.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 %tobool6.not.5 = icmp eq i32 %first.1.4, 0 br i1 %tobool6.not.5, label %if.else.5, label %if.then7.5 if.then7.5: ; preds = %if.then.5 %putchar24.5 = call i32 @putchar(i32 54) br label %for.inc.5 if.else.5: ; preds = %if.then.5 %call11.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 54) br label %for.inc.5 for.inc.5: ; preds = %if.else.5, %if.then7.5, %for.inc.4 %first.1.5 = phi i32 [ 0, %if.then7.5 ], [ 0, %if.else.5 ], [ %first.1.4, %for.inc.4 ] store i8 55, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.6 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.6 = icmp eq i32 %call5.6, 0 br i1 %tobool.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 %tobool6.not.6 = icmp eq i32 %first.1.5, 0 br i1 %tobool6.not.6, label %if.else.6, label %if.then7.6 if.then7.6: ; preds = %if.then.6 %putchar24.6 = call i32 @putchar(i32 55) br label %for.inc.6 if.else.6: ; preds = %if.then.6 %call11.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 55) br label %for.inc.6 for.inc.6: ; preds = %if.else.6, %if.then7.6, %for.inc.5 %first.1.6 = phi i32 [ 0, %if.then7.6 ], [ 0, %if.else.6 ], [ %first.1.5, %for.inc.5 ] store i8 56, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.7 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.7 = icmp eq i32 %call5.7, 0 br i1 %tobool.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 %tobool6.not.7 = icmp eq i32 %first.1.6, 0 br i1 %tobool6.not.7, label %if.else.7, label %if.then7.7 if.then7.7: ; preds = %if.then.7 %putchar24.7 = call i32 @putchar(i32 56) br label %for.inc.7 if.else.7: ; preds = %if.then.7 %call11.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 56) br label %for.inc.7 for.inc.7: ; preds = %if.else.7, %if.then7.7, %for.inc.6 %first.1.7 = phi i32 [ 0, %if.then7.7 ], [ 0, %if.else.7 ], [ %first.1.6, %for.inc.6 ] store i8 57, ptr %arrayidx, align 1, !tbaa !5 store i8 0, ptr %arrayidx3, align 1, !tbaa !5 %call5.8 = call i32 @is_complete(ptr noundef nonnull %buf), !range !32 %tobool.not.8 = icmp eq i32 %call5.8, 0 %tobool13.not = icmp eq i32 %first.1.7, 0 br i1 %tobool.not.8, label %for.inc.8, label %if.then.8 if.then.8: ; preds = %for.inc.7 br i1 %tobool13.not, label %if.else.8, label %if.then7.8 if.then7.8: ; preds = %if.then.8 %putchar24.8 = call i32 @putchar(i32 57) br label %if.else16 if.else.8: ; preds = %if.then.8 %call11.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef 57) br label %if.else16 for.inc.8: ; preds = %for.inc.7 br i1 %tobool13.not, label %if.else16, label %if.then14 if.then14: ; preds = %for.inc.8 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end18 if.else16: ; preds = %if.else.8, %if.then7.8, %for.inc.8 %putchar = call i32 @putchar(i32 10) br label %if.end18 if.end18: ; preds = %if.else16, %if.then14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %buf) %cmp = icmp eq i32 %call, 1 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !36 while.end: ; preds = %if.end18, %entry call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %buf) #9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 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 nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { nounwind } attributes #10 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !13, !14} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !11, !13, !14} !19 = distinct !{!19, !11, !13, !14} !20 = distinct !{!20, !17} !21 = distinct !{!21, !11, !13} !22 = distinct !{!22, !11, !13, !14} !23 = distinct !{!23, !11, !13, !14} !24 = distinct !{!24, !17} !25 = distinct !{!25, !11, !13} !26 = distinct !{!26, !11, !13, !14} !27 = distinct !{!27, !17} !28 = distinct !{!28, !11, !13} !29 = distinct !{!29, !11, !13} !30 = distinct !{!30, !11} !31 = distinct !{!31, !11} !32 = !{i32 0, i32 2} !33 = distinct !{!33, !11} !34 = distinct !{!34, !11} !35 = distinct !{!35, !11} !36 = distinct !{!36, !11}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int descending_compare(const void *a, const void *b){ if (*(int*)a > *(int*)b){ return -1; }else if (*(int*)a == *(int*)b){ return 0; }else{ return 1; } } int ascending_compare(const void *a, const void *b){ if (*(int*)a < *(int*)b){ return -1; }else if (*(int*)a == *(int*)b){ return 0; }else{ return 1; } } int lower_bound(int *a, int n, int key){ int left, mid, right; left = 0, right = n; mid = (left + right)/2; while ((left+1 != mid || mid+1 != right) && mid != left){ if (key > a[mid]){ left = mid; }else{ right = mid+1; } mid = (left + right)/2; } if (a[left] >= key)return left; if (a[mid] >= key)return mid; if (a[right] >= key)return right; return n; } int a[100005]; int b[100005]; int c[100005]; int main(void){ int n; int i; unsigned long long answer = 0; int ai, ci; scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d", &a[i]); } for (i = 0; i < n; i++){ scanf("%d", &b[i]); } for (i = 0; i < n; i++){ scanf("%d", &c[i]); } qsort(a, n, sizeof(int), ascending_compare); qsort(b, n, sizeof(int), ascending_compare); qsort(c, n, sizeof(int), ascending_compare); for (i = 0; i < n; i++){ ai = lower_bound(a, n, b[i]); ci = lower_bound(c, n, b[i]+1); answer += (unsigned long long)(ai)*(n-ci); } printf("%lld\n", answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332323/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [100005 x i32] zeroinitializer, align 16 @b = dso_local global [100005 x i32] zeroinitializer, align 16 @c = dso_local global [100005 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @descending_compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %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 @ascending_compare(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 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: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %n, i32 noundef %key) local_unnamed_addr #1 { entry: %mid.050 = sdiv i32 %n, 2 %0 = and i32 %n, -2 %cmp.not51 = icmp eq i32 %0, 2 %add252 = add nsw i32 %mid.050, 1 %cmp3.not53 = icmp eq i32 %add252, %n %or.cond54 = select i1 %cmp.not51, i1 %cmp3.not53, i1 false %n.off = add i32 %n, 1 %cmp4.not55 = icmp ult i32 %n.off, 3 %or.cond4956 = or i1 %cmp4.not55, %or.cond54 br i1 %or.cond4956, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %add260 = phi i32 [ %add2, %while.body ], [ %add252, %entry ] %mid.059 = phi i32 [ %mid.0, %while.body ], [ %mid.050, %entry ] %right.058 = phi i32 [ %right.1, %while.body ], [ %n, %entry ] %left.057 = phi i32 [ %left.1, %while.body ], [ 0, %entry ] %idxprom = sext i32 %mid.059 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp5 = icmp slt i32 %1, %key %left.1 = select i1 %cmp5, i32 %mid.059, i32 %left.057 %right.1 = select i1 %cmp5, i32 %right.058, i32 %add260 %add7 = add nsw i32 %left.1, %right.1 %mid.0 = sdiv i32 %add7, 2 %add1 = add nsw i32 %left.1, 1 %cmp.not = icmp eq i32 %add1, %mid.0 %add2 = add nsw i32 %mid.0, 1 %cmp3.not = icmp eq i32 %add2, %right.1 %or.cond = select i1 %cmp.not, i1 %cmp3.not, i1 false %cmp4.not = icmp eq i32 %mid.0, %left.1 %or.cond49 = or i1 %cmp4.not, %or.cond br i1 %or.cond49, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %left.0.lcssa = phi i32 [ 0, %entry ], [ %left.1, %while.body ] %right.0.lcssa = phi i32 [ %n, %entry ], [ %right.1, %while.body ] %mid.0.lcssa = phi i32 [ %mid.050, %entry ], [ %mid.0, %while.body ] %idxprom9 = sext i32 %left.0.lcssa to i64 %arrayidx10 = getelementptr inbounds i32, ptr %a, i64 %idxprom9 %2 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11.not = icmp slt i32 %2, %key br i1 %cmp11.not, label %if.end13, label %cleanup if.end13: ; preds = %while.end %idxprom14 = sext i32 %mid.0.lcssa to i64 %arrayidx15 = getelementptr inbounds i32, ptr %a, i64 %idxprom14 %3 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16.not = icmp slt i32 %3, %key br i1 %cmp16.not, label %if.end18, label %cleanup if.end18: ; preds = %if.end13 %idxprom19 = sext i32 %right.0.lcssa to i64 %arrayidx20 = getelementptr inbounds i32, ptr %a, i64 %idxprom19 %4 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21.not = icmp slt i32 %4, %key %n.right.0 = select i1 %cmp21.not, i32 %n, i32 %right.0.lcssa br label %cleanup cleanup: ; preds = %if.end18, %if.end13, %while.end %retval.0 = phi i32 [ %left.0.lcssa, %while.end ], [ %mid.0.lcssa, %if.end13 ], [ %n.right.0, %if.end18 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp98 = icmp sgt i32 %0, 0 br i1 %cmp98, label %for.body, label %for.cond11.preheader.for.end19_crit_edge for.cond2.preheader: ; preds = %for.body %cmp3100 = icmp sgt i32 %1, 0 br i1 %cmp3100, label %for.body4, label %for.cond11.preheader.for.end19_crit_edge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11 for.cond11.preheader: ; preds = %for.body4 %cmp12102 = icmp sgt i32 %4, 0 br i1 %cmp12102, label %for.body13, label %for.cond11.preheader.for.end19_crit_edge for.cond11.preheader.for.end19_crit_edge: ; preds = %entry, %for.cond2.preheader, %for.cond11.preheader %3 = phi i32 [ %4, %for.cond11.preheader ], [ %1, %for.cond2.preheader ], [ %0, %entry ] %.pre = sext i32 %3 to i64 br label %for.end19 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv110 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp3 = icmp slt i64 %indvars.iv.next111, %5 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !12 for.body13: ; preds = %for.cond11.preheader, %for.body13 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.body13 ], [ 0, %for.cond11.preheader ] %arrayidx15 = getelementptr inbounds [100005 x i32], ptr @c, i64 0, i64 %indvars.iv113 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15) %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp12 = icmp slt i64 %indvars.iv.next114, %7 br i1 %cmp12, label %for.body13, label %for.end19, !llvm.loop !13 for.end19: ; preds = %for.body13, %for.cond11.preheader.for.end19_crit_edge %conv.pre-phi = phi i64 [ %.pre, %for.cond11.preheader.for.end19_crit_edge ], [ %7, %for.body13 ] call void @qsort(ptr noundef nonnull @a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @ascending_compare) #6 %8 = load i32, ptr %n, align 4, !tbaa !5 %conv20 = sext i32 %8 to i64 call void @qsort(ptr noundef nonnull @b, i64 noundef %conv20, i64 noundef 4, ptr noundef nonnull @ascending_compare) #6 %9 = load i32, ptr %n, align 4, !tbaa !5 %conv21 = sext i32 %9 to i64 call void @qsort(ptr noundef nonnull @c, i64 noundef %conv21, i64 noundef 4, ptr noundef nonnull @ascending_compare) #6 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp23104 = icmp sgt i32 %10, 0 br i1 %cmp23104, label %for.body25.lr.ph, label %for.end37 for.body25.lr.ph: ; preds = %for.end19 %mid.050.i121124 = lshr i32 %10, 1 %11 = and i32 %10, -2 %cmp.not51.i = icmp eq i32 %11, 2 %add252.i = add nuw nsw i32 %mid.050.i121124, 1 %cmp3.not53.i = icmp eq i32 %add252.i, %10 %or.cond54.i = select i1 %cmp.not51.i, i1 %cmp3.not53.i, i1 false %cmp4.not55.i = icmp eq i32 %10, 1 %or.cond4956.i = or i1 %cmp4.not55.i, %or.cond54.i %wide.trip.count = zext i32 %10 to i64 br label %for.body25 for.body25: ; preds = %for.body25.lr.ph, %lower_bound.exit97 %indvars.iv116 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next117, %lower_bound.exit97 ] %answer.0105 = phi i64 [ 0, %for.body25.lr.ph ], [ %add34, %lower_bound.exit97 ] %arrayidx27 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv116 %12 = load i32, ptr %arrayidx27, align 4, !tbaa !5 br i1 %or.cond4956.i, label %while.end.i, label %while.body.i while.body.i: ; preds = %for.body25, %while.body.i %add260.i = phi i32 [ %add2.i, %while.body.i ], [ %add252.i, %for.body25 ] %mid.059.i = phi i32 [ %mid.0.i, %while.body.i ], [ %mid.050.i121124, %for.body25 ] %right.058.i = phi i32 [ %right.1.i, %while.body.i ], [ %10, %for.body25 ] %left.057.i = phi i32 [ %left.1.i, %while.body.i ], [ 0, %for.body25 ] %idxprom.i = sext i32 %mid.059.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr @a, i64 %idxprom.i %13 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp5.i = icmp slt i32 %13, %12 %left.1.i = select i1 %cmp5.i, i32 %mid.059.i, i32 %left.057.i %right.1.i = select i1 %cmp5.i, i32 %right.058.i, i32 %add260.i %add7.i = add nsw i32 %left.1.i, %right.1.i %mid.0.i = sdiv i32 %add7.i, 2 %add1.i = add nsw i32 %left.1.i, 1 %cmp.not.i = icmp eq i32 %add1.i, %mid.0.i %add2.i = add nsw i32 %mid.0.i, 1 %cmp3.not.i = icmp eq i32 %add2.i, %right.1.i %or.cond.i = select i1 %cmp.not.i, i1 %cmp3.not.i, i1 false %cmp4.not.i = icmp eq i32 %mid.0.i, %left.1.i %or.cond49.i = or i1 %cmp4.not.i, %or.cond.i br i1 %or.cond49.i, label %while.end.i, label %while.body.i, !llvm.loop !9 while.end.i: ; preds = %while.body.i, %for.body25 %left.0.lcssa.i = phi i32 [ 0, %for.body25 ], [ %left.1.i, %while.body.i ] %right.0.lcssa.i = phi i32 [ %10, %for.body25 ], [ %right.1.i, %while.body.i ] %mid.0.lcssa.i = phi i32 [ %mid.050.i121124, %for.body25 ], [ %mid.0.i, %while.body.i ] %idxprom9.i = sext i32 %left.0.lcssa.i to i64 %arrayidx10.i = getelementptr inbounds i32, ptr @a, i64 %idxprom9.i %14 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %cmp11.not.i = icmp slt i32 %14, %12 br i1 %cmp11.not.i, label %if.end13.i, label %lower_bound.exit if.end13.i: ; preds = %while.end.i %idxprom14.i = sext i32 %mid.0.lcssa.i to i64 %arrayidx15.i = getelementptr inbounds i32, ptr @a, i64 %idxprom14.i %15 = load i32, ptr %arrayidx15.i, align 4, !tbaa !5 %cmp16.not.i = icmp slt i32 %15, %12 br i1 %cmp16.not.i, label %if.end18.i, label %lower_bound.exit if.end18.i: ; preds = %if.end13.i %idxprom19.i = sext i32 %right.0.lcssa.i to i64 %arrayidx20.i = getelementptr inbounds i32, ptr @a, i64 %idxprom19.i %16 = load i32, ptr %arrayidx20.i, align 4, !tbaa !5 %cmp21.not.i = icmp slt i32 %16, %12 %n.right.0.i = select i1 %cmp21.not.i, i32 %10, i32 %right.0.lcssa.i br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %if.end13.i, %if.end18.i %retval.0.i = phi i32 [ %left.0.lcssa.i, %while.end.i ], [ %mid.0.lcssa.i, %if.end13.i ], [ %n.right.0.i, %if.end18.i ] br i1 %or.cond4956.i, label %while.end.i80, label %while.body.i61 while.body.i61: ; preds = %lower_bound.exit, %while.body.i61 %add260.i62 = phi i32 [ %add2.i75, %while.body.i61 ], [ %add252.i, %lower_bound.exit ] %mid.059.i63 = phi i32 [ %mid.0.i72, %while.body.i61 ], [ %mid.050.i121124, %lower_bound.exit ] %right.058.i64 = phi i32 [ %right.1.i70, %while.body.i61 ], [ %10, %lower_bound.exit ] %left.057.i65 = phi i32 [ %left.1.i69, %while.body.i61 ], [ 0, %lower_bound.exit ] %idxprom.i66 = sext i32 %mid.059.i63 to i64 %arrayidx.i67 = getelementptr inbounds i32, ptr @c, i64 %idxprom.i66 %17 = load i32, ptr %arrayidx.i67, align 4, !tbaa !5 %cmp5.i68.not = icmp sgt i32 %17, %12 %left.1.i69 = select i1 %cmp5.i68.not, i32 %left.057.i65, i32 %mid.059.i63 %right.1.i70 = select i1 %cmp5.i68.not, i32 %add260.i62, i32 %right.058.i64 %add7.i71 = add nsw i32 %left.1.i69, %right.1.i70 %mid.0.i72 = sdiv i32 %add7.i71, 2 %add1.i73 = add nsw i32 %left.1.i69, 1 %cmp.not.i74 = icmp eq i32 %add1.i73, %mid.0.i72 %add2.i75 = add nsw i32 %mid.0.i72, 1 %cmp3.not.i76 = icmp eq i32 %add2.i75, %right.1.i70 %or.cond.i77 = select i1 %cmp.not.i74, i1 %cmp3.not.i76, i1 false %cmp4.not.i78 = icmp eq i32 %mid.0.i72, %left.1.i69 %or.cond49.i79 = or i1 %cmp4.not.i78, %or.cond.i77 br i1 %or.cond49.i79, label %while.end.i80, label %while.body.i61, !llvm.loop !9 while.end.i80: ; preds = %while.body.i61, %lower_bound.exit %left.0.lcssa.i81 = phi i32 [ 0, %lower_bound.exit ], [ %left.1.i69, %while.body.i61 ] %right.0.lcssa.i82 = phi i32 [ %10, %lower_bound.exit ], [ %right.1.i70, %while.body.i61 ] %mid.0.lcssa.i83 = phi i32 [ %mid.050.i121124, %lower_bound.exit ], [ %mid.0.i72, %while.body.i61 ] %idxprom9.i84 = sext i32 %left.0.lcssa.i81 to i64 %arrayidx10.i85 = getelementptr inbounds i32, ptr @c, i64 %idxprom9.i84 %18 = load i32, ptr %arrayidx10.i85, align 4, !tbaa !5 %cmp11.not.i86.not = icmp sgt i32 %18, %12 br i1 %cmp11.not.i86.not, label %lower_bound.exit97, label %if.end13.i88 if.end13.i88: ; preds = %while.end.i80 %idxprom14.i89 = sext i32 %mid.0.lcssa.i83 to i64 %arrayidx15.i90 = getelementptr inbounds i32, ptr @c, i64 %idxprom14.i89 %19 = load i32, ptr %arrayidx15.i90, align 4, !tbaa !5 %cmp16.not.i91.not = icmp sgt i32 %19, %12 br i1 %cmp16.not.i91.not, label %lower_bound.exit97, label %if.end18.i92 if.end18.i92: ; preds = %if.end13.i88 %idxprom19.i93 = sext i32 %right.0.lcssa.i82 to i64 %arrayidx20.i94 = getelementptr inbounds i32, ptr @c, i64 %idxprom19.i93 %20 = load i32, ptr %arrayidx20.i94, align 4, !tbaa !5 %cmp21.not.i95.not = icmp sgt i32 %20, %12 %n.right.0.i96 = select i1 %cmp21.not.i95.not, i32 %right.0.lcssa.i82, i32 %10 br label %lower_bound.exit97 lower_bound.exit97: ; preds = %while.end.i80, %if.end13.i88, %if.end18.i92 %retval.0.i87 = phi i32 [ %left.0.lcssa.i81, %while.end.i80 ], [ %mid.0.lcssa.i83, %if.end13.i88 ], [ %n.right.0.i96, %if.end18.i92 ] %conv32 = sext i32 %retval.0.i to i64 %sub = sub nsw i32 %10, %retval.0.i87 %conv33 = sext i32 %sub to i64 %mul = mul nsw i64 %conv33, %conv32 %add34 = add i64 %mul, %answer.0105 %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1 %exitcond.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count br i1 %exitcond.not, label %for.end37, label %for.body25, !llvm.loop !14 for.end37: ; preds = %lower_bound.exit97, %for.end19 %answer.0.lcssa = phi i64 [ 0, %for.end19 ], [ %add34, %lower_bound.exit97 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %answer.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> #include<string.h> int main(){ int i,len,check=0; char s[101]; scanf("%s",&s); len=strlen(s); for(i=0;i<len;i++){ if(s[i]=='L' && i%2==0) check=1; else if(s[i]=='R' && i%2==1) check=1; } if(check==1) printf("No\n"); else printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332374/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332374/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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 [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call1 to i32 %cmp33 = icmp sgt i32 %conv, 0 br i1 %cmp33, label %for.body.preheader, label %if.else23 for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call1, 4294967295 %xtraiter = and i64 %call1, 1 %0 = icmp eq i64 %wide.trip.count, 1 br i1 %0, label %for.end.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %check.035 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp4 = icmp eq i8 %1, 76 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp11.1.not = icmp eq i8 %2, 82 %3 = select i1 %cmp11.1.not, i1 true, i1 %cmp4 %spec.select.1 = select i1 %3, i32 1, i32 %check.035 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body, !llvm.loop !8 for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader %check.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %check.035.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.unr-lcssa %arrayidx.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %4 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %cmp4.epil = icmp eq i8 %4, 76 %rem37.epil = and i64 %indvars.iv.unr, 1 %cmp6.epil = icmp eq i64 %rem37.epil, 0 %or.cond.epil = and i1 %cmp6.epil, %cmp4.epil %cmp11.epil = icmp ne i8 %4, 82 %or.cond32.epil = or i1 %cmp6.epil, %cmp11.epil %spec.select.epil = select i1 %or.cond32.epil, i32 %check.035.unr, i32 1 %check.1.epil = select i1 %or.cond.epil, i32 1, i32 %spec.select.epil br label %for.end for.end: ; preds = %for.end.unr-lcssa, %for.body.epil %check.1.lcssa = phi i32 [ %check.1.lcssa.ph, %for.end.unr-lcssa ], [ %check.1.epil, %for.body.epil ] %5 = icmp eq i32 %check.1.lcssa, 1 br i1 %5, label %if.end25, label %if.else23 if.else23: ; preds = %entry, %for.end br label %if.end25 if.end25: ; preds = %for.end, %if.else23 %str.sink = phi ptr [ @str, %if.else23 ], [ @str.3, %for.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 101, 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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main() { char tap[128]; int i=0; int len; int count=0; scanf("%s",tap); len=strlen(tap); for(i=0;i<len;i++) { if(count%2==0) { if(tap[i]=='L') { printf("No\n"); return 0; } } else if(count%2==1) { if(tap[i]=='R') { printf("No\n"); return 0; } } count++; } printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332424/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332424/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %tap = alloca [128 x i8], align 16 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %tap) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tap) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %tap) #6 %conv = trunc i64 %call2 to i32 %cmp37 = icmp sgt i32 %conv, 0 br i1 %cmp37, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %if.end24 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %if.end24 ] %rem43 = and i64 %indvars.iv, 1 %cmp4 = icmp eq i64 %rem43, 0 %arrayidx = getelementptr inbounds [128 x i8], ptr %tap, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 br i1 %cmp4, label %if.then, label %if.then14 if.then: ; preds = %for.body %cmp7 = icmp eq i8 %0, 76 br i1 %cmp7, label %cleanup, label %if.end24 if.then14: ; preds = %for.body %cmp18 = icmp eq i8 %0, 82 br i1 %cmp18, label %cleanup, label %if.end24 if.end24: ; preds = %if.then14, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8 cleanup: ; preds = %if.end24, %if.then14, %if.then, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.4, %if.then ], [ @str.4, %if.then14 ], [ @str, %if.end24 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %tap) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { char str[101]; int flag=0; scanf("%s",str); for(int i=0;str[i]!='\0';i+=2) { if(str[i]=='L') flag++; } for(int i=1;str[i]!='\0';i+=2) { if(str[i]=='R') flag++; } if(flag==0) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332468/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332468/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %str = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) br label %for.cond for.cond: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %flag.0 = phi i32 [ %flag.1, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 2, !tbaa !5 switch i8 %0, label %for.inc [ i8 0, label %for.cond8 i8 76, label %if.then ] if.then: ; preds = %for.cond %inc = add nsw i32 %flag.0, 1 br label %for.inc for.inc: ; preds = %for.cond, %if.then %flag.1 = phi i32 [ %inc, %if.then ], [ %flag.0, %for.cond ] %indvars.iv.next = add nuw i64 %indvars.iv, 2 br label %for.cond, !llvm.loop !8 for.cond8: ; preds = %for.cond, %for.inc24 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.inc24 ], [ 1, %for.cond ] %flag.2 = phi i32 [ %flag.3, %for.inc24 ], [ %flag.0, %for.cond ] %arrayidx10 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %indvars.iv40 %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 switch i8 %1, label %for.inc24 [ i8 0, label %for.cond.cleanup14 i8 82, label %if.then21 ] for.cond.cleanup14: ; preds = %for.cond8 %cmp27 = icmp eq i32 %flag.2, 0 %.str.1..str.2 = select i1 %cmp27, ptr @.str.1, ptr @.str.2 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str) #3 ret i32 0 if.then21: ; preds = %for.cond8 %inc22 = add nsw i32 %flag.2, 1 br label %for.inc24 for.inc24: ; preds = %for.cond8, %if.then21 %flag.3 = phi i32 [ %inc22, %if.then21 ], [ %flag.2, %for.cond8 ] %indvars.iv.next41 = add nuw i64 %indvars.iv40, 2 br label %for.cond8, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> int main(void) { char S[100]; int check=1, i; scanf("%s", S); for(i=0; S[i] != '\0'; i++){ if(i % 2 == 0){ //奇数文字目 if(S[i]!='R' && S[i]!='U' && S[i]!='D'){ check = 0; } } else{ if(S[i]!='L' && S[i]!='U' && S[i]!='D'){ check = 0; } } } if(check == 1){ printf("Yes"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332510/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332510/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 16, !tbaa !5 %cmp.not56 = icmp eq i8 %0, 0 br i1 %cmp.not56, label %if.end47, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %1 = phi i8 [ %2, %for.inc ], [ %0, %entry ] %check.057 = phi i32 [ %check.1, %for.inc ], [ 1, %entry ] %rem59 = and i64 %indvars.iv, 1 %cmp2 = icmp eq i64 %rem59, 0 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body switch i8 %1, label %if.then20 [ i8 82, label %for.inc i8 85, label %for.inc i8 68, label %for.inc ] if.then20: ; preds = %if.then br label %for.inc if.else: ; preds = %for.body switch i8 %1, label %if.then38 [ i8 76, label %for.inc i8 85, label %for.inc i8 68, label %for.inc ] if.then38: ; preds = %if.else br label %for.inc for.inc: ; preds = %if.else, %if.else, %if.else, %if.then, %if.then, %if.then, %if.then20, %if.then38 %check.1 = phi i32 [ 0, %if.then20 ], [ %check.057, %if.then ], [ 0, %if.then38 ], [ %check.057, %if.else ], [ %check.057, %if.then ], [ %check.057, %if.then ], [ %check.057, %if.else ], [ %check.057, %if.else ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.inc %3 = icmp eq i32 %check.1, 1 %spec.select = select i1 %3, ptr @.str.1, ptr @.str.2 br label %if.end47 if.end47: ; preds = %for.end, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %for.end ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ char S[101]; int n; int flg = 1; int i=0; scanf("%s",S); n = (unsigned)(sizeof(S)/sizeof(S[0])); //printf("%d",n); while(S[i]!=NULL){ //for(int i=0; i<n; i++){ if(i%2 ==0){ if(S[i]!='R' && S[i]!='U' && S[i]!='D')flg = 0; }else if(i%2 ==1){ if(S[i]!='L' && S[i]!='U' && S[i]!='D')flg = 0; } i++; } if(flg==1){ printf("Yes"); }else{ printf("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332561/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332561/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 16, !tbaa !5 %cmp.not62 = icmp eq i8 %0, 0 br i1 %cmp.not62, label %if.end52, label %while.body while.body: ; preds = %entry, %if.end45 %indvars.iv = phi i64 [ %indvars.iv.next, %if.end45 ], [ 0, %entry ] %1 = phi i8 [ %2, %if.end45 ], [ %0, %entry ] %flg.063 = phi i32 [ %flg.1, %if.end45 ], [ 1, %entry ] %rem65 = and i64 %indvars.iv, 1 %cmp2 = icmp eq i64 %rem65, 0 br i1 %cmp2, label %if.then, label %if.then24 if.then: ; preds = %while.body switch i8 %1, label %if.then20 [ i8 82, label %if.end45 i8 85, label %if.end45 i8 68, label %if.end45 ] if.then20: ; preds = %if.then br label %if.end45 if.then24: ; preds = %while.body switch i8 %1, label %if.then42 [ i8 76, label %if.end45 i8 85, label %if.end45 i8 68, label %if.end45 ] if.then42: ; preds = %if.then24 br label %if.end45 if.end45: ; preds = %if.then24, %if.then24, %if.then24, %if.then, %if.then, %if.then, %if.then42, %if.then20 %flg.1 = phi i32 [ 0, %if.then20 ], [ %flg.063, %if.then ], [ 0, %if.then42 ], [ %flg.063, %if.then24 ], [ %flg.063, %if.then ], [ %flg.063, %if.then ], [ %flg.063, %if.then24 ], [ %flg.063, %if.then24 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %if.end45 %3 = icmp eq i32 %flg.1, 1 %spec.select = select i1 %3, ptr @.str.1, ptr @.str.2 br label %if.end52 if.end52: ; preds = %while.end, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %while.end ] %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { char s[101]; int check = 0; scanf("%s", s); int i; for(i = 1; s[i]; i += 2){ if(s[i] == 'R'){ check = 1; break; } } for(i = 0; s[i]; i += 2){ if(s[i] == 'L'){ check = 1; break; } } if(check == 1){ printf("No"); } else{ printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332611/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332611/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %for.inc [ i8 0, label %for.end.loopexit i8 82, label %for.end ] for.inc: ; preds = %for.cond %indvars.iv.next = add nuw i64 %indvars.iv, 2 br label %for.cond, !llvm.loop !8 for.end.loopexit: ; preds = %for.cond br label %for.end for.end: ; preds = %for.cond, %for.end.loopexit %cmp19 = phi ptr [ @.str.2, %for.end.loopexit ], [ @.str.1, %for.cond ] br label %for.cond4 for.cond4: ; preds = %for.inc16, %for.end %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.inc16 ], [ 0, %for.end ] %arrayidx6 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv35 %1 = load i8, ptr %arrayidx6, align 2, !tbaa !5 switch i8 %1, label %for.inc16 [ i8 0, label %if.end24.loopexit39 i8 76, label %if.end24 ] for.inc16: ; preds = %for.cond4 %indvars.iv.next36 = add nuw i64 %indvars.iv35, 2 br label %for.cond4, !llvm.loop !10 if.end24.loopexit39: ; preds = %for.cond4 br label %if.end24 if.end24: ; preds = %for.cond4, %if.end24.loopexit39 %.str.2.sink = phi ptr [ %cmp19, %if.end24.loopexit39 ], [ @.str.1, %for.cond4 ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char step[101]; int i; scanf("%s", step); for (i=0; i<strlen(step); i++) { if (i%2==1) { if (step[i]!='L' && step[i]!='U' && step[i]!='D') { printf("No\n"); return 0; } } else { if (step[i]!='R' && step[i]!='U' && step[i]!='D') { printf("No\n"); return 0; } } } printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332655/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %step = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %step) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %step) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %step) #6 %cmp55.not = icmp eq i64 %call2, 0 br i1 %cmp55.not, label %cleanup, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %rem59 = and i64 %indvars.iv, 1 %cmp4.not = icmp eq i64 %rem59, 0 %arrayidx23 = getelementptr inbounds [101 x i8], ptr %step, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx23, align 1, !tbaa !5 br i1 %cmp4.not, label %if.else, label %if.then if.then: ; preds = %for.body switch i8 %0, label %cleanup [ i8 76, label %for.inc i8 85, label %for.inc i8 68, label %for.inc ] if.else: ; preds = %for.body switch i8 %0, label %cleanup [ i8 82, label %for.inc i8 85, label %for.inc i8 68, label %for.inc ] for.inc: ; preds = %if.else, %if.else, %if.else, %if.then, %if.then, %if.then %indvars.iv.next = add nuw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call2 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8 cleanup: ; preds = %for.inc, %if.else, %if.then, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.4, %if.then ], [ @str.4, %if.else ], [ @str, %for.inc ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %step) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define MAX 2147483647 #define NMAX 100001 int find(int A[],int x,int y){ int i; int min=MAX; for(i=x;i<=y;i++){ if(A[i]<=min){min=A[i];} } return min; } int main(){ int n,q,i; int com,x,y; int A[NMAX]; int C[NMAX]; scanf("%d %d",&n,&q); for(i=0;i<n;i++)A[i]=MAX; for(i=0;i<q;i++)C[i]=-1; for(i=0;i<q;i++){ scanf("%d %d %d",&com,&x,&y); switch(com){ case 0:A[x]=y; break; case 1:C[i]=find(A,x,y); break; } } for(i=0;i<q;i++){if(C[i]!=-1){printf("%d\n",C[i]);}} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332699/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332699/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @find(ptr nocapture noundef readonly %A, i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp.not9 = icmp sgt i32 %x, %y br i1 %cmp.not9, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %x to i64 %1 = add i32 %y, 1 %2 = sub i32 %y, %x %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %invariant.gep = getelementptr i32, ptr %A, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %6, %vector.body ] %vec.phi13 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %7, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load14 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %7 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load14, <4 x i32> %vec.phi13) %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %6, <4 x i32> %7) %9 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %min.011.ph = phi i32 [ 2147483647, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %min.011 = phi i32 [ %spec.select, %for.body ], [ %min.011.ph, %for.body.preheader15 ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %spec.select = tail call i32 @llvm.smin.i32(i32 %10, i32 %min.011) %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 !13 for.end: ; preds = %for.body, %middle.block, %entry %min.0.lcssa = phi i32 [ 2147483647, %entry ], [ %9, %middle.block ], [ %spec.select, %for.body ] ret i32 %min.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: %n = alloca i32, align 4 %q = alloca i32, align 4 %com = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %A = alloca [100001 x i32], align 16 %C = alloca [100001 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 %q) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %com) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #6 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %C) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp46 = icmp sgt i32 %0, 0 br i1 %cmp46, label %for.body.preheader, label %for.cond1.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader80, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %index store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %2, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader80 for.body.preheader80: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block, %entry %4 = load i32, ptr %q, align 4, !tbaa !5 %cmp248 = icmp sgt i32 %4, 0 br i1 %cmp248, label %for.body11.preheader, label %for.end33 for.body: ; preds = %for.body.preheader80, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader80 ] %arrayidx = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv store i32 2147483647, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !15 for.body11.preheader: ; preds = %for.cond1.preheader %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %C, i8 -1, i64 %6, i1 false), !tbaa !5 br label %for.body11 for.cond22.preheader: ; preds = %for.inc19 %cmp2352 = icmp sgt i32 %23, 0 br i1 %cmp2352, label %for.body24, label %for.end33 for.body11: ; preds = %for.body11.preheader, %for.inc19 %indvars.iv58 = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next59, %for.inc19 ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %x, ptr noundef nonnull %y) %7 = load i32, ptr %com, align 4, !tbaa !5 switch i32 %7, label %for.inc19 [ i32 0, label %sw.bb i32 1, label %sw.bb15 ] sw.bb: ; preds = %for.body11 %8 = load i32, ptr %y, align 4, !tbaa !5 %9 = load i32, ptr %x, align 4, !tbaa !5 %idxprom13 = sext i32 %9 to i64 %arrayidx14 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %idxprom13 store i32 %8, ptr %arrayidx14, align 4, !tbaa !5 br label %for.inc19 sw.bb15: ; preds = %for.body11 %10 = load i32, ptr %x, align 4, !tbaa !5 %11 = load i32, ptr %y, align 4, !tbaa !5 %cmp.not9.i = icmp sgt i32 %10, %11 br i1 %cmp.not9.i, label %find.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %sw.bb15 %12 = sext i32 %10 to i64 %13 = add i32 %11, 1 %14 = sub i32 %11, %10 %15 = zext i32 %14 to i64 %16 = add nuw nsw i64 %15, 1 %min.iters.check67 = icmp ult i32 %14, 7 br i1 %min.iters.check67, label %for.body.i.preheader, label %vector.ph68 vector.ph68: ; preds = %for.body.preheader.i %n.vec70 = and i64 %16, 8589934584 %ind.end = add nsw i64 %n.vec70, %12 %invariant.gep = getelementptr i32, ptr %A, i64 %12 br label %vector.body73 vector.body73: ; preds = %vector.body73, %vector.ph68 %index74 = phi i64 [ 0, %vector.ph68 ], [ %index.next77, %vector.body73 ] %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph68 ], [ %18, %vector.body73 ] %vec.phi75 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph68 ], [ %19, %vector.body73 ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index74 %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %17 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load76 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %19 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load76, <4 x i32> %vec.phi75) %index.next77 = add nuw i64 %index74, 8 %20 = icmp eq i64 %index.next77, %n.vec70 br i1 %20, label %middle.block65, label %vector.body73, !llvm.loop !16 middle.block65: ; preds = %vector.body73 %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %18, <4 x i32> %19) %21 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n72 = icmp eq i64 %16, %n.vec70 br i1 %cmp.n72, label %find.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block65 %indvars.iv.i.ph = phi i64 [ %12, %for.body.preheader.i ], [ %ind.end, %middle.block65 ] %min.011.i.ph = phi i32 [ 2147483647, %for.body.preheader.i ], [ %21, %middle.block65 ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %min.011.i = phi i32 [ %spec.select.i, %for.body.i ], [ %min.011.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %spec.select.i = call i32 @llvm.smin.i32(i32 %22, i32 %min.011.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 %13, %lftr.wideiv.i br i1 %exitcond.not.i, label %find.exit, label %for.body.i, !llvm.loop !17 find.exit: ; preds = %for.body.i, %middle.block65, %sw.bb15 %min.0.lcssa.i = phi i32 [ 2147483647, %sw.bb15 ], [ %21, %middle.block65 ], [ %spec.select.i, %for.body.i ] %arrayidx18 = getelementptr inbounds [100001 x i32], ptr %C, i64 0, i64 %indvars.iv58 store i32 %min.0.lcssa.i, ptr %arrayidx18, align 4, !tbaa !5 br label %for.inc19 for.inc19: ; preds = %sw.bb, %find.exit, %for.body11 %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %23 = load i32, ptr %q, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp10 = icmp slt i64 %indvars.iv.next59, %24 br i1 %cmp10, label %for.body11, label %for.cond22.preheader, !llvm.loop !18 for.body24: ; preds = %for.cond22.preheader, %for.inc31 %25 = phi i32 [ %27, %for.inc31 ], [ %23, %for.cond22.preheader ] %indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.inc31 ], [ 0, %for.cond22.preheader ] %arrayidx26 = getelementptr inbounds [100001 x i32], ptr %C, i64 0, i64 %indvars.iv61 %26 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %cmp27.not = icmp eq i32 %26, -1 br i1 %cmp27.not, label %for.inc31, label %if.then if.then: ; preds = %for.body24 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) %.pre = load i32, ptr %q, align 4, !tbaa !5 br label %for.inc31 for.inc31: ; preds = %for.body24, %if.then %27 = phi i32 [ %25, %for.body24 ], [ %.pre, %if.then ] %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %28 = sext i32 %27 to i64 %cmp23 = icmp slt i64 %indvars.iv.next62, %28 br i1 %cmp23, label %for.body24, label %for.end33, !llvm.loop !19 for.end33: ; preds = %for.inc31, %for.cond1.preheader, %for.cond22.preheader call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %C) #6 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %com) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4 attributes #0 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> int main(void) { int n,a,b; scanf("%d%d%d",&n,&a,&b); if(n*a<b) printf("%d\n",n*a); else printf("%d\n",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332741/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332741/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) #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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %b, align 4, !tbaa !5 %mul. = call i32 @llvm.smin.i32(i32 %mul, i32 %2) %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int N, A, B; scanf("%d %d %d", &N, &A, &B); int res = A * N < B ? A * N : B; printf("%d\n", res); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332785/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332785/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) #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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4 %1 = load i32, ptr %N, align 4 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %B, align 4 %cond = call i32 @llvm.smin.i32(i32 %mul, i32 %2) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main(void) { int a,b,c,d; scanf("%d %d %d",&a,&b,&c); if(a*b<c){ d=a*b; }else{ d=c; } printf("%d",d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332835/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332835/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %mul. = call i32 @llvm.smin.i32(i32 %mul, i32 %2) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int n,a,b,mt; scanf("%d %d %d",&n,&a,&b); mt=n*a; if(mt<b) { printf("%d\n",mt); } else { printf("%d\n",b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332879/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332879/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) #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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %b, align 4, !tbaa !5 %mul. = call i32 @llvm.smin.i32(i32 %mul, i32 %2) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define cal(n,a,b) ((n*a>b) ? b : n*a) int main(){ int n,a,b; scanf("%d %d %d",&n,&a,&b); printf("%d\n",cal(n,a,b)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_332936/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_332936/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) #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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4 %1 = load i32, ptr %a, align 4 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %b, align 4 %cond = call i32 @llvm.smin.i32(i32 %mul, i32 %2) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main() { int t; scanf("%d",&t); while(t--){ int l,r; scanf("%d %d",&l,&r); int temp,rem; temp = r-l; if(temp/l < 1){ rem = temp; printf("%d\n",rem); } else if(temp/l >= 1){ rem = ((r+1)/2) - 1; printf("%d\n",rem); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33298/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33298/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %t = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 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 %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec13 = add nsw i32 %0, -1 store i32 %dec13, ptr %t, align 4, !tbaa !5 %tobool.not14 = icmp eq i32 %0, 0 br i1 %tobool.not14, label %while.end, label %while.body while.body: ; preds = %entry, %if.end9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r) %1 = load i32, ptr %r, align 4, !tbaa !5 %2 = load i32, ptr %l, align 4, !tbaa !5 %sub = sub nsw i32 %1, %2 %div = sdiv i32 %sub, %2 %cmp = icmp slt i32 %div, 1 br i1 %cmp, label %if.end9, label %if.then5 if.then5: ; preds = %while.body %add = add nsw i32 %1, 1 %div6 = sdiv i32 %add, 2 %sub7 = add nsw i32 %div6, -1 br label %if.end9 if.end9: ; preds = %while.body, %if.then5 %sub7.sink = phi i32 [ %sub7, %if.then5 ], [ %sub, %while.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub7.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 %3 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end9, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int K,A,B; scanf("%d %d %d",&K,&A,&B); int L=A; int sw=0; while(L<=B){ if(L%K==0){ sw=1; } L=L+1; } if(sw==1){ printf("OK\n"); }else{ printf("NG\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333029/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333029/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %K, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp.not10 = icmp sgt i32 %0, %1 br i1 %cmp.not10, label %if.else, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %2 = load i32, ptr %K, align 4, !tbaa !5 %3 = add i32 %1, 1 %4 = sub i32 %3, %0 %xtraiter = and i32 %4, 1 %5 = icmp eq i32 %1, %0 br i1 %5, label %while.end.unr-lcssa, label %while.body.lr.ph.new while.body.lr.ph.new: ; preds = %while.body.lr.ph %unroll_iter = and i32 %4, -2 br label %while.body while.body: ; preds = %while.body, %while.body.lr.ph.new %sw.012 = phi i32 [ 0, %while.body.lr.ph.new ], [ %spec.select.1, %while.body ] %L.011 = phi i32 [ %0, %while.body.lr.ph.new ], [ %add.1, %while.body ] %niter = phi i32 [ 0, %while.body.lr.ph.new ], [ %niter.next.1, %while.body ] %rem = srem i32 %L.011, %2 %cmp1 = icmp eq i32 %rem, 0 %add = add i32 %L.011, 1 %rem.1 = srem i32 %add, %2 %cmp1.1 = icmp eq i32 %rem.1, 0 %6 = select i1 %cmp1.1, i1 true, i1 %cmp1 %spec.select.1 = select i1 %6, i32 1, i32 %sw.012 %add.1 = add i32 %L.011, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.end.unr-lcssa, label %while.body, !llvm.loop !9 while.end.unr-lcssa: ; preds = %while.body, %while.body.lr.ph %spec.select.lcssa.ph = phi i32 [ undef, %while.body.lr.ph ], [ %spec.select.1, %while.body ] %sw.012.unr = phi i32 [ 0, %while.body.lr.ph ], [ %spec.select.1, %while.body ] %L.011.unr = phi i32 [ %0, %while.body.lr.ph ], [ %add.1, %while.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.end, label %while.body.epil while.body.epil: ; preds = %while.end.unr-lcssa %rem.epil = srem i32 %L.011.unr, %2 %cmp1.epil = icmp eq i32 %rem.epil, 0 %spec.select.epil = select i1 %cmp1.epil, i32 1, i32 %sw.012.unr br label %while.end while.end: ; preds = %while.end.unr-lcssa, %while.body.epil %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %while.end.unr-lcssa ], [ %spec.select.epil, %while.body.epil ] %7 = icmp eq i32 %spec.select.lcssa, 1 br i1 %7, label %if.end6, label %if.else if.else: ; preds = %entry, %while.end br label %if.end6 if.end6: ; preds = %while.end, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %while.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include <stdbool.h> int main(){ int k, a, b; bool judge = false; scanf("%d", &k); scanf("%d %d", &a, &b); for(int i=a; i<=b; i++){ if(i % k == 0){ judge = true; } } if(judge){ printf("OK\n"); } else { printf("NG\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333072/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333072/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not10 = icmp sgt i32 %0, %1 br i1 %cmp.not10, label %if.else, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %k, align 4, !tbaa !5 %3 = add i32 %1, 1 %4 = sub i32 %3, %0 %xtraiter = and i32 %4, 1 %5 = icmp eq i32 %1, %0 br i1 %5, label %for.cond.cleanup.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %4, -2 br label %for.body for.cond.cleanup.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %spec.select.lcssa.ph = phi i8 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ] %i.012.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc.1, %for.body ] %judge.011.unr = phi i8 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa %rem.epil = srem i32 %i.012.unr, %2 %cmp2.epil = icmp eq i32 %rem.epil, 0 %spec.select.epil = select i1 %cmp2.epil, i8 1, i8 %judge.011.unr br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil %spec.select.lcssa = phi i8 [ %spec.select.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] %6 = and i8 %spec.select.lcssa, 1 %7 = icmp eq i8 %6, 0 br i1 %7, label %if.else, label %if.end6 for.body: ; preds = %for.body, %for.body.lr.ph.new %i.012 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %judge.011 = phi i8 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %rem = srem i32 %i.012, %2 %cmp2 = icmp eq i32 %rem, 0 %inc = add i32 %i.012, 1 %rem.1 = srem i32 %inc, %2 %cmp2.1 = icmp eq i32 %rem.1, 0 %8 = select i1 %cmp2.1, i1 true, i1 %cmp2 %spec.select.1 = select i1 %8, i8 1, i8 %judge.011 %inc.1 = add i32 %i.012, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !9 if.else: ; preds = %entry, %for.cond.cleanup br label %if.end6 if.end6: ; preds = %for.cond.cleanup, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.4, %for.cond.cleanup ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<math.h> int main() { int t; scanf("%d",&t); int a,b;int c=0; scanf("%d%d",&a,&b); for(int i=a;i<=b;i++) { if(i%t==0) { ++c;break; } } if(c==0) printf("NG"); else printf("OK"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333115/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333115/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not12 = icmp sgt i32 %0, %1 br i1 %cmp.not12, label %if.end8, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %t, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc3 = add i32 %i.013, 1 %exitcond.not = icmp eq i32 %i.013, %1 br i1 %exitcond.not, label %if.end8, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.013 = phi i32 [ %0, %for.body.lr.ph ], [ %inc3, %for.cond ] %rem = srem i32 %i.013, %2 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %if.end8, label %for.cond if.end8: ; preds = %for.body, %for.cond, %entry %.str.3.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.cond ], [ @.str.3, %for.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { int k,a,b; int flag=0; scanf("%d",&k); // printf("k=%d\n",k); scanf("%d %d",&a,&b); // printf("a=%d b=%d\n",a,b); // printf("flag=%d\n",flag); for (int i=1;i<=1000;i++){ if (k*i>=a && k*i<=b){ // printf("i=%d %d\n",i,k*i); flag=1; break; } } if (flag==1) printf("OK"); else printf("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333159/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333159/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"OK\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4 br label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.017, 1 %mul.1 = mul nsw i32 %0, %inc %cmp2.not.1 = icmp slt i32 %mul.1, %1 %cmp4.not.1 = icmp sgt i32 %mul.1, %2 %or.cond.1 = select i1 %cmp2.not.1, i1 true, i1 %cmp4.not.1 br i1 %or.cond.1, label %for.cond.1, label %if.end9 for.cond.1: ; preds = %for.cond %inc.1 = add nuw nsw i32 %i.017, 2 %mul.2 = mul nsw i32 %0, %inc.1 %cmp2.not.2 = icmp slt i32 %mul.2, %1 %cmp4.not.2 = icmp sgt i32 %mul.2, %2 %or.cond.2 = select i1 %cmp2.not.2, i1 true, i1 %cmp4.not.2 br i1 %or.cond.2, label %for.cond.2, label %if.end9 for.cond.2: ; preds = %for.cond.1 %inc.2 = add nuw nsw i32 %i.017, 3 %mul.3 = mul nsw i32 %0, %inc.2 %cmp2.not.3 = icmp slt i32 %mul.3, %1 %cmp4.not.3 = icmp sgt i32 %mul.3, %2 %or.cond.3 = select i1 %cmp2.not.3, i1 true, i1 %cmp4.not.3 br i1 %or.cond.3, label %for.cond.3, label %if.end9 for.cond.3: ; preds = %for.cond.2 %inc.3 = add nuw nsw i32 %i.017, 4 %exitcond.not.3 = icmp eq i32 %inc.3, 1001 br i1 %exitcond.not.3, label %if.end9, label %for.body, !llvm.loop !9 for.body: ; preds = %for.cond.3, %entry %i.017 = phi i32 [ 1, %entry ], [ %inc.3, %for.cond.3 ] %mul = mul nsw i32 %0, %i.017 %cmp2.not = icmp slt i32 %mul, %1 %cmp4.not = icmp sgt i32 %mul, %2 %or.cond = select i1 %cmp2.not, i1 true, i1 %cmp4.not br i1 %or.cond, label %for.cond, label %if.end9 if.end9: ; preds = %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %for.body %.str.3.sink = phi ptr [ @.str.2, %for.body ], [ @.str.2, %for.cond ], [ @.str.2, %for.cond.1 ], [ @.str.2, %for.cond.2 ], [ @.str.3, %for.cond.3 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { double k, a, b, i; double aa, bb; int c = 0; scanf("%lf", &k); scanf("%lf", &a); scanf("%lf", &b); aa = a / k; bb = b / k; for(i = 1; i <= 1000; i++){ if(i >= aa && i <= bb){ c = 1; } } if(c == 0){ printf("NG\n"); } else{ printf("OK\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333201/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333201/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca double, align 8 %a = alloca double, align 8 %b = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load double, ptr %a, align 8, !tbaa !5 %1 = load double, ptr %k, align 8, !tbaa !5 %div = fdiv double %0, %1 %2 = load double, ptr %b, align 8, !tbaa !5 %div3 = fdiv double %2, %1 br label %for.body for.body: ; preds = %for.body, %entry %c.016 = phi i32 [ 0, %entry ], [ %c.1.3, %for.body ] %i.015.int = phi i32 [ 1, %entry ], [ %inc.int.3, %for.body ] %indvar.conv = sitofp i32 %i.015.int to double %cmp4 = fcmp ugt double %div, %indvar.conv %cmp5 = fcmp ult double %div3, %indvar.conv %or.cond = select i1 %cmp4, i1 true, i1 %cmp5 %inc.int = add nuw nsw i32 %i.015.int, 1 %indvar.conv.1 = sitofp i32 %inc.int to double %cmp4.1 = fcmp ugt double %div, %indvar.conv.1 %cmp5.1 = fcmp ult double %div3, %indvar.conv.1 %or.cond.1 = select i1 %cmp4.1, i1 true, i1 %cmp5.1 %inc.int.1 = add nuw nsw i32 %i.015.int, 2 %indvar.conv.2 = sitofp i32 %inc.int.1 to double %cmp4.2 = fcmp ugt double %div, %indvar.conv.2 %cmp5.2 = fcmp ult double %div3, %indvar.conv.2 %or.cond.2 = select i1 %cmp4.2, i1 true, i1 %cmp5.2 %inc.int.2 = add nuw nsw i32 %i.015.int, 3 %indvar.conv.3 = sitofp i32 %inc.int.2 to double %cmp4.3 = fcmp ugt double %div, %indvar.conv.3 %cmp5.3 = fcmp ult double %div3, %indvar.conv.3 %or.cond.3 = select i1 %cmp4.3, i1 true, i1 %cmp5.3 %3 = select i1 %or.cond.3, i1 %or.cond.2, i1 false %4 = select i1 %3, i1 %or.cond.1, i1 false %5 = select i1 %4, i1 %or.cond, i1 false %c.1.3 = select i1 %5, i32 %c.016, i32 1 %inc.int.3 = add nuw nsw i32 %i.015.int, 4 %exitcond.3 = icmp eq i32 %inc.int.3, 1001 br i1 %exitcond.3, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body %cmp6 = icmp eq i32 %c.1.3, 0 %str.3.str = select i1 %cmp6, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 = !{!"double", !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 K; int A,B; scanf("%d",&K); scanf("%d %d",&A,&B); for(int i=A;i<=B;i++){ if(i%K==0){ printf("OK\n"); return 0; }else if(i%K!=0){ } } printf("NG\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333245/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333245/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %K) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp.not17 = icmp sgt i32 %0, %1 br i1 %cmp.not17, label %cleanup9, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %K, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc = add i32 %i.018, 1 %exitcond.not = icmp eq i32 %i.018, %1 br i1 %exitcond.not, label %cleanup9, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.018 = phi i32 [ %0, %for.body.lr.ph ], [ %inc, %for.cond ] %rem = srem i32 %i.018, %2 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %cleanup9, label %for.cond cleanup9: ; preds = %for.cond, %for.body, %entry %str.sink = phi ptr [ @str.4, %entry ], [ @str, %for.body ], [ @str.4, %for.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void) { int K,A,B,i; scanf("%d",&K); scanf("%d",&A); scanf("%d",&B); for(i=A; i<=B; i++){ if(i % K == 0){ printf("OK\n"); return 0; } } printf("NG\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333289/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333289/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NG\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %K) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp.not12 = icmp sgt i32 %0, %1 br i1 %cmp.not12, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %K, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc = add i32 %i.013, 1 %exitcond.not = icmp eq i32 %i.013, %1 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.013 = phi i32 [ %0, %for.body.lr.ph ], [ %inc, %for.cond ] %rem = srem i32 %i.013, %2 %cmp3 = icmp eq i32 %rem, 0 br i1 %cmp3, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %for.body, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.3, %for.body ], [ @str, %for.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int k, a, b; scanf("%d", &k); scanf("%d %d", &a, &b); for(int i = a;i <= b;i++) { if(i % k == 0) { puts("OK"); return 0; } } puts("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333331/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333331/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"OK\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not10 = icmp sgt i32 %0, %1 br i1 %cmp.not10, label %cleanup5, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc = add i32 %i.011, 1 %exitcond.not = icmp eq i32 %i.011, %1 br i1 %exitcond.not, label %cleanup5, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.011 = phi i32 [ %0, %for.body.lr.ph ], [ %inc, %for.cond ] %rem = srem i32 %i.011, %2 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %cleanup5, label %for.cond cleanup5: ; preds = %for.cond, %for.body, %entry %.str.2.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.3, %for.cond ] %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int i,k,a,b; scanf("%d%d%d",&k,&a,&b); for(i=b;i>=a;i--){ if(i%k){ }else{ printf("OK"); return 0; } } printf("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333375/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333375/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"OK\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not8 = icmp slt i32 %0, %1 br i1 %cmp.not8, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %dec = add nsw i32 %i.09, -1 %cmp.not.not = icmp sgt i32 %i.09, %1 br i1 %cmp.not.not, label %for.body, label %cleanup, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.09 = phi i32 [ %0, %for.body.lr.ph ], [ %dec, %for.cond ] %rem = srem i32 %i.09, %2 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %cleanup, label %for.cond cleanup: ; preds = %for.cond, %for.body, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body ], [ @.str.2, %for.cond ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b,k,total=0,c=0; scanf("%d",&k); scanf("%d %d",&a,&b); for(int i=1; i<1000; i++){ total=0; total=k*i; if(total>=a&&total<=b){ c++; break; } } if(c>=1)puts("OK"); else puts("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333418/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333418/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"OK\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NG\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 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4 br label %for.body for.cond: ; preds = %for.body %inc4 = add nuw nsw i32 %i.019, 1 %mul.1 = mul nsw i32 %0, %inc4 %cmp2.not.1 = icmp slt i32 %mul.1, %1 %cmp3.not.1 = icmp sgt i32 %mul.1, %2 %or.cond.1 = select i1 %cmp2.not.1, i1 true, i1 %cmp3.not.1 br i1 %or.cond.1, label %for.cond.1, label %if.end9 for.cond.1: ; preds = %for.cond %inc4.1 = add nuw nsw i32 %i.019, 2 %mul.2 = mul nsw i32 %0, %inc4.1 %cmp2.not.2 = icmp slt i32 %mul.2, %1 %cmp3.not.2 = icmp sgt i32 %mul.2, %2 %or.cond.2 = select i1 %cmp2.not.2, i1 true, i1 %cmp3.not.2 br i1 %or.cond.2, label %for.cond.2, label %if.end9 for.cond.2: ; preds = %for.cond.1 %inc4.2 = add nuw nsw i32 %i.019, 3 %exitcond.not.2 = icmp eq i32 %inc4.2, 1000 br i1 %exitcond.not.2, label %if.end9, label %for.body, !llvm.loop !9 for.body: ; preds = %for.cond.2, %entry %i.019 = phi i32 [ 1, %entry ], [ %inc4.2, %for.cond.2 ] %mul = mul nsw i32 %0, %i.019 %cmp2.not = icmp slt i32 %mul, %1 %cmp3.not = icmp sgt i32 %mul, %2 %or.cond = select i1 %cmp2.not, i1 true, i1 %cmp3.not br i1 %or.cond, label %for.cond, label %if.end9 if.end9: ; preds = %for.cond.2, %for.cond.1, %for.cond, %for.body %.str.3.sink = phi ptr [ @.str.2, %for.body ], [ @.str.2, %for.cond ], [ @.str.2, %for.cond.1 ], [ @.str.3, %for.cond.2 ] %call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int k,a,b,i,c; c=0; scanf("%d",&k); scanf("%d %d",&a,&b); for(i=a;i<=b;i++){ if(i%k==0){ printf("OK\n"); c=1; break; } } if(c==0){ printf("NG\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333461/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333461/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not11 = icmp sgt i32 %0, %1 br i1 %cmp.not11, label %if.end7, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc = add i32 %i.012, 1 %exitcond.not = icmp eq i32 %i.012, %1 br i1 %exitcond.not, label %if.end7, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.012 = phi i32 [ %0, %for.body.lr.ph ], [ %inc, %for.cond ] %rem = srem i32 %i.012, %2 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %if.end7, label %for.cond if.end7: ; preds = %for.cond, %for.body, %entry %str.sink = phi ptr [ @str.4, %entry ], [ @str, %for.body ], [ @str.4, %for.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int k,a,b,i,flag=0; scanf("%d",&k); scanf("%d %d",&a,&b); for(i=a;i<=b;i++) { if(i%k==0) { flag=1; break; } } if(flag==1) printf("OK"); else printf("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333504/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333504/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"OK\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not.not10 = icmp sgt i32 %0, %1 br i1 %cmp.not.not10, label %if.end7, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %2 = load i32, ptr %k, align 4, !tbaa !5 br label %for.body for.cond: ; preds = %for.body %inc = add i32 %i.011, 1 %exitcond.not = icmp eq i32 %i.011, %1 br i1 %exitcond.not, label %if.end7, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.lr.ph, %for.cond %i.011 = phi i32 [ %0, %for.body.lr.ph ], [ %inc, %for.cond ] %rem = srem i32 %i.011, %2 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %if.end7, label %for.cond if.end7: ; preds = %for.cond, %for.body, %entry %.str.3.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.3, %for.cond ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #define max 1000 //qsort(str, n, sizeof(int), up_comp); int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;} int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;} int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;} int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);} int int_sort( const void * a , const void * b ) { return strcmp(( char * )a , ( char * )b ); } int main() { int k, a, b, i; scanf("%d%d%d", &k, &a, &b); for (i=1; i<=b; i++) { if (k*i<=b&&k*i>=a) { printf("OK"); return 0; } } printf("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333548/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333548/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"OK\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @up_comp(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 @down_comp(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: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count_digit(i32 noundef %a) local_unnamed_addr #1 { entry: %cmp.not3 = icmp eq i32 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i32 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i32 %a.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %a.addr.04.off = add i32 %a.addr.04, 9 %cmp.not = icmp ult i32 %a.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end3, %entry %a.tr = phi i32 [ %a, %entry ], [ %spec.select17, %if.end3 ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %if.end3 ] %spec.select17 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr) %cmp1 = icmp slt i32 %spec.select17, 1 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %tailrecurse %spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr) %rem = srem i32 %spec.select, %spec.select17 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %tailrecurse cleanup: ; preds = %if.end3, %tailrecurse %retval.0 = phi i32 [ -1, %tailrecurse ], [ %spec.select17, %if.end3 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %k = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not12 = icmp slt i32 %0, 1 br i1 %cmp.not12, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %k, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4 br label %for.body for.cond: ; preds = %for.body %inc = add nuw i32 %i.013, 1 %exitcond.not = icmp eq i32 %i.013, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11 for.body: ; preds = %for.body.lr.ph, %for.cond %i.013 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %for.cond ] %mul = mul nsw i32 %1, %i.013 %cmp1.not = icmp sgt i32 %mul, %0 %cmp3.not = icmp slt i32 %mul, %2 %or.cond = select i1 %cmp1.not, i1 true, i1 %cmp3.not br i1 %or.cond, label %for.cond, label %cleanup cleanup: ; preds = %for.cond, %for.body, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body ], [ @.str.2, %for.cond ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 k,a,b; int main(){ scanf("%d%d%d",&k,&a,&b); for(;a<=b;a++){ if(a%k==0){ puts("OK"); return 0; } } puts("NG"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333591/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @k = dso_local global i32 0, align 4 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NG\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @k, ptr noundef nonnull @a, ptr noundef nonnull @b) %0 = load i32, ptr @b, align 4, !tbaa !5 %a.promoted = load i32, ptr @a, align 4, !tbaa !5 %cmp.not5 = icmp sgt i32 %a.promoted, %0 br i1 %cmp.not5, label %return, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @k, align 4, !tbaa !5 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %inc46 = phi i32 [ %a.promoted, %for.body.lr.ph ], [ %inc, %for.inc ] %rem = srem i32 %inc46, %1 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %return, label %for.inc for.inc: ; preds = %for.body %inc = add i32 %inc46, 1 store i32 %inc, ptr @a, align 4, !tbaa !5 %exitcond.not = icmp eq i32 %inc46, %0 br i1 %exitcond.not, label %return, label %for.body, !llvm.loop !9 return: ; preds = %for.inc, %for.body, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body ], [ @.str.2, %for.inc ] %call3 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.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 #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> #include <stdlib.h> #include <math.h> #define Mod 200003 typedef struct { double Re, Im; } complex; complex sum_complex(complex x, complex y) { complex z; z.Re = x.Re + y.Re; z.Im = x.Im + y.Im; return z; } complex prod_complex(complex x, complex y) { complex z; z.Re = x.Re * y.Re - x.Im * y.Im; z.Im = x.Re * y.Im + x.Im * y.Re; return z; } complex scale_complex(double a, complex x) { complex z; z.Re = a * x.Re; z.Im = a * x.Im; return z; } void FFT(int d, complex a[], complex z[]) { if (d == 1) { z[0] = a[0]; return; } else d /= 2; int i; complex root, tmp, *b = (complex*)malloc(sizeof(complex) * d), *c = (complex*)malloc(sizeof(complex) * d), *x = (complex*)malloc(sizeof(complex) * d), *y = (complex*)malloc(sizeof(complex) * d); for (i = 0; i < d; i++) { b[i] = a[i*2]; c[i] = a[i*2+1]; } FFT(d, b, x); FFT(d, c, y); root.Re = cosl(M_PI / (double)d); root.Im = sinl(M_PI / (double)d); for (i = 0, tmp.Re = 1.0, tmp.Im = 0.0; i < d; i++, tmp = prod_complex(tmp, root)) { z[i] = sum_complex(x[i], prod_complex(tmp, y[i])); z[i+d] = sum_complex(x[i], scale_complex(-1.0, prod_complex(tmp, y[i]))); } free(b); free(c); free(x); free(y); } void FFT_reverse(int d, complex z[], complex a[]) { if (d == 1) { a[0] = z[0]; return; } else d /= 2; int i; complex root, tmp, *b = (complex*)malloc(sizeof(complex) * d), *c = (complex*)malloc(sizeof(complex) * d), *x = (complex*)malloc(sizeof(complex) * d), *y = (complex*)malloc(sizeof(complex) * d); for (i = 0; i < d; i++) { x[i] = z[i*2]; y[i] = z[i*2+1]; } FFT_reverse(d, x, b); FFT_reverse(d, y, c); root.Re = cosl(M_PI / (double)d); root.Im = -sinl(M_PI / (double)d); for (i = 0, tmp.Re = 1.0, tmp.Im = 0.0; i < d; i++, tmp = prod_complex(tmp, root)) { a[i] = sum_complex(b[i], prod_complex(tmp, c[i])); a[i+d] = sum_complex(b[i], scale_complex(-1.0, prod_complex(tmp, c[i]))); } free(b); free(c); free(x); free(y); } void prod_poly_FFT(int d, long long a[], long long b[], long long c[]) { int i, D; for (D = 2; D < d * 2; D *= 2); complex *p = (complex*)malloc(sizeof(complex) * D), *q = (complex*)malloc(sizeof(complex) * D), *r = (complex*)malloc(sizeof(complex) * D), *x = (complex*)malloc(sizeof(complex) * D), *y = (complex*)malloc(sizeof(complex) * D), *z = (complex*)malloc(sizeof(complex) * D); for (i = 0; i < d; i++) { p[i].Re = (double)a[i]; p[i].Im = 0.0; q[i].Re = (double)b[i]; q[i].Im = 0.0; } for (; i < D; i++) { p[i].Re = 0.0; p[i].Im = 0.0; q[i].Re = 0.0; q[i].Im = 0.0; } FFT(D, p, x); FFT(D, q, y); for (i = 0; i < D; i++) z[i] = prod_complex(x[i], y[i]); FFT_reverse(D, z, r); for (i = 0; i < d * 2; i++) c[i] = (long long)(r[i].Re / (double)D + 1e-1); free(p); free(q); free(r); free(x); free(y); free(z); } int main() { int i, N, A, pow[Mod], log[Mod]; long long num[Mod] = {}; for (i = 0, A = 1; i < Mod; i++, A = A * 2 % Mod) { pow[i] = A; log[A] = i; } scanf("%d", &N); for (i = 1; i <= N; i++) { scanf("%d", &A); if (A > 0) num[log[A]]++; } int j; long long ans = 0, sq[Mod*2] = {}; prod_poly_FFT(Mod, num, num, sq); for (i = 0; i < Mod; i++) { sq[i*2] -= num[i] * num[i]; ans += pow[i*2%(Mod-1)] * num[i] * (num[i] - 1) / 2; } for (i = 0; i < Mod * 2; i++) ans += pow[i%(Mod-1)] * sq[i] / 2; printf("%lld\n", ans); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333634/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333634/source.c" target datalayout = "e-m:e-p270: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.complex = type { double, double } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local { double, double } @sum_complex(double %x.coerce0, double %x.coerce1, double %y.coerce0, double %y.coerce1) local_unnamed_addr #0 { entry: %add = fadd double %x.coerce0, %y.coerce0 %add4 = fadd double %x.coerce1, %y.coerce1 %.fca.0.insert = insertvalue { double, double } poison, double %add, 0 %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %add4, 1 ret { double, double } %.fca.1.insert } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local { double, double } @prod_complex(double %x.coerce0, double %x.coerce1, double %y.coerce0, double %y.coerce1) local_unnamed_addr #1 { entry: %0 = fneg double %x.coerce1 %1 = insertelement <2 x double> poison, double %0, i64 0 %2 = insertelement <2 x double> %1, double %x.coerce1, i64 1 %3 = insertelement <2 x double> poison, double %y.coerce1, i64 0 %4 = insertelement <2 x double> %3, double %y.coerce0, i64 1 %5 = fmul <2 x double> %2, %4 %6 = insertelement <2 x double> poison, double %x.coerce0, i64 0 %7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer %8 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> <i32 1, i32 0> %9 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %8, <2 x double> %5) %10 = extractelement <2 x double> %9, i64 0 %.fca.0.insert = insertvalue { double, double } poison, double %10, 0 %11 = extractelement <2 x double> %9, i64 1 %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %11, 1 ret { double, double } %.fca.1.insert } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local { double, double } @scale_complex(double noundef %a, double %x.coerce0, double %x.coerce1) local_unnamed_addr #0 { entry: %mul = fmul double %a, %x.coerce0 %mul2 = fmul double %a, %x.coerce1 %.fca.0.insert = insertvalue { double, double } poison, double %mul, 0 %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %mul2, 1 ret { double, double } %.fca.1.insert } ; Function Attrs: nounwind uwtable define dso_local void @FFT(i32 noundef %d, ptr nocapture noundef readonly %a, ptr nocapture noundef writeonly %z) local_unnamed_addr #2 { entry: %cmp = icmp eq i32 %d, 1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %z, ptr noundef nonnull align 8 dereferenceable(16) %a, i64 16, i1 false), !tbaa.struct !5 br label %return if.else: ; preds = %entry %div = sdiv i32 %d, 2 %conv = sext i32 %div to i64 %mul = shl nsw i64 %conv, 4 %call = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call4 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call7 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call10 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %cmp11124 = icmp sgt i32 %d, 1 br i1 %cmp11124, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.else %wide.trip.count = zext i32 %div to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx13 = getelementptr inbounds %struct.complex, ptr %call, i64 %indvars.iv %0 = shl nuw nsw i64 %indvars.iv, 1 %arrayidx16 = getelementptr inbounds %struct.complex, ptr %a, i64 %0 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx13, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx16, i64 16, i1 false), !tbaa.struct !5 %arrayidx18 = getelementptr inbounds %struct.complex, ptr %call4, i64 %indvars.iv %1 = or i64 %0, 1 %arrayidx21 = getelementptr inbounds %struct.complex, ptr %a, i64 %1 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx18, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx21, i64 16, i1 false), !tbaa.struct !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 !10 for.end: ; preds = %for.body, %if.else tail call void @FFT(i32 noundef %div, ptr noundef %call, ptr noundef %call7) tail call void @FFT(i32 noundef %div, ptr noundef %call4, ptr noundef %call10) %conv22 = sitofp i32 %div to double %div23 = fdiv double 0x400921FB54442D18, %conv22 %conv24 = fpext double %div23 to x86_fp80 %call25 = tail call x86_fp80 @cosl(x86_fp80 noundef %conv24) #12 %call30 = tail call x86_fp80 @sinl(x86_fp80 noundef %conv24) #12 br i1 %cmp11124, label %for.body37.preheader, label %for.end64 for.body37.preheader: ; preds = %for.end %conv31 = fptrunc x86_fp80 %call30 to double %conv26 = fptrunc x86_fp80 %call25 to double %wide.trip.count137 = zext i32 %div to i64 %invariant.gep = getelementptr %struct.complex, ptr %z, i64 %conv %2 = insertelement <2 x double> poison, double %conv26, i64 0 %3 = insertelement <2 x double> %2, double %conv31, i64 1 %4 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> <i32 1, i32 0> br label %for.body37 for.body37: ; preds = %for.body37.preheader, %for.body37 %indvars.iv133 = phi i64 [ 0, %for.body37.preheader ], [ %indvars.iv.next134, %for.body37 ] %5 = phi <2 x double> [ <double 0.000000e+00, double 1.000000e+00>, %for.body37.preheader ], [ %18, %for.body37 ] %arrayidx39 = getelementptr inbounds %struct.complex, ptr %z, i64 %indvars.iv133 %arrayidx42 = getelementptr inbounds %struct.complex, ptr %call7, i64 %indvars.iv133 %arrayidx44 = getelementptr inbounds %struct.complex, ptr %call10, i64 %indvars.iv133 %6 = extractelement <2 x double> %5, i64 0 %7 = fneg double %6 %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %indvars.iv133 %8 = load <2 x double>, ptr %arrayidx44, align 8 %9 = insertelement <2 x double> %5, double %7, i64 1 %10 = fmul <2 x double> %8, %9 %11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> <i32 1, i32 0> %12 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> <i32 1, i32 1> %13 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %8, <2 x double> %11) %14 = load <2 x double>, ptr %arrayidx42, align 8 %15 = fadd <2 x double> %13, %14 store <2 x double> %15, ptr %arrayidx39, align 8 %16 = fsub <2 x double> %14, %13 store <2 x double> %16, ptr %gep, align 8 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %17 = fmul <2 x double> %9, %3 %18 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %4, <2 x double> %17) %exitcond138.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count137 br i1 %exitcond138.not, label %for.end64, label %for.body37, !llvm.loop !12 for.end64: ; preds = %for.body37, %for.end tail call void @free(ptr noundef %call) #12 tail call void @free(ptr noundef %call4) #12 tail call void @free(ptr noundef %call7) #12 tail call void @free(ptr noundef %call10) #12 br label %return return: ; preds = %for.end64, %if.then ret void } ; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare x86_fp80 @cosl(x86_fp80 noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare x86_fp80 @sinl(x86_fp80 noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nounwind uwtable define dso_local void @FFT_reverse(i32 noundef %d, ptr nocapture noundef readonly %z, ptr nocapture noundef writeonly %a) local_unnamed_addr #2 { entry: %cmp = icmp eq i32 %d, 1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %a, ptr noundef nonnull align 8 dereferenceable(16) %z, i64 16, i1 false), !tbaa.struct !5 br label %return if.else: ; preds = %entry %div = sdiv i32 %d, 2 %conv = sext i32 %div to i64 %mul = shl nsw i64 %conv, 4 %call = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call4 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call7 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %call10 = tail call noalias ptr @malloc(i64 noundef %mul) #11 %cmp11124 = icmp sgt i32 %d, 1 br i1 %cmp11124, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.else %wide.trip.count = zext i32 %div to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx13 = getelementptr inbounds %struct.complex, ptr %call7, i64 %indvars.iv %0 = shl nuw nsw i64 %indvars.iv, 1 %arrayidx16 = getelementptr inbounds %struct.complex, ptr %z, i64 %0 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx13, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx16, i64 16, i1 false), !tbaa.struct !5 %arrayidx18 = getelementptr inbounds %struct.complex, ptr %call10, i64 %indvars.iv %1 = or i64 %0, 1 %arrayidx21 = getelementptr inbounds %struct.complex, ptr %z, i64 %1 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx18, ptr noundef nonnull align 8 dereferenceable(16) %arrayidx21, i64 16, i1 false), !tbaa.struct !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 !13 for.end: ; preds = %for.body, %if.else tail call void @FFT_reverse(i32 noundef %div, ptr noundef %call7, ptr noundef %call) tail call void @FFT_reverse(i32 noundef %div, ptr noundef %call10, ptr noundef %call4) %conv22 = sitofp i32 %div to double %div23 = fdiv double 0x400921FB54442D18, %conv22 %conv24 = fpext double %div23 to x86_fp80 %call25 = tail call x86_fp80 @cosl(x86_fp80 noundef %conv24) #12 %call30 = tail call x86_fp80 @sinl(x86_fp80 noundef %conv24) #12 br i1 %cmp11124, label %for.body37.preheader, label %for.end64 for.body37.preheader: ; preds = %for.end %2 = fptrunc x86_fp80 %call30 to double %conv31 = fneg double %2 %conv26 = fptrunc x86_fp80 %call25 to double %wide.trip.count137 = zext i32 %div to i64 %invariant.gep = getelementptr %struct.complex, ptr %a, i64 %conv %3 = insertelement <2 x double> poison, double %conv26, i64 0 %4 = insertelement <2 x double> %3, double %2, i64 1 %5 = insertelement <2 x double> poison, double %conv31, i64 0 %6 = insertelement <2 x double> %5, double %conv26, i64 1 br label %for.body37 for.body37: ; preds = %for.body37.preheader, %for.body37 %indvars.iv133 = phi i64 [ 0, %for.body37.preheader ], [ %indvars.iv.next134, %for.body37 ] %7 = phi <2 x double> [ <double 0.000000e+00, double 1.000000e+00>, %for.body37.preheader ], [ %21, %for.body37 ] %arrayidx39 = getelementptr inbounds %struct.complex, ptr %a, i64 %indvars.iv133 %arrayidx42 = getelementptr inbounds %struct.complex, ptr %call, i64 %indvars.iv133 %arrayidx44 = getelementptr inbounds %struct.complex, ptr %call4, i64 %indvars.iv133 %8 = extractelement <2 x double> %7, i64 0 %9 = fneg double %8 %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %indvars.iv133 %10 = load <2 x double>, ptr %arrayidx44, align 8 %11 = insertelement <2 x double> %7, double %9, i64 1 %12 = fmul <2 x double> %10, %11 %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 0> %14 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> <i32 1, i32 1> %15 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %10, <2 x double> %13) %16 = load <2 x double>, ptr %arrayidx42, align 8 %17 = fadd <2 x double> %15, %16 store <2 x double> %17, ptr %arrayidx39, align 8 %18 = fsub <2 x double> %16, %15 store <2 x double> %18, ptr %gep, align 8 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %19 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer %20 = fmul <2 x double> %19, %4 %21 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %6, <2 x double> %20) %exitcond138.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count137 br i1 %exitcond138.not, label %for.end64, label %for.body37, !llvm.loop !14 for.end64: ; preds = %for.body37, %for.end tail call void @free(ptr noundef %call) #12 tail call void @free(ptr noundef %call4) #12 tail call void @free(ptr noundef %call7) #12 tail call void @free(ptr noundef %call10) #12 br label %return return: ; preds = %for.end64, %if.then ret void } ; Function Attrs: nounwind uwtable define dso_local void @prod_poly_FFT(i32 noundef %d, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, ptr nocapture noundef writeonly %c) local_unnamed_addr #2 { entry: %mul = shl nsw i32 %d, 1 br label %for.cond for.cond: ; preds = %for.cond, %entry %D.0 = phi i32 [ 2, %entry ], [ %mul1, %for.cond ] %cmp = icmp slt i32 %D.0, %mul %mul1 = shl nsw i32 %D.0, 1 br i1 %cmp, label %for.cond, label %for.end, !llvm.loop !15 for.end: ; preds = %for.cond %conv = zext i32 %D.0 to i64 %mul2 = shl nuw nsw i64 %conv, 4 %call = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %call5 = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %call8 = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %call11 = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %call14 = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %call17 = tail call noalias ptr @malloc(i64 noundef %mul2) #11 %cmp19141 = icmp sgt i32 %d, 0 br i1 %cmp19141, label %for.body21.preheader, label %for.body41.preheader for.body21.preheader: ; preds = %for.end %wide.trip.count = zext i32 %d to i64 br label %for.body21 for.cond38.preheader: ; preds = %for.body21 %cmp39143 = icmp ugt i32 %D.0, %d br i1 %cmp39143, label %for.body41.preheader, label %for.end56 for.body41.preheader: ; preds = %for.end, %for.cond38.preheader %i.0.lcssa165 = phi i32 [ %d, %for.cond38.preheader ], [ 0, %for.end ] %0 = zext i32 %i.0.lcssa165 to i64 %1 = shl nuw nsw i64 %0, 4 %scevgep = getelementptr i8, ptr %call, i64 %1 %2 = xor i32 %i.0.lcssa165, -1 %3 = add i32 %D.0, %2 %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 4 %6 = add nuw nsw i64 %5, 16 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %6, i1 false), !tbaa !6 %scevgep149 = getelementptr i8, ptr %call5, i64 %1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep149, i8 0, i64 %6, i1 false), !tbaa !6 br label %for.end56 for.body21: ; preds = %for.body21.preheader, %for.body21 %indvars.iv = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next, %for.body21 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %indvars.iv %7 = load i64, ptr %arrayidx, align 8, !tbaa !16 %conv22 = sitofp i64 %7 to double %arrayidx24 = getelementptr inbounds %struct.complex, ptr %call, i64 %indvars.iv store double %conv22, ptr %arrayidx24, align 8, !tbaa !18 %Im = getelementptr inbounds %struct.complex, ptr %call, i64 %indvars.iv, i32 1 store double 0.000000e+00, ptr %Im, align 8, !tbaa !20 %arrayidx28 = getelementptr inbounds i64, ptr %b, i64 %indvars.iv %8 = load i64, ptr %arrayidx28, align 8, !tbaa !16 %conv29 = sitofp i64 %8 to double %arrayidx31 = getelementptr inbounds %struct.complex, ptr %call5, i64 %indvars.iv store double %conv29, ptr %arrayidx31, align 8, !tbaa !18 %Im35 = getelementptr inbounds %struct.complex, ptr %call5, i64 %indvars.iv, i32 1 store double 0.000000e+00, ptr %Im35, align 8, !tbaa !20 %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.cond38.preheader, label %for.body21, !llvm.loop !21 for.end56: ; preds = %for.body41.preheader, %for.cond38.preheader tail call void @FFT(i32 noundef %D.0, ptr noundef %call, ptr noundef %call11) tail call void @FFT(i32 noundef %D.0, ptr noundef %call5, ptr noundef %call14) %umax = tail call i32 @llvm.umax.i32(i32 %D.0, i32 1) %wide.trip.count156 = zext i32 %umax to i64 %n.vec = and i64 %wide.trip.count156, 4294967294 br label %vector.body vector.body: ; preds = %vector.body, %for.end56 %index = phi i64 [ 0, %for.end56 ], [ %index.next, %vector.body ] %9 = getelementptr inbounds %struct.complex, ptr %call11, i64 %index %10 = getelementptr inbounds %struct.complex, ptr %call14, i64 %index %wide.vec = load <4 x double>, ptr %9, align 8 %strided.vec = shufflevector <4 x double> %wide.vec, <4 x double> poison, <2 x i32> <i32 0, i32 2> %strided.vec166 = shufflevector <4 x double> %wide.vec, <4 x double> poison, <2 x i32> <i32 1, i32 3> %wide.vec167 = load <4 x double>, ptr %10, align 8 %strided.vec168 = shufflevector <4 x double> %wide.vec167, <4 x double> poison, <2 x i32> <i32 0, i32 2> %strided.vec169 = shufflevector <4 x double> %wide.vec167, <4 x double> poison, <2 x i32> <i32 1, i32 3> %11 = fneg <2 x double> %strided.vec166 %12 = fmul <2 x double> %strided.vec169, %11 %13 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %strided.vec, <2 x double> %strided.vec168, <2 x double> %12) %14 = fmul <2 x double> %strided.vec166, %strided.vec168 %15 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %strided.vec, <2 x double> %strided.vec169, <2 x double> %14) %16 = getelementptr inbounds %struct.complex, ptr %call17, i64 %index %interleaved.vec = shufflevector <2 x double> %13, <2 x double> %15, <4 x i32> <i32 0, i32 2, i32 1, i32 3> store <4 x double> %interleaved.vec, ptr %16, align 8 %index.next = add nuw i64 %index, 2 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %cmp.n.not = icmp eq i64 %n.vec, 0 br i1 %cmp.n.not, label %for.body60, label %for.end70 for.body60: ; preds = %middle.block, %for.body60 %indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.body60 ], [ %n.vec, %middle.block ] %arrayidx62 = getelementptr inbounds %struct.complex, ptr %call17, i64 %indvars.iv153 %arrayidx64 = getelementptr inbounds %struct.complex, ptr %call11, i64 %indvars.iv153 %arrayidx66 = getelementptr inbounds %struct.complex, ptr %call14, i64 %indvars.iv153 %18 = load double, ptr %arrayidx64, align 8 %19 = getelementptr inbounds { double, double }, ptr %arrayidx64, i64 0, i32 1 %20 = load double, ptr %19, align 8 %21 = fneg double %20 %22 = load <2 x double>, ptr %arrayidx66, align 8 %23 = insertelement <2 x double> poison, double %20, i64 0 %24 = insertelement <2 x double> %23, double %21, i64 1 %25 = fmul <2 x double> %22, %24 %26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> <i32 1, i32 0> %27 = insertelement <2 x double> poison, double %18, i64 0 %28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer %29 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %28, <2 x double> %22, <2 x double> %26) store <2 x double> %29, ptr %arrayidx62, align 8 %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.end70, label %for.body60, !llvm.loop !25 for.end70: ; preds = %for.body60, %middle.block tail call void @FFT_reverse(i32 noundef %D.0, ptr noundef nonnull %call17, ptr noundef %call8) br i1 %cmp19141, label %for.body75.lr.ph, label %for.end85 for.body75.lr.ph: ; preds = %for.end70 %conv79 = sitofp i32 %D.0 to double %smax = tail call i32 @llvm.smax.i32(i32 %mul, i32 1) %wide.trip.count161 = zext i32 %smax to i64 %min.iters.check172 = icmp ult i32 %smax, 3 br i1 %min.iters.check172, label %for.body75.preheader, label %vector.ph173 vector.ph173: ; preds = %for.body75.lr.ph %n.mod.vf174 = and i64 %wide.trip.count161, 1 %30 = icmp eq i64 %n.mod.vf174, 0 %31 = select i1 %30, i64 2, i64 %n.mod.vf174 %n.vec175 = sub nsw i64 %wide.trip.count161, %31 %broadcast.splatinsert = insertelement <2 x double> poison, double %conv79, i64 0 %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer br label %vector.body177 vector.body177: ; preds = %vector.body177, %vector.ph173 %index178 = phi i64 [ 0, %vector.ph173 ], [ %index.next179, %vector.body177 ] %32 = or i64 %index178, 1 %33 = getelementptr inbounds %struct.complex, ptr %call8, i64 %index178 %34 = getelementptr inbounds %struct.complex, ptr %call8, i64 %32 %35 = load double, ptr %33, align 8, !tbaa !18 %36 = load double, ptr %34, align 8, !tbaa !18 %37 = insertelement <2 x double> poison, double %35, i64 0 %38 = insertelement <2 x double> %37, double %36, i64 1 %39 = fdiv <2 x double> %38, %broadcast.splat %40 = fadd <2 x double> %39, <double 1.000000e-01, double 1.000000e-01> %41 = fptosi <2 x double> %40 to <2 x i64> %42 = getelementptr inbounds i64, ptr %c, i64 %index178 store <2 x i64> %41, ptr %42, align 8, !tbaa !16 %index.next179 = add nuw i64 %index178, 2 %43 = icmp eq i64 %index.next179, %n.vec175 br i1 %43, label %for.body75.preheader, label %vector.body177, !llvm.loop !26 for.body75.preheader: ; preds = %vector.body177, %for.body75.lr.ph %indvars.iv158.ph = phi i64 [ 0, %for.body75.lr.ph ], [ %n.vec175, %vector.body177 ] br label %for.body75 for.body75: ; preds = %for.body75.preheader, %for.body75 %indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.body75 ], [ %indvars.iv158.ph, %for.body75.preheader ] %arrayidx77 = getelementptr inbounds %struct.complex, ptr %call8, i64 %indvars.iv158 %44 = load double, ptr %arrayidx77, align 8, !tbaa !18 %div = fdiv double %44, %conv79 %add = fadd double %div, 1.000000e-01 %conv80 = fptosi double %add to i64 %arrayidx82 = getelementptr inbounds i64, ptr %c, i64 %indvars.iv158 store i64 %conv80, ptr %arrayidx82, align 8, !tbaa !16 %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end85, label %for.body75, !llvm.loop !27 for.end85: ; preds = %for.body75, %for.end70 tail call void @free(ptr noundef %call) #12 tail call void @free(ptr noundef %call5) #12 tail call void @free(ptr noundef %call8) #12 tail call void @free(ptr noundef %call11) #12 tail call void @free(ptr noundef %call14) #12 tail call void @free(ptr noundef %call17) #12 ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 %A = alloca i32, align 4 %pow = alloca [200003 x i32], align 16 %log = alloca [200003 x i32], align 16 %num = alloca [200003 x i64], align 16 %sq = alloca [400006 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #12 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #12 call void @llvm.lifetime.start.p0(i64 800012, ptr nonnull %pow) #12 call void @llvm.lifetime.start.p0(i64 800012, ptr nonnull %log) #12 call void @llvm.lifetime.start.p0(i64 1600024, ptr nonnull %num) #12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600024) %num, i8 0, i64 1600024, i1 false) br label %for.body for.body: ; preds = %for.body.1, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.body.1 ] %storemerge80 = phi i32 [ 1, %entry ], [ %rem.1, %for.body.1 ] %arrayidx = getelementptr inbounds [200003 x i32], ptr %pow, i64 0, i64 %indvars.iv store i32 %storemerge80, ptr %arrayidx, align 8, !tbaa !28 %idxprom1 = sext i32 %storemerge80 to i64 %arrayidx2 = getelementptr inbounds [200003 x i32], ptr %log, i64 0, i64 %idxprom1 %0 = trunc i64 %indvars.iv to i32 store i32 %0, ptr %arrayidx2, align 4, !tbaa !28 %indvars.iv.next = or i64 %indvars.iv, 1 %mul = shl nsw i32 %storemerge80, 1 %rem = srem i32 %mul, 200003 %exitcond.not = icmp eq i64 %indvars.iv.next, 200003 br i1 %exitcond.not, label %for.end, label %for.body.1, !llvm.loop !30 for.body.1: ; preds = %for.body %arrayidx.1 = getelementptr inbounds [200003 x i32], ptr %pow, i64 0, i64 %indvars.iv.next store i32 %rem, ptr %arrayidx.1, align 4, !tbaa !28 %idxprom1.1 = sext i32 %rem to i64 %arrayidx2.1 = getelementptr inbounds [200003 x i32], ptr %log, i64 0, i64 %idxprom1.1 %1 = trunc i64 %indvars.iv.next to i32 store i32 %1, ptr %arrayidx2.1, align 4, !tbaa !28 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %mul.1 = shl nsw i32 %rem, 1 %rem.1 = srem i32 %mul.1, 200003 br label %for.body for.end: ; preds = %for.body store i32 %rem, ptr %A, align 4, !tbaa !28 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %2 = load i32, ptr %N, align 4, !tbaa !28 %cmp4.not82 = icmp slt i32 %2, 1 br i1 %cmp4.not82, label %for.end15, label %for.body5 for.body5: ; preds = %for.end, %for.inc13 %i.183 = phi i32 [ %inc14, %for.inc13 ], [ 1, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %3 = load i32, ptr %A, align 4, !tbaa !28 %cmp7 = icmp sgt i32 %3, 0 br i1 %cmp7, label %if.then, label %for.inc13 if.then: ; preds = %for.body5 %idxprom8 = zext i32 %3 to i64 %arrayidx9 = getelementptr inbounds [200003 x i32], ptr %log, i64 0, i64 %idxprom8 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !28 %idxprom10 = sext i32 %4 to i64 %arrayidx11 = getelementptr inbounds [200003 x i64], ptr %num, i64 0, i64 %idxprom10 %5 = load i64, ptr %arrayidx11, align 8, !tbaa !16 %inc12 = add nsw i64 %5, 1 store i64 %inc12, ptr %arrayidx11, align 8, !tbaa !16 br label %for.inc13 for.inc13: ; preds = %for.body5, %if.then %inc14 = add nuw nsw i32 %i.183, 1 %6 = load i32, ptr %N, align 4, !tbaa !28 %cmp4.not.not = icmp slt i32 %i.183, %6 br i1 %cmp4.not.not, label %for.body5, label %for.end15, !llvm.loop !31 for.end15: ; preds = %for.inc13, %for.end call void @llvm.lifetime.start.p0(i64 3200048, ptr nonnull %sq) #12 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3200048) %sq, i8 0, i64 3200048, i1 false) call void @prod_poly_FFT(i32 noundef 200003, ptr noundef nonnull %num, ptr noundef nonnull %num, ptr noundef nonnull %sq) br label %for.body20 for.body20: ; preds = %for.end15, %for.body20 %indvars.iv89 = phi i64 [ 0, %for.end15 ], [ %indvars.iv.next90, %for.body20 ] %ans.085 = phi i64 [ 0, %for.end15 ], [ %add, %for.body20 ] %arrayidx22 = getelementptr inbounds [200003 x i64], ptr %num, i64 0, i64 %indvars.iv89 %7 = load i64, ptr %arrayidx22, align 8, !tbaa !16 %mul25 = mul nsw i64 %7, %7 %8 = shl nuw nsw i64 %indvars.iv89, 1 %arrayidx28 = getelementptr inbounds [400006 x i64], ptr %sq, i64 0, i64 %8 %9 = load i64, ptr %arrayidx28, align 16, !tbaa !16 %sub = sub nsw i64 %9, %mul25 store i64 %sub, ptr %arrayidx28, align 16, !tbaa !16 %10 = trunc i64 %8 to i32 %rem30 = urem i32 %10, 200002 %idxprom31 = zext i32 %rem30 to i64 %arrayidx32 = getelementptr inbounds [200003 x i32], ptr %pow, i64 0, i64 %idxprom31 %11 = load i32, ptr %arrayidx32, align 8, !tbaa !28 %conv = sext i32 %11 to i64 %sub38 = add nsw i64 %7, -1 %mul35 = mul i64 %sub38, %7 %mul39 = mul i64 %mul35, %conv %div = sdiv i64 %mul39, 2 %add = add nsw i64 %div, %ans.085 %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %exitcond93.not = icmp eq i64 %indvars.iv.next90, 200003 br i1 %exitcond93.not, label %for.body46, label %for.body20, !llvm.loop !32 for.body46: ; preds = %for.body20, %for.body46 %indvars.iv94 = phi i64 [ %indvars.iv.next95.1, %for.body46 ], [ 0, %for.body20 ] %ans.187 = phi i64 [ %add55.1, %for.body46 ], [ %add, %for.body20 ] %12 = trunc i64 %indvars.iv94 to i32 %rem47 = urem i32 %12, 200002 %idxprom48 = zext i32 %rem47 to i64 %arrayidx49 = getelementptr inbounds [200003 x i32], ptr %pow, i64 0, i64 %idxprom48 %13 = load i32, ptr %arrayidx49, align 8, !tbaa !28 %conv50 = sext i32 %13 to i64 %arrayidx52 = getelementptr inbounds [400006 x i64], ptr %sq, i64 0, i64 %indvars.iv94 %14 = load i64, ptr %arrayidx52, align 16, !tbaa !16 %mul53 = mul nsw i64 %14, %conv50 %div54 = sdiv i64 %mul53, 2 %add55 = add nsw i64 %div54, %ans.187 %indvars.iv.next95 = or i64 %indvars.iv94, 1 %15 = trunc i64 %indvars.iv.next95 to i32 %rem47.1 = urem i32 %15, 200002 %idxprom48.1 = zext i32 %rem47.1 to i64 %arrayidx49.1 = getelementptr inbounds [200003 x i32], ptr %pow, i64 0, i64 %idxprom48.1 %16 = load i32, ptr %arrayidx49.1, align 4, !tbaa !28 %conv50.1 = sext i32 %16 to i64 %arrayidx52.1 = getelementptr inbounds [400006 x i64], ptr %sq, i64 0, i64 %indvars.iv.next95 %17 = load i64, ptr %arrayidx52.1, align 8, !tbaa !16 %mul53.1 = mul nsw i64 %17, %conv50.1 %div54.1 = sdiv i64 %mul53.1, 2 %add55.1 = add nsw i64 %div54.1, %add55 %indvars.iv.next95.1 = add nuw nsw i64 %indvars.iv94, 2 %exitcond97.not.1 = icmp eq i64 %indvars.iv.next95.1, 400006 br i1 %exitcond97.not.1, label %for.end58, label %for.body46, !llvm.loop !33 for.end58: ; preds = %for.body46 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add55.1) %18 = load ptr, ptr @stdout, align 8, !tbaa !34 %call60 = call i32 @fflush(ptr noundef %18) call void @llvm.lifetime.end.p0(i64 3200048, ptr nonnull %sq) #12 call void @llvm.lifetime.end.p0(i64 1600024, ptr nonnull %num) #12 call void @llvm.lifetime.end.p0(i64 800012, ptr nonnull %log) #12 call void @llvm.lifetime.end.p0(i64 800012, ptr nonnull %pow) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #12 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #10 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 = { 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 #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #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 allocsize(0) } 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 = !{i64 0, i64 8, !6, i64 8, i64 8, !6} !6 = !{!7, !7, i64 0} !7 = !{!"double", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11} !16 = !{!17, !17, i64 0} !17 = !{!"long long", !8, i64 0} !18 = !{!19, !7, i64 0} !19 = !{!"", !7, i64 0, !7, i64 8} !20 = !{!19, !7, i64 8} !21 = distinct !{!21, !11} !22 = distinct !{!22, !11, !23, !24} !23 = !{!"llvm.loop.isvectorized", i32 1} !24 = !{!"llvm.loop.unroll.runtime.disable"} !25 = distinct !{!25, !11, !24, !23} !26 = distinct !{!26, !11, !23, !24} !27 = distinct !{!27, !11, !24, !23} !28 = !{!29, !29, i64 0} !29 = !{!"int", !8, i64 0} !30 = distinct !{!30, !11} !31 = distinct !{!31, !11} !32 = distinct !{!32, !11} !33 = distinct !{!33, !11} !34 = !{!35, !35, i64 0} !35 = !{!"any pointer", !8, i64 0}
#include <stdio.h> int main(){ double a,b,c; scanf("%lf",&a); scanf("%lf",&b); scanf("%lf",&c); double result; result = a / c; if(result <= b){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333678/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333678/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 %b = alloca double, align 8 %c = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load double, ptr %a, align 8, !tbaa !5 %1 = load double, ptr %c, align 8, !tbaa !5 %div = fdiv double %0, %1 %2 = load double, ptr %b, align 8, !tbaa !5 %cmp = fcmp ugt double %div, %2 %.str.2..str.1 = select i1 %cmp, ptr @.str.2, ptr @.str.1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int d, t, s; scanf("%d %d %d", &d, &t, &s); if(t*s >= d) printf("Yes\n"); else printf("No\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333728/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333728/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 %t = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %d, align 4, !tbaa !5 %cmp.not = icmp slt i32 %mul, %2 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int d, t, s; scanf("%d %d %d", &d, &t, &s); if(((double)d / (double)s) <= t) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333771/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333771/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %d = alloca i32, align 4 %t = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 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 %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load i32, ptr %d, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %s, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %2 = load i32, ptr %t, align 4, !tbaa !5 %conv2 = sitofp i32 %2 to double %cmp = fcmp ugt double %div, %conv2 %.str.2..str.1 = select i1 %cmp, ptr @.str.2, ptr @.str.1 %call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <ctype.h> #include<math.h> int main(){ int d, s, t; scanf("%d %d %d", &d, &s, &t); long long eq= t*s; if (eq>=d) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333814/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333814/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #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 %d, ptr noundef nonnull %s, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %d, align 4, !tbaa !5 %cmp.not = icmp slt i32 %mul, %2 %str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int d, t, s; scanf("%d %d %d", &d, &t, &s); (d > t * s) ? printf("No") : printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333858/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333858/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"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: %d = alloca i32, align 4 %t = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 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 %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load i32, ptr %d, align 4, !tbaa !5 %1 = load i32, ptr %t, align 4, !tbaa !5 %2 = load i32, ptr %s, align 4, !tbaa !5 %mul = mul nsw i32 %2, %1 %cmp = icmp sgt i32 %0, %mul %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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() { float d,t,s,r; scanf("%f %f %f", &d, &t, &s); r = d/s; if (r <= t) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333900/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f %f %f\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: %d = alloca float, align 4 %t = alloca float, align 4 %s = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 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 %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load float, ptr %d, align 4, !tbaa !5 %1 = load float, ptr %s, align 4, !tbaa !5 %div = fdiv float %0, %1 %2 = load float, ptr %t, align 4, !tbaa !5 %cmp = fcmp ugt float %div, %2 %.str.2..str.1 = select i1 %cmp, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { float d, t, s; float ans; scanf("%e %e %e",&d,&t,&s); ans = t * s; if (ans >= d) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333951/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333951/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%e %e %e\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: %d = alloca float, align 4 %t = alloca float, align 4 %s = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 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 %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load float, ptr %t, align 4, !tbaa !5 %1 = load float, ptr %s, align 4, !tbaa !5 %mul = fmul float %0, %1 %2 = load float, ptr %d, align 4, !tbaa !5 %cmp = fcmp ult float %mul, %2 %.str.2..str.1 = select i1 %cmp, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int d,t,s; scanf("%d %d %d",&d,&t,&s); if (t*s>=d) printf("Yes");else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_333995/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_333995/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %d = alloca i32, align 4 %t = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 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 %d, ptr noundef nonnull %t, ptr noundef nonnull %s) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = load i32, ptr %s, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %d, align 4, !tbaa !5 %cmp.not = icmp slt i32 %mul, %2 %.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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,a,b; scanf("%d",&n); while(n--){ scanf("%d %d",&a,&b); a%=b; if(a)printf("%d\n",a); else printf("%d\n",b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334037/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334037/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a = alloca i32, align 4 %b = 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 %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec5 = add nsw i32 %0, -1 store i32 %dec5, ptr %n, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %rem = srem i32 %2, %1 store i32 %rem, ptr %a, align 4, !tbaa !5 %tobool2.not = icmp eq i32 %rem, 0 %.rem = select i1 %tobool2.not, i32 %1, i32 %rem %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.rem) %3 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N, i, K, P, W; scanf("%d", &N); for(i=0;i < N;i++){ scanf("%d %d", &K, &P); if(K > P){ W = K % P; if(W != 0) printf("%d\n", W); else printf("%d\n", P); }else printf("%d\n", K); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334080/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334080/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %K = alloca i32, align 4 %P = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 0 br i1 %cmp13, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.014 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K, ptr noundef nonnull %P) %1 = load i32, ptr %K, align 4, !tbaa !5 %2 = load i32, ptr %P, align 4, !tbaa !5 %cmp2 = icmp sgt i32 %1, %2 br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body %rem = srem i32 %1, %2 %cmp3.not = icmp eq i32 %rem, 0 %.rem = select i1 %cmp3.not, i32 %2, i32 %rem br label %for.inc for.inc: ; preds = %for.body, %if.then %.sink = phi i32 [ %.rem, %if.then ], [ %1, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.sink) %inc = add nuw nsw i32 %i.014, 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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i,N,K[100],P[100],a[100]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d %d",&K[i],&P[i]); if(P[i]>K[i]){ a[i]=K[i]; } else if(K[i]%P[i]==0){ a[i]=P[i]; } else{ a[i]=K[i]%P[i]; } } for(i=0;i<N;i++){ printf("%d\n",a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334123/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334123/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %K = alloca [100 x i32], align 16 %P = alloca [100 x i32], align 16 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %K) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %P) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.end40 for.cond32.preheader: ; preds = %for.inc %1 = icmp sgt i32 %4, 0 br i1 %1, label %for.body34, label %for.end40 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %K, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i32], ptr %P, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %2, %3 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body %arrayidx12 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv store i32 %3, ptr %arrayidx12, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %for.body %rem = srem i32 %3, %2 %cmp17 = icmp eq i32 %rem, 0 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv br i1 %cmp17, label %if.then18, label %if.else23 if.then18: ; preds = %if.else store i32 %2, ptr %arrayidx22, align 4, !tbaa !5 br label %for.inc if.else23: ; preds = %if.else store i32 %rem, ptr %arrayidx22, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else23, %if.then18 %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.cond32.preheader, !llvm.loop !9 for.body34: ; preds = %for.cond32.preheader, %for.body34 %indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.body34 ], [ 0, %for.cond32.preheader ] %arrayidx36 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv64 %6 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6) %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1 %7 = load i32, ptr %N, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp33 = icmp slt i64 %indvars.iv.next65, %8 br i1 %cmp33, label %for.body34, label %for.end40, !llvm.loop !11 for.end40: ; preds = %for.body34, %entry, %for.cond32.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %P) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ char key[1000]; int i=0; scanf("%s", key); while(key[i] != '\0'){ if(key[i] >= 'D') printf("%c", key[i]-3); else printf("%c", key[i]+23); ++i; } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334167/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334167/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %key = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %key) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key) %0 = load i8, ptr %key, align 16, !tbaa !5 %cmp.not23 = icmp eq i8 %0, 0 br i1 %cmp.not23, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %1 = phi i8 [ %2, %while.body ], [ %0, %entry ] %conv25 = sext i8 %1 to i32 %cmp5 = icmp sgt i8 %1, 67 %. = select i1 %cmp5, i32 -3, i32 23 %add = add nsw i32 %., %conv25 %putchar20 = call i32 @putchar(i32 %add) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1000 x i8], ptr %key, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %key) #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() { int m; scanf("%d",&m); while(m--) { int n; scanf("%d",&n); int q[499999]={0},k,m=0; for(int i=0;i<n;i++) { scanf("%d",&k); if(m<k) m=k; q[k]++; if(q[k]>=2) { q[k]--; q[k+1]++; } } k=0; for(int i=1;i<=m+10;i++) { if(q[i]) k++; } printf("%d\n",k); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33421/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33421/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %m = alloca i32, align 4 %n = alloca i32, align 4 %q = alloca [499999 x i32], align 16 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %dec46 = add nsw i32 %0, -1 store i32 %dec46, ptr %m, align 4, !tbaa !5 %tobool.not47 = icmp eq i32 %0, 0 br i1 %tobool.not47, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup21 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 1999996, ptr nonnull %q) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1999996) %q, i8 0, i64 1999996, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp38 = icmp sgt i32 %1, 0 br i1 %cmp38, label %for.body, label %for.body22.preheader for.body22.preheader: ; preds = %for.inc, %while.body %m2.0.lcssa = phi i32 [ 0, %while.body ], [ %spec.select, %for.inc ] store i32 0, ptr %k, align 4, !tbaa !5 %add19 = add i32 %m2.0.lcssa, 10 %smax = call i32 @llvm.smax.i32(i32 %add19, i32 1) %2 = zext i32 %smax to i64 %xtraiter = and i64 %2, 1 %3 = icmp slt i32 %add19, 2 br i1 %3, label %for.cond.cleanup21.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = and i64 %2, 2147483646 br label %for.body22 for.body: ; preds = %while.body, %for.inc %i.040 = phi i32 [ %inc16, %for.inc ], [ 0, %while.body ] %m2.039 = phi i32 [ %spec.select, %for.inc ], [ 0, %while.body ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %4 = load i32, ptr %k, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %m2.039, i32 %4) %idxprom = sext i32 %4 to i64 %arrayidx = getelementptr inbounds [499999 x i32], ptr %q, i64 0, i64 %idxprom %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %5, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %5, 0 br i1 %cmp7, label %if.then8, label %for.inc if.then8: ; preds = %for.body store i32 %5, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, 1 %idxprom12 = sext i32 %add to i64 %arrayidx13 = getelementptr inbounds [499999 x i32], ptr %q, i64 0, i64 %idxprom12 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %inc14 = add nsw i32 %6, 1 store i32 %inc14, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then8 %inc16 = add nuw nsw i32 %i.040, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc16, %7 br i1 %cmp, label %for.body, label %for.body22.preheader, !llvm.loop !9 for.cond.cleanup21.unr-lcssa: ; preds = %for.inc29.1, %for.body22.preheader %inc2741.lcssa.ph = phi i32 [ undef, %for.body22.preheader ], [ %inc2741.1, %for.inc29.1 ] %indvars.iv.unr = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next.1, %for.inc29.1 ] %inc274244.unr = phi i32 [ 0, %for.body22.preheader ], [ %inc2741.1, %for.inc29.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup21, label %for.body22.epil for.body22.epil: ; preds = %for.cond.cleanup21.unr-lcssa %arrayidx24.epil = getelementptr inbounds [499999 x i32], ptr %q, i64 0, i64 %indvars.iv.unr %8 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5 %tobool25.not.epil = icmp eq i32 %8, 0 br i1 %tobool25.not.epil, label %for.cond.cleanup21, label %if.then26.epil if.then26.epil: ; preds = %for.body22.epil %inc27.epil = add nsw i32 %inc274244.unr, 1 store i32 %inc27.epil, ptr %k, align 4, !tbaa !5 br label %for.cond.cleanup21 for.cond.cleanup21: ; preds = %for.body22.epil, %if.then26.epil, %for.cond.cleanup21.unr-lcssa %inc2741.lcssa = phi i32 [ %inc2741.lcssa.ph, %for.cond.cleanup21.unr-lcssa ], [ %inc274244.unr, %for.body22.epil ], [ %inc27.epil, %if.then26.epil ] %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc2741.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 1999996, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %9 = load i32, ptr %m, align 4, !tbaa !5 %dec = add nsw i32 %9, -1 store i32 %dec, ptr %m, align 4, !tbaa !5 %tobool.not = icmp eq i32 %9, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 for.body22: ; preds = %for.inc29.1, %for.body22.preheader.new %indvars.iv = phi i64 [ 1, %for.body22.preheader.new ], [ %indvars.iv.next.1, %for.inc29.1 ] %inc274244 = phi i32 [ 0, %for.body22.preheader.new ], [ %inc2741.1, %for.inc29.1 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.inc29.1 ] %arrayidx24 = getelementptr inbounds [499999 x i32], ptr %q, i64 0, i64 %indvars.iv %10 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %tobool25.not = icmp eq i32 %10, 0 br i1 %tobool25.not, label %for.inc29, label %if.then26 if.then26: ; preds = %for.body22 %inc27 = add nsw i32 %inc274244, 1 store i32 %inc27, ptr %k, align 4, !tbaa !5 br label %for.inc29 for.inc29: ; preds = %for.body22, %if.then26 %inc2741 = phi i32 [ %inc274244, %for.body22 ], [ %inc27, %if.then26 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx24.1 = getelementptr inbounds [499999 x i32], ptr %q, i64 0, i64 %indvars.iv.next %11 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5 %tobool25.not.1 = icmp eq i32 %11, 0 br i1 %tobool25.not.1, label %for.inc29.1, label %if.then26.1 if.then26.1: ; preds = %for.inc29 %inc27.1 = add nsw i32 %inc2741, 1 store i32 %inc27.1, ptr %k, align 4, !tbaa !5 br label %for.inc29.1 for.inc29.1: ; preds = %if.then26.1, %for.inc29 %inc2741.1 = phi i32 [ %inc2741, %for.inc29 ], [ %inc27.1, %if.then26.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup21.unr-lcssa, label %for.body22, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup21, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main() { char table[26] = {'X','Y','Z','A','B','C','D','E','F','G','H','I','J', 'K','L','M','N','O','P','Q','R','S','T','U','V','W'}; char input[1001]; scanf("%s",input); char c = input[0]; int i; for(i=0; c!='\0'; i++){ printf("%c",table[(c-65)]); c=input[i+1]; } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334253/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334253/source.c" target datalayout = "e-m:e-p270: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.table = private unnamed_addr constant [26 x i8] c"XYZABCDEFGHIJKLMNOPQRSTUVW", align 16 @.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 [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %input) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %c.012 = load i8, ptr %input, align 16, !tbaa !5 %cmp.not13 = icmp eq i8 %c.012, 0 br i1 %cmp.not13, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %c.015 = phi i8 [ %c.0, %for.body ], [ %c.012, %entry ] %conv = sext i8 %c.015 to i64 %sub = add nsw i64 %conv, -65 %arrayidx3 = getelementptr inbounds [26 x i8], ptr @__const.main.table, i64 0, i64 %sub %0 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %conv4 = sext i8 %0 to i32 %putchar11 = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx7 = getelementptr inbounds [1001 x i8], ptr %input, i64 0, i64 %indvars.iv.next %c.0 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %cmp.not = icmp eq i8 %c.0, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 1001, 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 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 str[1001]; char *p; scanf("%s\n",str); p=str; while(*p!='\0'){ if(*p>='D'){ *p-=3; } else { *p+=23; } p++; } printf("%s\n",str); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334325/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334325/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %0 = load i8, ptr %str, align 16, !tbaa !5 %cmp.not16 = icmp eq i8 %0, 0 br i1 %cmp.not16, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %1 = phi i8 [ %2, %while.body ], [ %0, %entry ] %p.017 = phi ptr [ %incdec.ptr, %while.body ], [ %str, %entry ] %cmp4 = icmp sgt i8 %1, 67 %storemerge.v = select i1 %cmp4, i8 -3, i8 23 %storemerge = add i8 %storemerge.v, %1 store i8 %storemerge, ptr %p.017, align 1, !tbaa !5 %incdec.ptr = getelementptr inbounds i8, ptr %p.017, i64 1 %2 = load i8, ptr %incdec.ptr, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str) call void @llvm.lifetime.end.p0(i64 1001, 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 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"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int abs(int x){ if(x>0) return x; else return -x; } long long factorial(int x){ if(x==0) return 1; else return x*((factorial(x-1))%1000000007)%1000000007; } long long combi(int m, int n){ if(abs(m-n)>=2){ return 0; }else if(abs(m-n)==1){ return (factorial(m)*factorial(n))%1000000007; }else{ return (2*factorial(m)*factorial(n))%1000000007; } } int main(){ int n, m; scanf("%d%d",&n,&m); printf("%lld\n", combi(m, n)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334376/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334376/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @abs(i32 noundef %x) local_unnamed_addr #0 { entry: %retval.0 = tail call i32 @llvm.abs.i32(i32 %x, i1 true) ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @factorial(i32 noundef %x) local_unnamed_addr #1 { entry: %cmp = icmp eq i32 %x, 0 br i1 %cmp, label %common.ret4, label %if.else common.ret4: ; preds = %entry, %if.else %common.ret4.op = phi i64 [ %rem1, %if.else ], [ 1, %entry ] ret i64 %common.ret4.op if.else: ; preds = %entry %conv = sext i32 %x to i64 %sub = add nsw i32 %x, -1 %call = tail call i64 @factorial(i32 noundef %sub), !range !5 %mul = mul nsw i64 %call, %conv %rem1 = srem i64 %mul, 1000000007 br label %common.ret4 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @combi(i32 noundef %m, i32 noundef %n) local_unnamed_addr #1 { entry: %sub = sub nsw i32 %m, %n %0 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %cmp = icmp ugt i32 %0, 1 br i1 %cmp, label %return, label %if.else if.else: ; preds = %entry %cmp2 = icmp eq i32 %0, 1 %call = tail call i64 @factorial(i32 noundef %m), !range !5 br i1 %cmp2, label %if.then3, label %if.else5 if.then3: ; preds = %if.else %call4 = tail call i64 @factorial(i32 noundef %n), !range !5 br label %return.sink.split if.else5: ; preds = %if.else %mul7 = shl nsw i64 %call, 1 %call8 = tail call i64 @factorial(i32 noundef %n), !range !5 br label %return.sink.split return.sink.split: ; preds = %if.then3, %if.else5 %call8.sink = phi i64 [ %call8, %if.else5 ], [ %call, %if.then3 ] %mul7.sink = phi i64 [ %mul7, %if.else5 ], [ %call4, %if.then3 ] %mul9 = mul nsw i64 %mul7.sink, %call8.sink %rem10 = srem i64 %mul9, 1000000007 br label %return return: ; preds = %return.sink.split, %entry %retval.0 = phi i64 [ 0, %entry ], [ %rem10, %return.sink.split ] ret i64 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !6 %1 = load i32, ptr %n, align 4, !tbaa !6 %sub.i = sub nsw i32 %0, %1 %2 = call i32 @llvm.abs.i32(i32 %sub.i, i1 true) %cmp.i = icmp ugt i32 %2, 1 br i1 %cmp.i, label %combi.exit, label %if.else.i if.else.i: ; preds = %entry %cmp2.i = icmp eq i32 %2, 1 %call.i = call i64 @factorial(i32 noundef %0), !range !5 br i1 %cmp2.i, label %if.then3.i, label %if.else5.i if.then3.i: ; preds = %if.else.i %call4.i = call i64 @factorial(i32 noundef %1), !range !5 br label %return.sink.split.i if.else5.i: ; preds = %if.else.i %mul7.i = shl nsw i64 %call.i, 1 %call8.i = call i64 @factorial(i32 noundef %1), !range !5 br label %return.sink.split.i return.sink.split.i: ; preds = %if.else5.i, %if.then3.i %call8.sink.i = phi i64 [ %call8.i, %if.else5.i ], [ %call.i, %if.then3.i ] %mul7.sink.i = phi i64 [ %mul7.i, %if.else5.i ], [ %call4.i, %if.then3.i ] %mul9.i = mul nsw i64 %mul7.sink.i, %call8.sink.i %rem10.i = srem i64 %mul9.i, 1000000007 br label %combi.exit combi.exit: ; preds = %entry, %return.sink.split.i %retval.0.i = phi i64 [ 0, %entry ], [ %rem10.i, %return.sink.split.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %retval.0.i) 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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 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 nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i64 -1000000006, i64 1000000007} !6 = !{!7, !7, i64 0} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"}
// AOJ 2656 Taps // 2018.4.6 bal4u #include <stdio.h> #include <string.h> #include <math.h> //#define getchar_unlocked() getchar() int in() { int n = 0, c = getchar_unlocked(); do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } #define EPS 1e-6 #define EQ(a,b) (fabs((a)-(b))<EPS) int T, D, ta, tb, da, db; int ok(int a, int b) { int t = a*da + b*db; return t >= 1 && t <= D; } double calc2() { int a, b; double s, t, ans; s = (double)(ta-tb)/(ta-T) * db; ans = 100; for (b = 1; ; b++) { t = b*s; if (!EQ(t, 1) && t <= 1) continue; if (!EQ(t, D) && t >= D) break; t = (double)(T-tb)*db*b / ((ta-T)*da); a = (int)t; if (a < 0) continue; if (!ok(a, b)) continue; t = ta*a*da + tb*b*db, t /= a*da+b*db, t = fabs(T-t); if (t < ans) ans = t; if (!ok(++a, b)) continue; t = ta*a*da + tb*b*db, t /= a*da+b*db, t = fabs(T-t); if (t < ans) ans = t; } return ans; } double calc() { int x; double t, ans; if (ta == tb) return fabs(T-ta); if (ta == T || tb == T) return 0; t = ta; if (t < tb) t = tb; if (T > t) return T-t; t = ta; if (t > tb) t = tb; if (T < t) return t-T; ans = fabs(T-ta), t = fabs(T-tb); if (t < ans) ans = t; t = calc2(); if (t < ans) ans = t; x = ta, ta = tb, tb = x; x = da, da = db, db = x; t = calc2(); if (t < ans) ans = t; return ans; } int main() { T = in(), D = in(); ta = in(), tb = in(); da = in(), db = in(); printf("%.10lf\n", calc()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334426/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334426/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @da = dso_local local_unnamed_addr global i32 0, align 4 @db = dso_local local_unnamed_addr global i32 0, align 4 @D = dso_local local_unnamed_addr global i32 0, align 4 @ta = dso_local local_unnamed_addr global i32 0, align 4 @tb = dso_local local_unnamed_addr global i32 0, align 4 @T = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7 %.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.preheader cond.false.i: ; preds = %entry %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %do.body.preheader do.body.preheader: ; preds = %cond.true.i, %cond.false.i %.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ] %c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ] br label %do.body do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13 %4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ] %mul = mul nsw i32 %n.0, 10 %and = and i32 %c.0, 15 %add = add nsw i32 %and, %mul %_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !9 %_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !14 %cmp.not.i6 = icmp ult ptr %5, %6 br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !15 cond.true.i7: ; preds = %do.body %call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #7 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13 cond.false.i10: ; preds = %do.body %incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i12 = zext i8 %7 to i32 br label %getchar_unlocked.exit13 getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10 %8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ] %cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ] %cmp = icmp sgt i32 %cond.i9, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit13 ret i32 %add } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @ok(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr @da, align 4, !tbaa !19 %mul = mul nsw i32 %0, %a %1 = load i32, ptr @db, align 4, !tbaa !19 %mul1 = mul nsw i32 %1, %b %add = add nsw i32 %mul1, %mul %cmp = icmp sgt i32 %add, 0 %2 = load i32, ptr @D, align 4 %cmp2 = icmp sle i32 %add, %2 %3 = select i1 %cmp, i1 %cmp2, i1 false %land.ext = zext i1 %3 to i32 ret i32 %land.ext } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local double @calc2() local_unnamed_addr #2 { entry: %0 = load i32, ptr @ta, align 4, !tbaa !19 %1 = load i32, ptr @tb, align 4, !tbaa !19 %sub = sub nsw i32 %0, %1 %conv = sitofp i32 %sub to double %2 = load i32, ptr @T, align 4, !tbaa !19 %sub1 = sub nsw i32 %0, %2 %conv2 = sitofp i32 %sub1 to double %div = fdiv double %conv, %conv2 %3 = load i32, ptr @db, align 4, !tbaa !19 %conv3 = sitofp i32 %3 to double %mul = fmul double %div, %conv3 %4 = load i32, ptr @D, align 4 %conv10 = sitofp i32 %4 to double %sub20 = sub nsw i32 %2, %1 %conv21 = sitofp i32 %sub20 to double %mul23 = fmul double %conv21, %conv3 %5 = load i32, ptr @da, align 4 %mul27 = mul nsw i32 %5, %sub1 %conv28 = sitofp i32 %mul27 to double %mul37 = mul i32 %5, %0 %mul39 = mul i32 %3, %1 %conv47 = sitofp i32 %2 to double br label %for.cond for.cond: ; preds = %for.inc, %entry %b.0 = phi i32 [ 1, %entry ], [ %inc74, %for.inc ] %ans.0 = phi double [ 1.000000e+02, %entry ], [ %ans.2, %for.inc ] %conv4 = sitofp i32 %b.0 to double %mul5 = fmul double %mul, %conv4 %sub6 = fadd double %mul5, -1.000000e+00 %6 = tail call double @llvm.fabs.f64(double %sub6) %cmp = fcmp uge double %6, 0x3EB0C6F7A0B5ED8D %cmp8 = fcmp ole double %mul5, 1.000000e+00 %or.cond = select i1 %cmp, i1 %cmp8, i1 false br i1 %or.cond, label %for.inc, label %if.end if.end: ; preds = %for.cond %sub11 = fsub double %mul5, %conv10 %7 = tail call double @llvm.fabs.f64(double %sub11) %cmp12 = fcmp olt double %7, 0x3EB0C6F7A0B5ED8D %cmp16 = fcmp ult double %mul5, %conv10 %or.cond104 = select i1 %cmp12, i1 true, i1 %cmp16 br i1 %or.cond104, label %if.end19, label %for.end if.end19: ; preds = %if.end %mul25 = fmul double %mul23, %conv4 %div29 = fdiv double %mul25, %conv28 %conv30 = fptosi double %div29 to i32 %cmp31 = icmp slt i32 %conv30, 0 br i1 %cmp31, label %for.inc, label %if.end34 if.end34: ; preds = %if.end19 %mul.i = mul nsw i32 %5, %conv30 %mul1.i = mul nsw i32 %b.0, %3 %add.i = add nsw i32 %mul.i, %mul1.i %cmp.i = icmp slt i32 %add.i, 1 %cmp2.i = icmp sgt i32 %add.i, %4 %.not = select i1 %cmp.i, i1 true, i1 %cmp2.i br i1 %.not, label %for.inc, label %if.end36 if.end36: ; preds = %if.end34 %mul38 = mul i32 %mul37, %conv30 %mul40 = mul i32 %mul39, %b.0 %add = add nsw i32 %mul38, %mul40 %conv41 = sitofp i32 %add to double %conv45 = sitofp i32 %add.i to double %div46 = fdiv double %conv41, %conv45 %sub48 = fsub double %conv47, %div46 %8 = tail call double @llvm.fabs.f64(double %sub48) %cmp49 = fcmp olt double %8, %ans.0 %ans.1 = select i1 %cmp49, double %8, double %ans.0 %inc = add nuw nsw i32 %conv30, 1 %mul.i105 = mul nsw i32 %inc, %5 %add.i107 = add nsw i32 %mul.i105, %mul1.i %cmp.i108 = icmp slt i32 %add.i107, 1 %cmp2.i109 = icmp sgt i32 %add.i107, %4 %.not111 = select i1 %cmp.i108, i1 true, i1 %cmp2.i109 br i1 %.not111, label %for.inc, label %if.end56 if.end56: ; preds = %if.end36 %mul58 = mul i32 %mul37, %inc %add61 = add nsw i32 %mul58, %mul40 %conv62 = sitofp i32 %add61 to double %conv66 = sitofp i32 %add.i107 to double %div67 = fdiv double %conv62, %conv66 %sub69 = fsub double %conv47, %div67 %9 = tail call double @llvm.fabs.f64(double %sub69) %cmp70 = fcmp olt double %9, %ans.1 br i1 %cmp70, label %if.then72, label %for.inc if.then72: ; preds = %if.end56 br label %for.inc for.inc: ; preds = %if.end56, %if.then72, %if.end36, %if.end34, %if.end19, %for.cond %ans.2 = phi double [ %ans.0, %for.cond ], [ %ans.0, %if.end19 ], [ %9, %if.then72 ], [ %ans.1, %if.end56 ], [ %ans.1, %if.end36 ], [ %ans.0, %if.end34 ] %inc74 = add nuw nsw i32 %b.0, 1 br label %for.cond for.end: ; preds = %if.end ret double %ans.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #3 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local double @calc() local_unnamed_addr #4 { entry: %0 = load i32, ptr @ta, align 4, !tbaa !19 %1 = load i32, ptr @tb, align 4, !tbaa !19 %cmp = icmp eq i32 %0, %1 %2 = load i32, ptr @T, align 4, !tbaa !19 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %sub = sub nsw i32 %2, %0 %conv = sitofp i32 %sub to double %3 = tail call double @llvm.fabs.f64(double %conv) br label %cleanup if.end: ; preds = %entry %cmp1 = icmp eq i32 %0, %2 %cmp3 = icmp eq i32 %1, %2 %or.cond = or i1 %cmp1, %cmp3 br i1 %or.cond, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %conv7 = sitofp i32 %0 to double %conv8 = sitofp i32 %1 to double %cmp9 = fcmp olt double %conv7, %conv8 %t.0 = select i1 %cmp9, double %conv8, double %conv7 %conv14 = sitofp i32 %2 to double %cmp15 = fcmp olt double %t.0, %conv14 br i1 %cmp15, label %if.then17, label %if.end20 if.then17: ; preds = %if.end6 %sub19 = fsub double %conv14, %t.0 br label %cleanup if.end20: ; preds = %if.end6 %cmp23 = fcmp ogt double %conv7, %conv8 %t.1 = select i1 %cmp23, double %conv8, double %conv7 %cmp29 = fcmp ogt double %t.1, %conv14 br i1 %cmp29, label %if.then31, label %if.end34 if.then31: ; preds = %if.end20 %sub33 = fsub double %t.1, %conv14 br label %cleanup if.end34: ; preds = %if.end20 %sub35 = sub nsw i32 %2, %0 %conv36 = sitofp i32 %sub35 to double %4 = tail call double @llvm.fabs.f64(double %conv36) %sub37 = sub nsw i32 %2, %1 %conv38 = sitofp i32 %sub37 to double %5 = tail call double @llvm.fabs.f64(double %conv38) %cmp39 = fcmp olt double %5, %4 %ans.0 = select i1 %cmp39, double %5, double %4 %call = tail call double @calc2() %cmp43 = fcmp olt double %call, %ans.0 %ans.1 = select i1 %cmp43, double %call, double %ans.0 store i32 %1, ptr @ta, align 4, !tbaa !19 store i32 %0, ptr @tb, align 4, !tbaa !19 %6 = load i32, ptr @da, align 4, !tbaa !19 %7 = load i32, ptr @db, align 4, !tbaa !19 store i32 %7, ptr @da, align 4, !tbaa !19 store i32 %6, ptr @db, align 4, !tbaa !19 %call47 = tail call double @calc2() %cmp48 = fcmp olt double %call47, %ans.1 %ans.2 = select i1 %cmp48, double %call47, double %ans.1 br label %cleanup cleanup: ; preds = %if.end, %if.end34, %if.then31, %if.then17, %if.then %retval.0 = phi double [ %3, %if.then ], [ %sub19, %if.then17 ], [ %sub33, %if.then31 ], [ %ans.2, %if.end34 ], [ 0.000000e+00, %if.end ] ret double %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %entry %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7 %.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %entry %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %do.body.i.preheader do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i %.ph179 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ] %c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ] br label %do.body.i do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i %4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph179, %do.body.i.preheader ] %n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ] %mul.i = mul nsw i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add.i = add nsw i32 %and.i, %mul.i %_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9 %_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !14 %cmp.not.i6.i = icmp ult ptr %5, %6 br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !15 cond.true.i7.i: ; preds = %do.body.i %call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #7 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i cond.false.i10.i: ; preds = %do.body.i %incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i12.i = zext i8 %7 to i32 br label %getchar_unlocked.exit13.i getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i %8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ] %cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ] %cmp.i = icmp sgt i32 %cond.i9.i, 47 br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17 in.exit: ; preds = %getchar_unlocked.exit13.i store i32 %add.i, ptr @T, align 4, !tbaa !19 %_IO_read_ptr.i.i8 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i.i8, align 8, !tbaa !9 %_IO_read_end.i.i9 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i.i9, align 8, !tbaa !14 %cmp.not.i.i10 = icmp ult ptr %9, %10 br i1 %cmp.not.i.i10, label %cond.false.i.i35, label %cond.true.i.i11, !prof !15 cond.true.i.i11: ; preds = %in.exit %call.i.i12 = tail call i32 @__uflow(ptr noundef nonnull %8) #7 %.pre14.pre.i13 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i17.preheader cond.false.i.i35: ; preds = %in.exit %incdec.ptr.i.i36 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i.i36, ptr %_IO_read_ptr.i.i8, align 8, !tbaa !9 %11 = load i8, ptr %9, align 1, !tbaa !16 %conv3.i.i37 = zext i8 %11 to i32 br label %do.body.i17.preheader do.body.i17.preheader: ; preds = %cond.false.i.i35, %cond.true.i.i11 %.ph177 = phi ptr [ %8, %cond.false.i.i35 ], [ %.pre14.pre.i13, %cond.true.i.i11 ] %c.0.i19.ph = phi i32 [ %conv3.i.i37, %cond.false.i.i35 ], [ %call.i.i12, %cond.true.i.i11 ] br label %do.body.i17 do.body.i17: ; preds = %do.body.i17.preheader, %getchar_unlocked.exit13.i29 %12 = phi ptr [ %16, %getchar_unlocked.exit13.i29 ], [ %.ph177, %do.body.i17.preheader ] %n.0.i18 = phi i32 [ %add.i22, %getchar_unlocked.exit13.i29 ], [ 0, %do.body.i17.preheader ] %c.0.i19 = phi i32 [ %cond.i9.i30, %getchar_unlocked.exit13.i29 ], [ %c.0.i19.ph, %do.body.i17.preheader ] %mul.i20 = mul nsw i32 %n.0.i18, 10 %and.i21 = and i32 %c.0.i19, 15 %add.i22 = add nsw i32 %and.i21, %mul.i20 %_IO_read_ptr.i4.i23 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i4.i23, align 8, !tbaa !9 %_IO_read_end.i5.i24 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i5.i24, align 8, !tbaa !14 %cmp.not.i6.i25 = icmp ult ptr %13, %14 br i1 %cmp.not.i6.i25, label %cond.false.i10.i32, label %cond.true.i7.i26, !prof !15 cond.true.i7.i26: ; preds = %do.body.i17 %call.i8.i27 = tail call i32 @__uflow(ptr noundef nonnull %12) #7 %.pre.i28 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i29 cond.false.i10.i32: ; preds = %do.body.i17 %incdec.ptr.i11.i33 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i11.i33, ptr %_IO_read_ptr.i4.i23, align 8, !tbaa !9 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i12.i34 = zext i8 %15 to i32 br label %getchar_unlocked.exit13.i29 getchar_unlocked.exit13.i29: ; preds = %cond.false.i10.i32, %cond.true.i7.i26 %16 = phi ptr [ %.pre.i28, %cond.true.i7.i26 ], [ %12, %cond.false.i10.i32 ] %cond.i9.i30 = phi i32 [ %call.i8.i27, %cond.true.i7.i26 ], [ %conv3.i12.i34, %cond.false.i10.i32 ] %cmp.i31 = icmp sgt i32 %cond.i9.i30, 47 br i1 %cmp.i31, label %do.body.i17, label %in.exit38, !llvm.loop !17 in.exit38: ; preds = %getchar_unlocked.exit13.i29 store i32 %add.i22, ptr @D, align 4, !tbaa !19 %_IO_read_ptr.i.i39 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 1 %17 = load ptr, ptr %_IO_read_ptr.i.i39, align 8, !tbaa !9 %_IO_read_end.i.i40 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 2 %18 = load ptr, ptr %_IO_read_end.i.i40, align 8, !tbaa !14 %cmp.not.i.i41 = icmp ult ptr %17, %18 br i1 %cmp.not.i.i41, label %cond.false.i.i66, label %cond.true.i.i42, !prof !15 cond.true.i.i42: ; preds = %in.exit38 %call.i.i43 = tail call i32 @__uflow(ptr noundef nonnull %16) #7 %.pre14.pre.i44 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i48.preheader cond.false.i.i66: ; preds = %in.exit38 %incdec.ptr.i.i67 = getelementptr inbounds i8, ptr %17, i64 1 store ptr %incdec.ptr.i.i67, ptr %_IO_read_ptr.i.i39, align 8, !tbaa !9 %19 = load i8, ptr %17, align 1, !tbaa !16 %conv3.i.i68 = zext i8 %19 to i32 br label %do.body.i48.preheader do.body.i48.preheader: ; preds = %cond.false.i.i66, %cond.true.i.i42 %.ph175 = phi ptr [ %16, %cond.false.i.i66 ], [ %.pre14.pre.i44, %cond.true.i.i42 ] %c.0.i50.ph = phi i32 [ %conv3.i.i68, %cond.false.i.i66 ], [ %call.i.i43, %cond.true.i.i42 ] br label %do.body.i48 do.body.i48: ; preds = %do.body.i48.preheader, %getchar_unlocked.exit13.i60 %20 = phi ptr [ %24, %getchar_unlocked.exit13.i60 ], [ %.ph175, %do.body.i48.preheader ] %n.0.i49 = phi i32 [ %add.i53, %getchar_unlocked.exit13.i60 ], [ 0, %do.body.i48.preheader ] %c.0.i50 = phi i32 [ %cond.i9.i61, %getchar_unlocked.exit13.i60 ], [ %c.0.i50.ph, %do.body.i48.preheader ] %mul.i51 = mul nsw i32 %n.0.i49, 10 %and.i52 = and i32 %c.0.i50, 15 %add.i53 = add nsw i32 %and.i52, %mul.i51 %_IO_read_ptr.i4.i54 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 1 %21 = load ptr, ptr %_IO_read_ptr.i4.i54, align 8, !tbaa !9 %_IO_read_end.i5.i55 = getelementptr inbounds %struct._IO_FILE, ptr %20, i64 0, i32 2 %22 = load ptr, ptr %_IO_read_end.i5.i55, align 8, !tbaa !14 %cmp.not.i6.i56 = icmp ult ptr %21, %22 br i1 %cmp.not.i6.i56, label %cond.false.i10.i63, label %cond.true.i7.i57, !prof !15 cond.true.i7.i57: ; preds = %do.body.i48 %call.i8.i58 = tail call i32 @__uflow(ptr noundef nonnull %20) #7 %.pre.i59 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i60 cond.false.i10.i63: ; preds = %do.body.i48 %incdec.ptr.i11.i64 = getelementptr inbounds i8, ptr %21, i64 1 store ptr %incdec.ptr.i11.i64, ptr %_IO_read_ptr.i4.i54, align 8, !tbaa !9 %23 = load i8, ptr %21, align 1, !tbaa !16 %conv3.i12.i65 = zext i8 %23 to i32 br label %getchar_unlocked.exit13.i60 getchar_unlocked.exit13.i60: ; preds = %cond.false.i10.i63, %cond.true.i7.i57 %24 = phi ptr [ %.pre.i59, %cond.true.i7.i57 ], [ %20, %cond.false.i10.i63 ] %cond.i9.i61 = phi i32 [ %call.i8.i58, %cond.true.i7.i57 ], [ %conv3.i12.i65, %cond.false.i10.i63 ] %cmp.i62 = icmp sgt i32 %cond.i9.i61, 47 br i1 %cmp.i62, label %do.body.i48, label %in.exit69, !llvm.loop !17 in.exit69: ; preds = %getchar_unlocked.exit13.i60 store i32 %add.i53, ptr @ta, align 4, !tbaa !19 %_IO_read_ptr.i.i70 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 1 %25 = load ptr, ptr %_IO_read_ptr.i.i70, align 8, !tbaa !9 %_IO_read_end.i.i71 = getelementptr inbounds %struct._IO_FILE, ptr %24, i64 0, i32 2 %26 = load ptr, ptr %_IO_read_end.i.i71, align 8, !tbaa !14 %cmp.not.i.i72 = icmp ult ptr %25, %26 br i1 %cmp.not.i.i72, label %cond.false.i.i97, label %cond.true.i.i73, !prof !15 cond.true.i.i73: ; preds = %in.exit69 %call.i.i74 = tail call i32 @__uflow(ptr noundef nonnull %24) #7 %.pre14.pre.i75 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i79.preheader cond.false.i.i97: ; preds = %in.exit69 %incdec.ptr.i.i98 = getelementptr inbounds i8, ptr %25, i64 1 store ptr %incdec.ptr.i.i98, ptr %_IO_read_ptr.i.i70, align 8, !tbaa !9 %27 = load i8, ptr %25, align 1, !tbaa !16 %conv3.i.i99 = zext i8 %27 to i32 br label %do.body.i79.preheader do.body.i79.preheader: ; preds = %cond.false.i.i97, %cond.true.i.i73 %.ph173 = phi ptr [ %24, %cond.false.i.i97 ], [ %.pre14.pre.i75, %cond.true.i.i73 ] %c.0.i81.ph = phi i32 [ %conv3.i.i99, %cond.false.i.i97 ], [ %call.i.i74, %cond.true.i.i73 ] br label %do.body.i79 do.body.i79: ; preds = %do.body.i79.preheader, %getchar_unlocked.exit13.i91 %28 = phi ptr [ %32, %getchar_unlocked.exit13.i91 ], [ %.ph173, %do.body.i79.preheader ] %n.0.i80 = phi i32 [ %add.i84, %getchar_unlocked.exit13.i91 ], [ 0, %do.body.i79.preheader ] %c.0.i81 = phi i32 [ %cond.i9.i92, %getchar_unlocked.exit13.i91 ], [ %c.0.i81.ph, %do.body.i79.preheader ] %mul.i82 = mul nsw i32 %n.0.i80, 10 %and.i83 = and i32 %c.0.i81, 15 %add.i84 = add nsw i32 %and.i83, %mul.i82 %_IO_read_ptr.i4.i85 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 1 %29 = load ptr, ptr %_IO_read_ptr.i4.i85, align 8, !tbaa !9 %_IO_read_end.i5.i86 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 2 %30 = load ptr, ptr %_IO_read_end.i5.i86, align 8, !tbaa !14 %cmp.not.i6.i87 = icmp ult ptr %29, %30 br i1 %cmp.not.i6.i87, label %cond.false.i10.i94, label %cond.true.i7.i88, !prof !15 cond.true.i7.i88: ; preds = %do.body.i79 %call.i8.i89 = tail call i32 @__uflow(ptr noundef nonnull %28) #7 %.pre.i90 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i91 cond.false.i10.i94: ; preds = %do.body.i79 %incdec.ptr.i11.i95 = getelementptr inbounds i8, ptr %29, i64 1 store ptr %incdec.ptr.i11.i95, ptr %_IO_read_ptr.i4.i85, align 8, !tbaa !9 %31 = load i8, ptr %29, align 1, !tbaa !16 %conv3.i12.i96 = zext i8 %31 to i32 br label %getchar_unlocked.exit13.i91 getchar_unlocked.exit13.i91: ; preds = %cond.false.i10.i94, %cond.true.i7.i88 %32 = phi ptr [ %.pre.i90, %cond.true.i7.i88 ], [ %28, %cond.false.i10.i94 ] %cond.i9.i92 = phi i32 [ %call.i8.i89, %cond.true.i7.i88 ], [ %conv3.i12.i96, %cond.false.i10.i94 ] %cmp.i93 = icmp sgt i32 %cond.i9.i92, 47 br i1 %cmp.i93, label %do.body.i79, label %in.exit100, !llvm.loop !17 in.exit100: ; preds = %getchar_unlocked.exit13.i91 store i32 %add.i84, ptr @tb, align 4, !tbaa !19 %_IO_read_ptr.i.i101 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 1 %33 = load ptr, ptr %_IO_read_ptr.i.i101, align 8, !tbaa !9 %_IO_read_end.i.i102 = getelementptr inbounds %struct._IO_FILE, ptr %32, i64 0, i32 2 %34 = load ptr, ptr %_IO_read_end.i.i102, align 8, !tbaa !14 %cmp.not.i.i103 = icmp ult ptr %33, %34 br i1 %cmp.not.i.i103, label %cond.false.i.i128, label %cond.true.i.i104, !prof !15 cond.true.i.i104: ; preds = %in.exit100 %call.i.i105 = tail call i32 @__uflow(ptr noundef nonnull %32) #7 %.pre14.pre.i106 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i110.preheader cond.false.i.i128: ; preds = %in.exit100 %incdec.ptr.i.i129 = getelementptr inbounds i8, ptr %33, i64 1 store ptr %incdec.ptr.i.i129, ptr %_IO_read_ptr.i.i101, align 8, !tbaa !9 %35 = load i8, ptr %33, align 1, !tbaa !16 %conv3.i.i130 = zext i8 %35 to i32 br label %do.body.i110.preheader do.body.i110.preheader: ; preds = %cond.false.i.i128, %cond.true.i.i104 %.ph172 = phi ptr [ %32, %cond.false.i.i128 ], [ %.pre14.pre.i106, %cond.true.i.i104 ] %c.0.i112.ph = phi i32 [ %conv3.i.i130, %cond.false.i.i128 ], [ %call.i.i105, %cond.true.i.i104 ] br label %do.body.i110 do.body.i110: ; preds = %do.body.i110.preheader, %getchar_unlocked.exit13.i122 %36 = phi ptr [ %40, %getchar_unlocked.exit13.i122 ], [ %.ph172, %do.body.i110.preheader ] %n.0.i111 = phi i32 [ %add.i115, %getchar_unlocked.exit13.i122 ], [ 0, %do.body.i110.preheader ] %c.0.i112 = phi i32 [ %cond.i9.i123, %getchar_unlocked.exit13.i122 ], [ %c.0.i112.ph, %do.body.i110.preheader ] %mul.i113 = mul nsw i32 %n.0.i111, 10 %and.i114 = and i32 %c.0.i112, 15 %add.i115 = add nsw i32 %and.i114, %mul.i113 %_IO_read_ptr.i4.i116 = getelementptr inbounds %struct._IO_FILE, ptr %36, i64 0, i32 1 %37 = load ptr, ptr %_IO_read_ptr.i4.i116, align 8, !tbaa !9 %_IO_read_end.i5.i117 = getelementptr inbounds %struct._IO_FILE, ptr %36, i64 0, i32 2 %38 = load ptr, ptr %_IO_read_end.i5.i117, align 8, !tbaa !14 %cmp.not.i6.i118 = icmp ult ptr %37, %38 br i1 %cmp.not.i6.i118, label %cond.false.i10.i125, label %cond.true.i7.i119, !prof !15 cond.true.i7.i119: ; preds = %do.body.i110 %call.i8.i120 = tail call i32 @__uflow(ptr noundef nonnull %36) #7 %.pre.i121 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i122 cond.false.i10.i125: ; preds = %do.body.i110 %incdec.ptr.i11.i126 = getelementptr inbounds i8, ptr %37, i64 1 store ptr %incdec.ptr.i11.i126, ptr %_IO_read_ptr.i4.i116, align 8, !tbaa !9 %39 = load i8, ptr %37, align 1, !tbaa !16 %conv3.i12.i127 = zext i8 %39 to i32 br label %getchar_unlocked.exit13.i122 getchar_unlocked.exit13.i122: ; preds = %cond.false.i10.i125, %cond.true.i7.i119 %40 = phi ptr [ %.pre.i121, %cond.true.i7.i119 ], [ %36, %cond.false.i10.i125 ] %cond.i9.i123 = phi i32 [ %call.i8.i120, %cond.true.i7.i119 ], [ %conv3.i12.i127, %cond.false.i10.i125 ] %cmp.i124 = icmp sgt i32 %cond.i9.i123, 47 br i1 %cmp.i124, label %do.body.i110, label %in.exit131, !llvm.loop !17 in.exit131: ; preds = %getchar_unlocked.exit13.i122 store i32 %add.i115, ptr @da, align 4, !tbaa !19 %_IO_read_ptr.i.i132 = getelementptr inbounds %struct._IO_FILE, ptr %40, i64 0, i32 1 %41 = load ptr, ptr %_IO_read_ptr.i.i132, align 8, !tbaa !9 %_IO_read_end.i.i133 = getelementptr inbounds %struct._IO_FILE, ptr %40, i64 0, i32 2 %42 = load ptr, ptr %_IO_read_end.i.i133, align 8, !tbaa !14 %cmp.not.i.i134 = icmp ult ptr %41, %42 br i1 %cmp.not.i.i134, label %cond.false.i.i159, label %cond.true.i.i135, !prof !15 cond.true.i.i135: ; preds = %in.exit131 %call.i.i136 = tail call i32 @__uflow(ptr noundef nonnull %40) #7 %.pre14.pre.i137 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i141.preheader cond.false.i.i159: ; preds = %in.exit131 %incdec.ptr.i.i160 = getelementptr inbounds i8, ptr %41, i64 1 store ptr %incdec.ptr.i.i160, ptr %_IO_read_ptr.i.i132, align 8, !tbaa !9 %43 = load i8, ptr %41, align 1, !tbaa !16 %conv3.i.i161 = zext i8 %43 to i32 br label %do.body.i141.preheader do.body.i141.preheader: ; preds = %cond.false.i.i159, %cond.true.i.i135 %.ph = phi ptr [ %40, %cond.false.i.i159 ], [ %.pre14.pre.i137, %cond.true.i.i135 ] %c.0.i143.ph = phi i32 [ %conv3.i.i161, %cond.false.i.i159 ], [ %call.i.i136, %cond.true.i.i135 ] br label %do.body.i141 do.body.i141: ; preds = %do.body.i141.preheader, %getchar_unlocked.exit13.i153 %44 = phi ptr [ %48, %getchar_unlocked.exit13.i153 ], [ %.ph, %do.body.i141.preheader ] %n.0.i142 = phi i32 [ %add.i146, %getchar_unlocked.exit13.i153 ], [ 0, %do.body.i141.preheader ] %c.0.i143 = phi i32 [ %cond.i9.i154, %getchar_unlocked.exit13.i153 ], [ %c.0.i143.ph, %do.body.i141.preheader ] %mul.i144 = mul nsw i32 %n.0.i142, 10 %and.i145 = and i32 %c.0.i143, 15 %add.i146 = add nsw i32 %and.i145, %mul.i144 %_IO_read_ptr.i4.i147 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 1 %45 = load ptr, ptr %_IO_read_ptr.i4.i147, align 8, !tbaa !9 %_IO_read_end.i5.i148 = getelementptr inbounds %struct._IO_FILE, ptr %44, i64 0, i32 2 %46 = load ptr, ptr %_IO_read_end.i5.i148, align 8, !tbaa !14 %cmp.not.i6.i149 = icmp ult ptr %45, %46 br i1 %cmp.not.i6.i149, label %cond.false.i10.i156, label %cond.true.i7.i150, !prof !15 cond.true.i7.i150: ; preds = %do.body.i141 %call.i8.i151 = tail call i32 @__uflow(ptr noundef nonnull %44) #7 %.pre.i152 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit13.i153 cond.false.i10.i156: ; preds = %do.body.i141 %incdec.ptr.i11.i157 = getelementptr inbounds i8, ptr %45, i64 1 store ptr %incdec.ptr.i11.i157, ptr %_IO_read_ptr.i4.i147, align 8, !tbaa !9 %47 = load i8, ptr %45, align 1, !tbaa !16 %conv3.i12.i158 = zext i8 %47 to i32 br label %getchar_unlocked.exit13.i153 getchar_unlocked.exit13.i153: ; preds = %cond.false.i10.i156, %cond.true.i7.i150 %48 = phi ptr [ %.pre.i152, %cond.true.i7.i150 ], [ %44, %cond.false.i10.i156 ] %cond.i9.i154 = phi i32 [ %call.i8.i151, %cond.true.i7.i150 ], [ %conv3.i12.i158, %cond.false.i10.i156 ] %cmp.i155 = icmp sgt i32 %cond.i9.i154, 47 br i1 %cmp.i155, label %do.body.i141, label %in.exit162, !llvm.loop !17 in.exit162: ; preds = %getchar_unlocked.exit13.i153 store i32 %add.i146, ptr @db, align 4, !tbaa !19 %49 = load i32, ptr @ta, align 4, !tbaa !19 %50 = load i32, ptr @tb, align 4, !tbaa !19 %cmp.i163 = icmp eq i32 %49, %50 %51 = load i32, ptr @T, align 4, !tbaa !19 br i1 %cmp.i163, label %if.then.i, label %if.end.i if.then.i: ; preds = %in.exit162 %sub.i = sub nsw i32 %51, %49 %conv.i = sitofp i32 %sub.i to double %52 = tail call double @llvm.fabs.f64(double %conv.i) br label %calc.exit if.end.i: ; preds = %in.exit162 %cmp1.i = icmp eq i32 %49, %51 %cmp3.i = icmp eq i32 %50, %51 %or.cond.i = or i1 %cmp1.i, %cmp3.i br i1 %or.cond.i, label %calc.exit, label %if.end6.i if.end6.i: ; preds = %if.end.i %conv7.i = sitofp i32 %49 to double %conv8.i = sitofp i32 %50 to double %cmp9.i = fcmp olt double %conv7.i, %conv8.i %t.0.i = select i1 %cmp9.i, double %conv8.i, double %conv7.i %conv14.i = sitofp i32 %51 to double %cmp15.i = fcmp olt double %t.0.i, %conv14.i br i1 %cmp15.i, label %if.then17.i, label %if.end20.i if.then17.i: ; preds = %if.end6.i %sub19.i = fsub double %conv14.i, %t.0.i br label %calc.exit if.end20.i: ; preds = %if.end6.i %cmp23.i = fcmp ogt double %conv7.i, %conv8.i %t.1.i = select i1 %cmp23.i, double %conv8.i, double %conv7.i %cmp29.i = fcmp ogt double %t.1.i, %conv14.i br i1 %cmp29.i, label %if.then31.i, label %if.end34.i if.then31.i: ; preds = %if.end20.i %sub33.i = fsub double %t.1.i, %conv14.i br label %calc.exit if.end34.i: ; preds = %if.end20.i %sub35.i = sub nsw i32 %51, %49 %conv36.i = sitofp i32 %sub35.i to double %53 = tail call double @llvm.fabs.f64(double %conv36.i) %sub37.i = sub nsw i32 %51, %50 %conv38.i = sitofp i32 %sub37.i to double %54 = tail call double @llvm.fabs.f64(double %conv38.i) %cmp39.i = fcmp olt double %54, %53 %ans.0.i = select i1 %cmp39.i, double %54, double %53 %call.i = tail call double @calc2() %cmp43.i = fcmp olt double %call.i, %ans.0.i %ans.1.i = select i1 %cmp43.i, double %call.i, double %ans.0.i store i32 %50, ptr @ta, align 4, !tbaa !19 store i32 %49, ptr @tb, align 4, !tbaa !19 %55 = load i32, ptr @da, align 4, !tbaa !19 store i32 %add.i146, ptr @da, align 4, !tbaa !19 store i32 %55, ptr @db, align 4, !tbaa !19 %call47.i = tail call double @calc2() %cmp48.i = fcmp olt double %call47.i, %ans.1.i %ans.2.i = select i1 %cmp48.i, double %call47.i, double %ans.1.i br label %calc.exit calc.exit: ; preds = %if.then.i, %if.end.i, %if.then17.i, %if.then31.i, %if.end34.i %retval.0.i = phi double [ %52, %if.then.i ], [ %sub19.i, %if.then17.i ], [ %sub33.i, %if.then31.i ], [ %ans.2.i, %if.end34.i ], [ 0.000000e+00, %if.end.i ] %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %retval.0.i) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 declare i32 @__uflow(ptr noundef) local_unnamed_addr #6 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { "no-trapping-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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!11, !11, i64 0}
#include<stdio.h> int main(void) { int ar[51] = { 0 }; int treex[50]; int result[100] = { 0 }; int trees; int tests; int i, j, k; int dis; scanf("%d", &tests); for (i = 0; i < tests; i++) { scanf("%d", &trees); for (j = 0; j < trees; j++) scanf("%d", &treex[j]); for (j = 0; j < trees - 1; j++) { for (k = j + 1; k < trees; k++) { dis = treex[k] - treex[j]; ar[dis]++; } } for (j = 0; j < 51; j++) { if (ar[j] != 0) { result[i]++; ar[j] = 0; } } } for (i = 0; i < tests; i++) printf("%d\n", result[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33447/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33447/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %ar = alloca [51 x i32], align 16 %treex = alloca [50 x i32], align 16 %result = alloca [100 x i32], align 16 %trees = alloca i32, align 4 %tests = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %ar) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(204) %ar, i8 0, i64 204, i1 false) call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %treex) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %result) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %result, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %trees) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tests) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tests) %0 = load i32, ptr %tests, align 4, !tbaa !5 %cmp76 = icmp sgt i32 %0, 0 br i1 %cmp76, label %for.body, label %for.end51 for.cond43.preheader: ; preds = %for.inc40 %1 = icmp sgt i32 %13, 0 br i1 %1, label %for.body45, label %for.end51 for.body: ; preds = %entry, %for.inc40 %indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.inc40 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %trees) %2 = load i32, ptr %trees, align 4, !tbaa !5 %cmp369 = icmp sgt i32 %2, 0 br i1 %cmp369, label %for.body4, label %for.cond26.preheader for.cond6.preheader: ; preds = %for.body4 %cmp773 = icmp sgt i32 %4, 1 br i1 %cmp773, label %for.body8.preheader, label %for.cond26.preheader for.body8.preheader: ; preds = %for.cond6.preheader %sub = add nsw i32 %4, -1 %3 = zext i32 %4 to i64 %wide.trip.count90 = zext i32 %sub to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.body8 for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [50 x i32], ptr %treex, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %trees, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp3, label %for.body4, label %for.cond6.preheader, !llvm.loop !9 for.cond6.loopexit: ; preds = %for.body11, %for.body8 %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90 br i1 %exitcond91.not, label %for.cond26.preheader, label %for.body8, !llvm.loop !11 for.cond26.preheader: ; preds = %for.cond6.loopexit, %for.body, %for.cond6.preheader %arrayidx33 = getelementptr inbounds [100 x i32], ptr %result, i64 0, i64 %indvars.iv96 br label %for.body28 for.body8: ; preds = %for.body8.preheader, %for.cond6.loopexit %indvars.iv87 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next88, %for.cond6.loopexit ] %indvars.iv82 = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next83, %for.cond6.loopexit ] %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %cmp1071 = icmp ult i64 %indvars.iv.next88, %3 br i1 %cmp1071, label %for.body11.lr.ph, label %for.cond6.loopexit for.body11.lr.ph: ; preds = %for.body8 %arrayidx15 = getelementptr inbounds [50 x i32], ptr %treex, i64 0, i64 %indvars.iv87 %6 = load i32, ptr %arrayidx15, align 4, !tbaa !5 br label %for.body11 for.body11: ; preds = %for.body11.lr.ph, %for.body11 %indvars.iv84 = phi i64 [ %indvars.iv82, %for.body11.lr.ph ], [ %indvars.iv.next85, %for.body11 ] %arrayidx13 = getelementptr inbounds [50 x i32], ptr %treex, i64 0, i64 %indvars.iv84 %7 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %sub16 = sub nsw i32 %7, %6 %idxprom17 = sext i32 %sub16 to i64 %arrayidx18 = getelementptr inbounds [51 x i32], ptr %ar, i64 0, i64 %idxprom17 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %inc19 = add nsw i32 %8, 1 store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5 %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count br i1 %exitcond.not, label %for.cond6.loopexit, label %for.body11, !llvm.loop !12 for.body28: ; preds = %for.inc37.1, %for.cond26.preheader %indvars.iv92 = phi i64 [ 0, %for.cond26.preheader ], [ %indvars.iv.next93.1, %for.inc37.1 ] %arrayidx30 = getelementptr inbounds [51 x i32], ptr %ar, i64 0, i64 %indvars.iv92 %9 = load i32, ptr %arrayidx30, align 8, !tbaa !5 %cmp31.not = icmp eq i32 %9, 0 br i1 %cmp31.not, label %for.inc37, label %if.then if.then: ; preds = %for.body28 %10 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %inc34 = add nsw i32 %10, 1 store i32 %inc34, ptr %arrayidx33, align 4, !tbaa !5 store i32 0, ptr %arrayidx30, align 8, !tbaa !5 br label %for.inc37 for.inc37: ; preds = %for.body28, %if.then %indvars.iv.next93 = or i64 %indvars.iv92, 1 %exitcond95.not = icmp eq i64 %indvars.iv.next93, 51 br i1 %exitcond95.not, label %for.inc40, label %for.body28.1, !llvm.loop !13 for.body28.1: ; preds = %for.inc37 %arrayidx30.1 = getelementptr inbounds [51 x i32], ptr %ar, i64 0, i64 %indvars.iv.next93 %11 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %cmp31.not.1 = icmp eq i32 %11, 0 br i1 %cmp31.not.1, label %for.inc37.1, label %if.then.1 if.then.1: ; preds = %for.body28.1 %12 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %inc34.1 = add nsw i32 %12, 1 store i32 %inc34.1, ptr %arrayidx33, align 4, !tbaa !5 store i32 0, ptr %arrayidx30.1, align 4, !tbaa !5 br label %for.inc37.1 for.inc37.1: ; preds = %if.then.1, %for.body28.1 %indvars.iv.next93.1 = add nuw nsw i64 %indvars.iv92, 2 br label %for.body28 for.inc40: ; preds = %for.inc37 %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %13 = load i32, ptr %tests, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp = icmp slt i64 %indvars.iv.next97, %14 br i1 %cmp, label %for.body, label %for.cond43.preheader, !llvm.loop !14 for.body45: ; preds = %for.cond43.preheader, %for.body45 %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body45 ], [ 0, %for.cond43.preheader ] %arrayidx47 = getelementptr inbounds [100 x i32], ptr %result, i64 0, i64 %indvars.iv99 %15 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15) %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %16 = load i32, ptr %tests, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp44 = icmp slt i64 %indvars.iv.next100, %17 br i1 %cmp44, label %for.body45, label %for.end51, !llvm.loop !15 for.end51: ; preds = %for.body45, %entry, %for.cond43.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tests) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %trees) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %result) #4 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %treex) #4 call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %ar) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int digit(int nb) { int sum = 0; while (nb > 0) { sum += nb % 10; nb /= 10; } return (sum); } int main(void) { int N,a,b; scanf("%d%d%d",&N,&a,&b); int i = 1; int sum = 0; while (i <= N) { if (digit(i) >= a && digit(i) <= b) sum += i; i++; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334512/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334512/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @digit(i32 noundef %nb) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %nb, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %nb.addr.05 = phi i32 [ %div, %while.body ], [ %nb, %entry ] %rem = urem i32 %nb.addr.05, 10 %add = add nuw nsw i32 %sum.06, %rem %div = udiv i32 %nb.addr.05, 10 %cmp.not = icmp ult i32 %nb.addr.05, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { 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) #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 %N, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %N, align 4, !tbaa !7 %cmp.not19 = icmp slt i32 %0, 1 br i1 %cmp.not19, label %while.end, label %while.body.i.preheader.lr.ph while.body.i.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %a, align 4, !tbaa !7 %2 = load i32, ptr %b, align 4 br label %while.body.i.preheader while.body.i.preheader: ; preds = %while.body.i.preheader.lr.ph, %if.end %sum.021 = phi i32 [ 0, %while.body.i.preheader.lr.ph ], [ %sum.1, %if.end ] %i.020 = phi i32 [ 1, %while.body.i.preheader.lr.ph ], [ %inc, %if.end ] br label %while.body.i while.body.i: ; preds = %while.body.i.preheader, %while.body.i %sum.06.i = phi i32 [ %add.i, %while.body.i ], [ 0, %while.body.i.preheader ] %nb.addr.05.i = phi i32 [ %div.i, %while.body.i ], [ %i.020, %while.body.i.preheader ] %rem.i = urem i32 %nb.addr.05.i, 10 %add.i = add nuw nsw i32 %rem.i, %sum.06.i %div.i = udiv i32 %nb.addr.05.i, 10 %cmp.not.i = icmp ult i32 %nb.addr.05.i, 10 br i1 %cmp.not.i, label %digit.exit, label %while.body.i, !llvm.loop !5 digit.exit: ; preds = %while.body.i %cmp2.not = icmp slt i32 %add.i, %1 br i1 %cmp2.not, label %if.end, label %while.body.i11 while.body.i11: ; preds = %digit.exit, %while.body.i11 %sum.06.i12 = phi i32 [ %add.i15, %while.body.i11 ], [ 0, %digit.exit ] %nb.addr.05.i13 = phi i32 [ %div.i16, %while.body.i11 ], [ %i.020, %digit.exit ] %rem.i14 = urem i32 %nb.addr.05.i13, 10 %add.i15 = add nuw nsw i32 %rem.i14, %sum.06.i12 %div.i16 = udiv i32 %nb.addr.05.i13, 10 %cmp.not.i17 = icmp ult i32 %nb.addr.05.i13, 10 br i1 %cmp.not.i17, label %digit.exit18, label %while.body.i11, !llvm.loop !5 digit.exit18: ; preds = %while.body.i11 %cmp4.not = icmp sgt i32 %add.i15, %2 %add = select i1 %cmp4.not, i32 0, i32 %i.020 %spec.select = add nsw i32 %add, %sum.021 br label %if.end if.end: ; preds = %digit.exit18, %digit.exit %sum.1 = phi i32 [ %sum.021, %digit.exit ], [ %spec.select, %digit.exit18 ] %inc = add nuw i32 %i.020, 1 %exitcond.not = icmp eq i32 %i.020, %0 br i1 %exitcond.not, label %while.end, label %while.body.i.preheader, !llvm.loop !11 while.end: ; preds = %if.end, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %sum.1, %if.end ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int findSumOfDigits(int n){ int sum=0; while(n>0){ sum += n%10; n /= 10; } return sum; } int main(){ int N, A, B; scanf("%d %d %d", &N, &A, &B); int total = 0; for (int i =1; i <=N ; ++i) { int sum = findSumOfDigits(i); if(sum>=A && sum <= B){ total += i; } } printf("%d", total); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334556/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334556/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @findSumOfDigits(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %n.addr.05 = phi i32 [ %div, %while.body ], [ %n, %entry ] %rem = urem i32 %n.addr.05, 10 %add = add nuw nsw i32 %sum.06, %rem %div = udiv i32 %n.addr.05, 10 %cmp.not = icmp ult i32 %n.addr.05, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { 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) #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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %N, align 4, !tbaa !7 %cmp.not10 = icmp slt i32 %0, 1 br i1 %cmp.not10, label %for.cond.cleanup, label %while.body.i.preheader.lr.ph while.body.i.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %A, align 4, !tbaa !7 %2 = load i32, ptr %B, align 4 br label %while.body.i.preheader while.body.i.preheader: ; preds = %while.body.i.preheader.lr.ph, %findSumOfDigits.exit %total.012 = phi i32 [ 0, %while.body.i.preheader.lr.ph ], [ %total.1, %findSumOfDigits.exit ] %i.011 = phi i32 [ 1, %while.body.i.preheader.lr.ph ], [ %inc, %findSumOfDigits.exit ] br label %while.body.i for.cond.cleanup: ; preds = %findSumOfDigits.exit, %entry %total.0.lcssa = phi i32 [ 0, %entry ], [ %total.1, %findSumOfDigits.exit ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %total.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 while.body.i: ; preds = %while.body.i.preheader, %while.body.i %sum.06.i = phi i32 [ %add.i, %while.body.i ], [ 0, %while.body.i.preheader ] %n.addr.05.i = phi i32 [ %div.i, %while.body.i ], [ %i.011, %while.body.i.preheader ] %rem.i = urem i32 %n.addr.05.i, 10 %add.i = add nuw nsw i32 %rem.i, %sum.06.i %div.i = udiv i32 %n.addr.05.i, 10 %cmp.not.i = icmp ult i32 %n.addr.05.i, 10 br i1 %cmp.not.i, label %findSumOfDigits.exit, label %while.body.i, !llvm.loop !5 findSumOfDigits.exit: ; preds = %while.body.i %cmp2.not = icmp slt i32 %add.i, %1 %cmp3.not = icmp sgt i32 %add.i, %2 %or.cond = select i1 %cmp2.not, i1 true, i1 %cmp3.not %add = select i1 %or.cond, i32 0, i32 %i.011 %total.1 = add nuw nsw i32 %add, %total.012 %inc = add nuw i32 %i.011, 1 %exitcond.not = icmp eq i32 %i.011, %0 br i1 %exitcond.not, label %for.cond.cleanup, label %while.body.i.preheader, !llvm.loop !11 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define REP(i,n) for(i=0;i<n;i++) #define ll long long int sum(int N){ int ans = 0; while(N > 0){ ans += N % 10; N = N / 10; } return ans; } int main(void){ int i; int N, A, B; scanf("%d""%d""%d",&N,&A,&B); int total = 0; REP(i,N+1){ int Sum = sum(i); if(Sum >= A && Sum <= B) total += i; } printf("%d",total); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334606/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @sum(i32 noundef %N) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %N, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %ans.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %N.addr.05 = phi i32 [ %div, %while.body ], [ %N, %entry ] %rem = urem i32 %N.addr.05, 10 %add = add nuw nsw i32 %ans.06, %rem %div = udiv i32 %N.addr.05, 10 %cmp.not = icmp ult i32 %N.addr.05, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %ans.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: %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) #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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %N, align 4, !tbaa !7 %cmp.not11 = icmp slt i32 %0, 0 br i1 %cmp.not11, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %A, align 4, !tbaa !7 %2 = load i32, ptr %B, align 4 br label %for.body for.body: ; preds = %for.body.lr.ph, %sum.exit %i.013 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %sum.exit ] %total.012 = phi i32 [ 0, %for.body.lr.ph ], [ %total.1, %sum.exit ] %cmp4.i.not = icmp eq i32 %i.013, 0 br i1 %cmp4.i.not, label %sum.exit, label %while.body.i while.body.i: ; preds = %for.body, %while.body.i %ans.06.i = phi i32 [ %add.i, %while.body.i ], [ 0, %for.body ] %N.addr.05.i = phi i32 [ %div.i, %while.body.i ], [ %i.013, %for.body ] %rem.i = urem i32 %N.addr.05.i, 10 %add.i = add nuw nsw i32 %rem.i, %ans.06.i %div.i = udiv i32 %N.addr.05.i, 10 %cmp.not.i = icmp ult i32 %N.addr.05.i, 10 br i1 %cmp.not.i, label %sum.exit, label %while.body.i, !llvm.loop !5 sum.exit: ; preds = %while.body.i, %for.body %ans.0.lcssa.i = phi i32 [ 0, %for.body ], [ %add.i, %while.body.i ] %cmp2.not = icmp slt i32 %ans.0.lcssa.i, %1 %cmp3.not = icmp sgt i32 %ans.0.lcssa.i, %2 %or.cond = select i1 %cmp2.not, i1 true, i1 %cmp3.not %add4 = select i1 %or.cond, i32 0, i32 %i.013 %total.1 = add nuw nsw i32 %add4, %total.012 %inc = add nuw i32 %i.013, 1 %exitcond.not = icmp eq i32 %i.013, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %sum.exit, %entry %total.0.lcssa = phi i32 [ 0, %entry ], [ %total.1, %sum.exit ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %total.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> #include <stdlib.h> int main() { int T; scanf("%d",&T); int k; for(k=0;k<T;k++) { int n; int a[55]; scanf("%d",&n); int i,j; for(i=0;i<n;i++) scanf("%d",&a[i]); int c[10000]; int q=0; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { c[q++]=a[j]-a[i]; } } int cnt=0; int flag[10000]; for(i=0;i<10000;i++) flag[i]=0; for(i=0;i<q;i++) { if(flag[c[i]]!=1) { flag[c[i]]=1; cnt++; } } printf("%d\n",cnt); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %T = alloca i32, align 4 %n = alloca i32, align 4 %a = alloca [55 x i32], align 16 %c = alloca [10000 x i32], align 16 %flag = alloca [10000 x i32], align 16 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 %cmp86 = icmp sgt i32 %0, 0 br i1 %cmp86, label %for.body, label %for.end52 for.body: ; preds = %entry, %for.end48 %k.087 = phi i32 [ %inc51, %for.end48 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 220, ptr nonnull %a) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp371 = icmp sgt i32 %1, 0 br i1 %cmp371, label %for.body4, label %for.end.thread for.end.thread: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %c) #4 br label %for.end24.thread for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [55 x i32], ptr %a, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %c) #4 %cmp777 = icmp sgt i32 %2, 0 br i1 %cmp777, label %for.body8.preheader, label %for.end24.thread for.body8.preheader: ; preds = %for.end %4 = zext i32 %2 to i64 %wide.trip.count102 = zext i32 %2 to i64 br label %for.body8 for.cond6.loopexit.loopexit: ; preds = %for.body11, %middle.block %indvars.iv.next91.lcssa = phi i64 [ %ind.end116, %middle.block ], [ %indvars.iv.next91, %for.body11 ] %5 = trunc i64 %indvars.iv.next91.lcssa to i32 br label %for.cond6.loopexit for.cond6.loopexit: ; preds = %for.cond6.loopexit.loopexit, %for.body8 %q.1.lcssa = phi i32 [ %q.079, %for.body8 ], [ %5, %for.cond6.loopexit.loopexit ] %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102 br i1 %exitcond103.not, label %for.end24, label %for.body8, !llvm.loop !11 for.body8: ; preds = %for.body8.preheader, %for.cond6.loopexit %indvars.iv99 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next100, %for.cond6.loopexit ] %indvars.iv92 = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next93, %for.cond6.loopexit ] %q.079 = phi i32 [ 0, %for.body8.preheader ], [ %q.1.lcssa, %for.cond6.loopexit ] %6 = xor i64 %indvars.iv99, -1 %7 = add nsw i64 %6, %wide.trip.count102 %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %cmp1073 = icmp ult i64 %indvars.iv.next100, %4 br i1 %cmp1073, label %for.body11.lr.ph, label %for.cond6.loopexit for.body11.lr.ph: ; preds = %for.body8 %arrayidx15 = getelementptr inbounds [55 x i32], ptr %a, i64 0, i64 %indvars.iv99 %8 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %9 = sext i32 %q.079 to i64 %min.iters.check = icmp ult i64 %7, 8 br i1 %min.iters.check, label %for.body11.preheader, label %vector.ph vector.ph: ; preds = %for.body11.lr.ph %n.vec = and i64 %7, -8 %ind.end = add i64 %indvars.iv92, %n.vec %ind.end116 = add i64 %n.vec, %9 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %8, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %9 %offset.idx118 = add i64 %indvars.iv92, %index %10 = getelementptr inbounds [55 x i32], ptr %a, i64 0, i64 %offset.idx118 %wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load119 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = sub nsw <4 x i32> %wide.load, %broadcast.splat %13 = sub nsw <4 x i32> %wide.load119, %broadcast.splat %14 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %offset.idx store <4 x i32> %12, ptr %14, align 4, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 store <4 x i32> %13, ptr %15, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %for.cond6.loopexit.loopexit, label %for.body11.preheader for.body11.preheader: ; preds = %for.body11.lr.ph, %middle.block %indvars.iv94.ph = phi i64 [ %indvars.iv92, %for.body11.lr.ph ], [ %ind.end, %middle.block ] %indvars.iv90.ph = phi i64 [ %9, %for.body11.lr.ph ], [ %ind.end116, %middle.block ] br label %for.body11 for.body11: ; preds = %for.body11.preheader, %for.body11 %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body11 ], [ %indvars.iv94.ph, %for.body11.preheader ] %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body11 ], [ %indvars.iv90.ph, %for.body11.preheader ] %arrayidx13 = getelementptr inbounds [55 x i32], ptr %a, i64 0, i64 %indvars.iv94 %17 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %sub = sub nsw i32 %17, %8 %indvars.iv.next91 = add nsw i64 %indvars.iv90, 1 %arrayidx18 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %indvars.iv90 store i32 %sub, ptr %arrayidx18, align 4, !tbaa !5 %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count102 br i1 %exitcond.not, label %for.cond6.loopexit.loopexit, label %for.body11, !llvm.loop !15 for.end24.thread: ; preds = %for.end, %for.end.thread call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %flag) #4 br label %for.end48 for.end24: ; preds = %for.cond6.loopexit call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %flag) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %flag, i8 0, i64 40000, i1 false), !tbaa !5 %cmp3482 = icmp sgt i32 %q.1.lcssa, 0 br i1 %cmp3482, label %for.body35.preheader, label %for.end48 for.body35.preheader: ; preds = %for.end24 %wide.trip.count110 = zext i32 %q.1.lcssa to i64 %xtraiter = and i64 %wide.trip.count110, 1 %18 = icmp eq i32 %q.1.lcssa, 1 br i1 %18, label %for.end48.loopexit.unr-lcssa, label %for.body35.preheader.new for.body35.preheader.new: ; preds = %for.body35.preheader %unroll_iter = and i64 %wide.trip.count110, 4294967294 br label %for.body35 for.body35: ; preds = %for.inc46.1, %for.body35.preheader.new %indvars.iv107 = phi i64 [ 0, %for.body35.preheader.new ], [ %indvars.iv.next108.1, %for.inc46.1 ] %cnt.084 = phi i32 [ 0, %for.body35.preheader.new ], [ %cnt.1.1, %for.inc46.1 ] %niter = phi i64 [ 0, %for.body35.preheader.new ], [ %niter.next.1, %for.inc46.1 ] %arrayidx37 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %indvars.iv107 %19 = load i32, ptr %arrayidx37, align 8, !tbaa !5 %idxprom38 = sext i32 %19 to i64 %arrayidx39 = getelementptr inbounds [10000 x i32], ptr %flag, i64 0, i64 %idxprom38 %20 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %cmp40.not = icmp eq i32 %20, 1 br i1 %cmp40.not, label %for.inc46, label %if.then if.then: ; preds = %for.body35 store i32 1, ptr %arrayidx39, align 4, !tbaa !5 %inc45 = add nsw i32 %cnt.084, 1 br label %for.inc46 for.inc46: ; preds = %for.body35, %if.then %cnt.1 = phi i32 [ %inc45, %if.then ], [ %cnt.084, %for.body35 ] %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx37.1 = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %indvars.iv.next108 %21 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5 %idxprom38.1 = sext i32 %21 to i64 %arrayidx39.1 = getelementptr inbounds [10000 x i32], ptr %flag, i64 0, i64 %idxprom38.1 %22 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %cmp40.not.1 = icmp eq i32 %22, 1 br i1 %cmp40.not.1, label %for.inc46.1, label %if.then.1 if.then.1: ; preds = %for.inc46 store i32 1, ptr %arrayidx39.1, align 4, !tbaa !5 %inc45.1 = add nsw i32 %cnt.1, 1 br label %for.inc46.1 for.inc46.1: ; preds = %if.then.1, %for.inc46 %cnt.1.1 = phi i32 [ %inc45.1, %if.then.1 ], [ %cnt.1, %for.inc46 ] %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 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.end48.loopexit.unr-lcssa, label %for.body35, !llvm.loop !16 for.end48.loopexit.unr-lcssa: ; preds = %for.inc46.1, %for.body35.preheader %cnt.1.lcssa.ph = phi i32 [ undef, %for.body35.preheader ], [ %cnt.1.1, %for.inc46.1 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next108.1, %for.inc46.1 ] %cnt.084.unr = phi i32 [ 0, %for.body35.preheader ], [ %cnt.1.1, %for.inc46.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end48, label %for.body35.epil for.body35.epil: ; preds = %for.end48.loopexit.unr-lcssa %arrayidx37.epil = getelementptr inbounds [10000 x i32], ptr %c, i64 0, i64 %indvars.iv107.unr %23 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5 %idxprom38.epil = sext i32 %23 to i64 %arrayidx39.epil = getelementptr inbounds [10000 x i32], ptr %flag, i64 0, i64 %idxprom38.epil %24 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %cmp40.not.epil = icmp eq i32 %24, 1 br i1 %cmp40.not.epil, label %for.end48, label %if.then.epil if.then.epil: ; preds = %for.body35.epil store i32 1, ptr %arrayidx39.epil, align 4, !tbaa !5 %inc45.epil = add nsw i32 %cnt.084.unr, 1 br label %for.end48 for.end48: ; preds = %for.end48.loopexit.unr-lcssa, %if.then.epil, %for.body35.epil, %for.end24.thread, %for.end24 %cnt.0.lcssa = phi i32 [ 0, %for.end24 ], [ 0, %for.end24.thread ], [ %cnt.1.lcssa.ph, %for.end48.loopexit.unr-lcssa ], [ %inc45.epil, %if.then.epil ], [ %cnt.084.unr, %for.body35.epil ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %flag) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 220, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 %inc51 = add nuw nsw i32 %k.087, 1 %25 = load i32, ptr %T, align 4, !tbaa !5 %cmp = icmp slt i32 %inc51, %25 br i1 %cmp, label %for.body, label %for.end52, !llvm.loop !17 for.end52: ; preds = %for.end48, %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: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main() { int a, b, n, sum = 0, temp = 0, t; scanf("%d %d %d", &n, &a, &b); for(int i = 1; i <= n; i++){ t = i; while(t / 10 || t % 10){ temp += t % 10; t /= 10; } if(temp >= a && temp <= b){ sum += i; } temp = 0; } printf("%d", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not26 = icmp slt i32 %0, 1 br i1 %cmp.not26, label %for.cond.cleanup, label %while.cond.preheader.lr.ph while.cond.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %while.end %i.028 = phi i32 [ 1, %while.cond.preheader.lr.ph ], [ %inc, %while.end ] %sum.027 = phi i32 [ 0, %while.cond.preheader.lr.ph ], [ %sum.1, %while.end ] %tobool.not19 = icmp ult i32 %i.028, 10 %rem20 = urem i32 %i.028, 10 %tobool1.not21 = icmp eq i32 %rem20, 0 %or.cond22 = and i1 %tobool.not19, %tobool1.not21 br i1 %or.cond22, label %while.end, label %while.body for.cond.cleanup: ; preds = %while.end, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %sum.1, %while.end ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 while.body: ; preds = %while.cond.preheader, %while.body %rem25 = phi i32 [ %rem, %while.body ], [ %rem20, %while.cond.preheader ] %t.024 = phi i32 [ %div, %while.body ], [ %i.028, %while.cond.preheader ] %temp.123 = phi i32 [ %add, %while.body ], [ 0, %while.cond.preheader ] %div = sdiv i32 %t.024, 10 %add = add nsw i32 %rem25, %temp.123 %t.0.off = add nsw i32 %div, 9 %tobool.not = icmp ult i32 %t.0.off, 19 %rem = srem i32 %div, 10 %tobool1.not = icmp eq i32 %rem, 0 %or.cond = and i1 %tobool.not, %tobool1.not br i1 %or.cond, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %while.cond.preheader %temp.1.lcssa = phi i32 [ 0, %while.cond.preheader ], [ %add, %while.body ] %cmp4.not = icmp slt i32 %temp.1.lcssa, %1 %cmp5.not = icmp sgt i32 %temp.1.lcssa, %2 %or.cond17 = select i1 %cmp4.not, i1 true, i1 %cmp5.not %add6 = select i1 %or.cond17, i32 0, i32 %i.028 %sum.1 = add nuw nsw i32 %add6, %sum.027 %inc = add nuw i32 %i.028, 1 %exitcond.not = icmp eq i32 %i.028, %0 br i1 %exitcond.not, label %for.cond.cleanup, label %while.cond.preheader, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int a,b; int main() { int c,d,e,f,g,h,i,n,z,sum=0; scanf("%d%d%d",&z,&a,&b); for(n=1;n<=z;n++) { if(n<10) { g=n; } else if(n>=100&&n<1000) { c=n%10;d=n/10;e=d%10;f=d/10; g=c+e+f; } else if(n>=10&&n<100) { c=n%10; d=n/10; g=c+d; } else if(n>=1000&&n<10000) { c=n%10; d=n/10; e=d%10; f=d/10; h=f%10; i=f/10; g=c+e+h+i; } else if(n==10000) { g=1; } if(g>=a&&g<=b) sum=sum+n; } printf("%d",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334743/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334743/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z, ptr noundef nonnull @a, ptr noundef nonnull @b) %0 = load i32, ptr %z, align 4, !tbaa !5 %cmp.not88 = icmp slt i32 %0, 1 br i1 %cmp.not88, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @a, align 4, !tbaa !5 %2 = load i32, ptr @b, align 4 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.end36 %sum.091 = phi i32 [ 0, %for.body.lr.ph ], [ %sum.1, %if.end36 ] %n.090 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %if.end36 ] %g.089 = phi i32 [ undef, %for.body.lr.ph ], [ %g.1, %if.end36 ] %cmp1 = icmp ult i32 %n.090, 10 br i1 %cmp1, label %if.end36, label %if.else if.else: ; preds = %for.body %3 = add nsw i32 %n.090, -100 %or.cond = icmp ult i32 %3, 900 br i1 %or.cond, label %if.then4, label %if.else8 if.then4: ; preds = %if.else %rem.lhs.trunc = trunc i32 %n.090 to i16 %rem75 = urem i16 %rem.lhs.trunc, 10 %div76 = udiv i16 %rem.lhs.trunc, 10 %rem5.lhs.trunc = trunc i16 %div76 to i8 %rem577 = urem i8 %rem5.lhs.trunc, 10 %rem5.zext = zext i8 %rem577 to i32 %div678 = udiv i16 %rem.lhs.trunc, 100 %narrow92 = add nuw nsw i16 %div678, %rem75 %add = zext i16 %narrow92 to i32 %add7 = add nuw nsw i32 %add, %rem5.zext br label %if.end36 if.else8: ; preds = %if.else %cmp11 = icmp ult i32 %n.090, 100 br i1 %cmp11, label %if.then12, label %if.else16 if.then12: ; preds = %if.else8 %rem13.lhs.trunc = trunc i32 %n.090 to i8 %rem1379 = urem i8 %rem13.lhs.trunc, 10 %div1480 = udiv i8 %rem13.lhs.trunc, 10 %narrow87 = add nuw nsw i8 %rem1379, %div1480 %add15 = zext i8 %narrow87 to i32 br label %if.end36 if.else16: ; preds = %if.else8 %4 = add nsw i32 %n.090, -1000 %or.cond45 = icmp ult i32 %4, 9000 br i1 %or.cond45, label %if.then20, label %if.else30 if.then20: ; preds = %if.else16 %rem21.lhs.trunc = trunc i32 %n.090 to i16 %rem2181 = urem i16 %rem21.lhs.trunc, 10 %div2282 = udiv i16 %rem21.lhs.trunc, 10 %rem2383 = urem i16 %div2282, 10 %div2484 = udiv i16 %rem21.lhs.trunc, 100 %rem25.lhs.trunc = trunc i16 %div2484 to i8 %rem2585 = urem i8 %rem25.lhs.trunc, 10 %rem25.zext = zext i8 %rem2585 to i32 %div2686 = udiv i16 %rem21.lhs.trunc, 1000 %div26.zext = zext i16 %div2686 to i32 %narrow = add nuw nsw i16 %rem2383, %rem2181 %add27 = zext i16 %narrow to i32 %add28 = add nuw nsw i32 %rem25.zext, %div26.zext %add29 = add nuw nsw i32 %add28, %add27 br label %if.end36 if.else30: ; preds = %if.else16 %cmp31 = icmp eq i32 %n.090, 10000 %spec.select = select i1 %cmp31, i32 1, i32 %g.089 br label %if.end36 if.end36: ; preds = %if.else30, %for.body, %if.then4, %if.then20, %if.then12 %g.1 = phi i32 [ %add7, %if.then4 ], [ %add15, %if.then12 ], [ %add29, %if.then20 ], [ %n.090, %for.body ], [ %spec.select, %if.else30 ] %cmp37.not = icmp slt i32 %g.1, %1 %cmp39.not = icmp sgt i32 %g.1, %2 %or.cond74 = select i1 %cmp37.not, i1 true, i1 %cmp39.not %add41 = select i1 %or.cond74, i32 0, i32 %n.090 %sum.1 = add nuw nsw i32 %add41, %sum.091 %inc = add nuw i32 %n.090, 1 %exitcond.not = icmp eq i32 %n.090, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %if.end36, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %sum.1, %if.end36 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int n, a, b, i, j, x; int sum1=0, sum2=0; scanf("%d", &n); scanf("%d", &a); scanf("%d", &b); for(i=1; i<=n; i++){ sum1 = 0; x = i; for(j=0; j<10; j++){ sum1 = sum1 + (x % 10); x = x / 10; } if(sum1 >= a && sum1 <= b){ sum2 = sum2 + i; } } printf("%d\n", sum2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334787/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334787/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = 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 %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 %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 1 br i1 %cmp.not24, label %for.end11, label %for.cond3.preheader.lr.ph for.cond3.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = load i32, ptr %b, align 4 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.cond3.preheader.preheader, label %vector.ph vector.ph: ; preds = %for.cond3.preheader.lr.ph %n.vec = and i32 %0, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert33 = insertelement <4 x i32> poison, i32 %2, i64 0 %broadcast.splat34 = shufflevector <4 x i32> %broadcast.splatinsert33, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %81, %vector.body ] %vec.phi31 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %82, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %vec.ind.frozen = freeze <4 x i32> %vec.ind %3 = udiv <4 x i32> %vec.ind.frozen, <i32 10, i32 10, i32 10, i32 10> %4 = mul <4 x i32> %3, <i32 10, i32 10, i32 10, i32 10> %.decomposed = sub <4 x i32> %vec.ind.frozen, %4 %step.add.frozen = freeze <4 x i32> %step.add %5 = udiv <4 x i32> %step.add.frozen, <i32 10, i32 10, i32 10, i32 10> %6 = mul <4 x i32> %5, <i32 10, i32 10, i32 10, i32 10> %.decomposed37 = sub <4 x i32> %step.add.frozen, %6 %7 = urem <4 x i32> %3, <i32 10, i32 10, i32 10, i32 10> %8 = urem <4 x i32> %5, <i32 10, i32 10, i32 10, i32 10> %9 = add nuw nsw <4 x i32> %.decomposed, %7 %10 = add nuw nsw <4 x i32> %.decomposed37, %8 %11 = udiv <4 x i32> %vec.ind, <i32 100, i32 100, i32 100, i32 100> %12 = udiv <4 x i32> %step.add, <i32 100, i32 100, i32 100, i32 100> %13 = urem <4 x i32> %11, <i32 10, i32 10, i32 10, i32 10> %14 = urem <4 x i32> %12, <i32 10, i32 10, i32 10, i32 10> %15 = add nuw nsw <4 x i32> %9, %13 %16 = add nuw nsw <4 x i32> %10, %14 %17 = udiv <4 x i32> %vec.ind, <i32 1000, i32 1000, i32 1000, i32 1000> %18 = udiv <4 x i32> %step.add, <i32 1000, i32 1000, i32 1000, i32 1000> %19 = urem <4 x i32> %17, <i32 10, i32 10, i32 10, i32 10> %20 = urem <4 x i32> %18, <i32 10, i32 10, i32 10, i32 10> %21 = add nuw nsw <4 x i32> %15, %19 %22 = add nuw nsw <4 x i32> %16, %20 %23 = udiv <4 x i32> %vec.ind, <i32 10000, i32 10000, i32 10000, i32 10000> %24 = udiv <4 x i32> %step.add, <i32 10000, i32 10000, i32 10000, i32 10000> %25 = urem <4 x i32> %23, <i32 10, i32 10, i32 10, i32 10> %26 = urem <4 x i32> %24, <i32 10, i32 10, i32 10, i32 10> %27 = add nuw nsw <4 x i32> %21, %25 %28 = add nuw nsw <4 x i32> %22, %26 %29 = udiv <4 x i32> %vec.ind, <i32 100000, i32 100000, i32 100000, i32 100000> %30 = udiv <4 x i32> %step.add, <i32 100000, i32 100000, i32 100000, i32 100000> %31 = trunc <4 x i32> %29 to <4 x i16> %32 = trunc <4 x i32> %30 to <4 x i16> %33 = urem <4 x i16> %31, <i16 10, i16 10, i16 10, i16 10> %34 = urem <4 x i16> %32, <i16 10, i16 10, i16 10, i16 10> %35 = zext <4 x i16> %33 to <4 x i32> %36 = zext <4 x i16> %34 to <4 x i32> %37 = add nuw nsw <4 x i32> %27, %35 %38 = add nuw nsw <4 x i32> %28, %36 %39 = udiv <4 x i32> %vec.ind, <i32 1000000, i32 1000000, i32 1000000, i32 1000000> %40 = udiv <4 x i32> %step.add, <i32 1000000, i32 1000000, i32 1000000, i32 1000000> %41 = trunc <4 x i32> %39 to <4 x i16> %42 = trunc <4 x i32> %40 to <4 x i16> %43 = urem <4 x i16> %41, <i16 10, i16 10, i16 10, i16 10> %44 = urem <4 x i16> %42, <i16 10, i16 10, i16 10, i16 10> %45 = zext <4 x i16> %43 to <4 x i32> %46 = zext <4 x i16> %44 to <4 x i32> %47 = add nuw nsw <4 x i32> %37, %45 %48 = add nuw nsw <4 x i32> %38, %46 %49 = udiv <4 x i32> %vec.ind, <i32 10000000, i32 10000000, i32 10000000, i32 10000000> %50 = udiv <4 x i32> %step.add, <i32 10000000, i32 10000000, i32 10000000, i32 10000000> %51 = trunc <4 x i32> %49 to <4 x i16> %52 = trunc <4 x i32> %50 to <4 x i16> %53 = urem <4 x i16> %51, <i16 10, i16 10, i16 10, i16 10> %54 = urem <4 x i16> %52, <i16 10, i16 10, i16 10, i16 10> %55 = zext <4 x i16> %53 to <4 x i32> %56 = zext <4 x i16> %54 to <4 x i32> %57 = add nuw nsw <4 x i32> %47, %55 %58 = add nuw nsw <4 x i32> %48, %56 %59 = udiv <4 x i32> %vec.ind, <i32 100000000, i32 100000000, i32 100000000, i32 100000000> %60 = udiv <4 x i32> %step.add, <i32 100000000, i32 100000000, i32 100000000, i32 100000000> %61 = trunc <4 x i32> %59 to <4 x i8> %62 = trunc <4 x i32> %60 to <4 x i8> %63 = urem <4 x i8> %61, <i8 10, i8 10, i8 10, i8 10> %64 = urem <4 x i8> %62, <i8 10, i8 10, i8 10, i8 10> %65 = zext <4 x i8> %63 to <4 x i32> %66 = zext <4 x i8> %64 to <4 x i32> %67 = add nuw nsw <4 x i32> %57, %65 %68 = add nuw nsw <4 x i32> %58, %66 %69 = udiv <4 x i32> %vec.ind, <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000> %70 = udiv <4 x i32> %step.add, <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000> %71 = add nuw nsw <4 x i32> %67, %69 %72 = add nuw nsw <4 x i32> %68, %70 %73 = icmp slt <4 x i32> %71, %broadcast.splat %74 = icmp slt <4 x i32> %72, %broadcast.splat %75 = icmp sgt <4 x i32> %71, %broadcast.splat34 %76 = icmp sgt <4 x i32> %72, %broadcast.splat34 %77 = select <4 x i1> %73, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %75 %78 = select <4 x i1> %74, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %76 %79 = select <4 x i1> %77, <4 x i32> zeroinitializer, <4 x i32> %vec.ind %80 = select <4 x i1> %78, <4 x i32> zeroinitializer, <4 x i32> %step.add %81 = add <4 x i32> %79, %vec.phi %82 = add <4 x i32> %80, %vec.phi31 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %83 = icmp eq i32 %index.next, %n.vec br i1 %83, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %82, %81 %84 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %0, %n.vec br i1 %cmp.n, label %for.end11, label %for.cond3.preheader.preheader for.cond3.preheader.preheader: ; preds = %for.cond3.preheader.lr.ph, %middle.block %sum2.026.ph = phi i32 [ 0, %for.cond3.preheader.lr.ph ], [ %84, %middle.block ] %i.025.ph = phi i32 [ 1, %for.cond3.preheader.lr.ph ], [ %ind.end, %middle.block ] br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.cond3.preheader %sum2.026 = phi i32 [ %sum2.1, %for.cond3.preheader ], [ %sum2.026.ph, %for.cond3.preheader.preheader ] %i.025 = phi i32 [ %inc10, %for.cond3.preheader ], [ %i.025.ph, %for.cond3.preheader.preheader ] %rem.urem = urem i32 %i.025, 10 %div.udiv = udiv i32 %i.025, 10 %rem.1 = urem i32 %div.udiv, 10 %add.1 = add nuw nsw i32 %rem.urem, %rem.1 %div.1 = udiv i32 %i.025, 100 %rem.2 = urem i32 %div.1, 10 %add.2 = add nuw nsw i32 %add.1, %rem.2 %div.2 = udiv i32 %i.025, 1000 %rem.3 = urem i32 %div.2, 10 %add.3 = add nuw nsw i32 %add.2, %rem.3 %div.3 = udiv i32 %i.025, 10000 %rem.4 = urem i32 %div.3, 10 %add.4 = add nuw nsw i32 %add.3, %rem.4 %div.4 = udiv i32 %i.025, 100000 %rem.5.lhs.trunc = trunc i32 %div.4 to i16 %rem.527 = urem i16 %rem.5.lhs.trunc, 10 %rem.5.zext = zext i16 %rem.527 to i32 %add.5 = add nuw nsw i32 %add.4, %rem.5.zext %div.5 = udiv i32 %i.025, 1000000 %rem.6.lhs.trunc = trunc i32 %div.5 to i16 %rem.628 = urem i16 %rem.6.lhs.trunc, 10 %rem.6.zext = zext i16 %rem.628 to i32 %add.6 = add nuw nsw i32 %add.5, %rem.6.zext %div.6 = udiv i32 %i.025, 10000000 %rem.7.lhs.trunc = trunc i32 %div.6 to i16 %rem.729 = urem i16 %rem.7.lhs.trunc, 10 %rem.7.zext = zext i16 %rem.729 to i32 %add.7 = add nuw nsw i32 %add.6, %rem.7.zext %div.7 = udiv i32 %i.025, 100000000 %rem.8.lhs.trunc = trunc i32 %div.7 to i8 %rem.830 = urem i8 %rem.8.lhs.trunc, 10 %rem.8.zext = zext i8 %rem.830 to i32 %add.8 = add nuw nsw i32 %add.7, %rem.8.zext %div.8 = udiv i32 %i.025, 1000000000 %add.9 = add nuw nsw i32 %add.8, %div.8 %cmp6.not = icmp slt i32 %add.9, %1 %cmp7.not = icmp sgt i32 %add.9, %2 %or.cond = select i1 %cmp6.not, i1 true, i1 %cmp7.not %add8 = select i1 %or.cond, i32 0, i32 %i.025 %sum2.1 = add nuw nsw i32 %add8, %sum2.026 %inc10 = add nuw i32 %i.025, 1 %exitcond.not = icmp eq i32 %i.025, %0 br i1 %exitcond.not, label %for.end11, label %for.cond3.preheader, !llvm.loop !13 for.end11: ; preds = %for.cond3.preheader, %middle.block, %entry %sum2.0.lcssa = phi i32 [ 0, %entry ], [ %84, %middle.block ], [ %sum2.1, %for.cond3.preheader ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum2.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11}
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> int len[1000001]; int main() { int n, a, b, c, d; long long int max = 0; scanf("%d", &n); a = n; while(a--){ scanf("%d", &b); len[b]++; } a = b = c = d = 0; for(int i = 1000000; i >= 2; i--){ if(c){ len[i]++; } a = len[i] / 2; if(a){ if(b){ if(a > b){ max += (long long)((long long)i * (long long)d * (long long)b); b = a - b; d = i; if(b > 1){ max += (long long)((long long)i * (long long)i * (long long)(b / 2)); b %= 2; } } else if(b > a){ max += (long long)((long long)i * (long long)d * (long long)a); b = b - a; }else{ max += (long long)((long long)i * (long long)d * (long long)b); b = 0; d = 0; } }else{ if(a > 1){ max += (long long)((long long)i * (long long)i * (long long)(b=a / 2)); a %= 2; } b = a; d = i; } } if((len[i] == 1) && c){ c = 0; } else{ c = 0; if(len[i] % 2){ c = 1; } } } printf("%I64d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33483/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33483/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @len = dso_local local_unnamed_addr global [1000001 x i32] zeroinitializer, align 16 @.str.1 = 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 i32, align 4 %b = 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 %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not112 = icmp eq i32 %0, 0 br i1 %tobool.not112, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.0113 = phi i32 [ %dec, %while.body ], [ %0, %entry ] %dec = add nsw i32 %a.0113, -1 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %1 = load i32, ptr %b, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [1000001 x i32], ptr @len, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry store i32 0, ptr %b, align 4, !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %if.end61 %call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %max.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %while.end, %if.end61 %indvars.iv = phi i64 [ 1000000, %while.end ], [ %indvars.iv.next, %if.end61 ] %max.0119 = phi i64 [ 0, %while.end ], [ %max.2, %if.end61 ] %d.0118 = phi i32 [ 0, %while.end ], [ %d.1, %if.end61 ] %c.0117 = phi i32 [ 0, %while.end ], [ %c.1, %if.end61 ] %a.1115116 = phi i32 [ 0, %while.end ], [ %a.1114, %if.end61 ] %tobool2 = icmp ne i32 %c.0117, 0 %arrayidx4 = getelementptr inbounds [1000001 x i32], ptr @len, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 br i1 %tobool2, label %if.then, label %if.end if.then: ; preds = %for.body %inc5 = add nsw i32 %3, 1 store i32 %inc5, ptr %arrayidx4, align 4, !tbaa !5 br label %if.end if.end: ; preds = %for.body, %if.then %4 = phi i32 [ %inc5, %if.then ], [ %3, %for.body ] %div = sdiv i32 %4, 2 %.off = add i32 %4, 1 %tobool8.not = icmp ult i32 %.off, 3 br i1 %tobool8.not, label %if.end61, label %if.then9 if.then9: ; preds = %if.end %tobool10.not = icmp eq i32 %a.1115116, 0 %5 = trunc i64 %indvars.iv to i32 br i1 %tobool10.not, label %if.else47, label %if.then11 if.then11: ; preds = %if.then9 %cmp12 = icmp sgt i32 %div, %a.1115116 br i1 %cmp12, label %if.then13, label %if.else if.then13: ; preds = %if.then11 %conv14 = sext i32 %d.0118 to i64 %mul = mul nsw i64 %indvars.iv, %conv14 %conv15 = sext i32 %a.1115116 to i64 %mul16 = mul nsw i64 %mul, %conv15 %add = add nsw i64 %mul16, %max.0119 %sub = sub nsw i32 %div, %a.1115116 store i32 %sub, ptr %b, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %sub, 1 br i1 %cmp17, label %if.then19, label %if.end61 if.then19: ; preds = %if.then13 %mul22 = mul nuw nsw i64 %indvars.iv, %indvars.iv %div23111 = lshr i32 %sub, 1 %conv24 = zext i32 %div23111 to i64 %mul25 = mul nsw i64 %mul22, %conv24 %add26 = add nsw i64 %mul25, %add %rem = and i32 %sub, 1 store i32 %rem, ptr %b, align 4, !tbaa !5 br label %if.end61 if.else: ; preds = %if.then11 %cmp28 = icmp sgt i32 %a.1115116, %div %conv32 = sext i32 %d.0118 to i64 %mul33 = mul nsw i64 %indvars.iv, %conv32 br i1 %cmp28, label %if.then30, label %if.else38 if.then30: ; preds = %if.else %conv34 = sext i32 %div to i64 %mul35 = mul nsw i64 %mul33, %conv34 %add36 = add nsw i64 %mul35, %max.0119 %sub37 = sub nsw i32 %a.1115116, %div store i32 %sub37, ptr %b, align 4, !tbaa !5 br label %if.end61 if.else38: ; preds = %if.else %conv42 = sext i32 %a.1115116 to i64 %mul43 = mul nsw i64 %mul33, %conv42 %add44 = add nsw i64 %mul43, %max.0119 store i32 0, ptr %b, align 4, !tbaa !5 br label %if.end61 if.else47: ; preds = %if.then9 %cmp48 = icmp sgt i32 %4, 3 br i1 %cmp48, label %if.then50, label %if.end59 if.then50: ; preds = %if.else47 %mul53 = mul nuw nsw i64 %indvars.iv, %indvars.iv %div54110 = lshr i32 %div, 1 %conv55 = zext i32 %div54110 to i64 %mul56 = mul nsw i64 %mul53, %conv55 %add57 = add nsw i64 %mul56, %max.0119 %rem58 = and i32 %div, 1 br label %if.end59 if.end59: ; preds = %if.then50, %if.else47 %a.1 = phi i32 [ %rem58, %if.then50 ], [ %div, %if.else47 ] %max.1 = phi i64 [ %add57, %if.then50 ], [ %max.0119, %if.else47 ] store i32 %a.1, ptr %b, align 4, !tbaa !5 br label %if.end61 if.end61: ; preds = %if.end59, %if.then30, %if.else38, %if.then13, %if.then19, %if.end %a.1114 = phi i32 [ %rem, %if.then19 ], [ %sub, %if.then13 ], [ %sub37, %if.then30 ], [ 0, %if.else38 ], [ %a.1, %if.end59 ], [ %a.1115116, %if.end ] %d.1 = phi i32 [ %5, %if.then19 ], [ %5, %if.then13 ], [ %d.0118, %if.then30 ], [ 0, %if.else38 ], [ %5, %if.end59 ], [ %d.0118, %if.end ] %max.2 = phi i64 [ %add26, %if.then19 ], [ %add, %if.then13 ], [ %add36, %if.then30 ], [ %add44, %if.else38 ], [ %max.1, %if.end59 ], [ %max.0119, %if.end ] %cmp64 = icmp eq i32 %4, 1 %or.cond = and i1 %tobool2, %cmp64 %6 = and i32 %4, 1 %c.1 = select i1 %or.cond, i32 0, i32 %6 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp = icmp ugt i64 %indvars.iv, 2 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 main() { int A,B; scanf("%d %d",&A,&B); if(A==1 && B==2) printf("3"); else if(A==1 && B==3) printf("2"); else if(A==2 && B==3) printf("1"); else if(A==2 && B==1) printf("3"); else if(A==3 && B==1) printf("2"); else if(A==3 && B==2) printf("1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334873/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334873/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 %1 = load i32, ptr %B, align 4 %cmp1 = icmp eq i32 %1, 2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end36.sink.split, label %if.else if.else: ; preds = %entry %cmp5 = icmp eq i32 %1, 3 %or.cond37 = select i1 %cmp, i1 %cmp5, i1 false br i1 %or.cond37, label %if.end36.sink.split, label %if.else8 if.else8: ; preds = %if.else %cmp9 = icmp eq i32 %0, 2 %or.cond38 = select i1 %cmp9, i1 %cmp5, i1 false br i1 %or.cond38, label %if.end36.sink.split, label %if.else14 if.else14: ; preds = %if.else8 %cmp17 = icmp eq i32 %1, 1 %or.cond39 = select i1 %cmp9, i1 %cmp17, i1 false br i1 %or.cond39, label %if.end36.sink.split, label %if.else20 if.else20: ; preds = %if.else14 %cmp21 = icmp eq i32 %0, 3 %or.cond40 = select i1 %cmp21, i1 %cmp17, i1 false br i1 %or.cond40, label %if.end36.sink.split, label %if.else26 if.else26: ; preds = %if.else20 %or.cond41 = select i1 %cmp21, i1 %cmp1, i1 false br i1 %or.cond41, label %if.end36.sink.split, label %if.end36 if.end36.sink.split: ; preds = %if.else26, %if.else20, %if.else14, %if.else8, %if.else, %entry %.sink = phi i32 [ 51, %entry ], [ 50, %if.else ], [ 49, %if.else8 ], [ 51, %if.else14 ], [ 50, %if.else20 ], [ 49, %if.else26 ] %putchar45 = call i32 @putchar(i32 %.sink) br label %if.end36 if.end36: ; preds = %if.end36.sink.split, %if.else26 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main () { int A,B,C; scanf("%d %d",&A,&B); if(A==3 && B==1 || A==1 && B==3) { printf("2"); } else if(A==1 && B==2 || A==2 && B==1) { printf("3"); } else if(A==3 && B==2 || A==2 && B==3) { printf("1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_334916/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_334916/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 3 %1 = load i32, ptr %B, align 4 %cmp1 = icmp eq i32 %1, 1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end26.sink.split, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp2 = icmp eq i32 %0, 1 %cmp4 = icmp eq i32 %1, 3 %or.cond27 = select i1 %cmp2, i1 %cmp4, i1 false br i1 %or.cond27, label %if.end26.sink.split, label %if.else if.else: ; preds = %lor.lhs.false %cmp8 = icmp eq i32 %1, 2 %or.cond28 = select i1 %cmp2, i1 %cmp8, i1 false br i1 %or.cond28, label %if.end26.sink.split, label %lor.lhs.false9 lor.lhs.false9: ; preds = %if.else %cmp10 = icmp eq i32 %0, 2 %or.cond29 = select i1 %cmp10, i1 %cmp1, i1 false br i1 %or.cond29, label %if.end26.sink.split, label %if.else15 if.else15: ; preds = %lor.lhs.false9 %or.cond30 = select i1 %cmp, i1 %cmp8, i1 false %or.cond31 = select i1 %cmp10, i1 %cmp4, i1 false %or.cond34 = select i1 %or.cond30, i1 true, i1 %or.cond31 br i1 %or.cond34, label %if.end26.sink.split, label %if.end26 if.end26.sink.split: ; preds = %if.else15, %if.else, %lor.lhs.false9, %entry, %lor.lhs.false %.sink = phi i32 [ 50, %lor.lhs.false ], [ 50, %entry ], [ 51, %lor.lhs.false9 ], [ 51, %if.else ], [ 49, %if.else15 ] %putchar32 = call i32 @putchar(i32 %.sink) br label %if.end26 if.end26: ; preds = %if.end26.sink.split, %if.else15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long n,ans=0,i; long c[26]; char a[1000000]; scanf("%ld",&n); scanf("%s",a); n=2*n-2; for(i=0;i<26;i++) { c[i]=0; } for(i=n-1;i>=0;i--) if(a[i]<93) c[a[i]-65]++; else { if(c[a[i]-97]!=0) c[a[i]-97]--; } for(i=0;i<26;i++) ans+=c[i]; printf("%ld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33496/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33496/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [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 i64, align 8 %c = alloca [26 x i64], align 16 %a = alloca [1000000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %a) #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.1, ptr noundef nonnull %a) %0 = load i64, ptr %n, align 8, !tbaa !5 %mul = shl nsw i64 %0, 1 %sub = add nsw i64 %mul, -2 store i64 %sub, ptr %n, align 8, !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %c, i8 0, i64 208, i1 false), !tbaa !5 %cmp454 = icmp sgt i64 %0, 1 br i1 %cmp454, label %for.body5.preheader, label %for.cond31.preheader for.body5.preheader: ; preds = %entry %i.153 = add nsw i64 %mul, -3 br label %for.body5 for.cond31.preheader.loopexit: ; preds = %for.inc28 %1 = load <16 x i64>, ptr %c, align 16, !tbaa !5 %arrayidx35.16.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %c, i64 0, i64 16 %2 = load <8 x i64>, ptr %arrayidx35.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx35.24.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %c, i64 0, i64 24 %.pre81 = load i64, ptr %arrayidx35.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx35.25.phi.trans.insert = getelementptr inbounds [26 x i64], ptr %c, i64 0, i64 25 %.pre82 = load i64, ptr %arrayidx35.25.phi.trans.insert, align 8, !tbaa !5 %3 = call i64 @llvm.vector.reduce.add.v16i64(<16 x i64> %1) %4 = call i64 @llvm.vector.reduce.add.v8i64(<8 x i64> %2) %op.rdx = add i64 %3, %4 %op.rdx83 = add i64 %op.rdx, %.pre81 %op.rdx84 = add i64 %op.rdx83, %.pre82 br label %for.cond31.preheader for.cond31.preheader: ; preds = %for.cond31.preheader.loopexit, %entry %add.25 = phi i64 [ %op.rdx84, %for.cond31.preheader.loopexit ], [ 0, %entry ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add.25) call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 for.body5: ; preds = %for.body5.preheader, %for.inc28 %i.155 = phi i64 [ %i.1, %for.inc28 ], [ %i.153, %for.body5.preheader ] %arrayidx6 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %i.155 %5 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %conv = sext i8 %5 to i32 %cmp7 = icmp slt i8 %5, 93 br i1 %cmp7, label %if.then, label %if.else if.then: ; preds = %for.body5 %sub11 = add nsw i32 %conv, -65 %idxprom = sext i32 %sub11 to i64 %arrayidx12 = getelementptr inbounds [26 x i64], ptr %c, i64 0, i64 %idxprom %6 = load i64, ptr %arrayidx12, align 8, !tbaa !5 %inc13 = add nsw i64 %6, 1 store i64 %inc13, ptr %arrayidx12, align 8, !tbaa !5 br label %for.inc28 if.else: ; preds = %for.body5 %sub16 = add nsw i32 %conv, -97 %idxprom17 = sext i32 %sub16 to i64 %arrayidx18 = getelementptr inbounds [26 x i64], ptr %c, i64 0, i64 %idxprom17 %7 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %cmp19.not = icmp eq i64 %7, 0 br i1 %cmp19.not, label %for.inc28, label %if.then21 if.then21: ; preds = %if.else %dec = add nsw i64 %7, -1 store i64 %dec, ptr %arrayidx18, align 8, !tbaa !5 br label %for.inc28 for.inc28: ; preds = %if.then, %if.then21, %if.else %i.1 = add nsw i64 %i.155, -1 %cmp4 = icmp sgt i64 %i.155, 0 br i1 %cmp4, label %for.body5, label %for.cond31.preheader.loopexit, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v16i64(<16 x i64>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v8i64(<8 x i64>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !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 a,b; scanf("%d%d",&a,&b); if(a+b==3){ printf("3"); }else if(a+b==4){ printf("2"); }else{ printf("1"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335001/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %switch.selectcmp = icmp eq i32 %add, 4 %switch.select = select i1 %switch.selectcmp, i32 50, i32 49 %switch.selectcmp11 = icmp eq i32 %add, 3 %switch.select12 = select i1 %switch.selectcmp11, i32 51, i32 %switch.select %putchar9 = call i32 @putchar(i32 %switch.select12) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int A,B; scanf("%d",&A); scanf("%d",&B); if((A==2&&B==3)||(A==3&&B==2)) { printf("1\n"); } else if((A==1&&B==2)||(A==2&&B==1)) { printf("3\n"); } else { printf("2\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335045/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335045/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.4 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 2 %1 = load i32, ptr %B, align 4 %cmp2 = icmp eq i32 %1, 3 %or.cond = select i1 %cmp, i1 %cmp2, i1 false br i1 %or.cond, label %if.end18, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp3 = icmp eq i32 %0, 3 %cmp5 = icmp eq i32 %1, 2 %or.cond19 = select i1 %cmp3, i1 %cmp5, i1 false br i1 %or.cond19, label %if.end18, label %if.else if.else: ; preds = %lor.lhs.false %cmp7 = icmp eq i32 %0, 1 %or.cond20 = select i1 %cmp7, i1 %cmp5, i1 false %cmp13 = icmp eq i32 %1, 1 %or.cond21 = select i1 %cmp, i1 %cmp13, i1 false %or.cond24 = select i1 %or.cond20, i1 true, i1 %or.cond21 %str.4.str = select i1 %or.cond24, ptr @str.4, ptr @str br label %if.end18 if.end18: ; preds = %if.else, %entry, %lor.lhs.false %str.4.sink = phi ptr [ @str.5, %lor.lhs.false ], [ @str.5, %entry ], [ %str.4.str, %if.else ] %puts22 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <assert.h> #include <stdio.h> #include <stdlib.h> int main (void) { int a, b; scanf("%d%d", &a, &b); if ( a+b == 3 ) printf("3\n"); else if ( a+b == 4 ) printf("2\n"); else if ( a+b == 5 ) printf("1\n"); else assert(0); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335089/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335089/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @.str.5 = private unnamed_addr constant [63 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/C/Source_335089/source.c\00", align 1 @__PRETTY_FUNCTION__.main = private unnamed_addr constant [15 x i8] c"int main(void)\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @reltable.main = private unnamed_addr constant [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.7 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.6 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4 ; Function Attrs: 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) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %switch.tableidx = add i32 %add, -3 %2 = icmp ult i32 %switch.tableidx, 3 br i1 %2, label %switch.lookup, label %if.else11 if.else11: ; preds = %entry call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 15, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7 unreachable switch.lookup: ; preds = %entry %3 = sext i32 %switch.tableidx to i64 %reltable.shift = shl i64 %3, 2 %reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift) %puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: noreturn nounwind declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read) declare ptr @llvm.load.relative.i64(ptr, i64) #5 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } attributes #6 = { nounwind } attributes #7 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d",6-a-b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335139/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335139/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = add i32 %0, %1 %sub1 = sub i32 6, %2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main() { char s[200005],temp; scanf("%s",s); int x,n,i,j,k,c,a[200005]={0},b,m; n=strlen(s); scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d",&x); a[x-1]++; } int state=0; for(i=0;i<=(n-1)/2;i++) { if(state==0 && a[i]%2==1) { temp=s[i]; s[i]=s[n-i-1]; s[n-i-1]=temp; state=1; } else if(state==1 && a[i]%2==1) state=0; else if(state==1 && a[i]%2==0) { temp=s[i]; s[i]=s[n-i-1]; s[n-i-1]=temp; // state=0; } /*if(a[i]%2==1) { if(a[i]>0 && state==1) state=0; else if(a[i]>0 && state==0) state=1; }*/ } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33519/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33519/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [200005 x i8], align 16 %x = alloca i32, align 4 %a = alloca [200005 x i32], align 16 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %s) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %a) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800020) %a, i8 0, i64 800020, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %conv = trunc i64 %call2 to i32 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp90 = icmp sgt i32 %0, 0 br i1 %cmp90, label %for.body, label %for.cond7.preheader for.cond7.preheader: ; preds = %for.body, %entry %cmp9.not92 = icmp slt i32 %conv, 0 br i1 %cmp9.not92, label %for.end65, label %for.body11.preheader for.body11.preheader: ; preds = %for.cond7.preheader %sub8 = add nsw i32 %conv, -1 %div = sdiv i32 %sub8, 2 %1 = add nuw nsw i32 %div, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.body11 for.body: ; preds = %entry, %for.body %i.091 = phi i32 [ %inc6, %for.body ], [ 0, %entry ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %2 = load i32, ptr %x, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %idxprom %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %inc6 = add nuw nsw i32 %i.091, 1 %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp = icmp slt i32 %inc6, %4 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.body11: ; preds = %for.body11.preheader, %for.inc63 %indvars.iv = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next, %for.inc63 ] %state.094 = phi i32 [ 0, %for.body11.preheader ], [ %state.1, %for.inc63 ] %cmp12 = icmp eq i32 %state.094, 0 %arrayidx15 = getelementptr inbounds [200005 x i32], ptr %a, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %6 = and i32 %5, -2147483647 %cmp16 = icmp eq i32 %6, 1 br i1 %cmp12, label %land.lhs.true, label %land.lhs.true32 land.lhs.true: ; preds = %for.body11 br i1 %cmp16, label %if.then, label %for.inc63 if.then: ; preds = %land.lhs.true %arrayidx19 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv %7 = load i8, ptr %arrayidx19, align 1, !tbaa !11 %8 = xor i64 %indvars.iv, -1 %sub21 = add i64 %call2, %8 %sext96 = shl i64 %sub21, 32 %idxprom22 = ashr exact i64 %sext96, 32 %arrayidx23 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %idxprom22 %9 = load i8, ptr %arrayidx23, align 1, !tbaa !11 store i8 %9, ptr %arrayidx19, align 1, !tbaa !11 store i8 %7, ptr %arrayidx23, align 1, !tbaa !11 br label %for.inc63 land.lhs.true32: ; preds = %for.body11 br i1 %cmp16, label %for.inc63, label %land.lhs.true42 land.lhs.true42: ; preds = %land.lhs.true32 %10 = and i32 %5, 1 %cmp46 = icmp eq i32 %10, 0 br i1 %cmp46, label %if.then48, label %for.inc63 if.then48: ; preds = %land.lhs.true42 %arrayidx50 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv %11 = load i8, ptr %arrayidx50, align 1, !tbaa !11 %12 = xor i64 %indvars.iv, -1 %sub52 = add i64 %call2, %12 %sext = shl i64 %sub52, 32 %idxprom53 = ashr exact i64 %sext, 32 %arrayidx54 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %idxprom53 %13 = load i8, ptr %arrayidx54, align 1, !tbaa !11 store i8 %13, ptr %arrayidx50, align 1, !tbaa !11 store i8 %11, ptr %arrayidx54, align 1, !tbaa !11 br label %for.inc63 for.inc63: ; preds = %land.lhs.true, %land.lhs.true32, %if.then, %land.lhs.true42, %if.then48 %state.1 = phi i32 [ 1, %if.then ], [ 1, %if.then48 ], [ 1, %land.lhs.true42 ], [ 0, %land.lhs.true32 ], [ 0, %land.lhs.true ] %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.end65, label %for.body11, !llvm.loop !12 for.end65: ; preds = %for.inc63, %for.cond7.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %s) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress 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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) 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 nounwind willreturn memory(argmem: write) } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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() { int a,b,c,i; scanf("%d%d",&a,&b); for(i=1;i<4;i++){ if(i==a||i==b) continue; else{ printf("%d",i); break; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335232/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335232/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4 %cmp1 = icmp eq i32 %0, 1 %cmp2 = icmp eq i32 %1, 1 %or.cond = select i1 %cmp1, i1 true, i1 %cmp2 br i1 %or.cond, label %for.inc, label %if.else if.else: ; preds = %for.inc.1, %for.inc, %entry %i.09.lcssa = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.09.lcssa) br label %for.end for.inc: ; preds = %entry %cmp1.1 = icmp eq i32 %0, 2 %cmp2.1 = icmp eq i32 %1, 2 %or.cond.1 = select i1 %cmp1.1, i1 true, i1 %cmp2.1 br i1 %or.cond.1, label %for.inc.1, label %if.else for.inc.1: ; preds = %for.inc %cmp1.2 = icmp eq i32 %0, 3 %cmp2.2 = icmp eq i32 %1, 3 %or.cond.2 = select i1 %cmp1.2, i1 true, i1 %cmp2.2 br i1 %or.cond.2, label %for.end, label %if.else for.end: ; preds = %for.inc.1, %if.else call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int miss1,miss2; char str[64]; fgets(str,sizeof(str),stdin); sscanf(str,"%d",&miss1); fgets(str,sizeof(str),stdin); sscanf(str,"%d",&miss2); switch (miss1) { case 1: if(miss2 == 2) { puts("3"); }else { puts("2"); } break; case 2: if(miss2 == 1) { puts("3"); }else { puts("1"); } break; default: if(miss2 == 1) { puts("2"); }else { puts("1"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335276/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335276/source.c" target datalayout = "e-m:e-p270: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"%d\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %miss1 = alloca i32, align 4 %miss2 = alloca i32, align 4 %str = alloca [64 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %miss1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %miss2) #3 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %str) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 64, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %miss1) #3 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call4 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 64, ptr noundef %1) %call6 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %miss2) #3 %2 = load i32, ptr %miss1, align 4, !tbaa !9 %3 = load i32, ptr %miss2, align 4, !tbaa !9 switch i32 %2, label %sw.default [ i32 1, label %sw.bb i32 2, label %sw.bb9 ] sw.bb: ; preds = %entry %cmp = icmp eq i32 %3, 2 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 br label %sw.epilog sw.bb9: ; preds = %entry %cmp10 = icmp eq i32 %3, 1 %.str.1..str.3 = select i1 %cmp10, ptr @.str.1, ptr @.str.3 br label %sw.epilog sw.default: ; preds = %entry %cmp16 = icmp eq i32 %3, 1 %.str.2..str.3 = select i1 %cmp16, ptr @.str.2, ptr @.str.3 br label %sw.epilog sw.epilog: ; preds = %sw.default, %sw.bb9, %sw.bb %.str.2.sink = phi ptr [ %.str.1..str.2, %sw.bb ], [ %.str.1..str.3, %sw.bb9 ], [ %.str.2..str.3, %sw.default ] %call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %str) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %miss2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %miss1) #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 @__isoc99_sscanf(ptr nocapture noundef readonly, 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 = !{!"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> #include <math.h> #include <string.h> #include <stdlib.h> #include <time.h> #define pai 3.1415926535 #define N 10 int main(void) { int A, B; scanf("%d%d", &A, &B); if ((A == 1) && (B == 2) || (A == 2) && (B == 1)) { printf("%d", 3); } else if ((A == 1) && (B == 3) || (A == 3) && (B == 1)) { printf("%d", 2); } else { printf("%d", 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335319/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335319/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 %1 = load i32, ptr %B, align 4 %cmp1 = icmp eq i32 %1, 2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end17, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp2 = icmp eq i32 %0, 2 %cmp4 = icmp eq i32 %1, 1 %or.cond18 = select i1 %cmp2, i1 %cmp4, i1 false br i1 %or.cond18, label %if.end17, label %if.else if.else: ; preds = %lor.lhs.false %cmp8 = icmp eq i32 %1, 3 %or.cond19 = select i1 %cmp, i1 %cmp8, i1 false %cmp10 = icmp eq i32 %0, 3 %or.cond20 = select i1 %cmp10, i1 %cmp4, i1 false %or.cond21 = select i1 %or.cond19, i1 true, i1 %or.cond20 %. = select i1 %or.cond21, i32 2, i32 1 br label %if.end17 if.end17: ; preds = %if.else, %entry, %lor.lhs.false %.sink = phi i32 [ 3, %lor.lhs.false ], [ 3, %entry ], [ %., %if.else ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<string.h> #define GETINT(X) scanf("%d",&X) #define GETLL(X) scanf("%lld",&X) typedef long long int LL; int main() { int n; char arr[200005]; int hash[26]; memset(hash,0,sizeof(hash)); scanf("%d",&n); scanf("%s",arr); int i; int count=0; for(i=1;i<=n-1;i++) { if(arr[2*i-1]!=arr[2*i-2]-'a'+'A') { if(hash[arr[2*i-1]-'A']==0) count++; else hash[arr[2*i-1]-'A']--; hash[arr[2*i-2]-'a']++; } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33537/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33537/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [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 %arr = alloca [200005 x i8], align 16 %hash = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %arr) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %hash) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %hash, i8 0, i64 104, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arr) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not50 = icmp sgt i32 %0, 1 br i1 %cmp.not.not50, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %count.052 = phi i32 [ 0, %for.body.preheader ], [ %count.2, %for.inc ] %1 = shl nuw nsw i64 %indvars.iv, 1 %2 = add nsw i64 %1, -1 %arrayidx = getelementptr inbounds [200005 x i8], ptr %arr, i64 0, i64 %2 %3 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %3 to i32 %4 = add nsw i64 %1, -2 %arrayidx7 = getelementptr inbounds [200005 x i8], ptr %arr, i64 0, i64 %4 %5 = load i8, ptr %arrayidx7, align 2, !tbaa !9 %conv8 = sext i8 %5 to i32 %add = add nsw i32 %conv8, -32 %cmp10.not = icmp eq i32 %add, %conv br i1 %cmp10.not, label %for.inc, label %if.then if.then: ; preds = %for.body %sub17 = add nsw i32 %conv, -65 %idxprom18 = sext i32 %sub17 to i64 %arrayidx19 = getelementptr inbounds [26 x i32], ptr %hash, i64 0, i64 %idxprom18 %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp eq i32 %6, 0 br i1 %cmp20, label %if.then22, label %if.else if.then22: ; preds = %if.then %inc = add nsw i32 %count.052, 1 br label %if.end if.else: ; preds = %if.then %dec = add nsw i32 %6, -1 store i32 %dec, ptr %arrayidx19, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then22 %count.1 = phi i32 [ %inc, %if.then22 ], [ %count.052, %if.else ] %conv35 = sext i8 %5 to i64 %sub36 = add nsw i64 %conv35, -97 %arrayidx38 = getelementptr inbounds [26 x i32], ptr %hash, i64 0, i64 %sub36 %7 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %inc39 = add nsw i32 %7, 1 store i32 %inc39, ptr %arrayidx38, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.end %count.2 = phi i32 [ %count.1, %if.end ], [ %count.052, %for.body ] %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 !10 for.end: ; preds = %for.inc, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.2, %for.inc ] %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %hash) #4 call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %arr) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
// AOJ 2809: Graduation Ceremony // 2018.1.4 bal4u@uu #include <stdio.h> #define min(a,b) ((a)<=(b)?(a):(b)) #define max(a,b) ((a)>=(b)?(a):(b)) #define MAX 2002 char s[MAX]; short u[MAX], d[MAX], l[MAX], r[MAX]; int dx[4] = { 0,1,0,-1}; // URDL int dy[4] = {-1,0,1, 0}; int tr['Z']; int main() { int k, i, j, j2, dir, ans; char *p; tr['U'] = 0, tr['R'] = 1, tr['D'] = 2, tr['L'] = 3; scanf("%s%d", s, &k); p = s; while (*p) { dir = tr[*p++]; j2 = j = k; while (j--) { u[j2] = min(-d[j], u[j2]) + dy[dir]; r[j2] = max(-l[j], r[j2]) + dx[dir]; d[j2] = max(-u[j], d[j2]) + dy[dir]; l[j2] = min(-r[j], l[j2]) + dx[dir]; j2--; } l[0] += dx[dir], r[0] = l[0]; d[0] += dy[dir], u[0] = d[0]; } ans = 0; for (i = 0; i <= k; i++) { j = -l[i]; if (j < r[i ]) j = r[i]; j2 = -u[k-i]; if (j2 < d[k-i]) j2 = d[k-i]; j += j2; if (j > ans) ans = j; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335412/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335412/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @dx = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16 @dy = dso_local local_unnamed_addr global [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16 @tr = dso_local local_unnamed_addr global [90 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @s = dso_local global [2002 x i8] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [2002 x i16] zeroinitializer, align 16 @u = dso_local local_unnamed_addr global [2002 x i16] zeroinitializer, align 16 @l = dso_local local_unnamed_addr global [2002 x i16] zeroinitializer, align 16 @r = dso_local local_unnamed_addr global [2002 x i16] 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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 store i32 0, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 85), align 4, !tbaa !5 store i32 1, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 82), align 8, !tbaa !5 store i32 2, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 68), align 16, !tbaa !5 store i32 3, ptr getelementptr inbounds ([90 x i32], ptr @tr, i64 0, i64 76), align 16, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull %k) %0 = load i8, ptr @s, align 16, !tbaa !9 %tobool.not192 = icmp eq i8 %0, 0 %.pre211 = load i32, ptr %k, align 4, !tbaa !5 br i1 %tobool.not192, label %for.cond.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %tobool2.not189 = icmp eq i32 %.pre211, 0 br i1 %tobool2.not189, label %while.body.lr.ph.split.us, label %while.body.preheader while.body.preheader: ; preds = %while.body.lr.ph %1 = sext i32 %.pre211 to i64 %arrayidx7.phi.trans.insert = getelementptr inbounds [2002 x i16], ptr @u, i64 0, i64 %1 %arrayidx27.phi.trans.insert = getelementptr inbounds [2002 x i16], ptr @r, i64 0, i64 %1 %arrayidx53.phi.trans.insert = getelementptr inbounds [2002 x i16], ptr @d, i64 0, i64 %1 %arrayidx79.phi.trans.insert = getelementptr inbounds [2002 x i16], ptr @l, i64 0, i64 %1 br label %while.body while.body.lr.ph.split.us: ; preds = %while.body.lr.ph %l.promoted = load i16, ptr @l, align 16, !tbaa !10 %d.promoted = load i16, ptr @d, align 16, !tbaa !10 br label %while.body.us while.body.us: ; preds = %while.body.us, %while.body.lr.ph.split.us %conv110.us196 = phi i16 [ %d.promoted, %while.body.lr.ph.split.us ], [ %conv110.us, %while.body.us ] %conv105.us194 = phi i16 [ %l.promoted, %while.body.lr.ph.split.us ], [ %conv105.us, %while.body.us ] %2 = phi i8 [ %0, %while.body.lr.ph.split.us ], [ %8, %while.body.us ] %p.0193.us = phi ptr [ @s, %while.body.lr.ph.split.us ], [ %incdec.ptr.us, %while.body.us ] %incdec.ptr.us = getelementptr inbounds i8, ptr %p.0193.us, i64 1 %idxprom.us = sext i8 %2 to i64 %arrayidx.us = getelementptr inbounds [90 x i32], ptr @tr, i64 0, i64 %idxprom.us %3 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %idxprom101.us = sext i32 %3 to i64 %arrayidx102.us = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %idxprom101.us %4 = load i32, ptr %arrayidx102.us, align 4, !tbaa !5 %5 = trunc i32 %4 to i16 %conv105.us = add i16 %conv105.us194, %5 %arrayidx107.us = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %idxprom101.us %6 = load i32, ptr %arrayidx107.us, align 4, !tbaa !5 %7 = trunc i32 %6 to i16 %conv110.us = add i16 %conv110.us196, %7 %8 = load i8, ptr %incdec.ptr.us, align 1, !tbaa !9 %tobool.not.us = icmp eq i8 %8, 0 br i1 %tobool.not.us, label %while.cond.for.cond.preheader_crit_edge.split.us, label %while.body.us, !llvm.loop !12 while.cond.for.cond.preheader_crit_edge.split.us: ; preds = %while.body.us store i16 %conv105.us, ptr @l, align 16, !tbaa !10 store i16 %conv105.us, ptr @r, align 16, !tbaa !10 store i16 %conv110.us, ptr @d, align 16, !tbaa !10 store i16 %conv110.us, ptr @u, align 16, !tbaa !10 br label %for.cond.preheader for.cond.preheader: ; preds = %while.cond1.while.end_crit_edge, %while.cond.for.cond.preheader_crit_edge.split.us, %entry %cmp112.not198 = icmp slt i32 %.pre211, 0 br i1 %cmp112.not198, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %9 = zext i32 %.pre211 to i64 %10 = add nuw i32 %.pre211, 1 %wide.trip.count = zext i32 %10 to i64 %min.iters.check = icmp ult i32 %.pre211, 7 br i1 %min.iters.check, label %for.body.preheader223, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ] %vec.phi212 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ] %11 = getelementptr inbounds [2002 x i16], ptr @l, i64 0, i64 %index %wide.load = load <4 x i16>, ptr %11, align 16, !tbaa !10 %12 = getelementptr inbounds i16, ptr %11, i64 4 %wide.load213 = load <4 x i16>, ptr %12, align 8, !tbaa !10 %13 = sext <4 x i16> %wide.load to <4 x i32> %14 = sext <4 x i16> %wide.load213 to <4 x i32> %15 = sub nsw <4 x i32> zeroinitializer, %13 %16 = sub nsw <4 x i32> zeroinitializer, %14 %17 = getelementptr inbounds [2002 x i16], ptr @r, i64 0, i64 %index %wide.load214 = load <4 x i16>, ptr %17, align 16, !tbaa !10 %18 = getelementptr inbounds i16, ptr %17, i64 4 %wide.load215 = load <4 x i16>, ptr %18, align 8, !tbaa !10 %19 = sext <4 x i16> %wide.load214 to <4 x i32> %20 = sext <4 x i16> %wide.load215 to <4 x i32> %21 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %15, <4 x i32> %19) %22 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %16, <4 x i32> %20) %23 = sub nsw i64 %9, %index %24 = getelementptr inbounds [2002 x i16], ptr @u, i64 0, i64 %23 %25 = getelementptr inbounds i16, ptr %24, i64 -3 %wide.load216 = load <4 x i16>, ptr %25, align 2, !tbaa !10 %reverse = shufflevector <4 x i16> %wide.load216, <4 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %26 = getelementptr inbounds i16, ptr %24, i64 -7 %wide.load217 = load <4 x i16>, ptr %26, align 2, !tbaa !10 %reverse218 = shufflevector <4 x i16> %wide.load217, <4 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %27 = sext <4 x i16> %reverse to <4 x i32> %28 = sext <4 x i16> %reverse218 to <4 x i32> %29 = sub nsw <4 x i32> zeroinitializer, %27 %30 = sub nsw <4 x i32> zeroinitializer, %28 %31 = getelementptr inbounds [2002 x i16], ptr @d, i64 0, i64 %23 %32 = getelementptr inbounds i16, ptr %31, i64 -3 %wide.load219 = load <4 x i16>, ptr %32, align 2, !tbaa !10 %reverse220 = shufflevector <4 x i16> %wide.load219, <4 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %33 = getelementptr inbounds i16, ptr %31, i64 -7 %wide.load221 = load <4 x i16>, ptr %33, align 2, !tbaa !10 %reverse222 = shufflevector <4 x i16> %wide.load221, <4 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %34 = sext <4 x i16> %reverse220 to <4 x i32> %35 = sext <4 x i16> %reverse222 to <4 x i32> %36 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %29, <4 x i32> %34) %37 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %30, <4 x i32> %35) %38 = add nsw <4 x i32> %36, %21 %39 = add nsw <4 x i32> %37, %22 %40 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %38, <4 x i32> %vec.phi) %41 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %39, <4 x i32> %vec.phi212) %index.next = add nuw i64 %index, 8 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %40, <4 x i32> %41) %43 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader223 for.body.preheader223: ; preds = %for.body.preheader, %middle.block %indvars.iv204.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %ans.0200.ph = phi i32 [ 0, %for.body.preheader ], [ %43, %middle.block ] br label %for.body while.body: ; preds = %while.body.preheader, %while.cond1.while.end_crit_edge %44 = phi i8 [ %61, %while.cond1.while.end_crit_edge ], [ %0, %while.body.preheader ] %p.0193 = phi ptr [ %incdec.ptr, %while.cond1.while.end_crit_edge ], [ @s, %while.body.preheader ] %idxprom = sext i8 %44 to i64 %arrayidx = getelementptr inbounds [90 x i32], ptr @tr, i64 0, i64 %idxprom %45 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom17 = sext i32 %45 to i64 %arrayidx18 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %idxprom17 %46 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx43 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %idxprom17 %47 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %.pre = load i16, ptr %arrayidx7.phi.trans.insert, align 2, !tbaa !10 %.pre208 = load i16, ptr %arrayidx27.phi.trans.insert, align 2, !tbaa !10 %.pre209 = load i16, ptr %arrayidx53.phi.trans.insert, align 2, !tbaa !10 %.pre210 = load i16, ptr %arrayidx79.phi.trans.insert, align 2, !tbaa !10 br label %while.body3 while.body3: ; preds = %while.body, %while.body3 %48 = phi i16 [ %.pre210, %while.body ], [ %53, %while.body3 ] %49 = phi i16 [ %.pre209, %while.body ], [ %52, %while.body3 ] %50 = phi i16 [ %.pre208, %while.body ], [ %55, %while.body3 ] %51 = phi i16 [ %.pre, %while.body ], [ %54, %while.body3 ] %indvars.iv = phi i64 [ %1, %while.body ], [ %indvars.iv.next, %while.body3 ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx5 = getelementptr inbounds [2002 x i16], ptr @d, i64 0, i64 %indvars.iv.next %52 = load i16, ptr %arrayidx5, align 2, !tbaa !10 %conv = sext i16 %52 to i32 %sub = sub nsw i32 0, %conv %arrayidx7 = getelementptr inbounds [2002 x i16], ptr @u, i64 0, i64 %indvars.iv %conv8 = sext i16 %51 to i32 %conv8.sub = call i32 @llvm.smin.i32(i32 %sub, i32 %conv8) %add = add nsw i32 %conv8.sub, %46 %conv19 = trunc i32 %add to i16 store i16 %conv19, ptr %arrayidx7, align 2, !tbaa !10 %arrayidx23 = getelementptr inbounds [2002 x i16], ptr @l, i64 0, i64 %indvars.iv.next %53 = load i16, ptr %arrayidx23, align 2, !tbaa !10 %conv24 = sext i16 %53 to i32 %sub25 = sub nsw i32 0, %conv24 %arrayidx27 = getelementptr inbounds [2002 x i16], ptr @r, i64 0, i64 %indvars.iv %conv28 = sext i16 %50 to i32 %cond41 = call i32 @llvm.smax.i32(i32 %sub25, i32 %conv28) %add44 = add nsw i32 %cond41, %47 %conv45 = trunc i32 %add44 to i16 store i16 %conv45, ptr %arrayidx27, align 2, !tbaa !10 %arrayidx49 = getelementptr inbounds [2002 x i16], ptr @u, i64 0, i64 %indvars.iv.next %54 = load i16, ptr %arrayidx49, align 2, !tbaa !10 %conv50 = sext i16 %54 to i32 %sub51 = sub nsw i32 0, %conv50 %arrayidx53 = getelementptr inbounds [2002 x i16], ptr @d, i64 0, i64 %indvars.iv %conv54 = sext i16 %49 to i32 %cond67 = call i32 @llvm.smax.i32(i32 %sub51, i32 %conv54) %add70 = add nsw i32 %cond67, %46 %conv71 = trunc i32 %add70 to i16 store i16 %conv71, ptr %arrayidx53, align 2, !tbaa !10 %arrayidx75 = getelementptr inbounds [2002 x i16], ptr @r, i64 0, i64 %indvars.iv.next %55 = load i16, ptr %arrayidx75, align 2, !tbaa !10 %conv76 = sext i16 %55 to i32 %sub77 = sub nsw i32 0, %conv76 %arrayidx79 = getelementptr inbounds [2002 x i16], ptr @l, i64 0, i64 %indvars.iv %conv80 = sext i16 %48 to i32 %cond93 = call i32 @llvm.smin.i32(i32 %sub77, i32 %conv80) %add96 = add nsw i32 %cond93, %47 %conv97 = trunc i32 %add96 to i16 store i16 %conv97, ptr %arrayidx79, align 2, !tbaa !10 %56 = and i64 %indvars.iv.next, 4294967295 %tobool2.not = icmp eq i64 %56, 0 br i1 %tobool2.not, label %while.cond1.while.end_crit_edge, label %while.body3, !llvm.loop !17 while.cond1.while.end_crit_edge: ; preds = %while.body3 %incdec.ptr = getelementptr inbounds i8, ptr %p.0193, i64 1 %57 = load i16, ptr @l, align 16, !tbaa !10 %58 = trunc i32 %47 to i16 %conv105 = add i16 %57, %58 store i16 %conv105, ptr @l, align 16, !tbaa !10 store i16 %conv105, ptr @r, align 16, !tbaa !10 %59 = load i16, ptr @d, align 16, !tbaa !10 %60 = trunc i32 %46 to i16 %conv110 = add i16 %59, %60 store i16 %conv110, ptr @d, align 16, !tbaa !10 store i16 %conv110, ptr @u, align 16, !tbaa !10 %61 = load i8, ptr %incdec.ptr, align 1, !tbaa !9 %tobool.not = icmp eq i8 %61, 0 br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !12 for.body: ; preds = %for.body.preheader223, %for.body %indvars.iv204 = phi i64 [ %indvars.iv.next205, %for.body ], [ %indvars.iv204.ph, %for.body.preheader223 ] %ans.0200 = phi i32 [ %ans.1, %for.body ], [ %ans.0200.ph, %for.body.preheader223 ] %arrayidx115 = getelementptr inbounds [2002 x i16], ptr @l, i64 0, i64 %indvars.iv204 %62 = load i16, ptr %arrayidx115, align 2, !tbaa !10 %conv116 = sext i16 %62 to i32 %sub117 = sub nsw i32 0, %conv116 %arrayidx119 = getelementptr inbounds [2002 x i16], ptr @r, i64 0, i64 %indvars.iv204 %63 = load i16, ptr %arrayidx119, align 2, !tbaa !10 %conv120 = sext i16 %63 to i32 %spec.select = call i32 @llvm.smax.i32(i32 %sub117, i32 %conv120) %64 = sub nsw i64 %9, %indvars.iv204 %arrayidx128 = getelementptr inbounds [2002 x i16], ptr @u, i64 0, i64 %64 %65 = load i16, ptr %arrayidx128, align 2, !tbaa !10 %conv129 = sext i16 %65 to i32 %sub130 = sub nsw i32 0, %conv129 %arrayidx133 = getelementptr inbounds [2002 x i16], ptr @d, i64 0, i64 %64 %66 = load i16, ptr %arrayidx133, align 2, !tbaa !10 %conv134 = sext i16 %66 to i32 %j2.1 = call i32 @llvm.smax.i32(i32 %sub130, i32 %conv134) %add143 = add nsw i32 %j2.1, %spec.select %ans.1 = call i32 @llvm.smax.i32(i32 %add143, i32 %ans.0200) %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !18 for.end: ; preds = %for.body, %middle.block, %for.cond.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %43, %middle.block ], [ %ans.1, %for.body ] %call148 = 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 %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"short", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !13} !18 = distinct !{!18, !13, !16, !15}
#include<stdio.h> int main(){ int S; scanf("%4d", &S); if((S/100 <= 12 && S/100 >= 1)&&(S % 100 < 1 || S % 100 > 12)) { printf("MMYY"); } else if((S/100 < 1 || S/100 > 12)&&(S % 100 <= 12 && S % 100 >= 1)) { printf("YYMM"); } else if( S/100 <=12 && S/100 >= 1 && S % 100 <= 12 && S % 100 >= 1) { printf("AMBIGUOUS"); } else { printf("NA"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335456/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%4d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"MMYY\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"YYMM\00", align 1 @.str.3 = private unnamed_addr constant [10 x i8] c"AMBIGUOUS\00", align 1 @.str.4 = 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: %S = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i32, ptr %S, align 4, !tbaa !5 %1 = add i32 %0, -100 %or.cond = icmp ult i32 %1, 1200 br i1 %or.cond, label %land.lhs.true3, label %land.lhs.true13 land.lhs.true3: ; preds = %entry %rem44.lhs.trunc = trunc i32 %0 to i16 %rem4445 = urem i16 %rem44.lhs.trunc, 100 %2 = add nsw i16 %rem4445, -13 %or.cond39 = icmp ult i16 %2, -12 br i1 %or.cond39, label %if.end38, label %land.lhs.true27 land.lhs.true13: ; preds = %entry %rem14 = srem i32 %0, 100 %3 = add nsw i32 %rem14, -1 %or.cond41 = icmp ult i32 %3, 12 br i1 %or.cond41, label %if.end38, label %if.else35 land.lhs.true27: ; preds = %land.lhs.true3 %rem2846.lhs.trunc = trunc i32 %0 to i16 %rem284647 = urem i16 %rem2846.lhs.trunc, 100 %4 = add nsw i16 %rem284647, -1 %or.cond43 = icmp ult i16 %4, 12 br i1 %or.cond43, label %if.end38, label %if.else35 if.else35: ; preds = %land.lhs.true13, %land.lhs.true27 br label %if.end38 if.end38: ; preds = %land.lhs.true27, %land.lhs.true13, %land.lhs.true3, %if.else35 %.str.2.sink = phi ptr [ @.str.4, %if.else35 ], [ @.str.1, %land.lhs.true3 ], [ @.str.2, %land.lhs.true13 ], [ @.str.3, %land.lhs.true27 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int k; int d; int i; scanf(" %d %d", &k, &d); if (k == 1 && d == 0) { printf("0\n"); } else if (k != 0 && d == 0) { printf("No solution\n"); } else { for (i = 1; i < k; i++) { printf("9"); } printf("%d\n", d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3355/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c" %d %d\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [12 x i8] c"No solution\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %d) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 %1 = load i32, ptr %d, align 4 %cmp1 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end12 if.else: ; preds = %entry %cmp3 = icmp ne i32 %0, 0 %or.cond13 = select i1 %cmp3, i1 %cmp1, i1 false br i1 %or.cond13, label %if.then6, label %for.cond.preheader for.cond.preheader: ; preds = %if.else %cmp916 = icmp sgt i32 %0, 1 br i1 %cmp916, label %for.body, label %for.end if.then6: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end12 for.body: ; preds = %for.cond.preheader, %for.body %i.017 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ] %putchar = call i32 @putchar(i32 57) %inc = add nuw nsw i32 %i.017, 1 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp9 = icmp slt i32 %inc, %2 br i1 %cmp9, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %.pre = load i32, ptr %d, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %for.cond.preheader %3 = phi i32 [ %.pre, %for.end.loopexit ], [ %1, %for.cond.preheader ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %3) br label %if.end12 if.end12: ; preds = %if.then6, %for.end, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int m; char s[4]; int main(void) { scanf("%s", s); if (s[0] == '0' && s[1] >= '1' || s[0] == '1' && s[1] <= '2') { m = 1; } else { m = 2; } if (m == 1) { if (s[2] == '0' && s[3] >= '1' || s[2] == '1' && s[3] <= '2') { printf("AMBIGUOUS"); } else { printf("MMYY"); } } else { if (s[2] == '0' && s[3] == '0' || s[2] >= '2' || s[2] == '1' && s[3] >= '3') { printf("NA"); } else { printf("YYMM"); } } return 0; /*if(s[0] =='0'&&s[1] == '0'||s[2] =='0'&&s[3] == '0'){ printf("NA"); }else if (s[0] >= '2') { printf("YYMM"); } else if (s[1] >= '3') { printf("YYMM"); } else if(s[2] >= '2'&&s[3] >= '3'){ printf("MMYY"); }else { printf("AMBIGUOUS"); }*/ }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335557/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335557/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] zeroinitializer, align 1 @m = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [10 x i8] c"AMBIGUOUS\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"MMYY\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"NA\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"YYMM\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s) %0 = load i8, ptr @s, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 48 %1 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @s, i64 0, i64 1), align 1 %cmp3 = icmp sgt i8 %1, 48 %or.cond = select i1 %cmp, i1 %cmp3, i1 false br i1 %or.cond, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %cmp6 = icmp eq i8 %0, 49 %cmp10 = icmp slt i8 %1, 51 %or.cond61 = select i1 %cmp6, i1 %cmp10, i1 false br i1 %or.cond61, label %if.end, label %if.else if.else: ; preds = %lor.lhs.false store i32 2, ptr @m, align 4, !tbaa !8 %2 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @s, i64 0, i64 2), align 1 %cmp37 = icmp eq i8 %2, 48 %3 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @s, i64 0, i64 3), align 1 %cmp41 = icmp eq i8 %3, 48 %or.cond64 = select i1 %cmp37, i1 %cmp41, i1 false %cmp45 = icmp sgt i8 %2, 49 %or.cond65 = or i1 %cmp45, %or.cond64 br i1 %or.cond65, label %if.end60, label %lor.lhs.false47 if.end: ; preds = %entry, %lor.lhs.false store i32 1, ptr @m, align 4, !tbaa !8 %4 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @s, i64 0, i64 2), align 1, !tbaa !5 %cmp16 = icmp eq i8 %4, 48 %5 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @s, i64 0, i64 3), align 1 %cmp20 = icmp sgt i8 %5, 48 %or.cond62 = select i1 %cmp16, i1 %cmp20, i1 false br i1 %or.cond62, label %if.end60, label %lor.lhs.false22 lor.lhs.false22: ; preds = %if.end %cmp24 = icmp eq i8 %4, 49 %cmp28 = icmp slt i8 %5, 51 %or.cond63 = select i1 %cmp24, i1 %cmp28, i1 false %spec.select = select i1 %or.cond63, ptr @.str.1, ptr @.str.2 br label %if.end60 lor.lhs.false47: ; preds = %if.else %cmp49 = icmp eq i8 %2, 49 %cmp53 = icmp sgt i8 %3, 50 %or.cond66 = select i1 %cmp49, i1 %cmp53, i1 false %spec.select67 = select i1 %or.cond66, ptr @.str.3, ptr @.str.4 br label %if.end60 if.end60: ; preds = %lor.lhs.false47, %lor.lhs.false22, %if.else, %if.end %.str.3.sink = phi ptr [ @.str.1, %if.end ], [ @.str.3, %if.else ], [ %spec.select, %lor.lhs.false22 ], [ %spec.select67, %lor.lhs.false47 ] %call56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.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 @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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0}
#include<stdio.h> #include<string.h> int main() { int n; scanf("%d",&n); char a[1000000]; int i=0,j; int count=0; scanf(" %s",a); int l=strlen(a); int b[26]; for(i=0;i<26;i++) b[i]=0; i=0; while(i<l) { int x,y,p=0; x=a[i]; y=a[i+1]; if((x-y)==32) { i=i+2; count=count; } else { b[a[i]-97]++; if(b[a[i+1]-65]>0) { p=1; b[a[i+1]-65]=b[a[i+1]-65]-1; } if(p==1) { count=count; i=i+2; } else { count++; i=i+2; } } } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33560/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33560/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1000000 x i8], align 16 %b = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %a) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %b, i8 0, i64 104, i1 false), !tbaa !5 %conv = trunc i64 %call3 to i32 %cmp574 = icmp sgt i32 %conv, 0 br i1 %cmp574, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %sext = shl i64 %call3, 32 %0 = ashr exact i64 %sext, 32 br label %while.body while.body: ; preds = %while.body.preheader, %if.end56 %indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %if.end56 ] %count.075 = phi i32 [ 0, %while.body.preheader ], [ %count.1, %if.end56 ] %arrayidx8 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx8, align 2, !tbaa !9 %conv9 = sext i8 %1 to i32 %2 = or i64 %indvars.iv, 1 %arrayidx11 = getelementptr inbounds [1000000 x i8], ptr %a, i64 0, i64 %2 %3 = load i8, ptr %arrayidx11, align 1, !tbaa !9 %conv12 = sext i8 %3 to i32 %sub = sub nsw i32 %conv9, %conv12 %cmp13 = icmp eq i32 %sub, 32 br i1 %cmp13, label %if.end56, label %if.else if.else: ; preds = %while.body %sub19 = add nsw i32 %conv9, -97 %idxprom20 = sext i32 %sub19 to i64 %arrayidx21 = getelementptr inbounds [26 x i32], ptr %b, i64 0, i64 %idxprom20 %4 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %inc22 = add nsw i32 %4, 1 store i32 %inc22, ptr %arrayidx21, align 4, !tbaa !5 %conv26 = sext i8 %3 to i64 %sub27 = add nsw i64 %conv26, -65 %arrayidx29 = getelementptr inbounds [26 x i32], ptr %b, i64 0, i64 %sub27 %5 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %5, 0 br i1 %cmp30, label %if.then32, label %if.else52 if.then32: ; preds = %if.else %sub40 = add nsw i32 %5, -1 store i32 %sub40, ptr %arrayidx29, align 4, !tbaa !5 br label %if.end56 if.else52: ; preds = %if.else %inc53 = add nsw i32 %count.075, 1 br label %if.end56 if.end56: ; preds = %if.then32, %while.body, %if.else52 %count.1 = phi i32 [ %inc53, %if.else52 ], [ %count.075, %while.body ], [ %count.075, %if.then32 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2 %cmp5 = icmp slt i64 %indvars.iv.next, %0 br i1 %cmp5, label %while.body, label %while.end, !llvm.loop !10 while.end: ; preds = %if.end56, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %if.end56 ] %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdio.h> int main(int argc, char const *argv[]) { int N; scanf("%d\n", &N); int a,b;//00~99,01~12 a = N/100; b = N%100; if(a > 0 && a < 13){ if(b > 0 && b < 13){ printf("AMBIGUOUS"); } else { printf("MMYY"); } } else { if(b > 0 && b < 13){ printf("YYMM"); } else { printf("NA"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335643/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335643/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"AMBIGUOUS\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"MMYY\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"YYMM\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"NA\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %N = alloca i32, align 4 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 %rem = srem i32 %0, 100 %1 = add i32 %0, -100 %or.cond = icmp ult i32 %1, 1200 %2 = add nsw i32 %rem, -1 %or.cond18 = icmp ult i32 %2, 12 %.str.1..str.2 = select i1 %or.cond18, ptr @.str.1, ptr @.str.2 %.str.3..str.4 = select i1 %or.cond18, ptr @.str.3, ptr @.str.4 %.str.3.sink = select i1 %or.cond, ptr %.str.1..str.2, ptr %.str.3..str.4 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <ctype.h> #define MOD 998244353 #define MAX(a,b) (a>b?a:b) #define MAX3(a,b,c) MAX(a,MAX(b,c)) #define MIN(a,b) (a<b?a:b) #define MIN3(a,b,c) MIN(a, MIN(b,c)) typedef long long lli; int cmp(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main() { int i; char s[4]; scanf("%s",s); int ii = (s[0]-'0')*10 + (s[1]-'0'); int jj = (s[2]-'0')*10 + (s[3]-'0'); // printf("%d %d\n",ii,jj); if(ii==0 || 12 < ii) { if(0 < jj && jj <= 12) { puts("YYMM"); } else { puts("NA"); } } else { if(0 < jj && jj <= 12) { puts("AMBIGUOUS"); } else { puts("MMYY"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335687/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335687/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"YYMM\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NA\00", align 1 @.str.3 = private unnamed_addr constant [10 x i8] c"AMBIGUOUS\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"MMYY\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %s = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %1 = mul nsw i32 %conv, 10 %arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %2 = load i8, ptr %arrayidx1, align 1, !tbaa !9 %conv2 = sext i8 %2 to i32 %sub3 = add nsw i32 %1, %conv2 %arrayidx4 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %3 = load i8, ptr %arrayidx4, align 1, !tbaa !9 %conv5 = sext i8 %3 to i32 %4 = mul nsw i32 %conv5, 10 %arrayidx8 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %5 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %conv9 = sext i8 %5 to i32 %sub10 = add nsw i32 %4, %conv9 %cmp = icmp eq i32 %sub3, 528 %cmp13 = icmp sgt i32 %sub3, 540 %or.cond = or i1 %cmp, %cmp13 %6 = add nsw i32 %sub10, -529 %or.cond34 = icmp ult i32 %6, 12 %.str.1..str.2 = select i1 %or.cond34, ptr @.str.1, ptr @.str.2 %.str.3..str.4 = select i1 %or.cond34, ptr @.str.3, ptr @.str.4 %.str.3.sink = select i1 %or.cond, ptr %.str.1..str.2, ptr %.str.3..str.4 %call29 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @puts(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 = { 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #include <stdio.h> int cnt[3000000]; int p[200005]; int out[200005]; int main() { p[1] = 2; p[2] = 3; p[3] = 5; p[4] = 7; p[5] = 11; int tmp = 6; for (int i = 13; i < 2760000; i+=2) { for (int j = 1; j < i; j++) { if (i%p[j] == 0) break; else if (p[j] * p[j] > i) { p[tmp] = i; tmp++; break; } } if (tmp > 200000) break; } int n; int max = 0; scanf("%d", &n); for (int i=0; i<276000;i++) cnt[i] = 0; for (int j = 0; j < 2*n; j++) { int a; scanf("%d", &a); cnt[a]++; if (max < a) max = a; } int ocnt = 0; int pidx = 200000; for (int i = max; i >= 0; i--) { while (cnt[i]) { while (p[pidx] > i) pidx--; if (p[pidx] == i) { out[ocnt] = pidx; ocnt++; cnt[pidx]--; cnt[i]--; } else { out[ocnt] = i; ocnt++; cnt[i]--; tmp = 1; while (i%p[tmp] != 0) tmp++; cnt[i/p[tmp]]--; } } } for (int i = 0; i < n - 1; i++) printf("%d ", out[i]); printf("%d\n", out[n - 1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33573/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33573/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @p = dso_local local_unnamed_addr global [200005 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @cnt = dso_local local_unnamed_addr global [3000000 x i32] zeroinitializer, align 16 @out = dso_local local_unnamed_addr global [200005 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 store <4 x i32> <i32 2, i32 3, i32 5, i32 7>, ptr getelementptr inbounds ([200005 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5 store i32 11, ptr getelementptr inbounds ([200005 x i32], ptr @p, i64 0, i64 5), align 4, !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc19 %indvars.iv188 = phi i64 [ 13, %entry ], [ %indvars.iv.next189, %for.inc19 ] %tmp.0164 = phi i32 [ 6, %entry ], [ %tmp.1161, %for.inc19 ] %0 = trunc i64 %indvars.iv188 to i32 br label %for.body4 for.cond1: ; preds = %if.else %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [200005 x i32], ptr @p, i64 0, i64 %indvars.iv.next %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %rem.1 = srem i32 %0, %1 %cmp5.1 = icmp eq i32 %rem.1, 0 br i1 %cmp5.1, label %for.inc19, label %if.else.1 if.else.1: ; preds = %for.cond1 %mul.1 = mul nsw i32 %1, %1 %2 = zext i32 %mul.1 to i64 %cmp10.1 = icmp ult i64 %indvars.iv188, %2 br i1 %cmp10.1, label %cleanup, label %for.cond1.1 for.cond1.1: ; preds = %if.else.1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %indvars.iv188 br i1 %exitcond.not.1, label %for.inc19, label %for.body4, !llvm.loop !9 for.body4: ; preds = %for.cond1.1, %for.cond1.preheader %indvars.iv = phi i64 [ 1, %for.cond1.preheader ], [ %indvars.iv.next.1, %for.cond1.1 ] %arrayidx = getelementptr inbounds [200005 x i32], ptr @p, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %rem = srem i32 %0, %3 %cmp5 = icmp eq i32 %rem, 0 br i1 %cmp5, label %for.inc19, label %if.else if.else: ; preds = %for.body4 %mul = mul nsw i32 %3, %3 %4 = zext i32 %mul to i64 %cmp10 = icmp ult i64 %indvars.iv188, %4 br i1 %cmp10, label %cleanup, label %for.cond1 cleanup: ; preds = %if.else.1, %if.else %idxprom12 = sext i32 %tmp.0164 to i64 %arrayidx13 = getelementptr inbounds [200005 x i32], ptr @p, i64 0, i64 %idxprom12 store i32 %0, ptr %arrayidx13, align 4, !tbaa !5 %inc = add nsw i32 %tmp.0164, 1 %cmp16 = icmp sgt i32 %tmp.0164, 199999 br i1 %cmp16, label %cleanup20, label %for.inc19 for.inc19: ; preds = %for.body4, %for.cond1, %for.cond1.1, %cleanup %tmp.1161 = phi i32 [ %inc, %cleanup ], [ %tmp.0164, %for.cond1.1 ], [ %tmp.0164, %for.cond1 ], [ %tmp.0164, %for.body4 ] %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 2 %cmp = icmp ult i64 %indvars.iv188, 2759998 br i1 %cmp, label %for.cond1.preheader, label %cleanup20, !llvm.loop !11 cleanup20: ; preds = %cleanup, %for.inc19 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1104000) @cnt, i8 0, i64 1104000, i1 false), !tbaa !5 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp36169 = icmp sgt i32 %5, 0 br i1 %cmp36169, label %for.body38, label %while.cond.preheader.preheader for.cond51.preheader.loopexit: ; preds = %for.body38 %6 = zext i32 %spec.select to i64 br label %while.cond.preheader.preheader while.cond.preheader.preheader: ; preds = %cleanup20, %for.cond51.preheader.loopexit %7 = phi i32 [ %5, %cleanup20 ], [ %10, %for.cond51.preheader.loopexit ] %max.0.lcssa = phi i64 [ 0, %cleanup20 ], [ %6, %for.cond51.preheader.loopexit ] br label %while.cond.preheader for.body38: ; preds = %cleanup20, %for.body38 %j33.0171 = phi i32 [ %inc47, %for.body38 ], [ 0, %cleanup20 ] %max.0170 = phi i32 [ %spec.select, %for.body38 ], [ 0, %cleanup20 ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %8 = load i32, ptr %a, align 4, !tbaa !5 %idxprom40 = sext i32 %8 to i64 %arrayidx41 = getelementptr inbounds [3000000 x i32], ptr @cnt, i64 0, i64 %idxprom40 %9 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %inc42 = add nsw i32 %9, 1 store i32 %inc42, ptr %arrayidx41, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %max.0170, i32 %8) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 %inc47 = add nuw nsw i32 %j33.0171, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %mul35 = shl nsw i32 %10, 1 %cmp36 = icmp slt i32 %inc47, %mul35 br i1 %cmp36, label %for.body38, label %for.cond51.preheader.loopexit, !llvm.loop !12 while.cond.preheader: ; preds = %while.cond.preheader.preheader, %for.inc97 %indvars.iv203 = phi i64 [ %max.0.lcssa, %while.cond.preheader.preheader ], [ %indvars.iv.next204, %for.inc97 ] %pidx.0179 = phi i32 [ 200000, %while.cond.preheader.preheader ], [ %pidx.1.lcssa, %for.inc97 ] %ocnt.0178 = phi i32 [ 0, %while.cond.preheader.preheader ], [ %ocnt.1.lcssa, %for.inc97 ] %arrayidx56 = getelementptr inbounds [3000000 x i32], ptr @cnt, i64 0, i64 %indvars.iv203 %11 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %tobool.not172 = icmp eq i32 %11, 0 br i1 %tobool.not172, label %for.inc97, label %while.cond57.preheader.preheader while.cond57.preheader.preheader: ; preds = %while.cond.preheader %12 = sext i32 %ocnt.0178 to i64 %13 = trunc i64 %indvars.iv203 to i32 br label %while.cond57.preheader for.cond102.preheader: ; preds = %for.inc97 %cmp103182 = icmp sgt i32 %7, 1 br i1 %cmp103182, label %for.body105, label %for.cond102.preheader.for.cond.cleanup104_crit_edge for.cond102.preheader.for.cond.cleanup104_crit_edge: ; preds = %for.cond102.preheader %sub181 = add nsw i32 %7, -1 %.pre209 = sext i32 %sub181 to i64 br label %for.cond.cleanup104 while.cond57.preheader: ; preds = %while.cond57.preheader.preheader, %if.end95 %indvars.iv200 = phi i64 [ %12, %while.cond57.preheader.preheader ], [ %indvars.iv.next201, %if.end95 ] %14 = phi i32 [ %11, %while.cond57.preheader.preheader ], [ %24, %if.end95 ] %pidx.1174 = phi i32 [ %pidx.0179, %while.cond57.preheader.preheader ], [ %18, %if.end95 ] %15 = sext i32 %pidx.1174 to i64 br label %while.cond57 while.cond57: ; preds = %while.cond57, %while.cond57.preheader %indvars.iv194 = phi i64 [ %indvars.iv.next195, %while.cond57 ], [ %15, %while.cond57.preheader ] %arrayidx59 = getelementptr inbounds [200005 x i32], ptr @p, i64 0, i64 %indvars.iv194 %16 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp60 = icmp slt i64 %indvars.iv203, %17 %indvars.iv.next195 = add i64 %indvars.iv194, -1 br i1 %cmp60, label %while.cond57, label %while.end, !llvm.loop !13 while.end: ; preds = %while.cond57 %18 = trunc i64 %indvars.iv194 to i32 %19 = zext i32 %16 to i64 %cmp64 = icmp eq i64 %indvars.iv203, %19 %arrayidx67 = getelementptr inbounds [200005 x i32], ptr @out, i64 0, i64 %indvars.iv200 br i1 %cmp64, label %if.then65, label %if.else75 if.then65: ; preds = %while.end store i32 %18, ptr %arrayidx67, align 4, !tbaa !5 %arrayidx70 = getelementptr inbounds [3000000 x i32], ptr @cnt, i64 0, i64 %indvars.iv194 %20 = load i32, ptr %arrayidx70, align 4, !tbaa !5 %dec71 = add nsw i32 %20, -1 store i32 %dec71, ptr %arrayidx70, align 4, !tbaa !5 %21 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %dec74 = add nsw i32 %21, -1 store i32 %dec74, ptr %arrayidx56, align 4, !tbaa !5 br label %if.end95 if.else75: ; preds = %while.end store i32 %13, ptr %arrayidx67, align 4, !tbaa !5 %dec81 = add nsw i32 %14, -1 store i32 %dec81, ptr %arrayidx56, align 4, !tbaa !5 br label %while.cond82 while.cond82: ; preds = %while.cond82, %if.else75 %indvars.iv197 = phi i64 [ %indvars.iv.next198, %while.cond82 ], [ 1, %if.else75 ] %arrayidx84 = getelementptr inbounds [200005 x i32], ptr @p, i64 0, i64 %indvars.iv197 %22 = load i32, ptr %arrayidx84, align 4, !tbaa !5 %rem85 = srem i32 %13, %22 %div = sdiv i32 %13, %22 %cmp86.not = icmp eq i32 %rem85, 0 %indvars.iv.next198 = add nuw i64 %indvars.iv197, 1 br i1 %cmp86.not, label %while.end89, label %while.cond82, !llvm.loop !14 while.end89: ; preds = %while.cond82 %idxprom92 = sext i32 %div to i64 %arrayidx93 = getelementptr inbounds [3000000 x i32], ptr @cnt, i64 0, i64 %idxprom92 %23 = load i32, ptr %arrayidx93, align 4, !tbaa !5 %dec94 = add nsw i32 %23, -1 store i32 %dec94, ptr %arrayidx93, align 4, !tbaa !5 %.pre = load i32, ptr %arrayidx56, align 4, !tbaa !5 br label %if.end95 if.end95: ; preds = %while.end89, %if.then65 %24 = phi i32 [ %.pre, %while.end89 ], [ %dec74, %if.then65 ] %indvars.iv.next201 = add i64 %indvars.iv200, 1 %tobool.not = icmp eq i32 %24, 0 br i1 %tobool.not, label %for.inc97.loopexit, label %while.cond57.preheader, !llvm.loop !15 for.inc97.loopexit: ; preds = %if.end95 %25 = trunc i64 %indvars.iv.next201 to i32 br label %for.inc97 for.inc97: ; preds = %for.inc97.loopexit, %while.cond.preheader %ocnt.1.lcssa = phi i32 [ %ocnt.0178, %while.cond.preheader ], [ %25, %for.inc97.loopexit ] %pidx.1.lcssa = phi i32 [ %pidx.0179, %while.cond.preheader ], [ %18, %for.inc97.loopexit ] %indvars.iv.next204 = add nsw i64 %indvars.iv203, -1 %cmp52 = icmp sgt i64 %indvars.iv203, 0 br i1 %cmp52, label %while.cond.preheader, label %for.cond102.preheader, !llvm.loop !16 for.cond.cleanup104: ; preds = %for.body105, %for.cond102.preheader.for.cond.cleanup104_crit_edge %idxprom114.pre-phi = phi i64 [ %.pre209, %for.cond102.preheader.for.cond.cleanup104_crit_edge ], [ %29, %for.body105 ] %arrayidx115 = getelementptr inbounds [200005 x i32], ptr @out, i64 0, i64 %idxprom114.pre-phi %26 = load i32, ptr %arrayidx115, align 4, !tbaa !5 %call116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body105: ; preds = %for.cond102.preheader, %for.body105 %indvars.iv206 = phi i64 [ %indvars.iv.next207, %for.body105 ], [ 0, %for.cond102.preheader ] %arrayidx107 = getelementptr inbounds [200005 x i32], ptr @out, i64 0, i64 %indvars.iv206 %27 = load i32, ptr %arrayidx107, align 4, !tbaa !5 %call108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %27) %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1 %28 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %28, -1 %29 = sext i32 %sub to i64 %cmp103 = icmp slt i64 %indvars.iv.next207, %29 br i1 %cmp103, label %for.body105, label %for.cond.cleanup104, !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: 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 @__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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main(void){ int a, b; scanf("%d%d", &a, &b); if(a == 1 && b == 1){ printf("Draw"); }else if(a == 1){ printf("Alice"); }else if(b == 1){ printf("Bob"); }else if(a > b){ printf("Alice"); }else if(a < b){ printf("Bob"); }else{ printf("Draw"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335780/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335780/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"Alice\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 %1 = load i32, ptr %b, align 4 %cmp1 = icmp eq i32 %1, 1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1.mux = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %brmerge25 = select i1 %cmp, i1 true, i1 %cmp1 %.str.1.mux.mux = select i1 %cmp, ptr %.str.1.mux, ptr @.str.3 br i1 %brmerge25, label %if.end23, label %if.else10 if.else10: ; preds = %entry %cmp11 = icmp sgt i32 %0, %1 br i1 %cmp11, label %if.end23, label %if.else14 if.else14: ; preds = %if.else10 %cmp15 = icmp slt i32 %0, %1 %.str.3..str.1 = select i1 %cmp15, ptr @.str.3, ptr @.str.1 br label %if.end23 if.end23: ; preds = %entry, %if.else14, %if.else10 %.str.2.sink = phi ptr [ %.str.1.mux.mux, %entry ], [ @.str.2, %if.else10 ], [ %.str.3..str.1, %if.else14 ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if (a==1) a=14; if (b==1) b=14; if (a>b) { printf("Alice\n"); } else if (a<b) { printf("Bob\n"); } else { printf("Draw\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335823/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335823/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"Alice\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 eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 14, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 14, %if.then ], [ %0, %entry ] %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, 1 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 14, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %3 = phi i32 [ 14, %if.then2 ], [ %2, %if.end ] %cmp4 = icmp sgt i32 %1, %3 %cmp7 = icmp slt i32 %1, %3 %str.4.str = select i1 %cmp7, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp4, ptr @str.5, ptr %str.4.str %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int A,B; scanf("%d %d",&A,&B); if(A==1){ A=14; } if(B==1){ B=14; } if(A>B){ printf("Alice"); }else if(A<B){ printf("Bob"); }else{ printf("Draw"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335867/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335867/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"Alice\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 14, ptr %A, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 14, %if.then ], [ %0, %entry ] %2 = load i32, ptr %B, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, 1 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 14, ptr %B, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %3 = phi i32 [ 14, %if.then2 ], [ %2, %if.end ] %cmp4 = icmp sgt i32 %1, %3 %cmp7 = icmp slt i32 %1, %3 %.str.2..str.3 = select i1 %cmp7, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp4, ptr @.str.1, ptr %.str.2..str.3 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int t[1005]={}; unsigned long long int str[1005],count[1005]={},i,q,s; scanf("%llu",&q); for(i=0;i<q;i++) { scanf("%llu",&str[i]); s=str[i]; while(s>1) { if(s%2==0) { s=s/2; ++count[i]; } else if(s%3==0) { s=(2*s)/3; ++count[i]; } else if(s%5==0) { s=(4*s)/5; ++count[i]; } else { t[i]=-1; break; } } } for(i=0;i<q;i++) { if(t[i]==0) printf("%llu\n",count[i]); else printf("-1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33591/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca [1005 x i32], align 16 %str = alloca [1005 x i64], align 16 %count = alloca [1005 x i64], align 16 %q = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %t) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4020) %t, i8 0, i64 4020, i1 false) call void @llvm.lifetime.start.p0(i64 8040, ptr nonnull %str) #5 call void @llvm.lifetime.start.p0(i64 8040, ptr nonnull %count) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8040) %count, i8 0, i64 8040, i1 false) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i64, ptr %q, align 8, !tbaa !5 %cmp59.not = icmp eq i64 %0, 0 br i1 %cmp59.not, label %for.end38, label %for.body for.cond25.preheader: ; preds = %for.inc %1 = icmp eq i64 %4, 0 br i1 %1, label %for.end38, label %for.body27 for.body: ; preds = %entry, %for.inc %i.060 = phi i64 [ %inc24, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1005 x i64], ptr %str, i64 0, i64 %i.060 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp357 = icmp ugt i64 %2, 1 br i1 %cmp357, label %while.body.lr.ph, label %for.inc while.body.lr.ph: ; preds = %for.body %arrayidx18 = getelementptr inbounds [1005 x i64], ptr %count, i64 0, i64 %i.060 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end23 %s.058 = phi i64 [ %2, %while.body.lr.ph ], [ %s.1, %if.end23 ] %rem = and i64 %s.058, 1 %cmp4 = icmp eq i64 %rem, 0 br i1 %cmp4, label %if.then, label %if.else if.then: ; preds = %while.body %div56 = lshr i64 %s.058, 1 br label %if.end23 if.else: ; preds = %while.body %rem6 = urem i64 %s.058, 3 %cmp7 = icmp eq i64 %rem6, 0 br i1 %cmp7, label %if.then8, label %if.else12 if.then8: ; preds = %if.else %mul = shl i64 %s.058, 1 %div9 = udiv i64 %mul, 3 br label %if.end23 if.else12: ; preds = %if.else %rem13 = urem i64 %s.058, 5 %cmp14 = icmp eq i64 %rem13, 0 br i1 %cmp14, label %if.then15, label %if.else20 if.then15: ; preds = %if.else12 %mul16 = shl i64 %s.058, 2 %div17 = udiv i64 %mul16, 5 br label %if.end23 if.else20: ; preds = %if.else12 %arrayidx21 = getelementptr inbounds [1005 x i32], ptr %t, i64 0, i64 %i.060 store i32 -1, ptr %arrayidx21, align 4, !tbaa !9 br label %for.inc if.end23: ; preds = %if.then8, %if.then15, %if.then %s.1 = phi i64 [ %div56, %if.then ], [ %div9, %if.then8 ], [ %div17, %if.then15 ] %3 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %inc11 = add i64 %3, 1 store i64 %inc11, ptr %arrayidx18, align 8, !tbaa !5 %cmp3 = icmp ugt i64 %s.1, 1 br i1 %cmp3, label %while.body, label %for.inc, !llvm.loop !11 for.inc: ; preds = %if.end23, %for.body, %if.else20 %inc24 = add nuw i64 %i.060, 1 %4 = load i64, ptr %q, align 8, !tbaa !5 %cmp = icmp ult i64 %inc24, %4 br i1 %cmp, label %for.body, label %for.cond25.preheader, !llvm.loop !13 for.body27: ; preds = %for.cond25.preheader, %for.inc36 %i.163 = phi i64 [ %inc37, %for.inc36 ], [ 0, %for.cond25.preheader ] %arrayidx28 = getelementptr inbounds [1005 x i32], ptr %t, i64 0, i64 %i.163 %5 = load i32, ptr %arrayidx28, align 4, !tbaa !9 %cmp29 = icmp eq i32 %5, 0 br i1 %cmp29, label %if.then30, label %if.else33 if.then30: ; preds = %for.body27 %arrayidx31 = getelementptr inbounds [1005 x i64], ptr %count, i64 0, i64 %i.163 %6 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %6) br label %for.inc36 if.else33: ; preds = %for.body27 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc36 for.inc36: ; preds = %if.then30, %if.else33 %inc37 = add nuw i64 %i.163, 1 %7 = load i64, ptr %q, align 8, !tbaa !5 %cmp26 = icmp ult i64 %inc37, %7 br i1 %cmp26, label %for.body27, label %for.end38, !llvm.loop !14 for.end38: ; preds = %for.inc36, %entry, %for.cond25.preheader call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 8040, ptr nonnull %count) #5 call void @llvm.lifetime.end.p0(i64 8040, ptr nonnull %str) #5 call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %t) #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 @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 = !{!"long 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"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include<stdio.h> int main(void){ int A; int B; scanf("%d",&A); scanf("%d",&B); if(A==1 ) A=14; if(B==1) B=14; if(A>B) printf("Alice"); else if(A<B) printf("Bob"); else printf("Draw"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335953/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335953/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Alice\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 14, ptr %A, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 14, %if.then ], [ %0, %entry ] %2 = load i32, ptr %B, align 4, !tbaa !5 %cmp2 = icmp eq i32 %2, 1 br i1 %cmp2, label %if.then3, label %if.end4 if.then3: ; preds = %if.end store i32 14, ptr %B, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %if.then3, %if.end %3 = phi i32 [ 14, %if.then3 ], [ %2, %if.end ] %cmp5 = icmp sgt i32 %1, %3 %cmp8 = icmp slt i32 %1, %3 %.str.2..str.3 = select i1 %cmp8, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp5, ptr @.str.1, ptr %.str.2..str.3 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; scanf("%d %d",&a,&b); if(a==1){ a=14; } if(b==1){ b=14; } if(a>b){ printf("Alice\n"); }else if(a<b){ printf("Bob\n"); }else{ printf("Draw\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_335997/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_335997/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"Alice\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 eq i32 %0, 1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 14, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 14, %if.then ], [ %0, %entry ] %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, 1 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 14, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %3 = phi i32 [ 14, %if.then2 ], [ %2, %if.end ] %cmp4 = icmp sgt i32 %1, %3 %cmp7 = icmp slt i32 %1, %3 %str.4.str = select i1 %cmp7, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp4, ptr @str.5, ptr %str.4.str %puts15 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); if(a == 1 && b != 1|| a > b && b != 1) { printf("Alice\n"); }else if(b == 1 && a != 1|| a < b && a != 1){ printf("Bob\n"); }else{ printf("Draw\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336039/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336039/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"Draw\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"Alice\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 %cmp = icmp eq i32 %0, 1 %1 = load i32, ptr %b, align 4 %cmp1 = icmp ne i32 %1, 1 %cmp2 = icmp sgt i32 %0, %1 %2 = or i1 %cmp, %cmp2 %or.cond23 = and i1 %cmp1, %2 br i1 %or.cond23, label %if.end17, label %if.else if.else: ; preds = %entry %cmp6 = icmp eq i32 %1, 1 %cmp8 = icmp ne i32 %0, 1 %cmp10 = icmp slt i32 %0, %1 %or.cond1925 = or i1 %cmp6, %cmp10 %or.cond24 = and i1 %cmp8, %or.cond1925 %str.4.str = select i1 %or.cond24, ptr @str.4, ptr @str br label %if.end17 if.end17: ; preds = %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ %str.4.str, %if.else ] %puts21 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main() { long long int t, n, i, j, c = 0; scanf("%lld", &t); while (t--) { scanf("%lld", &n); while(1){ if (n == 1){ printf("%lld\n", c); c=0; break;} if (n % 2 == 0) { n = n / 2; c++; } else if (n % 3 == 0) { n = (2 * n) / 3; c++; } else if (n % 5 == 0) { n = (n * 4) / 5; c++; } else { printf("-1\n"); c = 0; break;} } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33609/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33609/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec34 = add nsw i64 %0, -1 store i64 %dec34, ptr %t, align 8, !tbaa !5 %tobool.not35 = icmp eq i64 %0, 0 br i1 %tobool.not35, label %while.end24, label %while.body while.body: ; preds = %entry, %while.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %n.promoted = load i64, ptr %n, align 8, !tbaa !5 %cmp31 = icmp eq i64 %n.promoted, 1 br i1 %cmp31, label %if.then, label %if.end if.then: ; preds = %if.end23, %while.body %c.1.lcssa = phi i64 [ 0, %while.body ], [ %c.2, %if.end23 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %c.1.lcssa) br label %while.end if.end: ; preds = %while.body, %if.end23 %c.133 = phi i64 [ %c.2, %if.end23 ], [ 0, %while.body ] %div172932 = phi i64 [ %div1730, %if.end23 ], [ %n.promoted, %while.body ] %1 = and i64 %div172932, 1 %cmp5 = icmp eq i64 %1, 0 br i1 %cmp5, label %if.then6, label %if.else if.then6: ; preds = %if.end %div = sdiv i64 %div172932, 2 store i64 %div, ptr %n, align 8, !tbaa !5 br label %if.end23 if.else: ; preds = %if.end %rem7 = srem i64 %div172932, 3 %cmp8 = icmp eq i64 %rem7, 0 br i1 %cmp8, label %if.then9, label %if.else12 if.then9: ; preds = %if.else %mul = shl nsw i64 %div172932, 1 %div10 = sdiv i64 %mul, 3 store i64 %div10, ptr %n, align 8, !tbaa !5 br label %if.end23 if.else12: ; preds = %if.else %rem13 = srem i64 %div172932, 5 %cmp14 = icmp eq i64 %rem13, 0 br i1 %cmp14, label %if.then15, label %if.else19 if.then15: ; preds = %if.else12 %mul16 = shl nsw i64 %div172932, 2 %div17 = sdiv i64 %mul16, 5 store i64 %div17, ptr %n, align 8, !tbaa !5 br label %if.end23 if.else19: ; preds = %if.else12 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %while.end if.end23: ; preds = %if.then9, %if.then15, %if.then6 %div1730 = phi i64 [ %div10, %if.then9 ], [ %div17, %if.then15 ], [ %div, %if.then6 ] %c.2 = add nuw nsw i64 %c.133, 1 %cmp = icmp eq i64 %div1730, 1 br i1 %cmp, label %if.then, label %if.end while.end: ; preds = %if.else19, %if.then %2 = load i64, ptr %t, align 8, !tbaa !5 %dec = add nsw i64 %2, -1 store i64 %dec, ptr %t, align 8, !tbaa !5 %tobool.not = icmp eq i64 %2, 0 br i1 %tobool.not, label %while.end24, label %while.body, !llvm.loop !9 while.end24: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { long long n; scanf("%lli",&n); long long query[n]; long long r[n]; for(int i = 0; i < n; i++) { r[i] = 0; scanf("%lli",&query[i]); if(query[i] == 1) r[i] = 0; else if(query[i]%2 == 0 || query[i]%3 == 0 || query[i]%5 == 0) { while(query[i] != 1) { if(query[i]%2 == 0) { query[i] = query[i]/2; r[i]++; } else if(query[i]%3 == 0) { query[i] = query[i]*2/3; r[i]++; } else if(query[i]%5 == 0) { query[i] = query[i]*4/5; r[i]++; } else { r[i] = -1; break; } } } else r[i] = -1; } for(int i = 0; i < n; i++) printf("%lli\n",r[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_33614/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_33614/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lli\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lli\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %vla1 = alloca i64, i64 %2, align 16 %cmp130 = icmp sgt i64 %2, 0 br i1 %cmp130, label %for.body, label %for.cond.cleanup91 for.cond87.preheader: ; preds = %for.inc %3 = icmp sgt i64 %8, 0 br i1 %3, label %for.body92, label %for.cond.cleanup91 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv store i64 0, ptr %arrayidx, align 8, !tbaa !5 %arrayidx4 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx4) %4 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp8 = icmp eq i64 %4, 1 br i1 %cmp8, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %5 = and i64 %4, 1 %cmp14 = icmp eq i64 %5, 0 %rem18 = srem i64 %4, 3 %cmp19 = icmp eq i64 %rem18, 0 %or.cond = or i1 %cmp14, %cmp19 %rem24 = srem i64 %4, 5 %cmp25 = icmp eq i64 %rem24, 0 %or.cond125 = or i1 %cmp25, %or.cond br i1 %or.cond125, label %while.body, label %for.inc.sink.split while.body: ; preds = %if.else, %if.end79 %6 = phi i64 [ %inc58, %if.end79 ], [ 0, %if.else ] %div69126129 = phi i64 [ %div53.sink, %if.end79 ], [ %4, %if.else ] %7 = and i64 %div69126129, 1 %cmp35 = icmp eq i64 %7, 0 br i1 %cmp35, label %if.then37, label %if.else44 if.then37: ; preds = %while.body %div = sdiv i64 %div69126129, 2 br label %if.end79 if.else44: ; preds = %while.body %rem47 = srem i64 %div69126129, 3 %cmp48 = icmp eq i64 %rem47, 0 br i1 %cmp48, label %if.then50, label %if.else59 if.then50: ; preds = %if.else44 %mul = shl nsw i64 %div69126129, 1 %div53 = sdiv i64 %mul, 3 br label %if.end79 if.else59: ; preds = %if.else44 %rem62 = srem i64 %div69126129, 5 %cmp63 = icmp eq i64 %rem62, 0 br i1 %cmp63, label %if.then65, label %for.inc.sink.split if.then65: ; preds = %if.else59 %mul68 = shl nsw i64 %div69126129, 2 %div69 = sdiv i64 %mul68, 5 br label %if.end79 if.end79: ; preds = %if.then50, %if.then65, %if.then37 %div53.sink = phi i64 [ %div53, %if.then50 ], [ %div69, %if.then65 ], [ %div, %if.then37 ] store i64 %div53.sink, ptr %arrayidx4, align 8, !tbaa !5 %inc58 = add nuw nsw i64 %6, 1 store i64 %inc58, ptr %arrayidx, align 8, !tbaa !5 %cmp30.not = icmp eq i64 %div53.sink, 1 br i1 %cmp30.not, label %for.inc, label %while.body, !llvm.loop !9 for.inc.sink.split: ; preds = %if.else59, %if.else, %for.body %.sink = phi i64 [ 0, %for.body ], [ -1, %if.else ], [ -1, %if.else59 ] store i64 %.sink, ptr %arrayidx, align 8, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end79, %for.inc.sink.split %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp sgt i64 %8, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond87.preheader, !llvm.loop !11 for.cond.cleanup91: ; preds = %for.body92, %entry, %for.cond87.preheader call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 for.body92: ; preds = %for.cond87.preheader, %for.body92 %indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.body92 ], [ 0, %for.cond87.preheader ] %arrayidx94 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv137 %9 = load i64, ptr %arrayidx94, align 8, !tbaa !5 %call95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %9) %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %10 = load i64, ptr %n, align 8, !tbaa !5 %cmp89 = icmp sgt i64 %10, %indvars.iv.next138 br i1 %cmp89, label %for.body92, label %for.cond.cleanup91, !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 declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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> int main() { int x,t,n,a[100]; for(x=0;x<4;x++){ scanf("%d %d",&t,&n); if(t==1){ a[x]=n*6000; } else if(t==2){ a[x]=n*4000; } else if(t==3){ a[x]=n*3000; } else if(t==4){ a[x]=n*2000; } } for(x=0;x<4;x++){ printf("%d\n",a[x]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %n) %0 = load i32, ptr %t, align 4, !tbaa !5 switch i32 %0, label %for.inc [ i32 1, label %if.then i32 2, label %if.then3 i32 3, label %if.then9 i32 4, label %if.then15 ] if.then: ; preds = %entry %1 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %1, 6000 br label %for.inc if.then3: ; preds = %entry %2 = load i32, ptr %n, align 4, !tbaa !5 %mul4 = mul nsw i32 %2, 4000 br label %for.inc if.then9: ; preds = %entry %3 = load i32, ptr %n, align 4, !tbaa !5 %mul10 = mul nsw i32 %3, 3000 br label %for.inc if.then15: ; preds = %entry %4 = load i32, ptr %n, align 4, !tbaa !5 %mul16 = mul nsw i32 %4, 2000 br label %for.inc for.inc: ; preds = %entry, %if.then, %if.then9, %if.then15, %if.then3 %a.sroa.0.0 = phi i32 [ undef, %entry ], [ %mul16, %if.then15 ], [ %mul10, %if.then9 ], [ %mul4, %if.then3 ], [ %mul, %if.then ] %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %n) %5 = load i32, ptr %t, align 4, !tbaa !5 switch i32 %5, label %for.inc.1 [ i32 1, label %if.then.1 i32 2, label %if.then3.1 i32 3, label %if.then9.1 i32 4, label %if.then15.1 ] if.then15.1: ; preds = %for.inc %6 = load i32, ptr %n, align 4, !tbaa !5 %mul16.1 = mul nsw i32 %6, 2000 br label %for.inc.1 if.then9.1: ; preds = %for.inc %7 = load i32, ptr %n, align 4, !tbaa !5 %mul10.1 = mul nsw i32 %7, 3000 br label %for.inc.1 if.then3.1: ; preds = %for.inc %8 = load i32, ptr %n, align 4, !tbaa !5 %mul4.1 = mul nsw i32 %8, 4000 br label %for.inc.1 if.then.1: ; preds = %for.inc %9 = load i32, ptr %n, align 4, !tbaa !5 %mul.1 = mul nsw i32 %9, 6000 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then3.1, %if.then9.1, %if.then15.1, %for.inc %a.sroa.7.0 = phi i32 [ undef, %for.inc ], [ %mul16.1, %if.then15.1 ], [ %mul10.1, %if.then9.1 ], [ %mul4.1, %if.then3.1 ], [ %mul.1, %if.then.1 ] %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %n) %10 = load i32, ptr %t, align 4, !tbaa !5 switch i32 %10, label %for.inc.2 [ i32 1, label %if.then.2 i32 2, label %if.then3.2 i32 3, label %if.then9.2 i32 4, label %if.then15.2 ] if.then15.2: ; preds = %for.inc.1 %11 = load i32, ptr %n, align 4, !tbaa !5 %mul16.2 = mul nsw i32 %11, 2000 br label %for.inc.2 if.then9.2: ; preds = %for.inc.1 %12 = load i32, ptr %n, align 4, !tbaa !5 %mul10.2 = mul nsw i32 %12, 3000 br label %for.inc.2 if.then3.2: ; preds = %for.inc.1 %13 = load i32, ptr %n, align 4, !tbaa !5 %mul4.2 = mul nsw i32 %13, 4000 br label %for.inc.2 if.then.2: ; preds = %for.inc.1 %14 = load i32, ptr %n, align 4, !tbaa !5 %mul.2 = mul nsw i32 %14, 6000 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %if.then3.2, %if.then9.2, %if.then15.2, %for.inc.1 %a.sroa.12.0 = phi i32 [ undef, %for.inc.1 ], [ %mul16.2, %if.then15.2 ], [ %mul10.2, %if.then9.2 ], [ %mul4.2, %if.then3.2 ], [ %mul.2, %if.then.2 ] %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %n) %15 = load i32, ptr %t, align 4, !tbaa !5 switch i32 %15, label %for.inc.3 [ i32 1, label %if.then.3 i32 2, label %if.then3.3 i32 3, label %if.then9.3 i32 4, label %if.then15.3 ] if.then15.3: ; preds = %for.inc.2 %16 = load i32, ptr %n, align 4, !tbaa !5 %mul16.3 = mul nsw i32 %16, 2000 br label %for.inc.3 if.then9.3: ; preds = %for.inc.2 %17 = load i32, ptr %n, align 4, !tbaa !5 %mul10.3 = mul nsw i32 %17, 3000 br label %for.inc.3 if.then3.3: ; preds = %for.inc.2 %18 = load i32, ptr %n, align 4, !tbaa !5 %mul4.3 = mul nsw i32 %18, 4000 br label %for.inc.3 if.then.3: ; preds = %for.inc.2 %19 = load i32, ptr %n, align 4, !tbaa !5 %mul.3 = mul nsw i32 %19, 6000 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %if.then3.3, %if.then9.3, %if.then15.3, %for.inc.2 %a.sroa.17.0 = phi i32 [ undef, %for.inc.2 ], [ %mul16.3, %if.then15.3 ], [ %mul10.3, %if.then9.3 ], [ %mul4.3, %if.then3.3 ], [ %mul.3, %if.then.3 ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.sroa.0.0) %call27.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.sroa.7.0) %call27.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.sroa.12.0) %call27.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.sroa.17.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b,c,d,n,i,p[100]={0}; for(i=0;i<4;i++){ scanf("%d %d",&a,&b); if(a==1) p[i]=6000*b; else if(a==2) p[i]=4000*b; else if(a==3) p[i]=3000*b; else if(a==4) p[i]=2000*b; } for(i=0;i<4;i++) printf("%d\n",p[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 switch i32 %0, label %for.inc [ i32 1, label %if.then i32 2, label %if.then3 i32 3, label %if.then9 i32 4, label %if.then15 ] if.then: ; preds = %entry %1 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %1, 6000 br label %for.inc if.then3: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %mul4 = mul nsw i32 %2, 4000 br label %for.inc if.then9: ; preds = %entry %3 = load i32, ptr %b, align 4, !tbaa !5 %mul10 = mul nsw i32 %3, 3000 br label %for.inc if.then15: ; preds = %entry %4 = load i32, ptr %b, align 4, !tbaa !5 %mul16 = mul nsw i32 %4, 2000 br label %for.inc for.inc: ; preds = %entry, %if.then, %if.then9, %if.then15, %if.then3 %p.sroa.0.0 = phi i32 [ 0, %entry ], [ %mul16, %if.then15 ], [ %mul10, %if.then9 ], [ %mul4, %if.then3 ], [ %mul, %if.then ] %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %5 = load i32, ptr %a, align 4, !tbaa !5 switch i32 %5, label %for.inc.1 [ i32 1, label %if.then.1 i32 2, label %if.then3.1 i32 3, label %if.then9.1 i32 4, label %if.then15.1 ] if.then15.1: ; preds = %for.inc %6 = load i32, ptr %b, align 4, !tbaa !5 %mul16.1 = mul nsw i32 %6, 2000 br label %for.inc.1 if.then9.1: ; preds = %for.inc %7 = load i32, ptr %b, align 4, !tbaa !5 %mul10.1 = mul nsw i32 %7, 3000 br label %for.inc.1 if.then3.1: ; preds = %for.inc %8 = load i32, ptr %b, align 4, !tbaa !5 %mul4.1 = mul nsw i32 %8, 4000 br label %for.inc.1 if.then.1: ; preds = %for.inc %9 = load i32, ptr %b, align 4, !tbaa !5 %mul.1 = mul nsw i32 %9, 6000 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then3.1, %if.then9.1, %if.then15.1, %for.inc %p.sroa.8.0 = phi i32 [ 0, %for.inc ], [ %mul16.1, %if.then15.1 ], [ %mul10.1, %if.then9.1 ], [ %mul4.1, %if.then3.1 ], [ %mul.1, %if.then.1 ] %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %10 = load i32, ptr %a, align 4, !tbaa !5 switch i32 %10, label %for.inc.2 [ i32 1, label %if.then.2 i32 2, label %if.then3.2 i32 3, label %if.then9.2 i32 4, label %if.then15.2 ] if.then15.2: ; preds = %for.inc.1 %11 = load i32, ptr %b, align 4, !tbaa !5 %mul16.2 = mul nsw i32 %11, 2000 br label %for.inc.2 if.then9.2: ; preds = %for.inc.1 %12 = load i32, ptr %b, align 4, !tbaa !5 %mul10.2 = mul nsw i32 %12, 3000 br label %for.inc.2 if.then3.2: ; preds = %for.inc.1 %13 = load i32, ptr %b, align 4, !tbaa !5 %mul4.2 = mul nsw i32 %13, 4000 br label %for.inc.2 if.then.2: ; preds = %for.inc.1 %14 = load i32, ptr %b, align 4, !tbaa !5 %mul.2 = mul nsw i32 %14, 6000 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %if.then3.2, %if.then9.2, %if.then15.2, %for.inc.1 %p.sroa.13.0 = phi i32 [ 0, %for.inc.1 ], [ %mul16.2, %if.then15.2 ], [ %mul10.2, %if.then9.2 ], [ %mul4.2, %if.then3.2 ], [ %mul.2, %if.then.2 ] %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %15 = load i32, ptr %a, align 4, !tbaa !5 switch i32 %15, label %for.inc.3 [ i32 1, label %if.then.3 i32 2, label %if.then3.3 i32 3, label %if.then9.3 i32 4, label %if.then15.3 ] if.then15.3: ; preds = %for.inc.2 %16 = load i32, ptr %b, align 4, !tbaa !5 %mul16.3 = mul nsw i32 %16, 2000 br label %for.inc.3 if.then9.3: ; preds = %for.inc.2 %17 = load i32, ptr %b, align 4, !tbaa !5 %mul10.3 = mul nsw i32 %17, 3000 br label %for.inc.3 if.then3.3: ; preds = %for.inc.2 %18 = load i32, ptr %b, align 4, !tbaa !5 %mul4.3 = mul nsw i32 %18, 4000 br label %for.inc.3 if.then.3: ; preds = %for.inc.2 %19 = load i32, ptr %b, align 4, !tbaa !5 %mul.3 = mul nsw i32 %19, 6000 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %if.then3.3, %if.then9.3, %if.then15.3, %for.inc.2 %p.sroa.18.0 = phi i32 [ 0, %for.inc.2 ], [ %mul16.3, %if.then15.3 ], [ %mul10.3, %if.then9.3 ], [ %mul4.3, %if.then3.3 ], [ %mul.3, %if.then.3 ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.sroa.0.0) %call27.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.sroa.8.0) %call27.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.sroa.13.0) %call27.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.sroa.18.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int did=0; int price; int n10,n50,n100,n500; int t10,t50,t100,t500; int pay,back; int b10,b50,b100,b500; int now,min; int r10,r50,r100,r500; while(1) { scanf("%d",&price); if(price==0)break; if(did)putchar('\n'); scanf("%d%d%d%d",&n10,&n50,&n100,&n500); min=10000; r10=r50=r100=r500=0; for(t10=0;t10<=n10;t10++) { for(t50=0;t50<=n50;t50++) { for(t100=0;t100<=n100;t100++) { for(t500=0;t500<=n500;t500++) { pay=t10*10+t50*50+t100*100+t500*500; if(pay<price)continue; back=pay-price; b500=back/500; b100=(back%500)/100; b50=(back%100)/50; b10=(back%50)/10; if(t10*b10 || t50*b50 || t100*b100 || t500*b500)continue; now=n10-t10+b10; now+=n50-t50+b50; now+=n100-t100+b100; now+=n500-t500+b500; if(now<min) { min=now; r10=t10; r50=t50; r100=t100; r500=t500; } } } } } if(r10>0)printf("10 %d\n",r10); if(r50>0)printf("50 %d\n",r50); if(r100>0)printf("100 %d\n",r100); if(r500>0)printf("500 %d\n",r500); did=1; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336299/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336299/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"10 %d\0A\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"50 %d\0A\00", align 1 @.str.4 = private unnamed_addr constant [8 x i8] c"100 %d\0A\00", align 1 @.str.5 = private unnamed_addr constant [8 x i8] c"500 %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: %price = alloca i32, align 4 %n10 = alloca i32, align 4 %n50 = alloca i32, align 4 %n100 = alloca i32, align 4 %n500 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %price) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n10) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n50) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n100) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n500) #3 %call238 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %price) %0 = load i32, ptr %price, align 4, !tbaa !5 %cmp239 = icmp eq i32 %0, 0 br i1 %cmp239, label %while.end, label %if.end3 if.then1.critedge: ; preds = %if.end78 %1 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i = call i32 @putc(i32 noundef 10, ptr noundef %1) br label %if.end3 if.end3: ; preds = %entry, %if.then1.critedge %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n10, ptr noundef nonnull %n50, ptr noundef nonnull %n100, ptr noundef nonnull %n500) %2 = load i32, ptr %n10, align 4, !tbaa !5 %cmp5.not185 = icmp slt i32 %2, 0 br i1 %cmp5.not185, label %if.end78, label %for.cond6.preheader.lr.ph for.cond6.preheader.lr.ph: ; preds = %if.end3 %3 = load i32, ptr %n50, align 4, !tbaa !5 %cmp7.not148 = icmp slt i32 %3, 0 %4 = load i32, ptr %n100, align 4 %5 = load i32, ptr %n500, align 4 %cmp13.not121 = icmp slt i32 %5, 0 %6 = load i32, ptr %price, align 4 %cmp10.not132 = icmp slt i32 %4, 0 %or.cond267 = select i1 %cmp7.not148, i1 true, i1 %cmp10.not132 %brmerge = select i1 %or.cond267, i1 true, i1 %cmp13.not121 br i1 %brmerge, label %if.end78, label %for.cond6.preheader.preheader for.cond6.preheader.preheader: ; preds = %for.cond6.preheader.lr.ph %7 = add i32 %2, %3 %8 = add i32 %7, %4 br label %for.cond6.preheader for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.cond6.for.inc60_crit_edge.split.split %r500.0193 = phi i32 [ %r500.4, %for.cond6.for.inc60_crit_edge.split.split ], [ 0, %for.cond6.preheader.preheader ] %r100.0192 = phi i32 [ %r100.4, %for.cond6.for.inc60_crit_edge.split.split ], [ 0, %for.cond6.preheader.preheader ] %r50.0191 = phi i32 [ %r50.4, %for.cond6.for.inc60_crit_edge.split.split ], [ 0, %for.cond6.preheader.preheader ] %r10.0190 = phi i32 [ %r10.4, %for.cond6.for.inc60_crit_edge.split.split ], [ 0, %for.cond6.preheader.preheader ] %min.0189 = phi i32 [ %min.4, %for.cond6.for.inc60_crit_edge.split.split ], [ 10000, %for.cond6.preheader.preheader ] %t10.0186 = phi i32 [ %inc61, %for.cond6.for.inc60_crit_edge.split.split ], [ 0, %for.cond6.preheader.preheader ] %mul = mul nuw nsw i32 %t10.0186, 10 br label %for.cond9.preheader for.cond9.preheader: ; preds = %for.cond6.preheader, %for.cond9.for.inc57_crit_edge.split %r500.1155 = phi i32 [ %r500.0193, %for.cond6.preheader ], [ %r500.4, %for.cond9.for.inc57_crit_edge.split ] %r100.1154 = phi i32 [ %r100.0192, %for.cond6.preheader ], [ %r100.4, %for.cond9.for.inc57_crit_edge.split ] %r50.1153 = phi i32 [ %r50.0191, %for.cond6.preheader ], [ %r50.4, %for.cond9.for.inc57_crit_edge.split ] %r10.1152 = phi i32 [ %r10.0190, %for.cond6.preheader ], [ %r10.4, %for.cond9.for.inc57_crit_edge.split ] %min.1151 = phi i32 [ %min.0189, %for.cond6.preheader ], [ %min.4, %for.cond9.for.inc57_crit_edge.split ] %t50.0149 = phi i32 [ 0, %for.cond6.preheader ], [ %inc58, %for.cond9.for.inc57_crit_edge.split ] %mul15 = mul nuw nsw i32 %t50.0149, 50 %add = add nuw nsw i32 %mul15, %mul %9 = add nuw i32 %t10.0186, %t50.0149 br label %for.cond12.preheader for.cond12.preheader: ; preds = %for.cond9.preheader, %for.cond12.for.inc54_crit_edge %r500.2138 = phi i32 [ %r500.1155, %for.cond9.preheader ], [ %r500.4, %for.cond12.for.inc54_crit_edge ] %r100.2137 = phi i32 [ %r100.1154, %for.cond9.preheader ], [ %r100.4, %for.cond12.for.inc54_crit_edge ] %r50.2136 = phi i32 [ %r50.1153, %for.cond9.preheader ], [ %r50.4, %for.cond12.for.inc54_crit_edge ] %r10.2135 = phi i32 [ %r10.1152, %for.cond9.preheader ], [ %r10.4, %for.cond12.for.inc54_crit_edge ] %min.2134 = phi i32 [ %min.1151, %for.cond9.preheader ], [ %min.4, %for.cond12.for.inc54_crit_edge ] %t100.0133 = phi i32 [ 0, %for.cond9.preheader ], [ %inc55, %for.cond12.for.inc54_crit_edge ] %mul16 = mul nuw nsw i32 %t100.0133, 100 %add17 = add nuw nsw i32 %add, %mul16 %10 = add i32 %9, %t100.0133 br label %for.body14 for.body14: ; preds = %for.cond12.preheader, %for.inc %r500.3127 = phi i32 [ %r500.2138, %for.cond12.preheader ], [ %r500.4, %for.inc ] %r100.3126 = phi i32 [ %r100.2137, %for.cond12.preheader ], [ %r100.4, %for.inc ] %r50.3125 = phi i32 [ %r50.2136, %for.cond12.preheader ], [ %r50.4, %for.inc ] %r10.3124 = phi i32 [ %r10.2135, %for.cond12.preheader ], [ %r10.4, %for.inc ] %min.3123 = phi i32 [ %min.2134, %for.cond12.preheader ], [ %min.4, %for.inc ] %t500.0122 = phi i32 [ 0, %for.cond12.preheader ], [ %inc, %for.inc ] %mul18 = mul nuw nsw i32 %t500.0122, 500 %add19 = add nuw nsw i32 %add17, %mul18 %cmp20 = icmp slt i32 %add19, %6 br i1 %cmp20, label %for.inc, label %if.end22 if.end22: ; preds = %for.body14 %sub = sub nsw i32 %add19, %6 %div = sdiv i32 %sub, 500 %rem = srem i32 %sub, 500 %div23.lhs.trunc = trunc i32 %rem to i16 %div23118 = sdiv i16 %div23.lhs.trunc, 100 %div23.sext = sext i16 %div23118 to i32 %rem24 = srem i32 %sub, 100 %div25.lhs.trunc = trunc i32 %rem24 to i8 %div25119 = sdiv i8 %div25.lhs.trunc, 50 %div25.sext = sext i8 %div25119 to i32 %rem26 = srem i32 %sub, 50 %div27.lhs.trunc = trunc i32 %rem26 to i8 %div27120 = sdiv i8 %div27.lhs.trunc, 10 %div27.sext = sext i8 %div27120 to i32 %mul28 = mul nsw i32 %t10.0186, %div27.sext %tobool29.not = icmp eq i32 %mul28, 0 %mul30 = mul nsw i32 %t50.0149, %div25.sext %tobool31.not = icmp eq i32 %mul30, 0 %or.cond = select i1 %tobool29.not, i1 %tobool31.not, i1 false %mul33 = mul nsw i32 %t100.0133, %div23.sext %tobool34.not = icmp eq i32 %mul33, 0 %or.cond116 = select i1 %or.cond, i1 %tobool34.not, i1 false %mul36 = mul nsw i32 %div, %t500.0122 %tobool37.not = icmp eq i32 %mul36, 0 %or.cond117 = select i1 %or.cond116, i1 %tobool37.not, i1 false br i1 %or.cond117, label %if.end39, label %for.inc if.end39: ; preds = %if.end22 %11 = add i32 %10, %t500.0122 %sub45 = sub i32 %8, %11 %add46 = add i32 %sub45, %5 %add47 = add i32 %add46, %div %sub48 = add i32 %add47, %div23.sext %add49 = add i32 %sub48, %div27.sext %add50 = add i32 %add49, %div25.sext %cmp51 = icmp slt i32 %add50, %min.3123 br i1 %cmp51, label %if.then52, label %for.inc if.then52: ; preds = %if.end39 br label %for.inc for.inc: ; preds = %if.end39, %if.then52, %if.end22, %for.body14 %min.4 = phi i32 [ %min.3123, %for.body14 ], [ %min.3123, %if.end22 ], [ %add50, %if.then52 ], [ %min.3123, %if.end39 ] %r10.4 = phi i32 [ %r10.3124, %for.body14 ], [ %r10.3124, %if.end22 ], [ %t10.0186, %if.then52 ], [ %r10.3124, %if.end39 ] %r50.4 = phi i32 [ %r50.3125, %for.body14 ], [ %r50.3125, %if.end22 ], [ %t50.0149, %if.then52 ], [ %r50.3125, %if.end39 ] %r100.4 = phi i32 [ %r100.3126, %for.body14 ], [ %r100.3126, %if.end22 ], [ %t100.0133, %if.then52 ], [ %r100.3126, %if.end39 ] %r500.4 = phi i32 [ %r500.3127, %for.body14 ], [ %r500.3127, %if.end22 ], [ %t500.0122, %if.then52 ], [ %r500.3127, %if.end39 ] %inc = add nuw i32 %t500.0122, 1 %exitcond.not = icmp eq i32 %t500.0122, %5 br i1 %exitcond.not, label %for.cond12.for.inc54_crit_edge, label %for.body14, !llvm.loop !11 for.cond12.for.inc54_crit_edge: ; preds = %for.inc %inc55 = add nuw i32 %t100.0133, 1 %exitcond244.not = icmp eq i32 %t100.0133, %4 br i1 %exitcond244.not, label %for.cond9.for.inc57_crit_edge.split, label %for.cond12.preheader, !llvm.loop !13 for.cond9.for.inc57_crit_edge.split: ; preds = %for.cond12.for.inc54_crit_edge %inc58 = add nuw i32 %t50.0149, 1 %exitcond245.not = icmp eq i32 %t50.0149, %3 br i1 %exitcond245.not, label %for.cond6.for.inc60_crit_edge.split.split, label %for.cond9.preheader, !llvm.loop !14 for.cond6.for.inc60_crit_edge.split.split: ; preds = %for.cond9.for.inc57_crit_edge.split %inc61 = add nuw i32 %t10.0186, 1 %exitcond246.not = icmp eq i32 %t10.0186, %2 br i1 %exitcond246.not, label %for.end62, label %for.cond6.preheader, !llvm.loop !15 for.end62: ; preds = %for.cond6.for.inc60_crit_edge.split.split %cmp63 = icmp sgt i32 %r10.4, 0 br i1 %cmp63, label %if.then64, label %if.end66 if.then64: ; preds = %for.end62 %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %r10.4) br label %if.end66 if.end66: ; preds = %if.then64, %for.end62 %cmp67 = icmp sgt i32 %r50.4, 0 br i1 %cmp67, label %if.then68, label %if.end70 if.then68: ; preds = %if.end66 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %r50.4) br label %if.end70 if.end70: ; preds = %if.then68, %if.end66 %cmp71 = icmp sgt i32 %r100.4, 0 br i1 %cmp71, label %if.then72, label %if.end74 if.then72: ; preds = %if.end70 %call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %r100.4) br label %if.end74 if.end74: ; preds = %if.then72, %if.end70 %cmp75 = icmp sgt i32 %r500.4, 0 br i1 %cmp75, label %if.then76, label %if.end78 if.then76: ; preds = %if.end74 %call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %r500.4) br label %if.end78 if.end78: ; preds = %for.cond6.preheader.lr.ph, %if.end3, %if.then76, %if.end74 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %price) %12 = load i32, ptr %price, align 4, !tbaa !5 %cmp = icmp eq i32 %12, 0 br i1 %cmp, label %while.end, label %if.then1.critedge while.end: ; preds = %if.end78, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n500) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n100) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n50) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n10) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %price) #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 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include <stdio.h> #include <inttypes.h> int32_t n, m; int32_t a[1000000]; int64_t imos[1000000]; int64_t ruiseki_minus[1000000]; int main(void) { int32_t i; int64_t honrai = 0; int64_t max_sakugen = 0; int64_t current_honrai; if (scanf("%"SCNd32"%"SCNd32, &n, &m) != 2) return 1; for (i = 0; i < n; i++) { if (scanf("%"SCNd32, &a[i]) != 1) return 1; } /* マーク */ for (i = 1; i < n; i++) { if (a[i - 1] < a[i]) { honrai += (current_honrai = a[i] - a[i - 1]); if (a[i - 1] + 2 <= a[i]) { imos[a[i - 1] + 2]++; imos[a[i] + 1]--; ruiseki_minus[a[i] + 1] += current_honrai - 1; } } else { honrai += (current_honrai = a[i] + (m - a[i - 1])); if (a[i - 1] + 2 <= m) { imos[a[i - 1] + 2]++; imos[m + 1]--; imos[1] += m - a[i - 1]; imos[2] -= m - a[i - 1]; imos[2]++; imos[a[i] + 1]--; } else if (a[i - 1] == m - 1) { imos[1]++; imos[a[i] + 1]--; } else { /* a[i - 1] == m */ imos[2]++; imos[a[i] + 1]--; } ruiseki_minus[a[i] + 1] += current_honrai - 1; } } /* いもす→累積和 */ for (i = 1; i <= m; i++) imos[i] += imos[i - 1]; for (i = 1; i <= m; i++) imos[i] += imos[i - 1] - ruiseki_minus[i]; /* 探す */ for (i = 1; i <= m; i++) { if (imos[i] > max_sakugen) max_sakugen = imos[i]; } printf("%"PRId64"\n", honrai - max_sakugen); return 0; } /* 「削減できる」を記録 いもす * * * s * * d * * 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 2 0 0 * * * d * s * * * 3 1 1 1 0 0 0 1 1 3 4 5 6 0 0 0 1 2 * * * d * * * s * 1 1 1 1 0 0 0 0 0 1 2 3 4 0 0 0 0 0 * * * d * * * * s 0 1 1 1 0 0 0 0 0 0 1 2 3 0 0 0 0 0 * * * d s * * * * 4 1 1 1 0 0 1 1 1 4 5 6 7 0 0 1 2 3 */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_336341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_336341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @n = dso_local global i32 0, align 4 @m = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @a = dso_local global [1000000 x i32] zeroinitializer, align 16 @imos = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @ruiseki_minus = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @.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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m) %cmp.not = icmp eq i32 %call, 2 br i1 %cmp.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %entry %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp1228 = icmp sgt i32 %0, 0 br i1 %cmp1228, label %for.body, label %for.cond6.preheader.thread for.cond6.preheader.thread: ; preds = %for.cond.preheader %.pre265270 = load i32, ptr @m, align 4 br label %for.cond132.preheader for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp1, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond %cmp7230 = icmp sgt i32 %1, 1 %.pre265 = load i32, ptr @m, align 4 br i1 %cmp7230, label %for.body8.lr.ph, label %for.cond132.preheader for.body8.lr.ph: ; preds = %for.cond6.preheader %add73 = add nsw i32 %.pre265, 1 %idxprom74 = sext i32 %add73 to i64 %arrayidx75 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom74 %sub100 = add nsw i32 %.pre265, -1 %wide.trip.count = zext i32 %1 to i64 %.pre = load i32, ptr @a, align 16, !tbaa !5 br label %for.body8 for.body: ; preds = %for.cond.preheader, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %cmp3.not = icmp eq i32 %call2, 1 br i1 %cmp3.not, label %for.cond, label %cleanup for.cond132.preheader: ; preds = %for.inc129, %for.cond6.preheader.thread, %for.cond6.preheader %.pre265271 = phi i32 [ %.pre265, %for.cond6.preheader ], [ %.pre265270, %for.cond6.preheader.thread ], [ %.pre265, %for.inc129 ] %honrai.0.lcssa = phi i64 [ 0, %for.cond6.preheader ], [ 0, %for.cond6.preheader.thread ], [ %honrai.1, %for.inc129 ] %cmp133.not234 = icmp slt i32 %.pre265271, 1 br i1 %cmp133.not234, label %for.end175, label %for.body135.preheader for.body135.preheader: ; preds = %for.cond132.preheader %3 = add nuw i32 %.pre265271, 1 %wide.trip.count252 = zext i32 %3 to i64 %.pre266 = load i64, ptr @imos, align 16, !tbaa !11 %4 = add nsw i64 %wide.trip.count252, -1 %5 = add nsw i64 %wide.trip.count252, -2 %xtraiter = and i64 %4, 3 %6 = icmp ult i64 %5, 3 br i1 %6, label %for.cond145.preheader.unr-lcssa, label %for.body135.preheader.new for.body135.preheader.new: ; preds = %for.body135.preheader %unroll_iter = and i64 %4, -4 br label %for.body135 for.body8: ; preds = %for.body8.lr.ph, %for.inc129 %7 = phi i32 [ %.pre, %for.body8.lr.ph ], [ %8, %for.inc129 ] %indvars.iv244 = phi i64 [ 1, %for.body8.lr.ph ], [ %indvars.iv.next245, %for.inc129 ] %honrai.0232 = phi i64 [ 0, %for.body8.lr.ph ], [ %honrai.1, %for.inc129 ] %arrayidx12 = getelementptr inbounds [1000000 x i32], ptr @a, i64 0, i64 %indvars.iv244 %8 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %7, %8 br i1 %cmp13, label %if.then14, label %if.else if.then14: ; preds = %for.body8 %sub20 = sub nsw i32 %8, %7 %conv = sext i32 %sub20 to i64 %add24 = add nsw i32 %7, 2 %cmp27.not = icmp sgt i32 %add24, %8 br i1 %cmp27.not, label %for.inc129, label %if.then29 if.then29: ; preds = %if.then14 %idxprom34 = sext i32 %add24 to i64 %arrayidx35 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom34 %9 = load i64, ptr %arrayidx35, align 8, !tbaa !11 %inc36 = add nsw i64 %9, 1 store i64 %inc36, ptr %arrayidx35, align 8, !tbaa !11 %add39 = add nsw i32 %8, 1 %idxprom40 = sext i32 %add39 to i64 %arrayidx41 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom40 br label %for.inc129.sink.split if.else: ; preds = %for.body8 %sub55 = sub nsw i32 %.pre265, %7 %add56 = add nsw i32 %sub55, %8 %conv57 = sext i32 %add56 to i64 %add62 = add nsw i32 %7, 2 %cmp63.not = icmp sgt i32 %add62, %.pre265 br i1 %cmp63.not, label %if.else96, label %if.then65 if.then65: ; preds = %if.else %idxprom70 = sext i32 %add62 to i64 %arrayidx71 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom70 %10 = load i64, ptr %arrayidx71, align 8, !tbaa !11 %inc72 = add nsw i64 %10, 1 store i64 %inc72, ptr %arrayidx71, align 8, !tbaa !11 %11 = load i64, ptr %arrayidx75, align 8, !tbaa !11 %dec76 = add nsw i64 %11, -1 store i64 %dec76, ptr %arrayidx75, align 8, !tbaa !11 %conv81 = sext i32 %sub55 to i64 %12 = load i64, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 1), align 8, !tbaa !11 %add82 = add nsw i64 %12, %conv81 store i64 %add82, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 1), align 8, !tbaa !11 %13 = load i64, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 2), align 16, !tbaa !11 %reass.sub = sub i64 %13, %conv81 %inc89 = add i64 %reass.sub, 1 store i64 %inc89, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 2), align 16, !tbaa !11 %add92 = add nsw i32 %8, 1 %idxprom93 = sext i32 %add92 to i64 %arrayidx94 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom93 br label %for.inc129.sink.split if.else96: ; preds = %if.else %cmp101 = icmp eq i32 %7, %sub100 %add107 = add nsw i32 %8, 1 %idxprom108 = sext i32 %add107 to i64 %arrayidx109 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %idxprom108 br i1 %cmp101, label %if.then103, label %if.else111 if.then103: ; preds = %if.else96 %14 = load i64, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 1), align 8, !tbaa !11 %inc104 = add nsw i64 %14, 1 store i64 %inc104, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 1), align 8, !tbaa !11 br label %for.inc129.sink.split if.else111: ; preds = %if.else96 %15 = load i64, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 2), align 16, !tbaa !11 %inc112 = add nsw i64 %15, 1 store i64 %inc112, ptr getelementptr inbounds ([1000000 x i64], ptr @imos, i64 0, i64 2), align 16, !tbaa !11 br label %for.inc129.sink.split for.inc129.sink.split: ; preds = %if.then65, %if.else111, %if.then103, %if.then29 %arrayidx41.sink274 = phi ptr [ %arrayidx41, %if.then29 ], [ %arrayidx109, %if.then103 ], [ %arrayidx109, %if.else111 ], [ %arrayidx94, %if.then65 ] %conv.sink = phi i64 [ %conv, %if.then29 ], [ %conv57, %if.then103 ], [ %conv57, %if.else111 ], [ %conv57, %if.then65 ] %idxprom40.sink = phi i64 [ %idxprom40, %if.then29 ], [ %idxprom108, %if.then103 ], [ %idxprom108, %if.else111 ], [ %idxprom93, %if.then65 ] %16 = load i64, ptr %arrayidx41.sink274, align 8, !tbaa !11 %dec = add nsw i64 %16, -1 store i64 %dec, ptr %arrayidx41.sink274, align 8, !tbaa !11 %sub42 = add nsw i64 %conv.sink, -1 %arrayidx47 = getelementptr inbounds [1000000 x i64], ptr @ruiseki_minus, i64 0, i64 %idxprom40.sink %17 = load i64, ptr %arrayidx47, align 8, !tbaa !11 %add127 = add nsw i64 %sub42, %17 store i64 %add127, ptr %arrayidx47, align 8, !tbaa !11 br label %for.inc129 for.inc129: ; preds = %for.inc129.sink.split, %if.then14 %conv.pn = phi i64 [ %conv, %if.then14 ], [ %conv.sink, %for.inc129.sink.split ] %honrai.1 = add nsw i64 %conv.pn, %honrai.0232 %indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1 %exitcond.not = icmp eq i64 %indvars.iv.next245, %wide.trip.count br i1 %exitcond.not, label %for.cond132.preheader, label %for.body8, !llvm.loop !13 for.cond145.preheader.unr-lcssa: ; preds = %for.body135, %for.body135.preheader %.unr = phi i64 [ %.pre266, %for.body135.preheader ], [ %add141.3, %for.body135 ] %indvars.iv248.unr = phi i64 [ 1, %for.body135.preheader ], [ %indvars.iv.next249.3, %for.body135 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond145.preheader, label %for.body135.epil for.body135.epil: ; preds = %for.cond145.preheader.unr-lcssa, %for.body135.epil %18 = phi i64 [ %add141.epil, %for.body135.epil ], [ %.unr, %for.cond145.preheader.unr-lcssa ] %indvars.iv248.epil = phi i64 [ %indvars.iv.next249.epil, %for.body135.epil ], [ %indvars.iv248.unr, %for.cond145.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body135.epil ], [ 0, %for.cond145.preheader.unr-lcssa ] %arrayidx140.epil = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv248.epil %19 = load i64, ptr %arrayidx140.epil, align 8, !tbaa !11 %add141.epil = add nsw i64 %19, %18 store i64 %add141.epil, ptr %arrayidx140.epil, align 8, !tbaa !11 %indvars.iv.next249.epil = add nuw nsw i64 %indvars.iv248.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.cond145.preheader, label %for.body135.epil, !llvm.loop !14 for.cond145.preheader: ; preds = %for.body135.epil, %for.cond145.preheader.unr-lcssa br i1 %cmp133.not234, label %for.end175, label %for.body148.preheader for.body148.preheader: ; preds = %for.cond145.preheader %.pre267 = load i64, ptr @imos, align 16, !tbaa !11 %xtraiter280 = and i64 %4, 1 %20 = icmp eq i64 %5, 0 br i1 %20, label %for.cond161.preheader.unr-lcssa, label %for.body148.preheader.new for.body148.preheader.new: ; preds = %for.body148.preheader %unroll_iter284 = and i64 %4, -2 br label %for.body148 for.body135: ; preds = %for.body135, %for.body135.preheader.new %21 = phi i64 [ %.pre266, %for.body135.preheader.new ], [ %add141.3, %for.body135 ] %indvars.iv248 = phi i64 [ 1, %for.body135.preheader.new ], [ %indvars.iv.next249.3, %for.body135 ] %niter = phi i64 [ 0, %for.body135.preheader.new ], [ %niter.next.3, %for.body135 ] %arrayidx140 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv248 %22 = load i64, ptr %arrayidx140, align 8, !tbaa !11 %add141 = add nsw i64 %22, %21 store i64 %add141, ptr %arrayidx140, align 8, !tbaa !11 %indvars.iv.next249 = add nuw nsw i64 %indvars.iv248, 1 %arrayidx140.1 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv.next249 %23 = load i64, ptr %arrayidx140.1, align 8, !tbaa !11 %add141.1 = add nsw i64 %23, %add141 store i64 %add141.1, ptr %arrayidx140.1, align 8, !tbaa !11 %indvars.iv.next249.1 = add nuw nsw i64 %indvars.iv248, 2 %arrayidx140.2 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv.next249.1 %24 = load i64, ptr %arrayidx140.2, align 8, !tbaa !11 %add141.2 = add nsw i64 %24, %add141.1 store i64 %add141.2, ptr %arrayidx140.2, align 8, !tbaa !11 %indvars.iv.next249.2 = add nuw nsw i64 %indvars.iv248, 3 %arrayidx140.3 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv.next249.2 %25 = load i64, ptr %arrayidx140.3, align 8, !tbaa !11 %add141.3 = add nsw i64 %25, %add141.2 store i64 %add141.3, ptr %arrayidx140.3, align 8, !tbaa !11 %indvars.iv.next249.3 = add nuw nsw i64 %indvars.iv248, 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.cond145.preheader.unr-lcssa, label %for.body135, !llvm.loop !16 for.cond161.preheader.unr-lcssa: ; preds = %for.body148, %for.body148.preheader %.unr282 = phi i64 [ %.pre267, %for.body148.preheader ], [ %add157.1, %for.body148 ] %indvars.iv254.unr = phi i64 [ 1, %for.body148.preheader ], [ %indvars.iv.next255.1, %for.body148 ] %lcmp.mod283.not = icmp eq i64 %xtraiter280, 0 br i1 %lcmp.mod283.not, label %for.cond161.preheader, label %for.body148.epil for.body148.epil: ; preds = %for.cond161.preheader.unr-lcssa %arrayidx153.epil = getelementptr inbounds [1000000 x i64], ptr @ruiseki_minus, i64 0, i64 %indvars.iv254.unr %26 = load i64, ptr %arrayidx153.epil, align 8, !tbaa !11 %sub154.epil = sub i64 %.unr282, %26 %arrayidx156.epil = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv254.unr %27 = load i64, ptr %arrayidx156.epil, align 8, !tbaa !11 %add157.epil = add nsw i64 %sub154.epil, %27 store i64 %add157.epil, ptr %arrayidx156.epil, align 8, !tbaa !11 br label %for.cond161.preheader for.cond161.preheader: ; preds = %for.cond161.preheader.unr-lcssa, %for.body148.epil br i1 %cmp133.not234, label %for.end175, label %for.body164.preheader for.body164.preheader: ; preds = %for.cond161.preheader %28 = add nuw i32 %.pre265271, 1 %wide.trip.count263 = zext i32 %28 to i64 %29 = add nsw i64 %wide.trip.count252, -1 %min.iters.check = icmp ult i32 %.pre265271, 4 br i1 %min.iters.check, label %for.body164.preheader277, label %vector.ph vector.ph: ; preds = %for.body164.preheader %n.vec = and i64 %29, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ] %vec.phi275 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %33, %vector.body ] %offset.idx = or i64 %index, 1 %30 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %offset.idx %wide.load = load <2 x i64>, ptr %30, align 8, !tbaa !11 %31 = getelementptr inbounds i64, ptr %30, i64 2 %wide.load276 = load <2 x i64>, ptr %31, align 8, !tbaa !11 %32 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %vec.phi) %33 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load276, <2 x i64> %vec.phi275) %index.next = add nuw i64 %index, 4 %34 = icmp eq i64 %index.next, %n.vec br i1 %34, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %32, <2 x i64> %33) %35 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %29, %n.vec br i1 %cmp.n, label %for.end175, label %for.body164.preheader277 for.body164.preheader277: ; preds = %for.body164.preheader, %middle.block %indvars.iv260.ph = phi i64 [ 1, %for.body164.preheader ], [ %ind.end, %middle.block ] %max_sakugen.0241.ph = phi i64 [ 0, %for.body164.preheader ], [ %35, %middle.block ] br label %for.body164 for.body148: ; preds = %for.body148, %for.body148.preheader.new %36 = phi i64 [ %.pre267, %for.body148.preheader.new ], [ %add157.1, %for.body148 ] %indvars.iv254 = phi i64 [ 1, %for.body148.preheader.new ], [ %indvars.iv.next255.1, %for.body148 ] %niter285 = phi i64 [ 0, %for.body148.preheader.new ], [ %niter285.next.1, %for.body148 ] %arrayidx153 = getelementptr inbounds [1000000 x i64], ptr @ruiseki_minus, i64 0, i64 %indvars.iv254 %37 = load i64, ptr %arrayidx153, align 8, !tbaa !11 %sub154 = sub i64 %36, %37 %arrayidx156 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv254 %38 = load i64, ptr %arrayidx156, align 8, !tbaa !11 %add157 = add nsw i64 %sub154, %38 store i64 %add157, ptr %arrayidx156, align 8, !tbaa !11 %indvars.iv.next255 = add nuw nsw i64 %indvars.iv254, 1 %arrayidx153.1 = getelementptr inbounds [1000000 x i64], ptr @ruiseki_minus, i64 0, i64 %indvars.iv.next255 %39 = load i64, ptr %arrayidx153.1, align 8, !tbaa !11 %sub154.1 = sub i64 %add157, %39 %arrayidx156.1 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv.next255 %40 = load i64, ptr %arrayidx156.1, align 8, !tbaa !11 %add157.1 = add nsw i64 %sub154.1, %40 store i64 %add157.1, ptr %arrayidx156.1, align 8, !tbaa !11 %indvars.iv.next255.1 = add nuw nsw i64 %indvars.iv254, 2 %niter285.next.1 = add i64 %niter285, 2 %niter285.ncmp.1 = icmp eq i64 %niter285.next.1, %unroll_iter284 br i1 %niter285.ncmp.1, label %for.cond161.preheader.unr-lcssa, label %for.body148, !llvm.loop !20 for.body164: ; preds = %for.body164.preheader277, %for.body164 %indvars.iv260 = phi i64 [ %indvars.iv.next261, %for.body164 ], [ %indvars.iv260.ph, %for.body164.preheader277 ] %max_sakugen.0241 = phi i64 [ %spec.select, %for.body164 ], [ %max_sakugen.0241.ph, %for.body164.preheader277 ] %arrayidx166 = getelementptr inbounds [1000000 x i64], ptr @imos, i64 0, i64 %indvars.iv260 %41 = load i64, ptr %arrayidx166, align 8, !tbaa !11 %spec.select = tail call i64 @llvm.smax.i64(i64 %41, i64 %max_sakugen.0241) %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1 %exitcond264.not = icmp eq i64 %indvars.iv.next261, %wide.trip.count263 br i1 %exitcond264.not, label %for.end175, label %for.body164, !llvm.loop !21 for.end175: ; preds = %for.body164, %middle.block, %for.cond132.preheader, %for.cond145.preheader, %for.cond161.preheader %max_sakugen.0.lcssa = phi i64 [ 0, %for.cond161.preheader ], [ 0, %for.cond145.preheader ], [ 0, %for.cond132.preheader ], [ %35, %middle.block ], [ %spec.select, %for.body164 ] %sub176 = sub nsw i64 %honrai.0.lcssa, %max_sakugen.0.lcssa %call177 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub176) br label %cleanup cleanup: ; preds = %for.body, %entry, %for.end175 %retval.0 = phi i32 [ 0, %for.end175 ], [ 1, %entry ], [ 1, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18, !19} !18 = !{!"llvm.loop.isvectorized", i32 1} !19 = !{!"llvm.loop.unroll.runtime.disable"} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !19, !18}