Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
/* * main.c * * Created on: 2019/12/29 * Author: family */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define MAX(a,b) (a > b ? a : b) #define MIN(a,b) (a > b ? b : a) typedef long long int ll; int main() { char C = 0; scanf("%c", &C); printf("%c\n", C+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260434/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %C = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %C) #3 store i8 0, ptr %C, align 1, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %0 = load i8, ptr %C, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %C) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main() { long long int N, ans = 0, j = 2; scanf("%lld",&N); if (N % 2 == 0) { for (int i = 0; i <= 26; i++) { j = j * 5; ans = ans + N / j; } printf("%lld", ans); } else { printf("0"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260478/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260478/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = and i64 %0, 1 %cmp = icmp eq i64 %1, 0 br i1 %cmp, label %for.body.preheader, label %if.else for.body.preheader: ; preds = %entry %div = sdiv i64 %0, 10 %div.1 = sdiv i64 %0, 50 %add.1 = add nsw i64 %div.1, %div %div.2 = sdiv i64 %0, 250 %add.2 = add nsw i64 %div.2, %add.1 %div.3 = sdiv i64 %0, 1250 %add.3 = add nsw i64 %div.3, %add.2 %div.4 = sdiv i64 %0, 6250 %add.4 = add nsw i64 %div.4, %add.3 %div.5 = sdiv i64 %0, 31250 %add.5 = add nsw i64 %div.5, %add.4 %div.6 = sdiv i64 %0, 156250 %add.6 = add nsw i64 %div.6, %add.5 %div.7 = sdiv i64 %0, 781250 %add.7 = add nsw i64 %div.7, %add.6 %div.8 = sdiv i64 %0, 3906250 %add.8 = add nsw i64 %div.8, %add.7 %div.9 = sdiv i64 %0, 19531250 %add.9 = add nsw i64 %div.9, %add.8 %div.10 = sdiv i64 %0, 97656250 %add.10 = add nsw i64 %div.10, %add.9 %div.11 = sdiv i64 %0, 488281250 %add.11 = add nsw i64 %div.11, %add.10 %div.12 = sdiv i64 %0, 2441406250 %add.12 = add nsw i64 %div.12, %add.11 %div.13 = sdiv i64 %0, 12207031250 %add.13 = add nsw i64 %div.13, %add.12 %div.14 = sdiv i64 %0, 61035156250 %add.14 = add nsw i64 %div.14, %add.13 %div.15 = sdiv i64 %0, 305175781250 %add.15 = add nsw i64 %div.15, %add.14 %div.16 = sdiv i64 %0, 1525878906250 %add.16 = add nsw i64 %div.16, %add.15 %div.17 = sdiv i64 %0, 7629394531250 %add.17 = add nsw i64 %div.17, %add.16 %div.18 = sdiv i64 %0, 38146972656250 %add.18 = add nsw i64 %div.18, %add.17 %div.19 = sdiv i64 %0, 190734863281250 %add.19 = add nsw i64 %div.19, %add.18 %div.20 = sdiv i64 %0, 953674316406250 %add.20 = add nsw i64 %div.20, %add.19 %div.21 = sdiv i64 %0, 4768371582031250 %add.21 = add nsw i64 %div.21, %add.20 %div.22 = sdiv i64 %0, 23841857910156250 %add.22 = add nsw i64 %div.22, %add.21 %div.23 = sdiv i64 %0, 119209289550781250 %add.23 = add nsw i64 %div.23, %add.22 %div.24 = sdiv i64 %0, 596046447753906250 %add.24 = add nsw i64 %div.24, %add.23 %div.25 = sdiv i64 %0, 2980232238769531250 %add.25 = add nsw i64 %div.25, %add.24 %div.26 = sdiv i64 %0, -3545582879861895366 %add.26 = add nsw i64 %div.26, %add.25 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add.26) br label %if.end if.else: ; preds = %entry %putchar = call i32 @putchar(i32 48) br label %if.end if.end: ; preds = %if.else, %for.body.preheader call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ unsigned long int n,half,denomi,i,ans=0; scanf("%ld",&n); if(n%2==1){ printf("0"); return 0; }; half=n/2; denomi=1; for(i=1;i<26;i++){ denomi*=5; ans+=half/denomi; //printf("found= %ld; ans= %ld \n",half/denomi, ans); }; printf("%ld",ans); return 0; };
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260520/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260520/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; 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 %rem = and i64 %0, 1 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %putchar = call i32 @putchar(i32 48) br label %cleanup if.end: ; preds = %entry %div3 = udiv i64 %0, 10 %div3.1 = udiv i64 %0, 50 %add.1 = add nuw nsw i64 %div3.1, %div3 %div3.2 = udiv i64 %0, 250 %add.2 = add nuw nsw i64 %div3.2, %add.1 %div3.3 = udiv i64 %0, 1250 %add.3 = add nuw nsw i64 %div3.3, %add.2 %div3.4 = udiv i64 %0, 6250 %add.4 = add nuw nsw i64 %div3.4, %add.3 %div3.5 = udiv i64 %0, 31250 %add.5 = add nuw nsw i64 %div3.5, %add.4 %div3.6 = udiv i64 %0, 156250 %add.6 = add nuw nsw i64 %div3.6, %add.5 %div3.7 = udiv i64 %0, 781250 %add.7 = add nuw nsw i64 %div3.7, %add.6 %div3.8 = udiv i64 %0, 3906250 %add.8 = add nuw nsw i64 %div3.8, %add.7 %div3.9 = udiv i64 %0, 19531250 %add.9 = add nuw nsw i64 %div3.9, %add.8 %div3.10 = udiv i64 %0, 97656250 %add.10 = add nuw nsw i64 %div3.10, %add.9 %div3.11 = udiv i64 %0, 488281250 %add.11 = add nuw nsw i64 %div3.11, %add.10 %div3.12 = udiv i64 %0, 2441406250 %add.12 = add nuw nsw i64 %div3.12, %add.11 %div3.13 = udiv i64 %0, 12207031250 %add.13 = add nuw nsw i64 %div3.13, %add.12 %div3.14 = udiv i64 %0, 61035156250 %add.14 = add nuw nsw i64 %div3.14, %add.13 %div3.15 = udiv i64 %0, 305175781250 %add.15 = add nuw nsw i64 %div3.15, %add.14 %div3.16 = udiv i64 %0, 1525878906250 %add.16 = add nuw nsw i64 %div3.16, %add.15 %div3.17 = udiv i64 %0, 7629394531250 %add.17 = add nuw nsw i64 %div3.17, %add.16 %div3.18 = udiv i64 %0, 38146972656250 %add.18 = add nuw nsw i64 %div3.18, %add.17 %div3.19 = udiv i64 %0, 190734863281250 %add.19 = add nuw nsw i64 %div3.19, %add.18 %div3.20 = udiv i64 %0, 953674316406250 %add.20 = add nuw nsw i64 %div3.20, %add.19 %div3.21 = udiv i64 %0, 4768371582031250 %add.21 = add nuw nsw i64 %div3.21, %add.20 %div3.22 = udiv i64 %0, 23841857910156250 %add.22 = add nuw nsw i64 %div3.22, %add.21 %div3.23 = udiv i64 %0, 119209289550781250 %add.23 = add nuw nsw i64 %div3.23, %add.22 %div3.24 = udiv i64 %0, 596046447753906250 %add.24 = add nuw nsw i64 %div3.24, %add.23 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add.24) br label %cleanup cleanup: ; preds = %if.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int unused __attribute__((unused)); char a, b; unused = scanf("%c %c", &a, &b); if(a=='H' && b=='H') printf("H"); else if(a=='D' && b=='H') printf("D"); else if(a=='H' && b=='D') printf("D"); else if(a=='D' && b=='D') printf("H"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260564/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260564/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 72 %1 = load i8, ptr %b, align 1 %cmp3 = icmp eq i8 %1, 72 %or.cond = select i1 %cmp, i1 %cmp3, i1 false br i1 %or.cond, label %if.end37.sink.split, label %if.else if.else: ; preds = %entry %cmp7 = icmp eq i8 %0, 68 %or.cond38 = select i1 %cmp7, i1 %cmp3, i1 false br i1 %or.cond38, label %if.end37.sink.split, label %if.else15 if.else15: ; preds = %if.else %cmp21 = icmp eq i8 %1, 68 %or.cond39 = select i1 %cmp, i1 %cmp21, i1 false br i1 %or.cond39, label %if.end37.sink.split, label %if.else25 if.else25: ; preds = %if.else15 %or.cond40 = select i1 %cmp7, i1 %cmp21, i1 false br i1 %or.cond40, label %if.end37.sink.split, label %if.end37 if.end37.sink.split: ; preds = %if.else25, %if.else15, %if.else, %entry %.sink = phi i32 [ 72, %entry ], [ 68, %if.else ], [ 68, %if.else15 ], [ 72, %if.else25 ] %putchar42 = call i32 @putchar(i32 %.sink) br label %if.end37 if.end37: ; preds = %if.end37.sink.split, %if.else25 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char a,b; scanf("%c %c",&a,&b); if(a == 'H'){ if(b == 'H'){ printf("H"); } else if(b == 'D'){ printf("D"); } } else if(a == 'D'){ if(b == 'H'){ printf("D"); } else if(b == 'D'){ printf("H"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260607/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260607/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 switch i8 %0, label %if.end32 [ i8 72, label %if.then i8 68, label %if.then17 ] if.then: ; preds = %entry %1 = load i8, ptr %b, align 1, !tbaa !5 switch i8 %1, label %if.end32 [ i8 72, label %if.end32.sink.split i8 68, label %if.then10 ] if.then10: ; preds = %if.then br label %if.end32.sink.split if.then17: ; preds = %entry %2 = load i8, ptr %b, align 1, !tbaa !5 switch i8 %2, label %if.end32 [ i8 72, label %if.end32.sink.split i8 68, label %if.then27 ] if.then27: ; preds = %if.then17 br label %if.end32.sink.split if.end32.sink.split: ; preds = %if.then17, %if.then, %if.then10, %if.then27 %.sink = phi i32 [ 72, %if.then27 ], [ 68, %if.then10 ], [ 72, %if.then ], [ 68, %if.then17 ] %putchar = call i32 @putchar(i32 %.sink) br label %if.end32 if.end32: ; preds = %if.end32.sink.split, %if.then17, %entry, %if.then call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char a,b; scanf("%c %c",&a,&b); if(a=='H') printf("%c",b); else if(a=='D'){ if(b=='H') printf("D"); else printf("H"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260650/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260650/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 switch i8 %0, label %if.end16 [ i8 72, label %if.then i8 68, label %if.then7 ] if.then: ; preds = %entry %1 = load i8, ptr %b, align 1, !tbaa !5 %conv2 = sext i8 %1 to i32 br label %if.end16.sink.split if.then7: ; preds = %entry %2 = load i8, ptr %b, align 1, !tbaa !5 %cmp9 = icmp eq i8 %2, 72 %. = select i1 %cmp9, i32 68, i32 72 br label %if.end16.sink.split if.end16.sink.split: ; preds = %if.then7, %if.then %.sink = phi i32 [ %conv2, %if.then ], [ %., %if.then7 ] %putchar = call i32 @putchar(i32 %.sink) br label %if.end16 if.end16: ; preds = %if.end16.sink.split, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char a,b; scanf("%s %s",&a,&b); if(a==b){ printf("H"); }else{ printf("D"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260694/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260694/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %. = select i1 %cmp, i32 72, i32 68 %putchar = call i32 @putchar(i32 %.) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { char a,b; while(scanf("%c %c",&a,&b)!=EOF) { if(a=='H') { if(b=='H') printf("H"); if(b=='D') printf("D"); } if(a=='D') { if(b=='H') printf("D"); if(b=='D') printf("H"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260744/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260744/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not38 = icmp eq i32 %call37, -1 br i1 %cmp.not38, label %while.end, label %while.body while.body: ; preds = %entry, %if.end31 %0 = load i8, ptr %a, align 1, !tbaa !5 %cmp1 = icmp eq i8 %0, 72 br i1 %cmp1, label %if.then, label %if.end14 if.then: ; preds = %while.body %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp4 = icmp eq i8 %1, 72 br i1 %cmp4, label %if.then6, label %if.end if.then6: ; preds = %if.then %putchar = call i32 @putchar(i32 72) %.pr = load i8, ptr %b, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.then6, %if.then %2 = phi i8 [ %.pr, %if.then6 ], [ %1, %if.then ] %cmp9 = icmp eq i8 %2, 68 br i1 %cmp9, label %if.then11, label %if.end14thread-pre-split if.then11: ; preds = %if.end %putchar32 = call i32 @putchar(i32 68) br label %if.end14thread-pre-split if.end14thread-pre-split: ; preds = %if.then11, %if.end %.pr35 = load i8, ptr %a, align 1, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.end14thread-pre-split, %while.body %3 = phi i8 [ %.pr35, %if.end14thread-pre-split ], [ %0, %while.body ] %cmp16 = icmp eq i8 %3, 68 br i1 %cmp16, label %if.then18, label %if.end31 if.then18: ; preds = %if.end14 %4 = load i8, ptr %b, align 1, !tbaa !5 %cmp20 = icmp eq i8 %4, 72 br i1 %cmp20, label %if.then22, label %if.end24 if.then22: ; preds = %if.then18 %putchar33 = call i32 @putchar(i32 68) %.pr36 = load i8, ptr %b, align 1, !tbaa !5 br label %if.end24 if.end24: ; preds = %if.then22, %if.then18 %5 = phi i8 [ %.pr36, %if.then22 ], [ %4, %if.then18 ] %cmp26 = icmp eq i8 %5, 68 br i1 %cmp26, label %if.then28, label %if.end31 if.then28: ; preds = %if.end24 %putchar34 = call i32 @putchar(i32 72) br label %if.end31 if.end31: ; preds = %if.end24, %if.then28, %if.end14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %if.end31, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { char a, b; scanf("%c %c", &a, &b); puts(a == b ? "H" : "D"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260788/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260788/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"H\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"D\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %cond = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int main(void){ char s[10]; int i,d=753; scanf("%s",s); for(i=0;s[i+2]!='\0';i++){ int n=(s[i]-'0')*100+(s[i+1]-'0')*10+s[i+2]-'0'; if(abs(n-753)<d){d=abs(n-753);} } printf("%d",d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260830/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260830/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx29 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 2 %0 = load i8, ptr %arrayidx29, align 1, !tbaa !5 %cmp.not30 = icmp eq i8 %0, 0 br i1 %cmp.not30, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %.pre = load i8, ptr %s, align 1, !tbaa !5 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %1 = phi i8 [ %.pre, %for.body.preheader ], [ %4, %for.body ] %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %2 = phi i8 [ %0, %for.body.preheader ], [ %8, %for.body ] %d.031 = phi i32 [ 753, %for.body.preheader ], [ %spec.select, %for.body ] %conv = sext i8 %2 to i32 %conv4 = sext i8 %1 to i32 %3 = mul nsw i32 %conv4, 100 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx7 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %4 to i32 %5 = mul nsw i32 %conv8, 10 %add11 = add nsw i32 %conv, -6081 %add16 = add nsw i32 %add11, %3 %sub18 = add nsw i32 %add16, %5 %6 = call i32 @llvm.abs.i32(i32 %sub18, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %6, i32 %d.031) %7 = add nuw nsw i64 %indvars.iv, 3 %arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %7 %8 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %8, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %d.0.lcssa = phi i32 [ 753, %entry ], [ %spec.select, %for.body ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, 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.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <limits.h> #define MIN(a,b) ((a<b)?a:b) #define ABS(a) ((a>0)?a:(-a)) int main(void) { char S[11]; scanf("%s", S); int len = strlen(S); int min = INT_MAX; for(int i = 0; i <= len-3; i++) { int x = (S[i]-'0') * 100 + (S[i+1]-'0') * 10 + (S[i+2]-'0'); min = MIN(min, ABS((753 - x))); } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260874/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260874/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6 %conv = trunc i64 %call2 to i32 %cmp.not54 = icmp slt i32 %conv, 3 br i1 %cmp.not54, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add i64 %call2, 4294967294 %wide.trip.count = and i64 %0, 4294967295 %.pre = load i8, ptr %S, align 1, !tbaa !5 %arrayidx7.phi.trans.insert = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 1 %.pre59 = load i8, ptr %arrayidx7.phi.trans.insert, align 1, !tbaa !5 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader67, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %0, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %vector.recur.init = insertelement <4 x i8> poison, i8 %.pre59, i64 3 %vector.recur.init60 = insertelement <4 x i8> poison, i8 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load63, %vector.body ] %vector.recur61 = phi <4 x i8> [ %vector.recur.init60, %vector.ph ], [ %5, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %30, %vector.body ] %vec.phi62 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %31, %vector.body ] %1 = or i64 %index, 2 %2 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %1 %wide.load = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load63 = load <4 x i8>, ptr %3, align 1, !tbaa !5 %4 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %5 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load63, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %6 = shufflevector <4 x i8> %vector.recur61, <4 x i8> %4, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %7 = shufflevector <4 x i8> %4, <4 x i8> %5, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %8 = sext <4 x i8> %6 to <4 x i32> %9 = sext <4 x i8> %7 to <4 x i32> %10 = mul nsw <4 x i32> %8, <i32 100, i32 100, i32 100, i32 100> %11 = mul nsw <4 x i32> %9, <i32 100, i32 100, i32 100, i32 100> %12 = sext <4 x i8> %4 to <4 x i32> %13 = sext <4 x i8> %5 to <4 x i32> %14 = mul nsw <4 x i32> %12, <i32 10, i32 10, i32 10, i32 10> %15 = mul nsw <4 x i32> %13, <i32 10, i32 10, i32 10, i32 10> %16 = add nsw <4 x i32> %14, %10 %17 = add nsw <4 x i32> %15, %11 %18 = sext <4 x i8> %wide.load to <4 x i32> %19 = sext <4 x i8> %wide.load63 to <4 x i32> %20 = add nsw <4 x i32> %16, %18 %21 = add nsw <4 x i32> %17, %19 %22 = add nsw <4 x i32> %20, <i32 -6081, i32 -6081, i32 -6081, i32 -6081> %23 = add nsw <4 x i32> %21, <i32 -6081, i32 -6081, i32 -6081, i32 -6081> %24 = sub nsw <4 x i32> <i32 6081, i32 6081, i32 6081, i32 6081>, %20 %25 = sub nsw <4 x i32> <i32 6081, i32 6081, i32 6081, i32 6081>, %21 %26 = icmp slt <4 x i32> %20, <i32 6081, i32 6081, i32 6081, i32 6081> %27 = icmp slt <4 x i32> %21, <i32 6081, i32 6081, i32 6081, i32 6081> %28 = select <4 x i1> %26, <4 x i32> %24, <4 x i32> %22 %29 = select <4 x i1> %27, <4 x i32> %25, <4 x i32> %23 %30 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %28) %31 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi62, <4 x i32> %29) %index.next = add nuw i64 %index, 8 %32 = icmp eq i64 %index.next, %n.vec br i1 %32, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %30, <4 x i32> %31) %33 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.mod.vf, 0 %vector.recur.extract = extractelement <4 x i8> %wide.load63, i64 3 %vector.recur.extract64 = extractelement <4 x i8> %wide.load63, i64 2 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader67 for.body.preheader67: ; preds = %for.body.preheader, %middle.block %scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre59, %for.body.preheader ] %scalar.recur66.ph = phi i8 [ %vector.recur.extract64, %middle.block ], [ %.pre, %for.body.preheader ] %indvars.iv.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body.preheader ] %min.056.ph = phi i32 [ %33, %middle.block ], [ 2147483647, %for.body.preheader ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %min.0.lcssa = phi i32 [ 2147483647, %entry ], [ %33, %middle.block ], [ %cond39, %for.body ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %S) #5 ret i32 0 for.body: ; preds = %for.body.preheader67, %for.body %scalar.recur = phi i8 [ %37, %for.body ], [ %scalar.recur.ph, %for.body.preheader67 ] %scalar.recur66 = phi i8 [ %scalar.recur, %for.body ], [ %scalar.recur66.ph, %for.body.preheader67 ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader67 ] %min.056 = phi i32 [ %cond39, %for.body ], [ %min.056.ph, %for.body.preheader67 ] %conv4 = sext i8 %scalar.recur66 to i32 %34 = mul nsw i32 %conv4, 100 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %conv8 = sext i8 %scalar.recur to i32 %35 = mul nsw i32 %conv8, 10 %mul10 = add nsw i32 %35, %34 %36 = add nuw nsw i64 %indvars.iv, 2 %arrayidx14 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %36 %37 = load i8, ptr %arrayidx14, align 1, !tbaa !5 %conv15 = sext i8 %37 to i32 %sub16 = add nsw i32 %mul10, %conv15 %sub18.neg53 = add nsw i32 %sub16, -6081 %sub18 = sub nsw i32 6081, %sub16 %cmp19 = icmp slt i32 %sub16, 6081 %cond = select i1 %cmp19, i32 %sub18, i32 %sub18.neg53 %cond39 = call i32 @llvm.smin.i32(i32 %min.056, i32 %cond) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !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 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 nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 nosync nounwind speculatable willreturn memory(none) } 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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include <stdio.h> int main(void) { char s[100]; scanf("%s",s); int i=0; int min=1000; int x; while(s[i+2]!='\0'){ x=(int)((s[i]-'0')*100+(s[i+1]-'0')*10+s[i+2]-'0'); if(x>753){ x=x-753; }else{ x=753-x; } if(min>x){ min=x; } i++; } printf("%d\n",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260917/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260917/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx36 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 2 %0 = load i8, ptr %arrayidx36, align 2, !tbaa !5 %cmp.not37 = icmp eq i8 %0, 0 br i1 %cmp.not37, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %.pre = load i8, ptr %s, align 16, !tbaa !5 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %1 = phi i8 [ %.pre, %while.body.preheader ], [ %4, %while.body ] %indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %2 = phi i8 [ %0, %while.body.preheader ], [ %7, %while.body ] %min.039 = phi i32 [ 1000, %while.body.preheader ], [ %min.1, %while.body ] %conv = sext i8 %2 to i32 %conv4 = sext i8 %1 to i32 %3 = mul nsw i32 %conv4, 100 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx7 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %4 to i32 %5 = mul nsw i32 %conv8, 10 %mul10 = add nsw i32 %conv, -5280 %add11 = add nsw i32 %mul10, %3 %add16 = add nsw i32 %add11, %5 %cmp18 = icmp sgt i32 %add16, 801 %sub20 = add nsw i32 %add16, -801 %sub21 = sub nsw i32 801, %add16 %x.0 = select i1 %cmp18, i32 %sub20, i32 %sub21 %min.1 = call i32 @llvm.smin.i32(i32 %min.039, i32 %x.0) %6 = add nuw nsw i64 %indvars.iv, 3 %arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %6 %7 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %7, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %min.0.lcssa = phi i32 [ 1000, %entry ], [ %min.1, %while.body ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int main(void){ char s[10]; int min=1000,x,i=0,j; scanf("%s",s); while(s[i+2]!='\0'){ x=0; for(j=0;j<3;j++){ x=x*10+s[i+j]-'0'; } if(min>abs(x-753)){ min=abs(x-753); } i++; } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx24 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 2 %0 = load i8, ptr %arrayidx24, align 1, !tbaa !5 %cmp.not25 = icmp eq i8 %0, 0 br i1 %cmp.not25, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %.pre = load i8, ptr %s, align 1, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.cond.preheader %1 = phi i8 [ %.pre, %for.cond.preheader.preheader ], [ %4, %for.cond.preheader ] %indvars.iv = phi i64 [ 0, %for.cond.preheader.preheader ], [ %3, %for.cond.preheader ] %min.026 = phi i32 [ 1000, %for.cond.preheader.preheader ], [ %spec.select, %for.cond.preheader ] %conv7 = sext i8 %1 to i32 %2 = mul nsw i32 %conv7, 10 %3 = add nuw i64 %indvars.iv, 1 %arrayidx6.1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %3 %4 = load i8, ptr %arrayidx6.1, align 1, !tbaa !5 %conv7.1 = sext i8 %4 to i32 %add8.1 = add nsw i32 %2, -528 %sub.1 = add nsw i32 %add8.1, %conv7.1 %mul.2 = mul nsw i32 %sub.1, 10 %5 = add nuw nsw i64 %indvars.iv, 2 %arrayidx6.2 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %5 %6 = load i8, ptr %arrayidx6.2, align 1, !tbaa !5 %conv7.2 = sext i8 %6 to i32 %op.rdx = add nsw i32 %conv7.2, -801 %op.rdx32 = add nsw i32 %op.rdx, %mul.2 %7 = call i32 @llvm.abs.i32(i32 %op.rdx32, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %min.026, i32 %7) %8 = add nuw nsw i64 %indvars.iv, 3 %arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %8 %9 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %9, 0 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !8 while.end: ; preds = %for.cond.preheader, %entry %min.0.lcssa = phi i32 [ 1000, %entry ], [ %spec.select, %for.cond.preheader ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ long int x; int i, j, k, n, y; int s[100] = {0}, t[100] = {0}, min; scanf("%ld", &x); n = 0; for (i = 0; x!=0; i++) { s[i] = x % 10; x = x / 10; n++; } for (i = 0; i < n; i++) { t[i] = s[n-i-1]; } min = 99999; for (i = 0; i < n-2; i++) { y = 753 - (100*t[i] + 10*t[i+1] + t[i+2]); if (y < 0) { y = -y; } if (min > y) { min = y; } } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261017/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261017/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i64, align 8 %s = alloca [100 x i32], align 16 %t = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %s) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %s, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %t) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %t, i8 0, i64 400, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %.pr = load i64, ptr %x, align 8, !tbaa !5 %cmp.not58 = icmp eq i64 %.pr, 0 br i1 %cmp.not58, label %for.end39, label %for.body for.cond2.preheader: ; preds = %for.body %indvars = trunc i64 %indvars.iv.next to i32 store i64 %div, ptr %x, align 8, !tbaa !5 %cmp361.not = icmp eq i32 %indvars, 0 br i1 %cmp361.not, label %for.end39, label %for.body5.preheader for.body5.preheader: ; preds = %for.cond2.preheader %sext = shl i64 %indvars.iv.next, 32 %0 = ashr exact i64 %sext, 32 %wide.trip.count = and i64 %indvars.iv.next, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body5.preheader111, label %vector.ph vector.ph: ; preds = %for.body5.preheader %n.mod.vf = and i64 %indvars.iv.next, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = xor i64 %index, -1 %2 = add nsw i64 %0, %1 %3 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %2 %4 = getelementptr inbounds i32, ptr %3, i64 -3 %wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !9 %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %5 = getelementptr inbounds i32, ptr %3, i64 -7 %wide.load88 = load <4 x i32>, ptr %5, align 4, !tbaa !9 %reverse89 = shufflevector <4 x i32> %wide.load88, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %6 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %index store <4 x i32> %reverse, ptr %6, align 16, !tbaa !9 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %reverse89, ptr %7, align 16, !tbaa !9 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond14.preheader, label %for.body5.preheader111 for.body5.preheader111: ; preds = %for.body5.preheader, %middle.block %indvars.iv70.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ] br label %for.body5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %9 = phi i64 [ %div, %for.body ], [ %.pr, %entry ] %rem = srem i64 %9, 10 %conv = trunc i64 %rem to i32 %arrayidx = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv store i32 %conv, ptr %arrayidx, align 4, !tbaa !9 %div = sdiv i64 %9, 10 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %.off = add i64 %9, 9 %cmp.not = icmp ult i64 %.off, 19 br i1 %cmp.not, label %for.cond2.preheader, label %for.body, !llvm.loop !15 for.cond14.preheader: ; preds = %for.body5, %middle.block %cmp1663 = icmp sgt i32 %indvars, 2 br i1 %cmp1663, label %for.body18.preheader, label %for.end39 for.body18.preheader: ; preds = %for.cond14.preheader %sub15 = add i64 %indvars.iv, 4294967295 %wide.trip.count80 = and i64 %sub15, 4294967295 %.pre = load i32, ptr %t, align 16, !tbaa !9 %arrayidx22.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 1 %.pre82 = load i32, ptr %arrayidx22.phi.trans.insert, align 4, !tbaa !9 %min.iters.check92 = icmp ult i64 %wide.trip.count80, 8 br i1 %min.iters.check92, label %for.body18.preheader109, label %vector.ph93 vector.ph93: ; preds = %for.body18.preheader %n.mod.vf94 = and i64 %sub15, 7 %n.vec95 = sub nsw i64 %wide.trip.count80, %n.mod.vf94 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre82, i64 3 %vector.recur.init100 = insertelement <4 x i32> poison, i32 %.pre, i64 3 br label %vector.body98 vector.body98: ; preds = %vector.body98, %vector.ph93 %index99 = phi i64 [ 0, %vector.ph93 ], [ %index.next105, %vector.body98 ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph93 ], [ %wide.load104, %vector.body98 ] %vector.recur101 = phi <4 x i32> [ %vector.recur.init100, %vector.ph93 ], [ %14, %vector.body98 ] %vec.phi = phi <4 x i32> [ <i32 99999, i32 99999, i32 99999, i32 99999>, %vector.ph93 ], [ %33, %vector.body98 ] %vec.phi102 = phi <4 x i32> [ <i32 99999, i32 99999, i32 99999, i32 99999>, %vector.ph93 ], [ %34, %vector.body98 ] %10 = or i64 %index99, 2 %11 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %10 %wide.load103 = load <4 x i32>, ptr %11, align 8, !tbaa !9 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load104 = load <4 x i32>, ptr %12, align 8, !tbaa !9 %13 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load103, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %14 = shufflevector <4 x i32> %wide.load103, <4 x i32> %wide.load104, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %15 = shufflevector <4 x i32> %vector.recur101, <4 x i32> %13, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %16 = shufflevector <4 x i32> %13, <4 x i32> %14, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %17 = mul nsw <4 x i32> %15, <i32 100, i32 100, i32 100, i32 100> %18 = mul nsw <4 x i32> %16, <i32 100, i32 100, i32 100, i32 100> %19 = mul nsw <4 x i32> %13, <i32 10, i32 10, i32 10, i32 10> %20 = mul nsw <4 x i32> %14, <i32 10, i32 10, i32 10, i32 10> %21 = add nsw <4 x i32> %19, %17 %22 = add nsw <4 x i32> %20, %18 %23 = add nsw <4 x i32> %21, %wide.load103 %24 = add nsw <4 x i32> %22, %wide.load104 %25 = sub nsw <4 x i32> <i32 753, i32 753, i32 753, i32 753>, %23 %26 = sub nsw <4 x i32> <i32 753, i32 753, i32 753, i32 753>, %24 %27 = icmp sgt <4 x i32> %23, <i32 753, i32 753, i32 753, i32 753> %28 = icmp sgt <4 x i32> %24, <i32 753, i32 753, i32 753, i32 753> %29 = add nsw <4 x i32> %23, <i32 -753, i32 -753, i32 -753, i32 -753> %30 = add nsw <4 x i32> %24, <i32 -753, i32 -753, i32 -753, i32 -753> %31 = select <4 x i1> %27, <4 x i32> %29, <4 x i32> %25 %32 = select <4 x i1> %28, <4 x i32> %30, <4 x i32> %26 %33 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %31) %34 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi102, <4 x i32> %32) %index.next105 = add nuw i64 %index99, 8 %35 = icmp eq i64 %index.next105, %n.vec95 br i1 %35, label %middle.block90, label %vector.body98, !llvm.loop !16 middle.block90: ; preds = %vector.body98 %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %33, <4 x i32> %34) %36 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n97 = icmp eq i64 %n.mod.vf94, 0 %vector.recur.extract = extractelement <4 x i32> %wide.load104, i64 3 %vector.recur.extract106 = extractelement <4 x i32> %wide.load104, i64 2 br i1 %cmp.n97, label %for.end39, label %for.body18.preheader109 for.body18.preheader109: ; preds = %for.body18.preheader, %middle.block90 %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block90 ], [ %.pre82, %for.body18.preheader ] %scalar.recur108.ph = phi i32 [ %vector.recur.extract106, %middle.block90 ], [ %.pre, %for.body18.preheader ] %indvars.iv75.ph = phi i64 [ %n.vec95, %middle.block90 ], [ 0, %for.body18.preheader ] %min.065.ph = phi i32 [ %36, %middle.block90 ], [ 99999, %for.body18.preheader ] br label %for.body18 for.body5: ; preds = %for.body5.preheader111, %for.body5 %indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body5 ], [ %indvars.iv70.ph, %for.body5.preheader111 ] %37 = xor i64 %indvars.iv70, -1 %38 = add nsw i64 %0, %37 %arrayidx8 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %38 %39 = load i32, ptr %arrayidx8, align 4, !tbaa !9 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %indvars.iv70 store i32 %39, ptr %arrayidx10, align 4, !tbaa !9 %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count br i1 %exitcond.not, label %for.cond14.preheader, label %for.body5, !llvm.loop !17 for.body18: ; preds = %for.body18.preheader109, %for.body18 %scalar.recur = phi i32 [ %41, %for.body18 ], [ %scalar.recur.ph, %for.body18.preheader109 ] %scalar.recur108 = phi i32 [ %scalar.recur, %for.body18 ], [ %scalar.recur108.ph, %for.body18.preheader109 ] %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body18 ], [ %indvars.iv75.ph, %for.body18.preheader109 ] %min.065 = phi i32 [ %min.1, %for.body18 ], [ %min.065.ph, %for.body18.preheader109 ] %mul = mul nsw i32 %scalar.recur108, 100 %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %mul23 = mul nsw i32 %scalar.recur, 10 %add24 = add nsw i32 %mul23, %mul %40 = add nuw nsw i64 %indvars.iv75, 2 %arrayidx27 = getelementptr inbounds [100 x i32], ptr %t, i64 0, i64 %40 %41 = load i32, ptr %arrayidx27, align 4, !tbaa !9 %add28 = add nsw i32 %add24, %41 %sub29 = sub nsw i32 753, %add28 %cmp30 = icmp sgt i32 %add28, 753 %sub29.neg = add nsw i32 %add28, -753 %spec.select = select i1 %cmp30, i32 %sub29.neg, i32 %sub29 %min.1 = call i32 @llvm.smin.i32(i32 %min.065, i32 %spec.select) %exitcond81.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count80 br i1 %exitcond81.not, label %for.end39, label %for.body18, !llvm.loop !18 for.end39: ; preds = %for.body18, %middle.block90, %entry, %for.cond2.preheader, %for.cond14.preheader %min.0.lcssa = phi i32 [ 99999, %for.cond14.preheader ], [ 99999, %for.cond2.preheader ], [ 99999, %entry ], [ %36, %middle.block90 ], [ %min.1, %for.body18 ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12, !13, !14} !17 = distinct !{!17, !12, !14, !13} !18 = distinct !{!18, !12, !14, !13}
#include <stdio.h> int main(void){ long long int n, m; scanf("%lld %lld", &n, &m); long long int ans; if(n==1 && m==1)ans=1; else if(n==1 && m>1)ans=m-2; else if(n>1 && m==1)ans=n-2; else if(n==2 || m==2)ans=0; else ans=n*m-(2*n+2*m-4); printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261097/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261097/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 %1 = load i64, ptr %m, align 8 %cmp1 = icmp eq i64 %1, 1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.end23, label %if.else if.else: ; preds = %entry %cmp4 = icmp sgt i64 %1, 1 %or.cond25 = select i1 %cmp, i1 %cmp4, i1 false br i1 %or.cond25, label %if.then5, label %if.else6 if.then5: ; preds = %if.else %sub = add nsw i64 %1, -2 br label %if.end23 if.else6: ; preds = %if.else %cmp7 = icmp sgt i64 %0, 1 %or.cond26 = select i1 %cmp7, i1 %cmp1, i1 false br i1 %or.cond26, label %if.then10, label %if.else12 if.then10: ; preds = %if.else6 %sub11 = add nsw i64 %0, -2 br label %if.end23 if.else12: ; preds = %if.else6 %cmp13 = icmp eq i64 %0, 2 %cmp14 = icmp eq i64 %1, 2 %or.cond27 = select i1 %cmp13, i1 true, i1 %cmp14 br i1 %or.cond27, label %if.end23, label %if.else16 if.else16: ; preds = %if.else12 %mul = mul nsw i64 %1, %0 %mul1730 = add i64 %1, %0 %sub19.neg = add i64 %mul, 4 %2 = shl i64 %mul1730, 1 %sub20 = sub i64 %sub19.neg, %2 br label %if.end23 if.end23: ; preds = %if.else12, %entry, %if.then5, %if.else16, %if.then10 %ans.0 = phi i64 [ %sub, %if.then5 ], [ %sub11, %if.then10 ], [ %sub20, %if.else16 ], [ 1, %entry ], [ 0, %if.else12 ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ long long int i,j,k,flag=0,t,a=0,b=0,n,A[200001],sumA=0,B[200001],sumB=0; scanf("%lld",&n); while(n--){ scanf("%lld",&t); if(t>0){ sumA=sumA+t; A[a]=t; a++; } else{ sumB=sumB-t; B[b]=-t; b++; } } if(sumA>sumB) flag=1; else if(sumB>sumA) flag=2; else{ for(i=0;(i<a&&i<b);i++){ if(A[i]>B[i]){ flag=1; break; } else if(B[i]>A[i]){ flag=2; break; } } if(flag==0){ if(t>0)flag=1; else flag=2; } } if(flag==1) printf("first\n"); else printf("second\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26114/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26114/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [7 x i8] c"second\00", align 1 @str.3 = private unnamed_addr constant [6 x i8] c"first\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 %A = alloca [200001 x i64], align 16 %B = alloca [200001 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %B) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %dec68 = add nsw i64 %0, -1 store i64 %dec68, ptr %n, align 8, !tbaa !5 %tobool.not69 = icmp eq i64 %0, 0 br i1 %tobool.not69, label %for.cond.preheader, label %while.body while.body: ; preds = %entry, %if.end %sumB.073 = phi i64 [ %sumB.1, %if.end ], [ 0, %entry ] %sumA.072 = phi i64 [ %sumA.1, %if.end ], [ 0, %entry ] %b.071 = phi i64 [ %2, %if.end ], [ 0, %entry ] %a.070 = phi i64 [ %a.1, %if.end ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %1 = load i64, ptr %t, align 8, !tbaa !5 %cmp = icmp sgt i64 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i64 %1, %sumA.072 %arrayidx = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %a.070 store i64 %1, ptr %arrayidx, align 8, !tbaa !5 %inc = add nsw i64 %a.070, 1 br label %if.end if.else: ; preds = %while.body %sub = sub nsw i64 %sumB.073, %1 %sub2 = sub nsw i64 0, %1 %arrayidx3 = getelementptr inbounds [200001 x i64], ptr %B, i64 0, i64 %b.071 store i64 %sub2, ptr %arrayidx3, align 8, !tbaa !5 %inc4 = add nsw i64 %b.071, 1 br label %if.end if.end: ; preds = %if.else, %if.then %a.1 = phi i64 [ %inc, %if.then ], [ %a.070, %if.else ] %b.1 = phi i64 [ %b.071, %if.then ], [ %inc4, %if.else ] %sumA.1 = phi i64 [ %add, %if.then ], [ %sumA.072, %if.else ] %sumB.1 = phi i64 [ %sumB.073, %if.then ], [ %sub, %if.else ] %2 = freeze i64 %b.1 %3 = load i64, ptr %n, align 8, !tbaa !5 %dec = add nsw i64 %3, -1 store i64 %dec, ptr %n, align 8, !tbaa !5 %tobool.not = icmp eq i64 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end %cmp5 = icmp sgt i64 %sumA.1, %sumB.1 br i1 %cmp5, label %if.end39, label %if.else7 if.else7: ; preds = %while.end %4 = icmp sgt i64 %1, 0 %cmp8 = icmp sgt i64 %sumB.1, %sumA.1 br i1 %cmp8, label %if.else37, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %if.else7 %cmp278598 = phi i1 [ %4, %if.else7 ], [ false, %entry ] %a.0.lcssa8697 = phi i64 [ %a.1, %if.else7 ], [ 0, %entry ] %b.0.lcssa8796 = phi i64 [ %2, %if.else7 ], [ 0, %entry ] %invariant.smin = call i64 @llvm.smin.i64(i64 %a.0.lcssa8697, i64 %b.0.lcssa8796) %.not77 = icmp slt i64 %invariant.smin, 1 br i1 %.not77, label %if.then26, label %for.body for.cond: ; preds = %if.else17 %inc24 = add nuw nsw i64 %i.078, 1 %exitcond.not = icmp eq i64 %inc24, %invariant.smin br i1 %exitcond.not, label %if.then26, label %for.body, !llvm.loop !11 for.body: ; preds = %for.cond.preheader, %for.cond %i.078 = phi i64 [ %inc24, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx13 = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %i.078 %5 = load i64, ptr %arrayidx13, align 8, !tbaa !5 %arrayidx14 = getelementptr inbounds [200001 x i64], ptr %B, i64 0, i64 %i.078 %6 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %cmp15 = icmp sgt i64 %5, %6 br i1 %cmp15, label %if.end39, label %if.else17 if.else17: ; preds = %for.body %cmp20 = icmp sgt i64 %6, %5 br i1 %cmp20, label %if.else37, label %for.cond if.then26: ; preds = %for.cond, %for.cond.preheader br i1 %cmp278598, label %if.end39, label %if.else37 if.else37: ; preds = %if.else17, %if.then26, %if.else7 br label %if.end39 if.end39: ; preds = %for.body, %while.end, %if.then26, %if.else37 %str.sink = phi ptr [ @str, %if.else37 ], [ @str.3, %if.then26 ], [ @str.3, %while.end ], [ @str.3, %for.body ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %B) #5 call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int i,j,k,n; int ain[10]; int bin[10]; int cin[10]; int aout[10]; int bout[10]; int cout[10]; j=0;k=0; for(i=1;i<=6;i++){ scanf("%d",&ain[i-1]); } for(i=1;i<=6;i++){ scanf("%d",&bin[i-1]); } for(i=1;i<=6;i++){ scanf("%d",&cin[i-1]); } n=ain[5]-ain[2]; if(n<0){ n+=60; j++; } aout[2]=n; n=ain[4]-ain[1]; if(n<0){ n+=60; k++; } if(j==1){ if(n==0){ n=59; }else{ n-=1; } } aout[1]=n; n=ain[3]-ain[0]; if(n<0){ n+=60; } if(k==1){ if(n==0){ n=23; }else{ n-=1; } } aout[0]=n; j=0;k=0; n=bin[5]-bin[2]; if(n<0){ n+=60; j++; } bout[2]=n; n=bin[4]-bin[1]; if(n<0){ n+=60; k++; } if(j==1){ if(n==0){ n=59; k++; }else{ n-=1; } } bout[1]=n; n=bin[3]-bin[0]; if(n<0){ n+=60; } if(k==1){ if(n==0){ n=23; }else{ n-=1; } } bout[0]=n; j=0;k=0; n=cin[5]-cin[2]; if(n<0){ n+=60; j++; } cout[2]=n; n=cin[4]-cin[1]; if(n<0){ n+=60; k++; } if(j==1){ if(n==0){ n=59; k++; }else{ n-=1; } } cout[1]=n; n=cin[3]-cin[0]; if(n<0){ n+=60; } if(k==1){ if(n==0){ n=23; }else{ n-=1; } } cout[0]=n; for(i=1;i<=3;i++){ printf("%d",aout[i-1]); if(i==3){ printf("\n"); break; } printf(" "); } for(i=1;i<=3;i++){ printf("%d",bout[i-1]); if(i==3){ printf("\n"); break; } printf(" "); } for(i=1;i<=3;i++){ printf("%d",cout[i-1]); if(i==3){ printf("\n"); break; } printf(" "); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261183/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261183/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ain = alloca [10 x i32], align 16 %bin = alloca [10 x i32], align 16 %cin = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %ain) #4 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %bin) #4 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %cin) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ain) %arrayidx.1 = getelementptr inbounds [10 x i32], ptr %ain, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [10 x i32], ptr %ain, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [10 x i32], ptr %ain, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [10 x i32], ptr %ain, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [10 x i32], ptr %ain, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %bin) %arrayidx6.1 = getelementptr inbounds [10 x i32], ptr %bin, i64 0, i64 1 %call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1) %arrayidx6.2 = getelementptr inbounds [10 x i32], ptr %bin, i64 0, i64 2 %call7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2) %arrayidx6.3 = getelementptr inbounds [10 x i32], ptr %bin, i64 0, i64 3 %call7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.3) %arrayidx6.4 = getelementptr inbounds [10 x i32], ptr %bin, i64 0, i64 4 %call7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.4) %arrayidx6.5 = getelementptr inbounds [10 x i32], ptr %bin, i64 0, i64 5 %call7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.5) %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cin) %arrayidx16.1 = getelementptr inbounds [10 x i32], ptr %cin, i64 0, i64 1 %call17.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.1) %arrayidx16.2 = getelementptr inbounds [10 x i32], ptr %cin, i64 0, i64 2 %call17.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.2) %arrayidx16.3 = getelementptr inbounds [10 x i32], ptr %cin, i64 0, i64 3 %call17.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.3) %arrayidx16.4 = getelementptr inbounds [10 x i32], ptr %cin, i64 0, i64 4 %call17.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.4) %arrayidx16.5 = getelementptr inbounds [10 x i32], ptr %cin, i64 0, i64 5 %call17.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.5) %0 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %2 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %5 = load i32, ptr %ain, align 16, !tbaa !5 %6 = load i32, ptr %arrayidx6.5, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5 %sub61 = sub nsw i32 %6, %7 %cmp62 = icmp slt i32 %sub61, 0 %8 = load i32, ptr %arrayidx6.4, align 16, !tbaa !5 %9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %sub70 = sub nsw i32 %8, %9 %cmp71 = icmp slt i32 %sub70, 0 %add73 = add nsw i32 %sub70, 60 %sub70.lobit = lshr i32 %sub70, 31 %n.6 = select i1 %cmp71, i32 %add73, i32 %sub70 br i1 %cmp62, label %if.then77, label %if.end84 if.then77: ; preds = %entry %cmp78 = icmp eq i32 %n.6, 0 br i1 %cmp78, label %if.then79, label %if.else81 if.then79: ; preds = %if.then77 %inc80 = add nuw nsw i32 %sub70.lobit, 1 br label %if.end84 if.else81: ; preds = %if.then77 %sub82 = add nsw i32 %n.6, -1 br label %if.end84 if.end84: ; preds = %if.then79, %if.else81, %entry %k.2 = phi i32 [ %inc80, %if.then79 ], [ %sub70.lobit, %if.else81 ], [ %sub70.lobit, %entry ] %n.7 = phi i32 [ 59, %if.then79 ], [ %sub82, %if.else81 ], [ %n.6, %entry ] %10 = load i32, ptr %arrayidx6.3, align 4, !tbaa !5 %11 = load i32, ptr %bin, align 16, !tbaa !5 %12 = load i32, ptr %arrayidx16.5, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx16.2, align 8, !tbaa !5 %sub104 = sub nsw i32 %12, %13 %cmp105 = icmp slt i32 %sub104, 0 %add107 = add nsw i32 %sub104, 60 %14 = load i32, ptr %arrayidx16.4, align 16, !tbaa !5 %15 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %sub113 = sub nsw i32 %14, %15 %cmp114 = icmp slt i32 %sub113, 0 %add116 = add nsw i32 %sub113, 60 %sub113.lobit = lshr i32 %sub113, 31 %n.11 = select i1 %cmp114, i32 %add116, i32 %sub113 br i1 %cmp105, label %if.then120, label %if.end127 if.then120: ; preds = %if.end84 %cmp121 = icmp eq i32 %n.11, 0 br i1 %cmp121, label %if.then122, label %if.else124 if.then122: ; preds = %if.then120 %inc123 = add nuw nsw i32 %sub113.lobit, 1 br label %if.end127 if.else124: ; preds = %if.then120 %sub125 = add nsw i32 %n.11, -1 br label %if.end127 if.end127: ; preds = %if.then122, %if.else124, %if.end84 %spec.select268 = phi i32 [ %add107, %if.then122 ], [ %add107, %if.else124 ], [ %sub104, %if.end84 ] %k.4 = phi i32 [ %inc123, %if.then122 ], [ %sub113.lobit, %if.else124 ], [ %sub113.lobit, %if.end84 ] %n.12 = phi i32 [ 59, %if.then122 ], [ %sub125, %if.else124 ], [ %n.11, %if.end84 ] %cmp93 = icmp eq i32 %k.2, 1 %sub88 = sub nsw i32 %10, %11 %cmp89 = icmp slt i32 %sub88, 0 %add91 = add nsw i32 %sub88, 60 %spec.select267 = select i1 %cmp89, i32 %add91, i32 %sub88 %cmp95 = icmp eq i32 %spec.select267, 0 %sub98 = add nsw i32 %spec.select267, -1 %spec.select272 = select i1 %cmp95, i32 23, i32 %sub98 %n.9 = select i1 %cmp93, i32 %spec.select272, i32 %spec.select267 %add64 = add nsw i32 %sub61, 60 %spec.select266 = select i1 %cmp62, i32 %add64, i32 %sub61 %sub29 = sub nsw i32 %2, %3 %cmp30 = icmp slt i32 %sub29, 0 %sub45 = sub nsw i32 %4, %5 %cmp46 = icmp slt i32 %sub45, 0 %add48 = add nsw i32 %sub45, 60 %spec.select265 = select i1 %cmp46, i32 %add48, i32 %sub45 %cmp52 = icmp eq i32 %spec.select265, 0 %sub55 = add nsw i32 %spec.select265, -1 %spec.select271 = select i1 %cmp52, i32 23, i32 %sub55 %n.4 = select i1 %cmp30, i32 %spec.select271, i32 %spec.select265 %sub23 = sub nsw i32 %0, %1 %cmp24 = icmp slt i32 %sub23, 0 %add32 = add nsw i32 %sub29, 60 %n.1 = select i1 %cmp30, i32 %add32, i32 %sub29 %cmp37 = icmp eq i32 %n.1, 0 %sub39 = add nsw i32 %n.1, -1 %spec.select270 = select i1 %cmp37, i32 59, i32 %sub39 %n.2 = select i1 %cmp24, i32 %spec.select270, i32 %n.1 %add = add nsw i32 %sub23, 60 %spec.select = select i1 %cmp24, i32 %add, i32 %sub23 %16 = load i32, ptr %arrayidx16.3, align 4, !tbaa !5 %17 = load i32, ptr %cin, align 16, !tbaa !5 %sub131 = sub nsw i32 %16, %17 %cmp132 = icmp slt i32 %sub131, 0 %add134 = add nsw i32 %sub131, 60 %spec.select269 = select i1 %cmp132, i32 %add134, i32 %sub131 %cmp136 = icmp eq i32 %k.4, 1 %cmp138 = icmp eq i32 %spec.select269, 0 %sub141 = add nsw i32 %spec.select269, -1 %spec.select273 = select i1 %cmp138, i32 23, i32 %sub141 %n.14 = select i1 %cmp136, i32 %spec.select273, i32 %spec.select269 %call151277 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.4) %putchar = call i32 @putchar(i32 32) %call151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.2) %putchar.1 = call i32 @putchar(i32 32) %call151.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select) %putchar260 = call i32 @putchar(i32 10) %call166279 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.9) %putchar261 = call i32 @putchar(i32 32) %call166 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.7) %putchar261.1 = call i32 @putchar(i32 32) %call166.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select266) %putchar262 = call i32 @putchar(i32 10) %call181281 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.14) %putchar263 = call i32 @putchar(i32 32) %call181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %n.12) %putchar263.1 = call i32 @putchar(i32 32) %call181.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select268) %putchar264 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %cin) #4 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %bin) #4 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %ain) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int p[3][3][2], t[3], i, j, k; for(i = 0; i < 3; i++){ for(k = 0; k < 2; k++){ for(j = 0; j < 3; j++){ scanf("%d", &p[i][j][k]); } } t[i] = (p[i][0][1] * 60 * 60 + p[i][1][1] * 60 + p[i][2][1]) - (p[i][0][0] * 60 * 60 + p[i][1][0] * 60 + p[i][2][0]); } for(i = 0; i < 3; i++){ printf("%d ", t[i] / 3600); t[i] %= 3600; printf("%d ", t[i] / 60); t[i] %= 60; printf("%d\n", t[i]); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261226/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261226/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca [3 x [3 x [2 x i32]]], align 16 call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %p) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p) %arrayidx10.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 0, i64 1, i64 0 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1) %arrayidx10.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 0, i64 2, i64 0 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2) %arrayidx10.1103 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 0, i64 0, i64 1 %call.1104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1103) %arrayidx10.1.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 0, i64 1, i64 1 %call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1.1) %arrayidx10.2.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 0, i64 2, i64 1 %call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2.1) %0 = load i32, ptr %arrayidx10.1103, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx10.1.1, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx10.2.1, align 4, !tbaa !5 %3 = load i32, ptr %p, align 16, !tbaa !5 %4 = load i32, ptr %arrayidx10.1, align 8, !tbaa !5 %5 = load i32, ptr %arrayidx10.2, align 16, !tbaa !5 %reass.add = sub i32 %1, %4 %reass.mul = mul i32 %reass.add, 60 %reass.add95 = sub i32 %0, %3 %reass.mul96 = mul i32 %reass.add95, 3600 %add = sub i32 %2, %5 %add28 = add i32 %add, %reass.mul96 %sub = add i32 %add28, %reass.mul %arrayidx10.1106 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 0, i64 0 %call.1107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1106) %arrayidx10.1.1108 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 1, i64 0 %call.1.1109 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1.1108) %arrayidx10.2.1110 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 2, i64 0 %call.2.1111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2.1110) %arrayidx10.1103.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 0, i64 1 %call.1104.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1103.1) %arrayidx10.1.1.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 1, i64 1 %call.1.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1.1.1) %arrayidx10.2.1.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 2, i64 1 %call.2.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2.1.1) %arrayidx17.1 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 1, i64 0, i64 1 %6 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx10.1.1.1, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx10.2.1.1, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx10.1106, align 8, !tbaa !5 %10 = load i32, ptr %arrayidx10.1.1108, align 16, !tbaa !5 %11 = load i32, ptr %arrayidx10.2.1110, align 8, !tbaa !5 %reass.add.1 = sub i32 %7, %10 %reass.mul.1 = mul i32 %reass.add.1, 60 %reass.add95.1 = sub i32 %6, %9 %reass.mul96.1 = mul i32 %reass.add95.1, 3600 %add.1 = sub i32 %8, %11 %add28.1 = add i32 %add.1, %reass.mul96.1 %sub.1 = add i32 %add28.1, %reass.mul.1 %arrayidx10.2113 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 0, i64 0 %call.2114 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2113) %arrayidx10.1.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 1, i64 0 %call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1.2) %arrayidx10.2.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 2, i64 0 %call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2.2) %arrayidx10.1103.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 0, i64 1 %call.1104.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1103.2) %arrayidx10.1.1.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 1, i64 1 %call.1.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.1.1.2) %arrayidx10.2.1.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 2, i64 1 %call.2.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10.2.1.2) %arrayidx17.2 = getelementptr inbounds [3 x [3 x [2 x i32]]], ptr %p, i64 0, i64 2, i64 0, i64 1 %12 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx10.1.1.2, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx10.2.1.2, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx10.2113, align 16, !tbaa !5 %16 = load i32, ptr %arrayidx10.1.2, align 8, !tbaa !5 %17 = load i32, ptr %arrayidx10.2.2, align 16, !tbaa !5 %reass.add.2 = sub i32 %13, %16 %reass.mul.2 = mul i32 %reass.add.2, 60 %reass.add95.2 = sub i32 %12, %15 %reass.mul96.2 = mul i32 %reass.add95.2, 3600 %add.2 = sub i32 %14, %17 %add28.2 = add i32 %add.2, %reass.mul96.2 %sub.2 = add i32 %add28.2, %reass.mul.2 %div = sdiv i32 %sub, 3600 %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) %rem = srem i32 %sub, 3600 %div61.lhs.trunc = trunc i32 %rem to i16 %div6192 = sdiv i16 %div61.lhs.trunc, 60 %div61.sext = sext i16 %div6192 to i32 %call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div61.sext) %rem6593 = srem i16 %div61.lhs.trunc, 60 %rem65.sext = sext i16 %rem6593 to i32 %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem65.sext) %div.1 = sdiv i32 %sub.1, 3600 %call56.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.1) %rem.1 = srem i32 %sub.1, 3600 %div61.lhs.trunc.1 = trunc i32 %rem.1 to i16 %div6192.1 = sdiv i16 %div61.lhs.trunc.1, 60 %div61.sext.1 = sext i16 %div6192.1 to i32 %call62.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div61.sext.1) %rem6593.1 = srem i16 %div61.lhs.trunc.1, 60 %rem65.sext.1 = sext i16 %rem6593.1 to i32 %call68.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem65.sext.1) %div.2 = sdiv i32 %sub.2, 3600 %call56.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.2) %rem.2 = srem i32 %sub.2, 3600 %div61.lhs.trunc.2 = trunc i32 %rem.2 to i16 %div6192.2 = sdiv i16 %div61.lhs.trunc.2, 60 %div61.sext.2 = sext i16 %div6192.2 to i32 %call62.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div61.sext.2) %rem6593.2 = srem i16 %div61.lhs.trunc.2, 60 %rem65.sext.2 = sext i16 %rem6593.2 to i32 %call68.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem65.sext.2) call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %p) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @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> long long int a[200004],b[200005]; int main() { long long int t,suma=0,i,j,sumb=0,x,flag,k,num; scanf("%lld",&t); i=0; j=0; while(t--) { scanf("%lld",&num); if(num>0) { a[i++]=num; suma=suma+num; x=1; } else { b[j++]=(-num); sumb=sumb-num; x=2; } } if(suma>sumb) printf("first\n"); else if(sumb>suma) printf("second\n"); else { flag=0; if(i>j) { for(k=0;k<j;k++) { if(a[k]>b[k]) { printf("first\n"); flag=1; break; } else if(a[k]<b[k]) { printf("second\n"); flag=1; break; } } } else if(i<=j) { for(k=0;k<j;k++) { if(a[k]>b[k]) { printf("first\n"); flag=1; break; } else if(a[k]<b[k]) { printf("second\n"); flag=1; break; } } } if(flag==0) { if(x==1) printf("first\n"); else printf("second\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26127/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26127/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local local_unnamed_addr global [200004 x i64] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [200005 x i64] zeroinitializer, align 16 @str.8 = private unnamed_addr constant [7 x i8] c"second\00", align 1 @str.9 = private unnamed_addr constant [6 x i8] c"first\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %num = 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 %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec98 = add nsw i64 %0, -1 store i64 %dec98, ptr %t, align 8, !tbaa !5 %tobool.not99 = icmp eq i64 %0, 0 br i1 %tobool.not99, label %if.end64, label %while.body while.body: ; preds = %entry, %if.end %sumb.0103 = phi i64 [ %sumb.1, %if.end ], [ 0, %entry ] %j.0102 = phi i64 [ %j.1, %if.end ], [ 0, %entry ] %i.0101 = phi i64 [ %i.1, %if.end ], [ 0, %entry ] %suma.0100 = phi i64 [ %suma.1, %if.end ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %1 = load i64, ptr %num, align 8, !tbaa !5 %cmp = icmp sgt i64 %1, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %inc = add nsw i64 %i.0101, 1 %arrayidx = getelementptr inbounds [200004 x i64], ptr @a, i64 0, i64 %i.0101 store i64 %1, ptr %arrayidx, align 8, !tbaa !5 %add = add nsw i64 %1, %suma.0100 br label %if.end if.else: ; preds = %while.body %sub = sub nsw i64 0, %1 %inc2 = add nsw i64 %j.0102, 1 %arrayidx3 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %j.0102 store i64 %sub, ptr %arrayidx3, align 8, !tbaa !5 %sub4 = sub nsw i64 %sumb.0103, %1 br label %if.end if.end: ; preds = %if.else, %if.then %suma.1 = phi i64 [ %add, %if.then ], [ %suma.0100, %if.else ] %i.1 = phi i64 [ %inc, %if.then ], [ %i.0101, %if.else ] %j.1 = phi i64 [ %j.0102, %if.then ], [ %inc2, %if.else ] %sumb.1 = phi i64 [ %sumb.0103, %if.then ], [ %sub4, %if.else ] %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.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end %cmp5 = icmp sgt i64 %suma.1, %sumb.1 br i1 %cmp5, label %if.end64, label %if.else8 if.else8: ; preds = %while.end %cmp9 = icmp sgt i64 %sumb.1, %suma.1 br i1 %cmp9, label %if.end64, label %if.else12 if.else12: ; preds = %if.else8 %cmp13 = icmp sgt i64 %i.1, %j.1 %cmp15110 = icmp sgt i64 %j.1, 0 br i1 %cmp13, label %for.cond.preheader, label %for.cond33.preheader for.cond33.preheader: ; preds = %if.else12 br i1 %cmp15110, label %for.body35, label %if.then55 for.cond.preheader: ; preds = %if.else12 br i1 %cmp15110, label %for.body, label %if.then55 for.cond: ; preds = %if.else21 %inc29 = add nuw nsw i64 %k.0111, 1 %exitcond113.not = icmp eq i64 %inc29, %j.1 br i1 %exitcond113.not, label %if.then55, label %for.body, !llvm.loop !11 for.body: ; preds = %for.cond.preheader, %for.cond %k.0111 = phi i64 [ %inc29, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx16 = getelementptr inbounds [200004 x i64], ptr @a, i64 0, i64 %k.0111 %3 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %arrayidx17 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %k.0111 %4 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %cmp18 = icmp sgt i64 %3, %4 br i1 %cmp18, label %if.end64, label %if.else21 if.else21: ; preds = %for.body %cmp24 = icmp slt i64 %3, %4 br i1 %cmp24, label %if.end64, label %for.cond for.cond33: ; preds = %if.else41 %inc50 = add nuw nsw i64 %k.1109, 1 %exitcond.not = icmp eq i64 %inc50, %j.1 br i1 %exitcond.not, label %if.then55, label %for.body35, !llvm.loop !12 for.body35: ; preds = %for.cond33.preheader, %for.cond33 %k.1109 = phi i64 [ %inc50, %for.cond33 ], [ 0, %for.cond33.preheader ] %arrayidx36 = getelementptr inbounds [200004 x i64], ptr @a, i64 0, i64 %k.1109 %5 = load i64, ptr %arrayidx36, align 8, !tbaa !5 %arrayidx37 = getelementptr inbounds [200005 x i64], ptr @b, i64 0, i64 %k.1109 %6 = load i64, ptr %arrayidx37, align 8, !tbaa !5 %cmp38 = icmp sgt i64 %5, %6 br i1 %cmp38, label %if.end64, label %if.else41 if.else41: ; preds = %for.body35 %cmp44 = icmp slt i64 %5, %6 br i1 %cmp44, label %if.end64, label %for.cond33 if.then55: ; preds = %for.cond33, %for.cond, %for.cond33.preheader, %for.cond.preheader %spec.select = select i1 %cmp, ptr @str.9, ptr @str.8 br label %if.end64 if.end64: ; preds = %if.else41, %for.body35, %if.else21, %for.body, %if.then55, %entry, %if.else8, %while.end %str.5.sink = phi ptr [ @str.9, %while.end ], [ @str.8, %if.else8 ], [ @str.9, %entry ], [ %spec.select, %if.then55 ], [ @str.9, %for.body ], [ @str.8, %if.else21 ], [ @str.9, %for.body35 ], [ @str.8, %if.else41 ] %puts92 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #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: 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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#pragma GCC target("arch=cascadelake") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <inttypes.h> #include <stdint.h> #include <stdio.h> int32_t n; int32_t a[200000]; int32_t b[200000]; int main(void) { scanf("%" SCNd32, &n); for (int32_t i = 0; i < n; ++i) { scanf("%" SCNd32, &a[i]); b[i] = a[i] + n - i - 1; } int64_t cnt = 0; for (int32_t i = 0; i < n; ++i) { int32_t c = n - i - 1 - a[i]; for (int32_t j = i + 1; j < n; ++j) { if (b[j] == c) { ++cnt; } } } printf("%" PRId64 "\n", cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261312/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261312/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @a = dso_local global [200000 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [200000 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %for.cond.cleanup10 for.cond8.preheader: ; preds = %for.body %cmp951 = icmp sgt i32 %3, 0 br i1 %cmp951, label %for.body11.preheader, label %for.cond.cleanup10 for.body11.preheader: ; preds = %for.cond8.preheader %1 = zext i32 %3 to i64 %wide.trip.count65 = zext i32 %3 to i64 br label %for.body11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %indvars56 = trunc i64 %indvars.iv to i32 %arrayidx = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = xor i32 %indvars56, -1 %add = add i32 %2, %4 %sub4 = add i32 %add, %3 %arrayidx6 = getelementptr inbounds [200000 x i32], ptr @b, i64 0, i64 %indvars.iv store i32 %sub4, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !9 for.cond8.loopexit: ; preds = %for.body21, %middle.block, %for.body11 %cnt.1.lcssa = phi i64 [ %cnt.052, %for.body11 ], [ %20, %middle.block ], [ %spec.select, %for.body21 ] %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65 br i1 %exitcond66.not, label %for.cond.cleanup10, label %for.body11, !llvm.loop !11 for.cond.cleanup10: ; preds = %for.cond8.loopexit, %entry, %for.cond8.preheader %cnt.0.lcssa = phi i64 [ 0, %for.cond8.preheader ], [ 0, %entry ], [ %cnt.1.lcssa, %for.cond8.loopexit ] %call32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cnt.0.lcssa) ret i32 0 for.body11: ; preds = %for.body11.preheader, %for.cond8.loopexit %indvars.iv62 = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next63, %for.cond8.loopexit ] %indvars.iv57 = phi i64 [ 1, %for.body11.preheader ], [ %indvars.iv.next58, %for.cond8.loopexit ] %cnt.052 = phi i64 [ 0, %for.body11.preheader ], [ %cnt.1.lcssa, %for.cond8.loopexit ] %6 = xor i64 %indvars.iv62, -1 %7 = add nsw i64 %6, %wide.trip.count65 %indvars64 = trunc i64 %indvars.iv62 to i32 %8 = xor i32 %indvars64, -1 %sub13 = add i32 %3, %8 %arrayidx15 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv62 %9 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %sub16 = sub i32 %sub13, %9 %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %cmp1947 = icmp ult i64 %indvars.iv.next63, %1 br i1 %cmp1947, label %for.body21.preheader, label %for.cond8.loopexit for.body21.preheader: ; preds = %for.body11 %min.iters.check = icmp ult i64 %7, 4 br i1 %min.iters.check, label %for.body21.preheader71, label %vector.ph vector.ph: ; preds = %for.body21.preheader %n.vec = and i64 %7, -4 %ind.end = add i64 %indvars.iv57, %n.vec %10 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %cnt.052, i64 0 %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %sub16, i64 0 %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %10, %vector.ph ], [ %17, %vector.body ] %vec.phi69 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ] %offset.idx = add i64 %indvars.iv57, %index %11 = getelementptr inbounds [200000 x i32], ptr @b, i64 0, i64 %offset.idx %wide.load = load <2 x i32>, ptr %11, align 4, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 2 %wide.load70 = load <2 x i32>, ptr %12, align 4, !tbaa !5 %13 = icmp eq <2 x i32> %wide.load, %broadcast.splat %14 = icmp eq <2 x i32> %wide.load70, %broadcast.splat %15 = zext <2 x i1> %13 to <2 x i64> %16 = zext <2 x i1> %14 to <2 x i64> %17 = add <2 x i64> %vec.phi, %15 %18 = add <2 x i64> %vec.phi69, %16 %index.next = add nuw i64 %index, 4 %19 = icmp eq i64 %index.next, %n.vec br i1 %19, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %18, %17 %20 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %for.cond8.loopexit, label %for.body21.preheader71 for.body21.preheader71: ; preds = %for.body21.preheader, %middle.block %indvars.iv59.ph = phi i64 [ %indvars.iv57, %for.body21.preheader ], [ %ind.end, %middle.block ] %cnt.148.ph = phi i64 [ %cnt.052, %for.body21.preheader ], [ %20, %middle.block ] br label %for.body21 for.body21: ; preds = %for.body21.preheader71, %for.body21 %indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.body21 ], [ %indvars.iv59.ph, %for.body21.preheader71 ] %cnt.148 = phi i64 [ %spec.select, %for.body21 ], [ %cnt.148.ph, %for.body21.preheader71 ] %arrayidx23 = getelementptr inbounds [200000 x i32], ptr @b, i64 0, i64 %indvars.iv59 %21 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp eq i32 %21, %sub16 %inc25 = zext i1 %cmp24 to i64 %spec.select = add nsw i64 %cnt.148, %inc25 %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count65 br i1 %exitcond.not, label %for.cond8.loopexit, label %for.body21, !llvm.loop !15 } ; 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.vector.reduce.add.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 = 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}
#include <stdio.h> int main(void){ int N, i, ans = 0; int l[100000]; int r[100000]; scanf("%d", &N); for(i = 0; i < N; i++){ scanf("%d %d", &l[i], &r[i]); //printf("%d\n %d\n", l[i], r[i]); ans = ans + (r[i] - l[i] + 1); } printf("%d\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261363/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261363/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %l = alloca [100000 x i32], align 16 %r = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %ans.018 = phi i32 [ %add8, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %l, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100000 x i32], ptr %r, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %sub = add i32 %ans.018, 1 %add = add i32 %sub, %1 %add8 = sub i32 %add, %2 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add8, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %l) #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 num; int l, r; int roop; int i; scanf("%d", &roop); // printf("num:%d \n",roop); num = 0; for (i = 1; i <= roop; i++) { scanf("%d %d", &l, &r); num += r - l + 1; } printf("%d",num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261406/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261406/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %l = alloca i32, align 4 %r = alloca i32, align 4 %roop = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %roop) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %roop) %0 = load i32, ptr %roop, align 4, !tbaa !5 %cmp.not6 = icmp slt i32 %0, 1 br i1 %cmp.not6, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %i.08 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %num.07 = phi i32 [ %add2, %for.body ], [ 0, %entry ] %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 = add i32 %num.07, 1 %add = add i32 %sub, %1 %add2 = sub i32 %add, %2 %inc = add nuw nsw i32 %i.08, 1 %3 = load i32, ptr %roop, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.08, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %num.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %roop) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> typedef long long int ll; void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;} ll asc(const void *a,const void *b){return *(ll*)a-*(ll*)b;} ll desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;} ll max(ll x,ll y){return x>y?x:y;} ll min(ll x,ll y){return x>y?y:x;} int main(){ int n,l[2000],r[2000]; int flg[100000]; for(int i=0;i<100000;i++)flg[i]=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d %d",&l[i],&r[i]); for(int j=l[i]-1;j<r[i];j++)flg[j]=1; } int cnt=0; for(int i=0;i<100000;i++)if(flg[i])cnt++; printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261457/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261457/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 { entry: %0 = load i64, ptr %x, align 8, !tbaa !5 %1 = load i64, ptr %y, align 8, !tbaa !5 store i64 %1, ptr %x, align 8, !tbaa !5 store i64 %0, ptr %y, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i32, align 4 %l = alloca [2000 x i32], align 16 %r = alloca [2000 x i32], align 16 %flg = alloca [100000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %l) #8 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %r) #8 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %flg) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %flg, i8 0, i64 400000, i1 false), !tbaa !9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !9 %cmp354 = icmp sgt i32 %0, 0 br i1 %cmp354, label %for.body5, label %vector.body71.preheader vector.body71.preheader: ; preds = %for.cond.cleanup17, %entry br label %vector.body71 vector.body71: ; preds = %vector.body71, %vector.body71.preheader %index72 = phi i64 [ 0, %vector.body71.preheader ], [ %index.next75.1, %vector.body71 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.body71.preheader ], [ %15, %vector.body71 ] %vec.phi73 = phi <4 x i32> [ zeroinitializer, %vector.body71.preheader ], [ %16, %vector.body71 ] %1 = getelementptr inbounds [100000 x i32], ptr %flg, i64 0, i64 %index72 %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !9 %2 = getelementptr inbounds i32, ptr %1, i64 4 %wide.load74 = load <4 x i32>, ptr %2, align 16, !tbaa !9 %3 = icmp ne <4 x i32> %wide.load, zeroinitializer %4 = icmp ne <4 x i32> %wide.load74, zeroinitializer %5 = zext <4 x i1> %3 to <4 x i32> %6 = zext <4 x i1> %4 to <4 x i32> %7 = add <4 x i32> %vec.phi, %5 %8 = add <4 x i32> %vec.phi73, %6 %index.next75 = or i64 %index72, 8 %9 = getelementptr inbounds [100000 x i32], ptr %flg, i64 0, i64 %index.next75 %wide.load.1 = load <4 x i32>, ptr %9, align 16, !tbaa !9 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load74.1 = load <4 x i32>, ptr %10, align 16, !tbaa !9 %11 = icmp ne <4 x i32> %wide.load.1, zeroinitializer %12 = icmp ne <4 x i32> %wide.load74.1, zeroinitializer %13 = zext <4 x i1> %11 to <4 x i32> %14 = zext <4 x i1> %12 to <4 x i32> %15 = add <4 x i32> %7, %13 %16 = add <4 x i32> %8, %14 %index.next75.1 = add nuw nsw i64 %index72, 16 %17 = icmp eq i64 %index.next75.1, 100000 br i1 %17, label %middle.block67, label %vector.body71, !llvm.loop !11 middle.block67: ; preds = %vector.body71 %bin.rdx = add <4 x i32> %16, %15 %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18) call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %flg) #8 call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %r) #8 call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %l) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 for.body5: ; preds = %entry, %for.cond.cleanup17 %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.cond.cleanup17 ], [ 0, %entry ] %arrayidx7 = getelementptr inbounds [2000 x i32], ptr %l, i64 0, i64 %indvars.iv60 %arrayidx9 = getelementptr inbounds [2000 x i32], ptr %r, i64 0, i64 %indvars.iv60 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9) %19 = load i32, ptr %arrayidx7, align 4, !tbaa !9 %20 = load i32, ptr %arrayidx9, align 4, !tbaa !9 %cmp1652.not = icmp sgt i32 %19, %20 br i1 %cmp1652.not, label %for.cond.cleanup17, label %for.body18.preheader for.body18.preheader: ; preds = %for.body5 %sub = add i32 %19, -1 %21 = sext i32 %sub to i64 %22 = sub i32 %20, %19 %23 = zext i32 %22 to i64 %24 = add nuw nsw i64 %23, 1 %min.iters.check = icmp ult i32 %22, 7 br i1 %min.iters.check, label %for.body18.preheader77, label %vector.ph vector.ph: ; preds = %for.body18.preheader %n.vec = and i64 %24, 8589934584 %ind.end = add nsw i64 %n.vec, %21 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, %21 %25 = getelementptr inbounds [100000 x i32], ptr %flg, i64 0, i64 %offset.idx store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %25, align 4, !tbaa !9 %26 = getelementptr inbounds i32, ptr %25, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %26, align 4, !tbaa !9 %index.next = add nuw i64 %index, 8 %27 = icmp eq i64 %index.next, %n.vec br i1 %27, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %24, %n.vec br i1 %cmp.n, label %for.cond.cleanup17, label %for.body18.preheader77 for.body18.preheader77: ; preds = %for.body18.preheader, %middle.block %indvars.iv.ph = phi i64 [ %21, %for.body18.preheader ], [ %ind.end, %middle.block ] br label %for.body18 for.cond.cleanup17: ; preds = %for.body18, %middle.block, %for.body5 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %28 = load i32, ptr %n, align 4, !tbaa !9 %29 = sext i32 %28 to i64 %cmp3 = icmp slt i64 %indvars.iv.next61, %29 br i1 %cmp3, label %for.body5, label %vector.body71.preheader, !llvm.loop !16 for.body18: ; preds = %for.body18.preheader77, %for.body18 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body18 ], [ %indvars.iv.ph, %for.body18.preheader77 ] %arrayidx20 = getelementptr inbounds [100000 x i32], ptr %flg, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx20, align 4, !tbaa !9 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %20, %lftr.wideiv br i1 %exitcond.not, label %for.cond.cleanup17, label %for.body18, !llvm.loop !17 } ; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 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 = { 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 #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12, !13, !14} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12, !14, !13}
#include<stdio.h> int main() { long long t,n,max,c=0,d; scanf("%I64d",&t); while(t) { n=t; max=n%10; n=n/10; while(n) { d=n%10; if(d>max) max=d; n=n/10; } t=t-max; c++; } printf("%I64d",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26150/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26150/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %.pr = load i64, ptr %t, align 8, !tbaa !5 %tobool.not19 = icmp eq i64 %.pr, 0 br i1 %tobool.not19, label %while.end6, label %while.body while.body: ; preds = %entry, %while.end %c.020 = phi i64 [ %inc, %while.end ], [ 0, %entry ] %0 = phi i64 [ %sub, %while.end ], [ %.pr, %entry ] %rem = srem i64 %0, 10 %n.0.in.off15 = add i64 %0, 9 %tobool2.not16 = icmp ult i64 %n.0.in.off15, 19 br i1 %tobool2.not16, label %while.end, label %while.body3 while.body3: ; preds = %while.body, %while.body3 %n.0.in18 = phi i64 [ %n.0, %while.body3 ], [ %0, %while.body ] %max.017 = phi i64 [ %spec.select, %while.body3 ], [ %rem, %while.body ] %n.0 = sdiv i64 %n.0.in18, 10 %rem4 = srem i64 %n.0, 10 %spec.select = call i64 @llvm.smax.i64(i64 %rem4, i64 %max.017) %n.0.in.off = add nsw i64 %n.0, 9 %tobool2.not = icmp ult i64 %n.0.in.off, 19 br i1 %tobool2.not, label %while.end, label %while.body3, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %max.0.lcssa = phi i64 [ %rem, %while.body ], [ %spec.select, %while.body3 ] %sub = sub nsw i64 %0, %max.0.lcssa %inc = add nuw nsw i64 %c.020, 1 %tobool.not = icmp eq i64 %sub, 0 br i1 %tobool.not, label %while.cond.while.end6_crit_edge, label %while.body, !llvm.loop !11 while.cond.while.end6_crit_edge: ; preds = %while.end store i64 0, ptr %t, align 8, !tbaa !5 br label %while.end6 while.end6: ; preds = %while.cond.while.end6_crit_edge, %entry %c.0.lcssa = phi i64 [ %inc, %while.cond.while.end6_crit_edge ], [ 0, %entry ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %c.0.lcssa) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int N,i,sum_ppl; scanf("%d",&N); for (i=1;i<=N;i++){ int l,r; scanf("%d %d",&l,&r); sum_ppl=sum_ppl+r-l+1; } printf("%d",sum_ppl); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261543/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261543/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not6 = icmp sgt i32 %0, 0 call void @llvm.assume(i1 %cmp.not6) br label %for.body for.body: ; preds = %entry, %for.body %sum_ppl.08 = phi i32 [ %add2, %for.body ], [ undef, %entry ] %i.07 = phi i32 [ %inc, %for.body ], [ 1, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4 %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 %add = add i32 %sum_ppl.08, 1 %sub = add i32 %add, %1 %add2 = sub i32 %sub, %2 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 %inc = add nuw nsw i32 %i.07, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.07, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 willreturn memory(inaccessiblemem: 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"}
#include <stdio.h> #define SIZE 100011 int main(void) { int num, tmp = 0; int l; int r; scanf("%d", &num); for (int i = 0; i < num; i++) { scanf("%d %d", &l, &r); tmp += r - l + 1; } printf("%d", tmp); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261608/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261608/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %l = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %tmp.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %tmp.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #3 ret i32 0 for.body: ; preds = %entry, %for.body %i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %tmp.07 = phi i32 [ %add2, %for.body ], [ 0, %entry ] %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 = add i32 %tmp.07, 1 %add = add i32 %sub, %1 %add2 = sub i32 %add, %2 %inc = add nuw nsw i32 %i.08, 1 %3 = load i32, ptr %num, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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(){ char a[3+1]; char b[3+1]; char c[3+1]; scanf("%s",a); scanf("%s",b); scanf("%s",c); printf("%c%c%c\n",a[0],b[1],c[2]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261651/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261651/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [4 x i8], align 1 %b = alloca [4 x i8], align 1 %c = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx5 = getelementptr inbounds [4 x i8], ptr %b, i64 0, i64 1 %1 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %conv6 = sext i8 %1 to i32 %arrayidx7 = getelementptr inbounds [4 x i8], ptr %c, i64 0, i64 2 %2 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %2 to i32 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv6, i32 noundef %conv8) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include <ctype.h> #include <stdint.h> #include <string.h> #include <wchar.h> #include <math.h> #define N_MAX (100) #define P_MAX (100) #define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define ABS(a) ((a) < 0 ? -(a) : (a)) #define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a)) int compare_sz_asc(const void* a, const void* b) { return *((size_t*)a) < *((size_t*)b) ? -1 : 1; } int compare_sz_desc(const void* a, const void* b) { return *((size_t*)a) > * ((size_t*)b) ? -1 : 1; } int compare_i64_asc(const void* a, const void* b) { return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1; } int compare_i64_desc(const void* a, const void* b) { return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1; } int compare_c_asc(const void* a, const void* b) { return *((char*)a) < *((char*)b) ? -1 : 1; } int compare_c_desc(const void* a, const void* b) { return *((char*)a) > * ((char*)b) ? -1 : 1; } static size_t powSz(const size_t base, const size_t exp) { if (exp == 0) { return 1; } if (exp == 1) { return base; } if (exp % 2 == 0) { return powSz(base * base, exp / 2); } else { return base * powSz(base, exp - 1); } } static size_t comb(const size_t n, const size_t r) { size_t result = 1; for (size_t i = 0; i < r; i++) { result *= n - i; result /= i + 1; } return result; } static uint64_t combU64(const uint64_t n, const uint64_t r) { uint64_t result = 1; for (uint64_t i = 0; i < r; i++) { result *= n - i; result /= i + 1; } return result; } static size_t gcdZu(size_t m, size_t n) { size_t temp; while (m % n != 0) { temp = n; n = m % n; m = temp; } return n; } static uint64_t gcdU64(uint64_t m, uint64_t n) { uint64_t temp; while (m % n != 0) { temp = n; n = m % n; m = temp; } return n; } typedef struct { uint64_t A; uint64_t B; uint64_t val; } _status; static _status status[200000]; typedef struct { uint64_t idx; }BHeap_Val; #define BHEAP_VAL_TYPE BHeap_Val static int _bHeap_Compare(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) { const uint64_t parentVal = status[parent->idx].val; const uint64_t nodeVal = status[node->idx].val; return parentVal >= nodeVal ? -1 : 1; } #define BHEAP_INVALID_NODE ((size_t)100000000) typedef struct { BHEAP_VAL_TYPE val; } BHeap_Node; static struct { size_t size; int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node); } bHeap_Info; static BHeap_Node bHeap_Node[1 << 20]; static void bHeap_Init(int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node)) { bHeap_Info.size = 0; bHeap_Info.compare = compare; } static void bHeap_UpHeap(const size_t nodeIdx) { if (nodeIdx == 0) { return; } const size_t parentIdx = (nodeIdx + 1) / 2 - 1; const int compareResult = bHeap_Info.compare(&(bHeap_Node[parentIdx].val), &(bHeap_Node[nodeIdx].val)); if (0 < compareResult) { const BHEAP_VAL_TYPE tmp = bHeap_Node[parentIdx].val; bHeap_Node[parentIdx].val = bHeap_Node[nodeIdx].val; bHeap_Node[nodeIdx].val = tmp; if (parentIdx != 0) { bHeap_UpHeap(parentIdx); } } } static void bHeap_DownHeap(const size_t nodeIdx) { if (bHeap_Info.size - 1 <= nodeIdx) { return; } const size_t leftIdx = 2 * (nodeIdx + 1) - 1; if (leftIdx < bHeap_Info.size) { const int leftResult = bHeap_Info.compare(&(bHeap_Node[nodeIdx].val), &(bHeap_Node[leftIdx].val)); size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx; const size_t rightIdx = leftIdx + 1; if (rightIdx < bHeap_Info.size) { const int rightResult = bHeap_Info.compare(&(bHeap_Node[nodeIdx].val), &(bHeap_Node[rightIdx].val)); if (swapTarget == BHEAP_INVALID_NODE) { if (0 < rightResult) { swapTarget = rightIdx; } } else { if (0 < rightResult) { const int rightLeftResult = bHeap_Info.compare(&(bHeap_Node[leftIdx].val), &(bHeap_Node[rightIdx].val)); if (0 < rightLeftResult) { swapTarget = rightIdx; } } } } if (swapTarget != BHEAP_INVALID_NODE) { const BHEAP_VAL_TYPE tmp = bHeap_Node[nodeIdx].val; bHeap_Node[nodeIdx].val = bHeap_Node[swapTarget].val; bHeap_Node[swapTarget].val = tmp; bHeap_DownHeap(swapTarget); } } } static void bHeap_Add(const BHEAP_VAL_TYPE val) { bHeap_Node[bHeap_Info.size].val = val; bHeap_Info.size++; bHeap_UpHeap(bHeap_Info.size - 1); } static void bHeap_RemoveTop(void) { if (bHeap_Info.size == 0) { return; } if (bHeap_Info.size == 1) { bHeap_Info.size--; return; } bHeap_Node[0].val = bHeap_Node[bHeap_Info.size - 1].val; bHeap_Info.size--; bHeap_DownHeap(0); } static BHEAP_VAL_TYPE* bHeap_GetTopVal(void) { return bHeap_Info.size == 0 ? NULL : &(bHeap_Node[0].val); } typedef struct { uint64_t cnt; size_t* child; size_t numChild; size_t maxNumChild; } Tree_Node; #define BREE_INIT_ALLOC (128) static Tree_Node tree_Node[200000]; static void tree_Init(const uint64_t N) { for (uint64_t i = 0; i < N; i++) { tree_Node[i].cnt = 0; tree_Node[i].numChild = 0; tree_Node[i].child = malloc(sizeof(size_t) * BREE_INIT_ALLOC); tree_Node[i].maxNumChild = BREE_INIT_ALLOC; } } static void tree_AddChild(const size_t parent, const size_t child) { if (tree_Node[parent].maxNumChild <= tree_Node[parent].numChild) { tree_Node[parent].child = realloc(tree_Node[parent].child, sizeof(size_t) * tree_Node[parent].maxNumChild * 2); tree_Node[parent].maxNumChild *= 2; } tree_Node[parent].child[tree_Node[parent].numChild] = child; tree_Node[parent].numChild++; } int main(void) { char c[3][4]; scanf("%s%s%s", c[0], c[1], c[2]); printf("%c%c%c\n", c[0][0], c[1][1], c[2][2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261695/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261695/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_sz_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ult i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_sz_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp ugt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_i64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_i64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %1 = load i8, ptr %b, align 1, !tbaa !9 %cmp = icmp slt i8 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %1 = load i8, ptr %b, align 1, !tbaa !9 %cmp = icmp sgt i8 %0, %1 %cond = select i1 %cmp, i32 -1, i32 1 ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %c = alloca [3 x [4 x i8]], align 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %c) #4 %arrayidx1 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 1 %arrayidx3 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx3) %0 = load i8, ptr %c, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %arrayidx8 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %conv9 = sext i8 %1 to i32 %arrayidx11 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx11, align 1, !tbaa !9 %conv12 = sext i8 %2 to i32 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv9, i32 noundef %conv12) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> int main(void){ char one[4]; char two[4]; char three[4]; char ans[4] = {'\0'}; scanf("%3s", one); scanf("%3s", two); scanf("%3s", three); ans[0] = one[0]; ans[1] = two[1]; ans[2] = three[2]; printf("%s\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261738/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261738/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%3s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %one = alloca [4 x i8], align 1 %two = alloca [4 x i8], align 1 %three = alloca [4 x i8], align 1 %ans = alloca [4 x i8], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %one) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %two) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %three) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ans) #4 store i32 0, ptr %ans, align 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %one) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %two) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %three) %0 = load i8, ptr %one, align 1, !tbaa !5 store i8 %0, ptr %ans, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [4 x i8], ptr %two, i64 0, i64 1 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %arrayidx7 = getelementptr inbounds [4 x i8], ptr %ans, i64 0, i64 1 store i8 %1, ptr %arrayidx7, align 1, !tbaa !5 %arrayidx8 = getelementptr inbounds [4 x i8], ptr %three, i64 0, i64 2 %2 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %arrayidx9 = getelementptr inbounds [4 x i8], ptr %ans, i64 0, i64 2 store i8 %2, ptr %arrayidx9, align 2, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ans) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %three) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %two) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %one) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main() { char A[3], B[3], C[3]; memset(A, 0, sizeof(A)); memset(B, 0, sizeof(B)); memset(C, 0, sizeof(C)); scanf("%s %s %s", A, B, C); printf("%c%c%c", A[0], B[1], C[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261781/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261781/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [3 x i8], align 1 %B = alloca [3 x i8], align 1 %C = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %C) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %A, i8 0, i64 3, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %B, i8 0, i64 3, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %C, i8 0, i64 3, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C) %0 = load i8, ptr %A, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx6 = getelementptr inbounds [3 x i8], ptr %B, i64 0, i64 1 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %conv7 = sext i8 %1 to i32 %arrayidx8 = getelementptr inbounds [3 x i8], ptr %C, i64 0, i64 2 %2 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %conv9 = sext i8 %2 to i32 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv7, i32 noundef %conv9) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 3, 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: 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char a[10][10]; scanf("%s%s%s",a[0],a[1],a[2]); printf("%c%c%c\n",a[0][0],a[1][1],a[2][2]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261824/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10 x [10 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #3 %arrayidx1 = getelementptr inbounds [10 x [10 x i8]], ptr %a, i64 0, i64 1 %arrayidx3 = getelementptr inbounds [10 x [10 x i8]], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx3) %0 = load i8, ptr %a, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx8 = getelementptr inbounds [10 x [10 x i8]], ptr %a, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %conv9 = sext i8 %1 to i32 %arrayidx11 = getelementptr inbounds [10 x [10 x i8]], ptr %a, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx11, align 2, !tbaa !5 %conv12 = sext i8 %2 to i32 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv9, i32 noundef %conv12) call void @llvm.lifetime.end.p0(i64 100, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void){ char a[3],b[3],c[3]; scanf("%s",a); scanf("%s",b); scanf("%s",c); printf("%c",a[0]); printf("%c",b[1]); printf("%c",c[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261868/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261868/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca [3 x i8], align 1 %b = alloca [3 x i8], align 1 %c = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %c) #4 %call = 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) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %putchar = call i32 @putchar(i32 %conv) %arrayidx6 = getelementptr inbounds [3 x i8], ptr %b, i64 0, i64 1 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %conv7 = sext i8 %1 to i32 %putchar12 = call i32 @putchar(i32 %conv7) %arrayidx9 = getelementptr inbounds [3 x i8], ptr %c, i64 0, i64 2 %2 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %conv10 = sext i8 %2 to i32 %putchar13 = call i32 @putchar(i32 %conv10) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 3, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
// AOJ 0526: Boat Travel // 2017.9.1 bal4u@uu // 2018.1.22 #include <stdio.h> #include <string.h> #define INF 0x10101010 int fee[101][101]; //#define getchar_unlocked() getchar() int in() { int n = 0; int c = getchar_unlocked(); do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } int main() { int n, k, a, b, c, d, e, t; while (n = in()) { k = in(); memset(fee, INF, sizeof(fee)); for (a = 1; a <= n; a++) fee[a][a] = 0; while (k-- > 0) { if (in()) { a = in(), b = in(), e = in(); if (fee[a][b] > e) { fee[a][b] = fee[b][a] = e; for (c = 1; c <= n; c++) for (d = c+1; d <= n; d++) { t = fee[c][a] + e + fee[b][d]; if (t < fee[c][d]) fee[c][d] = fee[d][c] = t; t = fee[c][b] + e + fee[a][d]; if (t < fee[c][d]) fee[c][d] = fee[d][c] = t; } } } else { a = in(), b = in(); if ((e = fee[a][b]) >= INF) e = -1; printf("%d\n", e); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261910/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261910/source.c" target datalayout = "e-m:e-p270: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] } @fee = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: 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) #4 %.pre17.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 ], [ %.pre17.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.exit16 %4 = phi ptr [ %8, %getchar_unlocked.exit16 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add2, %getchar_unlocked.exit16 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i12, %getchar_unlocked.exit16 ], [ %c.0.ph, %do.body.preheader ] %add = mul i32 %n.0, 10 %and = and i32 %c.0, 15 %add2 = add nsw i32 %and, %add %_IO_read_ptr.i7 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %_IO_read_end.i8 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8, align 8, !tbaa !14 %cmp.not.i9 = icmp ult ptr %5, %6 br i1 %cmp.not.i9, label %cond.false.i13, label %cond.true.i10, !prof !15 cond.true.i10: ; preds = %do.body %call.i11 = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16 cond.false.i13: ; preds = %do.body %incdec.ptr.i14 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15 = zext i8 %7 to i32 br label %getchar_unlocked.exit16 getchar_unlocked.exit16: ; preds = %cond.true.i10, %cond.false.i13 %8 = phi ptr [ %.pre, %cond.true.i10 ], [ %4, %cond.false.i13 ] %cond.i12 = phi i32 [ %call.i11, %cond.true.i10 ], [ %conv3.i15, %cond.false.i13 ] %cmp = icmp sgt i32 %cond.i12, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit16 ret i32 %add2 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %.pre380 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.cond while.cond.loopexit: ; preds = %if.end98, %while.cond4.preheader %.pre379386 = phi ptr [ %.pre379, %while.cond4.preheader ], [ %.pre379387, %if.end98 ] %0 = phi ptr [ %20, %while.cond4.preheader ], [ %99, %if.end98 ] br label %while.cond, !llvm.loop !19 while.cond: ; preds = %while.cond.loopexit, %entry %.pre379385 = phi ptr [ %.pre379386, %while.cond.loopexit ], [ %.pre380, %entry ] %1 = phi ptr [ %0, %while.cond.loopexit ], [ %.pre380, %entry ] %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %1, i64 0, i32 1 %2 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %1, i64 0, i32 2 %3 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %2, %3 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %while.cond %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %1) #4 %.pre17.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %while.cond %incdec.ptr.i.i = getelementptr inbounds i8, ptr %2, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %4 = load i8, ptr %2, align 1, !tbaa !16 %conv3.i.i = zext i8 %4 to i32 br label %do.body.i.preheader do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i %.pre379383.ph = phi ptr [ %.pre379385, %cond.false.i.i ], [ %.pre17.pre.i, %cond.true.i.i ] %.ph437 = phi ptr [ %1, %cond.false.i.i ], [ %.pre17.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.exit16.i %.pre379383 = phi ptr [ %.pre379382, %getchar_unlocked.exit16.i ], [ %.pre379383.ph, %do.body.i.preheader ] %5 = phi ptr [ %10, %getchar_unlocked.exit16.i ], [ %.ph437, %do.body.i.preheader ] %6 = phi ptr [ %11, %getchar_unlocked.exit16.i ], [ %.ph437, %do.body.i.preheader ] %n.0.i = phi i32 [ %add2.i, %getchar_unlocked.exit16.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i12.i, %getchar_unlocked.exit16.i ], [ %c.0.i.ph, %do.body.i.preheader ] %add.i = mul i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add2.i = add nsw i32 %and.i, %add.i %_IO_read_ptr.i7.i = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1 %7 = load ptr, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %_IO_read_end.i8.i = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2 %8 = load ptr, ptr %_IO_read_end.i8.i, align 8, !tbaa !14 %cmp.not.i9.i = icmp ult ptr %7, %8 br i1 %cmp.not.i9.i, label %cond.false.i13.i, label %cond.true.i10.i, !prof !15 cond.true.i10.i: ; preds = %do.body.i %call.i11.i = tail call i32 @__uflow(ptr noundef nonnull %6) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i cond.false.i13.i: ; preds = %do.body.i %incdec.ptr.i14.i = getelementptr inbounds i8, ptr %7, i64 1 store ptr %incdec.ptr.i14.i, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %9 = load i8, ptr %7, align 1, !tbaa !16 %conv3.i15.i = zext i8 %9 to i32 br label %getchar_unlocked.exit16.i getchar_unlocked.exit16.i: ; preds = %cond.false.i13.i, %cond.true.i10.i %.pre379382 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %.pre379383, %cond.false.i13.i ] %10 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %5, %cond.false.i13.i ] %11 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %6, %cond.false.i13.i ] %cond.i12.i = phi i32 [ %call.i11.i, %cond.true.i10.i ], [ %conv3.i15.i, %cond.false.i13.i ] %cmp.i = icmp sgt i32 %cond.i12.i, 47 br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17 in.exit: ; preds = %getchar_unlocked.exit16.i %tobool.not = icmp eq i32 %add2.i, 0 br i1 %tobool.not, label %while.end99, label %while.body while.body: ; preds = %in.exit %_IO_read_ptr.i.i142 = getelementptr inbounds %struct._IO_FILE, ptr %11, i64 0, i32 1 %12 = load ptr, ptr %_IO_read_ptr.i.i142, align 8, !tbaa !9 %_IO_read_end.i.i143 = getelementptr inbounds %struct._IO_FILE, ptr %11, i64 0, i32 2 %13 = load ptr, ptr %_IO_read_end.i.i143, align 8, !tbaa !14 %cmp.not.i.i144 = icmp ult ptr %12, %13 br i1 %cmp.not.i.i144, label %cond.false.i.i169, label %cond.true.i.i145, !prof !15 cond.true.i.i145: ; preds = %while.body %call.i.i146 = tail call i32 @__uflow(ptr noundef nonnull %11) #4 %.pre17.pre.i147 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i151.preheader cond.false.i.i169: ; preds = %while.body %incdec.ptr.i.i170 = getelementptr inbounds i8, ptr %12, i64 1 store ptr %incdec.ptr.i.i170, ptr %_IO_read_ptr.i.i142, align 8, !tbaa !9 %14 = load i8, ptr %12, align 1, !tbaa !16 %conv3.i.i171 = zext i8 %14 to i32 br label %do.body.i151.preheader do.body.i151.preheader: ; preds = %cond.false.i.i169, %cond.true.i.i145 %.pre379401.ph = phi ptr [ %.pre379382, %cond.false.i.i169 ], [ %.pre17.pre.i147, %cond.true.i.i145 ] %.ph434 = phi ptr [ %10, %cond.false.i.i169 ], [ %.pre17.pre.i147, %cond.true.i.i145 ] %.ph435 = phi ptr [ %11, %cond.false.i.i169 ], [ %.pre17.pre.i147, %cond.true.i.i145 ] %c.0.i153.ph = phi i32 [ %conv3.i.i171, %cond.false.i.i169 ], [ %call.i.i146, %cond.true.i.i145 ] br label %do.body.i151 do.body.i151: ; preds = %do.body.i151.preheader, %getchar_unlocked.exit16.i163 %.pre379401 = phi ptr [ %.pre379, %getchar_unlocked.exit16.i163 ], [ %.pre379401.ph, %do.body.i151.preheader ] %15 = phi ptr [ %20, %getchar_unlocked.exit16.i163 ], [ %.ph434, %do.body.i151.preheader ] %16 = phi ptr [ %21, %getchar_unlocked.exit16.i163 ], [ %.ph435, %do.body.i151.preheader ] %n.0.i152 = phi i32 [ %add2.i156, %getchar_unlocked.exit16.i163 ], [ 0, %do.body.i151.preheader ] %c.0.i153 = phi i32 [ %cond.i12.i164, %getchar_unlocked.exit16.i163 ], [ %c.0.i153.ph, %do.body.i151.preheader ] %add.i154 = mul i32 %n.0.i152, 10 %and.i155 = and i32 %c.0.i153, 15 %add2.i156 = add nsw i32 %and.i155, %add.i154 %_IO_read_ptr.i7.i157 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 1 %17 = load ptr, ptr %_IO_read_ptr.i7.i157, align 8, !tbaa !9 %_IO_read_end.i8.i158 = getelementptr inbounds %struct._IO_FILE, ptr %16, i64 0, i32 2 %18 = load ptr, ptr %_IO_read_end.i8.i158, align 8, !tbaa !14 %cmp.not.i9.i159 = icmp ult ptr %17, %18 br i1 %cmp.not.i9.i159, label %cond.false.i13.i166, label %cond.true.i10.i160, !prof !15 cond.true.i10.i160: ; preds = %do.body.i151 %call.i11.i161 = tail call i32 @__uflow(ptr noundef nonnull %16) #4 %.pre.i162 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i163 cond.false.i13.i166: ; preds = %do.body.i151 %incdec.ptr.i14.i167 = getelementptr inbounds i8, ptr %17, i64 1 store ptr %incdec.ptr.i14.i167, ptr %_IO_read_ptr.i7.i157, align 8, !tbaa !9 %19 = load i8, ptr %17, align 1, !tbaa !16 %conv3.i15.i168 = zext i8 %19 to i32 br label %getchar_unlocked.exit16.i163 getchar_unlocked.exit16.i163: ; preds = %cond.false.i13.i166, %cond.true.i10.i160 %.pre379 = phi ptr [ %.pre.i162, %cond.true.i10.i160 ], [ %.pre379401, %cond.false.i13.i166 ] %20 = phi ptr [ %.pre.i162, %cond.true.i10.i160 ], [ %15, %cond.false.i13.i166 ] %21 = phi ptr [ %.pre.i162, %cond.true.i10.i160 ], [ %16, %cond.false.i13.i166 ] %cond.i12.i164 = phi i32 [ %call.i11.i161, %cond.true.i10.i160 ], [ %conv3.i15.i168, %cond.false.i13.i166 ] %cmp.i165 = icmp sgt i32 %cond.i12.i164, 47 br i1 %cmp.i165, label %do.body.i151, label %in.exit172, !llvm.loop !17 in.exit172: ; preds = %getchar_unlocked.exit16.i163 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @fee, i8 16, i64 40804, i1 false) %cmp.not359 = icmp slt i32 %add2.i, 1 br i1 %cmp.not359, label %while.cond4.preheader, label %for.body.preheader for.body.preheader: ; preds = %in.exit172 %22 = or i32 %add.i, 1 %23 = and i32 %c.0.i, 15 %24 = add i32 %22, %23 %wide.trip.count = zext i32 %24 to i64 %25 = add nsw i64 %wide.trip.count, -1 %26 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %25, 3 %27 = icmp ult i64 %26, 3 br i1 %27, label %while.cond4.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %25, -4 br label %for.body while.cond4.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond4.preheader, label %for.body.epil for.body.epil: ; preds = %while.cond4.preheader.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %while.cond4.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %while.cond4.preheader.loopexit.unr-lcssa ] %arrayidx3.epil = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv.epil, i64 %indvars.iv.epil store i32 0, ptr %arrayidx3.epil, align 4, !tbaa !20 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %while.cond4.preheader, label %for.body.epil, !llvm.loop !21 while.cond4.preheader: ; preds = %while.cond4.preheader.loopexit.unr-lcssa, %for.body.epil, %in.exit172 %cmp5366 = icmp sgt i32 %add2.i156, 0 br i1 %cmp5366, label %while.body6.lr.ph, label %while.cond.loopexit while.body6.lr.ph: ; preds = %while.cond4.preheader %28 = sext i32 %add2.i to i64 %29 = or i32 %add.i, 1 %30 = and i32 %c.0.i, 15 %31 = add i32 %29, %30 %wide.trip.count377 = zext i32 %31 to i64 br label %while.body6 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx3 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv, i64 %indvars.iv store i32 0, ptr %arrayidx3, align 4, !tbaa !20 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3.1 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next store i32 0, ptr %arrayidx3.1, align 4, !tbaa !20 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx3.2 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv.next.1, i64 %indvars.iv.next.1 store i32 0, ptr %arrayidx3.2, align 4, !tbaa !20 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx3.3 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv.next.2, i64 %indvars.iv.next.2 store i32 0, ptr %arrayidx3.3, align 4, !tbaa !20 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %while.cond4.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !23 while.body6: ; preds = %while.body6.lr.ph, %if.end98 %.pre379400 = phi ptr [ %.pre379, %while.body6.lr.ph ], [ %.pre379387, %if.end98 ] %32 = phi ptr [ %.pre379, %while.body6.lr.ph ], [ %99, %if.end98 ] %33 = phi ptr [ %.pre379, %while.body6.lr.ph ], [ %100, %if.end98 ] %dec367.in = phi i32 [ %add2.i156, %while.body6.lr.ph ], [ %dec367, %if.end98 ] %dec367 = add nsw i32 %dec367.in, -1 %_IO_read_ptr.i.i173 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 1 %34 = load ptr, ptr %_IO_read_ptr.i.i173, align 8, !tbaa !9 %_IO_read_end.i.i174 = getelementptr inbounds %struct._IO_FILE, ptr %33, i64 0, i32 2 %35 = load ptr, ptr %_IO_read_end.i.i174, align 8, !tbaa !14 %cmp.not.i.i175 = icmp ult ptr %34, %35 br i1 %cmp.not.i.i175, label %cond.false.i.i200, label %cond.true.i.i176, !prof !15 cond.true.i.i176: ; preds = %while.body6 %call.i.i177 = tail call i32 @__uflow(ptr noundef nonnull %33) #4 %.pre17.pre.i178 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i182.preheader cond.false.i.i200: ; preds = %while.body6 %incdec.ptr.i.i201 = getelementptr inbounds i8, ptr %34, i64 1 store ptr %incdec.ptr.i.i201, ptr %_IO_read_ptr.i.i173, align 8, !tbaa !9 %36 = load i8, ptr %34, align 1, !tbaa !16 %conv3.i.i202 = zext i8 %36 to i32 br label %do.body.i182.preheader do.body.i182.preheader: ; preds = %cond.false.i.i200, %cond.true.i.i176 %.pre379398.ph = phi ptr [ %.pre379400, %cond.false.i.i200 ], [ %.pre17.pre.i178, %cond.true.i.i176 ] %.ph432 = phi ptr [ %32, %cond.false.i.i200 ], [ %.pre17.pre.i178, %cond.true.i.i176 ] %.ph433 = phi ptr [ %33, %cond.false.i.i200 ], [ %.pre17.pre.i178, %cond.true.i.i176 ] %c.0.i184.ph = phi i32 [ %conv3.i.i202, %cond.false.i.i200 ], [ %call.i.i177, %cond.true.i.i176 ] br label %do.body.i182 do.body.i182: ; preds = %do.body.i182.preheader, %getchar_unlocked.exit16.i194 %.pre379398 = phi ptr [ %.pre379397, %getchar_unlocked.exit16.i194 ], [ %.pre379398.ph, %do.body.i182.preheader ] %37 = phi ptr [ %42, %getchar_unlocked.exit16.i194 ], [ %.ph432, %do.body.i182.preheader ] %38 = phi ptr [ %43, %getchar_unlocked.exit16.i194 ], [ %.ph433, %do.body.i182.preheader ] %n.0.i183 = phi i32 [ %add2.i187, %getchar_unlocked.exit16.i194 ], [ 0, %do.body.i182.preheader ] %c.0.i184 = phi i32 [ %cond.i12.i195, %getchar_unlocked.exit16.i194 ], [ %c.0.i184.ph, %do.body.i182.preheader ] %add.i185 = mul i32 %n.0.i183, 10 %and.i186 = and i32 %c.0.i184, 15 %add2.i187 = add nsw i32 %and.i186, %add.i185 %_IO_read_ptr.i7.i188 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 1 %39 = load ptr, ptr %_IO_read_ptr.i7.i188, align 8, !tbaa !9 %_IO_read_end.i8.i189 = getelementptr inbounds %struct._IO_FILE, ptr %38, i64 0, i32 2 %40 = load ptr, ptr %_IO_read_end.i8.i189, align 8, !tbaa !14 %cmp.not.i9.i190 = icmp ult ptr %39, %40 br i1 %cmp.not.i9.i190, label %cond.false.i13.i197, label %cond.true.i10.i191, !prof !15 cond.true.i10.i191: ; preds = %do.body.i182 %call.i11.i192 = tail call i32 @__uflow(ptr noundef nonnull %38) #4 %.pre.i193 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i194 cond.false.i13.i197: ; preds = %do.body.i182 %incdec.ptr.i14.i198 = getelementptr inbounds i8, ptr %39, i64 1 store ptr %incdec.ptr.i14.i198, ptr %_IO_read_ptr.i7.i188, align 8, !tbaa !9 %41 = load i8, ptr %39, align 1, !tbaa !16 %conv3.i15.i199 = zext i8 %41 to i32 br label %getchar_unlocked.exit16.i194 getchar_unlocked.exit16.i194: ; preds = %cond.false.i13.i197, %cond.true.i10.i191 %.pre379397 = phi ptr [ %.pre.i193, %cond.true.i10.i191 ], [ %.pre379398, %cond.false.i13.i197 ] %42 = phi ptr [ %.pre.i193, %cond.true.i10.i191 ], [ %37, %cond.false.i13.i197 ] %43 = phi ptr [ %.pre.i193, %cond.true.i10.i191 ], [ %38, %cond.false.i13.i197 ] %cond.i12.i195 = phi i32 [ %call.i11.i192, %cond.true.i10.i191 ], [ %conv3.i15.i199, %cond.false.i13.i197 ] %cmp.i196 = icmp sgt i32 %cond.i12.i195, 47 br i1 %cmp.i196, label %do.body.i182, label %in.exit203, !llvm.loop !17 in.exit203: ; preds = %getchar_unlocked.exit16.i194 %tobool8.not = icmp eq i32 %add2.i187, 0 br i1 %tobool8.not, label %if.else, label %if.then if.then: ; preds = %in.exit203 %_IO_read_ptr.i.i204 = getelementptr inbounds %struct._IO_FILE, ptr %43, i64 0, i32 1 %44 = load ptr, ptr %_IO_read_ptr.i.i204, align 8, !tbaa !9 %_IO_read_end.i.i205 = getelementptr inbounds %struct._IO_FILE, ptr %43, i64 0, i32 2 %45 = load ptr, ptr %_IO_read_end.i.i205, align 8, !tbaa !14 %cmp.not.i.i206 = icmp ult ptr %44, %45 br i1 %cmp.not.i.i206, label %cond.false.i.i231, label %cond.true.i.i207, !prof !15 cond.true.i.i207: ; preds = %if.then %call.i.i208 = tail call i32 @__uflow(ptr noundef nonnull %43) #4 %.pre17.pre.i209 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i213.preheader cond.false.i.i231: ; preds = %if.then %incdec.ptr.i.i232 = getelementptr inbounds i8, ptr %44, i64 1 store ptr %incdec.ptr.i.i232, ptr %_IO_read_ptr.i.i204, align 8, !tbaa !9 %46 = load i8, ptr %44, align 1, !tbaa !16 %conv3.i.i233 = zext i8 %46 to i32 br label %do.body.i213.preheader do.body.i213.preheader: ; preds = %cond.false.i.i231, %cond.true.i.i207 %.pre379395.ph = phi ptr [ %.pre379397, %cond.false.i.i231 ], [ %.pre17.pre.i209, %cond.true.i.i207 ] %.ph430 = phi ptr [ %42, %cond.false.i.i231 ], [ %.pre17.pre.i209, %cond.true.i.i207 ] %.ph431 = phi ptr [ %43, %cond.false.i.i231 ], [ %.pre17.pre.i209, %cond.true.i.i207 ] %c.0.i215.ph = phi i32 [ %conv3.i.i233, %cond.false.i.i231 ], [ %call.i.i208, %cond.true.i.i207 ] br label %do.body.i213 do.body.i213: ; preds = %do.body.i213.preheader, %getchar_unlocked.exit16.i225 %.pre379395 = phi ptr [ %.pre379394, %getchar_unlocked.exit16.i225 ], [ %.pre379395.ph, %do.body.i213.preheader ] %47 = phi ptr [ %52, %getchar_unlocked.exit16.i225 ], [ %.ph430, %do.body.i213.preheader ] %48 = phi ptr [ %53, %getchar_unlocked.exit16.i225 ], [ %.ph431, %do.body.i213.preheader ] %n.0.i214 = phi i32 [ %add2.i218, %getchar_unlocked.exit16.i225 ], [ 0, %do.body.i213.preheader ] %c.0.i215 = phi i32 [ %cond.i12.i226, %getchar_unlocked.exit16.i225 ], [ %c.0.i215.ph, %do.body.i213.preheader ] %add.i216 = mul i32 %n.0.i214, 10 %and.i217 = and i32 %c.0.i215, 15 %add2.i218 = add nsw i32 %and.i217, %add.i216 %_IO_read_ptr.i7.i219 = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 1 %49 = load ptr, ptr %_IO_read_ptr.i7.i219, align 8, !tbaa !9 %_IO_read_end.i8.i220 = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 2 %50 = load ptr, ptr %_IO_read_end.i8.i220, align 8, !tbaa !14 %cmp.not.i9.i221 = icmp ult ptr %49, %50 br i1 %cmp.not.i9.i221, label %cond.false.i13.i228, label %cond.true.i10.i222, !prof !15 cond.true.i10.i222: ; preds = %do.body.i213 %call.i11.i223 = tail call i32 @__uflow(ptr noundef nonnull %48) #4 %.pre.i224 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i225 cond.false.i13.i228: ; preds = %do.body.i213 %incdec.ptr.i14.i229 = getelementptr inbounds i8, ptr %49, i64 1 store ptr %incdec.ptr.i14.i229, ptr %_IO_read_ptr.i7.i219, align 8, !tbaa !9 %51 = load i8, ptr %49, align 1, !tbaa !16 %conv3.i15.i230 = zext i8 %51 to i32 br label %getchar_unlocked.exit16.i225 getchar_unlocked.exit16.i225: ; preds = %cond.false.i13.i228, %cond.true.i10.i222 %.pre379394 = phi ptr [ %.pre.i224, %cond.true.i10.i222 ], [ %.pre379395, %cond.false.i13.i228 ] %52 = phi ptr [ %.pre.i224, %cond.true.i10.i222 ], [ %47, %cond.false.i13.i228 ] %53 = phi ptr [ %.pre.i224, %cond.true.i10.i222 ], [ %48, %cond.false.i13.i228 ] %cond.i12.i226 = phi i32 [ %call.i11.i223, %cond.true.i10.i222 ], [ %conv3.i15.i230, %cond.false.i13.i228 ] %cmp.i227 = icmp sgt i32 %cond.i12.i226, 47 br i1 %cmp.i227, label %do.body.i213, label %in.exit234, !llvm.loop !17 in.exit234: ; preds = %getchar_unlocked.exit16.i225 %_IO_read_ptr.i.i235 = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 1 %54 = load ptr, ptr %_IO_read_ptr.i.i235, align 8, !tbaa !9 %_IO_read_end.i.i236 = getelementptr inbounds %struct._IO_FILE, ptr %53, i64 0, i32 2 %55 = load ptr, ptr %_IO_read_end.i.i236, align 8, !tbaa !14 %cmp.not.i.i237 = icmp ult ptr %54, %55 br i1 %cmp.not.i.i237, label %cond.false.i.i262, label %cond.true.i.i238, !prof !15 cond.true.i.i238: ; preds = %in.exit234 %call.i.i239 = tail call i32 @__uflow(ptr noundef nonnull %53) #4 %.pre17.pre.i240 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i244.preheader cond.false.i.i262: ; preds = %in.exit234 %incdec.ptr.i.i263 = getelementptr inbounds i8, ptr %54, i64 1 store ptr %incdec.ptr.i.i263, ptr %_IO_read_ptr.i.i235, align 8, !tbaa !9 %56 = load i8, ptr %54, align 1, !tbaa !16 %conv3.i.i264 = zext i8 %56 to i32 br label %do.body.i244.preheader do.body.i244.preheader: ; preds = %cond.false.i.i262, %cond.true.i.i238 %.pre379392.ph = phi ptr [ %.pre379394, %cond.false.i.i262 ], [ %.pre17.pre.i240, %cond.true.i.i238 ] %.ph428 = phi ptr [ %52, %cond.false.i.i262 ], [ %.pre17.pre.i240, %cond.true.i.i238 ] %.ph429 = phi ptr [ %53, %cond.false.i.i262 ], [ %.pre17.pre.i240, %cond.true.i.i238 ] %c.0.i246.ph = phi i32 [ %conv3.i.i264, %cond.false.i.i262 ], [ %call.i.i239, %cond.true.i.i238 ] br label %do.body.i244 do.body.i244: ; preds = %do.body.i244.preheader, %getchar_unlocked.exit16.i256 %.pre379392 = phi ptr [ %.pre379391, %getchar_unlocked.exit16.i256 ], [ %.pre379392.ph, %do.body.i244.preheader ] %57 = phi ptr [ %62, %getchar_unlocked.exit16.i256 ], [ %.ph428, %do.body.i244.preheader ] %58 = phi ptr [ %63, %getchar_unlocked.exit16.i256 ], [ %.ph429, %do.body.i244.preheader ] %n.0.i245 = phi i32 [ %add2.i249, %getchar_unlocked.exit16.i256 ], [ 0, %do.body.i244.preheader ] %c.0.i246 = phi i32 [ %cond.i12.i257, %getchar_unlocked.exit16.i256 ], [ %c.0.i246.ph, %do.body.i244.preheader ] %add.i247 = mul i32 %n.0.i245, 10 %and.i248 = and i32 %c.0.i246, 15 %add2.i249 = add nsw i32 %and.i248, %add.i247 %_IO_read_ptr.i7.i250 = getelementptr inbounds %struct._IO_FILE, ptr %58, i64 0, i32 1 %59 = load ptr, ptr %_IO_read_ptr.i7.i250, align 8, !tbaa !9 %_IO_read_end.i8.i251 = getelementptr inbounds %struct._IO_FILE, ptr %58, i64 0, i32 2 %60 = load ptr, ptr %_IO_read_end.i8.i251, align 8, !tbaa !14 %cmp.not.i9.i252 = icmp ult ptr %59, %60 br i1 %cmp.not.i9.i252, label %cond.false.i13.i259, label %cond.true.i10.i253, !prof !15 cond.true.i10.i253: ; preds = %do.body.i244 %call.i11.i254 = tail call i32 @__uflow(ptr noundef nonnull %58) #4 %.pre.i255 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i256 cond.false.i13.i259: ; preds = %do.body.i244 %incdec.ptr.i14.i260 = getelementptr inbounds i8, ptr %59, i64 1 store ptr %incdec.ptr.i14.i260, ptr %_IO_read_ptr.i7.i250, align 8, !tbaa !9 %61 = load i8, ptr %59, align 1, !tbaa !16 %conv3.i15.i261 = zext i8 %61 to i32 br label %getchar_unlocked.exit16.i256 getchar_unlocked.exit16.i256: ; preds = %cond.false.i13.i259, %cond.true.i10.i253 %.pre379391 = phi ptr [ %.pre.i255, %cond.true.i10.i253 ], [ %.pre379392, %cond.false.i13.i259 ] %62 = phi ptr [ %.pre.i255, %cond.true.i10.i253 ], [ %57, %cond.false.i13.i259 ] %63 = phi ptr [ %.pre.i255, %cond.true.i10.i253 ], [ %58, %cond.false.i13.i259 ] %cond.i12.i257 = phi i32 [ %call.i11.i254, %cond.true.i10.i253 ], [ %conv3.i15.i261, %cond.false.i13.i259 ] %cmp.i258 = icmp sgt i32 %cond.i12.i257, 47 br i1 %cmp.i258, label %do.body.i244, label %in.exit265, !llvm.loop !17 in.exit265: ; preds = %getchar_unlocked.exit16.i256 %_IO_read_ptr.i.i266 = getelementptr inbounds %struct._IO_FILE, ptr %62, i64 0, i32 1 %64 = load ptr, ptr %_IO_read_ptr.i.i266, align 8, !tbaa !9 %_IO_read_end.i.i267 = getelementptr inbounds %struct._IO_FILE, ptr %62, i64 0, i32 2 %65 = load ptr, ptr %_IO_read_end.i.i267, align 8, !tbaa !14 %cmp.not.i.i268 = icmp ult ptr %64, %65 br i1 %cmp.not.i.i268, label %cond.false.i.i293, label %cond.true.i.i269, !prof !15 cond.true.i.i269: ; preds = %in.exit265 %call.i.i270 = tail call i32 @__uflow(ptr noundef nonnull %62) #4 %.pre17.pre.i271 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i275.preheader cond.false.i.i293: ; preds = %in.exit265 %incdec.ptr.i.i294 = getelementptr inbounds i8, ptr %64, i64 1 store ptr %incdec.ptr.i.i294, ptr %_IO_read_ptr.i.i266, align 8, !tbaa !9 %66 = load i8, ptr %64, align 1, !tbaa !16 %conv3.i.i295 = zext i8 %66 to i32 br label %do.body.i275.preheader do.body.i275.preheader: ; preds = %cond.false.i.i293, %cond.true.i.i269 %.pre379389.ph = phi ptr [ %.pre379391, %cond.false.i.i293 ], [ %.pre17.pre.i271, %cond.true.i.i269 ] %.ph427 = phi ptr [ %62, %cond.false.i.i293 ], [ %.pre17.pre.i271, %cond.true.i.i269 ] %c.0.i277.ph = phi i32 [ %conv3.i.i295, %cond.false.i.i293 ], [ %call.i.i270, %cond.true.i.i269 ] br label %do.body.i275 do.body.i275: ; preds = %do.body.i275.preheader, %getchar_unlocked.exit16.i287 %.pre379389 = phi ptr [ %.pre379388, %getchar_unlocked.exit16.i287 ], [ %.pre379389.ph, %do.body.i275.preheader ] %67 = phi ptr [ %72, %getchar_unlocked.exit16.i287 ], [ %.ph427, %do.body.i275.preheader ] %68 = phi ptr [ %73, %getchar_unlocked.exit16.i287 ], [ %.ph427, %do.body.i275.preheader ] %n.0.i276 = phi i32 [ %add2.i280, %getchar_unlocked.exit16.i287 ], [ 0, %do.body.i275.preheader ] %c.0.i277 = phi i32 [ %cond.i12.i288, %getchar_unlocked.exit16.i287 ], [ %c.0.i277.ph, %do.body.i275.preheader ] %add.i278 = mul i32 %n.0.i276, 10 %and.i279 = and i32 %c.0.i277, 15 %add2.i280 = add nsw i32 %and.i279, %add.i278 %_IO_read_ptr.i7.i281 = getelementptr inbounds %struct._IO_FILE, ptr %68, i64 0, i32 1 %69 = load ptr, ptr %_IO_read_ptr.i7.i281, align 8, !tbaa !9 %_IO_read_end.i8.i282 = getelementptr inbounds %struct._IO_FILE, ptr %68, i64 0, i32 2 %70 = load ptr, ptr %_IO_read_end.i8.i282, align 8, !tbaa !14 %cmp.not.i9.i283 = icmp ult ptr %69, %70 br i1 %cmp.not.i9.i283, label %cond.false.i13.i290, label %cond.true.i10.i284, !prof !15 cond.true.i10.i284: ; preds = %do.body.i275 %call.i11.i285 = tail call i32 @__uflow(ptr noundef nonnull %68) #4 %.pre.i286 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i287 cond.false.i13.i290: ; preds = %do.body.i275 %incdec.ptr.i14.i291 = getelementptr inbounds i8, ptr %69, i64 1 store ptr %incdec.ptr.i14.i291, ptr %_IO_read_ptr.i7.i281, align 8, !tbaa !9 %71 = load i8, ptr %69, align 1, !tbaa !16 %conv3.i15.i292 = zext i8 %71 to i32 br label %getchar_unlocked.exit16.i287 getchar_unlocked.exit16.i287: ; preds = %cond.false.i13.i290, %cond.true.i10.i284 %.pre379388 = phi ptr [ %.pre.i286, %cond.true.i10.i284 ], [ %.pre379389, %cond.false.i13.i290 ] %72 = phi ptr [ %.pre.i286, %cond.true.i10.i284 ], [ %67, %cond.false.i13.i290 ] %73 = phi ptr [ %.pre.i286, %cond.true.i10.i284 ], [ %68, %cond.false.i13.i290 ] %cond.i12.i288 = phi i32 [ %call.i11.i285, %cond.true.i10.i284 ], [ %conv3.i15.i292, %cond.false.i13.i290 ] %cmp.i289 = icmp sgt i32 %cond.i12.i288, 47 br i1 %cmp.i289, label %do.body.i275, label %in.exit296, !llvm.loop !17 in.exit296: ; preds = %getchar_unlocked.exit16.i287 %idxprom12 = sext i32 %add2.i218 to i64 %idxprom14 = sext i32 %add2.i249 to i64 %arrayidx15 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %idxprom12, i64 %idxprom14 %74 = load i32, ptr %arrayidx15, align 4, !tbaa !20 %cmp16 = icmp sgt i32 %74, %add2.i280 br i1 %cmp16, label %if.then17, label %if.end98 if.then17: ; preds = %in.exit296 %arrayidx21 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %idxprom14, i64 %idxprom12 store i32 %add2.i280, ptr %arrayidx21, align 4, !tbaa !20 store i32 %add2.i280, ptr %arrayidx15, align 4, !tbaa !20 br i1 %cmp.not359, label %if.end98, label %for.body28 for.cond26.loopexit: ; preds = %for.inc81, %for.body28 %indvars.iv.next370 = add nuw nsw i64 %indvars.iv369, 1 %exitcond378.not = icmp eq i64 %indvars.iv.next375, %wide.trip.count377 br i1 %exitcond378.not, label %if.end98, label %for.body28, !llvm.loop !24 for.body28: ; preds = %if.then17, %for.cond26.loopexit %indvars.iv374 = phi i64 [ %indvars.iv.next375, %for.cond26.loopexit ], [ 1, %if.then17 ] %indvars.iv369 = phi i64 [ %indvars.iv.next370, %for.cond26.loopexit ], [ 2, %if.then17 ] %indvars.iv.next375 = add nuw nsw i64 %indvars.iv374, 1 %cmp30.not361.not = icmp slt i64 %indvars.iv374, %28 br i1 %cmp30.not361.not, label %for.body31.lr.ph, label %for.cond26.loopexit for.body31.lr.ph: ; preds = %for.body28 %arrayidx35 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv374, i64 %idxprom12 %arrayidx59 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv374, i64 %idxprom14 br label %for.body31 for.body31: ; preds = %for.body31.lr.ph, %for.inc81 %indvars.iv371 = phi i64 [ %indvars.iv369, %for.body31.lr.ph ], [ %indvars.iv.next372, %for.inc81 ] %75 = load i32, ptr %arrayidx35, align 4, !tbaa !20 %add36 = add nsw i32 %75, %add2.i280 %arrayidx40 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %idxprom14, i64 %indvars.iv371 %76 = load i32, ptr %arrayidx40, align 4, !tbaa !20 %add41 = add nsw i32 %add36, %76 %arrayidx45 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv374, i64 %indvars.iv371 %77 = load i32, ptr %arrayidx45, align 4, !tbaa !20 %cmp46 = icmp slt i32 %add41, %77 br i1 %cmp46, label %if.then47, label %if.end if.then47: ; preds = %for.body31 %arrayidx51 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv371, i64 %indvars.iv374 store i32 %add41, ptr %arrayidx51, align 4, !tbaa !20 store i32 %add41, ptr %arrayidx45, align 4, !tbaa !20 br label %if.end if.end: ; preds = %if.then47, %for.body31 %78 = phi i32 [ %add41, %if.then47 ], [ %77, %for.body31 ] %79 = load i32, ptr %arrayidx59, align 4, !tbaa !20 %add60 = add nsw i32 %79, %add2.i280 %arrayidx64 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %idxprom12, i64 %indvars.iv371 %80 = load i32, ptr %arrayidx64, align 4, !tbaa !20 %add65 = add nsw i32 %add60, %80 %cmp70 = icmp slt i32 %add65, %78 br i1 %cmp70, label %if.then71, label %for.inc81 if.then71: ; preds = %if.end %arrayidx75 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %indvars.iv371, i64 %indvars.iv374 store i32 %add65, ptr %arrayidx75, align 4, !tbaa !20 store i32 %add65, ptr %arrayidx45, align 4, !tbaa !20 br label %for.inc81 for.inc81: ; preds = %if.end, %if.then71 %indvars.iv.next372 = add nuw nsw i64 %indvars.iv371, 1 %81 = trunc i64 %indvars.iv371 to i32 %cmp30.not.not = icmp sgt i32 %add2.i, %81 br i1 %cmp30.not.not, label %for.body31, label %for.cond26.loopexit, !llvm.loop !25 if.else: ; preds = %in.exit203 %_IO_read_ptr.i.i297 = getelementptr inbounds %struct._IO_FILE, ptr %42, i64 0, i32 1 %82 = load ptr, ptr %_IO_read_ptr.i.i297, align 8, !tbaa !9 %_IO_read_end.i.i298 = getelementptr inbounds %struct._IO_FILE, ptr %42, i64 0, i32 2 %83 = load ptr, ptr %_IO_read_end.i.i298, align 8, !tbaa !14 %cmp.not.i.i299 = icmp ult ptr %82, %83 br i1 %cmp.not.i.i299, label %cond.false.i.i324, label %cond.true.i.i300, !prof !15 cond.true.i.i300: ; preds = %if.else %call.i.i301 = tail call i32 @__uflow(ptr noundef nonnull %42) #4 %.pre17.pre.i302 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i306.preheader cond.false.i.i324: ; preds = %if.else %incdec.ptr.i.i325 = getelementptr inbounds i8, ptr %82, i64 1 store ptr %incdec.ptr.i.i325, ptr %_IO_read_ptr.i.i297, align 8, !tbaa !9 %84 = load i8, ptr %82, align 1, !tbaa !16 %conv3.i.i326 = zext i8 %84 to i32 br label %do.body.i306.preheader do.body.i306.preheader: ; preds = %cond.false.i.i324, %cond.true.i.i300 %.ph425 = phi ptr [ %42, %cond.false.i.i324 ], [ %.pre17.pre.i302, %cond.true.i.i300 ] %c.0.i308.ph = phi i32 [ %conv3.i.i326, %cond.false.i.i324 ], [ %call.i.i301, %cond.true.i.i300 ] br label %do.body.i306 do.body.i306: ; preds = %do.body.i306.preheader, %getchar_unlocked.exit16.i318 %85 = phi ptr [ %89, %getchar_unlocked.exit16.i318 ], [ %.ph425, %do.body.i306.preheader ] %n.0.i307 = phi i32 [ %add2.i311, %getchar_unlocked.exit16.i318 ], [ 0, %do.body.i306.preheader ] %c.0.i308 = phi i32 [ %cond.i12.i319, %getchar_unlocked.exit16.i318 ], [ %c.0.i308.ph, %do.body.i306.preheader ] %add.i309 = mul i32 %n.0.i307, 10 %and.i310 = and i32 %c.0.i308, 15 %add2.i311 = add nsw i32 %and.i310, %add.i309 %_IO_read_ptr.i7.i312 = getelementptr inbounds %struct._IO_FILE, ptr %85, i64 0, i32 1 %86 = load ptr, ptr %_IO_read_ptr.i7.i312, align 8, !tbaa !9 %_IO_read_end.i8.i313 = getelementptr inbounds %struct._IO_FILE, ptr %85, i64 0, i32 2 %87 = load ptr, ptr %_IO_read_end.i8.i313, align 8, !tbaa !14 %cmp.not.i9.i314 = icmp ult ptr %86, %87 br i1 %cmp.not.i9.i314, label %cond.false.i13.i321, label %cond.true.i10.i315, !prof !15 cond.true.i10.i315: ; preds = %do.body.i306 %call.i11.i316 = tail call i32 @__uflow(ptr noundef nonnull %85) #4 %.pre.i317 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i318 cond.false.i13.i321: ; preds = %do.body.i306 %incdec.ptr.i14.i322 = getelementptr inbounds i8, ptr %86, i64 1 store ptr %incdec.ptr.i14.i322, ptr %_IO_read_ptr.i7.i312, align 8, !tbaa !9 %88 = load i8, ptr %86, align 1, !tbaa !16 %conv3.i15.i323 = zext i8 %88 to i32 br label %getchar_unlocked.exit16.i318 getchar_unlocked.exit16.i318: ; preds = %cond.false.i13.i321, %cond.true.i10.i315 %89 = phi ptr [ %.pre.i317, %cond.true.i10.i315 ], [ %85, %cond.false.i13.i321 ] %cond.i12.i319 = phi i32 [ %call.i11.i316, %cond.true.i10.i315 ], [ %conv3.i15.i323, %cond.false.i13.i321 ] %cmp.i320 = icmp sgt i32 %cond.i12.i319, 47 br i1 %cmp.i320, label %do.body.i306, label %in.exit327, !llvm.loop !17 in.exit327: ; preds = %getchar_unlocked.exit16.i318 %_IO_read_ptr.i.i328 = getelementptr inbounds %struct._IO_FILE, ptr %89, i64 0, i32 1 %90 = load ptr, ptr %_IO_read_ptr.i.i328, align 8, !tbaa !9 %_IO_read_end.i.i329 = getelementptr inbounds %struct._IO_FILE, ptr %89, i64 0, i32 2 %91 = load ptr, ptr %_IO_read_end.i.i329, align 8, !tbaa !14 %cmp.not.i.i330 = icmp ult ptr %90, %91 br i1 %cmp.not.i.i330, label %cond.false.i.i355, label %cond.true.i.i331, !prof !15 cond.true.i.i331: ; preds = %in.exit327 %call.i.i332 = tail call i32 @__uflow(ptr noundef nonnull %89) #4 %.pre17.pre.i333 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i337.preheader cond.false.i.i355: ; preds = %in.exit327 %incdec.ptr.i.i356 = getelementptr inbounds i8, ptr %90, i64 1 store ptr %incdec.ptr.i.i356, ptr %_IO_read_ptr.i.i328, align 8, !tbaa !9 %92 = load i8, ptr %90, align 1, !tbaa !16 %conv3.i.i357 = zext i8 %92 to i32 br label %do.body.i337.preheader do.body.i337.preheader: ; preds = %cond.false.i.i355, %cond.true.i.i331 %.ph = phi ptr [ %89, %cond.false.i.i355 ], [ %.pre17.pre.i333, %cond.true.i.i331 ] %c.0.i339.ph = phi i32 [ %conv3.i.i357, %cond.false.i.i355 ], [ %call.i.i332, %cond.true.i.i331 ] br label %do.body.i337 do.body.i337: ; preds = %do.body.i337.preheader, %getchar_unlocked.exit16.i349 %93 = phi ptr [ %97, %getchar_unlocked.exit16.i349 ], [ %.ph, %do.body.i337.preheader ] %n.0.i338 = phi i32 [ %add2.i342, %getchar_unlocked.exit16.i349 ], [ 0, %do.body.i337.preheader ] %c.0.i339 = phi i32 [ %cond.i12.i350, %getchar_unlocked.exit16.i349 ], [ %c.0.i339.ph, %do.body.i337.preheader ] %add.i340 = mul i32 %n.0.i338, 10 %and.i341 = and i32 %c.0.i339, 15 %add2.i342 = add nsw i32 %and.i341, %add.i340 %_IO_read_ptr.i7.i343 = getelementptr inbounds %struct._IO_FILE, ptr %93, i64 0, i32 1 %94 = load ptr, ptr %_IO_read_ptr.i7.i343, align 8, !tbaa !9 %_IO_read_end.i8.i344 = getelementptr inbounds %struct._IO_FILE, ptr %93, i64 0, i32 2 %95 = load ptr, ptr %_IO_read_end.i8.i344, align 8, !tbaa !14 %cmp.not.i9.i345 = icmp ult ptr %94, %95 br i1 %cmp.not.i9.i345, label %cond.false.i13.i352, label %cond.true.i10.i346, !prof !15 cond.true.i10.i346: ; preds = %do.body.i337 %call.i11.i347 = tail call i32 @__uflow(ptr noundef nonnull %93) #4 %.pre.i348 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i349 cond.false.i13.i352: ; preds = %do.body.i337 %incdec.ptr.i14.i353 = getelementptr inbounds i8, ptr %94, i64 1 store ptr %incdec.ptr.i14.i353, ptr %_IO_read_ptr.i7.i343, align 8, !tbaa !9 %96 = load i8, ptr %94, align 1, !tbaa !16 %conv3.i15.i354 = zext i8 %96 to i32 br label %getchar_unlocked.exit16.i349 getchar_unlocked.exit16.i349: ; preds = %cond.false.i13.i352, %cond.true.i10.i346 %97 = phi ptr [ %.pre.i348, %cond.true.i10.i346 ], [ %93, %cond.false.i13.i352 ] %cond.i12.i350 = phi i32 [ %call.i11.i347, %cond.true.i10.i346 ], [ %conv3.i15.i354, %cond.false.i13.i352 ] %cmp.i351 = icmp sgt i32 %cond.i12.i350, 47 br i1 %cmp.i351, label %do.body.i337, label %in.exit358, !llvm.loop !17 in.exit358: ; preds = %getchar_unlocked.exit16.i349 %idxprom90 = sext i32 %add2.i311 to i64 %idxprom92 = sext i32 %add2.i342 to i64 %arrayidx93 = getelementptr inbounds [101 x [101 x i32]], ptr @fee, i64 0, i64 %idxprom90, i64 %idxprom92 %98 = load i32, ptr %arrayidx93, align 4, !tbaa !20 %cmp94 = icmp sgt i32 %98, 269488143 %spec.store.select = select i1 %cmp94, i32 -1, i32 %98 %call97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.store.select) %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %if.end98 if.end98: ; preds = %for.cond26.loopexit, %if.then17, %in.exit296, %in.exit358 %.pre379387 = phi ptr [ %.pre379388, %if.then17 ], [ %.pre379388, %in.exit296 ], [ %.pre, %in.exit358 ], [ %.pre379388, %for.cond26.loopexit ] %99 = phi ptr [ %72, %if.then17 ], [ %72, %in.exit296 ], [ %.pre, %in.exit358 ], [ %72, %for.cond26.loopexit ] %100 = phi ptr [ %73, %if.then17 ], [ %73, %in.exit296 ], [ %.pre, %in.exit358 ], [ %73, %for.cond26.loopexit ] %cmp5 = icmp sgt i32 %dec367.in, 1 br i1 %cmp5, label %while.body6, label %while.cond.loopexit, !llvm.loop !26 while.end99: ; preds = %in.exit 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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 declare i32 @__uflow(ptr noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 = distinct !{!19, !18} !20 = !{!11, !11, i64 0} !21 = distinct !{!21, !22} !22 = !{!"llvm.loop.unroll.disable"} !23 = distinct !{!23, !18} !24 = distinct !{!24, !18} !25 = distinct !{!25, !18} !26 = distinct !{!26, !18}
// AOJ 0548 Reindeer with no sense of direction // 2018.2.23 bal4u #include <stdio.h> int w, h, cnt, ans; char map[13][13]; int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}}; //#define getchar_unlocked() getchar() int in() { int n = 0; int c = getchar_unlocked(); do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0'); return n; } void dfs(int r, int c, int s) { int i, nr, nc; for (i = 0; i < 4; i++) { nr = r, nc = c; while (1) { nr += mv[i][0], nc += mv[i][1]; if (nr < 0 || nr >= h || nc < 0 || nc >= w) break; if (map[nr][nc] == 1) { map[nr][nc] = -1; dfs(nr, nc, s+1); map[nr][nc] = 1; break; } else if (map[nr][nc] == 2) { if (s == cnt) { ans++; return; } } } } } int main() { int k, r, c, sr, sc; while (w = in()) { h = in(); cnt = 0; for (r = 0; r < h; r++) for (c = 0; c < w; c++) { map[r][c] = k = in(); if (k == 1) cnt++; else if (k == 2) sr = r, sc = c; } ans = 0; dfs(sr, sc, 0); printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261969/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261969/source.c" target datalayout = "e-m:e-p270: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] } @mv = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 -1]], align 16 @h = dso_local local_unnamed_addr global i32 0, align 4 @w = dso_local local_unnamed_addr global i32 0, align 4 @map = dso_local local_unnamed_addr global [13 x [13 x i8]] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @ans = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: 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) #4 %.pre17.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 ], [ %.pre17.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.exit16 %4 = phi ptr [ %8, %getchar_unlocked.exit16 ], [ %.ph, %do.body.preheader ] %n.0 = phi i32 [ %add2, %getchar_unlocked.exit16 ], [ 0, %do.body.preheader ] %c.0 = phi i32 [ %cond.i12, %getchar_unlocked.exit16 ], [ %c.0.ph, %do.body.preheader ] %add = mul i32 %n.0, 10 %and = and i32 %c.0, 15 %add2 = add nsw i32 %and, %add %_IO_read_ptr.i7 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %_IO_read_end.i8 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8, align 8, !tbaa !14 %cmp.not.i9 = icmp ult ptr %5, %6 br i1 %cmp.not.i9, label %cond.false.i13, label %cond.true.i10, !prof !15 cond.true.i10: ; preds = %do.body %call.i11 = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16 cond.false.i13: ; preds = %do.body %incdec.ptr.i14 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14, ptr %_IO_read_ptr.i7, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15 = zext i8 %7 to i32 br label %getchar_unlocked.exit16 getchar_unlocked.exit16: ; preds = %cond.true.i10, %cond.false.i13 %8 = phi ptr [ %.pre, %cond.true.i10 ], [ %4, %cond.false.i13 ] %cond.i12 = phi i32 [ %call.i11, %cond.true.i10 ], [ %conv3.i15, %cond.false.i13 ] %cmp = icmp sgt i32 %cond.i12, 47 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17 do.end: ; preds = %getchar_unlocked.exit16 ret i32 %add2 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %r, i32 noundef %c, i32 noundef %s) local_unnamed_addr #1 { entry: %add23 = add nsw i32 %s, 1 %0 = load i32, ptr @mv, align 16, !tbaa !19 %1 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 0, i64 1), align 4, !tbaa !19 %add70 = add nsw i32 %0, %r %cmp672 = icmp slt i32 %add70, 0 br i1 %cmp672, label %for.inc, label %lor.lhs.false.lr.ph lor.lhs.false.lr.ph: ; preds = %entry %add571 = add nsw i32 %1, %c %2 = load i32, ptr @h, align 4, !tbaa !19 %3 = load i32, ptr @w, align 4 %4 = load i32, ptr @cnt, align 4 %.fr = freeze i32 %4 %cmp36 = icmp eq i32 %.fr, %s br i1 %cmp36, label %lor.lhs.false.us, label %lor.lhs.false lor.lhs.false.us: ; preds = %lor.lhs.false.lr.ph, %if.end41.us %add574.us = phi i32 [ %add5.us, %if.end41.us ], [ %add571, %lor.lhs.false.lr.ph ] %add73.us = phi i32 [ %add.us, %if.end41.us ], [ %add70, %lor.lhs.false.lr.ph ] %cmp7.us = icmp slt i32 %add73.us, %2 %cmp9.us = icmp sgt i32 %add574.us, -1 %or.cond.not64.us = select i1 %cmp7.us, i1 %cmp9.us, i1 false %cmp11.not.us = icmp slt i32 %add574.us, %3 %or.cond63.us = select i1 %or.cond.not64.us, i1 %cmp11.not.us, i1 false br i1 %or.cond63.us, label %if.end.us, label %for.inc if.end.us: ; preds = %lor.lhs.false.us %idxprom12.us = zext i32 %add73.us to i64 %idxprom14.us = zext i32 %add574.us to i64 %arrayidx15.us = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.us, i64 %idxprom14.us %5 = load i8, ptr %arrayidx15.us, align 1, !tbaa !16 switch i8 %5, label %if.end41.us [ i8 1, label %if.then18 i8 2, label %if.then38 ] if.end41.us: ; preds = %if.end.us %add.us = add nsw i32 %0, %add73.us %add5.us = add nsw i32 %1, %add574.us %cmp6.us = icmp slt i32 %add.us, 0 br i1 %cmp6.us, label %for.inc, label %lor.lhs.false.us lor.lhs.false: ; preds = %lor.lhs.false.lr.ph, %if.end41 %add574 = phi i32 [ %add5, %if.end41 ], [ %add571, %lor.lhs.false.lr.ph ] %add73 = phi i32 [ %add, %if.end41 ], [ %add70, %lor.lhs.false.lr.ph ] %cmp7 = icmp slt i32 %add73, %2 %cmp9 = icmp sgt i32 %add574, -1 %or.cond.not64 = select i1 %cmp7, i1 %cmp9, i1 false %cmp11.not = icmp slt i32 %add574, %3 %or.cond63 = select i1 %or.cond.not64, i1 %cmp11.not, i1 false br i1 %or.cond63, label %if.end, label %for.inc if.end: ; preds = %lor.lhs.false %idxprom12 = zext i32 %add73 to i64 %idxprom14 = zext i32 %add574 to i64 %arrayidx15 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12, i64 %idxprom14 %6 = load i8, ptr %arrayidx15, align 1, !tbaa !16 %cond = icmp eq i8 %6, 1 br i1 %cond, label %if.then18, label %if.end41 if.then18: ; preds = %if.end, %if.end.us %.us-phi = phi ptr [ %arrayidx15.us, %if.end.us ], [ %arrayidx15, %if.end ] %.us-phi75 = phi i32 [ %add73.us, %if.end.us ], [ %add73, %if.end ] %.us-phi76 = phi i32 [ %add574.us, %if.end.us ], [ %add574, %if.end ] store i8 -1, ptr %.us-phi, align 1, !tbaa !16 tail call void @dfs(i32 noundef %.us-phi75, i32 noundef %.us-phi76, i32 noundef %add23) store i8 1, ptr %.us-phi, align 1, !tbaa !16 br label %for.inc if.then38: ; preds = %if.end.us, %if.end.us.1, %if.end.us.2, %if.end.us.3 %7 = load i32, ptr @ans, align 4, !tbaa !19 %inc = add nsw i32 %7, 1 store i32 %inc, ptr @ans, align 4, !tbaa !19 br label %common.ret if.end41: ; preds = %if.end %add = add nsw i32 %0, %add73 %add5 = add nsw i32 %1, %add574 %cmp6 = icmp slt i32 %add, 0 br i1 %cmp6, label %for.inc, label %lor.lhs.false for.inc: ; preds = %if.end41, %lor.lhs.false, %if.end41.us, %lor.lhs.false.us, %entry, %if.then18 %8 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1), align 8, !tbaa !19 %9 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1, i64 1), align 4, !tbaa !19 %add70.1 = add nsw i32 %8, %r %cmp672.1 = icmp slt i32 %add70.1, 0 br i1 %cmp672.1, label %for.inc.1, label %lor.lhs.false.lr.ph.1 lor.lhs.false.lr.ph.1: ; preds = %for.inc %add571.1 = add nsw i32 %9, %c %10 = load i32, ptr @h, align 4, !tbaa !19 %11 = load i32, ptr @w, align 4 %12 = load i32, ptr @cnt, align 4 %.fr.1 = freeze i32 %12 %cmp36.1 = icmp eq i32 %.fr.1, %s br i1 %cmp36.1, label %lor.lhs.false.us.1, label %lor.lhs.false.1 lor.lhs.false.1: ; preds = %lor.lhs.false.lr.ph.1, %if.end41.1 %add574.1 = phi i32 [ %add5.1, %if.end41.1 ], [ %add571.1, %lor.lhs.false.lr.ph.1 ] %add73.1 = phi i32 [ %add.1, %if.end41.1 ], [ %add70.1, %lor.lhs.false.lr.ph.1 ] %cmp7.1 = icmp slt i32 %add73.1, %10 %cmp9.1 = icmp sgt i32 %add574.1, -1 %or.cond.not64.1 = select i1 %cmp7.1, i1 %cmp9.1, i1 false %cmp11.not.1 = icmp slt i32 %add574.1, %11 %or.cond63.1 = select i1 %or.cond.not64.1, i1 %cmp11.not.1, i1 false br i1 %or.cond63.1, label %if.end.1, label %for.inc.1 if.end.1: ; preds = %lor.lhs.false.1 %idxprom12.1 = zext i32 %add73.1 to i64 %idxprom14.1 = zext i32 %add574.1 to i64 %arrayidx15.1 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.1, i64 %idxprom14.1 %13 = load i8, ptr %arrayidx15.1, align 1, !tbaa !16 %cond.1 = icmp eq i8 %13, 1 br i1 %cond.1, label %if.then18.1, label %if.end41.1 if.end41.1: ; preds = %if.end.1 %add.1 = add nsw i32 %8, %add73.1 %add5.1 = add nsw i32 %9, %add574.1 %cmp6.1 = icmp slt i32 %add.1, 0 br i1 %cmp6.1, label %for.inc.1, label %lor.lhs.false.1 lor.lhs.false.us.1: ; preds = %lor.lhs.false.lr.ph.1, %if.end41.us.1 %add574.us.1 = phi i32 [ %add5.us.1, %if.end41.us.1 ], [ %add571.1, %lor.lhs.false.lr.ph.1 ] %add73.us.1 = phi i32 [ %add.us.1, %if.end41.us.1 ], [ %add70.1, %lor.lhs.false.lr.ph.1 ] %cmp7.us.1 = icmp slt i32 %add73.us.1, %10 %cmp9.us.1 = icmp sgt i32 %add574.us.1, -1 %or.cond.not64.us.1 = select i1 %cmp7.us.1, i1 %cmp9.us.1, i1 false %cmp11.not.us.1 = icmp slt i32 %add574.us.1, %11 %or.cond63.us.1 = select i1 %or.cond.not64.us.1, i1 %cmp11.not.us.1, i1 false br i1 %or.cond63.us.1, label %if.end.us.1, label %for.inc.1 if.end.us.1: ; preds = %lor.lhs.false.us.1 %idxprom12.us.1 = zext i32 %add73.us.1 to i64 %idxprom14.us.1 = zext i32 %add574.us.1 to i64 %arrayidx15.us.1 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.us.1, i64 %idxprom14.us.1 %14 = load i8, ptr %arrayidx15.us.1, align 1, !tbaa !16 switch i8 %14, label %if.end41.us.1 [ i8 1, label %if.then18.1 i8 2, label %if.then38 ] if.then18.1: ; preds = %if.end.1, %if.end.us.1 %.us-phi.1 = phi ptr [ %arrayidx15.us.1, %if.end.us.1 ], [ %arrayidx15.1, %if.end.1 ] %.us-phi75.1 = phi i32 [ %add73.us.1, %if.end.us.1 ], [ %add73.1, %if.end.1 ] %.us-phi76.1 = phi i32 [ %add574.us.1, %if.end.us.1 ], [ %add574.1, %if.end.1 ] store i8 -1, ptr %.us-phi.1, align 1, !tbaa !16 tail call void @dfs(i32 noundef %.us-phi75.1, i32 noundef %.us-phi76.1, i32 noundef %add23) store i8 1, ptr %.us-phi.1, align 1, !tbaa !16 br label %for.inc.1 if.end41.us.1: ; preds = %if.end.us.1 %add.us.1 = add nsw i32 %8, %add73.us.1 %add5.us.1 = add nsw i32 %9, %add574.us.1 %cmp6.us.1 = icmp slt i32 %add.us.1, 0 br i1 %cmp6.us.1, label %for.inc.1, label %lor.lhs.false.us.1 for.inc.1: ; preds = %lor.lhs.false.1, %if.end41.1, %lor.lhs.false.us.1, %if.end41.us.1, %if.then18.1, %for.inc %15 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 2), align 16, !tbaa !19 %16 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 2, i64 1), align 4, !tbaa !19 %add70.2 = add nsw i32 %15, %r %cmp672.2 = icmp slt i32 %add70.2, 0 br i1 %cmp672.2, label %for.inc.2, label %lor.lhs.false.lr.ph.2 lor.lhs.false.lr.ph.2: ; preds = %for.inc.1 %add571.2 = add nsw i32 %16, %c %17 = load i32, ptr @h, align 4, !tbaa !19 %18 = load i32, ptr @w, align 4 %19 = load i32, ptr @cnt, align 4 %.fr.2 = freeze i32 %19 %cmp36.2 = icmp eq i32 %.fr.2, %s br i1 %cmp36.2, label %lor.lhs.false.us.2, label %lor.lhs.false.2 lor.lhs.false.2: ; preds = %lor.lhs.false.lr.ph.2, %if.end41.2 %add574.2 = phi i32 [ %add5.2, %if.end41.2 ], [ %add571.2, %lor.lhs.false.lr.ph.2 ] %add73.2 = phi i32 [ %add.2, %if.end41.2 ], [ %add70.2, %lor.lhs.false.lr.ph.2 ] %cmp7.2 = icmp slt i32 %add73.2, %17 %cmp9.2 = icmp sgt i32 %add574.2, -1 %or.cond.not64.2 = select i1 %cmp7.2, i1 %cmp9.2, i1 false %cmp11.not.2 = icmp slt i32 %add574.2, %18 %or.cond63.2 = select i1 %or.cond.not64.2, i1 %cmp11.not.2, i1 false br i1 %or.cond63.2, label %if.end.2, label %for.inc.2 if.end.2: ; preds = %lor.lhs.false.2 %idxprom12.2 = zext i32 %add73.2 to i64 %idxprom14.2 = zext i32 %add574.2 to i64 %arrayidx15.2 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.2, i64 %idxprom14.2 %20 = load i8, ptr %arrayidx15.2, align 1, !tbaa !16 %cond.2 = icmp eq i8 %20, 1 br i1 %cond.2, label %if.then18.2, label %if.end41.2 if.end41.2: ; preds = %if.end.2 %add.2 = add nsw i32 %15, %add73.2 %add5.2 = add nsw i32 %16, %add574.2 %cmp6.2 = icmp slt i32 %add.2, 0 br i1 %cmp6.2, label %for.inc.2, label %lor.lhs.false.2 lor.lhs.false.us.2: ; preds = %lor.lhs.false.lr.ph.2, %if.end41.us.2 %add574.us.2 = phi i32 [ %add5.us.2, %if.end41.us.2 ], [ %add571.2, %lor.lhs.false.lr.ph.2 ] %add73.us.2 = phi i32 [ %add.us.2, %if.end41.us.2 ], [ %add70.2, %lor.lhs.false.lr.ph.2 ] %cmp7.us.2 = icmp slt i32 %add73.us.2, %17 %cmp9.us.2 = icmp sgt i32 %add574.us.2, -1 %or.cond.not64.us.2 = select i1 %cmp7.us.2, i1 %cmp9.us.2, i1 false %cmp11.not.us.2 = icmp slt i32 %add574.us.2, %18 %or.cond63.us.2 = select i1 %or.cond.not64.us.2, i1 %cmp11.not.us.2, i1 false br i1 %or.cond63.us.2, label %if.end.us.2, label %for.inc.2 if.end.us.2: ; preds = %lor.lhs.false.us.2 %idxprom12.us.2 = zext i32 %add73.us.2 to i64 %idxprom14.us.2 = zext i32 %add574.us.2 to i64 %arrayidx15.us.2 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.us.2, i64 %idxprom14.us.2 %21 = load i8, ptr %arrayidx15.us.2, align 1, !tbaa !16 switch i8 %21, label %if.end41.us.2 [ i8 1, label %if.then18.2 i8 2, label %if.then38 ] if.then18.2: ; preds = %if.end.2, %if.end.us.2 %.us-phi.2 = phi ptr [ %arrayidx15.us.2, %if.end.us.2 ], [ %arrayidx15.2, %if.end.2 ] %.us-phi75.2 = phi i32 [ %add73.us.2, %if.end.us.2 ], [ %add73.2, %if.end.2 ] %.us-phi76.2 = phi i32 [ %add574.us.2, %if.end.us.2 ], [ %add574.2, %if.end.2 ] store i8 -1, ptr %.us-phi.2, align 1, !tbaa !16 tail call void @dfs(i32 noundef %.us-phi75.2, i32 noundef %.us-phi76.2, i32 noundef %add23) store i8 1, ptr %.us-phi.2, align 1, !tbaa !16 br label %for.inc.2 if.end41.us.2: ; preds = %if.end.us.2 %add.us.2 = add nsw i32 %15, %add73.us.2 %add5.us.2 = add nsw i32 %16, %add574.us.2 %cmp6.us.2 = icmp slt i32 %add.us.2, 0 br i1 %cmp6.us.2, label %for.inc.2, label %lor.lhs.false.us.2 for.inc.2: ; preds = %lor.lhs.false.2, %if.end41.2, %lor.lhs.false.us.2, %if.end41.us.2, %if.then18.2, %for.inc.1 %22 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 3), align 8, !tbaa !19 %23 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 3, i64 1), align 4, !tbaa !19 %add70.3 = add nsw i32 %22, %r %cmp672.3 = icmp slt i32 %add70.3, 0 br i1 %cmp672.3, label %common.ret, label %lor.lhs.false.lr.ph.3 lor.lhs.false.lr.ph.3: ; preds = %for.inc.2 %add571.3 = add nsw i32 %23, %c %24 = load i32, ptr @h, align 4, !tbaa !19 %25 = load i32, ptr @w, align 4 %26 = load i32, ptr @cnt, align 4 %.fr.3 = freeze i32 %26 %cmp36.3 = icmp eq i32 %.fr.3, %s br i1 %cmp36.3, label %lor.lhs.false.us.3, label %lor.lhs.false.3 lor.lhs.false.3: ; preds = %lor.lhs.false.lr.ph.3, %if.end41.3 %add574.3 = phi i32 [ %add5.3, %if.end41.3 ], [ %add571.3, %lor.lhs.false.lr.ph.3 ] %add73.3 = phi i32 [ %add.3, %if.end41.3 ], [ %add70.3, %lor.lhs.false.lr.ph.3 ] %cmp7.3 = icmp slt i32 %add73.3, %24 %cmp9.3 = icmp sgt i32 %add574.3, -1 %or.cond.not64.3 = select i1 %cmp7.3, i1 %cmp9.3, i1 false %cmp11.not.3 = icmp slt i32 %add574.3, %25 %or.cond63.3 = select i1 %or.cond.not64.3, i1 %cmp11.not.3, i1 false br i1 %or.cond63.3, label %if.end.3, label %common.ret if.end.3: ; preds = %lor.lhs.false.3 %idxprom12.3 = zext i32 %add73.3 to i64 %idxprom14.3 = zext i32 %add574.3 to i64 %arrayidx15.3 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.3, i64 %idxprom14.3 %27 = load i8, ptr %arrayidx15.3, align 1, !tbaa !16 %cond.3 = icmp eq i8 %27, 1 br i1 %cond.3, label %if.then18.3, label %if.end41.3 if.end41.3: ; preds = %if.end.3 %add.3 = add nsw i32 %22, %add73.3 %add5.3 = add nsw i32 %23, %add574.3 %cmp6.3 = icmp slt i32 %add.3, 0 br i1 %cmp6.3, label %common.ret, label %lor.lhs.false.3 lor.lhs.false.us.3: ; preds = %lor.lhs.false.lr.ph.3, %if.end41.us.3 %add574.us.3 = phi i32 [ %add5.us.3, %if.end41.us.3 ], [ %add571.3, %lor.lhs.false.lr.ph.3 ] %add73.us.3 = phi i32 [ %add.us.3, %if.end41.us.3 ], [ %add70.3, %lor.lhs.false.lr.ph.3 ] %cmp7.us.3 = icmp slt i32 %add73.us.3, %24 %cmp9.us.3 = icmp sgt i32 %add574.us.3, -1 %or.cond.not64.us.3 = select i1 %cmp7.us.3, i1 %cmp9.us.3, i1 false %cmp11.not.us.3 = icmp slt i32 %add574.us.3, %25 %or.cond63.us.3 = select i1 %or.cond.not64.us.3, i1 %cmp11.not.us.3, i1 false br i1 %or.cond63.us.3, label %if.end.us.3, label %common.ret if.end.us.3: ; preds = %lor.lhs.false.us.3 %idxprom12.us.3 = zext i32 %add73.us.3 to i64 %idxprom14.us.3 = zext i32 %add574.us.3 to i64 %arrayidx15.us.3 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %idxprom12.us.3, i64 %idxprom14.us.3 %28 = load i8, ptr %arrayidx15.us.3, align 1, !tbaa !16 switch i8 %28, label %if.end41.us.3 [ i8 1, label %if.then18.3 i8 2, label %if.then38 ] common.ret: ; preds = %if.then38, %for.inc.2, %lor.lhs.false.us.3, %if.end41.us.3, %lor.lhs.false.3, %if.end41.3, %if.then18.3 ret void if.then18.3: ; preds = %if.end.3, %if.end.us.3 %.us-phi.3 = phi ptr [ %arrayidx15.us.3, %if.end.us.3 ], [ %arrayidx15.3, %if.end.3 ] %.us-phi75.3 = phi i32 [ %add73.us.3, %if.end.us.3 ], [ %add73.3, %if.end.3 ] %.us-phi76.3 = phi i32 [ %add574.us.3, %if.end.us.3 ], [ %add574.3, %if.end.3 ] store i8 -1, ptr %.us-phi.3, align 1, !tbaa !16 tail call void @dfs(i32 noundef %.us-phi75.3, i32 noundef %.us-phi76.3, i32 noundef %add23) store i8 1, ptr %.us-phi.3, align 1, !tbaa !16 br label %common.ret if.end41.us.3: ; preds = %if.end.us.3 %add.us.3 = add nsw i32 %22, %add73.us.3 %add5.us.3 = add nsw i32 %23, %add574.us.3 %cmp6.us.3 = icmp slt i32 %add.us.3, 0 br i1 %cmp6.us.3, label %common.ret, label %lor.lhs.false.us.3 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %for.end17, %entry %sr.0 = phi i32 [ undef, %entry ], [ %sr.1.lcssa, %for.end17 ] %sc.0 = phi i32 [ undef, %entry ], [ %sc.1.lcssa, %for.end17 ] %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 = %while.cond %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 %.pre17.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i.preheader cond.false.i.i: ; preds = %while.cond %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 %.ph114 = phi ptr [ %0, %cond.false.i.i ], [ %.pre17.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.exit16.i %4 = phi ptr [ %8, %getchar_unlocked.exit16.i ], [ %.ph114, %do.body.i.preheader ] %n.0.i = phi i32 [ %add2.i, %getchar_unlocked.exit16.i ], [ 0, %do.body.i.preheader ] %c.0.i = phi i32 [ %cond.i12.i, %getchar_unlocked.exit16.i ], [ %c.0.i.ph, %do.body.i.preheader ] %add.i = mul i32 %n.0.i, 10 %and.i = and i32 %c.0.i, 15 %add2.i = add nsw i32 %and.i, %add.i %_IO_read_ptr.i7.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %_IO_read_end.i8.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i8.i, align 8, !tbaa !14 %cmp.not.i9.i = icmp ult ptr %5, %6 br i1 %cmp.not.i9.i, label %cond.false.i13.i, label %cond.true.i10.i, !prof !15 cond.true.i10.i: ; preds = %do.body.i %call.i11.i = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i cond.false.i13.i: ; preds = %do.body.i %incdec.ptr.i14.i = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i14.i, ptr %_IO_read_ptr.i7.i, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i15.i = zext i8 %7 to i32 br label %getchar_unlocked.exit16.i getchar_unlocked.exit16.i: ; preds = %cond.false.i13.i, %cond.true.i10.i %8 = phi ptr [ %.pre.i, %cond.true.i10.i ], [ %4, %cond.false.i13.i ] %cond.i12.i = phi i32 [ %call.i11.i, %cond.true.i10.i ], [ %conv3.i15.i, %cond.false.i13.i ] %cmp.i = icmp sgt i32 %cond.i12.i, 47 br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !17 in.exit: ; preds = %getchar_unlocked.exit16.i store i32 %add2.i, ptr @w, align 4, !tbaa !19 %tobool.not = icmp eq i32 %add2.i, 0 br i1 %tobool.not, label %while.end, label %while.body while.body: ; preds = %in.exit %_IO_read_ptr.i.i26 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i.i26, align 8, !tbaa !9 %_IO_read_end.i.i27 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i.i27, align 8, !tbaa !14 %cmp.not.i.i28 = icmp ult ptr %9, %10 br i1 %cmp.not.i.i28, label %cond.false.i.i53, label %cond.true.i.i29, !prof !15 cond.true.i.i29: ; preds = %while.body %call.i.i30 = tail call i32 @__uflow(ptr noundef nonnull %8) #4 %.pre17.pre.i31 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i35.preheader cond.false.i.i53: ; preds = %while.body %incdec.ptr.i.i54 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i.i54, ptr %_IO_read_ptr.i.i26, align 8, !tbaa !9 %11 = load i8, ptr %9, align 1, !tbaa !16 %conv3.i.i55 = zext i8 %11 to i32 br label %do.body.i35.preheader do.body.i35.preheader: ; preds = %cond.false.i.i53, %cond.true.i.i29 %.ph113 = phi ptr [ %8, %cond.false.i.i53 ], [ %.pre17.pre.i31, %cond.true.i.i29 ] %c.0.i37.ph = phi i32 [ %conv3.i.i55, %cond.false.i.i53 ], [ %call.i.i30, %cond.true.i.i29 ] br label %do.body.i35 do.body.i35: ; preds = %do.body.i35.preheader, %getchar_unlocked.exit16.i47 %12 = phi ptr [ %16, %getchar_unlocked.exit16.i47 ], [ %.ph113, %do.body.i35.preheader ] %n.0.i36 = phi i32 [ %add2.i40, %getchar_unlocked.exit16.i47 ], [ 0, %do.body.i35.preheader ] %c.0.i37 = phi i32 [ %cond.i12.i48, %getchar_unlocked.exit16.i47 ], [ %c.0.i37.ph, %do.body.i35.preheader ] %add.i38 = mul i32 %n.0.i36, 10 %and.i39 = and i32 %c.0.i37, 15 %add2.i40 = add nsw i32 %and.i39, %add.i38 %_IO_read_ptr.i7.i41 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i7.i41, align 8, !tbaa !9 %_IO_read_end.i8.i42 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i8.i42, align 8, !tbaa !14 %cmp.not.i9.i43 = icmp ult ptr %13, %14 br i1 %cmp.not.i9.i43, label %cond.false.i13.i50, label %cond.true.i10.i44, !prof !15 cond.true.i10.i44: ; preds = %do.body.i35 %call.i11.i45 = tail call i32 @__uflow(ptr noundef nonnull %12) #4 %.pre.i46 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i47 cond.false.i13.i50: ; preds = %do.body.i35 %incdec.ptr.i14.i51 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i14.i51, ptr %_IO_read_ptr.i7.i41, align 8, !tbaa !9 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i15.i52 = zext i8 %15 to i32 br label %getchar_unlocked.exit16.i47 getchar_unlocked.exit16.i47: ; preds = %cond.false.i13.i50, %cond.true.i10.i44 %16 = phi ptr [ %.pre.i46, %cond.true.i10.i44 ], [ %12, %cond.false.i13.i50 ] %cond.i12.i48 = phi i32 [ %call.i11.i45, %cond.true.i10.i44 ], [ %conv3.i15.i52, %cond.false.i13.i50 ] %cmp.i49 = icmp sgt i32 %cond.i12.i48, 47 br i1 %cmp.i49, label %do.body.i35, label %in.exit56, !llvm.loop !17 in.exit56: ; preds = %getchar_unlocked.exit16.i47 store i32 %add2.i40, ptr @h, align 4, !tbaa !19 store i32 0, ptr @cnt, align 4, !tbaa !19 %cmp93 = icmp sgt i32 %add2.i40, 0 %17 = load i32, ptr @w, align 4 %18 = icmp sgt i32 %17, 0 %or.cond = select i1 %cmp93, i1 %18, i1 false br i1 %or.cond, label %for.cond2.preheader, label %for.end17 for.cond2.preheader: ; preds = %in.exit56, %for.inc15 %19 = phi i32 [ %38, %for.inc15 ], [ %add2.i40, %in.exit56 ] %20 = phi ptr [ %39, %for.inc15 ], [ %16, %in.exit56 ] %21 = phi i32 [ %40, %for.inc15 ], [ %17, %in.exit56 ] %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.inc15 ], [ 0, %in.exit56 ] %sc.196 = phi i32 [ %sc.2.lcssa, %for.inc15 ], [ %sc.0, %in.exit56 ] %sr.195 = phi i32 [ %sr.2.lcssa, %for.inc15 ], [ %sr.0, %in.exit56 ] %cmp388 = icmp sgt i32 %21, 0 br i1 %cmp388, label %for.body4.lr.ph, label %for.inc15 for.body4.lr.ph: ; preds = %for.cond2.preheader %22 = trunc i64 %indvars.iv102 to i32 br label %for.body4 for.body4: ; preds = %for.body4.lr.ph, %for.inc %23 = phi ptr [ %20, %for.body4.lr.ph ], [ %32, %for.inc ] %indvars.iv = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next, %for.inc ] %sc.291 = phi i32 [ %sc.196, %for.body4.lr.ph ], [ %sc.3, %for.inc ] %sr.290 = phi i32 [ %sr.195, %for.body4.lr.ph ], [ %sr.3, %for.inc ] %_IO_read_ptr.i.i57 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 1 %24 = load ptr, ptr %_IO_read_ptr.i.i57, align 8, !tbaa !9 %_IO_read_end.i.i58 = getelementptr inbounds %struct._IO_FILE, ptr %23, i64 0, i32 2 %25 = load ptr, ptr %_IO_read_end.i.i58, align 8, !tbaa !14 %cmp.not.i.i59 = icmp ult ptr %24, %25 br i1 %cmp.not.i.i59, label %cond.false.i.i84, label %cond.true.i.i60, !prof !15 cond.true.i.i60: ; preds = %for.body4 %call.i.i61 = tail call i32 @__uflow(ptr noundef nonnull %23) #4 %.pre17.pre.i62 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %do.body.i66.preheader cond.false.i.i84: ; preds = %for.body4 %incdec.ptr.i.i85 = getelementptr inbounds i8, ptr %24, i64 1 store ptr %incdec.ptr.i.i85, ptr %_IO_read_ptr.i.i57, align 8, !tbaa !9 %26 = load i8, ptr %24, align 1, !tbaa !16 %conv3.i.i86 = zext i8 %26 to i32 br label %do.body.i66.preheader do.body.i66.preheader: ; preds = %cond.false.i.i84, %cond.true.i.i60 %.ph112 = phi ptr [ %23, %cond.false.i.i84 ], [ %.pre17.pre.i62, %cond.true.i.i60 ] %c.0.i68.ph = phi i32 [ %conv3.i.i86, %cond.false.i.i84 ], [ %call.i.i61, %cond.true.i.i60 ] br label %do.body.i66 do.body.i66: ; preds = %do.body.i66.preheader, %getchar_unlocked.exit16.i78 %27 = phi ptr [ %32, %getchar_unlocked.exit16.i78 ], [ %.ph112, %do.body.i66.preheader ] %28 = phi ptr [ %33, %getchar_unlocked.exit16.i78 ], [ %.ph112, %do.body.i66.preheader ] %n.0.i67 = phi i32 [ %add2.i71, %getchar_unlocked.exit16.i78 ], [ 0, %do.body.i66.preheader ] %c.0.i68 = phi i32 [ %cond.i12.i79, %getchar_unlocked.exit16.i78 ], [ %c.0.i68.ph, %do.body.i66.preheader ] %add.i69 = mul i32 %n.0.i67, 10 %and.i70 = and i32 %c.0.i68, 15 %add2.i71 = add nsw i32 %and.i70, %add.i69 %_IO_read_ptr.i7.i72 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 1 %29 = load ptr, ptr %_IO_read_ptr.i7.i72, align 8, !tbaa !9 %_IO_read_end.i8.i73 = getelementptr inbounds %struct._IO_FILE, ptr %28, i64 0, i32 2 %30 = load ptr, ptr %_IO_read_end.i8.i73, align 8, !tbaa !14 %cmp.not.i9.i74 = icmp ult ptr %29, %30 br i1 %cmp.not.i9.i74, label %cond.false.i13.i81, label %cond.true.i10.i75, !prof !15 cond.true.i10.i75: ; preds = %do.body.i66 %call.i11.i76 = tail call i32 @__uflow(ptr noundef nonnull %28) #4 %.pre.i77 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit16.i78 cond.false.i13.i81: ; preds = %do.body.i66 %incdec.ptr.i14.i82 = getelementptr inbounds i8, ptr %29, i64 1 store ptr %incdec.ptr.i14.i82, ptr %_IO_read_ptr.i7.i72, align 8, !tbaa !9 %31 = load i8, ptr %29, align 1, !tbaa !16 %conv3.i15.i83 = zext i8 %31 to i32 br label %getchar_unlocked.exit16.i78 getchar_unlocked.exit16.i78: ; preds = %cond.false.i13.i81, %cond.true.i10.i75 %32 = phi ptr [ %.pre.i77, %cond.true.i10.i75 ], [ %27, %cond.false.i13.i81 ] %33 = phi ptr [ %.pre.i77, %cond.true.i10.i75 ], [ %28, %cond.false.i13.i81 ] %cond.i12.i79 = phi i32 [ %call.i11.i76, %cond.true.i10.i75 ], [ %conv3.i15.i83, %cond.false.i13.i81 ] %cmp.i80 = icmp sgt i32 %cond.i12.i79, 47 br i1 %cmp.i80, label %do.body.i66, label %in.exit87, !llvm.loop !17 in.exit87: ; preds = %getchar_unlocked.exit16.i78 %conv = trunc i32 %add2.i71 to i8 %arrayidx7 = getelementptr inbounds [13 x [13 x i8]], ptr @map, i64 0, i64 %indvars.iv102, i64 %indvars.iv store i8 %conv, ptr %arrayidx7, align 1, !tbaa !16 switch i32 %add2.i71, label %for.inc [ i32 1, label %if.then i32 2, label %if.then12 ] if.then: ; preds = %in.exit87 %34 = load i32, ptr @cnt, align 4, !tbaa !19 %inc = add nsw i32 %34, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !19 br label %for.inc if.then12: ; preds = %in.exit87 %35 = trunc i64 %indvars.iv to i32 br label %for.inc for.inc: ; preds = %in.exit87, %if.then, %if.then12 %sr.3 = phi i32 [ %sr.290, %if.then ], [ %22, %if.then12 ], [ %sr.290, %in.exit87 ] %sc.3 = phi i32 [ %sc.291, %if.then ], [ %35, %if.then12 ], [ %sc.291, %in.exit87 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %36 = load i32, ptr @w, align 4, !tbaa !19 %37 = sext i32 %36 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %37 br i1 %cmp3, label %for.body4, label %for.inc15.loopexit, !llvm.loop !20 for.inc15.loopexit: ; preds = %for.inc %.pre = load i32, ptr @h, align 4, !tbaa !19 br label %for.inc15 for.inc15: ; preds = %for.inc15.loopexit, %for.cond2.preheader %38 = phi i32 [ %19, %for.cond2.preheader ], [ %.pre, %for.inc15.loopexit ] %39 = phi ptr [ %20, %for.cond2.preheader ], [ %32, %for.inc15.loopexit ] %40 = phi i32 [ %21, %for.cond2.preheader ], [ %36, %for.inc15.loopexit ] %sr.2.lcssa = phi i32 [ %sr.195, %for.cond2.preheader ], [ %sr.3, %for.inc15.loopexit ] %sc.2.lcssa = phi i32 [ %sc.196, %for.cond2.preheader ], [ %sc.3, %for.inc15.loopexit ] %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %41 = sext i32 %38 to i64 %cmp = icmp slt i64 %indvars.iv.next103, %41 br i1 %cmp, label %for.cond2.preheader, label %for.end17, !llvm.loop !21 for.end17: ; preds = %for.inc15, %in.exit56 %sr.1.lcssa = phi i32 [ %sr.0, %in.exit56 ], [ %sr.2.lcssa, %for.inc15 ] %sc.1.lcssa = phi i32 [ %sc.0, %in.exit56 ], [ %sc.2.lcssa, %for.inc15 ] store i32 0, ptr @ans, align 4, !tbaa !19 tail call void @dfs(i32 noundef %sr.1.lcssa, i32 noundef %sc.1.lcssa, i32 noundef 0) %42 = load i32, ptr @ans, align 4, !tbaa !19 %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %42) br label %while.cond, !llvm.loop !23 while.end: ; preds = %in.exit ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 declare i32 @__uflow(ptr noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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} !20 = distinct !{!20, !18} !21 = distinct !{!21, !18, !22} !22 = !{!"llvm.loop.unswitch.partial.disable"} !23 = distinct !{!23, !18}
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<limits.h> #define rep(i,begin,end) for(int i=begin; i<end; i++) #define revrep(i,begin,end) for(int i=begin; i>end; i--) #define lld long long int void initStrArray(char** p, int n, int len){ for(int i=0; i<n; i++){ *(p + i) = (char*)malloc(sizeof(char) * (len + 1)); } } int main(){ int n, m; scanf("%d", &n); int p[n], p_len = 0; char* s[n]; initStrArray(s, n, 10); rep(i, 0, n){ p[i] = 0; } rep(i, 0, n){ char buf[11]; scanf("%s", buf); int f=1; rep(j, 0, p_len){ if(strcmp(s[j], buf) == 0){ f = 0; p[j]++; break; } } if(f){ strcpy(s[p_len], buf); p[p_len++] = 1; } } scanf("%d", &m); rep(i, 0, m){ char buf[11]; scanf("%s", buf); rep(j, 0, p_len){ if(strcmp(s[j], buf) == 0){ p[j]--; break; } } } int ans = 0; rep(i, 0, p_len){ if(p[i] > ans){ ans = p[i]; } } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262018/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262018/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind memory(argmem: write, inaccessiblemem: readwrite) uwtable define dso_local void @initStrArray(ptr nocapture noundef writeonly %p, i32 noundef %n, i32 noundef %len) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %n, 0 br i1 %cmp3, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %add = add nsw i32 %len, 1 %conv = sext i32 %add to i64 %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry ret void for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %call = tail call noalias ptr @malloc(i64 noundef %conv) #10 %add.ptr = getelementptr inbounds ptr, ptr %p, i64 %indvars.iv store ptr %call, ptr %add.ptr, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %buf = alloca [11 x i8], align 1 %buf42 = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !11 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !11 %4 = zext i32 %3 to i64 %vla1 = alloca ptr, i64 %4, align 16 %cmp3.i = icmp sgt i32 %3, 0 br i1 %cmp3.i, label %for.body.i, label %for.cond.cleanup5 for.body.i: ; preds = %entry, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %entry ] %call.i = call noalias dereferenceable_or_null(11) ptr @malloc(i64 noundef 11) #10 %add.ptr.i = getelementptr inbounds ptr, ptr %vla1, i64 %indvars.iv.i store ptr %call.i, ptr %add.ptr.i, align 8, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %4 br i1 %exitcond.not.i, label %initStrArray.exit, label %for.body.i, !llvm.loop !9 initStrArray.exit: ; preds = %for.body.i br i1 %cmp3.i, label %for.body6.preheader, label %for.cond.cleanup5 for.body6.preheader: ; preds = %initStrArray.exit %5 = shl nuw nsw i64 %4, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %5, i1 false), !tbaa !11 br label %for.body6 for.cond.cleanup5: ; preds = %if.end31, %entry, %initStrArray.exit %p_len.0.lcssa = phi i32 [ 0, %initStrArray.exit ], [ 0, %entry ], [ %13, %if.end31 ] %call36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %6 = load i32, ptr %m, align 4, !tbaa !11 %cmp39116 = icmp sgt i32 %6, 0 br i1 %cmp39116, label %for.body41.lr.ph, label %for.cond68.preheader for.body41.lr.ph: ; preds = %for.cond.cleanup5 %cmp47114 = icmp sgt i32 %p_len.0.lcssa, 0 br i1 %cmp47114, label %for.body41.us.preheader, label %for.body41 for.body41.us.preheader: ; preds = %for.body41.lr.ph %wide.trip.count130 = zext i32 %p_len.0.lcssa to i64 br label %for.body41.us for.body41.us: ; preds = %for.body41.us.preheader, %cleanup61.us %i37.0117.us = phi i32 [ %inc64.us, %cleanup61.us ], [ 0, %for.body41.us.preheader ] call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf42) #11 %call44.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %buf42) br label %for.body49.us for.cond46.us: ; preds = %for.body49.us %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1 %exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130 br i1 %exitcond131.not, label %cleanup61.us, label %for.body49.us, !llvm.loop !13 for.body49.us: ; preds = %for.body41.us, %for.cond46.us %indvars.iv127 = phi i64 [ 0, %for.body41.us ], [ %indvars.iv.next128, %for.cond46.us ] %arrayidx51.us = getelementptr inbounds ptr, ptr %vla1, i64 %indvars.iv127 %7 = load ptr, ptr %arrayidx51.us, align 8, !tbaa !5 %call53.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %buf42) #12 %cmp54.us = icmp eq i32 %call53.us, 0 br i1 %cmp54.us, label %if.then55.us, label %for.cond46.us if.then55.us: ; preds = %for.body49.us %arrayidx57.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv127 %8 = load i32, ptr %arrayidx57.us, align 4, !tbaa !11 %dec.us = add nsw i32 %8, -1 store i32 %dec.us, ptr %arrayidx57.us, align 4, !tbaa !11 br label %cleanup61.us cleanup61.us: ; preds = %for.cond46.us, %if.then55.us call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf42) #11 %inc64.us = add nuw nsw i32 %i37.0117.us, 1 %9 = load i32, ptr %m, align 4, !tbaa !11 %cmp39.us = icmp slt i32 %inc64.us, %9 br i1 %cmp39.us, label %for.body41.us, label %for.cond68.preheader, !llvm.loop !14 for.body6: ; preds = %for.body6.preheader, %if.end31 %i2.0113 = phi i32 [ %inc33, %if.end31 ], [ 0, %for.body6.preheader ] %p_len.0112 = phi i32 [ %13, %if.end31 ], [ 0, %for.body6.preheader ] call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf) #11 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %buf) %cmp9109 = icmp sgt i32 %p_len.0112, 0 br i1 %cmp9109, label %for.body11.preheader, label %if.then23 for.body11.preheader: ; preds = %for.body6 %wide.trip.count = zext i32 %p_len.0112 to i64 br label %for.body11 for.cond8: ; preds = %for.body11 %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 %if.then23, label %for.body11, !llvm.loop !15 for.body11: ; preds = %for.body11.preheader, %for.cond8 %indvars.iv = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next, %for.cond8 ] %arrayidx13 = getelementptr inbounds ptr, ptr %vla1, i64 %indvars.iv %10 = load ptr, ptr %arrayidx13, align 8, !tbaa !5 %call15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) %buf) #12 %cmp16 = icmp eq i32 %call15, 0 br i1 %cmp16, label %if.then, label %for.cond8 if.then: ; preds = %for.body11 %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %11 = load i32, ptr %arrayidx18, align 4, !tbaa !11 %inc19 = add nsw i32 %11, 1 store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !11 br label %if.end31 if.then23: ; preds = %for.cond8, %for.body6 %idxprom24 = sext i32 %p_len.0112 to i64 %arrayidx25 = getelementptr inbounds ptr, ptr %vla1, i64 %idxprom24 %12 = load ptr, ptr %arrayidx25, align 8, !tbaa !5 %call27 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) %buf) #11 %inc28 = add nsw i32 %p_len.0112, 1 %arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 %idxprom24 store i32 1, ptr %arrayidx30, align 4, !tbaa !11 br label %if.end31 if.end31: ; preds = %if.then, %if.then23 %p_len.1 = phi i32 [ %inc28, %if.then23 ], [ %p_len.0112, %if.then ] %13 = freeze i32 %p_len.1 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf) #11 %inc33 = add nuw nsw i32 %i2.0113, 1 %14 = load i32, ptr %n, align 4, !tbaa !11 %cmp4 = icmp slt i32 %inc33, %14 br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !16 for.cond68.preheader: ; preds = %for.body41, %cleanup61.us, %for.cond.cleanup5 %cmp69118 = icmp sgt i32 %p_len.0.lcssa, 0 br i1 %cmp69118, label %for.body71.preheader, label %for.cond.cleanup70 for.body71.preheader: ; preds = %for.cond68.preheader %wide.trip.count135 = zext i32 %p_len.0.lcssa to i64 %min.iters.check = icmp ult i32 %p_len.0.lcssa, 8 br i1 %min.iters.check, label %for.body71.preheader145, label %vector.ph vector.ph: ; preds = %for.body71.preheader %n.vec = and i64 %wide.trip.count135, 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 ], [ %17, %vector.body ] %vec.phi143 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ] %15 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %15, align 16, !tbaa !11 %16 = getelementptr inbounds i32, ptr %15, i64 4 %wide.load144 = load <4 x i32>, ptr %16, align 16, !tbaa !11 %17 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %18 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load144, <4 x i32> %vec.phi143) %index.next = add nuw i64 %index, 8 %19 = icmp eq i64 %index.next, %n.vec br i1 %19, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %17, <4 x i32> %18) %20 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count135 br i1 %cmp.n, label %for.cond.cleanup70, label %for.body71.preheader145 for.body71.preheader145: ; preds = %for.body71.preheader, %middle.block %indvars.iv132.ph = phi i64 [ 0, %for.body71.preheader ], [ %n.vec, %middle.block ] %ans.0119.ph = phi i32 [ 0, %for.body71.preheader ], [ %20, %middle.block ] br label %for.body71 for.body41: ; preds = %for.body41.lr.ph, %for.body41 %i37.0117 = phi i32 [ %inc64, %for.body41 ], [ 0, %for.body41.lr.ph ] call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf42) #11 %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %buf42) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf42) #11 %inc64 = add nuw nsw i32 %i37.0117, 1 %21 = load i32, ptr %m, align 4, !tbaa !11 %cmp39 = icmp slt i32 %inc64, %21 br i1 %cmp39, label %for.body41, label %for.cond68.preheader, !llvm.loop !14 for.cond.cleanup70: ; preds = %for.body71, %middle.block, %for.cond68.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond68.preheader ], [ %20, %middle.block ], [ %spec.select, %for.body71 ] %call83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 for.body71: ; preds = %for.body71.preheader145, %for.body71 %indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.body71 ], [ %indvars.iv132.ph, %for.body71.preheader145 ] %ans.0119 = phi i32 [ %spec.select, %for.body71 ], [ %ans.0119.ph, %for.body71.preheader145 ] %arrayidx73 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv132 %22 = load i32, ptr %arrayidx73, align 4, !tbaa !11 %spec.select = call i32 @llvm.smax.i32(i32 %22, i32 %ans.0119) %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next133, %wide.trip.count135 br i1 %exitcond136.not, label %for.cond.cleanup70, label %for.body71, !llvm.loop !20 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #8 attributes #0 = { nofree nounwind memory(argmem: write, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nocallback nofree nosync nounwind willreturn } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #10 = { nounwind allocsize(0) } attributes #11 = { nounwind } attributes #12 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !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 = !{!"int", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !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, !19, !18}
#include<stdio.h> int main() { int n,m,i,j,k,ans=0; scanf("%d",&n); char sn[100][15]={'a'}; for(i=0;i<n;i++) { scanf("%s",&(sn[i])); } scanf("%d",&m); char sm[100][15]={'a'}; for(i=0;i<m;i++) { scanf("%s",&(sm[i])); } for(i=0;i<n;i++) { int sum=0,flag=0; for(j=0;j<(n+m);j++) { flag=0; if(j<n) { for(k=0;k<10;k++) { if(sn[i][k]==sn[j][k])flag=1; else { flag=0; break; } } if(flag)sum++; } else { for(k=0;k<10;k++) { if(sn[i][k]==sm[j-n][k])flag=1; else { flag=0; break; } } if(flag)sum--; } } //printf("%d\n",sum); if(sum>ans)ans=sum; } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262069/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262069/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %sn = alloca [100 x [15 x i8]], align 16 %sm = alloca [100 x [15 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 1500, ptr nonnull %sn) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1500) %sn, i8 0, i64 1500, i1 false) store i8 97, ptr %sn, align 16 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp113 = icmp sgt i32 %0, 0 br i1 %cmp113, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) call void @llvm.lifetime.start.p0(i64 1500, ptr nonnull %sm) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1500) %sm, i8 0, i64 1500, i1 false) store i8 97, ptr %sm, align 16 %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp4115 = icmp sgt i32 %3, 0 br i1 %cmp4115, label %for.body5, label %for.cond12.preheader for.cond12.preheader: ; preds = %for.body5, %for.end %.lcssa = phi i32 [ %3, %for.end ], [ %44, %for.body5 ] %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp13123 = icmp sgt i32 %4, 0 br i1 %cmp13123, label %for.cond15.preheader.lr.ph, label %for.end76 for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader %add = add nsw i32 %4, %.lcssa %cmp16119 = icmp sgt i32 %add, 0 br i1 %cmp16119, label %for.cond15.preheader.us.preheader, label %for.end76 for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph %5 = zext i32 %4 to i64 %wide.trip.count147 = zext i32 %4 to i64 %wide.trip.count = zext i32 %add to i64 br label %for.cond15.preheader.us for.cond15.preheader.us: ; preds = %for.cond15.preheader.us.preheader, %for.cond15.for.end69_crit_edge.us %indvars.iv144 = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next145, %for.cond15.for.end69_crit_edge.us ] %ans.0125.us = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %spec.select104.us, %for.cond15.for.end69_crit_edge.us ] %arrayidx48.us = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 0 %arrayidx48.us.1 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 1 %arrayidx48.us.2 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 2 %arrayidx48.us.3 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 3 %arrayidx48.us.4 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 4 %arrayidx48.us.5 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 5 %arrayidx48.us.6 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 6 %arrayidx48.us.7 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 7 %arrayidx48.us.8 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 8 %arrayidx25.us = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 0 %arrayidx25.us.1 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 1 %arrayidx25.us.2 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 2 %arrayidx25.us.3 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 3 %arrayidx25.us.4 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 4 %arrayidx25.us.5 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 5 %arrayidx25.us.6 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 6 %arrayidx25.us.7 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 7 %arrayidx25.us.8 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 8 %.sink151.in = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv144, i64 9 br label %for.body17.us for.body17.us: ; preds = %for.cond15.preheader.us, %for.inc67.us %indvars.iv140 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next141, %for.inc67.us ] %sum.0121.us = phi i32 [ 0, %for.cond15.preheader.us ], [ %sum.1.us, %for.inc67.us ] %cmp18.us = icmp ult i64 %indvars.iv140, %5 br i1 %cmp18.us, label %for.cond19.preheader.us, label %for.cond41.preheader.us for.cond41.us: ; preds = %for.cond41.preheader.us %6 = load i8, ptr %arrayidx48.us.1, align 1, !tbaa !11 %arrayidx53.us.1 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 1 %7 = load i8, ptr %arrayidx53.us.1, align 1, !tbaa !11 %cmp55.us.1 = icmp eq i8 %6, %7 br i1 %cmp55.us.1, label %for.cond41.us.1, label %for.inc67.us for.cond41.us.1: ; preds = %for.cond41.us %8 = load i8, ptr %arrayidx48.us.2, align 1, !tbaa !11 %arrayidx53.us.2 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 2 %9 = load i8, ptr %arrayidx53.us.2, align 1, !tbaa !11 %cmp55.us.2 = icmp eq i8 %8, %9 br i1 %cmp55.us.2, label %for.cond41.us.2, label %for.inc67.us for.cond41.us.2: ; preds = %for.cond41.us.1 %10 = load i8, ptr %arrayidx48.us.3, align 1, !tbaa !11 %arrayidx53.us.3 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 3 %11 = load i8, ptr %arrayidx53.us.3, align 1, !tbaa !11 %cmp55.us.3 = icmp eq i8 %10, %11 br i1 %cmp55.us.3, label %for.cond41.us.3, label %for.inc67.us for.cond41.us.3: ; preds = %for.cond41.us.2 %12 = load i8, ptr %arrayidx48.us.4, align 1, !tbaa !11 %arrayidx53.us.4 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 4 %13 = load i8, ptr %arrayidx53.us.4, align 1, !tbaa !11 %cmp55.us.4 = icmp eq i8 %12, %13 br i1 %cmp55.us.4, label %for.cond41.us.4, label %for.inc67.us for.cond41.us.4: ; preds = %for.cond41.us.3 %14 = load i8, ptr %arrayidx48.us.5, align 1, !tbaa !11 %arrayidx53.us.5 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 5 %15 = load i8, ptr %arrayidx53.us.5, align 1, !tbaa !11 %cmp55.us.5 = icmp eq i8 %14, %15 br i1 %cmp55.us.5, label %for.cond41.us.5, label %for.inc67.us for.cond41.us.5: ; preds = %for.cond41.us.4 %16 = load i8, ptr %arrayidx48.us.6, align 1, !tbaa !11 %arrayidx53.us.6 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 6 %17 = load i8, ptr %arrayidx53.us.6, align 1, !tbaa !11 %cmp55.us.6 = icmp eq i8 %16, %17 br i1 %cmp55.us.6, label %for.cond41.us.6, label %for.inc67.us for.cond41.us.6: ; preds = %for.cond41.us.5 %18 = load i8, ptr %arrayidx48.us.7, align 1, !tbaa !11 %arrayidx53.us.7 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 7 %19 = load i8, ptr %arrayidx53.us.7, align 1, !tbaa !11 %cmp55.us.7 = icmp eq i8 %18, %19 br i1 %cmp55.us.7, label %for.cond41.us.7, label %for.inc67.us for.cond41.us.7: ; preds = %for.cond41.us.6 %20 = load i8, ptr %arrayidx48.us.8, align 1, !tbaa !11 %arrayidx53.us.8 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 8 %21 = load i8, ptr %arrayidx53.us.8, align 1, !tbaa !11 %cmp55.us.8 = icmp eq i8 %20, %21 br i1 %cmp55.us.8, label %for.cond41.us.8, label %for.inc67.us for.cond41.us.8: ; preds = %for.cond41.us.7 %arrayidx53.us.9 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 9 br label %for.inc67.us.sink.split for.cond19.us: ; preds = %for.cond19.preheader.us %22 = load i8, ptr %arrayidx25.us.1, align 1, !tbaa !11 %arrayidx29.us.1 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 1 %23 = load i8, ptr %arrayidx29.us.1, align 1, !tbaa !11 %cmp31.us.1 = icmp eq i8 %22, %23 br i1 %cmp31.us.1, label %for.cond19.us.1, label %for.inc67.us for.cond19.us.1: ; preds = %for.cond19.us %24 = load i8, ptr %arrayidx25.us.2, align 1, !tbaa !11 %arrayidx29.us.2 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 2 %25 = load i8, ptr %arrayidx29.us.2, align 1, !tbaa !11 %cmp31.us.2 = icmp eq i8 %24, %25 br i1 %cmp31.us.2, label %for.cond19.us.2, label %for.inc67.us for.cond19.us.2: ; preds = %for.cond19.us.1 %26 = load i8, ptr %arrayidx25.us.3, align 1, !tbaa !11 %arrayidx29.us.3 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 3 %27 = load i8, ptr %arrayidx29.us.3, align 1, !tbaa !11 %cmp31.us.3 = icmp eq i8 %26, %27 br i1 %cmp31.us.3, label %for.cond19.us.3, label %for.inc67.us for.cond19.us.3: ; preds = %for.cond19.us.2 %28 = load i8, ptr %arrayidx25.us.4, align 1, !tbaa !11 %arrayidx29.us.4 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 4 %29 = load i8, ptr %arrayidx29.us.4, align 1, !tbaa !11 %cmp31.us.4 = icmp eq i8 %28, %29 br i1 %cmp31.us.4, label %for.cond19.us.4, label %for.inc67.us for.cond19.us.4: ; preds = %for.cond19.us.3 %30 = load i8, ptr %arrayidx25.us.5, align 1, !tbaa !11 %arrayidx29.us.5 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 5 %31 = load i8, ptr %arrayidx29.us.5, align 1, !tbaa !11 %cmp31.us.5 = icmp eq i8 %30, %31 br i1 %cmp31.us.5, label %for.cond19.us.5, label %for.inc67.us for.cond19.us.5: ; preds = %for.cond19.us.4 %32 = load i8, ptr %arrayidx25.us.6, align 1, !tbaa !11 %arrayidx29.us.6 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 6 %33 = load i8, ptr %arrayidx29.us.6, align 1, !tbaa !11 %cmp31.us.6 = icmp eq i8 %32, %33 br i1 %cmp31.us.6, label %for.cond19.us.6, label %for.inc67.us for.cond19.us.6: ; preds = %for.cond19.us.5 %34 = load i8, ptr %arrayidx25.us.7, align 1, !tbaa !11 %arrayidx29.us.7 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 7 %35 = load i8, ptr %arrayidx29.us.7, align 1, !tbaa !11 %cmp31.us.7 = icmp eq i8 %34, %35 br i1 %cmp31.us.7, label %for.cond19.us.7, label %for.inc67.us for.cond19.us.7: ; preds = %for.cond19.us.6 %36 = load i8, ptr %arrayidx25.us.8, align 1, !tbaa !11 %arrayidx29.us.8 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 8 %37 = load i8, ptr %arrayidx29.us.8, align 1, !tbaa !11 %cmp31.us.8 = icmp eq i8 %36, %37 br i1 %cmp31.us.8, label %for.cond19.us.8, label %for.inc67.us for.cond19.us.8: ; preds = %for.cond19.us.7 %arrayidx29.us.9 = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 9 br label %for.inc67.us.sink.split for.inc67.us.sink.split: ; preds = %for.cond41.us.8, %for.cond19.us.8 %arrayidx29.us.9.sink = phi ptr [ %arrayidx29.us.9, %for.cond19.us.8 ], [ %arrayidx53.us.9, %for.cond41.us.8 ] %.sink = phi i32 [ 1, %for.cond19.us.8 ], [ -1, %for.cond41.us.8 ] %.sink151 = load i8, ptr %.sink151.in, align 1, !tbaa !11 %38 = load i8, ptr %arrayidx29.us.9.sink, align 1, !tbaa !11 %cmp31.us.9 = icmp eq i8 %.sink151, %38 %inc38.us = select i1 %cmp31.us.9, i32 %.sink, i32 0 %spec.select150 = add nsw i32 %sum.0121.us, %inc38.us br label %for.inc67.us for.inc67.us: ; preds = %for.inc67.us.sink.split, %for.cond41.preheader.us, %for.cond41.us, %for.cond41.us.1, %for.cond41.us.2, %for.cond41.us.3, %for.cond41.us.4, %for.cond41.us.5, %for.cond41.us.6, %for.cond41.us.7, %for.cond19.preheader.us, %for.cond19.us, %for.cond19.us.1, %for.cond19.us.2, %for.cond19.us.3, %for.cond19.us.4, %for.cond19.us.5, %for.cond19.us.6, %for.cond19.us.7 %sum.1.us = phi i32 [ %sum.0121.us, %for.cond19.us.7 ], [ %sum.0121.us, %for.cond19.us.6 ], [ %sum.0121.us, %for.cond19.us.5 ], [ %sum.0121.us, %for.cond19.us.4 ], [ %sum.0121.us, %for.cond19.us.3 ], [ %sum.0121.us, %for.cond19.us.2 ], [ %sum.0121.us, %for.cond19.us.1 ], [ %sum.0121.us, %for.cond19.us ], [ %sum.0121.us, %for.cond19.preheader.us ], [ %sum.0121.us, %for.cond41.us.7 ], [ %sum.0121.us, %for.cond41.us.6 ], [ %sum.0121.us, %for.cond41.us.5 ], [ %sum.0121.us, %for.cond41.us.4 ], [ %sum.0121.us, %for.cond41.us.3 ], [ %sum.0121.us, %for.cond41.us.2 ], [ %sum.0121.us, %for.cond41.us.1 ], [ %sum.0121.us, %for.cond41.us ], [ %sum.0121.us, %for.cond41.preheader.us ], [ %spec.select150, %for.inc67.us.sink.split ] %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1 %exitcond.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count br i1 %exitcond.not, label %for.cond15.for.end69_crit_edge.us, label %for.body17.us, !llvm.loop !12 for.cond19.preheader.us: ; preds = %for.body17.us %39 = load i8, ptr %arrayidx25.us, align 1, !tbaa !11 %arrayidx29.us = getelementptr inbounds [100 x [15 x i8]], ptr %sn, i64 0, i64 %indvars.iv140, i64 0 %40 = load i8, ptr %arrayidx29.us, align 1, !tbaa !11 %cmp31.us = icmp eq i8 %39, %40 br i1 %cmp31.us, label %for.cond19.us, label %for.inc67.us for.cond41.preheader.us: ; preds = %for.body17.us %41 = sub nsw i64 %indvars.iv140, %5 %42 = load i8, ptr %arrayidx48.us, align 1, !tbaa !11 %arrayidx53.us = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %41, i64 0 %43 = load i8, ptr %arrayidx53.us, align 1, !tbaa !11 %cmp55.us = icmp eq i8 %42, %43 br i1 %cmp55.us, label %for.cond41.us, label %for.inc67.us for.cond15.for.end69_crit_edge.us: ; preds = %for.inc67.us %spec.select104.us = call i32 @llvm.smax.i32(i32 %sum.1.us, i32 %ans.0125.us) %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147 br i1 %exitcond148.not, label %for.end76, label %for.cond15.preheader.us, !llvm.loop !13 for.body5: ; preds = %for.end, %for.body5 %indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.body5 ], [ 0, %for.end ] %arrayidx7 = getelementptr inbounds [100 x [15 x i8]], ptr %sm, i64 0, i64 %indvars.iv131 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %44 = load i32, ptr %m, align 4, !tbaa !5 %45 = sext i32 %44 to i64 %cmp4 = icmp slt i64 %indvars.iv.next132, %45 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !14 for.end76: ; preds = %for.cond15.for.end69_crit_edge.us, %for.cond15.preheader.lr.ph, %for.cond12.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ %spec.select104.us, %for.cond15.for.end69_crit_edge.us ] %call77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1500, ptr nonnull %sm) #5 call void @llvm.lifetime.end.p0(i64 1500, ptr nonnull %sn) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #include <string.h> #define STRING_LEN 15 #define ARRAY_SIZE 300 typedef struct { char str[STRING_LEN+1]; int cnt; } Str; Str array[ARRAY_SIZE]; int array_top = 0; void search_str(const char* buf, int point) { for(int i = 0; i < array_top; i++) { if(strcmp(buf, array[i].str) == 0) { array[i].cnt += point; return; } } strncpy(array[array_top].str, buf, STRING_LEN+1); array[array_top].cnt += point; array_top++; } int find_largest() { int largest = 0; for(int i = 0; i < array_top; i++) { if(largest < array[i].cnt) { largest = array[i].cnt; } } return largest; } int main() { int n; char lf; scanf("%d%c", &n, &lf); memset(array, 0, sizeof(array)); char buf[STRING_LEN+1]; for(int i = 0; i < n; i++) { fgets(buf, sizeof(buf), stdin); search_str(buf, 1); } int m; scanf("%d%c", &m, &lf); for(int i = 0; i < m; i++) { fgets(buf, sizeof(buf), stdin); search_str(buf, -1); } printf("%d\n", find_largest()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262111/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262111/source.c" target datalayout = "e-m:e-p270: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.Str = type { [16 x i8], i32 } @array_top = dso_local local_unnamed_addr global i32 0, align 4 @array = dso_local global [300 x %struct.Str] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @search_str(ptr nocapture noundef readonly %buf, i32 noundef %point) local_unnamed_addr #0 { entry: %0 = load i32, ptr @array_top, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, 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.cond: ; preds = %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 !9 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %buf, ptr noundef nonnull dereferenceable(1) %arrayidx) #9 %cmp1 = icmp eq i32 %call, 0 br i1 %cmp1, label %cleanup, label %for.cond cleanup: ; preds = %for.body %cnt = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv, i32 1 %1 = load i32, ptr %cnt, align 4, !tbaa !11 %add = add nsw i32 %1, %point store i32 %add, ptr %cnt, align 4, !tbaa !11 br label %return for.end: ; preds = %for.cond, %entry %idxprom4 = sext i32 %0 to i64 %arrayidx5 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4 %call8 = tail call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx5, ptr noundef nonnull dereferenceable(1) %buf, i64 noundef 16) #10 %cnt11 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4, i32 1 %2 = load i32, ptr %cnt11, align 4, !tbaa !11 %add12 = add nsw i32 %2, %point store i32 %add12, ptr %cnt11, align 4, !tbaa !11 %inc13 = add nsw i32 %0, 1 store i32 %inc13, ptr @array_top, align 4, !tbaa !5 br label %return return: ; preds = %cleanup, %for.end ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @find_largest() local_unnamed_addr #4 { entry: %0 = load i32, ptr @array_top, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 9 br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %wide.trip.count, 7 %1 = icmp eq i64 %n.mod.vf, 0 %2 = select i1 %1, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count, %2 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 ], [ %34, %vector.body ] %vec.phi13 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ] %3 = or i64 %index, 1 %4 = or i64 %index, 2 %5 = or i64 %index, 3 %6 = or i64 %index, 4 %7 = or i64 %index, 5 %8 = or i64 %index, 6 %9 = or i64 %index, 7 %10 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %index, i32 1 %11 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %3, i32 1 %12 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %4, i32 1 %13 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %5, i32 1 %14 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %6, i32 1 %15 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %7, i32 1 %16 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %8, i32 1 %17 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %9, i32 1 %18 = load i32, ptr %10, align 16, !tbaa !11 %19 = load i32, ptr %11, align 4, !tbaa !11 %20 = load i32, ptr %12, align 8, !tbaa !11 %21 = load i32, ptr %13, align 4, !tbaa !11 %22 = insertelement <4 x i32> poison, i32 %18, i64 0 %23 = insertelement <4 x i32> %22, i32 %19, i64 1 %24 = insertelement <4 x i32> %23, i32 %20, i64 2 %25 = insertelement <4 x i32> %24, i32 %21, i64 3 %26 = load i32, ptr %14, align 16, !tbaa !11 %27 = load i32, ptr %15, align 4, !tbaa !11 %28 = load i32, ptr %16, align 8, !tbaa !11 %29 = load i32, ptr %17, align 4, !tbaa !11 %30 = insertelement <4 x i32> poison, i32 %26, i64 0 %31 = insertelement <4 x i32> %30, i32 %27, i64 1 %32 = insertelement <4 x i32> %31, i32 %28, i64 2 %33 = insertelement <4 x i32> %32, i32 %29, i64 3 %34 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %25) %35 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi13, <4 x i32> %33) %index.next = add nuw i64 %index, 8 %36 = icmp eq i64 %index.next, %n.vec br i1 %36, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %34, <4 x i32> %35) %37 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) br label %for.body.preheader14 for.body.preheader14: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %largest.010.ph = phi i32 [ 0, %for.body.preheader ], [ %37, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %largest.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] ret i32 %largest.0.lcssa for.body: ; preds = %for.body.preheader14, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ] %largest.010 = phi i32 [ %spec.select, %for.body ], [ %largest.010.ph, %for.body.preheader14 ] %cnt = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv, i32 1 %38 = load i32, ptr %cnt, align 4, !tbaa !11 %spec.select = tail call i32 @llvm.smax.i32(i32 %largest.010, i32 %38) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !16 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %n = alloca i32, align 4 %lf = alloca i8, align 1 %buf = alloca [16 x i8], align 16 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %lf) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %lf) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(6000) @array, i8 0, i64 6000, i1 false) call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %buf) #10 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %search_str.exit, %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #10 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %lf) %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp652 = icmp sgt i32 %1, 0 br i1 %cmp652, label %for.body8, label %for.cond.cleanup.for.cond.cleanup7_crit_edge for.cond.cleanup.for.cond.cleanup7_crit_edge: ; preds = %for.cond.cleanup %.pre = load i32, ptr @array_top, align 4, !tbaa !5 br label %for.cond.cleanup7 for.body: ; preds = %entry, %search_str.exit %i.051 = phi i32 [ %inc, %search_str.exit ], [ 0, %entry ] %2 = load ptr, ptr @stdin, align 8, !tbaa !17 %call1 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 16, ptr noundef %2) %3 = load i32, ptr @array_top, align 4, !tbaa !5 %cmp23.i = icmp sgt i32 %3, 0 br i1 %cmp23.i, label %for.body.preheader.i, label %for.end.i for.body.preheader.i: ; preds = %for.body %wide.trip.count.i = zext i32 %3 to i64 br label %for.body.i for.cond.i: ; preds = %for.body.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.end.i, label %for.body.i, !llvm.loop !9 for.body.i: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ] %arrayidx.i = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv.i %call.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %buf, ptr noundef nonnull dereferenceable(1) %arrayidx.i) #9 %cmp1.i = icmp eq i32 %call.i, 0 br i1 %cmp1.i, label %cleanup.i, label %for.cond.i cleanup.i: ; preds = %for.body.i %cnt.i = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv.i, i32 1 %4 = load i32, ptr %cnt.i, align 4, !tbaa !11 br label %search_str.exit for.end.i: ; preds = %for.cond.i, %for.body %idxprom4.i = sext i32 %3 to i64 %arrayidx5.i = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4.i %call8.i = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx5.i, ptr noundef nonnull dereferenceable(1) %buf, i64 noundef 16) #10 %cnt11.i = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4.i, i32 1 %5 = load i32, ptr %cnt11.i, align 4, !tbaa !11 %add12.i = add nsw i32 %5, 1 store i32 %add12.i, ptr %cnt11.i, align 4, !tbaa !11 br label %search_str.exit search_str.exit: ; preds = %cleanup.i, %for.end.i %.sink = phi i32 [ %4, %cleanup.i ], [ %3, %for.end.i ] %cnt.i.sink = phi ptr [ %cnt.i, %cleanup.i ], [ @array_top, %for.end.i ] %add.i = add nsw i32 %.sink, 1 store i32 %add.i, ptr %cnt.i.sink, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.051, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 for.cond.cleanup7: ; preds = %search_str.exit47, %for.cond.cleanup.for.cond.cleanup7_crit_edge %7 = phi i32 [ %.pre, %for.cond.cleanup.for.cond.cleanup7_crit_edge ], [ %50, %search_str.exit47 ] %cmp9.i = icmp sgt i32 %7, 0 br i1 %cmp9.i, label %for.body.preheader.i19, label %find_largest.exit for.body.preheader.i19: ; preds = %for.cond.cleanup7 %wide.trip.count.i20 = zext i32 %7 to i64 %min.iters.check = icmp ult i32 %7, 9 br i1 %min.iters.check, label %for.body.i21.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i19 %n.mod.vf = and i64 %wide.trip.count.i20, 7 %8 = icmp eq i64 %n.mod.vf, 0 %9 = select i1 %8, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count.i20, %9 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 ], [ %41, %vector.body ] %vec.phi60 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ] %10 = or i64 %index, 1 %11 = or i64 %index, 2 %12 = or i64 %index, 3 %13 = or i64 %index, 4 %14 = or i64 %index, 5 %15 = or i64 %index, 6 %16 = or i64 %index, 7 %17 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %index, i32 1 %18 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %10, i32 1 %19 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %11, i32 1 %20 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %12, i32 1 %21 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %13, i32 1 %22 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %14, i32 1 %23 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %15, i32 1 %24 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %16, i32 1 %25 = load i32, ptr %17, align 16, !tbaa !11 %26 = load i32, ptr %18, align 4, !tbaa !11 %27 = load i32, ptr %19, align 8, !tbaa !11 %28 = load i32, ptr %20, align 4, !tbaa !11 %29 = insertelement <4 x i32> poison, i32 %25, i64 0 %30 = insertelement <4 x i32> %29, i32 %26, i64 1 %31 = insertelement <4 x i32> %30, i32 %27, i64 2 %32 = insertelement <4 x i32> %31, i32 %28, i64 3 %33 = load i32, ptr %21, align 16, !tbaa !11 %34 = load i32, ptr %22, align 4, !tbaa !11 %35 = load i32, ptr %23, align 8, !tbaa !11 %36 = load i32, ptr %24, align 4, !tbaa !11 %37 = insertelement <4 x i32> poison, i32 %33, i64 0 %38 = insertelement <4 x i32> %37, i32 %34, i64 1 %39 = insertelement <4 x i32> %38, i32 %35, i64 2 %40 = insertelement <4 x i32> %39, i32 %36, i64 3 %41 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %32) %42 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi60, <4 x i32> %40) %index.next = add nuw i64 %index, 8 %43 = icmp eq i64 %index.next, %n.vec br i1 %43, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %41, <4 x i32> %42) %44 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) br label %for.body.i21.preheader for.body.i21.preheader: ; preds = %for.body.preheader.i19, %middle.block %indvars.iv.i22.ph = phi i64 [ 0, %for.body.preheader.i19 ], [ %n.vec, %middle.block ] %largest.010.i.ph = phi i32 [ 0, %for.body.preheader.i19 ], [ %44, %middle.block ] br label %for.body.i21 for.body.i21: ; preds = %for.body.i21.preheader, %for.body.i21 %indvars.iv.i22 = phi i64 [ %indvars.iv.next.i24, %for.body.i21 ], [ %indvars.iv.i22.ph, %for.body.i21.preheader ] %largest.010.i = phi i32 [ %spec.select.i, %for.body.i21 ], [ %largest.010.i.ph, %for.body.i21.preheader ] %cnt.i23 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv.i22, i32 1 %45 = load i32, ptr %cnt.i23, align 4, !tbaa !11 %spec.select.i = call i32 @llvm.smax.i32(i32 %largest.010.i, i32 %45) %indvars.iv.next.i24 = add nuw nsw i64 %indvars.iv.i22, 1 %exitcond.not.i25 = icmp eq i64 %indvars.iv.next.i24, %wide.trip.count.i20 br i1 %exitcond.not.i25, label %find_largest.exit, label %for.body.i21, !llvm.loop !21 find_largest.exit: ; preds = %for.body.i21, %for.cond.cleanup7 %largest.0.lcssa.i = phi i32 [ 0, %for.cond.cleanup7 ], [ %spec.select.i, %for.body.i21 ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %largest.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #10 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %buf) #10 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %lf) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 for.body8: ; preds = %for.cond.cleanup, %search_str.exit47 %i4.053 = phi i32 [ %inc13, %search_str.exit47 ], [ 0, %for.cond.cleanup ] %46 = load ptr, ptr @stdin, align 8, !tbaa !17 %call10 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 16, ptr noundef %46) %47 = load i32, ptr @array_top, align 4, !tbaa !5 %cmp23.i26 = icmp sgt i32 %47, 0 br i1 %cmp23.i26, label %for.body.preheader.i34, label %for.end.i27 for.body.preheader.i34: ; preds = %for.body8 %wide.trip.count.i35 = zext i32 %47 to i64 br label %for.body.i36 for.cond.i41: ; preds = %for.body.i36 %indvars.iv.next.i42 = add nuw nsw i64 %indvars.iv.i37, 1 %exitcond.not.i43 = icmp eq i64 %indvars.iv.next.i42, %wide.trip.count.i35 br i1 %exitcond.not.i43, label %for.end.i27, label %for.body.i36, !llvm.loop !9 for.body.i36: ; preds = %for.cond.i41, %for.body.preheader.i34 %indvars.iv.i37 = phi i64 [ 0, %for.body.preheader.i34 ], [ %indvars.iv.next.i42, %for.cond.i41 ] %arrayidx.i38 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv.i37 %call.i39 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %buf, ptr noundef nonnull dereferenceable(1) %arrayidx.i38) #9 %cmp1.i40 = icmp eq i32 %call.i39, 0 br i1 %cmp1.i40, label %cleanup.i44, label %for.cond.i41 cleanup.i44: ; preds = %for.body.i36 %cnt.i45 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %indvars.iv.i37, i32 1 %48 = load i32, ptr %cnt.i45, align 4, !tbaa !11 %add.i46 = add nsw i32 %48, -1 store i32 %add.i46, ptr %cnt.i45, align 4, !tbaa !11 br label %search_str.exit47 for.end.i27: ; preds = %for.cond.i41, %for.body8 %idxprom4.i28 = sext i32 %47 to i64 %arrayidx5.i29 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4.i28 %call8.i30 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx5.i29, ptr noundef nonnull dereferenceable(1) %buf, i64 noundef 16) #10 %cnt11.i31 = getelementptr inbounds [300 x %struct.Str], ptr @array, i64 0, i64 %idxprom4.i28, i32 1 %49 = load i32, ptr %cnt11.i31, align 4, !tbaa !11 %add12.i32 = add nsw i32 %49, -1 store i32 %add12.i32, ptr %cnt11.i31, align 4, !tbaa !11 %inc13.i33 = add nsw i32 %47, 1 store i32 %inc13.i33, ptr @array_top, align 4, !tbaa !5 br label %search_str.exit47 search_str.exit47: ; preds = %cleanup.i44, %for.end.i27 %50 = phi i32 [ %47, %cleanup.i44 ], [ %inc13.i33, %for.end.i27 ] %inc13 = add nuw nsw i32 %i4.053, 1 %51 = load i32, ptr %m, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc13, %51 br i1 %cmp6, label %for.body8, label %for.cond.cleanup7, !llvm.loop !22 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; 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 <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #8 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = !{!12, !6, i64 16} !12 = !{!"", !7, i64 0, !6, i64 16} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = !{!18, !18, i64 0} !18 = !{!"any pointer", !7, i64 0} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10, !14, !15} !21 = distinct !{!21, !10, !15, !14} !22 = distinct !{!22, !10}
#include<stdio.h> #include<stdint.h> #include<inttypes.h> #define MOD 1000000007 #define modml(rhs,lhs) (1ll * (rhs) * (lhs) % (MOD)) #define modadd(rhs,lhs) (((rhs) + (lhs)) % (MOD)) static inline long modpow(long num,long ind){ unsigned long u_ind = ind; long res = 1; while(u_ind){ if(u_ind & 1ul)res = modml(res,num); num = modml(num,num); u_ind >>= 1; } return res; } int main(void){ register int i,j; register uint64_t bitc; long n,tmp; long ans = 0; scanf("%ld",&n); uint64_t a[n]; for(i = 0;i < n;i++)scanf("%"SCNu64,&a[i]); for(i = 0;i < 60;i++){ bitc = 1ull << i; tmp = 0; for(j = 0;j < n;j++)if(a[j] & bitc)tmp++; ans = modadd(ans,modml(modpow(2,i),modml(tmp,n-tmp))); } printf("%ld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262162/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262162/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lu\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp40 = icmp sgt i64 %2, 0 br i1 %cmp40, label %for.body, label %for.end27 for.cond3.preheader: ; preds = %for.body %cmp943 = icmp sgt i64 %15, 0 br i1 %cmp943, label %for.body6.us.preheader, label %for.end27 for.body6.us.preheader: ; preds = %for.cond3.preheader %min.iters.check = icmp ult i64 %15, 4 %n.vec = and i64 %15, -4 %cmp.n = icmp eq i64 %15, %n.vec br label %for.body6.us for.body6.us: ; preds = %for.body6.us.preheader, %modpow.exit.us %indvars.iv56 = phi i64 [ %indvars.iv.next57, %modpow.exit.us ], [ 0, %for.body6.us.preheader ] %ans.048.us = phi i64 [ %rem24.us, %modpow.exit.us ], [ 0, %for.body6.us.preheader ] br i1 %min.iters.check, label %for.body11.us.preheader, label %vector.ph vector.ph: ; preds = %for.body6.us %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %indvars.iv56, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi62 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %3 = getelementptr inbounds i64, ptr %vla, i64 %index %wide.load = load <2 x i64>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i64, ptr %3, i64 2 %wide.load63 = load <2 x i64>, ptr %4, align 16, !tbaa !5 %5 = lshr <2 x i64> %wide.load, %broadcast.splat %6 = lshr <2 x i64> %wide.load63, %broadcast.splat %7 = and <2 x i64> %5, <i64 1, i64 1> %8 = and <2 x i64> %6, <i64 1, i64 1> %9 = add <2 x i64> %7, %vec.phi %10 = add <2 x i64> %8, %vec.phi62 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) br i1 %cmp.n, label %for.cond7.for.end17_crit_edge.us, label %for.body11.us.preheader for.body11.us.preheader: ; preds = %for.body6.us, %middle.block %indvars.iv53.ph = phi i64 [ 0, %for.body6.us ], [ %n.vec, %middle.block ] %tmp.045.us.ph = phi i64 [ 0, %for.body6.us ], [ %12, %middle.block ] br label %for.body11.us while.body.i.us: ; preds = %for.cond7.for.end17_crit_edge.us, %if.end.i.us %res.014.i.us = phi i64 [ %res.1.i.us, %if.end.i.us ], [ 1, %for.cond7.for.end17_crit_edge.us ] %u_ind.013.i.us = phi i64 [ %shr.i.us, %if.end.i.us ], [ %indvars.iv56, %for.cond7.for.end17_crit_edge.us ] %num.addr.012.i.us = phi i64 [ %rem5.i.us, %if.end.i.us ], [ 2, %for.cond7.for.end17_crit_edge.us ] %and.i.us = and i64 %u_ind.013.i.us, 1 %tobool1.not.i.us = icmp eq i64 %and.i.us, 0 br i1 %tobool1.not.i.us, label %if.end.i.us, label %if.then.i.us if.then.i.us: ; preds = %while.body.i.us %mul2.i.us = mul nsw i64 %num.addr.012.i.us, %res.014.i.us %rem.i.us = srem i64 %mul2.i.us, 1000000007 br label %if.end.i.us if.end.i.us: ; preds = %if.then.i.us, %while.body.i.us %res.1.i.us = phi i64 [ %rem.i.us, %if.then.i.us ], [ %res.014.i.us, %while.body.i.us ] %mul4.i.us = mul nuw nsw i64 %num.addr.012.i.us, %num.addr.012.i.us %rem5.i.us = urem i64 %mul4.i.us, 1000000007 %shr.i.us = lshr i64 %u_ind.013.i.us, 1 %tobool.not.i.us = icmp ult i64 %u_ind.013.i.us, 2 br i1 %tobool.not.i.us, label %modpow.exit.us, label %while.body.i.us, !llvm.loop !13 modpow.exit.us: ; preds = %if.end.i.us, %for.cond7.for.end17_crit_edge.us %res.0.lcssa.i.us = phi i64 [ 1, %for.cond7.for.end17_crit_edge.us ], [ %res.1.i.us, %if.end.i.us ] %sub.us = sub nsw i64 %15, %spec.select.us.lcssa %mul21.us = mul nsw i64 %sub.us, %spec.select.us.lcssa %rem.us = srem i64 %mul21.us, 1000000007 %mul22.us = mul nsw i64 %res.0.lcssa.i.us, %rem.us %rem23.us = srem i64 %mul22.us, 1000000007 %add.us = add nsw i64 %rem23.us, %ans.048.us %rem24.us = srem i64 %add.us, 1000000007 %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %exitcond59.not = icmp eq i64 %indvars.iv.next57, 60 br i1 %exitcond59.not, label %for.end27, label %for.body6.us, !llvm.loop !14 for.body11.us: ; preds = %for.body11.us.preheader, %for.body11.us %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body11.us ], [ %indvars.iv53.ph, %for.body11.us.preheader ] %tmp.045.us = phi i64 [ %spec.select.us, %for.body11.us ], [ %tmp.045.us.ph, %for.body11.us.preheader ] %arrayidx13.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv53 %13 = load i64, ptr %arrayidx13.us, align 8, !tbaa !5 %14 = lshr i64 %13, %indvars.iv56 %inc14.us = and i64 %14, 1 %spec.select.us = add nuw nsw i64 %inc14.us, %tmp.045.us %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %exitcond.not = icmp eq i64 %indvars.iv.next54, %15 br i1 %exitcond.not, label %for.cond7.for.end17_crit_edge.us, label %for.body11.us, !llvm.loop !15 for.cond7.for.end17_crit_edge.us: ; preds = %for.body11.us, %middle.block %spec.select.us.lcssa = phi i64 [ %12, %middle.block ], [ %spec.select.us, %for.body11.us ] %tobool.not11.i.us = icmp eq i64 %indvars.iv56, 0 br i1 %tobool.not11.i.us, label %modpow.exit.us, label %while.body.i.us for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp sgt i64 %15, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !16 for.end27: ; preds = %modpow.exit.us, %entry, %for.cond3.preheader %.us-phi = phi i64 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %rem24.us, %modpow.exit.us ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.us-phi) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10}
#include<stdio.h> int main() { int k,j, r, n; scanf("%d%d",&k,&r); for (int i=1;i<=9;i++) { j = i* k; if (j%10 == r || j%10 == 0) { printf("%d",i); return 0; } } printf("10"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26222/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26222/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"10\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %r) %0 = load i32, ptr %k, align 4, !tbaa !5 %1 = load i32, ptr %r, align 4, !tbaa !5 %rem = srem i32 %0, 10 %cmp1 = icmp eq i32 %rem, %1 %cmp3 = icmp eq i32 %rem, 0 %or.cond = or i1 %cmp1, %cmp3 br i1 %or.cond, label %if.then, label %for.inc if.then: ; preds = %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry %i.015.lcssa = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ 9, %for.inc.7 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.015.lcssa) br label %cleanup6 for.inc: ; preds = %entry %mul.1 = shl nsw i32 %0, 1 %rem.1 = srem i32 %mul.1, 10 %cmp1.1 = icmp eq i32 %rem.1, %1 %cmp3.1 = icmp eq i32 %rem.1, 0 %or.cond.1 = or i1 %cmp1.1, %cmp3.1 br i1 %or.cond.1, label %if.then, label %for.inc.1 for.inc.1: ; preds = %for.inc %mul.2 = mul nsw i32 %0, 3 %rem.2 = srem i32 %mul.2, 10 %cmp1.2 = icmp eq i32 %rem.2, %1 %cmp3.2 = icmp eq i32 %rem.2, 0 %or.cond.2 = or i1 %cmp1.2, %cmp3.2 br i1 %or.cond.2, label %if.then, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %mul.3 = shl nsw i32 %0, 2 %rem.3 = srem i32 %mul.3, 10 %cmp1.3 = icmp eq i32 %rem.3, %1 %cmp3.3 = icmp eq i32 %rem.3, 0 %or.cond.3 = or i1 %cmp1.3, %cmp3.3 br i1 %or.cond.3, label %if.then, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %mul.4 = mul nsw i32 %0, 5 %rem.4 = srem i32 %mul.4, 10 %cmp1.4 = icmp eq i32 %rem.4, %1 %cmp3.4 = icmp eq i32 %rem.4, 0 %or.cond.4 = or i1 %cmp1.4, %cmp3.4 br i1 %or.cond.4, label %if.then, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %mul.5 = mul nsw i32 %0, 6 %rem.5 = srem i32 %mul.5, 10 %cmp1.5 = icmp eq i32 %rem.5, %1 %cmp3.5 = icmp eq i32 %rem.5, 0 %or.cond.5 = or i1 %cmp1.5, %cmp3.5 br i1 %or.cond.5, label %if.then, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %mul.6 = mul nsw i32 %0, 7 %rem.6 = srem i32 %mul.6, 10 %cmp1.6 = icmp eq i32 %rem.6, %1 %cmp3.6 = icmp eq i32 %rem.6, 0 %or.cond.6 = or i1 %cmp1.6, %cmp3.6 br i1 %or.cond.6, label %if.then, label %for.inc.6 for.inc.6: ; preds = %for.inc.5 %mul.7 = shl nsw i32 %0, 3 %rem.7 = srem i32 %mul.7, 10 %cmp1.7 = icmp eq i32 %rem.7, %1 %cmp3.7 = icmp eq i32 %rem.7, 0 %or.cond.7 = or i1 %cmp1.7, %cmp3.7 br i1 %or.cond.7, label %if.then, label %for.inc.7 for.inc.7: ; preds = %for.inc.6 %mul.8 = mul nsw i32 %0, 9 %rem.8 = srem i32 %mul.8, 10 %cmp1.8 = icmp eq i32 %rem.8, %1 %cmp3.8 = icmp eq i32 %rem.8, 0 %or.cond.8 = or i1 %cmp1.8, %cmp3.8 br i1 %or.cond.8, label %if.then, label %for.inc.8 for.inc.8: ; preds = %for.inc.7 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup6 cleanup6: ; preds = %if.then, %for.inc.8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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"}
#include<stdio.h> int main(){ double r; double s; double l; scanf("%lf", &r); s = r * r * 3.141592653589; l = 2 * r * 3.141592653589; printf("%lf %lf\n", s, l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262263/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262263/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> int main(void){ double r; scanf("%lf", &r); printf("%lf %lf\n", M_PI * r * r, 2 * M_PI * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262306/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262306/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include<math.h> int main(){ double i; scanf("%lf",&i); printf("%f %f\n",i*i*M_PI,i*2*M_PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262407/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262407/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load double, ptr %i, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #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) { double r,men,syu; scanf("%lf",&r); men=r*r*3.141592653589; syu=2*r*3.141592653589; printf("%f %f",men,syu); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262450/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262450/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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) { // your code goes here double r; double a,l; scanf("%lf",&r); a = 3.141592653589 * r * r; l = 2 * r * 3.141592653589; printf("%f %f\n",a,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262494/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262494/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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){ double r; scanf("%lf",&r); printf("%.5lf %.5lf\n",r*r*3.141592653589,2*r*3.141592653689); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262537/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262537/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.5lf %.5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB544795BA %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> int main(void) { double r; scanf("%lf", &r); printf("%f %f", M_PI*pow(r,2), 2*M_PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262580/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262580/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %square = fmul double %0, %0 %mul = fmul double %square, 0x400921FB54442D18 %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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() { double r, l, s; double pi = 3.141592653589; scanf("%lf", &r); l = 2 * pi * r; s = pi * r * r; printf("%f %f\n", s, l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262623/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262623/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul1 = fmul double %0, 0x401921FB5444261E %mul2 = fmul double %0, 0x400921FB5444261E %mul3 = fmul double %0, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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){ double r; scanf("%lf",&r); printf("%.6f ",3.14159265358979*r*r); printf("%.6f\n",2*3.14159265358979*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262667/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262667/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%.6f \00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D11 %mul1 = fmul double %0, %mul %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1) %1 = load double, ptr %r, align 8, !tbaa !5 %mul3 = fmul double %1, 0x401921FB54442D11 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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() { int n,m,i,j=0,d; scanf("%d %d",&n,&m); for(i=1; j!=1 ;i++) { d=(n*i); if((d%10==m)||(d%10==0)) { //printf("%d\n",n); printf("%d\n",i); j=1; } } // printf("%d",i); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26271/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 br label %for.body for.body: ; preds = %for.body, %entry %i.08 = phi i32 [ 1, %entry ], [ %inc, %for.body ] %mul = mul nsw i32 %0, %i.08 %rem = srem i32 %mul, 10 %cmp1 = icmp eq i32 %rem, %1 %cmp3 = icmp eq i32 %rem, 0 %or.cond = or i1 %cmp1, %cmp3 %inc = add nuw nsw i32 %i.08, 1 br i1 %or.cond, label %for.end, label %for.body for.end: ; preds = %for.body %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.08) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ double r; scanf("%lf",&r); printf("%lf %lf\n",r*r*3.14159265358979323846,2*3.14159265358979323846*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262753/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262753/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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(){ double r,pi=3.141592653589; scanf("%lf",&r); printf("%f %f\n",pi*r*r,2*r*pi); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262803/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262803/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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(){ double r,l,s; scanf("%lf",&r); l=2*r*3.141592653589; s=r*r*3.141592653589; printf("%f %f\n",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262847/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262847/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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(){ double r, i; i=3.14159265359; scanf("%lf", &r); printf("%f %f\n", i*r*r, 2*i*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262890/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262890/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442EEA %mul1 = fmul double %0, %mul %mul3 = fmul double %0, 0x401921FB54442EEA %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> int main(void) { double r; double menseki; double syuu; scanf("%lf",&r); menseki=r*r*3.14159265358979323846; syuu=r*2*3.14159265358979323846; printf("%lf %lf\n", menseki, syuu); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262933/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262933/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define p 3.14159265359 int main() { double r; while (1) { scanf("%lf", &r); if (0 < r&&r < 10000) break; } printf("%.6lf %.6lf\n", (r*r)*p, (r * 2) * p); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262977/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262977/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.6lf %.6lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 br label %while.cond while.cond: ; preds = %while.cond, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8 %cmp = fcmp ogt double %0, 0.000000e+00 %cmp1 = fcmp olt double %0, 1.000000e+04 %or.cond = and i1 %cmp, %cmp1 br i1 %or.cond, label %while.end, label %while.cond while.end: ; preds = %while.cond %mul = fmul double %0, %0 %mul2 = fmul double %mul, 0x400921FB54442EEA %mul3 = fmul double %0, 2.000000e+00 %mul4 = fmul double %mul3, 0x400921FB54442EEA %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul4) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> #include <math.h> int main(void){ double r; scanf("%lf", &r); printf("%lf %lf\n", M_PI * r * r, 2 * M_PI * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263019/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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){ double r; scanf("%lf",&r); printf("%f\n",3.141592653589*r*r); printf("%f\n",2*3.141592653589*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263062/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1) %1 = load double, ptr %r, align 8, !tbaa !5 %mul3 = fmul double %1, 0x401921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include<math.h> int main(){ double r; scanf("%lf",&r); printf("%lf %lf\n",r*r*M_PI,2.0*r*M_PI); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> int main() { double r, a, b; scanf("%lf", &r); a = r * r * M_PI; b = 2 * r * M_PI; printf("%f %f", a, b); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263156/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263156/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long long int in, max, rem, temp, cnt=0; scanf("%lld",&in); for(rem=in;rem!=0;rem=rem%max){ for(max=1;max<=rem;max*=2); max=max/2; cnt++; } printf("%lld\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2632/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %in = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %in) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %0 = load i64, ptr %in, align 8, !tbaa !5 %cmp.not15 = icmp eq i64 %0, 0 br i1 %cmp.not15, label %for.end6, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.end %cnt.017 = phi i64 [ %inc, %for.end ], [ 0, %entry ] %rem.016 = phi i64 [ %rem5, %for.end ], [ %0, %entry ] br label %for.cond1 for.cond1: ; preds = %for.cond1, %for.cond1.preheader %max.0 = phi i64 [ %mul, %for.cond1 ], [ 1, %for.cond1.preheader ] %cmp2.not = icmp sgt i64 %max.0, %rem.016 %mul = shl nsw i64 %max.0, 1 br i1 %cmp2.not, label %for.end, label %for.cond1, !llvm.loop !9 for.end: ; preds = %for.cond1 %div14 = lshr exact i64 %max.0, 1 %inc = add nuw nsw i64 %cnt.017, 1 %rem5 = srem i64 %rem.016, %div14 %cmp.not = icmp eq i64 %rem5, 0 br i1 %cmp.not, label %for.end6, label %for.cond1.preheader, !llvm.loop !11 for.end6: ; preds = %for.end, %entry %cnt.0.lcssa = phi i64 [ 0, %entry ], [ %inc, %for.end ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %in) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { double r,area,circum; scanf("%lf",&r); area = 3.141592653589*r*r; circum = 2*3.141592653589*r; printf("%.6lf %.6lf\n",area,circum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263242/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263242/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.6lf %.6lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define PI 3.141592653589 int main(void){ double r; scanf("%lf",&r); printf("%lf %lf\n",PI*r*r,2*PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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(int argc, const char * argv[]) { double r; scanf("%lf",&r); printf("%f %f\n",r*r*3.141592653589,2*r*3.141592653589); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263329/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263329/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\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: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> #define PI 3.141592653589 int main(void){ double r; scanf("%lf", &r); printf("%f %f\n", PI*r*r,2*PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263372/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263372/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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) { double r,i,s,x; scanf("%lf",&r); s=3.141592653589*r*r; x=2*3.141592653589*r; printf("%.8lf %.8lf\n",s,x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263415/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263415/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.8lf %.8lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define pi 3.14159265358979 int main(void){ double r; scanf("%lf", &r); printf("%.6f %.6f\n", pi*r*r, 2*pi*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263480/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%.6f %.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D11 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D11 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define PI 3.141592653589 int main(void) { double r; scanf("%lf", &r); printf("%.5lf %.5lf\n", PI*r*r, 2*PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263530/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.5lf %.5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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){ double r,k,s,l; k=3.141592653589; scanf("%lf",&r); s=r*r*k; l=2*r*k; printf("%f %f",s,l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263574/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%f %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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) { double r,p=3.141592653589,area,circ; scanf("%lf",&r); area=r*r*p; circ=2*r*p; printf("%f %f\n",area,circ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263617/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263617/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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) { double r; scanf("%lf", &r); printf("%f %f\n", r*r *3.141592653589, r*2*3.141592653589); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263660/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define PI 3.141592653589 int main() { double r; scanf("%lf", &r); printf("%f %f\n", PI * r * r, 2 * PI * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263710/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define pie 3.141592653589 int main(void) { double r; scanf("%lf", &r); printf("%f %f\n", (pie * r) * r, (2 * pie) * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263776/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define pi 3.141592653589 int main(void) { double r,a,b; scanf("%lf",&r); a=2*r*pi; b=r*r*pi; printf("%f ",b); printf("%f\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263819/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263819/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 2.000000e+00 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, %0 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3) %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %mul1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #define PI 3.14159265359 int main(void) { double r; scanf("%lf",&r); printf("%f %f\n",r*r*PI,r*2*PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263862/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263862/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442EEA %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442EEA %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> #include <math.h> int main() { double r; scanf("%lf",&r); printf("%lf %lf\n",r * r*M_PI,2 * r * M_PI); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263905/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263905/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442D18 %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442D18 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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> // (1800M + 100N) * 2^M int main(void) { int n, m; scanf("%d%d", &n, &m); printf("%d", (1800 * m + 100 * n) << m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263970/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263970/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %mul = mul nsw i32 %0, 1800 %1 = load i32, ptr %n, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, 100 %add = add nsw i32 %mul1, %mul %shl = shl i32 %add, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %shl) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int t; scanf("%d", &t); for(;t>0;t--){ int n; scanf("%d", &n); printf("%d\n", n); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26402/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26402/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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) %.pr = load i32, ptr %t, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %for.body, label %for.end for.body: ; preds = %entry, %for.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %1 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %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(){ char n1[30]; char n2[30]; char n3[30]; scanf("%s %s %s", n1, n2, n3); printf("%c%c%c\n", n1[0]-32, n2[0]-32, n3[0]-32); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264070/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n1 = alloca [30 x i8], align 16 %n2 = alloca [30 x i8], align 16 %n3 = alloca [30 x i8], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %n1) #3 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %n2) #3 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %n3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3) %0 = load i8, ptr %n1, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %sub = add nsw i32 %conv, -32 %1 = load i8, ptr %n2, align 16, !tbaa !5 %conv4 = sext i8 %1 to i32 %sub5 = add nsw i32 %conv4, -32 %2 = load i8, ptr %n3, align 16, !tbaa !5 %conv7 = sext i8 %2 to i32 %sub8 = add nsw i32 %conv7, -32 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub, i32 noundef %sub5, i32 noundef %sub8) call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %n3) #3 call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %n2) #3 call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %n1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char s1[10],s2[10],s3[10]; scanf("%s%s%s",s1,s2,s3); char c1=s1[0]-32,c2=s2[0]-32,c3=s3[0]-32; printf("%c%c%c\n",c1,c2,c3); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s1 = alloca [10 x i8], align 1 %s2 = alloca [10 x i8], align 1 %s3 = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s1) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s2) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) %0 = load i8, ptr %s1, align 1, !tbaa !5 %sub = add i8 %0, -32 %1 = load i8, ptr %s2, align 1, !tbaa !5 %sub6 = add i8 %1, -32 %2 = load i8, ptr %s3, align 1, !tbaa !5 %sub10 = add i8 %2, -32 %conv12 = sext i8 %sub to i32 %conv13 = sext i8 %sub6 to i32 %conv14 = sext i8 %sub10 to i32 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv12, i32 noundef %conv13, i32 noundef %conv14) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s3) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s2) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char a[10],b[10],c[10]; scanf("%s %s %s",&a,&b,&c); a[0] = a[0] - 0x20; b[0] = b[0] - 0x20; c[0] = c[0] - 0x20; printf("%c%c%c\n",a[0],b[0],c[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10 x i8], align 1 %b = alloca [10 x i8], align 1 %c = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i8, ptr %a, align 1, !tbaa !5 %sub = add i8 %0, -32 store i8 %sub, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %sub5 = add i8 %1, -32 store i8 %sub5, ptr %b, align 1, !tbaa !5 %2 = load i8, ptr %c, align 1, !tbaa !5 %sub10 = add i8 %2, -32 store i8 %sub10, ptr %c, align 1, !tbaa !5 %conv14 = sext i8 %sub to i32 %conv16 = sext i8 %sub5 to i32 %conv18 = sext i8 %sub10 to i32 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv14, i32 noundef %conv16, i32 noundef %conv18) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 10, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <ctype.h> int main() { char s1[11] = { '\0' }; char s2[11] = { '\0' }; char s3[11] = { '\0' }; scanf("%s %s %s", s1, s2, s3); printf("%c%c%c", toupper(s1[0]), toupper(s2[0]), toupper(s3[0])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264207/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%c%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s1 = alloca [11 x i8], align 1 %s2 = alloca [11 x i8], align 1 %s3 = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s1) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(11) %s1, i8 0, i64 11, i1 false) call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s2) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(11) %s2, i8 0, i64 11, i1 false) call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s3) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(11) %s3, i8 0, i64 11, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) %call3 = tail call ptr @__ctype_toupper_loc() #6 %0 = load ptr, ptr %call3, align 8, !tbaa !5 %1 = load i8, ptr %s1, align 1, !tbaa !9 %idxprom = sext i8 %1 to i64 %arrayidx4 = getelementptr inbounds i32, ptr %0, i64 %idxprom %2 = load i32, ptr %arrayidx4, align 4, !tbaa !10 %3 = load i8, ptr %s2, align 1, !tbaa !9 %idxprom9 = sext i8 %3 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %0, i64 %idxprom9 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !10 %5 = load i8, ptr %s3, align 1, !tbaa !9 %idxprom16 = sext i8 %5 to i64 %arrayidx17 = getelementptr inbounds i32, ptr %0, i64 %idxprom16 %6 = load i32, ptr %arrayidx17, align 4, !tbaa !10 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %4, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s3) #5 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s2) #5 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s1) #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 nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_toupper_loc() 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !7, i64 0}
#include<stdio.h> #include<math.h> int main(){ long a,b,n; scanf("%ld %ld %ld",&a,&b,&n); long x,ans; if(n>=b){ x=b-1; }else{ x=n; } ans = floor(a*x/b)-a*floor(x/b); printf("%ld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264250/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp.not = icmp slt i64 %0, %1 %sub = add nsw i64 %1, -1 %x.0 = select i1 %cmp.not, i64 %0, i64 %sub %2 = load i64, ptr %a, align 8, !tbaa !5 %mul = mul nsw i64 %x.0, %2 %div = sdiv i64 %mul, %1 %conv = sitofp i64 %div to double %conv1 = sitofp i64 %2 to double %div2 = sdiv i64 %x.0, %1 %conv3 = sitofp i64 %div2 to double %neg = fneg double %conv1 %3 = call double @llvm.fmuladd.f64(double %neg, double %conv3, double %conv) %conv5 = fptosi double %3 to i64 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv5) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ long long int a,b,n; scanf("%lld%lld%lld",&a,&b,&n); //xの制約は 0からb-1 && 0からn if(n>=b){ //0からb-1だけ調べればok n = b-1;//f(x)は短調増加 } long long int ans = (a*n)/b;//0からb-1の間のときfloor(x/B)が0より printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264294/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264294/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp.not = icmp slt i64 %0, %1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %sub = add nsw i64 %1, -1 store i64 %sub, ptr %n, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i64 [ %sub, %if.then ], [ %0, %entry ] %3 = load i64, ptr %a, align 8, !tbaa !5 %mul = mul nsw i64 %2, %3 %div = sdiv i64 %mul, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { long long int a, b, n, ans = 0; scanf("%lld%lld%lld", &a, &b, &n); if(n<b) ans = ((a * n) / b) - a * (n / b); else ans = ((a * (b-1)) / b) - a * ((b-1) / b); printf("%lld", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264337/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %2 = load i64, ptr %a, align 8, !tbaa !5 %sub3 = add nsw i64 %1, -1 %sub3.sink12 = select i1 %cmp, i64 %0, i64 %sub3 %mul4 = mul nsw i64 %2, %sub3.sink12 %div5 = sdiv i64 %mul4, %1 %div7 = sdiv i64 %sub3.sink12, %1 %mul8 = mul nsw i64 %div7, %2 %sub9 = sub nsw i64 %div5, %mul8 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub9) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { long a,b,n; scanf("%ld %ld %ld", &a, &b,&n); long x; x = 1; x = b - 1; if(n<x) x = n; long fb = x / b; long fa = (a * x) / b; long ans = fa - a * fb; printf("%ld",ans); printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264380/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264380/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n) %0 = load i64, ptr %b, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 %1 = load i64, ptr %n, align 8, !tbaa !5 %spec.select = call i64 @llvm.smin.i64(i64 %1, i64 %sub) %div = sdiv i64 %spec.select, %0 %2 = load i64, ptr %a, align 8, !tbaa !5 %mul = mul nsw i64 %2, %spec.select %div1 = sdiv i64 %mul, %0 %mul2 = mul nsw i64 %2, %div %sub3 = sub nsw i64 %div1, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub3) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int t; scanf("%d",&t); while(t-->0){ int n; scanf("%d",&n); printf("%d\n",n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26446/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26446/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 %dec3 = add nsw i32 %0, -1 store i32 %dec3, ptr %t, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %2, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %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> #include <string.h> int main(void) { int n, m, remain; int i, count; char num[1000 + 1]; while (1){ scanf("%d%d", &n, &m); if (!n && !m){ break; } memset(num, '1', sizeof(num)); i = 1; remain = n; count = 0; while (remain - 1){ count++; while (num[i % n] == '0'){ i = (i + 1) % n; } if (count == m){ while (num[i] == '0'){ i = (i + 1) % n; } num[i] = '0'; count = 0; remain--; } i = (i + 1) % n; } for (i = 0; i < n; i++){ if (num[i] == '1'){ printf("%d\n", i == 0 ? n : i); } } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264517/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264517/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %num) #4 %call71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4 %tobool72 = icmp ne i32 %0, 0 %1 = load i32, ptr %m, align 4 %tobool173 = icmp ne i32 %1, 0 %or.cond74 = select i1 %tobool72, i1 true, i1 %tobool173 br i1 %or.cond74, label %if.end, label %while.end41 while.cond.loopexit: ; preds = %for.inc, %for.inc.peel, %for.cond.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %2 = load i32, ptr %n, align 4 %tobool = icmp ne i32 %2, 0 %3 = load i32, ptr %m, align 4 %tobool1 = icmp ne i32 %3, 0 %or.cond = select i1 %tobool, i1 true, i1 %tobool1 br i1 %or.cond, label %if.end, label %while.end41 if.end: ; preds = %entry, %while.cond.loopexit %4 = phi i32 [ %3, %while.cond.loopexit ], [ %1, %entry ] %5 = phi i32 [ %2, %while.cond.loopexit ], [ %0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %num, i8 49, i64 1001, i1 false) %tobool3.not65 = icmp eq i32 %5, 1 br i1 %tobool3.not65, label %if.then35.peel, label %while.body4 for.cond.preheader: ; preds = %if.end24 %cmp2869 = icmp sgt i32 %5, 0 br i1 %cmp2869, label %for.body.preheader, label %while.cond.loopexit for.body.preheader: ; preds = %for.cond.preheader %.pr = load i8, ptr %num, align 16, !tbaa !5 %cmp33.peel = icmp eq i8 %.pr, 49 br i1 %cmp33.peel, label %if.then35.peel, label %for.inc.peel if.then35.peel: ; preds = %if.end, %for.body.preheader %call38.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %.pre = load i32, ptr %n, align 4 br label %for.inc.peel for.inc.peel: ; preds = %if.then35.peel, %for.body.preheader %6 = phi i32 [ %.pre, %if.then35.peel ], [ %5, %for.body.preheader ] %cmp28.peel = icmp sgt i32 %6, 1 br i1 %cmp28.peel, label %for.body, label %while.cond.loopexit while.body4: ; preds = %if.end, %if.end24 %count.068 = phi i32 [ %count.1, %if.end24 ], [ 0, %if.end ] %i.067 = phi i32 [ %rem26, %if.end24 ], [ 1, %if.end ] %remain.066 = phi i32 [ %remain.1, %if.end24 ], [ %5, %if.end ] %inc = add nsw i32 %count.068, 1 %rem54 = srem i32 %i.067, %5 %idxprom55 = sext i32 %rem54 to i64 %arrayidx56 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %idxprom55 %7 = load i8, ptr %arrayidx56, align 1, !tbaa !5 %cmp57 = icmp eq i8 %7, 48 br i1 %cmp57, label %while.body7, label %while.end while.body7: ; preds = %while.body4, %while.body7 %i.158 = phi i32 [ %rem8, %while.body7 ], [ %i.067, %while.body4 ] %add = add nsw i32 %i.158, 1 %rem8 = srem i32 %add, %5 %idxprom = sext i32 %rem8 to i64 %arrayidx = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %idxprom %8 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %8, 48 br i1 %cmp, label %while.body7, label %while.end, !llvm.loop !8 while.end: ; preds = %while.body7, %while.body4 %i.1.lcssa = phi i32 [ %i.067, %while.body4 ], [ %rem8, %while.body7 ] %cmp9 = icmp eq i32 %inc, %4 br i1 %cmp9, label %while.cond12.preheader, label %if.end24 while.cond12.preheader: ; preds = %while.end %idxprom1359 = sext i32 %i.1.lcssa to i64 %arrayidx1460 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %idxprom1359 %9 = load i8, ptr %arrayidx1460, align 1, !tbaa !5 %cmp1661 = icmp eq i8 %9, 48 br i1 %cmp1661, label %while.body18, label %while.end21 while.body18: ; preds = %while.cond12.preheader, %while.body18 %i.262 = phi i32 [ %rem20, %while.body18 ], [ %i.1.lcssa, %while.cond12.preheader ] %add19 = add nsw i32 %i.262, 1 %rem20 = srem i32 %add19, %5 %idxprom13 = sext i32 %rem20 to i64 %arrayidx14 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %idxprom13 %10 = load i8, ptr %arrayidx14, align 1, !tbaa !5 %cmp16 = icmp eq i8 %10, 48 br i1 %cmp16, label %while.body18, label %while.end21, !llvm.loop !10 while.end21: ; preds = %while.body18, %while.cond12.preheader %idxprom13.lcssa = phi i64 [ %idxprom1359, %while.cond12.preheader ], [ %idxprom13, %while.body18 ] %i.2.lcssa = phi i32 [ %i.1.lcssa, %while.cond12.preheader ], [ %rem20, %while.body18 ] %arrayidx14.le = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %idxprom13.lcssa store i8 48, ptr %arrayidx14.le, align 1, !tbaa !5 %dec = add nsw i32 %remain.066, -1 br label %if.end24 if.end24: ; preds = %while.end21, %while.end %remain.1 = phi i32 [ %dec, %while.end21 ], [ %remain.066, %while.end ] %i.3 = phi i32 [ %i.2.lcssa, %while.end21 ], [ %i.1.lcssa, %while.end ] %count.1 = phi i32 [ 0, %while.end21 ], [ %inc, %while.end ] %add25 = add nsw i32 %i.3, 1 %rem26 = srem i32 %add25, %5 %tobool3.not = icmp eq i32 %remain.1, 1 br i1 %tobool3.not, label %for.cond.preheader, label %while.body4, !llvm.loop !11 for.body: ; preds = %for.inc.peel, %for.inc %11 = phi i32 [ %14, %for.inc ], [ %6, %for.inc.peel ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ] %arrayidx31 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx31, align 1, !tbaa !5 %cmp33 = icmp eq i8 %12, 49 br i1 %cmp33, label %if.then35, label %for.inc if.then35: ; preds = %for.body %13 = trunc i64 %indvars.iv to i32 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13) %.pre78 = load i32, ptr %n, align 4 br label %for.inc for.inc: ; preds = %for.body, %if.then35 %14 = phi i32 [ %11, %for.body ], [ %.pre78, %if.then35 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = sext i32 %14 to i64 %cmp28 = icmp slt i64 %indvars.iv.next, %15 br i1 %cmp28, label %for.body, label %while.cond.loopexit, !llvm.loop !12 while.end41: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9, !13} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #include<stdlib.h> long long int x[100005], y[100005]; int asc1(const void* a, const void* b) { if (x[*(long long int*)a] > x[*(long long int*)b])return 1; if (x[*(long long int*)a] < x[*(long long int*)b])return -1; return 0; } int asc2(const void* a, const void* b) { if (y[*(long long int*)a] > y[*(long long int*)b])return 1; if (y[*(long long int*)a] < y[*(long long int*)b])return -1; return 0; } long long int llabs(long long int n) { if (n < 0) n *= -1; return n; } long long int dist(long long int a, long long int b) { if (llabs(x[a] - x[b]) < llabs(y[a] - y[b])) return llabs(x[a] - x[b]); else return llabs(y[a] - y[b]); } long long int h[200005], l; void swap_h(long long int a, long long int b) { long long int f = h[a]; h[a] = h[b]; h[b] = f; return; } int comp_h(long long int a, long long int b) { long long int a1, a2, b1, b2; a = h[a]; b = h[b]; a1 = a / 100000; a2 = a % 100000; b1 = b / 100000; b2 = b % 100000; if (dist(a1, a2) > dist(b1, b2))return 1; return 0; } void f1(long long int n) { h[l] = n; long long int now = l; l++; while (now > 0) { if (comp_h((now - 1) / 2, now) > 0) swap_h((now - 1) / 2, now); now = (now - 1) / 2; } return; } long long int f2() { l--; swap_h(0, l); long long int now = 0; for (;;) { if (2 * now + 2 < l) { if (comp_h(2 * now + 1, 2 * now + 2) > 0) { if (comp_h(now, 2 * now + 2) > 0) swap_h(now, 2 * now + 2); now = 2 * now + 2; } else { if (comp_h(now, 2 * now + 1) > 0) swap_h(now, 2 * now + 1); now = 2 * now + 1; } } else if (2 * now + 1 < l) { if (comp_h(now, 2 * now + 1) > 0) swap_h(now, 2 * now + 1); now = 2 * now + 1; } else break; } return h[l]; } long long int p[100005]; long long int root(long long int n) { if (p[n] != n) p[n] = root(p[n]); return p[n]; } void uni(long long int a, long long int b) { a = root(a); b = root(b); if (a != b) p[a] = b; return; } int main() { long long int n; scanf("%lld", &n); long long int i, j; for (i = 0; i < n; i++) scanf("%lld %lld", &x[i], &y[i]); long long int a[100005], b[100005]; for (i = 0; i < n; i++) a[i] = b[i] = i; qsort(a, n, sizeof(long long int), asc1); qsort(b, n, sizeof(long long int), asc2); l = 0; for (i = 0; i < n - 1; i++) f1(100000 * a[i] + a[i + 1]); for (i = 0; i < n - 1; i++) f1(100000 * b[i] + b[i + 1]); for (i = 0; i < n; i++) p[i] = i; long long int ans = 0; while (l > 0) { i = f2(); j = i / 100000; i %= 100000; if (root(i) != root(j)) { ans += dist(i, j); uni(i, j); } } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264560/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264560/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @x = dso_local global [100005 x i64] zeroinitializer, align 16 @y = dso_local global [100005 x i64] zeroinitializer, align 16 @h = dso_local local_unnamed_addr global [200005 x i64] zeroinitializer, align 16 @l = dso_local local_unnamed_addr global i64 0, align 8 @p = dso_local local_unnamed_addr global [100005 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @asc1(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %0 %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %2 = load i64, ptr %b, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %2 %3 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp = icmp sgt i64 %1, %3 %cmp4 = icmp slt i64 %1, %3 %. = sext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @asc2(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %0 %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %2 = load i64, ptr %b, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %2 %3 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp = icmp sgt i64 %1, %3 %cmp4 = icmp slt i64 %1, %3 %. = sext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llabs(i64 noundef %n) local_unnamed_addr #1 { entry: %spec.select = tail call i64 @llvm.abs.i64(i64 %n, i1 true) ret i64 %spec.select } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @dist(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %arrayidx = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %a %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %b %1 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %2 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) %arrayidx2 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %a %3 = load i64, ptr %arrayidx2, align 8, !tbaa !5 %arrayidx3 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %b %4 = load i64, ptr %arrayidx3, align 8, !tbaa !5 %sub4 = sub nsw i64 %3, %4 %5 = tail call i64 @llvm.abs.i64(i64 %sub4, i1 true) %. = tail call i64 @llvm.umin.i64(i64 %2, i64 %5) ret i64 %. } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @swap_h(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %arrayidx = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %a %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %b %1 = load i64, ptr %arrayidx1, align 8, !tbaa !5 store i64 %1, ptr %arrayidx, align 8, !tbaa !5 store i64 %0, ptr %arrayidx1, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @comp_h(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %arrayidx = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %a %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %b %1 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %div = sdiv i64 %0, 100000 %rem = srem i64 %0, 100000 %div2 = sdiv i64 %1, 100000 %rem3 = srem i64 %1, 100000 %arrayidx.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div %2 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx1.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem %3 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 %sub.i = sub nsw i64 %2, %3 %4 = tail call i64 @llvm.abs.i64(i64 %sub.i, i1 true) %arrayidx2.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div %5 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %arrayidx3.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem %6 = load i64, ptr %arrayidx3.i, align 8, !tbaa !5 %sub4.i = sub nsw i64 %5, %6 %7 = tail call i64 @llvm.abs.i64(i64 %sub4.i, i1 true) %..i = tail call i64 @llvm.umin.i64(i64 %4, i64 %7) %arrayidx.i12 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2 %8 = load i64, ptr %arrayidx.i12, align 8, !tbaa !5 %arrayidx1.i13 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3 %9 = load i64, ptr %arrayidx1.i13, align 8, !tbaa !5 %sub.i14 = sub nsw i64 %8, %9 %10 = tail call i64 @llvm.abs.i64(i64 %sub.i14, i1 true) %arrayidx2.i15 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2 %11 = load i64, ptr %arrayidx2.i15, align 8, !tbaa !5 %arrayidx3.i16 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3 %12 = load i64, ptr %arrayidx3.i16, align 8, !tbaa !5 %sub4.i17 = sub nsw i64 %11, %12 %13 = tail call i64 @llvm.abs.i64(i64 %sub4.i17, i1 true) %..i18 = tail call i64 @llvm.umin.i64(i64 %10, i64 %13) %cmp = icmp ugt i64 %..i, %..i18 %. = zext i1 %cmp to i32 ret i32 %. } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @f1(i64 noundef %n) local_unnamed_addr #6 { entry: %0 = load i64, ptr @l, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %0 store i64 %n, ptr %arrayidx, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @l, align 8, !tbaa !5 %cmp14 = icmp sgt i64 %0, 0 br i1 %cmp14, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %now.015 = phi i64 [ %div11, %if.end ], [ %0, %entry ] %sub = add nsw i64 %now.015, -1 %div11 = lshr i64 %sub, 1 %arrayidx.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %div11 %1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx1.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %now.015 %2 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 %div.i = sdiv i64 %1, 100000 %rem.i = srem i64 %1, 100000 %div2.i = sdiv i64 %2, 100000 %rem3.i = srem i64 %2, 100000 %arrayidx.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i %3 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !5 %arrayidx1.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i %4 = load i64, ptr %arrayidx1.i.i, align 8, !tbaa !5 %sub.i.i = sub nsw i64 %3, %4 %5 = tail call i64 @llvm.abs.i64(i64 %sub.i.i, i1 true) %arrayidx2.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i %6 = load i64, ptr %arrayidx2.i.i, align 8, !tbaa !5 %arrayidx3.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i %7 = load i64, ptr %arrayidx3.i.i, align 8, !tbaa !5 %sub4.i.i = sub nsw i64 %6, %7 %8 = tail call i64 @llvm.abs.i64(i64 %sub4.i.i, i1 true) %..i.i = tail call i64 @llvm.umin.i64(i64 %5, i64 %8) %arrayidx.i12.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2.i %9 = load i64, ptr %arrayidx.i12.i, align 8, !tbaa !5 %arrayidx1.i13.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3.i %10 = load i64, ptr %arrayidx1.i13.i, align 8, !tbaa !5 %sub.i14.i = sub nsw i64 %9, %10 %11 = tail call i64 @llvm.abs.i64(i64 %sub.i14.i, i1 true) %arrayidx2.i15.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2.i %12 = load i64, ptr %arrayidx2.i15.i, align 8, !tbaa !5 %arrayidx3.i16.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3.i %13 = load i64, ptr %arrayidx3.i16.i, align 8, !tbaa !5 %sub4.i17.i = sub nsw i64 %12, %13 %14 = tail call i64 @llvm.abs.i64(i64 %sub4.i17.i, i1 true) %..i18.i = tail call i64 @llvm.umin.i64(i64 %11, i64 %14) %cmp.i.not = icmp ugt i64 %..i.i, %..i18.i br i1 %cmp.i.not, label %if.then, label %if.end if.then: ; preds = %while.body store i64 %2, ptr %arrayidx.i, align 8, !tbaa !5 store i64 %1, ptr %arrayidx1.i, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %cmp.not = icmp ult i64 %sub, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @f2() local_unnamed_addr #6 { entry: %0 = load i64, ptr @l, align 8, !tbaa !5 %dec = add nsw i64 %0, -1 store i64 %dec, ptr @l, align 8, !tbaa !5 %1 = load i64, ptr @h, align 16, !tbaa !5 %arrayidx1.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %dec %2 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 store i64 %2, ptr @h, align 16, !tbaa !5 store i64 %1, ptr %arrayidx1.i, align 8, !tbaa !5 br label %for.cond for.cond: ; preds = %for.cond.backedge, %entry %now.0 = phi i64 [ 0, %entry ], [ %now.0.be, %for.cond.backedge ] %mul = shl nsw i64 %now.0, 1 %add = add nsw i64 %mul, 2 %cmp = icmp slt i64 %add, %dec %add2 = or i64 %mul, 1 br i1 %cmp, label %if.then, label %if.else27 if.then: ; preds = %for.cond %arrayidx.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %add2 %3 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx1.i63 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %add %4 = load i64, ptr %arrayidx1.i63, align 16, !tbaa !5 %div.i = sdiv i64 %3, 100000 %rem.i = srem i64 %3, 100000 %div2.i = sdiv i64 %4, 100000 %rem3.i = srem i64 %4, 100000 %arrayidx.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i %5 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !5 %arrayidx1.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i %6 = load i64, ptr %arrayidx1.i.i, align 8, !tbaa !5 %sub.i.i = sub nsw i64 %5, %6 %7 = tail call i64 @llvm.abs.i64(i64 %sub.i.i, i1 true) %arrayidx2.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i %8 = load i64, ptr %arrayidx2.i.i, align 8, !tbaa !5 %arrayidx3.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i %9 = load i64, ptr %arrayidx3.i.i, align 8, !tbaa !5 %sub4.i.i = sub nsw i64 %8, %9 %10 = tail call i64 @llvm.abs.i64(i64 %sub4.i.i, i1 true) %..i.i = tail call i64 @llvm.umin.i64(i64 %7, i64 %10) %arrayidx.i12.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2.i %11 = load i64, ptr %arrayidx.i12.i, align 8, !tbaa !5 %arrayidx1.i13.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3.i %12 = load i64, ptr %arrayidx1.i13.i, align 8, !tbaa !5 %sub.i14.i = sub nsw i64 %11, %12 %13 = tail call i64 @llvm.abs.i64(i64 %sub.i14.i, i1 true) %arrayidx2.i15.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2.i %14 = load i64, ptr %arrayidx2.i15.i, align 8, !tbaa !5 %arrayidx3.i16.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3.i %15 = load i64, ptr %arrayidx3.i16.i, align 8, !tbaa !5 %sub4.i17.i = sub nsw i64 %14, %15 %16 = tail call i64 @llvm.abs.i64(i64 %sub4.i17.i, i1 true) %..i18.i = tail call i64 @llvm.umin.i64(i64 %13, i64 %16) %cmp.i.not = icmp ugt i64 %..i.i, %..i18.i %arrayidx.i64 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %now.0 %17 = load i64, ptr %arrayidx.i64, align 8, !tbaa !5 %div.i66 = sdiv i64 %17, 100000 %rem.i67 = srem i64 %17, 100000 %arrayidx.i.i70 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i66 %18 = load i64, ptr %arrayidx.i.i70, align 8, !tbaa !5 %arrayidx1.i.i71 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i67 %19 = load i64, ptr %arrayidx1.i.i71, align 8, !tbaa !5 %sub.i.i72 = sub nsw i64 %18, %19 %20 = tail call i64 @llvm.abs.i64(i64 %sub.i.i72, i1 true) %arrayidx2.i.i73 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i66 %21 = load i64, ptr %arrayidx2.i.i73, align 8, !tbaa !5 %arrayidx3.i.i74 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i67 %22 = load i64, ptr %arrayidx3.i.i74, align 8, !tbaa !5 %sub4.i.i75 = sub nsw i64 %21, %22 %23 = tail call i64 @llvm.abs.i64(i64 %sub4.i.i75, i1 true) %..i.i76 = tail call i64 @llvm.umin.i64(i64 %20, i64 %23) br i1 %cmp.i.not, label %if.then6, label %if.else if.then6: ; preds = %if.then %cmp.i84.not = icmp ugt i64 %..i.i76, %..i18.i br i1 %cmp.i84.not, label %if.then11, label %for.cond.backedge if.then11: ; preds = %if.then6 store i64 %4, ptr %arrayidx.i64, align 8, !tbaa !5 store i64 %17, ptr %arrayidx1.i63, align 16, !tbaa !5 br label %for.cond.backedge if.else: ; preds = %if.then %cmp.i108.not = icmp ugt i64 %..i.i76, %..i.i br i1 %cmp.i108.not, label %if.then20, label %for.cond.backedge if.then20: ; preds = %if.else store i64 %3, ptr %arrayidx.i64, align 8, !tbaa !5 store i64 %17, ptr %arrayidx.i, align 8, !tbaa !5 br label %for.cond.backedge if.else27: ; preds = %for.cond %cmp30 = icmp slt i64 %add2, %dec br i1 %cmp30, label %if.then31, label %for.end if.then31: ; preds = %if.else27 %arrayidx.i112 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %now.0 %24 = load i64, ptr %arrayidx.i112, align 8, !tbaa !5 %arrayidx1.i113 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %add2 %25 = load i64, ptr %arrayidx1.i113, align 8, !tbaa !5 %div.i114 = sdiv i64 %24, 100000 %rem.i115 = srem i64 %24, 100000 %div2.i116 = sdiv i64 %25, 100000 %rem3.i117 = srem i64 %25, 100000 %arrayidx.i.i118 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i114 %26 = load i64, ptr %arrayidx.i.i118, align 8, !tbaa !5 %arrayidx1.i.i119 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i115 %27 = load i64, ptr %arrayidx1.i.i119, align 8, !tbaa !5 %sub.i.i120 = sub nsw i64 %26, %27 %28 = tail call i64 @llvm.abs.i64(i64 %sub.i.i120, i1 true) %arrayidx2.i.i121 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i114 %29 = load i64, ptr %arrayidx2.i.i121, align 8, !tbaa !5 %arrayidx3.i.i122 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i115 %30 = load i64, ptr %arrayidx3.i.i122, align 8, !tbaa !5 %sub4.i.i123 = sub nsw i64 %29, %30 %31 = tail call i64 @llvm.abs.i64(i64 %sub4.i.i123, i1 true) %..i.i124 = tail call i64 @llvm.umin.i64(i64 %28, i64 %31) %arrayidx.i12.i125 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2.i116 %32 = load i64, ptr %arrayidx.i12.i125, align 8, !tbaa !5 %arrayidx1.i13.i126 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3.i117 %33 = load i64, ptr %arrayidx1.i13.i126, align 8, !tbaa !5 %sub.i14.i127 = sub nsw i64 %32, %33 %34 = tail call i64 @llvm.abs.i64(i64 %sub.i14.i127, i1 true) %arrayidx2.i15.i128 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2.i116 %35 = load i64, ptr %arrayidx2.i15.i128, align 8, !tbaa !5 %arrayidx3.i16.i129 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3.i117 %36 = load i64, ptr %arrayidx3.i16.i129, align 8, !tbaa !5 %sub4.i17.i130 = sub nsw i64 %35, %36 %37 = tail call i64 @llvm.abs.i64(i64 %sub4.i17.i130, i1 true) %..i18.i131 = tail call i64 @llvm.umin.i64(i64 %34, i64 %37) %cmp.i132.not = icmp ugt i64 %..i.i124, %..i18.i131 br i1 %cmp.i132.not, label %if.then36, label %for.cond.backedge for.cond.backedge: ; preds = %if.then31, %if.then36, %if.else, %if.then20, %if.then6, %if.then11 %now.0.be = phi i64 [ %add, %if.then11 ], [ %add, %if.then6 ], [ %add2, %if.then20 ], [ %add2, %if.else ], [ %add2, %if.then36 ], [ %add2, %if.then31 ] br label %for.cond if.then36: ; preds = %if.then31 store i64 %25, ptr %arrayidx.i112, align 8, !tbaa !5 store i64 %24, ptr %arrayidx1.i113, align 8, !tbaa !5 br label %for.cond.backedge for.end: ; preds = %if.else27 %38 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 ret i64 %38 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @root(i64 noundef %n) local_unnamed_addr #6 { entry: %arrayidx = getelementptr inbounds [100005 x i64], ptr @p, i64 0, i64 %n %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp.not = icmp eq i64 %0, %n br i1 %cmp.not, label %common.ret, label %if.then common.ret: ; preds = %entry, %if.then %common.ret.op = phi i64 [ %call, %if.then ], [ %n, %entry ] ret i64 %common.ret.op if.then: ; preds = %entry %call = tail call i64 @root(i64 noundef %0) store i64 %call, ptr %arrayidx, align 8, !tbaa !5 br label %common.ret } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @uni(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %call = tail call i64 @root(i64 noundef %a) %call1 = tail call i64 @root(i64 noundef %b) %cmp.not = icmp eq i64 %call, %call1 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %arrayidx = getelementptr inbounds [100005 x i64], ptr @p, i64 0, i64 %call store i64 %call1, ptr %arrayidx, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #8 { entry: %n = alloca i64, align 8 %a = alloca [100005 x i64], align 16 %b = alloca [100005 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #12 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp115 = icmp sgt i64 %0, 0 br i1 %cmp115, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %a) #12 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %b) #12 br label %for.end10 for.body: ; preds = %entry, %for.body %i.0116 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %i.0116 %arrayidx1 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %i.0116 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx1) %inc = add nuw nsw i64 %i.0116, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %a) #12 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %b) #12 %cmp4117 = icmp sgt i64 %1, 0 br i1 %cmp4117, label %for.body5.preheader, label %for.end10 for.body5.preheader: ; preds = %for.end %min.iters.check = icmp ult i64 %1, 4 br i1 %min.iters.check, label %for.body5.preheader161, label %vector.ph vector.ph: ; preds = %for.body5.preheader %n.vec = and i64 %1, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %2 = getelementptr inbounds [100005 x i64], ptr %b, i64 0, i64 %index store <2 x i64> %vec.ind, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i64, ptr %2, i64 2 store <2 x i64> %step.add, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %index store <2 x i64> %vec.ind, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i64, ptr %4, i64 2 store <2 x i64> %step.add, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end10, label %for.body5.preheader161 for.body5.preheader161: ; preds = %for.body5.preheader, %middle.block %i.1118.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ] br label %for.body5 for.body5: ; preds = %for.body5.preheader161, %for.body5 %i.1118 = phi i64 [ %inc9, %for.body5 ], [ %i.1118.ph, %for.body5.preheader161 ] %arrayidx6 = getelementptr inbounds [100005 x i64], ptr %b, i64 0, i64 %i.1118 store i64 %i.1118, ptr %arrayidx6, align 8, !tbaa !5 %arrayidx7 = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %i.1118 store i64 %i.1118, ptr %arrayidx7, align 8, !tbaa !5 %inc9 = add nuw nsw i64 %i.1118, 1 %exitcond.not = icmp eq i64 %inc9, %1 br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !15 for.end10: ; preds = %for.body5, %middle.block, %for.end.thread, %for.end %.lcssa114142 = phi i64 [ %0, %for.end.thread ], [ %1, %for.end ], [ %1, %middle.block ], [ %1, %for.body5 ] call void @qsort(ptr noundef nonnull %a, i64 noundef %.lcssa114142, i64 noundef 8, ptr noundef nonnull @asc1) #12 %7 = load i64, ptr %n, align 8, !tbaa !5 call void @qsort(ptr noundef nonnull %b, i64 noundef %7, i64 noundef 8, ptr noundef nonnull @asc2) #12 store i64 0, ptr @l, align 8, !tbaa !5 %8 = load i64, ptr %n, align 8, !tbaa !5 %sub = add i64 %8, -1 %cmp13120 = icmp sgt i64 %8, 1 br i1 %cmp13120, label %for.body14.preheader, label %for.cond33.preheader for.body14.preheader: ; preds = %for.end10 %.pre = load i64, ptr %a, align 16, !tbaa !5 br label %for.body14 for.cond21.preheader: ; preds = %f1.exit store i64 %sub, ptr @l, align 8, !tbaa !5 br i1 %cmp13120, label %for.body24.preheader, label %for.cond33.preheader for.body24.preheader: ; preds = %for.cond21.preheader %.pre139 = load i64, ptr %b, align 16, !tbaa !5 br label %for.body24 for.body14: ; preds = %for.body14.preheader, %f1.exit %9 = phi i64 [ %10, %f1.exit ], [ %.pre, %for.body14.preheader ] %i.2122 = phi i64 [ %add, %f1.exit ], [ 0, %for.body14.preheader ] %mul = mul nsw i64 %9, 100000 %add = add nuw nsw i64 %i.2122, 1 %arrayidx16 = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %add %10 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %add17 = add nsw i64 %mul, %10 %arrayidx.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %i.2122 store i64 %add17, ptr %arrayidx.i, align 8, !tbaa !5 %cmp14.i.not = icmp eq i64 %i.2122, 0 br i1 %cmp14.i.not, label %f1.exit, label %while.body.i while.body.i: ; preds = %for.body14, %if.end.i %now.015.i = phi i64 [ %div11.i, %if.end.i ], [ %i.2122, %for.body14 ] %sub.i = add nsw i64 %now.015.i, -1 %div11.i = lshr i64 %sub.i, 1 %arrayidx.i.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %div11.i %11 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !5 %arrayidx1.i.i = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %now.015.i %12 = load i64, ptr %arrayidx1.i.i, align 8, !tbaa !5 %div.i.i = sdiv i64 %11, 100000 %rem.i.i = srem i64 %11, 100000 %div2.i.i = sdiv i64 %12, 100000 %rem3.i.i = srem i64 %12, 100000 %arrayidx.i.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i.i %13 = load i64, ptr %arrayidx.i.i.i, align 8, !tbaa !5 %arrayidx1.i.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i.i %14 = load i64, ptr %arrayidx1.i.i.i, align 8, !tbaa !5 %sub.i.i.i = sub nsw i64 %13, %14 %15 = call i64 @llvm.abs.i64(i64 %sub.i.i.i, i1 true) %arrayidx2.i.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i.i %16 = load i64, ptr %arrayidx2.i.i.i, align 8, !tbaa !5 %arrayidx3.i.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i.i %17 = load i64, ptr %arrayidx3.i.i.i, align 8, !tbaa !5 %sub4.i.i.i = sub nsw i64 %16, %17 %18 = call i64 @llvm.abs.i64(i64 %sub4.i.i.i, i1 true) %..i.i.i = call i64 @llvm.umin.i64(i64 %15, i64 %18) %arrayidx.i12.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2.i.i %19 = load i64, ptr %arrayidx.i12.i.i, align 8, !tbaa !5 %arrayidx1.i13.i.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3.i.i %20 = load i64, ptr %arrayidx1.i13.i.i, align 8, !tbaa !5 %sub.i14.i.i = sub nsw i64 %19, %20 %21 = call i64 @llvm.abs.i64(i64 %sub.i14.i.i, i1 true) %arrayidx2.i15.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2.i.i %22 = load i64, ptr %arrayidx2.i15.i.i, align 8, !tbaa !5 %arrayidx3.i16.i.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3.i.i %23 = load i64, ptr %arrayidx3.i16.i.i, align 8, !tbaa !5 %sub4.i17.i.i = sub nsw i64 %22, %23 %24 = call i64 @llvm.abs.i64(i64 %sub4.i17.i.i, i1 true) %..i18.i.i = call i64 @llvm.umin.i64(i64 %21, i64 %24) %cmp.i.not.i = icmp ugt i64 %..i.i.i, %..i18.i.i br i1 %cmp.i.not.i, label %if.then.i, label %if.end.i if.then.i: ; preds = %while.body.i store i64 %12, ptr %arrayidx.i.i, align 8, !tbaa !5 store i64 %11, ptr %arrayidx1.i.i, align 8, !tbaa !5 br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %cmp.not.i = icmp ult i64 %sub.i, 2 br i1 %cmp.not.i, label %f1.exit, label %while.body.i, !llvm.loop !9 f1.exit: ; preds = %if.end.i, %for.body14 %exitcond135.not = icmp eq i64 %add, %sub br i1 %exitcond135.not, label %for.cond21.preheader, label %for.body14, !llvm.loop !16 for.cond21.for.cond33.preheader_crit_edge: ; preds = %f1.exit107 store i64 %inc.i77, ptr @l, align 8, !tbaa !5 br label %for.cond33.preheader for.cond33.preheader: ; preds = %for.end10, %for.cond21.for.cond33.preheader_crit_edge, %for.cond21.preheader %25 = phi i64 [ %inc.i77, %for.cond21.for.cond33.preheader_crit_edge ], [ %sub, %for.cond21.preheader ], [ 0, %for.end10 ] %cmp34130 = icmp sgt i64 %8, 0 br i1 %cmp34130, label %for.body35.preheader, label %while.cond.preheader for.body35.preheader: ; preds = %for.cond33.preheader %min.iters.check147 = icmp ult i64 %8, 4 br i1 %min.iters.check147, label %for.body35.preheader160, label %vector.ph148 vector.ph148: ; preds = %for.body35.preheader %n.vec150 = and i64 %8, -4 br label %vector.body153 vector.body153: ; preds = %vector.body153, %vector.ph148 %index154 = phi i64 [ 0, %vector.ph148 ], [ %index.next159, %vector.body153 ] %vec.ind155 = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph148 ], [ %vec.ind.next158, %vector.body153 ] %step.add156 = add <2 x i64> %vec.ind155, <i64 2, i64 2> %26 = getelementptr inbounds [100005 x i64], ptr @p, i64 0, i64 %index154 store <2 x i64> %vec.ind155, ptr %26, align 16, !tbaa !5 %27 = getelementptr inbounds i64, ptr %26, i64 2 store <2 x i64> %step.add156, ptr %27, align 16, !tbaa !5 %index.next159 = add nuw i64 %index154, 4 %vec.ind.next158 = add <2 x i64> %vec.ind155, <i64 4, i64 4> %28 = icmp eq i64 %index.next159, %n.vec150 br i1 %28, label %middle.block145, label %vector.body153, !llvm.loop !17 middle.block145: ; preds = %vector.body153 %cmp.n152 = icmp eq i64 %8, %n.vec150 br i1 %cmp.n152, label %while.cond.preheader, label %for.body35.preheader160 for.body35.preheader160: ; preds = %for.body35.preheader, %middle.block145 %i.4131.ph = phi i64 [ 0, %for.body35.preheader ], [ %n.vec150, %middle.block145 ] br label %for.body35 for.body24: ; preds = %for.body24.preheader, %f1.exit107 %29 = phi i64 [ %30, %f1.exit107 ], [ %.pre139, %for.body24.preheader ] %i.3129 = phi i64 [ %add27, %f1.exit107 ], [ 0, %for.body24.preheader ] %inc.i77126128 = phi i64 [ %inc.i77, %f1.exit107 ], [ %sub, %for.body24.preheader ] %mul26 = mul nsw i64 %29, 100000 %add27 = add nuw nsw i64 %i.3129, 1 %arrayidx28 = getelementptr inbounds [100005 x i64], ptr %b, i64 0, i64 %add27 %30 = load i64, ptr %arrayidx28, align 8, !tbaa !5 %add29 = add nsw i64 %mul26, %30 %arrayidx.i76 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %inc.i77126128 store i64 %add29, ptr %arrayidx.i76, align 8, !tbaa !5 %inc.i77 = add nsw i64 %inc.i77126128, 1 %cmp14.i78 = icmp sgt i64 %inc.i77126128, 0 br i1 %cmp14.i78, label %while.body.i79, label %f1.exit107 while.body.i79: ; preds = %for.body24, %if.end.i104 %now.015.i80 = phi i64 [ %div11.i82, %if.end.i104 ], [ %inc.i77126128, %for.body24 ] %sub.i81 = add nsw i64 %now.015.i80, -1 %div11.i82 = lshr i64 %sub.i81, 1 %arrayidx.i.i83 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %div11.i82 %31 = load i64, ptr %arrayidx.i.i83, align 8, !tbaa !5 %arrayidx1.i.i84 = getelementptr inbounds [200005 x i64], ptr @h, i64 0, i64 %now.015.i80 %32 = load i64, ptr %arrayidx1.i.i84, align 8, !tbaa !5 %div.i.i85 = sdiv i64 %31, 100000 %rem.i.i86 = srem i64 %31, 100000 %div2.i.i87 = sdiv i64 %32, 100000 %rem3.i.i88 = srem i64 %32, 100000 %arrayidx.i.i.i89 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div.i.i85 %33 = load i64, ptr %arrayidx.i.i.i89, align 8, !tbaa !5 %arrayidx1.i.i.i90 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem.i.i86 %34 = load i64, ptr %arrayidx1.i.i.i90, align 8, !tbaa !5 %sub.i.i.i91 = sub nsw i64 %33, %34 %35 = call i64 @llvm.abs.i64(i64 %sub.i.i.i91, i1 true) %arrayidx2.i.i.i92 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div.i.i85 %36 = load i64, ptr %arrayidx2.i.i.i92, align 8, !tbaa !5 %arrayidx3.i.i.i93 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem.i.i86 %37 = load i64, ptr %arrayidx3.i.i.i93, align 8, !tbaa !5 %sub4.i.i.i94 = sub nsw i64 %36, %37 %38 = call i64 @llvm.abs.i64(i64 %sub4.i.i.i94, i1 true) %..i.i.i95 = call i64 @llvm.umin.i64(i64 %35, i64 %38) %arrayidx.i12.i.i96 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div2.i.i87 %39 = load i64, ptr %arrayidx.i12.i.i96, align 8, !tbaa !5 %arrayidx1.i13.i.i97 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem3.i.i88 %40 = load i64, ptr %arrayidx1.i13.i.i97, align 8, !tbaa !5 %sub.i14.i.i98 = sub nsw i64 %39, %40 %41 = call i64 @llvm.abs.i64(i64 %sub.i14.i.i98, i1 true) %arrayidx2.i15.i.i99 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div2.i.i87 %42 = load i64, ptr %arrayidx2.i15.i.i99, align 8, !tbaa !5 %arrayidx3.i16.i.i100 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem3.i.i88 %43 = load i64, ptr %arrayidx3.i16.i.i100, align 8, !tbaa !5 %sub4.i17.i.i101 = sub nsw i64 %42, %43 %44 = call i64 @llvm.abs.i64(i64 %sub4.i17.i.i101, i1 true) %..i18.i.i102 = call i64 @llvm.umin.i64(i64 %41, i64 %44) %cmp.i.not.i103 = icmp ugt i64 %..i.i.i95, %..i18.i.i102 br i1 %cmp.i.not.i103, label %if.then.i106, label %if.end.i104 if.then.i106: ; preds = %while.body.i79 store i64 %32, ptr %arrayidx.i.i83, align 8, !tbaa !5 store i64 %31, ptr %arrayidx1.i.i84, align 8, !tbaa !5 br label %if.end.i104 if.end.i104: ; preds = %if.then.i106, %while.body.i79 %cmp.not.i105 = icmp ult i64 %sub.i81, 2 br i1 %cmp.not.i105, label %f1.exit107, label %while.body.i79, !llvm.loop !9 f1.exit107: ; preds = %if.end.i104, %for.body24 %exitcond136.not = icmp eq i64 %add27, %sub br i1 %exitcond136.not, label %for.cond21.for.cond33.preheader_crit_edge, label %for.body24, !llvm.loop !18 while.cond.preheader: ; preds = %for.body35, %middle.block145, %for.cond33.preheader %cmp40132 = icmp sgt i64 %25, 0 br i1 %cmp40132, label %while.body, label %while.end for.body35: ; preds = %for.body35.preheader160, %for.body35 %i.4131 = phi i64 [ %inc38, %for.body35 ], [ %i.4131.ph, %for.body35.preheader160 ] %arrayidx36 = getelementptr inbounds [100005 x i64], ptr @p, i64 0, i64 %i.4131 store i64 %i.4131, ptr %arrayidx36, align 8, !tbaa !5 %inc38 = add nuw nsw i64 %i.4131, 1 %exitcond137.not = icmp eq i64 %inc38, %8 br i1 %exitcond137.not, label %while.cond.preheader, label %for.body35, !llvm.loop !19 while.body: ; preds = %while.cond.preheader, %if.end %ans.0133 = phi i64 [ %ans.1, %if.end ], [ 0, %while.cond.preheader ] %call41 = call i64 @f2() %div = sdiv i64 %call41, 100000 %rem = srem i64 %call41, 100000 %call42 = call i64 @root(i64 noundef %rem) %call43 = call i64 @root(i64 noundef %div) %cmp44.not = icmp eq i64 %call42, %call43 br i1 %cmp44.not, label %if.end, label %if.then if.then: ; preds = %while.body %arrayidx.i108 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %rem %45 = load i64, ptr %arrayidx.i108, align 8, !tbaa !5 %arrayidx1.i = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %div %46 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 %sub.i109 = sub nsw i64 %45, %46 %47 = call i64 @llvm.abs.i64(i64 %sub.i109, i1 true) %arrayidx2.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %rem %48 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %arrayidx3.i = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %div %49 = load i64, ptr %arrayidx3.i, align 8, !tbaa !5 %sub4.i = sub nsw i64 %48, %49 %50 = call i64 @llvm.abs.i64(i64 %sub4.i, i1 true) %..i = call i64 @llvm.umin.i64(i64 %47, i64 %50) %add46 = add nsw i64 %..i, %ans.0133 %call.i = call i64 @root(i64 noundef %rem) %call1.i = call i64 @root(i64 noundef %div) %cmp.not.i110 = icmp eq i64 %call.i, %call1.i br i1 %cmp.not.i110, label %if.end, label %if.then.i111 if.then.i111: ; preds = %if.then %arrayidx.i112 = getelementptr inbounds [100005 x i64], ptr @p, i64 0, i64 %call.i store i64 %call1.i, ptr %arrayidx.i112, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then.i111, %if.then, %while.body %ans.1 = phi i64 [ %ans.0133, %while.body ], [ %add46, %if.then ], [ %add46, %if.then.i111 ] %51 = load i64, ptr @l, align 8, !tbaa !5 %cmp40 = icmp sgt i64 %51, 0 br i1 %cmp40, label %while.body, label %while.end, !llvm.loop !20 while.end: ; preds = %if.end, %while.cond.preheader %ans.0.lcssa = phi i64 [ 0, %while.cond.preheader ], [ %ans.1, %if.end ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %b) #12 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %a) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #12 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #10 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #11 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !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, !13, !14} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !14, !13} !20 = distinct !{!20, !10}
#include <stdio.h> #include <stdlib.h> #include <limits.h> int n, c, k; int t[100005]; int cmp(const void *x, const void *y); int main() { scanf("%d %d %d", &n, &c, &k); for (int i = 0; i < n; i++) { scanf("%d", &t[i]); } t[n] = INT_MAX; qsort(t, n, sizeof(int), cmp); int ans = 0; int indx = 0; while (indx < n) { ans++; int tlim = t[indx] + k; int cnt = 0; while (cnt < c && t[indx] <= tlim) { indx++; cnt++; } } printf("%d\n", ans); return 0; } int cmp(const void *x, const void *y) { if (*(int *)x > *(int *)y) { return 1; } else if (*(int *)x == *(int *)y) { return 0; } else { return -1; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264603/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264603/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @n = dso_local global i32 0, align 4 @c = dso_local global i32 0, align 4 @k = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @t = dso_local global [100005 x i32] zeroinitializer, align 16 @.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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @c, ptr noundef nonnull @k) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp28 = icmp sgt i32 %0, 0 br i1 %cmp28, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %idxprom2.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %9, %for.body ] %arrayidx3 = getelementptr inbounds [100005 x i32], ptr @t, i64 0, i64 %idxprom2.pre-phi store i32 2147483647, ptr %arrayidx3, align 4, !tbaa !5 tail call void @qsort(ptr noundef nonnull @t, i64 noundef %idxprom2.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #4 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp435 = icmp sgt i32 %1, 0 br i1 %cmp435, label %while.body.lr.ph, label %while.end19 while.body.lr.ph: ; preds = %for.cond.cleanup %2 = load i32, ptr @k, align 4, !tbaa !5 %3 = load i32, ptr @c, align 4, !tbaa !5 %cmp1030 = icmp sgt i32 %3, 0 br i1 %cmp1030, label %while.body.us, label %while.body.us39 while.body.us: ; preds = %while.body.lr.ph, %while.end.us %indx.037.us = phi i32 [ %indx.1.lcssa.us, %while.end.us ], [ 0, %while.body.lr.ph ] %ans.036.us = phi i32 [ %inc6.us, %while.end.us ], [ 0, %while.body.lr.ph ] %inc6.us = add nuw nsw i32 %ans.036.us, 1 %idxprom7.us = sext i32 %indx.037.us to i64 %arrayidx8.us = getelementptr inbounds [100005 x i32], ptr @t, i64 0, i64 %idxprom7.us %4 = load i32, ptr %arrayidx8.us, align 4, !tbaa !5 %add.us = add nsw i32 %2, %4 %5 = add i32 %3, %indx.037.us br label %land.rhs.us land.rhs.us: ; preds = %while.body.us, %while.body16.us %indvars.iv44 = phi i64 [ %idxprom7.us, %while.body.us ], [ %indvars.iv.next45, %while.body16.us ] %cnt.032.us = phi i32 [ 0, %while.body.us ], [ %inc18.us, %while.body16.us ] %arrayidx13.us = getelementptr inbounds [100005 x i32], ptr @t, i64 0, i64 %indvars.iv44 %6 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp sgt i32 %6, %add.us br i1 %cmp14.not.us, label %while.end.us.split.loop.exit, label %while.body16.us while.body16.us: ; preds = %land.rhs.us %indvars.iv.next45 = add nsw i64 %indvars.iv44, 1 %inc18.us = add nuw nsw i32 %cnt.032.us, 1 %exitcond.not = icmp eq i32 %inc18.us, %3 br i1 %exitcond.not, label %while.end.us, label %land.rhs.us, !llvm.loop !9 while.end.us.split.loop.exit: ; preds = %land.rhs.us %7 = trunc i64 %indvars.iv44 to i32 br label %while.end.us while.end.us: ; preds = %while.body16.us, %while.end.us.split.loop.exit %indx.1.lcssa.us = phi i32 [ %7, %while.end.us.split.loop.exit ], [ %5, %while.body16.us ] %cmp4.us = icmp slt i32 %indx.1.lcssa.us, %1 br i1 %cmp4.us, label %while.body.us, label %while.end19, !llvm.loop !11 while.body.us39: ; preds = %while.body.lr.ph, %while.body.us39 br label %while.body.us39 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr @t, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr @n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12 while.end19: ; preds = %while.end.us, %for.cond.cleanup %ans.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %inc6.us, %while.end.us ] %call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #3 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: 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" } attributes #2 = { 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> int people[50]; int main(){ int n,p; while (scanf("%d%d",&n,&p)!=EOF){ if (n==0&&p==0) { break; } int flag=p; int output; int x=0; memset(people,0,sizeof(people)); while (x<=1000000) { for(int i=0;i<n;i++){ if(p!=0){ p=p-1; people[i]++; //printf("%d\n",p); //printf("%d\n",people[i]); if(people[i]==flag){ output=i; goto print; } } //printf("%d\n",i); else if(p==0&&people[i]>0) { p=people[i]; people[i]=0; } x++; } } print: printf("%d\n",output); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264647/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264647/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @people = dso_local local_unnamed_addr global [50 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = 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 %p) #4 %call56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %cmp.not57 = icmp eq i32 %call56, -1 br i1 %cmp.not57, label %while.end29, label %while.body while.body: ; preds = %entry, %print %output.058 = phi i32 [ %output.3, %print ], [ undef, %entry ] %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, 0 %1 = load i32, ptr %p, align 4 %cmp2 = icmp eq i32 %1, 0 %or.cond = select i1 %cmp1, i1 %cmp2, i1 false br i1 %or.cond, label %while.end29, label %if.end if.end: ; preds = %while.body call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) @people, i8 0, i64 200, i1 false) %cmp646 = icmp sgt i32 %0, 0 br i1 %cmp646, label %for.cond.preheader.us.preheader, label %for.cond.preheader for.cond.preheader.us.preheader: ; preds = %if.end %2 = add nsw i32 %0, -1 %wide.trip.count = zext i32 %0 to i64 br label %for.cond.preheader.us for.cond.preheader.us: ; preds = %for.cond.preheader.us.preheader, %for.cond.while.cond3.loopexit_crit_edge.us %x.055.us = phi i32 [ %3, %for.cond.while.cond3.loopexit_crit_edge.us ], [ 0, %for.cond.preheader.us.preheader ] %p.promoted5354.us = phi i32 [ %p.promoted51.us, %for.cond.while.cond3.loopexit_crit_edge.us ], [ %1, %for.cond.preheader.us.preheader ] %3 = add i32 %0, %x.055.us %4 = add i32 %2, %x.055.us br label %for.body.us for.body.us: ; preds = %for.cond.preheader.us, %if.end25.us %indvars.iv = phi i64 [ 0, %for.cond.preheader.us ], [ %indvars.iv.next, %if.end25.us ] %p.promoted52.us = phi i32 [ %p.promoted5354.us, %for.cond.preheader.us ], [ %p.promoted51.us, %if.end25.us ] %5 = phi i32 [ %p.promoted5354.us, %for.cond.preheader.us ], [ %8, %if.end25.us ] %cmp7.not.us = icmp eq i32 %5, 0 br i1 %cmp7.not.us, label %land.lhs.true15.us, label %if.then8.us if.then8.us: ; preds = %for.body.us %sub.us = add nsw i32 %5, -1 store i32 %sub.us, ptr %p, align 4, !tbaa !5 %arrayidx.us = getelementptr inbounds [50 x i32], ptr @people, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %inc.us = add nsw i32 %6, 1 store i32 %inc.us, ptr %arrayidx.us, align 4, !tbaa !5 %cmp11.us = icmp eq i32 %inc.us, %1 br i1 %cmp11.us, label %print.loopexit, label %if.end25.us land.lhs.true15.us: ; preds = %for.body.us %arrayidx17.us = getelementptr inbounds [50 x i32], ptr @people, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5 %cmp18.us = icmp sgt i32 %7, 0 br i1 %cmp18.us, label %if.then19.us, label %if.end25.us if.then19.us: ; preds = %land.lhs.true15.us store i32 %7, ptr %p, align 4, !tbaa !5 store i32 0, ptr %arrayidx17.us, align 4, !tbaa !5 br label %if.end25.us if.end25.us: ; preds = %if.then19.us, %land.lhs.true15.us, %if.then8.us %p.promoted51.us = phi i32 [ %p.promoted52.us, %land.lhs.true15.us ], [ %7, %if.then19.us ], [ %sub.us, %if.then8.us ] %8 = phi i32 [ 0, %land.lhs.true15.us ], [ %7, %if.then19.us ], [ %sub.us, %if.then8.us ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.while.cond3.loopexit_crit_edge.us, label %for.body.us, !llvm.loop !9 for.cond.while.cond3.loopexit_crit_edge.us: ; preds = %if.end25.us %cmp4.us = icmp slt i32 %4, 1000000 br i1 %cmp4.us, label %for.cond.preheader.us, label %print for.cond.preheader: ; preds = %if.end, %for.cond.preheader br label %for.cond.preheader print.loopexit: ; preds = %if.then8.us %9 = trunc i64 %indvars.iv to i32 br label %print print: ; preds = %for.cond.while.cond3.loopexit_crit_edge.us, %print.loopexit %output.3 = phi i32 [ %9, %print.loopexit ], [ %output.058, %for.cond.while.cond3.loopexit_crit_edge.us ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %output.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end29, label %while.body, !llvm.loop !11 while.end29: ; preds = %print, %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 have[ 50 ]; int main( void ) { int i, n, p, r; for ( ; scanf( "%d %d", &n, &p ), r = p; printf( "%d\n", i ) ) for ( i = 0; ; i = ( i + 1 ) % n ) { if ( r ) { r--; have[ i ]++; } else { r = have[ i ]; have[ i ] = 0; } if ( r == p ) break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264748/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264748/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @have = dso_local local_unnamed_addr global [50 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = 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 %p) #3 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %0 = load i32, ptr %p, align 4, !tbaa !5 %tobool.not19 = icmp eq i32 %0, 0 br i1 %tobool.not19, label %for.end11, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc9 %1 = phi i32 [ %5, %for.inc9 ], [ %0, %entry ] %2 = load i32, ptr %n, align 4 br label %for.cond1 for.cond1: ; preds = %for.cond1.preheader, %for.inc %i.0 = phi i32 [ %rem, %for.inc ], [ 0, %for.cond1.preheader ] %r.0 = phi i32 [ %r.1, %for.inc ], [ %1, %for.cond1.preheader ] %tobool2.not = icmp eq i32 %r.0, 0 br i1 %tobool2.not, label %if.else, label %if.then if.then: ; preds = %for.cond1 %dec = add nsw i32 %r.0, -1 %idxprom = sext i32 %i.0 to i64 %arrayidx = getelementptr inbounds [50 x i32], ptr @have, 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 br label %if.end if.else: ; preds = %for.cond1 %idxprom3 = sext i32 %i.0 to i64 %arrayidx4 = getelementptr inbounds [50 x i32], ptr @have, i64 0, i64 %idxprom3 %4 = load i32, ptr %arrayidx4, align 4, !tbaa !5 store i32 0, ptr %arrayidx4, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %r.1 = phi i32 [ %dec, %if.then ], [ %4, %if.else ] %cmp = icmp eq i32 %r.1, %1 br i1 %cmp, label %for.inc9, label %for.inc for.inc: ; preds = %if.end %add = add nsw i32 %i.0, 1 %rem = srem i32 %add, %2 br label %for.cond1 for.inc9: ; preds = %if.end %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %5 = load i32, ptr %p, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !9 for.end11: ; preds = %for.inc9, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> char ss[25000][6]; int compare_s(const void*a, const void*b){ int* A = (int*)a; int* B = (int*)b; return strcmp(ss[*A], ss[*B]); } int main(void){ char s[5001]; int k; scanf("%s", s); scanf("%d", &k); char *ps; int ls = strlen(s); // h:sから切り取る文字の長さ // ls-h+1:sからh文字切り取る動作の回数 // ssに、sから長さ1~5の文字列を全て切り取って代入する int index = 0; for(int h = 1; h <= 5; h++){ ps = s; for(int i = 0; i < ls-h+1; i++){ strncpy(ss[index], ps, h); ss[index][h] = '\0'; ps++; index++; } } int num[25000]; for(int i = 0; i < index; i++){num[i] = i;} // ssの各要素の大小関係で、numをソートする // ソート後のnumの要素の中身xは、ss[x]がss全体の中で // 辞書順に並べたときにx+1番目に位置することを意味する // (要はssを直接ソートせずにnumをソートすることで、ssがソートできます) qsort(num, index, sizeof(int), compare_s); char tmp[6]; strcpy(tmp, ss[num[0]]); int cnt = 1; if(index == 1){printf("%s\n", tmp); return 0;} for(int i = 0; i < index-1; i++){ // if(strcmp(tmp, ss[num[i+1]])==0){ // continue; // }else{ // cnt++; // strcpy(tmp, ss[num[i+1]]); // } if(strcmp(tmp, ss[num[i+1]])!=0){ cnt++; strcpy(tmp, ss[num[i+1]]); } if(cnt == k){printf("%s\n", ss[num[i+1]]); return 0;} } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264827/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264827/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ss = dso_local global [25000 x [6 x i8]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @compare_s(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %idxprom %1 = load i32, ptr %b, align 4, !tbaa !5 %idxprom1 = sext i32 %1 to i64 %arrayidx2 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %idxprom1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #9 ret i32 %call } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %s = alloca [5001 x i8], align 16 %k = alloca i32, align 4 %num = alloca [25000 x i32], align 16 %tmp = alloca [6 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5001, ptr nonnull %s) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #9 %sext = shl i64 %call3, 32 %cmp7.not117 = icmp slt i64 %sext, 4294967296 br i1 %cmp7.not117, label %for.cond.cleanup9.4.thread, label %for.body10.preheader for.body10.preheader: ; preds = %entry %0 = add i64 %call3, 4294967295 %1 = and i64 %0, 4294967295 %2 = add nuw nsw i64 %1, 1 %xtraiter = and i64 %2, 1 %3 = icmp eq i64 %1, 0 br i1 %3, label %for.cond.cleanup9.unr-lcssa, label %for.body10.preheader.new for.body10.preheader.new: ; preds = %for.body10.preheader %unroll_iter = and i64 %2, 8589934590 br label %for.body10 for.cond.cleanup9.4.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %num) #10 br label %for.cond.cleanup26 for.body27.preheader: ; preds = %for.cond.cleanup9.4 %wide.trip.count = and i64 %index.1.lcssa.4.in, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body27.preheader166, label %vector.ph vector.ph: ; preds = %for.body27.preheader %n.mod.vf = and i64 %index.1.lcssa.4.in, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %4 = getelementptr inbounds [25000 x i32], ptr %num, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 store <4 x i32> %step.add, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup26, label %for.body27.preheader166 for.body27.preheader166: ; preds = %for.body27.preheader, %middle.block %indvars.iv133.ph = phi i64 [ 0, %for.body27.preheader ], [ %n.vec, %middle.block ] br label %for.body27 for.cond.cleanup9.unr-lcssa: ; preds = %for.body10, %for.body10.preheader %indvars.iv.next.lcssa.ph = phi i64 [ undef, %for.body10.preheader ], [ %indvars.iv.next.1173, %for.body10 ] %indvars.iv.unr = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next.1173, %for.body10 ] %ps.0118.unr = phi ptr [ %s, %for.body10.preheader ], [ %incdec.ptr.1172, %for.body10 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup9, label %for.body10.epil for.body10.epil: ; preds = %for.cond.cleanup9.unr-lcssa %arrayidx.epil = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.unr %stxncpy.char0.epil = load i8, ptr %ps.0118.unr, align 1 store i8 %stxncpy.char0.epil, ptr %arrayidx.epil, align 2 %arrayidx17.epil = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.unr, i64 1 store i8 0, ptr %arrayidx17.epil, align 1, !tbaa !13 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 br label %for.cond.cleanup9 for.cond.cleanup9: ; preds = %for.cond.cleanup9.unr-lcssa, %for.body10.epil %indvars.iv.next.lcssa = phi i64 [ %indvars.iv.next.lcssa.ph, %for.cond.cleanup9.unr-lcssa ], [ %indvars.iv.next.epil, %for.body10.epil ] %indvars.iv.next127 = add i64 %call3, 4294967294 %7 = and i64 %indvars.iv.next127, 4294967295 %scevgep.1 = getelementptr i8, ptr %s, i64 %7 %cmp7.not117.1 = icmp slt i64 %sext, 8589934592 br i1 %cmp7.not117.1, label %for.cond.cleanup9.4, label %for.body10.lr.ph.1 for.body10.lr.ph.1: ; preds = %for.cond.cleanup9 %sext161 = shl i64 %indvars.iv.next.lcssa, 32 %8 = ashr exact i64 %sext161, 32 br label %for.body10.1 for.body10.1: ; preds = %for.body10.1, %for.body10.lr.ph.1 %indvars.iv.1 = phi i64 [ %8, %for.body10.lr.ph.1 ], [ %indvars.iv.next.1, %for.body10.1 ] %ps.0118.1 = phi ptr [ %s, %for.body10.lr.ph.1 ], [ %incdec.ptr.1, %for.body10.1 ] %arrayidx.1 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.1 %call13.1 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx.1, ptr noundef nonnull dereferenceable(1) %ps.0118.1, i64 noundef 2) #10 %arrayidx17.1 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.1, i64 2 store i8 0, ptr %arrayidx17.1, align 2, !tbaa !13 %incdec.ptr.1 = getelementptr inbounds i8, ptr %ps.0118.1, i64 1 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %exitcond.1.not = icmp eq ptr %ps.0118.1, %scevgep.1 br i1 %exitcond.1.not, label %for.cond.cleanup9.1, label %for.body10.1, !llvm.loop !14 for.cond.cleanup9.1: ; preds = %for.body10.1 %indvars.iv.next127.1 = add i64 %call3, 4294967293 %9 = and i64 %indvars.iv.next127.1, 4294967295 %scevgep.2 = getelementptr i8, ptr %s, i64 %9 %cmp7.not117.2 = icmp slt i64 %sext, 12884901888 br i1 %cmp7.not117.2, label %for.cond.cleanup9.4, label %for.body10.lr.ph.2 for.body10.lr.ph.2: ; preds = %for.cond.cleanup9.1 %sext162 = shl i64 %indvars.iv.next.1, 32 %10 = ashr exact i64 %sext162, 32 br label %for.body10.2 for.body10.2: ; preds = %for.body10.2, %for.body10.lr.ph.2 %indvars.iv.2 = phi i64 [ %10, %for.body10.lr.ph.2 ], [ %indvars.iv.next.2, %for.body10.2 ] %ps.0118.2 = phi ptr [ %s, %for.body10.lr.ph.2 ], [ %incdec.ptr.2, %for.body10.2 ] %arrayidx.2 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.2 %call13.2 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx.2, ptr noundef nonnull dereferenceable(1) %ps.0118.2, i64 noundef 3) #10 %arrayidx17.2 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.2, i64 3 store i8 0, ptr %arrayidx17.2, align 1, !tbaa !13 %incdec.ptr.2 = getelementptr inbounds i8, ptr %ps.0118.2, i64 1 %indvars.iv.next.2 = add nsw i64 %indvars.iv.2, 1 %exitcond.2.not = icmp eq ptr %ps.0118.2, %scevgep.2 br i1 %exitcond.2.not, label %for.cond.cleanup9.2, label %for.body10.2, !llvm.loop !14 for.cond.cleanup9.2: ; preds = %for.body10.2 %indvars.iv.next127.2 = add i64 %call3, 4294967292 %11 = and i64 %indvars.iv.next127.2, 4294967295 %scevgep.3 = getelementptr i8, ptr %s, i64 %11 %cmp7.not117.3 = icmp slt i64 %sext, 17179869184 br i1 %cmp7.not117.3, label %for.cond.cleanup9.4, label %for.body10.lr.ph.3 for.body10.lr.ph.3: ; preds = %for.cond.cleanup9.2 %sext163 = shl i64 %indvars.iv.next.2, 32 %12 = ashr exact i64 %sext163, 32 br label %for.body10.3 for.body10.3: ; preds = %for.body10.3, %for.body10.lr.ph.3 %indvars.iv.3 = phi i64 [ %12, %for.body10.lr.ph.3 ], [ %indvars.iv.next.3, %for.body10.3 ] %ps.0118.3 = phi ptr [ %s, %for.body10.lr.ph.3 ], [ %incdec.ptr.3, %for.body10.3 ] %arrayidx.3 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.3 %call13.3 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx.3, ptr noundef nonnull dereferenceable(1) %ps.0118.3, i64 noundef 4) #10 %arrayidx17.3 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.3, i64 4 store i8 0, ptr %arrayidx17.3, align 2, !tbaa !13 %incdec.ptr.3 = getelementptr inbounds i8, ptr %ps.0118.3, i64 1 %indvars.iv.next.3 = add nsw i64 %indvars.iv.3, 1 %exitcond.3.not = icmp eq ptr %ps.0118.3, %scevgep.3 br i1 %exitcond.3.not, label %for.cond.cleanup9.3, label %for.body10.3, !llvm.loop !14 for.cond.cleanup9.3: ; preds = %for.body10.3 %indvars.iv.next127.3 = add i64 %call3, 4294967291 %13 = and i64 %indvars.iv.next127.3, 4294967295 %scevgep.4 = getelementptr i8, ptr %s, i64 %13 %cmp7.not117.4 = icmp slt i64 %sext, 21474836480 br i1 %cmp7.not117.4, label %for.cond.cleanup9.4, label %for.body10.lr.ph.4 for.body10.lr.ph.4: ; preds = %for.cond.cleanup9.3 %sext164 = shl i64 %indvars.iv.next.3, 32 %14 = ashr exact i64 %sext164, 32 br label %for.body10.4 for.body10.4: ; preds = %for.body10.4, %for.body10.lr.ph.4 %indvars.iv.4 = phi i64 [ %14, %for.body10.lr.ph.4 ], [ %indvars.iv.next.4, %for.body10.4 ] %ps.0118.4 = phi ptr [ %s, %for.body10.lr.ph.4 ], [ %incdec.ptr.4, %for.body10.4 ] %arrayidx.4 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.4 %call13.4 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %arrayidx.4, ptr noundef nonnull dereferenceable(1) %ps.0118.4, i64 noundef 5) #10 %arrayidx17.4 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.4, i64 5 store i8 0, ptr %arrayidx17.4, align 1, !tbaa !13 %incdec.ptr.4 = getelementptr inbounds i8, ptr %ps.0118.4, i64 1 %indvars.iv.next.4 = add nsw i64 %indvars.iv.4, 1 %exitcond.4.not = icmp eq ptr %ps.0118.4, %scevgep.4 br i1 %exitcond.4.not, label %for.cond.cleanup9.4, label %for.body10.4, !llvm.loop !14 for.cond.cleanup9.4: ; preds = %for.body10.4, %for.cond.cleanup9, %for.cond.cleanup9.1, %for.cond.cleanup9.2, %for.cond.cleanup9.3 %index.1.lcssa.4.in = phi i64 [ %indvars.iv.next.3, %for.cond.cleanup9.3 ], [ %indvars.iv.next.2, %for.cond.cleanup9.2 ], [ %indvars.iv.next.1, %for.cond.cleanup9.1 ], [ %indvars.iv.next.lcssa, %for.cond.cleanup9 ], [ %indvars.iv.next.4, %for.body10.4 ] %index.1.lcssa.4 = trunc i64 %index.1.lcssa.4.in to i32 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %num) #10 %cmp24123 = icmp sgt i32 %index.1.lcssa.4, 0 br i1 %cmp24123, label %for.body27.preheader, label %for.cond.cleanup26 for.body10: ; preds = %for.body10, %for.body10.preheader.new %indvars.iv = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next.1173, %for.body10 ] %ps.0118 = phi ptr [ %s, %for.body10.preheader.new ], [ %incdec.ptr.1172, %for.body10 ] %niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.1, %for.body10 ] %arrayidx = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv %stxncpy.char0 = load i8, ptr %ps.0118, align 1 store i8 %stxncpy.char0, ptr %arrayidx, align 4 %arrayidx17 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv, i64 1 store i8 0, ptr %arrayidx17, align 1, !tbaa !13 %incdec.ptr = getelementptr inbounds i8, ptr %ps.0118, i64 1 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1170 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.next %stxncpy.char0.1 = load i8, ptr %incdec.ptr, align 1 store i8 %stxncpy.char0.1, ptr %arrayidx.1170, align 2 %arrayidx17.1171 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %indvars.iv.next, i64 1 store i8 0, ptr %arrayidx17.1171, align 1, !tbaa !13 %incdec.ptr.1172 = getelementptr inbounds i8, ptr %ps.0118, i64 2 %indvars.iv.next.1173 = 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.cleanup9.unr-lcssa, label %for.body10, !llvm.loop !14 for.cond.cleanup26: ; preds = %for.body27, %middle.block, %for.cond.cleanup9.4.thread, %for.cond.cleanup9.4 %index.1.lcssa.4160 = phi i32 [ 0, %for.cond.cleanup9.4.thread ], [ %index.1.lcssa.4, %for.cond.cleanup9.4 ], [ %index.1.lcssa.4, %middle.block ], [ %index.1.lcssa.4, %for.body27 ] %conv34 = sext i32 %index.1.lcssa.4160 to i64 call void @qsort(ptr noundef nonnull %num, i64 noundef %conv34, i64 noundef 4, ptr noundef nonnull @compare_s) #10 call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %tmp) #10 %15 = load i32, ptr %num, align 16, !tbaa !5 %idxprom37 = sext i32 %15 to i64 %arrayidx38 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %idxprom37 %call40 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %tmp, ptr noundef nonnull dereferenceable(1) %arrayidx38) #10 %cmp41 = icmp eq i32 %index.1.lcssa.4160, 1 br i1 %cmp41, label %cleanup87.sink.split, label %for.cond46.preheader for.cond46.preheader: ; preds = %for.cond.cleanup26 %16 = load i32, ptr %k, align 4 %17 = call i32 @llvm.smax.i32(i32 %index.1.lcssa.4160, i32 1) %smax = add nsw i32 %17, -1 %wide.trip.count140 = zext i32 %smax to i64 br label %for.cond46 for.body27: ; preds = %for.body27.preheader166, %for.body27 %indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.body27 ], [ %indvars.iv133.ph, %for.body27.preheader166 ] %arrayidx29 = getelementptr inbounds [25000 x i32], ptr %num, i64 0, i64 %indvars.iv133 %18 = trunc i64 %indvars.iv133 to i32 store i32 %18, ptr %arrayidx29, align 4, !tbaa !5 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count br i1 %exitcond136.not, label %for.cond.cleanup26, label %for.body27, !llvm.loop !15 for.cond46: ; preds = %for.cond46.preheader, %if.end72 %indvars.iv137 = phi i64 [ 0, %for.cond46.preheader ], [ %indvars.iv.next138, %if.end72 ] %cnt.0 = phi i32 [ 1, %for.cond46.preheader ], [ %cnt.1, %if.end72 ] %exitcond141.not = icmp eq i64 %indvars.iv137, %wide.trip.count140 br i1 %exitcond141.not, label %cleanup87, label %for.body51 for.body51: ; preds = %for.cond46 %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %arrayidx55 = getelementptr inbounds [25000 x i32], ptr %num, i64 0, i64 %indvars.iv.next138 %19 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %idxprom56 = sext i32 %19 to i64 %arrayidx57 = getelementptr inbounds [25000 x [6 x i8]], ptr @ss, i64 0, i64 %idxprom56 %call59 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %tmp, ptr noundef nonnull dereferenceable(1) %arrayidx57) #9 %cmp60.not = icmp eq i32 %call59, 0 br i1 %cmp60.not, label %if.end72, label %if.then62 if.then62: ; preds = %for.body51 %inc63 = add nsw i32 %cnt.0, 1 %call71 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %tmp, ptr noundef nonnull dereferenceable(1) %arrayidx57) #10 br label %if.end72 if.end72: ; preds = %if.then62, %for.body51 %cnt.1 = phi i32 [ %inc63, %if.then62 ], [ %cnt.0, %for.body51 ] %cmp73 = icmp eq i32 %cnt.1, %16 br i1 %cmp73, label %cleanup87.sink.split, label %for.cond46, !llvm.loop !16 cleanup87.sink.split: ; preds = %if.end72, %for.cond.cleanup26 %arrayidx57.lcssa.sink = phi ptr [ %tmp, %for.cond.cleanup26 ], [ %arrayidx57, %if.end72 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx57.lcssa.sink) br label %cleanup87 cleanup87: ; preds = %for.cond46, %cleanup87.sink.split call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %tmp) #10 call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %num) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #10 call void @llvm.lifetime.end.p0(i64 5001, ptr nonnull %s) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #5 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6 ; 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 #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(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 attributes #0 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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: 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 #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind } 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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10}
#include<stdio.h> int main(void) { int a,b,c,d,e; scanf("%d %d",&a,&b); c=a*b; d=c%2; if(0<d) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264870/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264870/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca 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 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, -2147483647 %cmp = icmp eq i32 %2, 1 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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; do{ scanf("%d %d", &A, &B); }while(A<1|| A>3||B<1|| B>3); if((A*B)%2!=0){ printf("Yes"); } else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264913/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264913/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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 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 br label %do.body do.body: ; preds = %do.body, %entry %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 %1 = add i32 %0, -4 %or.cond = icmp ult i32 %1, -3 %2 = load i32, ptr %B, align 4 %cmp3 = icmp slt i32 %2, 1 %or.cond8 = select i1 %or.cond, i1 true, i1 %cmp3 %cmp4 = icmp sgt i32 %2, 3 %or.cond9 = select i1 %or.cond8, i1 true, i1 %cmp4 br i1 %or.cond9, label %do.body, label %do.end, !llvm.loop !5 do.end: ; preds = %do.body %mul = mul nuw nsw i32 %2, %0 %rem = and i32 %mul, 1 %cmp5.not = icmp eq i32 %rem, 0 %.str.2..str.1 = select i1 %cmp5.not, ptr @.str.2, ptr @.str.1 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int A, B; scanf("%d %d", &A, &B); if(A%2==0 || B%2==0){ printf("No"); } else{ printf("Yes"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264957/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"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: %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 = and i32 %0, 1 %cmp = icmp eq i32 %1, 0 %2 = load i32, ptr %B, align 4 %3 = and i32 %2, 1 %cmp2 = icmp eq i32 %3, 0 %4 = select i1 %cmp, i1 true, i1 %cmp2 %.str.2.sink = select i1 %4, ptr @.str.1, ptr @.str.2 %call4 = 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 power(int i, int j) { int x, y = 1; for(x = 1; x <= j; x++){ y = y * i; } return y; } int i, j, k, x, y, z, m, n, ans , min = 0; int main() { scanf("%d", &x); ans = 1; for(i = 0, j = x; j != 1; i++){ /*for(i = 0; ; i++){ k = power(2, i) if(k == j){ ans = j * 2 } }*/ if(j % 2 != 0){ ans++; } j = j / 2; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2650/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2650/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @min = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @x = dso_local global i32 0, align 4 @ans = dso_local local_unnamed_addr global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @j = dso_local local_unnamed_addr global i32 0, align 4 @k = dso_local local_unnamed_addr global i32 0, align 4 @y = dso_local local_unnamed_addr global i32 0, align 4 @z = dso_local local_unnamed_addr global i32 0, align 4 @m = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @power(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %cmp.not3 = icmp slt i32 %j, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %j, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %j, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !5 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %j br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %y.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %x.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %y.05 = phi i32 [ %mul, %for.body ], [ %y.05.ph, %for.body.preheader7 ] %x.04 = phi i32 [ %inc, %for.body ], [ %x.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %y.05, %i %inc = add nuw i32 %x.04, 1 %exitcond.not = icmp eq i32 %x.04, %j br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %middle.block, %entry %y.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %y.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x) store i32 1, ptr @ans, align 4, !tbaa !10 store i32 0, ptr @i, align 4, !tbaa !10 %0 = load i32, ptr @x, align 4, !tbaa !10 store i32 %0, ptr @j, align 4, !tbaa !10 %cmp.not7 = icmp eq i32 %0, 1 br i1 %cmp.not7, label %for.end, label %for.body for.body: ; preds = %entry, %if.end %1 = phi i32 [ %div, %if.end ], [ %0, %entry ] %inc59 = phi i32 [ %inc4, %if.end ], [ 1, %entry ] %inc268 = phi i32 [ %inc2, %if.end ], [ 0, %entry ] %2 = and i32 %1, 1 %cmp1.not = icmp eq i32 %2, 0 br i1 %cmp1.not, label %if.end, label %if.then if.then: ; preds = %for.body %inc = add nsw i32 %inc59, 1 store i32 %inc, ptr @ans, align 4, !tbaa !10 br label %if.end if.end: ; preds = %if.then, %for.body %inc4 = phi i32 [ %inc, %if.then ], [ %inc59, %for.body ] %div = sdiv i32 %1, 2 %inc2 = add nuw nsw i32 %inc268, 1 %3 = and i32 %1, -2 %cmp.not = icmp eq i32 %3, 2 br i1 %cmp.not, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !14 for.cond.for.end_crit_edge: ; preds = %if.end store i32 %div, ptr @j, align 4, !tbaa !10 store i32 %inc2, ptr @i, align 4, !tbaa !10 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %entry %4 = phi i32 [ %inc4, %for.cond.for.end_crit_edge ], [ 1, %entry ] %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6, !7, !8} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!"llvm.loop.isvectorized", i32 1} !8 = !{!"llvm.loop.unroll.runtime.disable"} !9 = distinct !{!9, !6, !8, !7} !10 = !{!11, !11, i64 0} !11 = !{!"int", !12, i64 0} !12 = !{!"omnipotent char", !13, i64 0} !13 = !{!"Simple C/C++ TBAA"} !14 = distinct !{!14, !6}
#include <stdio.h> int main() { int a, b; scanf("%d%d", &a, &b); if (a * b % 2 == 0) puts("No"); else puts("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265042/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265042/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %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 %mul = mul nsw i32 %1, %0 %2 = and i32 %mul, 1 %cmp = icmp eq i32 %2, 0 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b; scanf("%d %d",&a,&b); if(a%2 && b%2){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265086/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265086/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca 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 = and i32 %0, 1 %tobool.not = icmp eq i32 %1, 0 br i1 %tobool.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = and i32 %2, 1 %tobool2.not = icmp eq i32 %3, 0 br i1 %tobool2.not, label %if.else, label %if.end if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> #include<stdlib.h> int main() { int a,b; scanf("%d %d",&a,&b); printf(a%2==1&&b%2==1?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265129/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265129/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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 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 = and i32 %0, -2147483647 %cmp = icmp eq i32 %1, 1 %2 = load i32, ptr %b, align 4 %3 = and i32 %2, -2147483647 %cmp2 = icmp eq i32 %3, 1 %4 = select i1 %cmp, i1 %cmp2, i1 false %cond = select i1 %4, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) 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,n; scanf("%d",&t); while(t>0) { scanf("%d",&n); printf("%d\n",n); t--; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26518/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26518/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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) %.pr = load i32, ptr %t, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %.pr, 0 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %1 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}