Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<math.h>
int main()
{
int n,d,ans=0;
scanf("%d %d",&n,&d);
double dis=0;
for(int i=0;i<n;i++){
double x,y;
scanf("%lf %lf",&x,&y);
dis=sqrt(x*x+y*y);
if(dis<=d)ans++;
}
printf("%d\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151549/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151549/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%lf %lf\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
%d = alloca i32, align 4
%x = alloca double, align 8
%y = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1, %for.body ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%i.012 = phi i32 [ %inc6, %for.body ], [ 0, %entry ]
%ans.011 = phi i32 [ %ans.1, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load double, ptr %x, align 8, !tbaa !9
%2 = load double, ptr %y, align 8, !tbaa !9
%mul2 = fmul double %2, %2
%3 = call double @llvm.fmuladd.f64(double %1, double %1, double %mul2)
%sqrt = call double @llvm.sqrt.f64(double %3)
%4 = load i32, ptr %d, align 4, !tbaa !5
%conv = sitofp i32 %4 to double
%cmp4 = fcmp ole double %sqrt, %conv
%inc = zext i1 %cmp4 to i32
%ans.1 = add nuw nsw i32 %ans.011, %inc
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
%inc6 = add nuw nsw i32 %i.012, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc6, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 double @llvm.sqrt.f64(double) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
long int q;
long int b;
long int w;
long int u;
long int l;
long int i;
long int j;
scanf("%ld", &q);
while (--q >= 0) {
scanf("%ld %ld", &b, &w);
if (b <= 3 * w + 1 && w <= 3 * b + 1) {
printf("YES\n");
if (b > w) {
i = 2;
u = b - w - 1;
b = w + w + 1;
} else {
i = 3;
u = w - b - (w > b ? 1 : 0);
b = b + b + (w > b ? 1 : 0);
}
if (u > b / 2) {
l = 2 * (u - b / 2);
u = b;
} else {
u = u + u;
l = 0;
}
for (j = 0; ++j <= b; ) {
printf("%ld %ld\n", i, j);
}
--i;
for (j = 2; j <= u; j += 2) {
printf("%ld %ld\n", i, j);
}
i += 2;
for (j = 2; j <= l; j += 2) {
printf("%ld %ld\n", i, j);
}
} else {
printf("NO\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1516/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1516/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%ld %ld\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i64, align 8
%b = alloca i64, align 8
%w = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i64, ptr %q, align 8, !tbaa !5
%dec81 = add nsw i64 %0, -1
store i64 %dec81, ptr %q, align 8, !tbaa !5
%cmp82 = icmp sgt i64 %0, 0
br i1 %cmp82, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end52
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %w)
%1 = load i64, ptr %b, align 8, !tbaa !5
%2 = load i64, ptr %w, align 8, !tbaa !5
%mul = mul nsw i64 %2, 3
%add = add nsw i64 %mul, 1
%cmp2.not = icmp sgt i64 %1, %add
br i1 %cmp2.not, label %if.else50, label %land.lhs.true
land.lhs.true: ; preds = %while.body
%mul3 = mul nsw i64 %1, 3
%add4 = add nsw i64 %mul3, 1
%cmp5.not = icmp sgt i64 %2, %add4
br i1 %cmp5.not, label %if.else50, label %if.then
if.then: ; preds = %land.lhs.true
%puts71 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
%3 = load i64, ptr %b, align 8, !tbaa !5
%4 = load i64, ptr %w, align 8, !tbaa !5
%cmp7 = icmp sgt i64 %3, %4
br i1 %cmp7, label %if.then8, label %if.else
if.then8: ; preds = %if.then
%5 = xor i64 %4, -1
%sub9 = add i64 %3, %5
br label %if.end
if.else: ; preds = %if.then
%cmp13 = icmp sgt i64 %4, %3
%conv.neg83 = sext i1 %cmp13 to i64
%conv = zext i1 %cmp13 to i64
%.neg73 = sub i64 %4, %3
%sub14 = add i64 %.neg73, %conv.neg83
br label %if.end
if.end: ; preds = %if.else, %if.then8
%.sink = phi i64 [ %3, %if.else ], [ %4, %if.then8 ]
%conv.sink = phi i64 [ %conv, %if.else ], [ 1, %if.then8 ]
%u.0 = phi i64 [ %sub14, %if.else ], [ %sub9, %if.then8 ]
%i.0 = phi i64 [ 3, %if.else ], [ 2, %if.then8 ]
%add15 = shl nsw i64 %.sink, 1
%add20 = or i64 %add15, %conv.sink
store i64 %add20, ptr %b, align 8, !tbaa !5
%div = sdiv i64 %add20, 2
%cmp21 = icmp sle i64 %u.0, %div
%cmp21.fr = freeze i1 %cmp21
%sub25 = sub nsw i64 %u.0, %div
%mul26 = shl nsw i64 %sub25, 1
%add28 = shl nsw i64 %u.0, 1
%u.1 = select i1 %cmp21.fr, i64 %add28, i64 %add20
%cmp30.not.not74 = icmp sgt i64 %add20, 0
br i1 %cmp30.not.not74, label %for.body, label %for.end
for.body: ; preds = %if.end, %for.body
%j.075 = phi i64 [ %inc, %for.body ], [ 0, %if.end ]
%inc = add nuw nsw i64 %j.075, 1
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %i.0, i64 noundef %inc)
%6 = load i64, ptr %b, align 8, !tbaa !5
%cmp30.not.not = icmp slt i64 %inc, %6
br i1 %cmp30.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %if.end
%dec33 = add nsw i64 %i.0, -1
%cmp35.not76 = icmp slt i64 %u.1, 2
br i1 %cmp35.not76, label %for.end40, label %for.body37
for.body37: ; preds = %for.end, %for.body37
%j.177 = phi i64 [ %add39, %for.body37 ], [ 2, %for.end ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %dec33, i64 noundef %j.177)
%add39 = add nuw nsw i64 %j.177, 2
%cmp35.not = icmp sgt i64 %add39, %u.1
br i1 %cmp35.not, label %for.end40, label %for.body37, !llvm.loop !11
for.end40: ; preds = %for.body37, %for.end
%add41 = add nuw nsw i64 %i.0, 1
%cmp43.not7278 = icmp slt i64 %sub25, 1
%cmp43.not79 = select i1 %cmp21.fr, i1 true, i1 %cmp43.not7278
br i1 %cmp43.not79, label %if.end52, label %for.body45
for.body45: ; preds = %for.end40, %for.body45
%j.280 = phi i64 [ %add48, %for.body45 ], [ 2, %for.end40 ]
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %add41, i64 noundef %j.280)
%add48 = add nuw nsw i64 %j.280, 2
%cmp43.not72 = icmp slt i64 %mul26, %add48
br i1 %cmp43.not72, label %if.end52, label %for.body45, !llvm.loop !12
if.else50: ; preds = %land.lhs.true, %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end52
if.end52: ; preds = %for.body45, %for.end40, %if.else50
%7 = load i64, ptr %q, align 8, !tbaa !5
%dec = add nsw i64 %7, -1
store i64 %dec, ptr %q, align 8, !tbaa !5
%cmp = icmp sgt i64 %7, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !13
while.end: ; preds = %if.end52, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void)
{
int n;
for(;;){
scanf("%d",&n);
if(n==0)break;
int zero=0;
while(n>=5){
n/=5;
zero+= n;
}
printf("%d\n",zero);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151642/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151642/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp eq i32 %0, 0
br i1 %cmp7, label %for.end, label %while.cond.preheader
while.cond.preheader: ; preds = %entry, %while.end
%1 = phi i32 [ %3, %while.end ], [ %0, %entry ]
%cmp14 = icmp sgt i32 %1, 4
br i1 %cmp14, label %while.body, label %while.end
while.body: ; preds = %while.cond.preheader, %while.body
%zero.05 = phi i32 [ %add, %while.body ], [ 0, %while.cond.preheader ]
%2 = phi i32 [ %div, %while.body ], [ %1, %while.cond.preheader ]
%div = udiv i32 %2, 5
%add = add nuw nsw i32 %zero.05, %div
%cmp1 = icmp ugt i32 %2, 24
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader
%zero.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %zero.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %3, 0
br i1 %cmp, label %for.end, label %while.cond.preheader
for.end: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int n;
int result;
// http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1154186366
// 階乗のなかで、0が増えるのは、2と5を約数にもった数を
// 掛けたときです。特に2と5の2つを比べると
// 圧倒的に5が少ないですから、5の倍数を調べて5の約数の数を
// 見つけるのです。そして5の約数の数だけ0が増えていくのです。
while(scanf("%d\n", &n) == 1) {
if(n==0) break;
result = 0;
while(n!=0) {
n /= 5;
result += n;
}
printf("%d\n", result);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151729/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151729/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp10 = icmp ne i32 %call9, 1
%0 = load i32, ptr %n, align 4
%cmp111 = icmp eq i32 %0, 0
%or.cond12 = select i1 %cmp10, i1 true, i1 %cmp111
br i1 %or.cond12, label %while.end6, label %while.body4
while.body4: ; preds = %entry, %while.body4.backedge
%result.08 = phi i32 [ %result.08.be, %while.body4.backedge ], [ 0, %entry ]
%1 = phi i32 [ %.be, %while.body4.backedge ], [ %0, %entry ]
%div = sdiv i32 %1, 5
%add = add nsw i32 %result.08, %div
%.off = add i32 %1, 4
%cmp3.not = icmp ult i32 %.off, 9
br i1 %cmp3.not, label %while.end, label %while.body4.backedge
while.body4.backedge: ; preds = %while.body4, %while.end
%result.08.be = phi i32 [ %add, %while.body4 ], [ 0, %while.end ]
%.be = phi i32 [ %div, %while.body4 ], [ %2, %while.end ]
br label %while.body4, !llvm.loop !5
while.end: ; preds = %while.body4
store i32 %div, ptr %n, align 4, !tbaa !7
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp = icmp ne i32 %call, 1
%2 = load i32, ptr %n, align 4
%cmp1 = icmp eq i32 %2, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end6, label %while.body4.backedge
while.end6: ; preds = %while.end, %entry
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,m,test,i;
scanf("%d",&test);
for(i=0;i<test;i++)
{
scanf("%d %d",&n,&m );
if(n%m==0)
{
printf("YES\n");
}
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15178/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15178/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%test = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %test) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %test)
%0 = load i32, ptr %test, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr %m, align 4, !tbaa !5
%rem = srem i32 %1, %2
%cmp2 = icmp eq i32 %rem, 0
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%puts6 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %test, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %test) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
int n,m;
scanf("%d%d", &n, &m);
if (n >= 3 && m >= 3) {
if (n % m == 0) {
printf("YES\n");
} else {
printf("NO\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15183/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end8, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %if.end8
%i.013 = phi i32 [ %inc, %if.end8 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, 2
%2 = load i32, ptr %m, align 4
%cmp3 = icmp sgt i32 %2, 2
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then, label %if.end8
if.then: ; preds = %for.body
%rem = urem i32 %1, %2
%cmp4 = icmp eq i32 %rem, 0
%str.4.str = select i1 %cmp4, ptr @str.4, ptr @str
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
br label %if.end8
if.end8: ; preds = %if.then, %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%inc = add nuw nsw i32 %i.013, 1
%3 = load i32, ptr %t, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d%d",&a,&b);
if(a<10 && b<10)
printf("%d",a*b);
else
printf("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a*b;
if(a<=9 && b<=9)
{
printf("%d\n",c);
}
else
{
printf(" -1\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_151916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_151916/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [4 x i8] c" -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4
%cmp = icmp slt i32 %0, 10
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int t, i, m, n;
scanf("%d", &t);
for(i=1; i<=t; i++)
{
scanf("%d%d", &n, &m);
if(n%m==0)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #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 %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not7 = icmp slt i32 %0, 1
br i1 %cmp.not7, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr %m, align 4, !tbaa !5
%rem = srem i32 %1, %2
%cmp2 = icmp eq i32 %rem, 0
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%puts6 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %t, 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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
if(a>=10 || b>=10){
printf("-1");
}
else{
printf("%d",a*b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152001/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152001/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp2 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp2
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a>=10||b>=10){
printf("-1\n");
}
else{
printf("%d\n",a*b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d", &a, &b);
if(0<a&&a<10&&0<b&&b<10)
printf("%d\n", a*b);
else
printf("-1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 10
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
br i1 %or.cond9, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nuw nsw i32 %2, %0
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a < 10 && b < 10)
{
printf("%d\n", a * b);
}
else
printf("-1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 10
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a>9||a<1||b>9||b<1){
printf("-1");
}
else
printf("%d",a*b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%1 = add i32 %0, -10
%or.cond = icmp ult i32 %1, -9
%2 = load i32, ptr %b, align 4
%cmp3 = icmp sgt i32 %2, 9
%or.cond8 = select i1 %or.cond, i1 true, i1 %cmp3
%cmp5 = icmp slt i32 %2, 1
%or.cond9 = select i1 %or.cond8, i1 true, i1 %cmp5
br i1 %or.cond9, label %if.then, label %if.else
if.then: ; preds = %entry
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%mul = mul nuw nsw i32 %2, %0
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
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)"}
|
#include <stdio.h>
int main(void){
int A, B;
scanf("%d %d", &A, &B);
if(A>9 || B>9){
printf("-1");
}else{
printf("%d", A*B);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152218/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152218/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %B, align 4
%cmp1 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
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 n,m;
scanf("%d %d",&n,&m);
if(n<10 && n>=1 && m<10 && m>=1)
printf("%d",n*m);
else
printf("-1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152261/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152261/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 9
%2 = load i32, ptr %m, align 4
%cmp3 = icmp slt i32 %2, 10
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp sgt i32 %2, 0
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
br i1 %or.cond9, label %if.then, label %if.else
if.then: ; preds = %entry
%mul = mul nuw nsw i32 %2, %0
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %entry
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
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)"}
|
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d %d",&a,&b);
if(a>9 || b>9){
printf("-1");
}
else{
c=a*b;
printf("%d",c);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152304/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152304/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9
%1 = load i32, ptr %b, align 4
%cmp1 = icmp sgt i32 %1, 9
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%mul = mul nsw i32 %1, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
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 <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))
#define SWAP(type, a, b) { const type tmp = a; a = b; b = tmp; }
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_u64_asc(const void* a, const void* b) {
return *((uint64_t*)a) < *((uint64_t*)b) ? -1 : 1;
}
int compare_u64_desc(const void* a, const void* b) {
return *((uint64_t*)a) > * ((uint64_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;
}
int compare_dp_asc(const void* a, const void* b) {
return *((double*)a) < *((double*)b) ? -1 : 1;
}
static uint64_t modinvU64(const uint64_t a, const uint64_t m) {
int64_t aa = (int64_t)a;
const int64_t mm = (int64_t)m;
int64_t b = mm;
int64_t u = 1;
int64_t v = 0;
while (b != 0) {
const int64_t t = aa / b;
aa -= t * b;
SWAP(uint64_t, aa, b);
u -= t * v;
SWAP(uint64_t, u, v);
}
u %= mm;
if (u < 0) {
u += m;
}
return (uint64_t)u;
}
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 uint64_t combU64WMod(const uint64_t n, const uint64_t r, const uint64_t m) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result = result * (n - i) % m;
result = result * modinvU64(i + 1, m) % m;
}
return result;
}
static uint64_t permU64WMod(const uint64_t n, const uint64_t m) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
result %= m;
}
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 val;
}BHeap_Val;
#define BHEAP_VAL_TYPE BHeap_Val
#define BHEAP_INVALID_NODE ((size_t)100000000)
typedef struct {
BHEAP_VAL_TYPE val;
} BHeap_Node;
struct _BHeap_Ctx {
size_t size;
int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node);
void(*notifyNodeChange)(const struct _BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList);
BHeap_Node* node;
};
typedef struct _BHeap_Ctx BHeap_Ctx;
static void bHeap_Init(BHeap_Ctx* const ctx, int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node), void(*notifyNodeChange)(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList), BHeap_Node* const nodes) {
ctx->size = 0;
ctx->compare = compare;
ctx->notifyNodeChange = notifyNodeChange;
ctx->node = nodes;
}
static void bHeap_Swap(BHeap_Ctx* const ctx, const size_t node0, const size_t node1) {
const BHEAP_VAL_TYPE tmp = ctx->node[node0].val;
ctx->node[node0].val = ctx->node[node1].val;
ctx->node[node1].val = tmp;
if (ctx->notifyNodeChange != NULL) {
const size_t nodeList[2] = { node0,node1 };
ctx->notifyNodeChange(ctx, 2, nodeList);
}
}
static void bHeap_UpHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (nodeIdx == 0) {
return;
}
const size_t parentIdx = (nodeIdx + 1) / 2 - 1;
const int compareResult = ctx->compare(&(ctx->node[parentIdx].val), &(ctx->node[nodeIdx].val));
if (0 < compareResult) {
bHeap_Swap(ctx, nodeIdx, parentIdx);
if (parentIdx != 0) {
bHeap_UpHeap(ctx, parentIdx);
}
}
}
static void bHeap_DownHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (ctx->size - 1 <= nodeIdx) {
return;
}
const size_t leftIdx = 2 * (nodeIdx + 1) - 1;
if (leftIdx < ctx->size) {
const int leftResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[leftIdx].val));
size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx;
const size_t rightIdx = leftIdx + 1;
if (rightIdx < ctx->size) {
const int rightResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[rightIdx].val));
if (swapTarget == BHEAP_INVALID_NODE) {
if (0 < rightResult) {
swapTarget = rightIdx;
}
}
else {
if (0 < rightResult) {
const int rightLeftResult = ctx->compare(&(ctx->node[leftIdx].val), &(ctx->node[rightIdx].val));
if (0 < rightLeftResult) {
swapTarget = rightIdx;
}
}
}
}
if (swapTarget != BHEAP_INVALID_NODE) {
bHeap_Swap(ctx, nodeIdx, swapTarget);
bHeap_DownHeap(ctx, swapTarget);
}
}
}
static void bHeap_Add(BHeap_Ctx* const ctx, const BHEAP_VAL_TYPE val) {
ctx->node[ctx->size].val = val;
ctx->size++;
if (ctx->notifyNodeChange != NULL) {
const size_t node = ctx->size - 1;
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_UpHeap(ctx, ctx->size - 1);
}
static void bHeap_RemoveTop(BHeap_Ctx* const ctx) {
if (ctx->size == 0) {
return;
}
if (ctx->size == 1) {
ctx->size--;
return;
}
ctx->node[0].val = ctx->node[ctx->size - 1].val;
if (ctx->notifyNodeChange != NULL) {
const size_t node = 0;
ctx->notifyNodeChange(ctx, 1, &node);
}
ctx->size--;
bHeap_DownHeap(ctx, 0);
}
static void bHeap_RemoveNode(BHeap_Ctx* const ctx, const size_t node) {
if (node == ctx->size - 1) {
ctx->size--;
}
else {
ctx->node[node].val = ctx->node[ctx->size - 1].val;
ctx->size--;
if (ctx->notifyNodeChange != NULL) {
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_DownHeap(ctx, node);
bHeap_UpHeap(ctx, node);
}
}
static BHEAP_VAL_TYPE* bHeap_GetTopVal(const BHeap_Ctx* const ctx) {
return ctx->size == 0 ? NULL : &(ctx->node[0].val);
}
typedef struct {
uint64_t cnt;
size_t* child;
size_t numChild;
size_t maxNumChild;
} Tree_Node;
#define TREE_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) * TREE_INIT_ALLOC);
tree_Node[i].maxNumChild = TREE_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++;
}
static BHeap_Node BN_Asc[200000];
static BHeap_Node BN_Desc[200000];
static int _bHeap_Compare_Asc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val <= node->val ? -1 : 1;
}
static int _bHeap_Compare_Desc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val >= node->val ? -1 : 1;
}
static size_t PBHeap_Asc_Idx[200000];
static size_t PBHeap_Desc_Idx[200000];
static void _bHeap_NotifyNodeChange_Asc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Asc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
static void _bHeap_NotifyNodeChange_Desc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Desc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
#define MOD_VAL (UINT64_C(1000000007))
int main(void) {
uint64_t N, M;
scanf("%"PRIu64"%"PRIu64, &N, &M);
uint64_t ans = 0;
if (N + 1 == M || M + 1 == N || N == M) {
ans = permU64WMod(N, MOD_VAL) * permU64WMod(M, MOD_VAL) % MOD_VAL;
if (N == M) {
ans *= 2;
ans %= MOD_VAL;
}
}
printf("%"PRIu64"\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152348/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152348/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu%lu\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lu\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_u64_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_u64_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_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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_dp_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !10
%1 = load double, ptr %b, align 8, !tbaa !10
%cmp = fcmp olt double %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:
%N = alloca i64, align 8
%M = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %M) #5
%call = 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
%add = add i64 %0, 1
%1 = load i64, ptr %M, align 8, !tbaa !5
%cmp = icmp eq i64 %add, %1
%add1 = add i64 %1, 1
%cmp2 = icmp eq i64 %add1, %0
%or.cond = or i1 %cmp, %cmp2
%cmp4 = icmp eq i64 %0, %1
%or.cond16 = or i1 %cmp4, %or.cond
br i1 %or.cond16, label %if.then, label %if.end11
if.then: ; preds = %entry
%cmp.not5.i = icmp ult i64 %0, 2
br i1 %cmp.not5.i, label %permU64WMod.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.then
%umax.i = call i64 @llvm.umax.i64(i64 %add, i64 3)
%2 = add i64 %umax.i, -2
%3 = add i64 %umax.i, -3
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %permU64WMod.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %2, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%v.07.i = phi i64 [ 2, %for.body.preheader.i.new ], [ %inc.i.3, %for.body.i ]
%result.06.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %rem.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.3, %for.body.i ]
%mul.i = mul i64 %result.06.i, %v.07.i
%rem.i = urem i64 %mul.i, 1000000007
%inc.i = or i64 %v.07.i, 1
%mul.i.1 = mul i64 %rem.i, %inc.i
%rem.i.1 = urem i64 %mul.i.1, 1000000007
%inc.i.1 = add nuw i64 %v.07.i, 2
%mul.i.2 = mul i64 %rem.i.1, %inc.i.1
%rem.i.2 = urem i64 %mul.i.2, 1000000007
%inc.i.2 = add nuw i64 %v.07.i, 3
%mul.i.3 = mul i64 %rem.i.2, %inc.i.2
%rem.i.3 = urem i64 %mul.i.3, 1000000007
%inc.i.3 = add nuw i64 %v.07.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %permU64WMod.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !12
permU64WMod.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.preheader.i ], [ %rem.i.3, %for.body.i ]
%v.07.i.unr = phi i64 [ 2, %for.body.preheader.i ], [ %inc.i.3, %for.body.i ]
%result.06.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %rem.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %permU64WMod.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %permU64WMod.exit.loopexit.unr-lcssa, %for.body.i.epil
%v.07.i.epil = phi i64 [ %inc.i.epil, %for.body.i.epil ], [ %v.07.i.unr, %permU64WMod.exit.loopexit.unr-lcssa ]
%result.06.i.epil = phi i64 [ %rem.i.epil, %for.body.i.epil ], [ %result.06.i.unr, %permU64WMod.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %permU64WMod.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul i64 %result.06.i.epil, %v.07.i.epil
%rem.i.epil = urem i64 %mul.i.epil, 1000000007
%inc.i.epil = add nuw i64 %v.07.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %permU64WMod.exit, label %for.body.i.epil, !llvm.loop !14
permU64WMod.exit: ; preds = %permU64WMod.exit.loopexit.unr-lcssa, %for.body.i.epil, %if.then
%result.0.lcssa.i = phi i64 [ 1, %if.then ], [ %rem.i.lcssa.ph, %permU64WMod.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i.epil ]
%cmp.not5.i17 = icmp ult i64 %1, 2
br i1 %cmp.not5.i17, label %permU64WMod.exit28, label %for.body.preheader.i18
for.body.preheader.i18: ; preds = %permU64WMod.exit
%umax.i19 = call i64 @llvm.umax.i64(i64 %add1, i64 3)
%5 = add i64 %umax.i19, -2
%6 = add i64 %umax.i19, -3
%xtraiter30 = and i64 %5, 3
%7 = icmp ult i64 %6, 3
br i1 %7, label %permU64WMod.exit28.loopexit.unr-lcssa, label %for.body.preheader.i18.new
for.body.preheader.i18.new: ; preds = %for.body.preheader.i18
%unroll_iter34 = and i64 %5, -4
br label %for.body.i20
for.body.i20: ; preds = %for.body.i20, %for.body.preheader.i18.new
%v.07.i21 = phi i64 [ 2, %for.body.preheader.i18.new ], [ %inc.i25.3, %for.body.i20 ]
%result.06.i22 = phi i64 [ 1, %for.body.preheader.i18.new ], [ %rem.i24.3, %for.body.i20 ]
%niter35 = phi i64 [ 0, %for.body.preheader.i18.new ], [ %niter35.next.3, %for.body.i20 ]
%mul.i23 = mul i64 %result.06.i22, %v.07.i21
%rem.i24 = urem i64 %mul.i23, 1000000007
%inc.i25 = or i64 %v.07.i21, 1
%mul.i23.1 = mul i64 %rem.i24, %inc.i25
%rem.i24.1 = urem i64 %mul.i23.1, 1000000007
%inc.i25.1 = add nuw i64 %v.07.i21, 2
%mul.i23.2 = mul i64 %rem.i24.1, %inc.i25.1
%rem.i24.2 = urem i64 %mul.i23.2, 1000000007
%inc.i25.2 = add nuw i64 %v.07.i21, 3
%mul.i23.3 = mul i64 %rem.i24.2, %inc.i25.2
%rem.i24.3 = urem i64 %mul.i23.3, 1000000007
%inc.i25.3 = add nuw i64 %v.07.i21, 4
%niter35.next.3 = add i64 %niter35, 4
%niter35.ncmp.3 = icmp eq i64 %niter35.next.3, %unroll_iter34
br i1 %niter35.ncmp.3, label %permU64WMod.exit28.loopexit.unr-lcssa, label %for.body.i20, !llvm.loop !12
permU64WMod.exit28.loopexit.unr-lcssa: ; preds = %for.body.i20, %for.body.preheader.i18
%rem.i24.lcssa.ph = phi i64 [ undef, %for.body.preheader.i18 ], [ %rem.i24.3, %for.body.i20 ]
%v.07.i21.unr = phi i64 [ 2, %for.body.preheader.i18 ], [ %inc.i25.3, %for.body.i20 ]
%result.06.i22.unr = phi i64 [ 1, %for.body.preheader.i18 ], [ %rem.i24.3, %for.body.i20 ]
%lcmp.mod32.not = icmp eq i64 %xtraiter30, 0
br i1 %lcmp.mod32.not, label %permU64WMod.exit28, label %for.body.i20.epil
for.body.i20.epil: ; preds = %permU64WMod.exit28.loopexit.unr-lcssa, %for.body.i20.epil
%v.07.i21.epil = phi i64 [ %inc.i25.epil, %for.body.i20.epil ], [ %v.07.i21.unr, %permU64WMod.exit28.loopexit.unr-lcssa ]
%result.06.i22.epil = phi i64 [ %rem.i24.epil, %for.body.i20.epil ], [ %result.06.i22.unr, %permU64WMod.exit28.loopexit.unr-lcssa ]
%epil.iter31 = phi i64 [ %epil.iter31.next, %for.body.i20.epil ], [ 0, %permU64WMod.exit28.loopexit.unr-lcssa ]
%mul.i23.epil = mul i64 %result.06.i22.epil, %v.07.i21.epil
%rem.i24.epil = urem i64 %mul.i23.epil, 1000000007
%inc.i25.epil = add nuw i64 %v.07.i21.epil, 1
%epil.iter31.next = add i64 %epil.iter31, 1
%epil.iter31.cmp.not = icmp eq i64 %epil.iter31.next, %xtraiter30
br i1 %epil.iter31.cmp.not, label %permU64WMod.exit28, label %for.body.i20.epil, !llvm.loop !16
permU64WMod.exit28: ; preds = %permU64WMod.exit28.loopexit.unr-lcssa, %for.body.i20.epil, %permU64WMod.exit
%result.0.lcssa.i27 = phi i64 [ 1, %permU64WMod.exit ], [ %rem.i24.lcssa.ph, %permU64WMod.exit28.loopexit.unr-lcssa ], [ %rem.i24.epil, %for.body.i20.epil ]
%mul = mul nuw nsw i64 %result.0.lcssa.i27, %result.0.lcssa.i
%mul.fr = freeze i64 %mul
%rem = urem i64 %mul.fr, 1000000007
br i1 %cmp4, label %if.then8, label %if.end11
if.then8: ; preds = %permU64WMod.exit28
%mul9 = shl nuw nsw i64 %rem, 1
%rem10.urem = add nsw i64 %mul9, -1000000007
%rem10.cmp = icmp ult i64 %rem, 500000004
%rem10 = select i1 %rem10.cmp, i64 %mul9, i64 %rem10.urem
br label %if.end11
if.end11: ; preds = %entry, %permU64WMod.exit28, %if.then8
%ans.0 = phi i64 [ %rem10, %if.then8 ], [ %rem, %permU64WMod.exit28 ], [ 0, %entry ]
%call12 = 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) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !15}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
int dog, mon;
int i;
int ans;
scanf("%d %d", &dog, &mon);
int n = abs(dog - mon);
if (n > 1)ans = 0;
else {
long long int dogcount = 1;
long long int moncount = 1;
for (i = 1; i <= dog; i++) {
dogcount *= i;
dogcount = dogcount % 1000000007;
}
for (i = 1; i <= mon; i++) {
moncount *= i;
moncount = moncount % 1000000007;
}
if(n==0) ans = (2*dogcount*moncount) % 1000000007;
else ans= (dogcount*moncount) % 1000000007;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152399/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%dog = alloca i32, align 4
%mon = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dog) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %mon) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dog, ptr noundef nonnull %mon)
%0 = load i32, ptr %dog, align 4, !tbaa !5
%1 = load i32, ptr %mon, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%cmp = icmp ugt i32 %2, 1
br i1 %cmp, label %if.end23, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp1.not37 = icmp slt i32 %0, 1
br i1 %cmp1.not37, label %for.cond2.preheader, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%3 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %3 to i64
%4 = add nsw i64 %wide.trip.count, -1
%5 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %4, 3
%6 = icmp ult i64 %5, 3
br i1 %6, label %for.cond2.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %4, -4
br label %for.body
for.cond2.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%dogcount.039.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond2.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond2.preheader.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond2.preheader.loopexit.unr-lcssa ]
%dogcount.039.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %dogcount.039.unr, %for.cond2.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond2.preheader.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %dogcount.039.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%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 %for.cond2.preheader, label %for.body.epil, !llvm.loop !9
for.cond2.preheader: ; preds = %for.cond2.preheader.loopexit.unr-lcssa, %for.body.epil, %for.cond.preheader
%dogcount.0.lcssa = phi i64 [ 1, %for.cond.preheader ], [ %rem.lcssa.ph, %for.cond2.preheader.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%cmp3.not40 = icmp slt i32 %1, 1
br i1 %cmp3.not40, label %for.end11, label %for.body5.preheader
for.body5.preheader: ; preds = %for.cond2.preheader
%7 = add nuw i32 %1, 1
%wide.trip.count48 = zext i32 %7 to i64
%8 = add nsw i64 %wide.trip.count48, -1
%9 = add nsw i64 %wide.trip.count48, -2
%xtraiter51 = and i64 %8, 3
%10 = icmp ult i64 %9, 3
br i1 %10, label %for.end11.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter55 = and i64 %8, -4
br label %for.body5
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%dogcount.039 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %dogcount.039, %indvars.iv
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, 1000000007
%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 %for.cond2.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%indvars.iv45 = phi i64 [ 1, %for.body5.preheader.new ], [ %indvars.iv.next46.3, %for.body5 ]
%moncount.042 = phi i64 [ 1, %for.body5.preheader.new ], [ %rem8.3, %for.body5 ]
%niter56 = phi i64 [ 0, %for.body5.preheader.new ], [ %niter56.next.3, %for.body5 ]
%mul7 = mul nsw i64 %moncount.042, %indvars.iv45
%rem8 = srem i64 %mul7, 1000000007
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%mul7.1 = mul nsw i64 %rem8, %indvars.iv.next46
%rem8.1 = srem i64 %mul7.1, 1000000007
%indvars.iv.next46.1 = add nuw nsw i64 %indvars.iv45, 2
%mul7.2 = mul nsw i64 %rem8.1, %indvars.iv.next46.1
%rem8.2 = srem i64 %mul7.2, 1000000007
%indvars.iv.next46.2 = add nuw nsw i64 %indvars.iv45, 3
%mul7.3 = mul nsw i64 %rem8.2, %indvars.iv.next46.2
%rem8.3 = srem i64 %mul7.3, 1000000007
%indvars.iv.next46.3 = add nuw nsw i64 %indvars.iv45, 4
%niter56.next.3 = add i64 %niter56, 4
%niter56.ncmp.3 = icmp eq i64 %niter56.next.3, %unroll_iter55
br i1 %niter56.ncmp.3, label %for.end11.loopexit.unr-lcssa, label %for.body5, !llvm.loop !13
for.end11.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%rem8.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %rem8.3, %for.body5 ]
%indvars.iv45.unr = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next46.3, %for.body5 ]
%moncount.042.unr = phi i64 [ 1, %for.body5.preheader ], [ %rem8.3, %for.body5 ]
%lcmp.mod53.not = icmp eq i64 %xtraiter51, 0
br i1 %lcmp.mod53.not, label %for.end11, label %for.body5.epil
for.body5.epil: ; preds = %for.end11.loopexit.unr-lcssa, %for.body5.epil
%indvars.iv45.epil = phi i64 [ %indvars.iv.next46.epil, %for.body5.epil ], [ %indvars.iv45.unr, %for.end11.loopexit.unr-lcssa ]
%moncount.042.epil = phi i64 [ %rem8.epil, %for.body5.epil ], [ %moncount.042.unr, %for.end11.loopexit.unr-lcssa ]
%epil.iter52 = phi i64 [ %epil.iter52.next, %for.body5.epil ], [ 0, %for.end11.loopexit.unr-lcssa ]
%mul7.epil = mul nsw i64 %moncount.042.epil, %indvars.iv45.epil
%rem8.epil = srem i64 %mul7.epil, 1000000007
%indvars.iv.next46.epil = add nuw nsw i64 %indvars.iv45.epil, 1
%epil.iter52.next = add i64 %epil.iter52, 1
%epil.iter52.cmp.not = icmp eq i64 %epil.iter52.next, %xtraiter51
br i1 %epil.iter52.cmp.not, label %for.end11, label %for.body5.epil, !llvm.loop !14
for.end11: ; preds = %for.end11.loopexit.unr-lcssa, %for.body5.epil, %for.cond2.preheader
%moncount.0.lcssa = phi i64 [ 1, %for.cond2.preheader ], [ %rem8.lcssa.ph, %for.end11.loopexit.unr-lcssa ], [ %rem8.epil, %for.body5.epil ]
%cmp12 = icmp eq i32 %0, %1
%mul15 = zext i1 %cmp12 to i64
%mul15.pn = shl nsw i64 %dogcount.0.lcssa, %mul15
%ans.0.in.in = mul nsw i64 %moncount.0.lcssa, %mul15.pn
%ans.0.in = srem i64 %ans.0.in.in, 1000000007
%ans.0 = trunc i64 %ans.0.in to i32
br label %if.end23
if.end23: ; preds = %entry, %for.end11
%ans.1 = phi i32 [ %ans.0, %for.end11 ], [ 0, %entry ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %mon) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dog) #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 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
int compare(const void *a, const void *b)
{
int *x;
int *y;
x = (int *)a;
y = (int *)b;
return (*y - *x);
}
int main(void)
{
int n, m;
int point[1001];
static int sum[1002001];
int s;
int i, j, k;
int left, right, center;
int temp, ans;
while (1){
scanf("%d%d", &n, &m);
if (n + m == 0){
break;
}
point[0] = 0;
for (i = 1; i <= n; i++){
scanf("%d", &point[i]);
}
n++;
k = 0;
for (i = 0; i < n; i++){
for (j = i; j < n; j++){
sum[k++] = point[i] + point[j];
}
}
qsort(sum, k, sizeof(int), compare);
ans = 0;
for (i = 0; i < k; i++){
if (sum[i] <= m){
temp = sum[i];
left = 0;
right = k - 1;
while (left != right){
center = (left + right) / 2;
if (temp + sum[center] <= m){
right = center;
}
else {
left = center + 1;
}
}
ans = ans < (temp + sum[right]) ? (temp + sum[right]) : ans;
}
}
printf("%d\n", ans);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152449/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152449/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main.sum = internal global [1002001 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%point = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %point) #6
%call105 = 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
%add106 = sub i32 0, %1
%cmp107 = icmp eq i32 %0, %add106
br i1 %cmp107, label %while.end62, label %if.end
if.end: ; preds = %entry, %for.end60
%2 = phi i32 [ %27, %for.end60 ], [ %0, %entry ]
store i32 0, ptr %point, align 16, !tbaa !5
%cmp1.not89 = icmp slt i32 %2, 1
br i1 %cmp1.not89, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %if.end ]
%arrayidx2 = getelementptr inbounds [1001 x i32], ptr %point, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2)
%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
%cmp1.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp1.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %if.end
%.lcssa = phi i32 [ %2, %if.end ], [ %3, %for.body ]
%inc4 = add i32 %.lcssa, 1
store i32 %inc4, ptr %n, align 4, !tbaa !5
%cmp6.not93 = icmp slt i32 %.lcssa, 0
br i1 %cmp6.not93, label %for.end24.thread, label %for.cond8.preheader.preheader
for.end24.thread: ; preds = %for.end
call void @qsort(ptr noundef nonnull @main.sum, i64 noundef 0, i64 noundef 4, ptr noundef nonnull @compare) #6
br label %for.end60
for.cond8.preheader.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %inc4 to i64
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc22
%indvars.iv120 = phi i32 [ 1, %for.cond8.preheader.preheader ], [ %indvars.iv.next121, %for.inc22 ]
%indvars.iv111 = phi i64 [ 0, %for.cond8.preheader.preheader ], [ %indvars.iv.next112, %for.inc22 ]
%k.094 = phi i32 [ 0, %for.cond8.preheader.preheader ], [ %k.0.lcssa.fr, %for.inc22 ]
%5 = trunc i64 %indvars.iv111 to i32
%smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 %5)
%arrayidx12 = getelementptr inbounds [1001 x i32], ptr %point, i64 0, i64 %indvars.iv111
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%7 = sext i32 %k.094 to i64
%8 = add i32 %k.094, %smax
%9 = add i32 %8, %indvars.iv120
%k.0.lcssa.fr = freeze i32 %9
%10 = xor i32 %k.094, -1
%11 = add i32 %k.0.lcssa.fr, %10
%12 = zext i32 %11 to i64
%13 = add nuw nsw i64 %12, 1
%min.iters.check = icmp ult i32 %11, 7
br i1 %min.iters.check, label %for.body10.preheader, label %vector.ph
vector.ph: ; preds = %for.cond8.preheader
%n.vec = and i64 %13, 8589934584
%ind.end = add nsw i64 %n.vec, %7
%ind.end143 = add nuw i64 %indvars.iv111, %n.vec
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %6, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %indvars.iv111, %index
%offset.idx145 = add i64 %index, %7
%14 = getelementptr inbounds [1001 x i32], ptr %point, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %14, align 4, !tbaa !5
%15 = getelementptr inbounds i32, ptr %14, i64 4
%wide.load146 = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = add nsw <4 x i32> %wide.load, %broadcast.splat
%17 = add nsw <4 x i32> %wide.load146, %broadcast.splat
%18 = getelementptr inbounds [1002001 x i32], ptr @main.sum, i64 0, i64 %offset.idx145
store <4 x i32> %16, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
store <4 x i32> %17, ptr %19, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %13, %n.vec
br i1 %cmp.n, label %for.inc22, label %for.body10.preheader
for.body10.preheader: ; preds = %for.cond8.preheader, %middle.block
%indvars.iv115.ph = phi i64 [ %7, %for.cond8.preheader ], [ %ind.end, %middle.block ]
%indvars.iv113.ph = phi i64 [ %indvars.iv111, %for.cond8.preheader ], [ %ind.end143, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader, %for.body10
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body10 ], [ %indvars.iv115.ph, %for.body10.preheader ]
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.body10 ], [ %indvars.iv113.ph, %for.body10.preheader ]
%arrayidx14 = getelementptr inbounds [1001 x i32], ptr %point, i64 0, i64 %indvars.iv113
%21 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add15 = add nsw i32 %21, %6
%indvars.iv.next116 = add nsw i64 %indvars.iv115, 1
%arrayidx18 = getelementptr inbounds [1002001 x i32], ptr @main.sum, i64 0, i64 %indvars.iv115
store i32 %add15, ptr %arrayidx18, align 4, !tbaa !5
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%lftr.wideiv = trunc i64 %indvars.iv.next116 to i32
%exitcond.not = icmp eq i32 %k.0.lcssa.fr, %lftr.wideiv
br i1 %exitcond.not, label %for.inc22, label %for.body10, !llvm.loop !14
for.inc22: ; preds = %for.body10, %middle.block
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%indvars.iv.next121 = add nsw i32 %indvars.iv120, -1
%exitcond123.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count
br i1 %exitcond123.not, label %for.end24, label %for.cond8.preheader, !llvm.loop !15
for.end24: ; preds = %for.inc22
%conv = sext i32 %k.0.lcssa.fr to i64
call void @qsort(ptr noundef nonnull @main.sum, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare) #6
%cmp26101 = icmp sgt i32 %k.0.lcssa.fr, 0
br i1 %cmp26101, label %for.body28.lr.ph, label %for.end60
for.body28.lr.ph: ; preds = %for.end24
%22 = load i32, ptr %m, align 4, !tbaa !5
%sub = add nsw i32 %k.0.lcssa.fr, -1
%cmp37.not97 = icmp eq i32 %sub, 0
%wide.trip.count132 = zext i32 %k.0.lcssa.fr to i64
br i1 %cmp37.not97, label %for.end60.loopexit, label %for.body28
for.body28: ; preds = %for.body28.lr.ph, %for.inc58
%indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.inc58 ], [ 0, %for.body28.lr.ph ]
%ans.0103 = phi i32 [ %ans.1, %for.inc58 ], [ 0, %for.body28.lr.ph ]
%arrayidx30 = getelementptr inbounds [1002001 x i32], ptr @main.sum, i64 0, i64 %indvars.iv124
%23 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.not = icmp sgt i32 %23, %22
br i1 %cmp31.not, label %for.inc58, label %while.body39
while.body39: ; preds = %for.body28, %while.body39
%right.099 = phi i32 [ %right.1, %while.body39 ], [ %sub, %for.body28 ]
%left.098 = phi i32 [ %left.1, %while.body39 ], [ 0, %for.body28 ]
%add40 = add nsw i32 %right.099, %left.098
%div = sdiv i32 %add40, 2
%idxprom41 = sext i32 %div to i64
%arrayidx42 = getelementptr inbounds [1002001 x i32], ptr @main.sum, i64 0, i64 %idxprom41
%24 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%add43 = add nsw i32 %24, %23
%cmp44.not = icmp sgt i32 %add43, %22
%add47 = add nsw i32 %div, 1
%left.1 = select i1 %cmp44.not, i32 %add47, i32 %left.098
%right.1 = select i1 %cmp44.not, i32 %right.099, i32 %div
%cmp37.not = icmp eq i32 %left.1, %right.1
br i1 %cmp37.not, label %while.cond36.while.end_crit_edge, label %while.body39, !llvm.loop !16
while.cond36.while.end_crit_edge: ; preds = %while.body39
%idxprom49 = sext i32 %left.1 to i64
%arrayidx50 = getelementptr inbounds [1002001 x i32], ptr @main.sum, i64 0, i64 %idxprom49
%25 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%add51 = add nsw i32 %25, %23
%add51.ans.0 = call i32 @llvm.smax.i32(i32 %ans.0103, i32 %add51)
br label %for.inc58
for.inc58: ; preds = %for.body28, %while.cond36.while.end_crit_edge
%ans.1 = phi i32 [ %add51.ans.0, %while.cond36.while.end_crit_edge ], [ %ans.0103, %for.body28 ]
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count132
br i1 %exitcond128.not, label %for.end60, label %for.body28, !llvm.loop !17
for.end60.loopexit: ; preds = %for.body28.lr.ph
%26 = load i32, ptr @main.sum, align 16
%cmp31.not.us = icmp sgt i32 %26, %22
%add51.us = shl nsw i32 %26, 1
%add51.ans.0.us = call i32 @llvm.smax.i32(i32 %add51.us, i32 0)
%ans.1.us = select i1 %cmp31.not.us, i32 0, i32 %add51.ans.0.us
br label %for.end60
for.end60: ; preds = %for.inc58, %for.end60.loopexit, %for.end24.thread, %for.end24
%ans.0.lcssa = phi i32 [ 0, %for.end24 ], [ 0, %for.end24.thread ], [ %ans.1.us, %for.end60.loopexit ], [ %ans.1, %for.inc58 ]
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%27 = load i32, ptr %n, align 4, !tbaa !5
%28 = load i32, ptr %m, align 4, !tbaa !5
%add = sub i32 0, %28
%cmp = icmp eq i32 %27, %add
br i1 %cmp, label %while.end62, label %if.end
while.end62: ; preds = %for.end60, %entry
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %point) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main()
{
int q;
scanf("%d", &q);
int n, k;
char s[200005];
int r[200005], g[200005], b[200005];
int i, j;
int ans;
for (i = 0; i < q; i++)
{
scanf("%d %d", &n, &k);
scanf("%s", s);
r[0] = g[0] = b[0] = 0;
for (j = 0; j < n; j++)
{
if (j % 3 == 0)
{
if (s[j] == 'R')
{
r[j + 1] = r[j];
g[j + 1] = g[j] + 1;
b[j + 1] = b[j] + 1;
}
else if (s[j] == 'G')
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j];
b[j + 1] = b[j] + 1;
}
else
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j] + 1;
b[j + 1] = b[j];
}
}
else if (j % 3 == 1)
{
if (s[j] == 'R')
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j] + 1;
b[j + 1] = b[j];
}
else if (s[j] == 'G')
{
r[j + 1] = r[j];
g[j + 1] = g[j] + 1;
b[j + 1] = b[j] + 1;
}
else
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j];
b[j + 1] = b[j] + 1;
}
}
else
{
if (s[j] == 'R')
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j];
b[j + 1] = b[j] + 1;
}
else if (s[j] == 'G')
{
r[j + 1] = r[j] + 1;
g[j + 1] = g[j] + 1;
b[j + 1] = b[j];
}
else
{
r[j + 1] = r[j];
g[j + 1] = g[j] + 1;
b[j + 1] = b[j] + 1;
}
}
}
ans = n;
for (j = k; j <= n; j++)
{
if (ans > r[j] - r[j - k])
ans = r[j] - r[j - k];
if (ans > g[j] - g[j - k])
ans = g[j] - g[j - k];
if (ans > b[j] - b[j - k])
ans = b[j] - b[j - k];
}
printf("%d\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1525/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1525/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
%n = alloca i32, align 4
%k = alloca i32, align 4
%s = alloca [200005 x i8], align 16
%r = alloca [200005 x i32], align 16
%g = alloca [200005 x i32], align 16
%b = alloca [200005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %g) #4
call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %b) #4
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp358 = icmp sgt i32 %0, 0
br i1 %cmp358, label %for.body, label %for.end270
for.body: ; preds = %entry, %for.end266
%i.0359 = phi i32 [ %inc269, %for.end266 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s)
store i32 0, ptr %b, align 16, !tbaa !5
store i32 0, ptr %g, align 16, !tbaa !5
store i32 0, ptr %r, align 16, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp6352 = icmp sgt i32 %1, 0
br i1 %cmp6352, label %for.body7.preheader, label %for.end
for.body7.preheader: ; preds = %for.body
%wide.trip.count = zext i32 %1 to i64
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body7.preheader ], [ %.sink, %for.inc ]
%2 = trunc i64 %indvars.iv to i32
%rem = urem i32 %2, 3
%arrayidx145 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx145, align 1, !tbaa !9
%arrayidx193 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx193, align 4, !tbaa !5
switch i32 %rem, label %if.else143 [
i32 0, label %if.then
i32 1, label %if.then75
]
if.then: ; preds = %for.body7
switch i8 %3, label %if.else52 [
i8 82, label %if.then12
i8 71, label %if.then34
]
if.then12: ; preds = %if.then
%5 = add nuw nsw i64 %indvars.iv, 1
%arrayidx16 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %5
store i32 %4, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%add19 = add nsw i32 %6, 1
%arrayidx22 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %5
store i32 %add19, ptr %arrayidx22, align 4, !tbaa !5
%arrayidx24 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25 = add nsw i32 %7, 1
br label %for.inc
if.then34: ; preds = %if.then
%add37 = add nsw i32 %4, 1
%8 = add nuw nsw i64 %indvars.iv, 1
%arrayidx40 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %8
store i32 %add37, ptr %arrayidx40, align 4, !tbaa !5
%arrayidx42 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%arrayidx45 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %8
store i32 %9, ptr %arrayidx45, align 4, !tbaa !5
%arrayidx47 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%add48 = add nsw i32 %10, 1
br label %for.inc
if.else52: ; preds = %if.then
%add55 = add nsw i32 %4, 1
%11 = add nuw nsw i64 %indvars.iv, 1
%arrayidx58 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %11
store i32 %add55, ptr %arrayidx58, align 4, !tbaa !5
%arrayidx60 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%12 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%add61 = add nsw i32 %12, 1
%arrayidx64 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %11
store i32 %add61, ptr %arrayidx64, align 4, !tbaa !5
%arrayidx66 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%13 = load i32, ptr %arrayidx66, align 4, !tbaa !5
br label %for.inc
if.then75: ; preds = %for.body7
switch i8 %3, label %if.else123 [
i8 82, label %if.then81
i8 71, label %if.then105
]
if.then81: ; preds = %if.then75
%add84 = add nsw i32 %4, 1
%14 = add nuw nsw i64 %indvars.iv, 1
%arrayidx87 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %14
store i32 %add84, ptr %arrayidx87, align 4, !tbaa !5
%arrayidx89 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%15 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%add90 = add nsw i32 %15, 1
%arrayidx93 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %14
store i32 %add90, ptr %arrayidx93, align 4, !tbaa !5
%arrayidx95 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%16 = load i32, ptr %arrayidx95, align 4, !tbaa !5
br label %for.inc
if.then105: ; preds = %if.then75
%17 = add nuw nsw i64 %indvars.iv, 1
%arrayidx110 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %17
store i32 %4, ptr %arrayidx110, align 4, !tbaa !5
%arrayidx112 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%18 = load i32, ptr %arrayidx112, align 4, !tbaa !5
%add113 = add nsw i32 %18, 1
%arrayidx116 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %17
store i32 %add113, ptr %arrayidx116, align 4, !tbaa !5
%arrayidx118 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%19 = load i32, ptr %arrayidx118, align 4, !tbaa !5
%add119 = add nsw i32 %19, 1
br label %for.inc
if.else123: ; preds = %if.then75
%add126 = add nsw i32 %4, 1
%20 = add nuw nsw i64 %indvars.iv, 1
%arrayidx129 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %20
store i32 %add126, ptr %arrayidx129, align 4, !tbaa !5
%arrayidx131 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%21 = load i32, ptr %arrayidx131, align 4, !tbaa !5
%arrayidx134 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %20
store i32 %21, ptr %arrayidx134, align 4, !tbaa !5
%arrayidx136 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%22 = load i32, ptr %arrayidx136, align 4, !tbaa !5
%add137 = add nsw i32 %22, 1
br label %for.inc
if.else143: ; preds = %for.body7
switch i8 %3, label %if.else191 [
i8 82, label %if.then149
i8 71, label %if.then173
]
if.then149: ; preds = %if.else143
%add152 = add nsw i32 %4, 1
%23 = add nuw nsw i64 %indvars.iv, 1
%arrayidx155 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %23
store i32 %add152, ptr %arrayidx155, align 4, !tbaa !5
%arrayidx157 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%24 = load i32, ptr %arrayidx157, align 4, !tbaa !5
%arrayidx160 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %23
store i32 %24, ptr %arrayidx160, align 4, !tbaa !5
%arrayidx162 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%25 = load i32, ptr %arrayidx162, align 4, !tbaa !5
%add163 = add nsw i32 %25, 1
br label %for.inc
if.then173: ; preds = %if.else143
%add176 = add nsw i32 %4, 1
%26 = add nuw nsw i64 %indvars.iv, 1
%arrayidx179 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %26
store i32 %add176, ptr %arrayidx179, align 4, !tbaa !5
%arrayidx181 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%27 = load i32, ptr %arrayidx181, align 4, !tbaa !5
%add182 = add nsw i32 %27, 1
%arrayidx185 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %26
store i32 %add182, ptr %arrayidx185, align 4, !tbaa !5
%arrayidx187 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%28 = load i32, ptr %arrayidx187, align 4, !tbaa !5
br label %for.inc
if.else191: ; preds = %if.else143
%29 = add nuw nsw i64 %indvars.iv, 1
%arrayidx196 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %29
store i32 %4, ptr %arrayidx196, align 4, !tbaa !5
%arrayidx198 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv
%30 = load i32, ptr %arrayidx198, align 4, !tbaa !5
%add199 = add nsw i32 %30, 1
%arrayidx202 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %29
store i32 %add199, ptr %arrayidx202, align 4, !tbaa !5
%arrayidx204 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv
%31 = load i32, ptr %arrayidx204, align 4, !tbaa !5
%add205 = add nsw i32 %31, 1
br label %for.inc
for.inc: ; preds = %if.then34, %if.else52, %if.then12, %if.then149, %if.else191, %if.then173, %if.then81, %if.else123, %if.then105
%.sink = phi i64 [ %8, %if.then34 ], [ %11, %if.else52 ], [ %5, %if.then12 ], [ %23, %if.then149 ], [ %29, %if.else191 ], [ %26, %if.then173 ], [ %14, %if.then81 ], [ %20, %if.else123 ], [ %17, %if.then105 ]
%add48.sink = phi i32 [ %add48, %if.then34 ], [ %13, %if.else52 ], [ %add25, %if.then12 ], [ %add163, %if.then149 ], [ %add205, %if.else191 ], [ %28, %if.then173 ], [ %16, %if.then81 ], [ %add137, %if.else123 ], [ %add119, %if.then105 ]
%arrayidx51 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %.sink
store i32 %add48.sink, ptr %arrayidx51, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %.sink, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body7, !llvm.loop !10
for.end: ; preds = %for.inc, %for.body
%32 = load i32, ptr %k, align 4, !tbaa !5
%cmp214.not354 = icmp sgt i32 %32, %1
br i1 %cmp214.not354, label %for.end266, label %for.body216.preheader
for.body216.preheader: ; preds = %for.end
%33 = sext i32 %32 to i64
%34 = add i32 %1, 1
%35 = sub i32 %1, %32
%36 = zext i32 %35 to i64
%37 = add nuw nsw i64 %36, 1
%min.iters.check = icmp ult i32 %35, 7
br i1 %min.iters.check, label %for.body216.preheader387, label %vector.ph
vector.ph: ; preds = %for.body216.preheader
%n.vec = and i64 %37, 8589934584
%ind.end = add nsw i64 %n.vec, %33
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %60, %vector.body ]
%vec.phi375 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %61, %vector.body ]
%offset.idx = add i64 %index, %33
%38 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %38, align 4, !tbaa !5
%39 = getelementptr inbounds i32, ptr %38, i64 4
%wide.load376 = load <4 x i32>, ptr %39, align 4, !tbaa !5
%40 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %index
%wide.load377 = load <4 x i32>, ptr %40, align 16, !tbaa !5
%41 = getelementptr inbounds i32, ptr %40, i64 4
%wide.load378 = load <4 x i32>, ptr %41, align 16, !tbaa !5
%42 = sub nsw <4 x i32> %wide.load, %wide.load377
%43 = sub nsw <4 x i32> %wide.load376, %wide.load378
%44 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %42)
%45 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi375, <4 x i32> %43)
%46 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %offset.idx
%wide.load379 = load <4 x i32>, ptr %46, align 4, !tbaa !5
%47 = getelementptr inbounds i32, ptr %46, i64 4
%wide.load380 = load <4 x i32>, ptr %47, align 4, !tbaa !5
%48 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %index
%wide.load381 = load <4 x i32>, ptr %48, align 16, !tbaa !5
%49 = getelementptr inbounds i32, ptr %48, i64 4
%wide.load382 = load <4 x i32>, ptr %49, align 16, !tbaa !5
%50 = sub nsw <4 x i32> %wide.load379, %wide.load381
%51 = sub nsw <4 x i32> %wide.load380, %wide.load382
%52 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %44, <4 x i32> %50)
%53 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %45, <4 x i32> %51)
%54 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %offset.idx
%wide.load383 = load <4 x i32>, ptr %54, align 4, !tbaa !5
%55 = getelementptr inbounds i32, ptr %54, i64 4
%wide.load384 = load <4 x i32>, ptr %55, align 4, !tbaa !5
%56 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %index
%wide.load385 = load <4 x i32>, ptr %56, align 16, !tbaa !5
%57 = getelementptr inbounds i32, ptr %56, i64 4
%wide.load386 = load <4 x i32>, ptr %57, align 16, !tbaa !5
%58 = sub nsw <4 x i32> %wide.load383, %wide.load385
%59 = sub nsw <4 x i32> %wide.load384, %wide.load386
%60 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %52, <4 x i32> %58)
%61 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %53, <4 x i32> %59)
%index.next = add nuw i64 %index, 8
%62 = icmp eq i64 %index.next, %n.vec
br i1 %62, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %60, <4 x i32> %61)
%63 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %37, %n.vec
br i1 %cmp.n, label %for.end266, label %for.body216.preheader387
for.body216.preheader387: ; preds = %for.body216.preheader, %middle.block
%indvars.iv370.ph = phi i64 [ %33, %for.body216.preheader ], [ %ind.end, %middle.block ]
%ans.0356.ph = phi i32 [ %1, %for.body216.preheader ], [ %63, %middle.block ]
br label %for.body216
for.body216: ; preds = %for.body216.preheader387, %for.body216
%indvars.iv370 = phi i64 [ %indvars.iv.next371, %for.body216 ], [ %indvars.iv370.ph, %for.body216.preheader387 ]
%ans.0356 = phi i32 [ %ans.3, %for.body216 ], [ %ans.0356.ph, %for.body216.preheader387 ]
%arrayidx218 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %indvars.iv370
%64 = load i32, ptr %arrayidx218, align 4, !tbaa !5
%65 = sub nsw i64 %indvars.iv370, %33
%arrayidx220 = getelementptr inbounds [200005 x i32], ptr %r, i64 0, i64 %65
%66 = load i32, ptr %arrayidx220, align 4, !tbaa !5
%sub221 = sub nsw i32 %64, %66
%spec.select = call i32 @llvm.smin.i32(i32 %ans.0356, i32 %sub221)
%arrayidx233 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %indvars.iv370
%67 = load i32, ptr %arrayidx233, align 4, !tbaa !5
%arrayidx236 = getelementptr inbounds [200005 x i32], ptr %g, i64 0, i64 %65
%68 = load i32, ptr %arrayidx236, align 4, !tbaa !5
%sub237 = sub nsw i32 %67, %68
%ans.2 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %sub237)
%arrayidx249 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv370
%69 = load i32, ptr %arrayidx249, align 4, !tbaa !5
%arrayidx252 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %65
%70 = load i32, ptr %arrayidx252, align 4, !tbaa !5
%sub253 = sub nsw i32 %69, %70
%ans.3 = call i32 @llvm.smin.i32(i32 %ans.2, i32 %sub253)
%indvars.iv.next371 = add nsw i64 %indvars.iv370, 1
%lftr.wideiv = trunc i64 %indvars.iv.next371 to i32
%exitcond374.not = icmp eq i32 %34, %lftr.wideiv
br i1 %exitcond374.not, label %for.end266, label %for.body216, !llvm.loop !15
for.end266: ; preds = %for.body216, %middle.block, %for.end
%ans.0.lcssa = phi i32 [ %1, %for.end ], [ %63, %middle.block ], [ %ans.3, %for.body216 ]
%call267 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %ans.0.lcssa)
%inc269 = add nuw nsw i32 %i.0359, 1
%71 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp slt i32 %inc269, %71
br i1 %cmp, label %for.body, label %for.end270, !llvm.loop !16
for.end270: ; preds = %for.end266, %entry
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !11, !14, !13}
!16 = distinct !{!16, !11}
|
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#define MAX 1000000
bool pr[MAX+1];
void sieve()
{
int i,j;
for(i=2;i<=1000;i++)
{
if(pr[i]==0)
{
for(j=i*i;j<=MAX;j+=i)
{
pr[j]=1;
}
}
}
}
int main()
{
int n,i;
sieve();
scanf("%d",&n);
for(i=4;i<=n/2;++i)
{
if(pr[i]==1 && pr[n-i]==1)
{
printf("%d %d",i,n-i);
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15255/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15255/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@pr = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @sieve() local_unnamed_addr #0 {
entry:
br label %for.body
for.body: ; preds = %entry, %for.inc9
%indvars.iv29 = phi i64 [ 5, %entry ], [ %indvars.iv.next30, %for.inc9 ]
%indvars.iv24 = phi i64 [ 2, %entry ], [ %indvars.iv.next25, %for.inc9 ]
%indvars.iv22 = phi i32 [ 4, %entry ], [ %indvars.iv.next23, %for.inc9 ]
%arrayidx = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %indvars.iv24
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5, !range !9, !noundef !10
%cmp1 = icmp eq i8 %0, 0
%1 = mul nuw nsw i64 %indvars.iv24, %indvars.iv24
%cmp418 = icmp ult i64 %1, 1000001
%or.cond = select i1 %cmp1, i1 %cmp418, i1 false
br i1 %or.cond, label %for.body6.preheader, label %for.inc9
for.body6.preheader: ; preds = %for.body
%2 = zext i32 %indvars.iv22 to i64
br label %for.body6
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv26 = phi i64 [ %2, %for.body6.preheader ], [ %indvars.iv.next27, %for.body6 ]
%arrayidx8 = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %indvars.iv26
store i8 1, ptr %arrayidx8, align 1, !tbaa !5
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, %indvars.iv24
%cmp4 = icmp ult i64 %indvars.iv.next27, 1000001
br i1 %cmp4, label %for.body6, label %for.inc9, !llvm.loop !11
for.inc9: ; preds = %for.body6, %for.body
%indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 2
%3 = trunc i64 %indvars.iv29 to i32
%indvars.iv.next23 = add i32 %indvars.iv22, %3
%exitcond.not = icmp eq i64 %indvars.iv.next25, 1001
br i1 %exitcond.not, label %for.end10, label %for.body, !llvm.loop !13
for.end10: ; preds = %for.inc9
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
br label %for.body.i
for.body.i: ; preds = %for.inc9.i, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc9.i ], [ 5, %entry ]
%indvars.iv24.i = phi i64 [ %indvars.iv.next25.i, %for.inc9.i ], [ 2, %entry ]
%indvars.iv22.i = phi i32 [ %indvars.iv.next23.i, %for.inc9.i ], [ 4, %entry ]
%arrayidx.i = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %indvars.iv24.i
%0 = load i8, ptr %arrayidx.i, align 1, !tbaa !5, !range !9, !noundef !10
%cmp1.i = icmp eq i8 %0, 0
%1 = mul nuw nsw i64 %indvars.iv24.i, %indvars.iv24.i
%cmp418.i = icmp ult i64 %1, 1000001
%or.cond.i = select i1 %cmp1.i, i1 %cmp418.i, i1 false
br i1 %or.cond.i, label %for.body6.preheader.i, label %for.inc9.i
for.body6.preheader.i: ; preds = %for.body.i
%2 = zext i32 %indvars.iv22.i to i64
br label %for.body6.i
for.body6.i: ; preds = %for.body6.i, %for.body6.preheader.i
%indvars.iv26.i = phi i64 [ %2, %for.body6.preheader.i ], [ %indvars.iv.next27.i, %for.body6.i ]
%arrayidx8.i = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %indvars.iv26.i
store i8 1, ptr %arrayidx8.i, align 1, !tbaa !5
%indvars.iv.next27.i = add nuw nsw i64 %indvars.iv26.i, %indvars.iv24.i
%cmp4.i = icmp ult i64 %indvars.iv.next27.i, 1000001
br i1 %cmp4.i, label %for.body6.i, label %for.inc9.i, !llvm.loop !11
for.inc9.i: ; preds = %for.body6.i, %for.body.i
%indvars.iv.next25.i = add nuw nsw i64 %indvars.iv24.i, 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
%3 = trunc i64 %indvars.iv to i32
%indvars.iv.next23.i = add i32 %indvars.iv22.i, %3
%exitcond.not.i = icmp eq i64 %indvars.iv.next25.i, 1001
br i1 %exitcond.not.i, label %sieve.exit, label %for.body.i, !llvm.loop !13
sieve.exit: ; preds = %for.inc9.i
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !14
%cmp.not17 = icmp slt i32 %4, 8
br i1 %cmp.not17, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %sieve.exit
%div2527 = lshr i32 %4, 1
%5 = zext i32 %4 to i64
%6 = add nuw nsw i32 %div2527, 1
%wide.trip.count = zext i32 %6 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv21 = phi i64 [ 4, %for.body.preheader ], [ %indvars.iv.next22, %for.inc ]
%arrayidx = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %indvars.iv21
%7 = load i8, ptr %arrayidx, align 1, !tbaa !5, !range !9, !noundef !10
%tobool.not = icmp eq i8 %7, 0
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%8 = sub nsw i64 %5, %indvars.iv21
%arrayidx4 = getelementptr inbounds [1000001 x i8], ptr @pr, i64 0, i64 %8
%9 = load i8, ptr %arrayidx4, align 1, !tbaa !5, !range !9, !noundef !10
%tobool5.not = icmp eq i8 %9, 0
br i1 %tobool5.not, label %for.inc, label %if.then
if.then: ; preds = %land.lhs.true
%10 = trunc i64 %indvars.iv21 to i32
%11 = trunc i64 %8 to i32
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10, i32 noundef %11)
br label %for.end
for.inc: ; preds = %for.body, %land.lhs.true
%indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1
%exitcond.not = icmp eq i64 %indvars.iv.next22, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.inc, %sieve.exit, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !12}
|
#include <stdio.h>
#define SIZE 3
int count, n, x;
void solve(int k, int last, int sum)
{
if(k < SIZE)
{
int i;
for(i=last+1; i<=n; i++)
if(sum+i <= x)
solve(k+1, i, sum+i);
}
else if(sum == x) count++;
}
int main(void)
{
while(scanf("%d %d", &n, &x), n+x)
{
count = 0;
solve(0, 0, 0);
printf("%d\n", count);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local global i32 0, align 4
@x = dso_local global i32 0, align 4
@count = dso_local local_unnamed_addr global i32 0, align 4
@.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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @solve(i32 noundef %k, i32 noundef %last, i32 noundef %sum) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %k, 3
br i1 %cmp, label %for.cond.preheader, label %if.else
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp1.not.not20 = icmp sgt i32 %0, %last
br i1 %cmp1.not.not20, label %for.body.lr.ph, label %if.end11
for.body.lr.ph: ; preds = %for.cond.preheader
%add5 = add nsw i32 %k, 1
%.pre22 = load i32, ptr @x, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%1 = phi i32 [ %0, %for.body.lr.ph ], [ %3, %for.inc ]
%2 = phi i32 [ %.pre22, %for.body.lr.ph ], [ %4, %for.inc ]
%i.021.in = phi i32 [ %last, %for.body.lr.ph ], [ %i.021, %for.inc ]
%i.021 = add nsw i32 %i.021.in, 1
%add2 = add nsw i32 %i.021, %sum
%cmp3.not = icmp sgt i32 %add2, %2
br i1 %cmp3.not, label %for.inc, label %if.then4
if.then4: ; preds = %for.body
tail call void @solve(i32 noundef %add5, i32 noundef %i.021, i32 noundef %add2)
%.pre = load i32, ptr @x, align 4, !tbaa !5
%.pre23 = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then4
%3 = phi i32 [ %1, %for.body ], [ %.pre23, %if.then4 ]
%4 = phi i32 [ %2, %for.body ], [ %.pre, %if.then4 ]
%cmp1.not.not = icmp slt i32 %i.021, %3
br i1 %cmp1.not.not, label %for.body, label %if.end11, !llvm.loop !9
if.else: ; preds = %entry
%5 = load i32, ptr @x, align 4, !tbaa !5
%cmp7 = icmp eq i32 %5, %sum
br i1 %cmp7, label %if.then8, label %if.end11
if.then8: ; preds = %if.else
%6 = load i32, ptr @count, align 4, !tbaa !5
%inc9 = add nsw i32 %6, 1
store i32 %inc9, ptr @count, align 4, !tbaa !5
br label %if.end11
if.end11: ; preds = %for.inc, %for.cond.preheader, %if.else, %if.then8
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @x)
%0 = load i32, ptr @n, align 4, !tbaa !5
%1 = load i32, ptr @x, align 4, !tbaa !5
%add3 = sub i32 0, %1
%tobool.not4 = icmp eq i32 %0, %add3
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
store i32 0, ptr @count, align 4, !tbaa !5
tail call void @solve(i32 noundef 0, i32 noundef 0, i32 noundef 0)
%2 = load i32, ptr @count, align 4, !tbaa !5
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @x)
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = load i32, ptr @x, align 4, !tbaa !5
%add = sub i32 0, %4
%tobool.not = icmp eq i32 %3, %add
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int i, j, k;
int n, x;
int cnt;
while (1){
scanf("%d %d", &n, &x);
if(n + x == 0){
break;
}
cnt = 0;
for (i = 1; i <= n; i++){
for (j = i + 1; j <= n; j++){
for (k = j + 1; k <= n; k++){
if(x == i + j + k){
cnt++;
}
}
}
}
printf("%d\n", cnt);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%add44 = sub i32 0, %1
%cmp45 = icmp eq i32 %0, %add44
br i1 %cmp45, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end21
%2 = phi i32 [ %19, %for.end21 ], [ %1, %entry ]
%3 = phi i32 [ %18, %for.end21 ], [ %0, %entry ]
%cmp1.not39 = icmp slt i32 %3, 1
br i1 %cmp1.not39, label %for.end21, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%4 = add i32 %3, -2
%broadcast.splatinsert51 = insertelement <4 x i32> poison, i32 %2, i64 0
%broadcast.splat52 = shufflevector <4 x i32> %broadcast.splatinsert51, <4 x i32> poison, <4 x i32> zeroinitializer
br label %for.body
for.cond.loopexit: ; preds = %for.cond3.loopexit, %for.body
%cnt.1.lcssa = phi i32 [ %cnt.041, %for.body ], [ %cnt.2.lcssa, %for.cond3.loopexit ]
%exitcond46.not = icmp eq i32 %i.040, %3
%indvar.next = add i32 %indvar, 1
br i1 %exitcond46.not, label %for.end21, label %for.body, !llvm.loop !9
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ]
%cnt.041 = phi i32 [ 0, %for.body.preheader ], [ %cnt.1.lcssa, %for.cond.loopexit ]
%i.040 = phi i32 [ 1, %for.body.preheader ], [ %add2, %for.cond.loopexit ]
%add2 = add nuw i32 %i.040, 1
%cmp4.not35.not = icmp slt i32 %i.040, %3
br i1 %cmp4.not35.not, label %for.body5, label %for.cond.loopexit
for.cond3.loopexit: ; preds = %for.body9, %middle.block, %for.body5
%cnt.2.lcssa = phi i32 [ %cnt.137, %for.body5 ], [ %17, %middle.block ], [ %spec.select, %for.body9 ]
%exitcond.not = icmp eq i32 %j.036, %3
%indvar.next48 = add i32 %indvar47, 1
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body, %for.cond3.loopexit
%indvar47 = phi i32 [ %indvar.next48, %for.cond3.loopexit ], [ 0, %for.body ]
%cnt.137 = phi i32 [ %cnt.2.lcssa, %for.cond3.loopexit ], [ %cnt.041, %for.body ]
%j.036 = phi i32 [ %add6, %for.cond3.loopexit ], [ %add2, %for.body ]
%5 = add i32 %indvar, %indvar47
%6 = sub i32 %4, %5
%add6 = add i32 %j.036, 1
%cmp8.not32.not = icmp slt i32 %j.036, %3
br i1 %cmp8.not32.not, label %for.body9.lr.ph, label %for.cond3.loopexit
for.body9.lr.ph: ; preds = %for.body5
%add10 = add nuw nsw i32 %j.036, %i.040
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body9.preheader, label %vector.ph
vector.ph: ; preds = %for.body9.lr.ph
%n.vec = and i32 %6, -8
%ind.end = add i32 %add6, %n.vec
%7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.137, i64 0
%.splatinsert = insertelement <4 x i32> poison, i32 %add6, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add10, 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> [ %7, %vector.ph ], [ %14, %vector.body ]
%vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%8 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind
%9 = add nuw nsw <4 x i32> %broadcast.splat, %step.add
%10 = icmp eq <4 x i32> %broadcast.splat52, %8
%11 = icmp eq <4 x i32> %broadcast.splat52, %9
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi49, %13
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%16 = icmp eq i32 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %6, %n.vec
br i1 %cmp.n, label %for.cond3.loopexit, label %for.body9.preheader
for.body9.preheader: ; preds = %for.body9.lr.ph, %middle.block
%cnt.234.ph = phi i32 [ %cnt.137, %for.body9.lr.ph ], [ %17, %middle.block ]
%k.033.ph = phi i32 [ %add6, %for.body9.lr.ph ], [ %ind.end, %middle.block ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.body9
%cnt.234 = phi i32 [ %spec.select, %for.body9 ], [ %cnt.234.ph, %for.body9.preheader ]
%k.033 = phi i32 [ %inc15, %for.body9 ], [ %k.033.ph, %for.body9.preheader ]
%add11 = add nuw nsw i32 %add10, %k.033
%cmp12 = icmp eq i32 %2, %add11
%inc = zext i1 %cmp12 to i32
%spec.select = add nsw i32 %cnt.234, %inc
%inc15 = add nuw nsw i32 %k.033, 1
%cmp8.not.not = icmp slt i32 %k.033, %3
br i1 %cmp8.not.not, label %for.body9, label %for.cond3.loopexit, !llvm.loop !15
for.end21: ; preds = %for.cond.loopexit, %for.cond.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %cnt.1.lcssa, %for.cond.loopexit ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = load i32, ptr %x, align 4, !tbaa !5
%add = sub i32 0, %19
%cmp = icmp eq i32 %18, %add
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end21, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
|
#include <stdio.h>
#include <string.h>
#define N 100005
#define nmax 55
void ac_fun(int n);
struct name
{
char f[nmax];
char s[nmax];
} a[N], b[N];
int p[N];
int main()
{
int n;
int i;
//freopen("input.txt", "r", stdin);
while ( scanf("%d", &n) != EOF )
{
for ( i = 1; i <= n; i++ )
{
scanf("%s %s", a[i].f, a[i].s);
}
for ( i = 1; i <= n; i++ )
{
scanf("%d", &p[i]);
}
ac_fun(n);
}
return 0;
}
void ac_fun(int n)
{
int i;
int flag = 0;
char tmp[nmax];
for ( i = 1; i <= n; i++ )
{
if ( strcmp(a[p[i]].f, a[p[i]].s) <= 0 )
{
strcpy(b[i].f, a[p[i]].f);
strcpy(b[i].s, a[p[i]].s);
}
else
{
strcpy(b[i].f, a[p[i]].s);
strcpy(b[i].s, a[p[i]].f);
}
if ( strcmp( b[i].f, b[i-1].f ) <= 0 )
{
if ( strcmp( b[i].s, b[i-1].f ) >= 0 )
{
strcpy(tmp, b[i].f);
strcpy(b[i].f, b[i].s);
strcpy(b[i].s, tmp);
}
else
{
flag = 1;
break;
}
}
}
/*
for ( i = 1; i < n; i++ )
{
if ( strcmp( b[i].f, b[i+1].f ) > 0 )
{
flag = 1; break;
}
}
*/
if ( flag )
{
printf("NO\n");
}
else
{
printf("YES\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15268/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15268/source.c"
target datalayout = "e-m:e-p270: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.name = type { [55 x i8], [55 x i8] }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@a = dso_local global [100005 x %struct.name] zeroinitializer, align 16
@p = dso_local global [100005 x i32] zeroinitializer, align 16
@b = dso_local global [100005 x %struct.name] zeroinitializer, align 16
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not26 = icmp eq i32 %call25, -1
br i1 %cmp.not26, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.not21 = icmp slt i32 %0, 1
br i1 %cmp1.not21, label %for.end14, label %for.body
for.cond6.preheader: ; preds = %for.body
%cmp7.not23 = icmp slt i32 %1, 1
br i1 %cmp7.not23, label %for.end14, label %for.body8
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100005 x %struct.name], ptr @a, i64 0, i64 %indvars.iv
%s = getelementptr inbounds [100005 x %struct.name], ptr @a, i64 0, i64 %indvars.iv, i32 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %s)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp1.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp1.not.not, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.body8: ; preds = %for.cond6.preheader, %for.body8
%indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body8 ], [ 1, %for.cond6.preheader ]
%arrayidx10 = getelementptr inbounds [100005 x i32], ptr @p, i64 0, i64 %indvars.iv29
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10)
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp7.not.not = icmp slt i64 %indvars.iv29, %4
br i1 %cmp7.not.not, label %for.body8, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.body8, %for.cond.preheader, %for.cond6.preheader
%.lcssa = phi i32 [ %1, %for.cond6.preheader ], [ %0, %for.cond.preheader ], [ %3, %for.body8 ]
call void @ac_fun(i32 noundef %.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @ac_fun(i32 noundef %n) local_unnamed_addr #0 {
entry:
%tmp = alloca [55 x i8], align 16
call void @llvm.lifetime.start.p0(i64 55, ptr nonnull %tmp) #6
%cmp.not125 = icmp slt i32 %n, 1
br i1 %cmp.not125, label %if.end104, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr @p, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %1 to i64
%arrayidx2 = getelementptr inbounds [100005 x %struct.name], ptr @a, i64 0, i64 %idxprom1
%s = getelementptr inbounds [100005 x %struct.name], ptr @a, i64 0, i64 %idxprom1, i32 1
%call = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx2, ptr noundef nonnull dereferenceable(1) %s) #7
%cmp8 = icmp slt i32 %call, 1
%arrayidx10 = getelementptr inbounds [100005 x %struct.name], ptr @b, i64 0, i64 %indvars.iv
%s22 = getelementptr inbounds [100005 x %struct.name], ptr @b, i64 0, i64 %indvars.iv, i32 1
%arrayidx2.s = select i1 %cmp8, ptr %arrayidx2, ptr %s
%s.arrayidx2 = select i1 %cmp8, ptr %s, ptr %arrayidx2
%call41 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx10, ptr noundef nonnull dereferenceable(1) %arrayidx2.s) #6
%call52 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %s22, ptr noundef nonnull dereferenceable(1) %s.arrayidx2) #6
%arrayidx54 = getelementptr inbounds [100005 x %struct.name], ptr @b, i64 0, i64 %indvars.iv
%2 = add nsw i64 %indvars.iv, -1
%arrayidx58 = getelementptr inbounds [100005 x %struct.name], ptr @b, i64 0, i64 %2
%call61 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx54, ptr noundef nonnull dereferenceable(1) %arrayidx58) #7
%cmp62 = icmp slt i32 %call61, 1
br i1 %cmp62, label %if.then63, label %for.inc
if.then63: ; preds = %for.body
%s66 = getelementptr inbounds [100005 x %struct.name], ptr @b, i64 0, i64 %indvars.iv, i32 1
%call73 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s66, ptr noundef nonnull dereferenceable(1) %arrayidx58) #7
%cmp74 = icmp sgt i32 %call73, -1
br i1 %cmp74, label %if.then75, label %if.end104
if.then75: ; preds = %if.then63
%call81 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %tmp, ptr noundef nonnull dereferenceable(1) %arrayidx54) #6
%call90 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx54, ptr noundef nonnull dereferenceable(1) %s66) #6
%call96 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %s66, ptr noundef nonnull dereferenceable(1) %tmp) #6
br label %for.inc
for.inc: ; preds = %for.body, %if.then75
%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.end104, label %for.body, !llvm.loop !13
if.end104: ; preds = %for.inc, %if.then63, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str.4, %if.then63 ], [ @str, %for.inc ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 55, ptr nonnull %tmp) #6
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: 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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <limits.h>
int main(void){
int n,t,max=0,min=INT_MAX,ans=0;
scanf("%d%d",&n,&t);
int a[n];
for (int i=0; i<n; i++){
scanf("%d",&a[i]);
}
for (int i=0; i<n; i++){
if (min>a[i]){
min=a[i];
}
if(max<a[i]-min){
max=a[i]-min;
}
}
min=INT_MAX;
for (int i=0; i<n; i++){
if (min>a[i]){
min=a[i];
}
if(max==a[i]-min){
ans++;
}
}
printf("%d\n",ans);
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152722/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152722/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %3, 0
br i1 %cmp65, label %for.body, label %for.cond.cleanup26
for.cond3.preheader: ; preds = %for.body
%cmp467 = icmp sgt i32 %6, 0
br i1 %cmp467, label %for.body6.preheader, label %for.cond.cleanup26
for.body6.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %6 to i64
%4 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %for.cond24.preheader.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond24.preheader.unr-lcssa: ; preds = %for.body6, %for.body6.preheader
%max.1.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %max.1.1, %for.body6 ]
%indvars.iv79.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next80.1, %for.body6 ]
%max.069.unr = phi i32 [ 0, %for.body6.preheader ], [ %max.1.1, %for.body6 ]
%min.068.unr = phi i32 [ 2147483647, %for.body6.preheader ], [ %spec.select.1, %for.body6 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond24.preheader, label %for.body6.epil
for.body6.epil: ; preds = %for.cond24.preheader.unr-lcssa
%arrayidx8.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv79.unr
%8 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%spec.select.epil = call i32 @llvm.smin.i32(i32 %min.068.unr, i32 %8)
%sub.epil = sub nsw i32 %8, %spec.select.epil
%max.1.epil = call i32 @llvm.smax.i32(i32 %max.069.unr, i32 %sub.epil)
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.unr-lcssa, %for.body6.epil
%max.1.lcssa = phi i32 [ %max.1.lcssa.ph, %for.cond24.preheader.unr-lcssa ], [ %max.1.epil, %for.body6.epil ]
br i1 %cmp467, label %for.body27.preheader, label %for.cond.cleanup26
for.body27.preheader: ; preds = %for.cond24.preheader
%xtraiter95 = and i64 %wide.trip.count, 1
%9 = icmp eq i64 %4, 0
br i1 %9, label %for.cond.cleanup26.loopexit.unr-lcssa, label %for.body27.preheader.new
for.body27.preheader.new: ; preds = %for.body27.preheader
%unroll_iter98 = and i64 %wide.trip.count, 4294967294
br label %for.body27
for.body6: ; preds = %for.body6, %for.body6.preheader.new
%indvars.iv79 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next80.1, %for.body6 ]
%max.069 = phi i32 [ 0, %for.body6.preheader.new ], [ %max.1.1, %for.body6 ]
%min.068 = phi i32 [ 2147483647, %for.body6.preheader.new ], [ %spec.select.1, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.body6 ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv79
%10 = load i32, ptr %arrayidx8, align 8, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.068, i32 %10)
%sub = sub nsw i32 %10, %spec.select
%max.1 = call i32 @llvm.smax.i32(i32 %max.069, i32 %sub)
%indvars.iv.next80 = or i64 %indvars.iv79, 1
%arrayidx8.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next80
%11 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%spec.select.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %11)
%sub.1 = sub nsw i32 %11, %spec.select.1
%max.1.1 = call i32 @llvm.smax.i32(i32 %max.1, i32 %sub.1)
%indvars.iv.next80.1 = add nuw nsw i64 %indvars.iv79, 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.cond24.preheader.unr-lcssa, label %for.body6, !llvm.loop !11
for.cond.cleanup26.loopexit.unr-lcssa: ; preds = %for.body27, %for.body27.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body27.preheader ], [ %ans.1.1, %for.body27 ]
%indvars.iv82.unr = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next83.1, %for.body27 ]
%ans.074.unr = phi i32 [ 0, %for.body27.preheader ], [ %ans.1.1, %for.body27 ]
%min.273.unr = phi i32 [ 2147483647, %for.body27.preheader ], [ %spec.select64.1, %for.body27 ]
%lcmp.mod96.not = icmp eq i64 %xtraiter95, 0
br i1 %lcmp.mod96.not, label %for.cond.cleanup26, label %for.body27.epil
for.body27.epil: ; preds = %for.cond.cleanup26.loopexit.unr-lcssa
%arrayidx29.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv82.unr
%12 = load i32, ptr %arrayidx29.epil, align 4, !tbaa !5
%spec.select64.epil = call i32 @llvm.smin.i32(i32 %min.273.unr, i32 %12)
%sub37.epil = sub nsw i32 %12, %spec.select64.epil
%cmp38.epil = icmp eq i32 %max.1.lcssa, %sub37.epil
%inc40.epil = zext i1 %cmp38.epil to i32
%ans.1.epil = add nuw nsw i32 %ans.074.unr, %inc40.epil
br label %for.cond.cleanup26
for.cond.cleanup26: ; preds = %for.body27.epil, %for.cond.cleanup26.loopexit.unr-lcssa, %entry, %for.cond3.preheader, %for.cond24.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond24.preheader ], [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup26.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body27.epil ]
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body27: ; preds = %for.body27, %for.body27.preheader.new
%indvars.iv82 = phi i64 [ 0, %for.body27.preheader.new ], [ %indvars.iv.next83.1, %for.body27 ]
%ans.074 = phi i32 [ 0, %for.body27.preheader.new ], [ %ans.1.1, %for.body27 ]
%min.273 = phi i32 [ 2147483647, %for.body27.preheader.new ], [ %spec.select64.1, %for.body27 ]
%niter99 = phi i64 [ 0, %for.body27.preheader.new ], [ %niter99.next.1, %for.body27 ]
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv82
%13 = load i32, ptr %arrayidx29, align 8, !tbaa !5
%spec.select64 = call i32 @llvm.smin.i32(i32 %min.273, i32 %13)
%sub37 = sub nsw i32 %13, %spec.select64
%cmp38 = icmp eq i32 %max.1.lcssa, %sub37
%inc40 = zext i1 %cmp38 to i32
%ans.1 = add nuw nsw i32 %ans.074, %inc40
%indvars.iv.next83 = or i64 %indvars.iv82, 1
%arrayidx29.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next83
%14 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
%spec.select64.1 = call i32 @llvm.smin.i32(i32 %spec.select64, i32 %14)
%sub37.1 = sub nsw i32 %14, %spec.select64.1
%cmp38.1 = icmp eq i32 %max.1.lcssa, %sub37.1
%inc40.1 = zext i1 %cmp38.1 to i32
%ans.1.1 = add nuw nsw i32 %ans.1, %inc40.1
%indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
%niter99.next.1 = add i64 %niter99, 2
%niter99.ncmp.1 = icmp eq i64 %niter99.next.1, %unroll_iter98
br i1 %niter99.ncmp.1, label %for.cond.cleanup26.loopexit.unr-lcssa, label %for.body27, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef char SINT8;
typedef unsigned char UINT8;
typedef short SINT16;
typedef unsigned short UINT16;
typedef int SINT32;
typedef unsigned int UINT32;
typedef long long SINT64;
typedef unsigned long long UINT64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
SINT32 main() {
SINT32 max = 100;
SINT32 n;
scanf("%d",&n);
SINT32 sosu[25] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
SINT32 sosukazu[25] = {0};
for (SINT32 i = 1; i < n+1; i++) {
SINT32 buf = i;
for (SINT32 j = 0; j < 25; j++) {
if (buf == 1) {
break;
}
while (buf%sosu[j] == 0) {
buf = buf/sosu[j];
sosukazu[j] = sosukazu[j] + 1;
}
}
}
SINT32 count2 = 0;
SINT32 count4 = 0;
SINT32 count14 = 0;
SINT32 count24 = 0;
SINT32 count74 = 0;
for (SINT32 j = 0; j < 25; j++) {
if (sosukazu[j] >= 2) {
count2++;
}
if (sosukazu[j] >= 4) {
count4++;
}
if (sosukazu[j] >= 14) {
count14++;
}
if (sosukazu[j] >= 24) {
count24++;
}
if (sosukazu[j] >= 74) {
count74++;
}
}
/* for (SINT32 j = 0; j < 25; j++) {
printf("%d ",sosukazu[j]);
}
printf("\n");
printf("%d %d %d %d %d\n",count2,count4,count14,count24,count74);
*/
if (count4 == 0) {
printf("0");
} else {
SINT32 ans = count74+count24*(count2-1) + count14*(count4-1) + count4*(count4-1)*(count2-2)/2;
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152766/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152766/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@__const.main.sosu = private unnamed_addr constant [25 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 37, i32 41, i32 43, i32 47, i32 53, i32 59, i32 61, i32 67, i32 71, i32 73, i32 79, i32 83, i32 89, i32 97], 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:
%n = alloca i32, align 4
%sosukazu = alloca [25 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %sosukazu) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %sosukazu, i8 0, i64 100, i1 false)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not112 = icmp slt i32 %0, 1
br i1 %cmp.not112, label %for.body22, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %cleanup
%i.0113 = phi i32 [ %inc15, %cleanup ], [ 1, %entry ]
%cmp5109 = icmp eq i32 %i.0113, 1
br i1 %cmp5109, label %cleanup, label %while.cond.preheader
while.cond.preheader: ; preds = %for.cond1.preheader, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond1.preheader ]
%buf.0110 = phi i32 [ %buf.1.lcssa, %for.inc ], [ %i.0113, %for.cond1.preheader ]
%arrayidx = getelementptr inbounds [25 x i32], ptr @__const.main.sosu, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%rem105 = srem i32 %buf.0110, %1
%cmp6106 = icmp eq i32 %rem105, 0
br i1 %cmp6106, label %while.body.lr.ph, label %for.inc
while.body.lr.ph: ; preds = %while.cond.preheader
%arrayidx10 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 %indvars.iv
%arrayidx10.promoted = load i32, ptr %arrayidx10, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%add11108 = phi i32 [ %arrayidx10.promoted, %while.body.lr.ph ], [ %add11, %while.body ]
%buf.1107 = phi i32 [ %buf.0110, %while.body.lr.ph ], [ %div, %while.body ]
%div = sdiv i32 %buf.1107, %1
%add11 = add nsw i32 %add11108, 1
%rem = srem i32 %div, %1
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %while.body, label %while.cond.for.inc_crit_edge, !llvm.loop !9
while.cond.for.inc_crit_edge: ; preds = %while.body
store i32 %add11, ptr %arrayidx10, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %while.cond.for.inc_crit_edge, %while.cond.preheader
%buf.1.lcssa = phi i32 [ %div, %while.cond.for.inc_crit_edge ], [ %buf.0110, %while.cond.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp2 = icmp ugt i64 %indvars.iv, 23
%cmp5 = icmp eq i32 %buf.1.lcssa, 1
%or.cond = or i1 %cmp5, %cmp2
br i1 %or.cond, label %cleanup, label %while.cond.preheader, !llvm.loop !11
cleanup: ; preds = %for.inc, %for.cond1.preheader
%inc15 = add nuw i32 %i.0113, 1
%exitcond.not = icmp eq i32 %i.0113, %0
br i1 %exitcond.not, label %for.body22, label %for.cond1.preheader, !llvm.loop !12
for.body22: ; preds = %entry, %cleanup
%wide.load = load <4 x i32>, ptr %sosukazu, align 16, !tbaa !5
%2 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 4
%wide.load.1 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 8
%wide.load.2 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 12
%wide.load.3 = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 16
%wide.load.4 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 20
%wide.load.5 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = icmp sgt <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3>
%8 = zext <4 x i1> %7 to <4 x i32>
%9 = icmp sgt <4 x i32> %wide.load.1, <i32 3, i32 3, i32 3, i32 3>
%10 = zext <4 x i1> %9 to <4 x i32>
%11 = add nuw nsw <4 x i32> %8, %10
%12 = icmp sgt <4 x i32> %wide.load.2, <i32 3, i32 3, i32 3, i32 3>
%13 = zext <4 x i1> %12 to <4 x i32>
%14 = add nuw nsw <4 x i32> %11, %13
%15 = icmp sgt <4 x i32> %wide.load.3, <i32 3, i32 3, i32 3, i32 3>
%16 = zext <4 x i1> %15 to <4 x i32>
%17 = add nuw nsw <4 x i32> %14, %16
%18 = icmp sgt <4 x i32> %wide.load.4, <i32 3, i32 3, i32 3, i32 3>
%19 = zext <4 x i1> %18 to <4 x i32>
%20 = add nuw nsw <4 x i32> %17, %19
%21 = icmp sgt <4 x i32> %wide.load.5, <i32 3, i32 3, i32 3, i32 3>
%22 = zext <4 x i1> %21 to <4 x i32>
%23 = add nuw nsw <4 x i32> %20, %22
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %23)
%arrayidx24 = getelementptr inbounds [25 x i32], ptr %sosukazu, i64 0, i64 24
%25 = load i32, ptr %arrayidx24, align 16, !tbaa !5
%cmp31 = icmp sgt i32 %25, 3
%inc33 = zext i1 %cmp31 to i32
%count4.1 = add nuw nsw i32 %24, %inc33
%cmp57 = icmp eq i32 %count4.1, 0
br i1 %cmp57, label %if.then58, label %if.else
if.then58: ; preds = %for.body22
%putchar = call i32 @putchar(i32 48)
br label %if.end71
if.else: ; preds = %for.body22
%26 = icmp sgt <4 x i32> %wide.load, <i32 73, i32 73, i32 73, i32 73>
%27 = zext <4 x i1> %26 to <4 x i32>
%28 = icmp sgt <4 x i32> %wide.load.1, <i32 73, i32 73, i32 73, i32 73>
%29 = zext <4 x i1> %28 to <4 x i32>
%30 = add nuw nsw <4 x i32> %27, %29
%31 = icmp sgt <4 x i32> %wide.load.2, <i32 73, i32 73, i32 73, i32 73>
%32 = zext <4 x i1> %31 to <4 x i32>
%33 = add nuw nsw <4 x i32> %30, %32
%34 = icmp sgt <4 x i32> %wide.load.3, <i32 73, i32 73, i32 73, i32 73>
%35 = zext <4 x i1> %34 to <4 x i32>
%36 = add nuw nsw <4 x i32> %33, %35
%37 = icmp sgt <4 x i32> %wide.load.4, <i32 73, i32 73, i32 73, i32 73>
%38 = zext <4 x i1> %37 to <4 x i32>
%39 = add nuw nsw <4 x i32> %36, %38
%40 = icmp sgt <4 x i32> %wide.load.5, <i32 73, i32 73, i32 73, i32 73>
%41 = zext <4 x i1> %40 to <4 x i32>
%42 = add nuw nsw <4 x i32> %39, %41
%43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %42)
%cmp49 = icmp sgt i32 %25, 73
%inc51 = zext i1 %cmp49 to i32
%count74.1 = add nuw nsw i32 %43, %inc51
%44 = icmp sgt <4 x i32> %wide.load, <i32 23, i32 23, i32 23, i32 23>
%45 = zext <4 x i1> %44 to <4 x i32>
%46 = icmp sgt <4 x i32> %wide.load.1, <i32 23, i32 23, i32 23, i32 23>
%47 = zext <4 x i1> %46 to <4 x i32>
%48 = add nuw nsw <4 x i32> %45, %47
%49 = icmp sgt <4 x i32> %wide.load.2, <i32 23, i32 23, i32 23, i32 23>
%50 = zext <4 x i1> %49 to <4 x i32>
%51 = add nuw nsw <4 x i32> %48, %50
%52 = icmp sgt <4 x i32> %wide.load.3, <i32 23, i32 23, i32 23, i32 23>
%53 = zext <4 x i1> %52 to <4 x i32>
%54 = add nuw nsw <4 x i32> %51, %53
%55 = icmp sgt <4 x i32> %wide.load.4, <i32 23, i32 23, i32 23, i32 23>
%56 = zext <4 x i1> %55 to <4 x i32>
%57 = add nuw nsw <4 x i32> %54, %56
%58 = icmp sgt <4 x i32> %wide.load.5, <i32 23, i32 23, i32 23, i32 23>
%59 = zext <4 x i1> %58 to <4 x i32>
%60 = add nuw nsw <4 x i32> %57, %59
%61 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %60)
%cmp43 = icmp sgt i32 %25, 23
%inc45 = zext i1 %cmp43 to i32
%count24.1 = add nuw nsw i32 %61, %inc45
%62 = icmp sgt <4 x i32> %wide.load, <i32 13, i32 13, i32 13, i32 13>
%63 = zext <4 x i1> %62 to <4 x i32>
%64 = icmp sgt <4 x i32> %wide.load.1, <i32 13, i32 13, i32 13, i32 13>
%65 = zext <4 x i1> %64 to <4 x i32>
%66 = add nuw nsw <4 x i32> %63, %65
%67 = icmp sgt <4 x i32> %wide.load.2, <i32 13, i32 13, i32 13, i32 13>
%68 = zext <4 x i1> %67 to <4 x i32>
%69 = add nuw nsw <4 x i32> %66, %68
%70 = icmp sgt <4 x i32> %wide.load.3, <i32 13, i32 13, i32 13, i32 13>
%71 = zext <4 x i1> %70 to <4 x i32>
%72 = add nuw nsw <4 x i32> %69, %71
%73 = icmp sgt <4 x i32> %wide.load.4, <i32 13, i32 13, i32 13, i32 13>
%74 = zext <4 x i1> %73 to <4 x i32>
%75 = add nuw nsw <4 x i32> %72, %74
%76 = icmp sgt <4 x i32> %wide.load.5, <i32 13, i32 13, i32 13, i32 13>
%77 = zext <4 x i1> %76 to <4 x i32>
%78 = add nuw nsw <4 x i32> %75, %77
%79 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %78)
%cmp37 = icmp sgt i32 %25, 13
%inc39 = zext i1 %cmp37 to i32
%count14.1 = add nuw nsw i32 %79, %inc39
%80 = icmp sgt <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%81 = zext <4 x i1> %80 to <4 x i32>
%82 = icmp sgt <4 x i32> %wide.load.1, <i32 1, i32 1, i32 1, i32 1>
%83 = zext <4 x i1> %82 to <4 x i32>
%84 = add nuw nsw <4 x i32> %81, %83
%85 = icmp sgt <4 x i32> %wide.load.2, <i32 1, i32 1, i32 1, i32 1>
%86 = zext <4 x i1> %85 to <4 x i32>
%87 = add nuw nsw <4 x i32> %84, %86
%88 = icmp sgt <4 x i32> %wide.load.3, <i32 1, i32 1, i32 1, i32 1>
%89 = zext <4 x i1> %88 to <4 x i32>
%90 = add nuw nsw <4 x i32> %87, %89
%91 = icmp sgt <4 x i32> %wide.load.4, <i32 1, i32 1, i32 1, i32 1>
%92 = zext <4 x i1> %91 to <4 x i32>
%93 = add nuw nsw <4 x i32> %90, %92
%94 = icmp sgt <4 x i32> %wide.load.5, <i32 1, i32 1, i32 1, i32 1>
%95 = zext <4 x i1> %94 to <4 x i32>
%96 = add nuw nsw <4 x i32> %93, %95
%97 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %96)
%cmp25 = icmp sgt i32 %25, 1
%inc27 = zext i1 %cmp25 to i32
%spec.select = add nuw nsw i32 %97, %inc27
%sub = add nsw i32 %spec.select, -1
%mul = mul nsw i32 %count24.1, %sub
%sub61 = add nsw i32 %count4.1, -1
%mul62 = mul nsw i32 %count14.1, %sub61
%sub66 = add nsw i32 %spec.select, -2
%mul65 = mul i32 %sub66, %count4.1
%mul67 = mul i32 %mul65, %sub61
%div68 = sdiv i32 %mul67, 2
%add60 = add i32 %mul, %mul62
%add63 = add i32 %add60, %count74.1
%add69 = add nsw i32 %add63, %div68
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add69)
br label %if.end71
if.end71: ; preds = %if.else, %if.then58
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %sosukazu) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
#include <stdlib.h>
int main(void){
int count;
int win=0;
char s[20];
scanf("%s",s);
for(count=0;s[count]!='\0';count++){
if(s[count]=='o'){win++;}
}
if(15-count>=8-win){printf("YES\n");}
else{printf("NO\n");}
}
int min(int a,int b){
int ans;
if(a>b){return b;}
else {return a;}
}
int max(int a,int b){
int ans;
if(a>b){return a;}
else {return b;}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152809/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152809/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%win.0 = phi i32 [ %win.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 0, label %for.end
i8 111, label %if.then
]
if.then: ; preds = %for.cond
%inc = add nsw i32 %win.0, 1
br label %for.inc
for.inc: ; preds = %for.cond, %if.then
%win.1 = phi i32 [ %inc, %if.then ], [ %win.0, %for.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%1 = trunc i64 %indvars.iv to i32
%sub = sub nsw i32 15, %1
%sub8 = sub nsw i32 8, %win.0
%cmp9.not = icmp slt i32 %sub, %sub8
%str.str.3 = select i1 %cmp9.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int k,i,countwin;
char str[100],s[100],*p;
fgets(str,sizeof(str),stdin);
p=strtok(str," \n");
strcpy(s,p);
k=strlen(s);
for(i=0,countwin=0;i<k;i++){
if(s[i]=='o'){
countwin++;
}
}
if((15-k)+countwin>=8){
printf("YES");
}else{
printf("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152852/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152852/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c" \0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [100 x i8], align 16
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #7
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #7
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %0)
%call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #7
%call4 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %call2) #7
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #8
%conv = trunc i64 %call6 to i32
%cmp22 = icmp sgt i32 %conv, 0
br i1 %cmp22, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call6, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader29, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call6, 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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi27 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%1 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !9
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load28 = load <4 x i8>, ptr %2, align 4, !tbaa !9
%3 = icmp eq <4 x i8> %wide.load, <i8 111, i8 111, i8 111, i8 111>
%4 = icmp eq <4 x i8> %wide.load28, <i8 111, i8 111, i8 111, i8 111>
%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.phi27, %6
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.end, label %for.body.preheader29
for.body.preheader29: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%countwin.023.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader29, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader29 ]
%countwin.023 = phi i32 [ %spec.select, %for.body ], [ %countwin.023.ph, %for.body.preheader29 ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp9 = icmp eq i8 %11, 111
%inc = zext i1 %cmp9 to i32
%spec.select = add nuw nsw i32 %countwin.023, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %middle.block, %entry
%countwin.0.lcssa = phi i32 [ 0, %entry ], [ %10, %middle.block ], [ %spec.select, %for.body ]
%reass.sub25 = sub i32 %countwin.0.lcssa, %conv
%add = add i32 %reass.sub25, 15
%cmp12 = icmp sgt i32 %add, 7
%.str.1..str.2 = select i1 %cmp12, ptr @.str.1, ptr @.str.2
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #7
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
|
#if 0
cat <<EOF >mistaken-paste
#endif
// thx Ebi-chan!
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 20000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1048576
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
using std::get;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
typedef struct {
double a;
double b;
} hwreal;
ull n, m;
ull h, w;
ull k;
ull q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// int32_t pullcomp (const void *left, const void *right) {
// ull l = *(ull*)left;
// ull r = *(ull*)right;
// if (l < r) {
// return -1;
// }
// if (l > r) {
// return +1;
// }
// return 0;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(sll);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleCABcomp){
DEFLR(hwllc);
CMPRET(l.c, r.c);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwrealcomp){
DEFLR(hwreal);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
int32_t pfracomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
CMPRET(l.a * r.b, l.b * r.a);
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
sll a[N_MAX + 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX + 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
sll d[N_MAX + 5];
sll e[N_MAX * 4];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX * 2 + 5];
hwllc tup[N_MAX + 5];
// sll table[3005][3005];
ull gin[N_MAX];
// here we go
// set<ull> g[N_MAX];
ull que[N_MAX], beg = 0, end = 0;
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
sll *dpcell;
n = strlen(s);
for (i = 0; i < 15; i++) {
if (i >= n || s[i] == 'o') result++;
}
if (result >= 8) goto success;
puts("NO");
// printf("%lld\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
puts("YES");
// puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("First");
return 0;
fail:
// puts("NO");
// puts("No");
// puts("0");
puts("-1");
// puts("-1 -1 -1");
// puts("Second");
return 1;
}
int32_t main (int argc, char *argv[]) {
int32_t i, j;
n = 5;
m = 0;
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &n, &m);
// scanf("%llu%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &q);
// scanf("%lld", &va, &vb, &vc, &vd);
// va--;
// vb--;
// scanf("%llu%llu", &ua, &ub, &uc, &ud, &ue);
scanf("%s", s);
// scanf("%s", t);
// scanf("%s", u);
// scanf("%llu", &k);
// scanf("%lld", &m);
// for (i = 0; i < n; i++) {
// scanf("%lld", &a[i]);
// // scanf("%lld", &d[i]);
// }
// scanf("%llu", &q);
for (i = 0; i < 0; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &c[i]);
scanf("%lld", &a[i]);
scanf("%lld", &b[i]);
// scanf("%lld", &c[i]);
// scanf("%lld", &d[i]);
a[i]--;
b[i]--;
// c[i]--;
// d[i]--;
// xy[i].a--;
// xy[i].b--;
// tup[i].a--;
// tup[i].b--;
}
// scanf("%llu", &m);
// for (i = 0; i < n; i++) {
// // scanf("%lld%lld", &a[i], &b[i]);
// // scanf("%lld", &b[i]);
// // a[i]--;
// // b[i]--;
// scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// // scanf("%lld", &e[i]);
// // c[i]--;
// // d[i]--;
// }
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < n; i++) {
// for (j = 0; j < m; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", s[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152896/source.c"
target datalayout = "e-m:e-p270: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.hwll = type { i64, i64 }
%struct.hwllc = type { i64, i64, i64 }
@beg = dso_local local_unnamed_addr global i64 0, align 8
@end = dso_local local_unnamed_addr global i64 0, align 8
@s = dso_local global [1048577 x i8] zeroinitializer, align 16
@n = dso_local local_unnamed_addr global i64 0, align 8
@.str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@m = dso_local local_unnamed_addr global i64 0, align 8
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@a = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@va = dso_local local_unnamed_addr global i64 0, align 8
@vb = dso_local local_unnamed_addr global i64 0, align 8
@vc = dso_local local_unnamed_addr global i64 0, align 8
@vd = dso_local local_unnamed_addr global i64 0, align 8
@ve = dso_local local_unnamed_addr global i64 0, align 8
@vf = dso_local local_unnamed_addr global i64 0, align 8
@ua = dso_local local_unnamed_addr global i64 0, align 8
@ub = dso_local local_unnamed_addr global i64 0, align 8
@uc = dso_local local_unnamed_addr global i64 0, align 8
@ud = dso_local local_unnamed_addr global i64 0, align 8
@ue = dso_local local_unnamed_addr global i64 0, align 8
@uf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@c = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global [4194304 x i64] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@u = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@xy = dso_local local_unnamed_addr global [2097157 x %struct.hwll] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1048581 x %struct.hwllc] zeroinitializer, align 16
@gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16
@que = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
%cmp4 = icmp eq i64 %y, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%y.tr6 = phi i64 [ %rem, %if.else ], [ %y, %entry ]
%x.tr5 = phi i64 [ %y.tr6, %if.else ], [ %x, %entry ]
%rem = urem i64 %x.tr5, %y.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.else ]
ret i64 %x.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %1, %0
%cmp1 = icmp sgt i64 %1, %0
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !12
%1 = load i8, ptr %right, align 1, !tbaa !12
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %left, align 8, !tbaa !13
%1 = load double, ptr %right, align 8, !tbaa !13
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp ogt double %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !15
%1 = load ptr, ptr %right, align 8, !tbaa !15
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #9
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleCABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = fcmp ogt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22
%l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19
%l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17
%l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24
%l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22
%r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19
%r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17
%r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24
%r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18
%cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp.i, label %cleanup10, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4.i, label %cleanup10, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit
phwllABcomp.exit: ; preds = %if.end6.i
%cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp13.i.not, label %cleanup10, label %if.end
if.end: ; preds = %phwllABcomp.exit
%cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp.i21, label %cleanup10, label %if.end.i22
if.end.i22: ; preds = %if.end
%cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24
if.end6.i24: ; preds = %if.end.i22
%cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26
if.end10.i26: ; preds = %if.end6.i24
%cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
%..i28 = zext i1 %cmp13.i27 to i32
br label %cleanup10
cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit
%retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pfracomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%mul = mul nsw i64 %r.sroa.5.0.copyload, %l.sroa.0.0.copyload
%mul3 = mul nsw i64 %r.sroa.0.0.copyload, %l.sroa.5.0.copyload
%cmp = icmp slt i64 %mul, %mul3
%cmp10 = icmp sgt i64 %mul, %mul3
%. = zext i1 %cmp10 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 zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #6 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #9
store i64 %call, ptr @n, align 8, !tbaa !8
%cmp1.not.not = icmp eq i64 %call, 0
%cmp1.not.1 = icmp ult i64 %call, 2
%cmp1.not.2 = icmp ult i64 %call, 3
%cmp1.not.3 = icmp ult i64 %call, 4
%cmp1.not.4 = icmp ult i64 %call, 5
%cmp1.not.5 = icmp ult i64 %call, 6
%cmp1.not.6 = icmp ult i64 %call, 7
%cmp1.not.7 = icmp ult i64 %call, 8
%0 = load <8 x i8>, ptr @s, align 16
%1 = icmp eq <8 x i8> %0, <i8 111, i8 111, i8 111, i8 111, i8 111, i8 111, i8 111, i8 111>
%2 = extractelement <8 x i1> %1, i64 0
%or.cond = select i1 %cmp1.not.not, i1 true, i1 %2
%result.1 = zext i1 %or.cond to i64
%3 = extractelement <8 x i1> %1, i64 1
%or.cond28 = select i1 %cmp1.not.1, i1 true, i1 %3
%inc.1 = select i1 %or.cond, i64 2, i64 1
%result.1.1 = select i1 %or.cond28, i64 %inc.1, i64 %result.1
%4 = extractelement <8 x i1> %1, i64 2
%or.cond29 = select i1 %cmp1.not.2, i1 true, i1 %4
%inc.2 = zext i1 %or.cond29 to i64
%result.1.2 = add nuw nsw i64 %result.1.1, %inc.2
%5 = extractelement <8 x i1> %1, i64 3
%or.cond30 = select i1 %cmp1.not.3, i1 true, i1 %5
%inc.3 = zext i1 %or.cond30 to i64
%result.1.3 = add nuw nsw i64 %result.1.2, %inc.3
%6 = extractelement <8 x i1> %1, i64 4
%or.cond31 = select i1 %cmp1.not.4, i1 true, i1 %6
%inc.4 = zext i1 %or.cond31 to i64
%result.1.4 = add nuw nsw i64 %result.1.3, %inc.4
%7 = extractelement <8 x i1> %1, i64 5
%or.cond32 = select i1 %cmp1.not.5, i1 true, i1 %7
%inc.5 = zext i1 %or.cond32 to i64
%result.1.5 = add nuw nsw i64 %result.1.4, %inc.5
%8 = extractelement <8 x i1> %1, i64 6
%or.cond33 = select i1 %cmp1.not.6, i1 true, i1 %8
%inc.6 = zext i1 %or.cond33 to i64
%result.1.6 = add nuw nsw i64 %result.1.5, %inc.6
%9 = extractelement <8 x i1> %1, i64 7
%or.cond34 = select i1 %cmp1.not.7, i1 true, i1 %9
%inc.7 = zext i1 %or.cond34 to i64
%result.1.7 = add nuw nsw i64 %result.1.6, %inc.7
%cmp1.not.8 = icmp ult i64 %call, 9
%10 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 8), align 8
%cmp2.8 = icmp eq i8 %10, 111
%or.cond35 = select i1 %cmp1.not.8, i1 true, i1 %cmp2.8
%inc.8 = zext i1 %or.cond35 to i64
%result.1.8 = add nuw nsw i64 %result.1.7, %inc.8
%cmp1.not.9 = icmp ult i64 %call, 10
%11 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 9), align 1
%cmp2.9 = icmp eq i8 %11, 111
%or.cond36 = select i1 %cmp1.not.9, i1 true, i1 %cmp2.9
%inc.9 = zext i1 %or.cond36 to i64
%result.1.9 = add nuw nsw i64 %result.1.8, %inc.9
%cmp1.not.10 = icmp ult i64 %call, 11
%12 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 10), align 2
%cmp2.10 = icmp eq i8 %12, 111
%or.cond37 = select i1 %cmp1.not.10, i1 true, i1 %cmp2.10
%inc.10 = zext i1 %or.cond37 to i64
%result.1.10 = add nuw nsw i64 %result.1.9, %inc.10
%cmp1.not.11 = icmp ult i64 %call, 12
%13 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 11), align 1
%cmp2.11 = icmp eq i8 %13, 111
%or.cond38 = select i1 %cmp1.not.11, i1 true, i1 %cmp2.11
%inc.11 = zext i1 %or.cond38 to i64
%result.1.11 = add nuw nsw i64 %result.1.10, %inc.11
%cmp1.not.12 = icmp ult i64 %call, 13
%14 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 12), align 4
%cmp2.12 = icmp eq i8 %14, 111
%or.cond39 = select i1 %cmp1.not.12, i1 true, i1 %cmp2.12
%inc.12 = zext i1 %or.cond39 to i64
%result.1.12 = add nuw nsw i64 %result.1.11, %inc.12
%cmp1.not.13 = icmp ult i64 %call, 14
%15 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 13), align 1
%cmp2.13 = icmp eq i8 %15, 111
%or.cond40 = select i1 %cmp1.not.13, i1 true, i1 %cmp2.13
%inc.13 = zext i1 %or.cond40 to i64
%result.1.13 = add nuw nsw i64 %result.1.12, %inc.13
%cmp1.not.14 = icmp ult i64 %call, 15
%16 = load i8, ptr getelementptr inbounds ([1048577 x i8], ptr @s, i64 0, i64 14), align 2
%cmp2.14 = icmp eq i8 %16, 111
%or.cond41 = select i1 %cmp1.not.14, i1 true, i1 %cmp2.14
%inc.14 = zext i1 %or.cond41 to i64
%result.1.14 = add nuw nsw i64 %result.1.13, %inc.14
%cmp5 = icmp ugt i64 %result.1.14, 7
%.str.1.sink = select i1 %cmp5, ptr @.str.1, ptr @.str
%call10 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
ret i64 0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #6 {
entry:
store i64 5, ptr @n, align 8, !tbaa !8
store i64 0, ptr @m, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @s)
%call10 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #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 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!18 = !{i64 0, i64 8, !8}
!19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!21 = !{i64 0, i64 8, !13}
!22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if((a>=b)&&(a>=c))printf("%d\n",10*a+b+c);
else if((b>=a)&&(b>=c))printf("%d\n",10*b+a+c);
else printf("%d\n",c*10+a+b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152939/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152939/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %0, %.pre.pre
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i32 %0, 10
%add = add nsw i32 %mul, %1
%add2 = add nsw i32 %add, %.pre.pre
br label %if.end17
if.else: ; preds = %entry
%cmp4.not = icmp slt i32 %1, %0
%cmp6.not = icmp slt i32 %1, %.pre.pre
%or.cond23 = select i1 %cmp4.not, i1 true, i1 %cmp6.not
br i1 %or.cond23, label %if.else12, label %if.then7
if.then7: ; preds = %if.else
%mul8 = mul nsw i32 %1, 10
%add9 = add nsw i32 %mul8, %0
%add10 = add nsw i32 %add9, %.pre.pre
br label %if.end17
if.else12: ; preds = %if.else
%mul13 = mul nsw i32 %.pre.pre, 10
%add14 = add i32 %1, %0
%add15 = add i32 %add14, %mul13
br label %if.end17
if.end17: ; preds = %if.then7, %if.else12, %if.then
%add10.sink = phi i32 [ %add10, %if.then7 ], [ %add15, %if.else12 ], [ %add2, %if.then ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
//scanf("%d",&x);
//printf("%d",x);
//for(i=0;i<N;i++){ }
//if( == ){ }else{ }
//while( ){ }
/*
int N, i;
int H[100];
scanf("%d", &N);
for (i = 0; i < N; i++) scanf("%s", &H[i]);
*/
int main()
{
int a[4];
int i;
for (i = 0; i < 3; i++) scanf("%d", &a[i]);
for (i = 0; i < 3; i++) {
for (int j = i + 1; j < 3; j++) {
if (a[i] > a[j]) {
int tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
}
int Ans = a[2] * 10 + a[1] + a[0];
printf("%d", Ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_152982/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_152982/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
for.body6.lr.ph:
%a = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx.1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%0 = load i32, ptr %a, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, %1
br i1 %cmp11, label %if.then, label %for.inc20
for.body6.lr.ph.1: ; preds = %if.then.160, %for.inc20
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp11.1 = icmp sgt i32 %2, %3
br i1 %cmp11.1, label %if.then.1, label %for.cond1.loopexit.2
if.then.1: ; preds = %for.body6.lr.ph.1
store i32 %3, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.2, align 8, !tbaa !5
br label %for.cond1.loopexit.2
for.cond1.loopexit.2: ; preds = %if.then.1, %for.body6.lr.ph.1
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%mul = mul nsw i32 %4, 10
%5 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add28 = add nsw i32 %mul, %5
%6 = load i32, ptr %a, align 16, !tbaa !5
%add30 = add nsw i32 %add28, %6
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add30)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #3
ret i32 0
if.then: ; preds = %for.body6.lr.ph
store i32 %1, ptr %a, align 16, !tbaa !5
store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.body6.lr.ph, %if.then
%7 = phi i32 [ %0, %for.body6.lr.ph ], [ %1, %if.then ]
%8 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp11.158 = icmp sgt i32 %7, %8
br i1 %cmp11.158, label %if.then.160, label %for.body6.lr.ph.1
if.then.160: ; preds = %for.inc20
store i32 %8, ptr %a, align 16, !tbaa !5
store i32 %7, ptr %arrayidx.2, align 8, !tbaa !5
br label %for.body6.lr.ph.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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"}
|
#include <stdio.h>
int main(void){
int A,B,C;
scanf("%d%d%d",&A,&B,&C);
int max = A;
if(max < B){
max = B;
}
if(max < C){
max = C;
}
printf("%d\n",A+B+C-max+max*10);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153068/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153068/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %C, align 4, !tbaa !5
%max.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%add = add nsw i32 %1, %0
%add4 = add nsw i32 %add, %2
%sub = sub i32 %add4, %max.1
%mul = mul nsw i32 %max.1, 10
%add5 = add nsw i32 %sub, %mul
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a[3];
int max = 0;
scanf("%d %d %d", &a[0], &a[1], &a[2]);
for(int i = 0;i < 3;i++){
for(int j = 0; j < 3;j++){
if (a[i] < a[j]) {
max = a[i];
a[i] = a[j];
a[j] = max;
}
}
}
printf("%d", a[2] * 10 + a[1] + a[0]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.inc:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], 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 %arrayidx2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %0, %1
br i1 %cmp10.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%2 = phi i32 [ %0, %if.then.1 ], [ %1, %for.inc ]
%3 = phi i32 [ %1, %if.then.1 ], [ %0, %for.inc ]
%4 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp10.2 = icmp slt i32 %3, %4
br i1 %cmp10.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%5 = phi i32 [ %3, %if.then.2 ], [ %4, %for.inc.1 ]
%6 = phi i32 [ %4, %if.then.2 ], [ %3, %for.inc.1 ]
%cmp10.140 = icmp slt i32 %2, %6
br i1 %cmp10.140, label %if.then.141, label %for.inc.1.1
if.then.141: ; preds = %for.inc.2
store i32 %6, ptr %arrayidx1, align 4, !tbaa !5
store i32 %2, ptr %a, align 4, !tbaa !5
br label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.2, %if.then.141
%7 = phi i32 [ %2, %if.then.141 ], [ %6, %for.inc.2 ]
%8 = phi i32 [ %6, %if.then.141 ], [ %2, %for.inc.2 ]
%cmp10.2.1 = icmp slt i32 %8, %5
br i1 %cmp10.2.1, label %if.then.2.1, label %for.inc.2.1
if.then.2.1: ; preds = %for.inc.1.1
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1
%9 = phi i32 [ %5, %if.then.2.1 ], [ %8, %for.inc.1.1 ]
%10 = phi i32 [ %8, %if.then.2.1 ], [ %5, %for.inc.1.1 ]
%cmp10.243 = icmp slt i32 %10, %7
br i1 %cmp10.243, label %if.then.244, label %for.inc.245
if.then.244: ; preds = %for.inc.2.1
store i32 %7, ptr %arrayidx2, align 4, !tbaa !5
store i32 %10, ptr %a, align 4, !tbaa !5
br label %for.inc.245
for.inc.245: ; preds = %if.then.244, %for.inc.2.1
%11 = phi i32 [ %10, %if.then.244 ], [ %7, %for.inc.2.1 ]
%12 = phi i32 [ %7, %if.then.244 ], [ %10, %for.inc.2.1 ]
%cmp10.1.2 = icmp slt i32 %12, %9
br i1 %cmp10.1.2, label %if.then.1.2, label %for.inc.2.2
if.then.1.2: ; preds = %for.inc.245
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
store i32 %12, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.2.2
for.inc.2.2: ; preds = %for.inc.245, %if.then.1.2
%13 = phi i32 [ %12, %if.then.1.2 ], [ %9, %for.inc.245 ]
%14 = phi i32 [ %9, %if.then.1.2 ], [ %12, %for.inc.245 ]
%mul = mul nsw i32 %14, 10
%add = add nsw i32 %mul, %13
%add25 = add nsw i32 %add, %11
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add25)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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"}
|
#include <stdio.h>
int main(void) {
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if (a >= b && a >= c) {
a *= 10;
} else if (b >= a && b >= c) {
b *= 10;
} else {
c *= 10;
}
printf("%d\n",a + b + c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153161/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153161/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1.not = icmp slt i32 %0, %2
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i32 %0, 10
store i32 %mul, ptr %a, align 4, !tbaa !5
br label %if.end9
if.else: ; preds = %entry
%cmp2.not = icmp slt i32 %1, %0
%cmp4.not = icmp slt i32 %1, %2
%or.cond13 = select i1 %cmp2.not, i1 true, i1 %cmp4.not
br i1 %or.cond13, label %if.else7, label %if.then5
if.then5: ; preds = %if.else
%mul6 = mul nsw i32 %1, 10
store i32 %mul6, ptr %b, align 4, !tbaa !5
br label %if.end9
if.else7: ; preds = %if.else
%mul8 = mul nsw i32 %2, 10
store i32 %mul8, ptr %c, align 4, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then5, %if.else7, %if.then
%3 = phi i32 [ %2, %if.then5 ], [ %mul8, %if.else7 ], [ %2, %if.then ]
%4 = phi i32 [ %mul6, %if.then5 ], [ %1, %if.else7 ], [ %1, %if.then ]
%5 = phi i32 [ %0, %if.then5 ], [ %0, %if.else7 ], [ %mul, %if.then ]
%add = add nsw i32 %4, %5
%add10 = add nsw i32 %add, %3
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define max(a,b) a>b?a:b
int main()
{ int a,b,c,n,k,x;
scanf("%d%d%d",&a,&b,&c);
if(a>b){
if(a>c){printf("%d",10*a+b+c);
}else{
printf("%d",10*c+a+b);
}}else if(b>c){
printf("%d",b*10+a+c);
}else{
printf("%d",10*c+a+b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153204/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153204/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.else9
if.then: ; preds = %entry
%cmp1 = icmp sgt i32 %0, %2
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%mul = mul nsw i32 %0, 10
%add = add nsw i32 %mul, %1
%add3 = add nsw i32 %add, %2
br label %if.end22
if.else: ; preds = %if.then
%mul5 = mul nsw i32 %2, 10
%add6 = add i32 %1, %0
%add7 = add i32 %add6, %mul5
br label %if.end22
if.else9: ; preds = %entry
%cmp10 = icmp sgt i32 %1, %2
br i1 %cmp10, label %if.then11, label %if.else16
if.then11: ; preds = %if.else9
%mul12 = mul nsw i32 %1, 10
%add13 = add nsw i32 %mul12, %0
%add14 = add nsw i32 %add13, %2
br label %if.end22
if.else16: ; preds = %if.else9
%mul17 = mul nsw i32 %2, 10
%add18 = add i32 %1, %0
%add19 = add i32 %add18, %mul17
br label %if.end22
if.end22: ; preds = %if.then11, %if.else16, %if.then2, %if.else
%add14.sink = phi i32 [ %add14, %if.then11 ], [ %add19, %if.else16 ], [ %add3, %if.then2 ], [ %add7, %if.else ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add14.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int n,a,b,t,c=0,i;
scanf("%d%d%d",&n,&a,&b);
for(i=1;i<=n;i++){
scanf("%d",&t);
if(!(a<=t&&t<b)){c++;}
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153248/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153248/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not8 = icmp slt i32 %0, 1
br i1 %cmp.not8, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.010 = phi i32 [ %inc4, %for.body ], [ 1, %entry ]
%c.09 = phi i32 [ %c.1, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %1, %2
%3 = load i32, ptr %b, align 4
%cmp3 = icmp sge i32 %2, %3
%or.cond.not = select i1 %cmp2.not, i1 true, i1 %cmp3
%inc = zext i1 %or.cond.not to i32
%c.1 = add nuw nsw i32 %c.09, %inc
%inc4 = add nuw nsw i32 %i.010, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.010, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %c.1, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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
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<math.h>
int main()
{
int n;
scanf("%d", &n);
int i;
int a[102];
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
double sum = 0;
for (i = 0; i < n; i++)
sum += a[i];
sum /= n;
int ans = 0;
for (i = 0; i < n; i++)
if (fabs(sum - a[ans]) > fabs(sum - a[i]))
ans = i;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [102 x i32], align 16
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)
call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %a) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp41 = icmp sgt i32 %0, 0
br i1 %cmp41, label %for.body, label %for.end26
for.cond2.preheader: ; preds = %for.body
%cmp343 = icmp sgt i32 %2, 0
br i1 %cmp343, label %for.body4.preheader, label %for.end26
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %2 to i64
%xtraiter = and i64 %wide.trip.count, 3
%1 = icmp ult i32 %2, 4
br i1 %1, label %for.end9.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%indvars.iv53 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next54.3, %for.body4 ]
%sum.045 = phi double [ 0.000000e+00, %for.body4.preheader.new ], [ %add.3, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.3, %for.body4 ]
%arrayidx6 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv53
%4 = load i32, ptr %arrayidx6, align 16, !tbaa !5
%conv = sitofp i32 %4 to double
%add = fadd double %sum.045, %conv
%indvars.iv.next54 = or i64 %indvars.iv53, 1
%arrayidx6.1 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv.next54
%5 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %5 to double
%add.1 = fadd double %add, %conv.1
%indvars.iv.next54.1 = or i64 %indvars.iv53, 2
%arrayidx6.2 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv.next54.1
%6 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5
%conv.2 = sitofp i32 %6 to double
%add.2 = fadd double %add.1, %conv.2
%indvars.iv.next54.2 = or i64 %indvars.iv53, 3
%arrayidx6.3 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv.next54.2
%7 = load i32, ptr %arrayidx6.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %7 to double
%add.3 = fadd double %add.2, %conv.3
%indvars.iv.next54.3 = add nuw nsw i64 %indvars.iv53, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end9.unr-lcssa, label %for.body4, !llvm.loop !11
for.end9.unr-lcssa: ; preds = %for.body4, %for.body4.preheader
%add.lcssa.ph = phi double [ undef, %for.body4.preheader ], [ %add.3, %for.body4 ]
%indvars.iv53.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next54.3, %for.body4 ]
%sum.045.unr = phi double [ 0.000000e+00, %for.body4.preheader ], [ %add.3, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end9, label %for.body4.epil
for.body4.epil: ; preds = %for.end9.unr-lcssa, %for.body4.epil
%indvars.iv53.epil = phi i64 [ %indvars.iv.next54.epil, %for.body4.epil ], [ %indvars.iv53.unr, %for.end9.unr-lcssa ]
%sum.045.epil = phi double [ %add.epil, %for.body4.epil ], [ %sum.045.unr, %for.end9.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body4.epil ], [ 0, %for.end9.unr-lcssa ]
%arrayidx6.epil = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv53.epil
%8 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %8 to double
%add.epil = fadd double %sum.045.epil, %conv.epil
%indvars.iv.next54.epil = add nuw nsw i64 %indvars.iv53.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end9, label %for.body4.epil, !llvm.loop !12
for.end9: ; preds = %for.body4.epil, %for.end9.unr-lcssa
%add.lcssa = phi double [ %add.lcssa.ph, %for.end9.unr-lcssa ], [ %add.epil, %for.body4.epil ]
br i1 %cmp343, label %for.body14.preheader, label %for.end26
for.body14.preheader: ; preds = %for.end9
%conv10 = sitofp i32 %2 to double
%div = fdiv double %add.lcssa, %conv10
%wide.trip.count59 = zext i32 %2 to i64
%9 = insertelement <2 x double> poison, double %div, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
br label %for.body14
for.body14: ; preds = %for.body14.preheader, %for.body14
%indvars.iv56 = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next57, %for.body14 ]
%ans.049 = phi i32 [ 0, %for.body14.preheader ], [ %ans.1, %for.body14 ]
%idxprom15 = sext i32 %ans.049 to i64
%arrayidx16 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %idxprom15
%11 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [102 x i32], ptr %a, i64 0, i64 %indvars.iv56
%12 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%13 = insertelement <2 x i32> poison, i32 %11, i64 0
%14 = insertelement <2 x i32> %13, i32 %12, i64 1
%15 = sitofp <2 x i32> %14 to <2 x double>
%16 = fsub <2 x double> %10, %15
%17 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %16)
%18 = extractelement <2 x double> %17, i64 0
%19 = extractelement <2 x double> %17, i64 1
%cmp22 = fcmp ogt double %18, %19
%20 = trunc i64 %indvars.iv56 to i32
%ans.1 = select i1 %cmp22, i32 %20, i32 %ans.049
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%exitcond60.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count59
br i1 %exitcond60.not, label %for.end26, label %for.body14, !llvm.loop !14
for.end26: ; preds = %for.body14, %entry, %for.cond2.preheader, %for.end9
%ans.0.lcssa = phi i32 [ 0, %for.end9 ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %ans.1, %for.body14 ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(){
int i,j,num,temp;
int ans[1000];
scanf("%d",&num);
for(i=0;i<num;i++){
scanf("%d",&ans[i]);
}
for(i=1;i<num;i++){
for(j=i;j>=0;j--){
if(ans[j]<=ans[j-1]){
temp=ans[j];
ans[j]=ans[j-1];
ans[j-1]=temp;
}
}
}
for(i=0;i<num;i++){
printf("%d",ans[i]);
if(i<num-1)printf(" ");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca i32, align 4
%ans = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %ans) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %for.body, label %for.end41
for.cond2.preheader: ; preds = %for.body
%cmp365 = icmp sgt i32 %1, 1
br i1 %cmp365, label %for.cond5.preheader.preheader, label %for.cond28.preheader
for.cond5.preheader.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %1 to i64
br label %for.body7.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %num, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body7.preheader: ; preds = %for.inc25, %for.cond5.preheader.preheader
%indvar = phi i64 [ %indvar.next, %for.inc25 ], [ 0, %for.cond5.preheader.preheader ]
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc25 ], [ 1, %for.cond5.preheader.preheader ]
%xtraiter = and i64 %indvar, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body7.prol.loopexit, label %for.body7.prol
for.body7.prol: ; preds = %for.body7.preheader
%idxprom8.prol = and i64 %indvars.iv71, 4294967295
%arrayidx9.prol = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %idxprom8.prol
%3 = load i32, ptr %arrayidx9.prol, align 4, !tbaa !5
%indvars.iv.next74.prol = add nsw i64 %indvars.iv71, -1
%arrayidx11.prol = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv.next74.prol
%4 = load i32, ptr %arrayidx11.prol, align 4, !tbaa !5
%cmp12.not.prol = icmp sgt i32 %3, %4
br i1 %cmp12.not.prol, label %for.body7.prol.loopexit, label %if.then.prol
if.then.prol: ; preds = %for.body7.prol
store i32 %4, ptr %arrayidx9.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx11.prol, align 4, !tbaa !5
br label %for.body7.prol.loopexit
for.body7.prol.loopexit: ; preds = %for.body7.prol, %if.then.prol, %for.body7.preheader
%indvars.iv73.unr = phi i64 [ %indvars.iv71, %for.body7.preheader ], [ %indvars.iv.next74.prol, %if.then.prol ], [ %indvars.iv.next74.prol, %for.body7.prol ]
%5 = icmp eq i64 %indvar, -1
br i1 %5, label %for.inc25, label %for.body7
for.cond28.preheader: ; preds = %for.inc25, %for.cond2.preheader
%cmp2967 = icmp sgt i32 %1, 0
br i1 %cmp2967, label %for.body30, label %for.end41
for.body7: ; preds = %for.body7.prol.loopexit, %for.inc23.1
%indvars.iv73 = phi i64 [ %indvars.iv.next74.1, %for.inc23.1 ], [ %indvars.iv73.unr, %for.body7.prol.loopexit ]
%idxprom8 = and i64 %indvars.iv73, 4294967295
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %idxprom8
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next74 = add nsw i64 %indvars.iv73, -1
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv.next74
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12.not = icmp sgt i32 %6, %7
br i1 %cmp12.not, label %for.inc23, label %if.then
if.then: ; preds = %for.body7
store i32 %7, ptr %arrayidx9, align 4, !tbaa !5
store i32 %6, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.body7, %if.then
%idxprom8.1 = and i64 %indvars.iv.next74, 4294967295
%arrayidx9.1 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %idxprom8.1
%8 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%indvars.iv.next74.1 = add nsw i64 %indvars.iv73, -2
%arrayidx11.1 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv.next74.1
%9 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.not.1 = icmp sgt i32 %8, %9
br i1 %cmp12.not.1, label %for.inc23.1, label %if.then.1
if.then.1: ; preds = %for.inc23
store i32 %9, ptr %arrayidx9.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx11.1, align 4, !tbaa !5
br label %for.inc23.1
for.inc23.1: ; preds = %if.then.1, %for.inc23
%cmp6.1 = icmp sgt i64 %indvars.iv73, 1
br i1 %cmp6.1, label %for.body7, label %for.inc25, !llvm.loop !11
for.inc25: ; preds = %for.inc23.1, %for.body7.prol.loopexit
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.cond28.preheader, label %for.body7.preheader, !llvm.loop !12
for.body30: ; preds = %for.cond28.preheader, %for.inc39
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.inc39 ], [ 0, %for.cond28.preheader ]
%arrayidx32 = getelementptr inbounds [1000 x i32], ptr %ans, i64 0, i64 %indvars.iv77
%10 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%11 = load i32, ptr %num, align 4, !tbaa !5
%sub34 = add nsw i32 %11, -1
%12 = sext i32 %sub34 to i64
%cmp35 = icmp slt i64 %indvars.iv77, %12
br i1 %cmp35, label %if.then36, label %for.inc39
if.then36: ; preds = %for.body30
%putchar60 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %num, align 4, !tbaa !5
br label %for.inc39
for.inc39: ; preds = %for.body30, %if.then36
%13 = phi i32 [ %11, %for.body30 ], [ %.pre, %if.then36 ]
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%14 = sext i32 %13 to i64
%cmp29 = icmp slt i64 %indvars.iv.next78, %14
br i1 %cmp29, label %for.body30, label %for.end41, !llvm.loop !13
for.end41: ; preds = %for.inc39, %entry, %for.cond28.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int n,m,i,j,k,l,count=0,q=0;
char c[3000],d[3000],e[3000],f[3000];
scanf("%d",&n);
while(n--)
{
scanf("%d %d",&m,&k);
scanf("%s",&c);
j=0;
count=0;
l=0;
for(i=0;i<k;i++){
if(i%3==0)
d[i]='R';
else if(i%3==1)
d[i]='G';
else
d[i]='B';
}
for(i=0;i<k;i++){
if(i%3==0)
e[i]='G';
else if(i%3==1)
e[i]='B';
else
e[i]='R';
}
for(i=0;i<k;i++){
if(i%3==0)
f[i]='B';
else if(i%3==1)
f[i]='R';
else
f[i]='G';
}
j=3000;
q=0;
for(count=0;count<=m-k;count++){
l=0;
for(i=0;i<k;i++){
if(d[i]!=c[i+count])
l++;
}
if(l<j)
j=l;
if(j==0){
q=1;
break;
}
}
if(q==0){
for(count=0;count<=m-k;count++){
l=0;
for(i=0;i<k;i++){
if(e[i]!=c[i+count])
l++;
}
if(l<j)
j=l;
if(j==0){
q=1;
break;
}
}
}
if(q==0){
for(count=0;count<=m-k;count++){
l=0;
for(i=0;i<k;i++){
if(f[i]!=c[i+count])
l++;
}
if(l<j)
j=l;
if(j==0){
q=1;
break;
}
}
}
if(q==1)
printf("0\n");
else
printf("%d\n",j);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1534/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1534/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%c = alloca [3000 x i8], align 16
%d = alloca [3000 x i8], align 16
%e = alloca [3000 x i8], align 16
%f = alloca [3000 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %e) #5
call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %f) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec276 = add nsw i32 %0, -1
store i32 %dec276, ptr %n, align 4, !tbaa !5
%tobool.not277 = icmp eq i32 %0, 0
br i1 %tobool.not277, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end171
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %k)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %c)
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp240 = icmp sgt i32 %1, 0
br i1 %cmp240, label %iter.check450, label %for.cond57.preheader
iter.check450: ; preds = %while.body
%wide.trip.count = zext i32 %1 to i64
%min.iters.check448 = icmp ult i32 %1, 8
br i1 %min.iters.check448, label %for.body.preheader, label %vector.main.loop.iter.check452
vector.main.loop.iter.check452: ; preds = %iter.check450
%min.iters.check451 = icmp ult i32 %1, 16
br i1 %min.iters.check451, label %vec.epilog.ph466, label %vector.ph453
vector.ph453: ; preds = %vector.main.loop.iter.check452
%n.vec455 = and i64 %wide.trip.count, 4294967280
br label %vector.body457
vector.body457: ; preds = %vector.body457, %vector.ph453
%index458 = phi i64 [ 0, %vector.ph453 ], [ %index.next461, %vector.body457 ]
%vec.ind459 = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph453 ], [ %vec.ind.next460, %vector.body457 ]
%2 = urem <16 x i32> %vec.ind459, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%3 = getelementptr inbounds [3000 x i8], ptr %d, i64 0, i64 %index458
%4 = icmp eq <16 x i32> %2, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%5 = select <16 x i1> %4, <16 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>, <16 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>
%6 = icmp eq <16 x i32> %2, zeroinitializer
%7 = select <16 x i1> %6, <16 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>, <16 x i8> %5
store <16 x i8> %7, ptr %3, align 16, !tbaa !9
%index.next461 = add nuw i64 %index458, 16
%vec.ind.next460 = add <16 x i32> %vec.ind459, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%8 = icmp eq i64 %index.next461, %n.vec455
br i1 %8, label %middle.block446, label %vector.body457, !llvm.loop !10
middle.block446: ; preds = %vector.body457
%cmp.n456 = icmp eq i64 %n.vec455, %wide.trip.count
br i1 %cmp.n456, label %for.cond13.preheader, label %vec.epilog.iter.check465
vec.epilog.iter.check465: ; preds = %middle.block446
%n.vec.remaining467 = and i64 %wide.trip.count, 8
%min.epilog.iters.check468.not.not = icmp eq i64 %n.vec.remaining467, 0
br i1 %min.epilog.iters.check468.not.not, label %for.body.preheader, label %vec.epilog.ph466
vec.epilog.ph466: ; preds = %vector.main.loop.iter.check452, %vec.epilog.iter.check465
%vec.epilog.resume.val469 = phi i64 [ %n.vec455, %vec.epilog.iter.check465 ], [ 0, %vector.main.loop.iter.check452 ]
%n.vec471 = and i64 %wide.trip.count, 4294967288
%9 = trunc i64 %vec.epilog.resume.val469 to i32
%.splatinsert476 = insertelement <8 x i32> poison, i32 %9, i64 0
%.splat477 = shufflevector <8 x i32> %.splatinsert476, <8 x i32> poison, <8 x i32> zeroinitializer
%induction478 = or <8 x i32> %.splat477, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
br label %vec.epilog.vector.body474
vec.epilog.vector.body474: ; preds = %vec.epilog.vector.body474, %vec.epilog.ph466
%index475 = phi i64 [ %vec.epilog.resume.val469, %vec.epilog.ph466 ], [ %index.next481, %vec.epilog.vector.body474 ]
%vec.ind479 = phi <8 x i32> [ %induction478, %vec.epilog.ph466 ], [ %vec.ind.next480, %vec.epilog.vector.body474 ]
%10 = urem <8 x i32> %vec.ind479, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%11 = getelementptr inbounds [3000 x i8], ptr %d, i64 0, i64 %index475
%12 = icmp eq <8 x i32> %10, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%13 = select <8 x i1> %12, <8 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>, <8 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>
%14 = icmp eq <8 x i32> %10, zeroinitializer
%15 = select <8 x i1> %14, <8 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>, <8 x i8> %13
store <8 x i8> %15, ptr %11, align 8, !tbaa !9
%index.next481 = add nuw i64 %index475, 8
%vec.ind.next480 = add <8 x i32> %vec.ind479, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
%16 = icmp eq i64 %index.next481, %n.vec471
br i1 %16, label %vec.epilog.middle.block463, label %vec.epilog.vector.body474, !llvm.loop !14
vec.epilog.middle.block463: ; preds = %vec.epilog.vector.body474
%cmp.n473 = icmp eq i64 %n.vec471, %wide.trip.count
br i1 %cmp.n473, label %for.cond13.preheader, label %for.body.preheader
for.body.preheader: ; preds = %iter.check450, %vec.epilog.iter.check465, %vec.epilog.middle.block463
%indvars.iv.ph = phi i64 [ 0, %iter.check450 ], [ %n.vec455, %vec.epilog.iter.check465 ], [ %n.vec471, %vec.epilog.middle.block463 ]
br label %for.body
for.cond13.preheader: ; preds = %for.body, %vec.epilog.middle.block463, %middle.block446
br i1 %cmp240, label %iter.check414, label %for.cond57.preheader
iter.check414: ; preds = %for.cond13.preheader
%wide.trip.count285 = zext i32 %1 to i64
%min.iters.check412 = icmp ult i32 %1, 8
br i1 %min.iters.check412, label %for.body15.preheader, label %vector.main.loop.iter.check416
vector.main.loop.iter.check416: ; preds = %iter.check414
%min.iters.check415 = icmp ult i32 %1, 16
br i1 %min.iters.check415, label %vec.epilog.ph430, label %vector.ph417
vector.ph417: ; preds = %vector.main.loop.iter.check416
%n.vec419 = and i64 %wide.trip.count, 4294967280
br label %vector.body421
vector.body421: ; preds = %vector.body421, %vector.ph417
%index422 = phi i64 [ 0, %vector.ph417 ], [ %index.next425, %vector.body421 ]
%vec.ind423 = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph417 ], [ %vec.ind.next424, %vector.body421 ]
%17 = urem <16 x i32> %vec.ind423, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%18 = getelementptr inbounds [3000 x i8], ptr %e, i64 0, i64 %index422
%19 = icmp eq <16 x i32> %17, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%20 = select <16 x i1> %19, <16 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>, <16 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>
%21 = icmp eq <16 x i32> %17, zeroinitializer
%22 = select <16 x i1> %21, <16 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>, <16 x i8> %20
store <16 x i8> %22, ptr %18, align 16, !tbaa !9
%index.next425 = add nuw i64 %index422, 16
%vec.ind.next424 = add <16 x i32> %vec.ind423, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%23 = icmp eq i64 %index.next425, %n.vec419
br i1 %23, label %middle.block410, label %vector.body421, !llvm.loop !15
middle.block410: ; preds = %vector.body421
%cmp.n420 = icmp eq i64 %n.vec419, %wide.trip.count
br i1 %cmp.n420, label %for.cond35.preheader, label %vec.epilog.iter.check429
vec.epilog.iter.check429: ; preds = %middle.block410
%n.vec.remaining431 = and i64 %wide.trip.count, 8
%min.epilog.iters.check432.not.not = icmp eq i64 %n.vec.remaining431, 0
br i1 %min.epilog.iters.check432.not.not, label %for.body15.preheader, label %vec.epilog.ph430
vec.epilog.ph430: ; preds = %vector.main.loop.iter.check416, %vec.epilog.iter.check429
%vec.epilog.resume.val433 = phi i64 [ %n.vec419, %vec.epilog.iter.check429 ], [ 0, %vector.main.loop.iter.check416 ]
%n.vec435 = and i64 %wide.trip.count, 4294967288
%24 = trunc i64 %vec.epilog.resume.val433 to i32
%.splatinsert440 = insertelement <8 x i32> poison, i32 %24, i64 0
%.splat441 = shufflevector <8 x i32> %.splatinsert440, <8 x i32> poison, <8 x i32> zeroinitializer
%induction442 = or <8 x i32> %.splat441, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
br label %vec.epilog.vector.body438
vec.epilog.vector.body438: ; preds = %vec.epilog.vector.body438, %vec.epilog.ph430
%index439 = phi i64 [ %vec.epilog.resume.val433, %vec.epilog.ph430 ], [ %index.next445, %vec.epilog.vector.body438 ]
%vec.ind443 = phi <8 x i32> [ %induction442, %vec.epilog.ph430 ], [ %vec.ind.next444, %vec.epilog.vector.body438 ]
%25 = urem <8 x i32> %vec.ind443, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%26 = getelementptr inbounds [3000 x i8], ptr %e, i64 0, i64 %index439
%27 = icmp eq <8 x i32> %25, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%28 = select <8 x i1> %27, <8 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>, <8 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>
%29 = icmp eq <8 x i32> %25, zeroinitializer
%30 = select <8 x i1> %29, <8 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>, <8 x i8> %28
store <8 x i8> %30, ptr %26, align 8, !tbaa !9
%index.next445 = add nuw i64 %index439, 8
%vec.ind.next444 = add <8 x i32> %vec.ind443, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
%31 = icmp eq i64 %index.next445, %n.vec435
br i1 %31, label %vec.epilog.middle.block427, label %vec.epilog.vector.body438, !llvm.loop !16
vec.epilog.middle.block427: ; preds = %vec.epilog.vector.body438
%cmp.n437 = icmp eq i64 %n.vec435, %wide.trip.count
br i1 %cmp.n437, label %for.cond35.preheader, label %for.body15.preheader
for.body15.preheader: ; preds = %iter.check414, %vec.epilog.iter.check429, %vec.epilog.middle.block427
%indvars.iv282.ph = phi i64 [ 0, %iter.check414 ], [ %n.vec419, %vec.epilog.iter.check429 ], [ %n.vec435, %vec.epilog.middle.block427 ]
br label %for.body15
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
%32 = trunc i64 %indvars.iv to i32
%rem = urem i32 %32, 3
%arrayidx11 = getelementptr inbounds [3000 x i8], ptr %d, i64 0, i64 %indvars.iv
%switch.selectcmp = icmp eq i32 %rem, 1
%switch.select = select i1 %switch.selectcmp, i8 71, i8 66
%switch.selectcmp334 = icmp eq i32 %rem, 0
%switch.select335 = select i1 %switch.selectcmp334, i8 82, i8 %switch.select
store i8 %switch.select335, ptr %arrayidx11, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond13.preheader, label %for.body, !llvm.loop !17
for.cond35.preheader: ; preds = %for.body15, %vec.epilog.middle.block427, %middle.block410
br i1 %cmp240, label %iter.check, label %for.cond57.preheader
iter.check: ; preds = %for.cond35.preheader
%wide.trip.count290 = zext i32 %1 to i64
%min.iters.check391 = icmp ult i32 %1, 8
br i1 %min.iters.check391, label %for.body37.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check393 = icmp ult i32 %1, 16
br i1 %min.iters.check393, label %vec.epilog.ph, label %vector.ph394
vector.ph394: ; preds = %vector.main.loop.iter.check
%n.vec396 = and i64 %wide.trip.count, 4294967280
br label %vector.body398
vector.body398: ; preds = %vector.body398, %vector.ph394
%index399 = phi i64 [ 0, %vector.ph394 ], [ %index.next400, %vector.body398 ]
%vec.ind = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph394 ], [ %vec.ind.next, %vector.body398 ]
%33 = urem <16 x i32> %vec.ind, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%34 = getelementptr inbounds [3000 x i8], ptr %f, i64 0, i64 %index399
%35 = icmp eq <16 x i32> %33, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%36 = select <16 x i1> %35, <16 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>, <16 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>
%37 = icmp eq <16 x i32> %33, zeroinitializer
%38 = select <16 x i1> %37, <16 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>, <16 x i8> %36
store <16 x i8> %38, ptr %34, align 16, !tbaa !9
%index.next400 = add nuw i64 %index399, 16
%vec.ind.next = add <16 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%39 = icmp eq i64 %index.next400, %n.vec396
br i1 %39, label %middle.block389, label %vector.body398, !llvm.loop !18
middle.block389: ; preds = %vector.body398
%cmp.n397 = icmp eq i64 %n.vec396, %wide.trip.count
br i1 %cmp.n397, label %for.cond57.preheader, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block389
%n.vec.remaining = and i64 %wide.trip.count, 8
%min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check.not.not, label %for.body37.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec396, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec403 = and i64 %wide.trip.count, 4294967288
%40 = trunc i64 %vec.epilog.resume.val to i32
%.splatinsert = insertelement <8 x i32> poison, i32 %40, i64 0
%.splat = shufflevector <8 x i32> %.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer
%induction = or <8 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index406 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next409, %vec.epilog.vector.body ]
%vec.ind407 = phi <8 x i32> [ %induction, %vec.epilog.ph ], [ %vec.ind.next408, %vec.epilog.vector.body ]
%41 = urem <8 x i32> %vec.ind407, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%42 = getelementptr inbounds [3000 x i8], ptr %f, i64 0, i64 %index406
%43 = icmp eq <8 x i32> %41, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%44 = select <8 x i1> %43, <8 x i8> <i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82, i8 82>, <8 x i8> <i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71, i8 71>
%45 = icmp eq <8 x i32> %41, zeroinitializer
%46 = select <8 x i1> %45, <8 x i8> <i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66, i8 66>, <8 x i8> %44
store <8 x i8> %46, ptr %42, align 8, !tbaa !9
%index.next409 = add nuw i64 %index406, 8
%vec.ind.next408 = add <8 x i32> %vec.ind407, <i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8>
%47 = icmp eq i64 %index.next409, %n.vec403
br i1 %47, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !19
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n405 = icmp eq i64 %n.vec403, %wide.trip.count
br i1 %cmp.n405, label %for.cond57.preheader, label %for.body37.preheader
for.body37.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv287.ph = phi i64 [ 0, %iter.check ], [ %n.vec396, %vec.epilog.iter.check ], [ %n.vec403, %vec.epilog.middle.block ]
br label %for.body37
for.body15: ; preds = %for.body15.preheader, %for.body15
%indvars.iv282 = phi i64 [ %indvars.iv.next283, %for.body15 ], [ %indvars.iv282.ph, %for.body15.preheader ]
%48 = trunc i64 %indvars.iv282 to i32
%rem16 = urem i32 %48, 3
%arrayidx29 = getelementptr inbounds [3000 x i8], ptr %e, i64 0, i64 %indvars.iv282
%switch.selectcmp336 = icmp eq i32 %rem16, 1
%switch.select337 = select i1 %switch.selectcmp336, i8 66, i8 82
%switch.selectcmp338 = icmp eq i32 %rem16, 0
%switch.select339 = select i1 %switch.selectcmp338, i8 71, i8 %switch.select337
store i8 %switch.select339, ptr %arrayidx29, align 1, !tbaa !9
%indvars.iv.next283 = add nuw nsw i64 %indvars.iv282, 1
%exitcond286.not = icmp eq i64 %indvars.iv.next283, %wide.trip.count285
br i1 %exitcond286.not, label %for.cond35.preheader, label %for.body15, !llvm.loop !20
for.cond57.preheader: ; preds = %for.body37, %middle.block389, %vec.epilog.middle.block, %while.body, %for.cond13.preheader, %for.cond35.preheader
%49 = load i32, ptr %m, align 4, !tbaa !5
%sub = sub nsw i32 %49, %1
%cmp58.not250 = icmp slt i32 %sub, 0
br i1 %cmp58.not250, label %if.else169, label %for.cond60.preheader.lr.ph
for.cond60.preheader.lr.ph: ; preds = %for.cond57.preheader
%50 = zext i32 %sub to i64
%51 = add i32 %49, 1
%52 = sub i32 %51, %1
%wide.trip.count300 = zext i32 %52 to i64
%wide.trip.count296 = zext i32 %1 to i64
%min.iters.check372 = icmp ult i32 %1, 8
%n.vec375 = and i64 %wide.trip.count296, 4294967288
%cmp.n377 = icmp eq i64 %n.vec375, %wide.trip.count296
br label %for.cond60.preheader
for.body37: ; preds = %for.body37.preheader, %for.body37
%indvars.iv287 = phi i64 [ %indvars.iv.next288, %for.body37 ], [ %indvars.iv287.ph, %for.body37.preheader ]
%53 = trunc i64 %indvars.iv287 to i32
%rem38 = urem i32 %53, 3
%arrayidx51 = getelementptr inbounds [3000 x i8], ptr %f, i64 0, i64 %indvars.iv287
%switch.selectcmp340 = icmp eq i32 %rem38, 1
%switch.select341 = select i1 %switch.selectcmp340, i8 82, i8 71
%switch.selectcmp342 = icmp eq i32 %rem38, 0
%switch.select343 = select i1 %switch.selectcmp342, i8 66, i8 %switch.select341
store i8 %switch.select343, ptr %arrayidx51, align 1, !tbaa !9
%indvars.iv.next288 = add nuw nsw i64 %indvars.iv287, 1
%exitcond291.not = icmp eq i64 %indvars.iv.next288, %wide.trip.count290
br i1 %exitcond291.not, label %for.cond57.preheader, label %for.body37, !llvm.loop !21
for.cond57: ; preds = %for.end75
%indvars.iv.next299 = add nuw nsw i64 %indvars.iv298, 1
%cmp58.not = icmp uge i64 %indvars.iv298, %50
%exitcond301 = icmp eq i64 %indvars.iv.next299, %wide.trip.count300
br i1 %exitcond301, label %for.end86, label %for.cond60.preheader, !llvm.loop !22
for.cond60.preheader: ; preds = %for.cond60.preheader.lr.ph, %for.cond57
%indvars.iv298 = phi i64 [ 0, %for.cond60.preheader.lr.ph ], [ %indvars.iv.next299, %for.cond57 ]
%cmp58.not253 = phi i1 [ false, %for.cond60.preheader.lr.ph ], [ %cmp58.not, %for.cond57 ]
%j.0251 = phi i32 [ 3000, %for.cond60.preheader.lr.ph ], [ %spec.select228, %for.cond57 ]
br i1 %cmp240, label %for.body62.preheader, label %for.end75
for.body62.preheader: ; preds = %for.cond60.preheader
br i1 %min.iters.check372, label %for.body62.preheader484, label %vector.body378
vector.body378: ; preds = %for.body62.preheader, %vector.body378
%index379 = phi i64 [ %index.next386, %vector.body378 ], [ 0, %for.body62.preheader ]
%vec.phi380 = phi <4 x i32> [ %63, %vector.body378 ], [ zeroinitializer, %for.body62.preheader ]
%vec.phi381 = phi <4 x i32> [ %64, %vector.body378 ], [ zeroinitializer, %for.body62.preheader ]
%54 = getelementptr inbounds [3000 x i8], ptr %d, i64 0, i64 %index379
%wide.load382 = load <4 x i8>, ptr %54, align 8, !tbaa !9
%55 = getelementptr inbounds i8, ptr %54, i64 4
%wide.load383 = load <4 x i8>, ptr %55, align 4, !tbaa !9
%56 = add nuw nsw i64 %index379, %indvars.iv298
%57 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %56
%wide.load384 = load <4 x i8>, ptr %57, align 1, !tbaa !9
%58 = getelementptr inbounds i8, ptr %57, i64 4
%wide.load385 = load <4 x i8>, ptr %58, align 1, !tbaa !9
%59 = icmp ne <4 x i8> %wide.load382, %wide.load384
%60 = icmp ne <4 x i8> %wide.load383, %wide.load385
%61 = zext <4 x i1> %59 to <4 x i32>
%62 = zext <4 x i1> %60 to <4 x i32>
%63 = add <4 x i32> %vec.phi380, %61
%64 = add <4 x i32> %vec.phi381, %62
%index.next386 = add nuw i64 %index379, 8
%65 = icmp eq i64 %index.next386, %n.vec375
br i1 %65, label %middle.block370, label %vector.body378, !llvm.loop !23
middle.block370: ; preds = %vector.body378
%bin.rdx387 = add <4 x i32> %64, %63
%66 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx387)
br i1 %cmp.n377, label %for.end75, label %for.body62.preheader484
for.body62.preheader484: ; preds = %for.body62.preheader, %middle.block370
%indvars.iv292.ph = phi i64 [ 0, %for.body62.preheader ], [ %n.vec375, %middle.block370 ]
%l.0248.ph = phi i32 [ 0, %for.body62.preheader ], [ %66, %middle.block370 ]
br label %for.body62
for.body62: ; preds = %for.body62.preheader484, %for.body62
%indvars.iv292 = phi i64 [ %indvars.iv.next293, %for.body62 ], [ %indvars.iv292.ph, %for.body62.preheader484 ]
%l.0248 = phi i32 [ %spec.select, %for.body62 ], [ %l.0248.ph, %for.body62.preheader484 ]
%arrayidx64 = getelementptr inbounds [3000 x i8], ptr %d, i64 0, i64 %indvars.iv292
%67 = load i8, ptr %arrayidx64, align 1, !tbaa !9
%68 = add nuw nsw i64 %indvars.iv292, %indvars.iv298
%arrayidx66 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %68
%69 = load i8, ptr %arrayidx66, align 1, !tbaa !9
%cmp68.not = icmp ne i8 %67, %69
%inc71 = zext i1 %cmp68.not to i32
%spec.select = add nuw nsw i32 %l.0248, %inc71
%indvars.iv.next293 = add nuw nsw i64 %indvars.iv292, 1
%exitcond297.not = icmp eq i64 %indvars.iv.next293, %wide.trip.count296
br i1 %exitcond297.not, label %for.end75, label %for.body62, !llvm.loop !24
for.end75: ; preds = %for.body62, %middle.block370, %for.cond60.preheader
%l.0.lcssa = phi i32 [ 0, %for.cond60.preheader ], [ %66, %middle.block370 ], [ %spec.select, %for.body62 ]
%spec.select228 = call i32 @llvm.smin.i32(i32 %l.0.lcssa, i32 %j.0251)
%cmp80 = icmp eq i32 %spec.select228, 0
br i1 %cmp80, label %for.end86, label %for.cond57
for.end86: ; preds = %for.cond57, %for.end75
%cmp58.not.lcssa = phi i1 [ %cmp58.not, %for.cond57 ], [ %cmp58.not253, %for.end75 ]
br i1 %cmp58.not.lcssa, label %for.cond90.preheader, label %if.then167
for.cond90.preheader: ; preds = %for.end86
br i1 %cmp58.not250, label %if.else169, label %for.cond95.preheader.lr.ph
for.cond95.preheader.lr.ph: ; preds = %for.cond90.preheader
%70 = add i32 %49, 1
%71 = sub i32 %70, %1
%wide.trip.count311 = zext i32 %71 to i64
%wide.trip.count306 = zext i32 %1 to i64
%min.iters.check353 = icmp ult i32 %1, 8
%n.vec356 = and i64 %wide.trip.count296, 4294967288
%cmp.n358 = icmp eq i64 %n.vec356, %wide.trip.count296
br label %for.cond95.preheader
for.cond90: ; preds = %for.end113
%indvars.iv.next309 = add nuw nsw i64 %indvars.iv308, 1
%exitcond312.not = icmp eq i64 %indvars.iv.next309, %wide.trip.count311
br i1 %exitcond312.not, label %for.cond129.preheader, label %for.cond95.preheader, !llvm.loop !25
for.cond129.preheader: ; preds = %for.cond90
br i1 %cmp58.not250, label %if.else169, label %for.cond134.preheader.lr.ph
for.cond134.preheader.lr.ph: ; preds = %for.cond129.preheader
%72 = add i32 %49, 1
%73 = sub i32 %72, %1
%wide.trip.count322 = zext i32 %73 to i64
%wide.trip.count317 = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
%n.vec = and i64 %wide.trip.count296, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count296
br label %for.cond134.preheader
for.cond95.preheader: ; preds = %for.cond95.preheader.lr.ph, %for.cond90
%indvars.iv308 = phi i64 [ 0, %for.cond95.preheader.lr.ph ], [ %indvars.iv.next309, %for.cond90 ]
%j.3265 = phi i32 [ %spec.select228, %for.cond95.preheader.lr.ph ], [ %spec.select230, %for.cond90 ]
br i1 %cmp240, label %for.body98.preheader, label %for.end113
for.body98.preheader: ; preds = %for.cond95.preheader
br i1 %min.iters.check353, label %for.body98.preheader483, label %vector.body359
vector.body359: ; preds = %for.body98.preheader, %vector.body359
%index360 = phi i64 [ %index.next367, %vector.body359 ], [ 0, %for.body98.preheader ]
%vec.phi361 = phi <4 x i32> [ %83, %vector.body359 ], [ zeroinitializer, %for.body98.preheader ]
%vec.phi362 = phi <4 x i32> [ %84, %vector.body359 ], [ zeroinitializer, %for.body98.preheader ]
%74 = getelementptr inbounds [3000 x i8], ptr %e, i64 0, i64 %index360
%wide.load363 = load <4 x i8>, ptr %74, align 8, !tbaa !9
%75 = getelementptr inbounds i8, ptr %74, i64 4
%wide.load364 = load <4 x i8>, ptr %75, align 4, !tbaa !9
%76 = add nuw nsw i64 %index360, %indvars.iv308
%77 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %76
%wide.load365 = load <4 x i8>, ptr %77, align 1, !tbaa !9
%78 = getelementptr inbounds i8, ptr %77, i64 4
%wide.load366 = load <4 x i8>, ptr %78, align 1, !tbaa !9
%79 = icmp ne <4 x i8> %wide.load363, %wide.load365
%80 = icmp ne <4 x i8> %wide.load364, %wide.load366
%81 = zext <4 x i1> %79 to <4 x i32>
%82 = zext <4 x i1> %80 to <4 x i32>
%83 = add <4 x i32> %vec.phi361, %81
%84 = add <4 x i32> %vec.phi362, %82
%index.next367 = add nuw i64 %index360, 8
%85 = icmp eq i64 %index.next367, %n.vec356
br i1 %85, label %middle.block351, label %vector.body359, !llvm.loop !26
middle.block351: ; preds = %vector.body359
%bin.rdx368 = add <4 x i32> %84, %83
%86 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx368)
br i1 %cmp.n358, label %for.end113, label %for.body98.preheader483
for.body98.preheader483: ; preds = %for.body98.preheader, %middle.block351
%indvars.iv302.ph = phi i64 [ 0, %for.body98.preheader ], [ %n.vec356, %middle.block351 ]
%l.2262.ph = phi i32 [ 0, %for.body98.preheader ], [ %86, %middle.block351 ]
br label %for.body98
for.body98: ; preds = %for.body98.preheader483, %for.body98
%indvars.iv302 = phi i64 [ %indvars.iv.next303, %for.body98 ], [ %indvars.iv302.ph, %for.body98.preheader483 ]
%l.2262 = phi i32 [ %spec.select229, %for.body98 ], [ %l.2262.ph, %for.body98.preheader483 ]
%arrayidx100 = getelementptr inbounds [3000 x i8], ptr %e, i64 0, i64 %indvars.iv302
%87 = load i8, ptr %arrayidx100, align 1, !tbaa !9
%88 = add nuw nsw i64 %indvars.iv302, %indvars.iv308
%arrayidx104 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %88
%89 = load i8, ptr %arrayidx104, align 1, !tbaa !9
%cmp106.not = icmp ne i8 %87, %89
%inc109 = zext i1 %cmp106.not to i32
%spec.select229 = add nuw nsw i32 %l.2262, %inc109
%indvars.iv.next303 = add nuw nsw i64 %indvars.iv302, 1
%exitcond307.not = icmp eq i64 %indvars.iv.next303, %wide.trip.count306
br i1 %exitcond307.not, label %for.end113, label %for.body98, !llvm.loop !27
for.end113: ; preds = %for.body98, %middle.block351, %for.cond95.preheader
%l.2.lcssa = phi i32 [ 0, %for.cond95.preheader ], [ %86, %middle.block351 ], [ %spec.select229, %for.body98 ]
%spec.select230 = call i32 @llvm.smin.i32(i32 %l.2.lcssa, i32 %j.3265)
%cmp118 = icmp eq i32 %spec.select230, 0
br i1 %cmp118, label %if.then167, label %for.cond90
for.cond129: ; preds = %for.end152
%indvars.iv.next320 = add nuw nsw i64 %indvars.iv319, 1
%exitcond323.not = icmp eq i64 %indvars.iv.next320, %wide.trip.count322
br i1 %exitcond323.not, label %if.else169, label %for.cond134.preheader, !llvm.loop !28
for.cond134.preheader: ; preds = %for.cond134.preheader.lr.ph, %for.cond129
%indvars.iv319 = phi i64 [ 0, %for.cond134.preheader.lr.ph ], [ %indvars.iv.next320, %for.cond129 ]
%j.6273 = phi i32 [ %spec.select230, %for.cond134.preheader.lr.ph ], [ %spec.select232, %for.cond129 ]
br i1 %cmp240, label %for.body137.preheader, label %for.end152
for.body137.preheader: ; preds = %for.cond134.preheader
br i1 %min.iters.check, label %for.body137.preheader482, label %vector.body
vector.body: ; preds = %for.body137.preheader, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body137.preheader ]
%vec.phi = phi <4 x i32> [ %99, %vector.body ], [ zeroinitializer, %for.body137.preheader ]
%vec.phi347 = phi <4 x i32> [ %100, %vector.body ], [ zeroinitializer, %for.body137.preheader ]
%90 = getelementptr inbounds [3000 x i8], ptr %f, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %90, align 8, !tbaa !9
%91 = getelementptr inbounds i8, ptr %90, i64 4
%wide.load348 = load <4 x i8>, ptr %91, align 4, !tbaa !9
%92 = add nuw nsw i64 %index, %indvars.iv319
%93 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %92
%wide.load349 = load <4 x i8>, ptr %93, align 1, !tbaa !9
%94 = getelementptr inbounds i8, ptr %93, i64 4
%wide.load350 = load <4 x i8>, ptr %94, align 1, !tbaa !9
%95 = icmp ne <4 x i8> %wide.load, %wide.load349
%96 = icmp ne <4 x i8> %wide.load348, %wide.load350
%97 = zext <4 x i1> %95 to <4 x i32>
%98 = zext <4 x i1> %96 to <4 x i32>
%99 = add <4 x i32> %vec.phi, %97
%100 = add <4 x i32> %vec.phi347, %98
%index.next = add nuw i64 %index, 8
%101 = icmp eq i64 %index.next, %n.vec
br i1 %101, label %middle.block, label %vector.body, !llvm.loop !29
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %100, %99
%102 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.end152, label %for.body137.preheader482
for.body137.preheader482: ; preds = %for.body137.preheader, %middle.block
%indvars.iv313.ph = phi i64 [ 0, %for.body137.preheader ], [ %n.vec, %middle.block ]
%l.4270.ph = phi i32 [ 0, %for.body137.preheader ], [ %102, %middle.block ]
br label %for.body137
for.body137: ; preds = %for.body137.preheader482, %for.body137
%indvars.iv313 = phi i64 [ %indvars.iv.next314, %for.body137 ], [ %indvars.iv313.ph, %for.body137.preheader482 ]
%l.4270 = phi i32 [ %spec.select231, %for.body137 ], [ %l.4270.ph, %for.body137.preheader482 ]
%arrayidx139 = getelementptr inbounds [3000 x i8], ptr %f, i64 0, i64 %indvars.iv313
%103 = load i8, ptr %arrayidx139, align 1, !tbaa !9
%104 = add nuw nsw i64 %indvars.iv313, %indvars.iv319
%arrayidx143 = getelementptr inbounds [3000 x i8], ptr %c, i64 0, i64 %104
%105 = load i8, ptr %arrayidx143, align 1, !tbaa !9
%cmp145.not = icmp ne i8 %103, %105
%inc148 = zext i1 %cmp145.not to i32
%spec.select231 = add nuw nsw i32 %l.4270, %inc148
%indvars.iv.next314 = add nuw nsw i64 %indvars.iv313, 1
%exitcond318.not = icmp eq i64 %indvars.iv.next314, %wide.trip.count317
br i1 %exitcond318.not, label %for.end152, label %for.body137, !llvm.loop !30
for.end152: ; preds = %for.body137, %middle.block, %for.cond134.preheader
%l.4.lcssa = phi i32 [ 0, %for.cond134.preheader ], [ %102, %middle.block ], [ %spec.select231, %for.body137 ]
%spec.select232 = call i32 @llvm.smin.i32(i32 %l.4.lcssa, i32 %j.6273)
%cmp157 = icmp eq i32 %spec.select232, 0
br i1 %cmp157, label %if.then167, label %for.cond129
if.then167: ; preds = %for.end113, %for.end152, %for.end86
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end171
if.else169: ; preds = %for.cond129, %for.cond57.preheader, %for.cond90.preheader, %for.cond129.preheader
%j.6.lcssa = phi i32 [ %spec.select230, %for.cond129.preheader ], [ %spec.select228, %for.cond90.preheader ], [ 3000, %for.cond57.preheader ], [ %spec.select232, %for.cond129 ]
%call170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %j.6.lcssa)
br label %if.end171
if.end171: ; preds = %if.else169, %if.then167
%106 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %106, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %106, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !31
while.end: ; preds = %if.end171, %entry
call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %e) #5
call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !12, !13}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11, !13, !12}
!18 = distinct !{!18, !11, !12, !13}
!19 = distinct !{!19, !11, !12, !13}
!20 = distinct !{!20, !11, !13, !12}
!21 = distinct !{!21, !11, !13, !12}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !11, !12, !13}
!24 = distinct !{!24, !11, !13, !12}
!25 = distinct !{!25, !11}
!26 = distinct !{!26, !11, !12, !13}
!27 = distinct !{!27, !11, !13, !12}
!28 = distinct !{!28, !11}
!29 = distinct !{!29, !11, !12, !13}
!30 = distinct !{!30, !11, !13, !12}
!31 = distinct !{!31, !11}
|
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
int main(){
int n,i,x[1000],temp,j;
scanf("%d",&n);
for(i = 0;i < n;i++){
scanf("%d",&x[i]);
}
for (i = 0; i < n - 1; i++) {
for (j = n - 1; j > i; j--) {
if (x[j - 1] > x[j]) {
temp = x[j];
x[j] = x[j - 1];
x[j - 1]= temp;
}
}
}
for (i = 0; i < n ; i++){
printf("%d", x[i]);
if(i != n-1){
printf(" ");
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153442/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153442/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end43
for.cond2.preheader: ; preds = %for.body
%cmp366 = icmp sgt i32 %3, 1
br i1 %cmp366, label %for.cond6.preheader.preheader, label %for.cond30.preheader
for.cond6.preheader.preheader: ; preds = %for.cond2.preheader
%sub = add nsw i32 %3, -1
%1 = zext i32 %3 to i64
%2 = add nsw i64 %1, -1
%wide.trip.count = zext i32 %sub to i64
%arrayidx13.phi.trans.insert = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %2
br label %for.cond6.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond2.preheader, !llvm.loop !9
for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc27
%indvars.iv75 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next76, %for.inc27 ]
%.pre = load i32, ptr %arrayidx13.phi.trans.insert, align 4, !tbaa !5
br label %for.body8
for.cond30.preheader: ; preds = %for.inc27, %for.cond2.preheader
%cmp3168 = icmp sgt i32 %3, 0
br i1 %cmp3168, label %for.body32, label %for.end43
for.body8: ; preds = %for.cond6.preheader, %for.inc25
%5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc25 ]
%indvars.iv72 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next73, %for.inc25 ]
%indvars.iv.next73 = add nsw i64 %indvars.iv72, -1
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next73
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %6, %5
br i1 %cmp14, label %if.then, label %for.inc25
if.then: ; preds = %for.body8
%arrayidx13 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv72
store i32 %6, ptr %arrayidx13, align 4, !tbaa !5
store i32 %5, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc25
for.inc25: ; preds = %for.body8, %if.then
%7 = phi i32 [ %6, %for.body8 ], [ %5, %if.then ]
%cmp7 = icmp sgt i64 %indvars.iv.next73, %indvars.iv75
br i1 %cmp7, label %for.body8, label %for.inc27, !llvm.loop !11
for.inc27: ; preds = %for.inc25
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader, !llvm.loop !12
for.body32: ; preds = %for.cond30.preheader, %for.inc41
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.inc41 ], [ 0, %for.cond30.preheader ]
%arrayidx34 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv78
%8 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%9 = load i32, ptr %n, align 4, !tbaa !5
%sub36 = add nsw i32 %9, -1
%10 = zext i32 %sub36 to i64
%cmp37.not = icmp eq i64 %indvars.iv78, %10
br i1 %cmp37.not, label %for.inc41, label %if.then38
if.then38: ; preds = %for.body32
%putchar62 = call i32 @putchar(i32 32)
%.pre81 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc41
for.inc41: ; preds = %for.body32, %if.then38
%11 = phi i32 [ %9, %for.body32 ], [ %.pre81, %if.then38 ]
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%12 = sext i32 %11 to i64
%cmp31 = icmp slt i64 %indvars.iv.next79, %12
br i1 %cmp31, label %for.body32, label %for.end43, !llvm.loop !13
for.end43: ; preds = %for.inc41, %entry, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int n, i, j, move;
int data[1000];
scanf("%d",&n);
for(i = 0;i < n;i++){
scanf("%d",&data[i]);
}
while(n != 0){
for(j = 1;j < n;j++){
if(data[j-1] < data[j]){
move = data[j-1];
data[j-1] = data[j];
data[j] = move;
}
}
if(n == 1){
printf("%d\n",data[n-1]);
}
else{
printf("%d ",data[n-1]);
}
n = n - 1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153486/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153486/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%data = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %data) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %0, 0
br i1 %cmp47, label %for.body, label %while.cond.preheader
while.cond.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%cmp2.not51 = icmp eq i32 %.lcssa, 0
br i1 %cmp2.not51, label %while.end, label %for.cond3.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9
for.cond3.preheader: ; preds = %while.cond.preheader, %if.end34
%3 = phi i32 [ %sub35, %if.end34 ], [ %.lcssa, %while.cond.preheader ]
%cmp449 = icmp sgt i32 %3, 1
br i1 %cmp449, label %for.body5.preheader, label %for.end23
for.body5.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %3 to i64
%.pre = load i32, ptr %data, align 16, !tbaa !5
%4 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %4, 1
%5 = icmp eq i32 %3, 2
br i1 %5, label %for.end23.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %4, -2
br label %for.body5
for.body5: ; preds = %for.inc21.1, %for.body5.preheader.new
%6 = phi i32 [ %.pre, %for.body5.preheader.new ], [ %11, %for.inc21.1 ]
%indvars.iv54 = phi i64 [ 1, %for.body5.preheader.new ], [ %indvars.iv.next55.1, %for.inc21.1 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc21.1 ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54
%7 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp slt i32 %6, %7
br i1 %cmp10, label %if.then, label %for.inc21
if.then: ; preds = %for.body5
%8 = add nsw i64 %indvars.iv54, -1
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %8
store i32 %7, ptr %arrayidx7, align 4, !tbaa !5
store i32 %6, ptr %arrayidx9, align 4, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.body5, %if.then
%9 = phi i32 [ %7, %for.body5 ], [ %6, %if.then ]
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%arrayidx9.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next55
%10 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %9, %10
br i1 %cmp10.1, label %if.then.1, label %for.inc21.1
if.then.1: ; preds = %for.inc21
%arrayidx7.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54
store i32 %10, ptr %arrayidx7.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx9.1, align 4, !tbaa !5
br label %for.inc21.1
for.inc21.1: ; preds = %if.then.1, %for.inc21
%11 = phi i32 [ %10, %for.inc21 ], [ %9, %if.then.1 ]
%indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 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.end23.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11
for.end23.loopexit.unr-lcssa: ; preds = %for.inc21.1, %for.body5.preheader
%.unr = phi i32 [ %.pre, %for.body5.preheader ], [ %11, %for.inc21.1 ]
%indvars.iv54.unr = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next55.1, %for.inc21.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body5.epil
for.body5.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv54.unr
%12 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%cmp10.epil = icmp slt i32 %.unr, %12
br i1 %cmp10.epil, label %if.then.epil, label %for.end23
if.then.epil: ; preds = %for.body5.epil
%13 = add nsw i64 %indvars.iv54.unr, -1
%arrayidx7.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %13
store i32 %12, ptr %arrayidx7.epil, align 4, !tbaa !5
store i32 %.unr, ptr %arrayidx9.epil, align 4, !tbaa !5
br label %for.end23
for.end23: ; preds = %for.end23.loopexit.unr-lcssa, %if.then.epil, %for.body5.epil, %for.cond3.preheader
%cmp24 = icmp eq i32 %3, 1
br i1 %cmp24, label %if.then25, label %if.else
if.then25: ; preds = %for.end23
%14 = load i32, ptr %data, align 16, !tbaa !5
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
br label %if.end34
if.else: ; preds = %for.end23
%sub30 = add nsw i32 %3, -1
%idxprom31 = sext i32 %sub30 to i64
%arrayidx32 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %idxprom31
%15 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
br label %if.end34
if.end34: ; preds = %if.else, %if.then25
%16 = load i32, ptr %n, align 4, !tbaa !5
%sub35 = add nsw i32 %16, -1
store i32 %sub35, ptr %n, align 4, !tbaa !5
%cmp2.not = icmp eq i32 %sub35, 0
br i1 %cmp2.not, label %while.end, label %for.cond3.preheader, !llvm.loop !12
while.end: ; preds = %if.end34, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %data) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void){
int F,C;
scanf("%d",&F);
C=(F-30)/2;
printf("%d\n",C);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153536/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%F = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %F) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %F)
%0 = load i32, ptr %F, align 4, !tbaa !5
%sub = add nsw i32 %0, -30
%div = sdiv i32 %sub, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %F) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
if(n%2==0)
{
printf("4 %d\n",n-4);
}
else
{
printf("9 %d\n",n-9);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15358/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15358/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"4 %d\0A\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"9 %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%. = select i1 %cmp, i32 -4, i32 -9
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%sub2 = add nsw i32 %0, %.
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %sub2)
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) {
int i,n,m,na,nb,min=114514,s=0;
scanf("%d%d",&n,&m);
for(i = 1;i <= m;i++){
scanf("%d%d",&na,&nb);
if(n > na){s+=(n-na);}
if(min > na){min = na;}
}
printf("%d\n",s-(n-min));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%na = alloca i32, align 4
%nb = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %na) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nb) #4
%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
%cmp.not14 = icmp slt i32 %0, 1
br i1 %cmp.not14, label %entry.for.end_crit_edge, label %for.body
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%s.017 = phi i32 [ %s.1, %for.body ], [ 0, %entry ]
%min.016 = phi i32 [ %min.1, %for.body ], [ 114514, %entry ]
%i.015 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %na, ptr noundef nonnull %nb)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr %na, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
%sub = sub nsw i32 %1, %2
%add = select i1 %cmp2, i32 %sub, i32 0
%s.1 = add nsw i32 %add, %s.017
%min.1 = call i32 @llvm.smin.i32(i32 %min.016, i32 %2)
%inc = add nuw nsw i32 %i.015, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.015, %3
br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = add i32 %s.1, %min.1
br label %for.end
for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit
%5 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %1, %for.end.loopexit ]
%sub6.neg = phi i32 [ 114514, %entry.for.end_crit_edge ], [ %4, %for.end.loopexit ]
%sub7 = sub i32 %sub6.neg, %5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nb) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %na) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
#include <stdbool.h>
int main()
{
int n;
scanf("%d",&n);
int a[n];
int b[n];
int i;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
b[n/2]=a[0];
int e=2;
int o=3;
for(i=n/2;i>0;i--)
{
if(n%2==0)
{
b[i-1]=a[e-1];
e+=2;
}
else
{
b[i-1]=a[o-1];
o+=2;
}
}
e=2;
o=3;
for(i=n/2;i<n;i++)
{
if(n%2==0)
{
b[i+1]=a[o-1];
o+=2;
}
else
{
b[i+1]=a[e-1];
e+=2;
}
}
for(i=0;i<n;i++)
{
printf("%d ",b[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp80 = icmp sgt i32 %3, 0
br i1 %cmp80, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%.nonneg = sub i32 0, %3
%div133139148 = lshr i32 %.nonneg, 1
%div133139.neg = sub nsw i32 0, %div133139148
%idxprom4134 = sext i32 %div133139.neg to i64
br label %for.cond26.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%div = sdiv i32 %5, 2
%idxprom4 = sext i32 %div to i64
%arrayidx5 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom4
store i32 %.pre, ptr %arrayidx5, align 4, !tbaa !5
%cmp882 = icmp sgt i32 %5, 1
br i1 %cmp882, label %for.body9.lr.ph, label %for.cond26.preheader
for.body9.lr.ph: ; preds = %for.end
%7 = and i32 %5, 1
%cmp10 = icmp eq i32 %7, 0
%8 = zext i32 %div to i64
%invariant.gep142 = getelementptr i32, ptr %vla, i64 -1
%9 = add nuw nsw i64 %8, 1
%10 = add i32 %5, -2
%11 = icmp ult i32 %10, -3
%umin163.neg = sext i1 %11 to i64
%12 = add nsw i64 %9, %umin163.neg
%min.iters.check166 = icmp ult i64 %12, 17
br i1 %cmp10, label %for.body9.us.preheader, label %for.body9.preheader
for.body9.preheader: ; preds = %for.body9.lr.ph
br i1 %min.iters.check166, label %for.body9.preheader220, label %vector.scevcheck
for.body9.preheader220: ; preds = %vector.body, %vector.scevcheck, %for.body9.preheader
%indvars.iv99.ph = phi i64 [ %8, %vector.scevcheck ], [ %8, %for.body9.preheader ], [ %ind.end, %vector.body ]
%indvars.iv96.ph = phi i64 [ 3, %vector.scevcheck ], [ 3, %for.body9.preheader ], [ %ind.end152, %vector.body ]
br label %for.body9
vector.scevcheck: ; preds = %for.body9.preheader
%13 = add i32 %5, -2
%14 = icmp ult i32 %13, -3
%umin.neg = sext i1 %14 to i64
%15 = add nsw i64 %umin.neg, %8
%16 = add nsw i32 %div, -1
%17 = trunc i64 %15 to i32
%18 = icmp ult i32 %16, %17
%19 = icmp ugt i64 %15, 4294967295
%20 = or i1 %18, %19
br i1 %20, label %for.body9.preheader220, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.mod.vf = and i64 %12, 7
%21 = icmp eq i64 %n.mod.vf, 0
%22 = select i1 %21, i64 8, i64 %n.mod.vf
%n.vec = sub nsw i64 %12, %22
%ind.end = sub nsw i64 %8, %n.vec
%23 = shl nsw i64 %n.vec, 1
%ind.end152 = add nsw i64 %23, 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%24 = shl i64 %index, 1
%offset.idx = or i64 %24, 3
%25 = or i64 %24, 11
%offset.idx154 = sub i64 %8, %index
%26 = getelementptr i32, ptr %invariant.gep142, i64 %offset.idx
%27 = getelementptr i32, ptr %invariant.gep142, i64 %25
%wide.vec = load <8 x i32>, ptr %26, align 8, !tbaa !5
%wide.vec155 = load <8 x i32>, ptr %27, align 8, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec156 = shufflevector <8 x i32> %wide.vec155, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%28 = add nuw i64 %offset.idx154, 4294967295
%29 = and i64 %28, 4294967295
%30 = getelementptr inbounds i32, ptr %vla1, i64 %29
%reverse = shufflevector <4 x i32> %strided.vec, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%31 = getelementptr inbounds i32, ptr %30, i64 -3
store <4 x i32> %reverse, ptr %31, align 4, !tbaa !5
%reverse157 = shufflevector <4 x i32> %strided.vec156, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%32 = getelementptr inbounds i32, ptr %30, i64 -7
store <4 x i32> %reverse157, ptr %32, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%33 = icmp eq i64 %index.next, %n.vec
br i1 %33, label %for.body9.preheader220, label %vector.body, !llvm.loop !11
for.body9.us.preheader: ; preds = %for.body9.lr.ph
br i1 %min.iters.check166, label %for.body9.us.preheader219, label %vector.scevcheck158
vector.scevcheck158: ; preds = %for.body9.us.preheader
%34 = add i32 %5, -2
%35 = icmp ult i32 %34, -3
%umin159.neg = sext i1 %35 to i64
%36 = add nsw i64 %umin159.neg, %8
%37 = add nsw i32 %div, -1
%38 = trunc i64 %36 to i32
%39 = icmp ult i32 %37, %38
%40 = icmp ugt i64 %36, 4294967295
%41 = or i1 %39, %40
br i1 %41, label %for.body9.us.preheader219, label %vector.ph167
vector.ph167: ; preds = %vector.scevcheck158
%n.mod.vf168 = and i64 %12, 7
%42 = icmp eq i64 %n.mod.vf168, 0
%43 = select i1 %42, i64 8, i64 %n.mod.vf168
%n.vec169 = sub nsw i64 %12, %43
%ind.end170 = sub nsw i64 %8, %n.vec169
%44 = shl nsw i64 %n.vec169, 1
%ind.end172 = add nsw i64 %44, 2
br label %vector.body174
vector.body174: ; preds = %vector.body174, %vector.ph167
%index175 = phi i64 [ 0, %vector.ph167 ], [ %index.next184, %vector.body174 ]
%45 = shl i64 %index175, 1
%offset.idx176 = or i64 %45, 2
%46 = or i64 %45, 10
%offset.idx177 = sub i64 %8, %index175
%47 = getelementptr i32, ptr %invariant.gep142, i64 %offset.idx176
%48 = getelementptr i32, ptr %invariant.gep142, i64 %46
%wide.vec178 = load <8 x i32>, ptr %47, align 4, !tbaa !5
%wide.vec179 = load <8 x i32>, ptr %48, align 4, !tbaa !5
%strided.vec180 = shufflevector <8 x i32> %wide.vec178, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec181 = shufflevector <8 x i32> %wide.vec179, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%49 = add nuw i64 %offset.idx177, 4294967295
%50 = and i64 %49, 4294967295
%51 = getelementptr inbounds i32, ptr %vla1, i64 %50
%reverse182 = shufflevector <4 x i32> %strided.vec180, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%52 = getelementptr inbounds i32, ptr %51, i64 -3
store <4 x i32> %reverse182, ptr %52, align 4, !tbaa !5
%reverse183 = shufflevector <4 x i32> %strided.vec181, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%53 = getelementptr inbounds i32, ptr %51, i64 -7
store <4 x i32> %reverse183, ptr %53, align 4, !tbaa !5
%index.next184 = add nuw i64 %index175, 8
%54 = icmp eq i64 %index.next184, %n.vec169
br i1 %54, label %for.body9.us.preheader219, label %vector.body174, !llvm.loop !14
for.body9.us.preheader219: ; preds = %vector.body174, %vector.scevcheck158, %for.body9.us.preheader
%indvars.iv107.ph = phi i64 [ %8, %vector.scevcheck158 ], [ %8, %for.body9.us.preheader ], [ %ind.end170, %vector.body174 ]
%indvars.iv104.ph = phi i64 [ 2, %vector.scevcheck158 ], [ 2, %for.body9.us.preheader ], [ %ind.end172, %vector.body174 ]
br label %for.body9.us
for.body9.us: ; preds = %for.body9.us.preheader219, %for.body9.us
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.body9.us ], [ %indvars.iv107.ph, %for.body9.us.preheader219 ]
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body9.us ], [ %indvars.iv104.ph, %for.body9.us.preheader219 ]
%gep143 = getelementptr i32, ptr %invariant.gep142, i64 %indvars.iv104
%55 = load i32, ptr %gep143, align 4, !tbaa !5
%sub13.us = add nuw i64 %indvars.iv107, 4294967295
%idxprom14.us = and i64 %sub13.us, 4294967295
%arrayidx15.us = getelementptr inbounds i32, ptr %vla1, i64 %idxprom14.us
store i32 %55, ptr %arrayidx15.us, align 4, !tbaa !5
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 2
%indvars.iv.next108 = add nsw i64 %indvars.iv107, -1
%cmp8.us = icmp ugt i64 %indvars.iv107, 1
br i1 %cmp8.us, label %for.body9.us, label %for.cond26.preheader, !llvm.loop !15
for.cond26.preheader: ; preds = %for.body9, %for.body9.us, %for.end.thread, %for.end
%idxprom4138 = phi i64 [ %idxprom4134, %for.end.thread ], [ %idxprom4, %for.end ], [ %idxprom4, %for.body9.us ], [ %idxprom4, %for.body9 ]
%div137 = phi i32 [ %div133139.neg, %for.end.thread ], [ %div, %for.end ], [ %div, %for.body9.us ], [ %div, %for.body9 ]
%56 = phi i32 [ %3, %for.end.thread ], [ %5, %for.end ], [ %5, %for.body9.us ], [ %5, %for.body9 ]
%cmp2786 = icmp slt i32 %div137, %56
br i1 %cmp2786, label %for.body28.lr.ph, label %for.cond51.preheader
for.body28.lr.ph: ; preds = %for.cond26.preheader
%57 = and i32 %56, 1
%cmp30 = icmp eq i32 %57, 0
%wide.trip.count128 = sext i32 %56 to i64
%invariant.gep146 = getelementptr i32, ptr %vla, i64 -1
%58 = sub nsw i64 %wide.trip.count128, %idxprom4138
%min.iters.check202 = icmp ult i64 %58, 8
br i1 %cmp30, label %for.body28.us.preheader, label %for.body28.preheader
for.body28.preheader: ; preds = %for.body28.lr.ph
br i1 %min.iters.check202, label %for.body28.preheader217, label %vector.ph188
vector.ph188: ; preds = %for.body28.preheader
%n.vec190 = and i64 %58, -8
%ind.end191 = add nsw i64 %idxprom4138, %n.vec190
%59 = shl nsw i64 %n.vec190, 1
%ind.end193 = or i64 %59, 2
%invariant.gep = getelementptr i32, ptr %invariant.gep146, i64 16
%60 = getelementptr i32, ptr %vla1, i64 %idxprom4138
br label %vector.body195
vector.body195: ; preds = %vector.body195, %vector.ph188
%index196 = phi i64 [ 0, %vector.ph188 ], [ %index.next199, %vector.body195 ]
%61 = shl i64 %index196, 1
%offset.idx197 = or i64 %61, 2
%62 = or i64 %61, 4
%63 = or i64 %61, 6
%64 = or i64 %61, 8
%65 = or i64 %61, 10
%66 = or i64 %61, 12
%67 = or i64 %61, 14
%68 = getelementptr i32, ptr %invariant.gep146, i64 %offset.idx197
%69 = getelementptr i32, ptr %invariant.gep146, i64 %62
%70 = getelementptr i32, ptr %invariant.gep146, i64 %63
%71 = getelementptr i32, ptr %invariant.gep146, i64 %64
%72 = getelementptr i32, ptr %invariant.gep146, i64 %65
%73 = getelementptr i32, ptr %invariant.gep146, i64 %66
%74 = getelementptr i32, ptr %invariant.gep146, i64 %67
%gep222 = getelementptr i32, ptr %invariant.gep, i64 %61
%75 = load i32, ptr %68, align 4, !tbaa !5
%76 = load i32, ptr %69, align 4, !tbaa !5
%77 = load i32, ptr %70, align 4, !tbaa !5
%78 = load i32, ptr %71, align 4, !tbaa !5
%79 = insertelement <4 x i32> poison, i32 %75, i64 0
%80 = insertelement <4 x i32> %79, i32 %76, i64 1
%81 = insertelement <4 x i32> %80, i32 %77, i64 2
%82 = insertelement <4 x i32> %81, i32 %78, i64 3
%83 = load i32, ptr %72, align 4, !tbaa !5
%84 = load i32, ptr %73, align 4, !tbaa !5
%85 = load i32, ptr %74, align 4, !tbaa !5
%86 = load i32, ptr %gep222, align 4, !tbaa !5
%87 = insertelement <4 x i32> poison, i32 %83, i64 0
%88 = insertelement <4 x i32> %87, i32 %84, i64 1
%89 = insertelement <4 x i32> %88, i32 %85, i64 2
%90 = insertelement <4 x i32> %89, i32 %86, i64 3
%91 = getelementptr i32, ptr %60, i64 %index196
%92 = getelementptr i32, ptr %91, i64 1
store <4 x i32> %82, ptr %92, align 4, !tbaa !5
%93 = getelementptr i32, ptr %91, i64 5
store <4 x i32> %90, ptr %93, align 4, !tbaa !5
%index.next199 = add nuw i64 %index196, 8
%94 = icmp eq i64 %index.next199, %n.vec190
br i1 %94, label %middle.block185, label %vector.body195, !llvm.loop !16
middle.block185: ; preds = %vector.body195
%cmp.n = icmp eq i64 %58, %n.vec190
br i1 %cmp.n, label %for.cond51.preheader, label %for.body28.preheader217
for.body28.preheader217: ; preds = %for.body28.preheader, %middle.block185
%indvars.iv115.ph = phi i64 [ %idxprom4138, %for.body28.preheader ], [ %ind.end191, %middle.block185 ]
%indvars.iv112.ph = phi i64 [ 2, %for.body28.preheader ], [ %ind.end193, %middle.block185 ]
br label %for.body28
for.body28.us.preheader: ; preds = %for.body28.lr.ph
br i1 %min.iters.check202, label %for.body28.us.preheader216, label %vector.ph203
vector.ph203: ; preds = %for.body28.us.preheader
%n.vec205 = and i64 %58, -8
%ind.end206 = add nsw i64 %idxprom4138, %n.vec205
%95 = shl nsw i64 %n.vec205, 1
%ind.end208 = or i64 %95, 3
%invariant.gep223 = getelementptr i32, ptr %invariant.gep146, i64 17
%96 = getelementptr i32, ptr %vla1, i64 %idxprom4138
br label %vector.body211
vector.body211: ; preds = %vector.body211, %vector.ph203
%index212 = phi i64 [ 0, %vector.ph203 ], [ %index.next215, %vector.body211 ]
%97 = shl i64 %index212, 1
%offset.idx213 = or i64 %97, 3
%98 = or i64 %97, 5
%99 = or i64 %97, 7
%100 = or i64 %97, 9
%101 = or i64 %97, 11
%102 = or i64 %97, 13
%103 = or i64 %97, 15
%104 = getelementptr i32, ptr %invariant.gep146, i64 %offset.idx213
%105 = getelementptr i32, ptr %invariant.gep146, i64 %98
%106 = getelementptr i32, ptr %invariant.gep146, i64 %99
%107 = getelementptr i32, ptr %invariant.gep146, i64 %100
%108 = getelementptr i32, ptr %invariant.gep146, i64 %101
%109 = getelementptr i32, ptr %invariant.gep146, i64 %102
%110 = getelementptr i32, ptr %invariant.gep146, i64 %103
%gep224 = getelementptr i32, ptr %invariant.gep223, i64 %97
%111 = load i32, ptr %104, align 8, !tbaa !5
%112 = load i32, ptr %105, align 16, !tbaa !5
%113 = load i32, ptr %106, align 8, !tbaa !5
%114 = load i32, ptr %107, align 16, !tbaa !5
%115 = insertelement <4 x i32> poison, i32 %111, i64 0
%116 = insertelement <4 x i32> %115, i32 %112, i64 1
%117 = insertelement <4 x i32> %116, i32 %113, i64 2
%118 = insertelement <4 x i32> %117, i32 %114, i64 3
%119 = load i32, ptr %108, align 8, !tbaa !5
%120 = load i32, ptr %109, align 16, !tbaa !5
%121 = load i32, ptr %110, align 8, !tbaa !5
%122 = load i32, ptr %gep224, align 16, !tbaa !5
%123 = insertelement <4 x i32> poison, i32 %119, i64 0
%124 = insertelement <4 x i32> %123, i32 %120, i64 1
%125 = insertelement <4 x i32> %124, i32 %121, i64 2
%126 = insertelement <4 x i32> %125, i32 %122, i64 3
%127 = getelementptr i32, ptr %96, i64 %index212
%128 = getelementptr i32, ptr %127, i64 1
store <4 x i32> %118, ptr %128, align 4, !tbaa !5
%129 = getelementptr i32, ptr %127, i64 5
store <4 x i32> %126, ptr %129, align 4, !tbaa !5
%index.next215 = add nuw i64 %index212, 8
%130 = icmp eq i64 %index.next215, %n.vec205
br i1 %130, label %middle.block200, label %vector.body211, !llvm.loop !17
middle.block200: ; preds = %vector.body211
%cmp.n210 = icmp eq i64 %58, %n.vec205
br i1 %cmp.n210, label %for.cond51.preheader, label %for.body28.us.preheader216
for.body28.us.preheader216: ; preds = %for.body28.us.preheader, %middle.block200
%indvars.iv123.ph = phi i64 [ %idxprom4138, %for.body28.us.preheader ], [ %ind.end206, %middle.block200 ]
%indvars.iv120.ph = phi i64 [ 3, %for.body28.us.preheader ], [ %ind.end208, %middle.block200 ]
br label %for.body28.us
for.body28.us: ; preds = %for.body28.us.preheader216, %for.body28.us
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.body28.us ], [ %indvars.iv123.ph, %for.body28.us.preheader216 ]
%indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.body28.us ], [ %indvars.iv120.ph, %for.body28.us.preheader216 ]
%gep147 = getelementptr i32, ptr %invariant.gep146, i64 %indvars.iv120
%131 = load i32, ptr %gep147, align 4, !tbaa !5
%indvars.iv.next124 = add nsw i64 %indvars.iv123, 1
%arrayidx37.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next124
store i32 %131, ptr %arrayidx37.us, align 4, !tbaa !5
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 2
%exitcond129.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count128
br i1 %exitcond129.not, label %for.cond51.preheader, label %for.body28.us, !llvm.loop !18
for.body9: ; preds = %for.body9.preheader220, %for.body9
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body9 ], [ %indvars.iv99.ph, %for.body9.preheader220 ]
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body9 ], [ %indvars.iv96.ph, %for.body9.preheader220 ]
%gep = getelementptr i32, ptr %invariant.gep142, i64 %indvars.iv96
%132 = load i32, ptr %gep, align 4, !tbaa !5
%sub19 = add nuw i64 %indvars.iv99, 4294967295
%idxprom20 = and i64 %sub19, 4294967295
%arrayidx21 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom20
store i32 %132, ptr %arrayidx21, align 4, !tbaa !5
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 2
%indvars.iv.next100 = add nsw i64 %indvars.iv99, -1
%cmp8 = icmp ugt i64 %indvars.iv99, 1
br i1 %cmp8, label %for.body9, label %for.cond26.preheader, !llvm.loop !19
for.cond51.preheader: ; preds = %for.body28, %for.body28.us, %middle.block185, %middle.block200, %for.cond26.preheader
%cmp5290 = icmp sgt i32 %56, 0
br i1 %cmp5290, label %for.body53, label %for.end59
for.body28: ; preds = %for.body28.preheader217, %for.body28
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body28 ], [ %indvars.iv115.ph, %for.body28.preheader217 ]
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body28 ], [ %indvars.iv112.ph, %for.body28.preheader217 ]
%gep145 = getelementptr i32, ptr %invariant.gep146, i64 %indvars.iv112
%133 = load i32, ptr %gep145, align 4, !tbaa !5
%indvars.iv.next116 = add nsw i64 %indvars.iv115, 1
%arrayidx45 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next116
store i32 %133, ptr %arrayidx45, align 4, !tbaa !5
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 2
%exitcond.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count128
br i1 %exitcond.not, label %for.cond51.preheader, label %for.body28, !llvm.loop !20
for.body53: ; preds = %for.cond51.preheader, %for.body53
%indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.body53 ], [ 0, %for.cond51.preheader ]
%arrayidx55 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv130
%134 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %134)
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%135 = load i32, ptr %n, align 4, !tbaa !5
%136 = sext i32 %135 to i64
%cmp52 = icmp slt i64 %indvars.iv.next131, %136
br i1 %cmp52, label %for.body53, label %for.end59, !llvm.loop !21
for.end59: ; preds = %for.body53, %for.cond51.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !12}
!16 = distinct !{!16, !10, !12, !13}
!17 = distinct !{!17, !10, !12, !13}
!18 = distinct !{!18, !10, !13, !12}
!19 = distinct !{!19, !10, !12}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10}
|
#include <stdio.h>
#define REP(i, a, b) for(long long int i = a; i < b; i++)
int main(void) {
int n;
scanf("%d", &n);
int a[n];
REP(i, 0, n) {
scanf("%d", &a[i]);
}
for (int i = n - 1; i >= 0; i -= 2) {
printf("%d ", a[i]);
}
for (int i = n % 2; i < n; i += 2) {
printf("%d ", a[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %3, 0
br i1 %cmp32, label %for.body, label %for.cond.cleanup7
for.cond.cleanup: ; preds = %for.body
%cmp534 = icmp sgt i32 %4, 0
br i1 %cmp534, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond.cleanup
%sub = add nsw i32 %4, -1
br label %for.body8
for.body: ; preds = %entry, %for.body
%i.033 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %i.033
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.033, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %4 to i64
%cmp = icmp slt i64 %inc, %conv
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup7.loopexit: ; preds = %for.body8
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup7
for.cond.cleanup7: ; preds = %entry, %for.cond.cleanup7.loopexit, %for.cond.cleanup
%5 = phi i32 [ %.pre, %for.cond.cleanup7.loopexit ], [ %4, %for.cond.cleanup ], [ %3, %entry ]
%rem = srem i32 %5, 2
%cmp1636 = icmp slt i32 %rem, %5
br i1 %cmp1636, label %for.body19.preheader, label %for.cond.cleanup18
for.body19.preheader: ; preds = %for.cond.cleanup7
%6 = sext i32 %rem to i64
br label %for.body19
for.body8: ; preds = %for.body8.preheader, %for.body8
%i3.035 = phi i32 [ %sub12, %for.body8 ], [ %sub, %for.body8.preheader ]
%idxprom = zext i32 %i3.035 to i64
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom
%7 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%sub12 = add nsw i32 %i3.035, -2
%cmp5 = icmp ugt i32 %i3.035, 1
br i1 %cmp5, label %for.body8, label %for.cond.cleanup7.loopexit, !llvm.loop !11
for.cond.cleanup18: ; preds = %for.body19, %for.cond.cleanup7
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body19: ; preds = %for.body19.preheader, %for.body19
%indvars.iv = phi i64 [ %6, %for.body19.preheader ], [ %indvars.iv.next, %for.body19 ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%8 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%indvars.iv.next = add nsw i64 %indvars.iv, 2
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp16 = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp16, label %for.body19, label %for.cond.cleanup18, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int n,i,j;
scanf("%d", &n);
int data[n];
for(i = 0;i < n;i++){
scanf("%d", &data[i]);
}
j = n - 1;
for(i = 0;i <= (n-1)/2;i++){
printf("%d ",data[j]);
j = j - 2;
}
if(n % 2 == 0) j = 0;
if(n % 2 == 1) j = 1;
for(i = 0;i < n/2; i++){
printf("%d ",data[j]);
j = j + 2;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153767/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153767/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %3, 0
br i1 %cmp38, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%6 = phi i32 [ %3, %entry ], [ %4, %for.body ]
%cmp4.not42 = icmp slt i32 %6, 0
br i1 %cmp4.not42, label %for.end27, label %for.body5.preheader
for.body5.preheader: ; preds = %for.end
%sub = add i32 %6, -1
%7 = sext i32 %sub to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv54 = phi i64 [ %7, %for.body5.preheader ], [ %indvars.iv.next55, %for.body5 ]
%i.144 = phi i32 [ 0, %for.body5.preheader ], [ %inc11, %for.body5 ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%indvars.iv.next55 = add nsw i64 %indvars.iv54, -2
%inc11 = add nuw nsw i32 %i.144, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%sub3 = add nsw i32 %9, -1
%div = sdiv i32 %sub3, 2
%cmp4.not.not = icmp slt i32 %i.144, %div
br i1 %cmp4.not.not, label %for.body5, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.body5
%cmp2048 = icmp sgt i32 %9, 1
br i1 %cmp2048, label %for.body21.preheader, label %for.end27
for.body21.preheader: ; preds = %for.end12
%10 = and i32 %9, -2147483647
%cmp15 = icmp eq i32 %10, 1
%11 = and i32 %9, 1
%cmp13 = icmp eq i32 %11, 0
%12 = shl i64 %indvars.iv.next55, 32
%13 = ashr exact i64 %12, 32
%14 = select i1 %cmp13, i64 0, i64 %13
%15 = select i1 %cmp15, i64 1, i64 %14
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv57 = phi i64 [ %15, %for.body21.preheader ], [ %indvars.iv.next58, %for.body21 ]
%i.250 = phi i32 [ 0, %for.body21.preheader ], [ %inc26, %for.body21 ]
%arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv57
%16 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
%indvars.iv.next58 = add nsw i64 %indvars.iv57, 2
%inc26 = add nuw nsw i32 %i.250, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%div19 = sdiv i32 %17, 2
%cmp20 = icmp slt i32 %inc26, %div19
br i1 %cmp20, label %for.body21, label %for.end27, !llvm.loop !12
for.end27: ; preds = %for.body21, %for.end, %for.end12
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
int premier (long n) {
long d;
if (n % 2 == 0)
return (n == 2);
for (d = 3; d * d <= n; d = d + 2)
if (n % d == 0)
return 0;
return 1;
}
int main()
{ long n;
int z = 0;
long x=4;
scanf("%ld",&n);
while (x<n || z==0){
if(premier(x)==0 && z==0) { if(premier(n-x)==0) {z=1;
printf("%ld %ld",x,n-x);}}
x++;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%ld %ld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @premier(i64 noundef %n) local_unnamed_addr #0 {
entry:
%0 = and i64 %n, 1
%cmp = icmp eq i64 %0, 0
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp2.not15 = icmp slt i64 %n, 9
br i1 %cmp2.not15, label %cleanup, label %for.body
if.then: ; preds = %entry
%cmp1 = icmp eq i64 %n, 2
%conv = zext i1 %cmp1 to i32
br label %cleanup
for.cond: ; preds = %for.body
%add = add nuw nsw i64 %d.016, 2
%mul = mul nsw i64 %add, %add
%cmp2.not = icmp sgt i64 %mul, %n
br i1 %cmp2.not, label %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.cond.preheader, %for.cond
%d.016 = phi i64 [ %add, %for.cond ], [ 3, %for.cond.preheader ]
%rem4 = srem i64 %n, %d.016
%cmp5 = icmp eq i64 %rem4, 0
br i1 %cmp5, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.then
%retval.0 = phi i32 [ %conv, %if.then ], [ 1, %for.cond.preheader ], [ 0, %for.body ], [ 1, %for.cond ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca 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 !7
br label %while.body
while.body: ; preds = %entry, %if.end10
%1 = phi i64 [ %0, %entry ], [ %4, %if.end10 ]
%cmp146 = phi i1 [ true, %entry ], [ %cmp1, %if.end10 ]
%x.044 = phi i64 [ 4, %entry ], [ %inc, %if.end10 ]
%z.043 = phi i32 [ 0, %entry ], [ %z.1, %if.end10 ]
%2 = and i64 %x.044, 1
%cmp.i = icmp eq i64 %2, 0
br i1 %cmp.i, label %premier.exit, label %for.cond.preheader.i
for.cond.preheader.i: ; preds = %while.body
%cmp2.not15.i = icmp ult i64 %x.044, 9
br i1 %cmp2.not15.i, label %if.end10, label %for.body.i
for.cond.i: ; preds = %for.body.i
%add.i = add nuw nsw i64 %d.016.i, 2
%mul.i = mul nsw i64 %add.i, %add.i
%cmp2.not.i = icmp ugt i64 %mul.i, %x.044
br i1 %cmp2.not.i, label %if.end10, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i
%d.016.i = phi i64 [ %add.i, %for.cond.i ], [ 3, %for.cond.preheader.i ]
%rem4.i = urem i64 %x.044, %d.016.i
%cmp5.i = icmp eq i64 %rem4.i, 0
br i1 %cmp5.i, label %premier.exit, label %for.cond.i
premier.exit: ; preds = %for.body.i, %while.body
br i1 %cmp146, label %if.then, label %if.end10
if.then: ; preds = %premier.exit
%sub = sub nsw i64 %1, %x.044
%3 = and i64 %sub, 1
%cmp.i17 = icmp eq i64 %3, 0
br i1 %cmp.i17, label %premier.exit32, label %for.cond.preheader.i18
for.cond.preheader.i18: ; preds = %if.then
%cmp2.not15.i19 = icmp slt i64 %sub, 9
br i1 %cmp2.not15.i19, label %if.end10, label %for.body.i20
for.cond.i24: ; preds = %for.body.i20
%add.i25 = add nuw nsw i64 %d.016.i21, 2
%mul.i26 = mul nsw i64 %add.i25, %add.i25
%cmp2.not.i27 = icmp sgt i64 %mul.i26, %sub
br i1 %cmp2.not.i27, label %if.end10, label %for.body.i20, !llvm.loop !5
for.body.i20: ; preds = %for.cond.preheader.i18, %for.cond.i24
%d.016.i21 = phi i64 [ %add.i25, %for.cond.i24 ], [ 3, %for.cond.preheader.i18 ]
%rem4.i22 = srem i64 %sub, %d.016.i21
%cmp5.i23 = icmp eq i64 %rem4.i22, 0
br i1 %cmp5.i23, label %if.then7, label %for.cond.i24
premier.exit32: ; preds = %if.then
%cmp1.i30.not = icmp eq i64 %sub, 2
br i1 %cmp1.i30.not, label %if.end10, label %if.then7
if.then7: ; preds = %for.body.i20, %premier.exit32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %x.044, i64 noundef %sub)
%.pre = load i64, ptr %n, align 8, !tbaa !7
br label %if.end10
if.end10: ; preds = %for.cond.i, %for.cond.i24, %for.cond.preheader.i18, %for.cond.preheader.i, %premier.exit32, %if.then7, %premier.exit
%4 = phi i64 [ %.pre, %if.then7 ], [ %1, %premier.exit32 ], [ %1, %premier.exit ], [ %1, %for.cond.preheader.i ], [ %1, %for.cond.preheader.i18 ], [ %1, %for.cond.i24 ], [ %1, %for.cond.i ]
%z.1 = phi i32 [ 1, %if.then7 ], [ 0, %premier.exit32 ], [ %z.043, %premier.exit ], [ %z.043, %for.cond.preheader.i ], [ 0, %for.cond.preheader.i18 ], [ 0, %for.cond.i24 ], [ %z.043, %for.cond.i ]
%inc = add nuw nsw i64 %x.044, 1
%cmp = icmp slt i64 %inc, %4
%cmp1 = icmp eq i32 %z.1, 0
%5 = select i1 %cmp, i1 true, i1 %cmp1
br i1 %5, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %if.end10
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
typedef struct{
int num;
int wa1;
int wa2;
} data;
int main(){
int n,i,num,walk;
while(1){
scanf("%d",&n);
if(n == 0){
break;
}
data kanja[n];
for(i=0;i<n;i++){
scanf("%d %d %d",&kanja[i].num,&kanja[i].wa1,&kanja[i].wa2);
if(i == 0){
num = kanja[i].num;
walk = kanja[i].wa1 + kanja[i].wa2;
}
else if(walk < kanja[i].wa1 + kanja[i].wa2){
num = kanja[i].num;
walk = kanja[i].wa1 + kanja[i].wa2;
}
}
printf("%d %d\n",num,walk);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153868/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153868/source.c"
target datalayout = "e-m:e-p270: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.data = type { i32, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp eq i32 %0, 0
br i1 %cmp61, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%1 = phi i32 [ %14, %for.end ], [ %0, %entry ]
%num.063 = phi i32 [ %num.1.lcssa, %for.end ], [ undef, %entry ]
%walk.062 = phi i32 [ %walk.1.lcssa, %for.end ], [ undef, %entry ]
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.data, i64 %2, align 16
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp155 = icmp sgt i32 %4, 0
br i1 %cmp155, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %if.end
%wa1.peel = getelementptr inbounds %struct.data, ptr %vla, i64 0, i32 1
%wa2.peel = getelementptr inbounds %struct.data, ptr %vla, i64 0, i32 2
%call7.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla, ptr noundef nonnull %wa1.peel, ptr noundef nonnull %wa2.peel)
%5 = load i32, ptr %vla, align 16, !tbaa !9
%6 = load i32, ptr %wa1.peel, align 4, !tbaa !11
%7 = load i32, ptr %wa2.peel, align 8, !tbaa !12
%add.peel = add nsw i32 %7, %6
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.peel = icmp sgt i32 %8, 1
br i1 %cmp1.peel, label %if.else, label %for.end
if.else: ; preds = %for.inc.peel, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ]
%num.157 = phi i32 [ %num.2, %for.inc ], [ %5, %for.inc.peel ]
%walk.156 = phi i32 [ %walk.2, %for.inc ], [ %add.peel, %for.inc.peel ]
%arrayidx = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv
%wa1 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv, i32 1
%wa2 = getelementptr inbounds %struct.data, ptr %vla, i64 %indvars.iv, i32 2
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %wa1, ptr noundef nonnull %wa2)
%9 = load i32, ptr %wa1, align 4, !tbaa !11
%10 = load i32, ptr %wa2, align 4, !tbaa !12
%add25 = add nsw i32 %10, %9
%cmp26 = icmp slt i32 %walk.156, %add25
br i1 %cmp26, label %if.then27, label %for.inc
if.then27: ; preds = %if.else
%11 = load i32, ptr %arrayidx, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %if.then27, %if.else
%walk.2 = phi i32 [ %add25, %if.then27 ], [ %walk.156, %if.else ]
%num.2 = phi i32 [ %11, %if.then27 ], [ %num.157, %if.else ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp1, label %if.else, label %for.end, !llvm.loop !13
for.end: ; preds = %for.inc, %for.inc.peel, %if.end
%walk.1.lcssa = phi i32 [ %walk.062, %if.end ], [ %add.peel, %for.inc.peel ], [ %walk.2, %for.inc ]
%num.1.lcssa = phi i32 [ %num.063, %if.end ], [ %5, %for.inc.peel ], [ %num.2, %for.inc ]
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.1.lcssa, i32 noundef %walk.1.lcssa)
call void @llvm.stackrestore.p0(ptr %3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %14, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(void) {
int n;
scanf("%d",&n);
int a = n / 100;
int b = (n / 10) % 10;
int c = (n % 10) % 10;
if(a == 1) {
a = 9;
} else if(a == 9) {
a = 1;
}
if(b == 1) {
b = 9;
} else if(b == 9) {
b = 1;
}
if(c == 1) {
c = 9;
} else if(c == 9) {
c = 1;
}
printf("%d%d%d\n", a,b,c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153910/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%d%d%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%.off = add i32 %0, -100
%cmp = icmp ult i32 %.off, 100
br i1 %cmp, label %if.end6, label %if.else
if.else: ; preds = %entry
%div = sdiv i32 %0, 100
%.off30 = add i32 %0, -900
%cmp4 = icmp ult i32 %.off30, 100
%spec.store.select = select i1 %cmp4, i32 1, i32 %div
br label %if.end6
if.end6: ; preds = %entry, %if.else
%a.0 = phi i32 [ %spec.store.select, %if.else ], [ 9, %entry ]
%rem2 = srem i32 %0, 10
%div1 = sdiv i32 %0, 10
%rem = srem i32 %div1, 10
%cmp7 = icmp eq i32 %rem, 1
%cmp10 = icmp eq i32 %rem, 9
%spec.store.select22 = select i1 %cmp10, i32 1, i32 %rem
%b.0 = select i1 %cmp7, i32 9, i32 %spec.store.select22
%cmp14 = icmp eq i32 %rem2, 1
%cmp17 = icmp eq i32 %rem2, 9
%spec.store.select23 = select i1 %cmp17, i32 1, i32 %rem2
%c.0 = select i1 %cmp14, i32 9, i32 %spec.store.select23
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0, i32 noundef %b.0, i32 noundef %c.0)
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() {
char n[5];
scanf("%s",n);
for(int i=0;i<3;i++)
{
if(n[i]=='1')
n[i]='9';
else if(n[i]=='9')
n[i]='1';
}
printf("%s",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153954/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i8, ptr %n, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 49, label %if.then
i8 57, label %if.then10
]
if.then: ; preds = %entry
store i8 57, ptr %n, align 1, !tbaa !5
br label %for.inc
if.then10: ; preds = %entry
store i8 49, ptr %n, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then, %if.then10
%arrayidx.1 = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
switch i8 %1, label %for.inc.1 [
i8 49, label %if.then.1
i8 57, label %for.inc.1.sink.split
]
if.then.1: ; preds = %for.inc
br label %for.inc.1.sink.split
for.inc.1.sink.split: ; preds = %for.inc, %if.then.1
%.sink = phi i8 [ 57, %if.then.1 ], [ 49, %for.inc ]
store i8 %.sink, ptr %arrayidx.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %for.inc.1.sink.split, %for.inc
%arrayidx.2 = getelementptr inbounds [5 x i8], ptr %n, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
switch i8 %2, label %for.inc.2 [
i8 49, label %if.then.2
i8 57, label %for.inc.2.sink.split
]
if.then.2: ; preds = %for.inc.1
br label %for.inc.2.sink.split
for.inc.2.sink.split: ; preds = %for.inc.1, %if.then.2
%.sink23 = phi i8 [ 57, %if.then.2 ], [ 49, %for.inc.1 ]
store i8 %.sink23, ptr %arrayidx.2, align 1, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %for.inc.2.sink.split, %for.inc.1
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.end.p0(i64 5, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int n,ans=0;
scanf("%d", &n);
if(n % 10 == 1){
ans+=9;
}
else if(n % 10 == 9){
ans+=1;
}
else{
ans += (n % 10);
}
int x =(n / 10) % 10;
switch (x) {
case 1: ans += 90; break;
case 9: ans += 10; break;
default: ans += (x * 10); break;
}
x = n/ 100;
switch (x) {
case 1: ans += 900; break;
case 9: ans += 100; break;
default: ans += x * 100; break;
}
printf("%d",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 10
switch i32 %rem, label %if.else5 [
i32 1, label %if.end8
i32 9, label %if.then3
]
if.then3: ; preds = %entry
br label %if.end8
if.else5: ; preds = %entry
br label %if.end8
if.end8: ; preds = %entry, %if.then3, %if.else5
%ans.0 = phi i32 [ 1, %if.then3 ], [ %rem, %if.else5 ], [ 9, %entry ]
%rem9 = srem i32 %div, 10
switch i32 %rem9, label %sw.default [
i32 1, label %sw.epilog
i32 9, label %sw.bb11
]
sw.bb11: ; preds = %if.end8
br label %sw.epilog
sw.default: ; preds = %if.end8
%mul = mul nsw i32 %rem9, 10
br label %sw.epilog
sw.epilog: ; preds = %if.end8, %sw.default, %sw.bb11
%mul.pn = phi i32 [ %mul, %sw.default ], [ 10, %sw.bb11 ], [ 90, %if.end8 ]
%div14 = sdiv i32 %0, 100
switch i32 %div14, label %sw.default19 [
i32 1, label %sw.epilog22
i32 9, label %sw.bb17
]
sw.bb17: ; preds = %sw.epilog
br label %sw.epilog22
sw.default19: ; preds = %sw.epilog
%mul20 = mul nsw i32 %div14, 100
br label %sw.epilog22
sw.epilog22: ; preds = %sw.epilog, %sw.default19, %sw.bb17
%mul20.pn = phi i32 [ %mul20, %sw.default19 ], [ 100, %sw.bb17 ], [ 900, %sw.epilog ]
%ans.1 = add nsw i32 %mul.pn, %ans.0
%ans.2 = add nsw i32 %ans.1, %mul20.pn
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<memory.h>
#include<assert.h>
#include<ctype.h>
typedef long long ll;
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define abs(k) (((k)>0)?(k):(-(k)))
#define sqr(k) ((k)*(k))
#define swap(a,b) a^=b^=a^=b
#define mod(a,b) (((a)%(b)+(b))%(b))
#define mode(a,b) a=mod(a,b)
#define mset(a) memset(a,0,sizeof(a))
#define mcpy(a,b) memcpy(a,b,sizeof(a))
#define inf 1000000000
#define linf 1000000000000000000LL
#define pi 3.14159265358979323846
void fileio_in_out()
{
freopen(".in","r",stdin);
freopen(".out","w",stdout);
}
void fileio_txt()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
//==================================================
int n,m,ans;
int i,j,k,l;
char s[111][111];
int a[111],b[111];
int contain(int x1,int y1,int x2,int y2)
{
return ((x1<=x2&&y1>=y2)||(x1>=x2&&y1<=y2));
}
int check()
{
for(i=1;i<=n;i++)
{
for(j=1;j<m;j++)
for(k=j+1;k<m;k++)
for(l=k+1;l<=m;l++)
if(s[i][j]=='B'&&s[i][k]=='W'&&s[i][l]=='B')
return 0;
}
for(i=1;i<=m;i++)
{
for(j=1;j<n;j++)
for(k=j+1;k<n;k++)
for(l=k+1;l<=n;l++)
if(s[j][i]=='B'&&s[k][i]=='W'&&s[l][i]=='B')
return 0;
}
for(i=1;i<=n;i++)
{
a[i]=0;
b[i]=inf;
for(j=1;j<=m+1;j++)
if(s[i][j]=='B')
{
if(!a[i])
a[i]=j;
}
else
{
if(a[i])
{
b[i]=j-1;
break;
}
}
}
for(i=1;i<n;i++)
for(j=i+1;j<=n;j++)
if(!contain(a[i],b[i],a[j],b[j]))
return 0;
for(i=1;i<=m;i++)
{
a[i]=0;
b[i]=inf;
for(j=1;j<=n+1;j++)
if(s[j][i]=='B')
{
if(!a[i])
a[i]=j;
}
else
{
if(a[i])
{
b[i]=j-1;
break;
}
}
}
for(i=1;i<m;i++)
for(j=i+1;j<=m;j++)
if(!contain(a[i],b[i],a[j],b[j]))
return 0;
return 1;
}
int main()
{
//fileio_in_out();
//fileio_txt();
scanf("%d%d",&n,&m);
for(i=1;i<=n;i++)
scanf("%s",s[i]+1);
for(i=0;i<=n+1;i++)
s[i][0]=s[i][m+1]='W';
for(i=0;i<=m+1;i++)
s[0][i]=s[n+1][i]='W';
printf("%s\n",check()?"YES":"NO");
//system("pause");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15404/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15404/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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".in\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"r\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [5 x i8] c".out\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = private unnamed_addr constant [10 x i8] c"input.txt\00", align 1
@.str.5 = private unnamed_addr constant [11 x i8] c"output.txt\00", align 1
@i = dso_local local_unnamed_addr global i32 0, align 4
@n = dso_local global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@m = dso_local global i32 0, align 4
@k = dso_local local_unnamed_addr global i32 0, align 4
@l = dso_local local_unnamed_addr global i32 0, align 4
@s = dso_local global [111 x [111 x i8]] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [111 x i32] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [111 x i32] zeroinitializer, align 16
@.str.6 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.7 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.9 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.10 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@ans = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nounwind uwtable
define dso_local void @fileio_in_out() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %0) #8
%1 = load ptr, ptr @stdout, align 8, !tbaa !5
%call1 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %1) #8
ret void
}
declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1
; Function Attrs: nounwind uwtable
define dso_local void @fileio_txt() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @freopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, ptr noundef %0) #8
%1 = load ptr, ptr @stdout, align 8, !tbaa !5
%call1 = tail call ptr @freopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef %1) #8
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @contain(i32 noundef %x1, i32 noundef %y1, i32 noundef %x2, i32 noundef %y2) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sle i32 %x1, %x2
%cmp1.not = icmp sge i32 %y1, %y2
%or.cond.not = and i1 %cmp.not, %cmp1.not
%cmp2 = icmp sge i32 %x1, %x2
%cmp3 = icmp sle i32 %y1, %y2
%0 = and i1 %cmp2, %cmp3
%narrow = or i1 %or.cond.not, %0
%lor.ext = zext i1 %narrow to i32
ret i32 %lor.ext
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @check() local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !9
%cmp.not294 = icmp slt i32 %0, 1
%.pre = load i32, ptr @m, align 4, !tbaa !9
br i1 %cmp.not294, label %for.cond39.preheader, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%cmp2290 = icmp sgt i32 %.pre, 1
br i1 %cmp2290, label %for.cond1.preheader.us.preheader, label %for.cond1.preheader.lr.ph.split
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%1 = add nuw i32 %.pre, 1
%2 = zext i32 %.pre to i64
%3 = add nuw i32 %0, 1
%4 = add nuw i32 %0, 1
%wide.trip.count427 = zext i32 %4 to i64
%wide.trip.count422 = zext i32 %.pre to i64
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc36_crit_edge.us
%indvars.iv424 = phi i64 [ 1, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next425, %for.cond1.for.inc36_crit_edge.us ]
br label %for.cond4.preheader.us
for.inc33.us: ; preds = %for.cond4.loopexit.us, %for.cond4.preheader.us
%storemerge258.lcssa.us = phi i32 [ %6, %for.cond4.preheader.us ], [ %.pre, %for.cond4.loopexit.us ]
store i32 %storemerge258.lcssa.us, ptr @k, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%indvars.iv.next415 = add nuw nsw i64 %indvars.iv414, 1
%exitcond423.not = icmp eq i64 %indvars.iv.next420, %wide.trip.count422
br i1 %exitcond423.not, label %for.cond1.for.inc36_crit_edge.us, label %for.cond4.preheader.us, !llvm.loop !11
for.body6.us: ; preds = %for.body6.lr.ph.us, %for.cond4.loopexit.us
%indvars.iv416 = phi i64 [ %indvars.iv414, %for.body6.lr.ph.us ], [ %indvars.iv.next417, %for.cond4.loopexit.us ]
%indvars.iv409 = phi i64 [ %indvars.iv, %for.body6.lr.ph.us ], [ %indvars.iv.next410, %for.cond4.loopexit.us ]
%storemerge258.in284.us = phi i32 [ %11, %for.body6.lr.ph.us ], [ %indvars418, %for.cond4.loopexit.us ]
%indvars418 = trunc i64 %indvars.iv416 to i32
%add7.us = add nuw nsw i32 %storemerge258.in284.us, 2
%cmp9.not277.us = icmp sgt i32 %add7.us, %.pre
br i1 %cmp9.not277.us, label %for.cond4.loopexit.us, label %for.body10.lr.ph.us
for.cond4.loopexit.us.loopexit: ; preds = %for.inc.us.us.us
%5 = trunc i64 %indvars.iv.next412 to i32
br label %for.cond4.loopexit.us
for.cond4.loopexit.us: ; preds = %for.body10.lr.ph.split.us.us, %for.body10.lr.ph.us, %for.cond4.loopexit.us.loopexit, %for.body6.us
%storemerge259.lcssa.us = phi i32 [ %add7.us, %for.body6.us ], [ %5, %for.cond4.loopexit.us.loopexit ], [ %1, %for.body10.lr.ph.us ], [ %1, %for.body10.lr.ph.split.us.us ]
store i32 %storemerge259.lcssa.us, ptr @l, align 4, !tbaa !9
%indvars.iv.next417 = add nuw nsw i64 %indvars.iv416, 1
%indvars.iv.next410 = add nuw nsw i64 %indvars.iv409, 1
%exitcond.not = icmp eq i64 %indvars.iv.next417, %wide.trip.count422
br i1 %exitcond.not, label %for.inc33.us, label %for.body6.us, !llvm.loop !13
for.cond4.preheader.us: ; preds = %for.cond1.preheader.us, %for.inc33.us
%indvars.iv419 = phi i64 [ 1, %for.cond1.preheader.us ], [ %indvars.iv.next420, %for.inc33.us ]
%indvars.iv414 = phi i64 [ 2, %for.cond1.preheader.us ], [ %indvars.iv.next415, %for.inc33.us ]
%indvars.iv = phi i64 [ 3, %for.cond1.preheader.us ], [ %indvars.iv.next, %for.inc33.us ]
%indvars.iv.next420 = add nuw nsw i64 %indvars.iv419, 1
%cmp5283.us = icmp ult i64 %indvars.iv.next420, %2
%6 = trunc i64 %indvars.iv.next420 to i32
br i1 %cmp5283.us, label %for.body6.lr.ph.us, label %for.inc33.us
for.body10.lr.ph.us: ; preds = %for.body6.us
%7 = load i8, ptr %arrayidx12.us, align 1, !tbaa !14
%cmp13.us = icmp eq i8 %7, 66
br i1 %cmp13.us, label %for.body10.lr.ph.split.us.us, label %for.cond4.loopexit.us
for.body10.lr.ph.split.us.us: ; preds = %for.body10.lr.ph.us
%arrayidx18.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv424, i64 %indvars.iv416
%8 = load i8, ptr %arrayidx18.us, align 1, !tbaa !14
%cmp20.us.us = icmp eq i8 %8, 87
br i1 %cmp20.us.us, label %for.body10.us.us.us, label %for.cond4.loopexit.us
for.body10.us.us.us: ; preds = %for.body10.lr.ph.split.us.us, %for.inc.us.us.us
%indvars.iv411 = phi i64 [ %indvars.iv.next412, %for.inc.us.us.us ], [ %indvars.iv409, %for.body10.lr.ph.split.us.us ]
%arrayidx26.us.us.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv424, i64 %indvars.iv411
%9 = load i8, ptr %arrayidx26.us.us.us, align 1, !tbaa !14
%cmp28.us.us.us = icmp eq i8 %9, 66
%10 = trunc i64 %indvars.iv411 to i32
br i1 %cmp28.us.us.us, label %return.loopexit270.split.us.split.us, label %for.inc.us.us.us
for.inc.us.us.us: ; preds = %for.body10.us.us.us
%indvars.iv.next412 = add nuw nsw i64 %indvars.iv411, 1
%cmp9.not.us.us.us.not = icmp sgt i32 %.pre, %10
br i1 %cmp9.not.us.us.us.not, label %for.body10.us.us.us, label %for.cond4.loopexit.us.loopexit, !llvm.loop !15
for.body6.lr.ph.us: ; preds = %for.cond4.preheader.us
%arrayidx12.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv424, i64 %indvars.iv419
%11 = trunc i64 %indvars.iv419 to i32
br label %for.body6.us
for.cond1.for.inc36_crit_edge.us: ; preds = %for.inc33.us
store i32 %.pre, ptr @j, align 4, !tbaa !9
%indvars.iv.next425 = add nuw nsw i64 %indvars.iv424, 1
%exitcond428.not = icmp eq i64 %indvars.iv.next425, %wide.trip.count427
br i1 %exitcond428.not, label %for.cond39.preheader, label %for.cond1.preheader.us, !llvm.loop !16
for.cond1.preheader.lr.ph.split: ; preds = %for.cond1.preheader.lr.ph
store i32 1, ptr @j, align 4, !tbaa !9
%12 = add nuw i32 %0, 1
br label %for.cond39.preheader
for.cond39.preheader: ; preds = %for.cond1.for.inc36_crit_edge.us, %for.cond1.preheader.lr.ph.split, %entry
%storemerge.lcssa = phi i32 [ 1, %entry ], [ %12, %for.cond1.preheader.lr.ph.split ], [ %3, %for.cond1.for.inc36_crit_edge.us ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !9
%cmp40.not337 = icmp slt i32 %.pre, 1
br i1 %cmp40.not337, label %for.cond94.preheader, label %for.cond43.preheader.lr.ph
for.cond43.preheader.lr.ph: ; preds = %for.cond39.preheader
%cmp44333 = icmp sgt i32 %0, 1
br i1 %cmp44333, label %for.cond43.preheader.us.preheader, label %for.cond43.preheader.lr.ph.split
for.cond43.preheader.us.preheader: ; preds = %for.cond43.preheader.lr.ph
%13 = add nuw i32 %0, 1
%14 = zext i32 %0 to i64
%15 = add nuw i32 %.pre, 1
%16 = add nuw i32 %.pre, 1
%wide.trip.count451 = zext i32 %16 to i64
%wide.trip.count446 = zext i32 %0 to i64
br label %for.cond43.preheader.us
for.cond43.preheader.us: ; preds = %for.cond43.preheader.us.preheader, %for.cond43.for.inc91_crit_edge.us
%indvars.iv448 = phi i64 [ 1, %for.cond43.preheader.us.preheader ], [ %indvars.iv.next449, %for.cond43.for.inc91_crit_edge.us ]
br label %for.cond48.preheader.us
for.inc88.us: ; preds = %for.cond48.loopexit.us, %for.cond48.preheader.us
%storemerge255.lcssa.us = phi i32 [ %18, %for.cond48.preheader.us ], [ %0, %for.cond48.loopexit.us ]
store i32 %storemerge255.lcssa.us, ptr @k, align 4, !tbaa !9
%indvars.iv.next430 = add nuw nsw i64 %indvars.iv429, 1
%indvars.iv.next437 = add nuw nsw i64 %indvars.iv436, 1
%exitcond447.not = icmp eq i64 %indvars.iv.next444, %wide.trip.count446
br i1 %exitcond447.not, label %for.cond43.for.inc91_crit_edge.us, label %for.cond48.preheader.us, !llvm.loop !17
for.body51.us: ; preds = %for.body51.lr.ph.us, %for.cond48.loopexit.us
%indvars.iv438 = phi i64 [ %indvars.iv436, %for.body51.lr.ph.us ], [ %indvars.iv.next439, %for.cond48.loopexit.us ]
%indvars.iv431 = phi i64 [ %indvars.iv429, %for.body51.lr.ph.us ], [ %indvars.iv.next432, %for.cond48.loopexit.us ]
%storemerge255.in327.us = phi i32 [ %23, %for.body51.lr.ph.us ], [ %indvars440, %for.cond48.loopexit.us ]
%indvars440 = trunc i64 %indvars.iv438 to i32
%add52.us = add nuw nsw i32 %storemerge255.in327.us, 2
%cmp54.not318.us = icmp sgt i32 %add52.us, %0
br i1 %cmp54.not318.us, label %for.cond48.loopexit.us, label %for.body56.lr.ph.us
for.cond48.loopexit.us.loopexit: ; preds = %for.inc82.us.us.us
%17 = trunc i64 %indvars.iv.next434 to i32
br label %for.cond48.loopexit.us
for.cond48.loopexit.us: ; preds = %for.body56.lr.ph.split.us.us, %for.body56.lr.ph.us, %for.cond48.loopexit.us.loopexit, %for.body51.us
%storemerge256.lcssa.us = phi i32 [ %add52.us, %for.body51.us ], [ %17, %for.cond48.loopexit.us.loopexit ], [ %13, %for.body56.lr.ph.us ], [ %13, %for.body56.lr.ph.split.us.us ]
store i32 %storemerge256.lcssa.us, ptr @l, align 4, !tbaa !9
%indvars.iv.next439 = add nuw nsw i64 %indvars.iv438, 1
%indvars.iv.next432 = add nuw nsw i64 %indvars.iv431, 1
%exitcond442.not = icmp eq i64 %indvars.iv.next439, %wide.trip.count446
br i1 %exitcond442.not, label %for.inc88.us, label %for.body51.us, !llvm.loop !18
for.cond48.preheader.us: ; preds = %for.cond43.preheader.us, %for.inc88.us
%indvars.iv443 = phi i64 [ 1, %for.cond43.preheader.us ], [ %indvars.iv.next444, %for.inc88.us ]
%indvars.iv436 = phi i64 [ 2, %for.cond43.preheader.us ], [ %indvars.iv.next437, %for.inc88.us ]
%indvars.iv429 = phi i64 [ 3, %for.cond43.preheader.us ], [ %indvars.iv.next430, %for.inc88.us ]
%indvars.iv.next444 = add nuw nsw i64 %indvars.iv443, 1
%cmp49326.us = icmp ult i64 %indvars.iv.next444, %14
%18 = trunc i64 %indvars.iv.next444 to i32
br i1 %cmp49326.us, label %for.body51.lr.ph.us, label %for.inc88.us
for.body56.lr.ph.us: ; preds = %for.body51.us
%19 = load i8, ptr %arrayidx60.us, align 1, !tbaa !14
%cmp62.us = icmp eq i8 %19, 66
br i1 %cmp62.us, label %for.body56.lr.ph.split.us.us, label %for.cond48.loopexit.us
for.body56.lr.ph.split.us.us: ; preds = %for.body56.lr.ph.us
%arrayidx68.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv438, i64 %indvars.iv448
%20 = load i8, ptr %arrayidx68.us, align 1, !tbaa !14
%cmp70.us.us = icmp eq i8 %20, 87
br i1 %cmp70.us.us, label %for.body56.us.us.us, label %for.cond48.loopexit.us
for.body56.us.us.us: ; preds = %for.body56.lr.ph.split.us.us, %for.inc82.us.us.us
%indvars.iv433 = phi i64 [ %indvars.iv.next434, %for.inc82.us.us.us ], [ %indvars.iv431, %for.body56.lr.ph.split.us.us ]
%arrayidx76.us.us.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv433, i64 %indvars.iv448
%21 = load i8, ptr %arrayidx76.us.us.us, align 1, !tbaa !14
%cmp78.us.us.us = icmp eq i8 %21, 66
%22 = trunc i64 %indvars.iv433 to i32
br i1 %cmp78.us.us.us, label %return.loopexit269.split.us.split.us, label %for.inc82.us.us.us
for.inc82.us.us.us: ; preds = %for.body56.us.us.us
%indvars.iv.next434 = add nuw nsw i64 %indvars.iv433, 1
%cmp54.not.us.us.us.not = icmp sgt i32 %0, %22
br i1 %cmp54.not.us.us.us.not, label %for.body56.us.us.us, label %for.cond48.loopexit.us.loopexit, !llvm.loop !19
for.body51.lr.ph.us: ; preds = %for.cond48.preheader.us
%arrayidx60.us = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv443, i64 %indvars.iv448
%23 = trunc i64 %indvars.iv443 to i32
br label %for.body51.us
for.cond43.for.inc91_crit_edge.us: ; preds = %for.inc88.us
store i32 %0, ptr @j, align 4, !tbaa !9
%indvars.iv.next449 = add nuw nsw i64 %indvars.iv448, 1
%exitcond452.not = icmp eq i64 %indvars.iv.next449, %wide.trip.count451
br i1 %exitcond452.not, label %for.cond94.preheader, label %for.cond43.preheader.us, !llvm.loop !20
for.cond43.preheader.lr.ph.split: ; preds = %for.cond43.preheader.lr.ph
store i32 1, ptr @j, align 4, !tbaa !9
%24 = add nuw i32 %.pre, 1
br label %for.cond94.preheader
return.loopexit270.split.us.split.us: ; preds = %for.body10.us.us.us
%25 = trunc i64 %indvars.iv424 to i32
store i32 %25, ptr @i, align 4, !tbaa !9
store i32 %11, ptr @j, align 4, !tbaa !9
store i32 %indvars418, ptr @k, align 4, !tbaa !9
store i32 %10, ptr @l, align 4, !tbaa !9
br label %return
for.cond94.preheader: ; preds = %for.cond43.for.inc91_crit_edge.us, %for.cond43.preheader.lr.ph.split, %for.cond39.preheader
%storemerge245.lcssa = phi i32 [ 1, %for.cond39.preheader ], [ %24, %for.cond43.preheader.lr.ph.split ], [ %15, %for.cond43.for.inc91_crit_edge.us ]
store i32 %storemerge245.lcssa, ptr @i, align 4, !tbaa !9
br i1 %cmp.not294, label %for.cond161.preheader, label %for.body97.lr.ph
for.body97.lr.ph: ; preds = %for.cond94.preheader
%cmp104.not363 = icmp slt i32 %.pre, 0
br i1 %cmp104.not363, label %for.body97.lr.ph.split.us, label %for.body97.preheader
for.body97.preheader: ; preds = %for.body97.lr.ph
%26 = add nuw i32 %.pre, 2
%27 = add nuw i32 %0, 1
%wide.trip.count461 = zext i32 %27 to i64
%wide.trip.count456 = zext i32 %26 to i64
br label %for.body97
for.body97.lr.ph.split.us: ; preds = %for.body97.lr.ph
store i32 1, ptr @j, align 4, !tbaa !9
%28 = zext i32 %0 to i64
%29 = shl nuw nsw i64 %28, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([111 x i32], ptr @a, i64 0, i64 1), i8 0, i64 %29, i1 false), !tbaa !9
%30 = add nuw i32 %0, 1
%wide.trip.count466 = zext i32 %30 to i64
%31 = add nsw i64 %wide.trip.count466, -1
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body97.us.preheader, label %vector.ph
vector.ph: ; preds = %for.body97.lr.ph.split.us
%n.vec = and i64 %31, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%32 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %offset.idx
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %32, align 4, !tbaa !9
%33 = getelementptr inbounds i32, ptr %32, i64 4
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %33, align 4, !tbaa !9
%index.next = add nuw i64 %index, 8
%34 = icmp eq i64 %index.next, %n.vec
br i1 %34, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %31, %n.vec
br i1 %cmp.n, label %for.cond135.preheader, label %for.body97.us.preheader
for.body97.us.preheader: ; preds = %for.body97.lr.ph.split.us, %middle.block
%indvars.iv463.ph = phi i64 [ 1, %for.body97.lr.ph.split.us ], [ %ind.end, %middle.block ]
br label %for.body97.us
for.body97.us: ; preds = %for.body97.us.preheader, %for.body97.us
%indvars.iv463 = phi i64 [ %indvars.iv.next464, %for.body97.us ], [ %indvars.iv463.ph, %for.body97.us.preheader ]
%arrayidx101.us = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv463
store i32 1000000000, ptr %arrayidx101.us, align 4, !tbaa !9
%indvars.iv.next464 = add nuw nsw i64 %indvars.iv463, 1
%exitcond467.not = icmp eq i64 %indvars.iv.next464, %wide.trip.count466
br i1 %exitcond467.not, label %for.cond135.preheader, label %for.body97.us, !llvm.loop !24
return.loopexit269.split.us.split.us: ; preds = %for.body56.us.us.us
%35 = trunc i64 %indvars.iv448 to i32
store i32 %35, ptr @i, align 4, !tbaa !9
store i32 %23, ptr @j, align 4, !tbaa !9
store i32 %indvars440, ptr @k, align 4, !tbaa !9
store i32 %22, ptr @l, align 4, !tbaa !9
br label %return
for.cond135.preheader: ; preds = %for.inc132, %for.body97.us, %middle.block
%storemerge246.lcssa = phi i32 [ %30, %middle.block ], [ %30, %for.body97.us ], [ %27, %for.inc132 ]
store i32 %storemerge246.lcssa, ptr @i, align 4, !tbaa !9
%cmp136371 = icmp sgt i32 %0, 1
br i1 %cmp136371, label %for.cond140.preheader.preheader, label %for.cond161.preheader
for.cond140.preheader.preheader: ; preds = %for.cond135.preheader
%36 = zext i32 %0 to i64
%wide.trip.count474 = zext i32 %0 to i64
br label %for.cond140.preheader
for.body97: ; preds = %for.body97.preheader, %for.inc132
%indvars.iv458 = phi i64 [ 1, %for.body97.preheader ], [ %indvars.iv.next459, %for.inc132 ]
%arrayidx99 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv458
store i32 0, ptr %arrayidx99, align 4, !tbaa !9
%arrayidx101 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv458
store i32 1000000000, ptr %arrayidx101, align 4, !tbaa !9
br label %for.body106
for.body106: ; preds = %for.body97, %for.inc129
%37 = phi i32 [ 0, %for.body97 ], [ %42, %for.inc129 ]
%38 = phi i32 [ 0, %for.body97 ], [ %43, %for.inc129 ]
%indvars.iv453 = phi i64 [ 1, %for.body97 ], [ %indvars.iv.next454, %for.inc129 ]
%arrayidx110 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv458, i64 %indvars.iv453
%39 = load i8, ptr %arrayidx110, align 1, !tbaa !14
%cmp112 = icmp eq i8 %39, 66
br i1 %cmp112, label %if.then114, label %if.else
if.then114: ; preds = %for.body106
%tobool.not = icmp eq i32 %37, 0
br i1 %tobool.not, label %if.then117, label %for.inc129
if.then117: ; preds = %if.then114
%40 = trunc i64 %indvars.iv453 to i32
store i32 %40, ptr %arrayidx99, align 4, !tbaa !9
br label %for.inc129
if.else: ; preds = %for.body106
%tobool123.not = icmp eq i32 %38, 0
br i1 %tobool123.not, label %for.inc129, label %if.then124
if.then124: ; preds = %if.else
%41 = trunc i64 %indvars.iv453 to i32
store i32 %41, ptr @j, align 4, !tbaa !9
%sub = add nsw i32 %41, -1
store i32 %sub, ptr %arrayidx101, align 4, !tbaa !9
br label %for.inc132
for.inc129: ; preds = %if.then117, %if.then114, %if.else
%42 = phi i32 [ %40, %if.then117 ], [ %37, %if.then114 ], [ %37, %if.else ]
%43 = phi i32 [ %40, %if.then117 ], [ %37, %if.then114 ], [ 0, %if.else ]
%indvars.iv.next454 = add nuw nsw i64 %indvars.iv453, 1
%exitcond457 = icmp eq i64 %indvars.iv.next454, %wide.trip.count456
br i1 %exitcond457, label %for.cond102.for.inc132.loopexit_crit_edge, label %for.body106, !llvm.loop !25
for.cond102.for.inc132.loopexit_crit_edge: ; preds = %for.inc129
store i32 %26, ptr @j, align 4, !tbaa !9
br label %for.inc132
for.inc132: ; preds = %for.cond102.for.inc132.loopexit_crit_edge, %if.then124
%indvars.iv.next459 = add nuw nsw i64 %indvars.iv458, 1
%exitcond462.not = icmp eq i64 %indvars.iv.next459, %wide.trip.count461
br i1 %exitcond462.not, label %for.cond135.preheader, label %for.body97, !llvm.loop !26
for.cond140.preheader: ; preds = %for.cond140.preheader.preheader, %for.inc158
%indvars.iv468 = phi i64 [ 1, %for.cond140.preheader.preheader ], [ %indvars.iv.next469, %for.inc158 ]
%arrayidx145 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv468
%arrayidx147 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv468
br label %for.cond140
for.cond161.preheader: ; preds = %for.inc158, %for.cond94.preheader, %for.cond135.preheader
%storemerge247.lcssa = phi i32 [ 1, %for.cond135.preheader ], [ 1, %for.cond94.preheader ], [ %0, %for.inc158 ]
store i32 %storemerge247.lcssa, ptr @i, align 4, !tbaa !9
br i1 %cmp40.not337, label %return.loopexit267, label %for.body164.lr.ph
for.body164.lr.ph: ; preds = %for.cond161.preheader
%cmp171.not375 = icmp slt i32 %0, 0
br i1 %cmp171.not375, label %for.body164.lr.ph.split.us, label %for.body164.preheader
for.body164.preheader: ; preds = %for.body164.lr.ph
%44 = add nuw i32 %0, 2
%45 = add nuw i32 %.pre, 1
%wide.trip.count484 = zext i32 %45 to i64
%wide.trip.count479 = zext i32 %44 to i64
br label %for.body164
for.body164.lr.ph.split.us: ; preds = %for.body164.lr.ph
store i32 1, ptr @j, align 4, !tbaa !9
%46 = zext i32 %.pre to i64
%47 = shl nuw nsw i64 %46, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([111 x i32], ptr @a, i64 0, i64 1), i8 0, i64 %47, i1 false), !tbaa !9
%48 = add nuw i32 %.pre, 1
%wide.trip.count489 = zext i32 %48 to i64
%49 = add nsw i64 %wide.trip.count489, -1
%min.iters.check535 = icmp ult i32 %.pre, 8
br i1 %min.iters.check535, label %for.body164.us.preheader, label %vector.ph536
vector.ph536: ; preds = %for.body164.lr.ph.split.us
%n.vec538 = and i64 %49, -8
%ind.end539 = or i64 %n.vec538, 1
br label %vector.body542
vector.body542: ; preds = %vector.body542, %vector.ph536
%index543 = phi i64 [ 0, %vector.ph536 ], [ %index.next545, %vector.body542 ]
%offset.idx544 = or i64 %index543, 1
%50 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %offset.idx544
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %50, align 4, !tbaa !9
%51 = getelementptr inbounds i32, ptr %50, i64 4
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %51, align 4, !tbaa !9
%index.next545 = add nuw i64 %index543, 8
%52 = icmp eq i64 %index.next545, %n.vec538
br i1 %52, label %middle.block533, label %vector.body542, !llvm.loop !27
middle.block533: ; preds = %vector.body542
%cmp.n541 = icmp eq i64 %49, %n.vec538
br i1 %cmp.n541, label %for.cond205.preheader, label %for.body164.us.preheader
for.body164.us.preheader: ; preds = %for.body164.lr.ph.split.us, %middle.block533
%indvars.iv486.ph = phi i64 [ 1, %for.body164.lr.ph.split.us ], [ %ind.end539, %middle.block533 ]
br label %for.body164.us
for.body164.us: ; preds = %for.body164.us.preheader, %for.body164.us
%indvars.iv486 = phi i64 [ %indvars.iv.next487, %for.body164.us ], [ %indvars.iv486.ph, %for.body164.us.preheader ]
%arrayidx168.us = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv486
store i32 1000000000, ptr %arrayidx168.us, align 4, !tbaa !9
%indvars.iv.next487 = add nuw nsw i64 %indvars.iv486, 1
%exitcond490.not = icmp eq i64 %indvars.iv.next487, %wide.trip.count489
br i1 %exitcond490.not, label %for.cond205.preheader, label %for.body164.us, !llvm.loop !28
for.cond140: ; preds = %for.cond140.preheader, %for.body143
%indvars.iv470 = phi i64 [ %indvars.iv468, %for.cond140.preheader ], [ %indvars.iv.next471, %for.body143 ]
%indvars.iv.next471 = add nuw nsw i64 %indvars.iv470, 1
%cmp141.not.not = icmp ult i64 %indvars.iv470, %36
br i1 %cmp141.not.not, label %for.body143, label %for.inc158
for.body143: ; preds = %for.cond140
%53 = load i32, ptr %arrayidx145, align 4, !tbaa !9
%54 = load i32, ptr %arrayidx147, align 4, !tbaa !9
%arrayidx149 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv.next471
%55 = load i32, ptr %arrayidx149, align 4, !tbaa !9
%arrayidx151 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv.next471
%56 = load i32, ptr %arrayidx151, align 4, !tbaa !9
%cmp.not.i = icmp sle i32 %53, %55
%cmp1.not.i = icmp sge i32 %54, %56
%or.cond.not.i = and i1 %cmp.not.i, %cmp1.not.i
%cmp2.i = icmp sge i32 %53, %55
%cmp3.i = icmp sle i32 %54, %56
%57 = and i1 %cmp2.i, %cmp3.i
%narrow.i = or i1 %or.cond.not.i, %57
br i1 %narrow.i, label %for.cond140, label %return.loopexit268, !llvm.loop !29
for.inc158: ; preds = %for.cond140
%58 = trunc i64 %indvars.iv.next471 to i32
store i32 %58, ptr @j, align 4, !tbaa !9
%indvars.iv.next469 = add nuw nsw i64 %indvars.iv468, 1
%exitcond475.not = icmp eq i64 %indvars.iv.next469, %wide.trip.count474
br i1 %exitcond475.not, label %for.cond161.preheader, label %for.cond140.preheader, !llvm.loop !30
for.cond205.preheader: ; preds = %for.inc202, %for.body164.us, %middle.block533
%storemerge248.lcssa = phi i32 [ %48, %middle.block533 ], [ %48, %for.body164.us ], [ %45, %for.inc202 ]
store i32 %storemerge248.lcssa, ptr @i, align 4, !tbaa !9
%cmp206384 = icmp sgt i32 %.pre, 1
br i1 %cmp206384, label %for.cond210.preheader.preheader, label %return.loopexit267
for.cond210.preheader.preheader: ; preds = %for.cond205.preheader
%59 = zext i32 %.pre to i64
%wide.trip.count497 = zext i32 %.pre to i64
br label %for.cond210.preheader
for.body164: ; preds = %for.body164.preheader, %for.inc202
%indvars.iv481 = phi i64 [ 1, %for.body164.preheader ], [ %indvars.iv.next482, %for.inc202 ]
%arrayidx166 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv481
store i32 0, ptr %arrayidx166, align 4, !tbaa !9
%arrayidx168 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv481
store i32 1000000000, ptr %arrayidx168, align 4, !tbaa !9
br label %for.body173
for.body173: ; preds = %for.body164, %for.inc199
%60 = phi i32 [ 0, %for.body164 ], [ %65, %for.inc199 ]
%61 = phi i32 [ 0, %for.body164 ], [ %66, %for.inc199 ]
%indvars.iv476 = phi i64 [ 1, %for.body164 ], [ %indvars.iv.next477, %for.inc199 ]
%arrayidx177 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv476, i64 %indvars.iv481
%62 = load i8, ptr %arrayidx177, align 1, !tbaa !14
%cmp179 = icmp eq i8 %62, 66
br i1 %cmp179, label %if.then181, label %if.else189
if.then181: ; preds = %for.body173
%tobool184.not = icmp eq i32 %60, 0
br i1 %tobool184.not, label %if.then185, label %for.inc199
if.then185: ; preds = %if.then181
%63 = trunc i64 %indvars.iv476 to i32
store i32 %63, ptr %arrayidx166, align 4, !tbaa !9
br label %for.inc199
if.else189: ; preds = %for.body173
%tobool192.not = icmp eq i32 %61, 0
br i1 %tobool192.not, label %for.inc199, label %if.then193
if.then193: ; preds = %if.else189
%64 = trunc i64 %indvars.iv476 to i32
store i32 %64, ptr @j, align 4, !tbaa !9
%sub194 = add nsw i32 %64, -1
store i32 %sub194, ptr %arrayidx168, align 4, !tbaa !9
br label %for.inc202
for.inc199: ; preds = %if.then185, %if.then181, %if.else189
%65 = phi i32 [ %63, %if.then185 ], [ %60, %if.then181 ], [ %60, %if.else189 ]
%66 = phi i32 [ %63, %if.then185 ], [ %60, %if.then181 ], [ 0, %if.else189 ]
%indvars.iv.next477 = add nuw nsw i64 %indvars.iv476, 1
%exitcond480 = icmp eq i64 %indvars.iv.next477, %wide.trip.count479
br i1 %exitcond480, label %for.cond169.for.inc202.loopexit_crit_edge, label %for.body173, !llvm.loop !31
for.cond169.for.inc202.loopexit_crit_edge: ; preds = %for.inc199
store i32 %44, ptr @j, align 4, !tbaa !9
br label %for.inc202
for.inc202: ; preds = %for.cond169.for.inc202.loopexit_crit_edge, %if.then193
%indvars.iv.next482 = add nuw nsw i64 %indvars.iv481, 1
%exitcond485.not = icmp eq i64 %indvars.iv.next482, %wide.trip.count484
br i1 %exitcond485.not, label %for.cond205.preheader, label %for.body164, !llvm.loop !32
for.cond210.preheader: ; preds = %for.cond210.preheader.preheader, %for.inc229
%indvars.iv491 = phi i64 [ 1, %for.cond210.preheader.preheader ], [ %indvars.iv.next492, %for.inc229 ]
%arrayidx215 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv491
%arrayidx217 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv491
br label %for.cond210
for.cond210: ; preds = %for.cond210.preheader, %for.body213
%indvars.iv493 = phi i64 [ %indvars.iv491, %for.cond210.preheader ], [ %indvars.iv.next494, %for.body213 ]
%indvars.iv.next494 = add nuw nsw i64 %indvars.iv493, 1
%cmp211.not.not = icmp ult i64 %indvars.iv493, %59
br i1 %cmp211.not.not, label %for.body213, label %for.inc229
for.body213: ; preds = %for.cond210
%67 = load i32, ptr %arrayidx215, align 4, !tbaa !9
%68 = load i32, ptr %arrayidx217, align 4, !tbaa !9
%arrayidx219 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv.next494
%69 = load i32, ptr %arrayidx219, align 4, !tbaa !9
%arrayidx221 = getelementptr inbounds [111 x i32], ptr @b, i64 0, i64 %indvars.iv.next494
%70 = load i32, ptr %arrayidx221, align 4, !tbaa !9
%cmp.not.i260 = icmp sle i32 %67, %69
%cmp1.not.i261 = icmp sge i32 %68, %70
%or.cond.not.i262 = and i1 %cmp.not.i260, %cmp1.not.i261
%cmp2.i263 = icmp sge i32 %67, %69
%cmp3.i264 = icmp sle i32 %68, %70
%71 = and i1 %cmp2.i263, %cmp3.i264
%narrow.i265 = or i1 %or.cond.not.i262, %71
br i1 %narrow.i265, label %for.cond210, label %return.loopexit, !llvm.loop !33
for.inc229: ; preds = %for.cond210
%72 = trunc i64 %indvars.iv.next494 to i32
store i32 %72, ptr @j, align 4, !tbaa !9
%indvars.iv.next492 = add nuw nsw i64 %indvars.iv491, 1
%exitcond498.not = icmp eq i64 %indvars.iv.next492, %wide.trip.count497
br i1 %exitcond498.not, label %return.loopexit267, label %for.cond210.preheader, !llvm.loop !34
return.loopexit: ; preds = %for.body213
%73 = trunc i64 %indvars.iv491 to i32
%74 = trunc i64 %indvars.iv.next494 to i32
store i32 %73, ptr @i, align 4, !tbaa !9
store i32 %74, ptr @j, align 4, !tbaa !9
br label %return
return.loopexit267: ; preds = %for.inc229, %for.cond161.preheader, %for.cond205.preheader
%storemerge249.lcssa = phi i32 [ 1, %for.cond205.preheader ], [ 1, %for.cond161.preheader ], [ %.pre, %for.inc229 ]
store i32 %storemerge249.lcssa, ptr @i, align 4, !tbaa !9
br label %return
return.loopexit268: ; preds = %for.body143
%75 = trunc i64 %indvars.iv468 to i32
%76 = trunc i64 %indvars.iv.next471 to i32
store i32 %75, ptr @i, align 4, !tbaa !9
store i32 %76, ptr @j, align 4, !tbaa !9
br label %return
return: ; preds = %return.loopexit270.split.us.split.us, %return.loopexit269.split.us.split.us, %return.loopexit268, %return.loopexit267, %return.loopexit
%retval.0 = phi i32 [ 0, %return.loopexit ], [ 1, %return.loopexit267 ], [ 0, %return.loopexit268 ], [ 0, %return.loopexit269.split.us.split.us ], [ 0, %return.loopexit270.split.us.split.us ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @n, ptr noundef nonnull @m)
store i32 1, ptr @i, align 4, !tbaa !9
%0 = load i32, ptr @n, align 4, !tbaa !9
%cmp.not36 = icmp slt i32 %0, 1
br i1 %cmp.not36, label %for.cond2.preheader, label %for.body
for.cond2.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.body ]
%add = add nsw i32 %.lcssa, 1
%cmp3.not38 = icmp slt i32 %.lcssa, -1
%.pre = load i32, ptr @m, align 4, !tbaa !9
br i1 %cmp3.not38, label %for.cond16.preheader, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%add7 = add nsw i32 %.pre, 1
%idxprom8 = sext i32 %add7 to i64
%1 = add i32 %.lcssa, 2
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i32 %1, 1
br i1 %2, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body4.lr.ph.new
for.body4.lr.ph.new: ; preds = %for.body4.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body4
for.body: ; preds = %entry, %for.body
%storemerge37 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%idxprom = sext i32 %storemerge37 to i64
%add.ptr = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom, i64 1
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %add.ptr)
%3 = load i32, ptr @i, align 4, !tbaa !9
%inc = add nsw i32 %3, 1
store i32 %inc, ptr @i, align 4, !tbaa !9
%4 = load i32, ptr @n, align 4, !tbaa !9
%cmp.not.not = icmp slt i32 %3, %4
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !35
for.cond16.preheader.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.lr.ph
%indvars.iv.unr = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next.1, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body4.epil
for.body4.epil: ; preds = %for.cond16.preheader.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv.unr, i64 %idxprom8
store i8 87, ptr %arrayidx9.epil, align 1, !tbaa !14
%arrayidx11.epil = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv.unr
store i8 87, ptr %arrayidx11.epil, align 1, !tbaa !14
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.body4.epil, %for.cond16.preheader.loopexit.unr-lcssa, %for.cond2.preheader
%cmp18.not42 = icmp slt i32 %.pre, -1
br i1 %cmp18.not42, label %for.end29, label %iter.check
iter.check: ; preds = %for.cond16.preheader
%idxprom21 = sext i32 %add to i64
%5 = add i32 %.pre, 2
%wide.trip.count50 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
%.neg = mul nsw i64 %idxprom21, -111
%diff.check = icmp ult i64 %.neg, 32
%or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
br i1 %or.cond, label %for.body19.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check54 = icmp ult i32 %5, 32
br i1 %min.iters.check54, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count50, 4294967264
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%6 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %index
store <16 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %6, align 1, !tbaa !14
%7 = getelementptr inbounds i8, ptr %6, i64 16
store <16 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %7, align 1, !tbaa !14
%8 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %index
store <16 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %8, align 16, !tbaa !14
%9 = getelementptr inbounds i8, ptr %8, i64 16
store <16 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %9, align 16, !tbaa !14
%index.next = add nuw i64 %index, 32
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !36
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count50
br i1 %cmp.n, label %for.end29, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %wide.trip.count50, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body19.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec56 = and i64 %wide.trip.count50, 4294967288
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index58 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next59, %vec.epilog.vector.body ]
%11 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %index58
store <8 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %11, align 1, !tbaa !14
%12 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %index58
store <8 x i8> <i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87, i8 87>, ptr %12, align 8, !tbaa !14
%index.next59 = add nuw i64 %index58, 8
%13 = icmp eq i64 %index.next59, %n.vec56
br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !37
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n57 = icmp eq i64 %n.vec56, %wide.trip.count50
br i1 %cmp.n57, label %for.end29, label %for.body19.preheader
for.body19.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv47.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec56, %vec.epilog.middle.block ]
%14 = xor i64 %indvars.iv47.ph, -1
%15 = add nsw i64 %14, %wide.trip.count50
%xtraiter61 = and i64 %wide.trip.count50, 3
%lcmp.mod62.not = icmp eq i64 %xtraiter61, 0
br i1 %lcmp.mod62.not, label %for.body19.prol.loopexit, label %for.body19.prol
for.body19.prol: ; preds = %for.body19.preheader, %for.body19.prol
%indvars.iv47.prol = phi i64 [ %indvars.iv.next48.prol, %for.body19.prol ], [ %indvars.iv47.ph, %for.body19.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body19.prol ], [ 0, %for.body19.preheader ]
%arrayidx24.prol = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %indvars.iv47.prol
store i8 87, ptr %arrayidx24.prol, align 1, !tbaa !14
%arrayidx26.prol = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %indvars.iv47.prol
store i8 87, ptr %arrayidx26.prol, align 1, !tbaa !14
%indvars.iv.next48.prol = add nuw nsw i64 %indvars.iv47.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter61
br i1 %prol.iter.cmp.not, label %for.body19.prol.loopexit, label %for.body19.prol, !llvm.loop !38
for.body19.prol.loopexit: ; preds = %for.body19.prol, %for.body19.preheader
%indvars.iv47.unr = phi i64 [ %indvars.iv47.ph, %for.body19.preheader ], [ %indvars.iv.next48.prol, %for.body19.prol ]
%16 = icmp ult i64 %15, 3
br i1 %16, label %for.end29, label %for.body19
for.body4: ; preds = %for.body4, %for.body4.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body4.lr.ph.new ], [ %indvars.iv.next.1, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.1, %for.body4 ]
%arrayidx9 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv, i64 %idxprom8
store i8 87, ptr %arrayidx9, align 1, !tbaa !14
%arrayidx11 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv
store i8 87, ptr %arrayidx11, align 2, !tbaa !14
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx9.1 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv.next, i64 %idxprom8
store i8 87, ptr %arrayidx9.1, align 1, !tbaa !14
%arrayidx11.1 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %indvars.iv.next
store i8 87, ptr %arrayidx11.1, align 1, !tbaa !14
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body4, !llvm.loop !40
for.body19: ; preds = %for.body19.prol.loopexit, %for.body19
%indvars.iv47 = phi i64 [ %indvars.iv.next48.3, %for.body19 ], [ %indvars.iv47.unr, %for.body19.prol.loopexit ]
%arrayidx24 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %indvars.iv47
store i8 87, ptr %arrayidx24, align 1, !tbaa !14
%arrayidx26 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %indvars.iv47
store i8 87, ptr %arrayidx26, align 1, !tbaa !14
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%arrayidx24.1 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %indvars.iv.next48
store i8 87, ptr %arrayidx24.1, align 1, !tbaa !14
%arrayidx26.1 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %indvars.iv.next48
store i8 87, ptr %arrayidx26.1, align 1, !tbaa !14
%indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 2
%arrayidx24.2 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %indvars.iv.next48.1
store i8 87, ptr %arrayidx24.2, align 1, !tbaa !14
%arrayidx26.2 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %indvars.iv.next48.1
store i8 87, ptr %arrayidx26.2, align 1, !tbaa !14
%indvars.iv.next48.2 = add nuw nsw i64 %indvars.iv47, 3
%arrayidx24.3 = getelementptr inbounds [111 x [111 x i8]], ptr @s, i64 0, i64 %idxprom21, i64 %indvars.iv.next48.2
store i8 87, ptr %arrayidx24.3, align 1, !tbaa !14
%arrayidx26.3 = getelementptr inbounds [111 x i8], ptr @s, i64 0, i64 %indvars.iv.next48.2
store i8 87, ptr %arrayidx26.3, align 1, !tbaa !14
%indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 4
%exitcond51.3 = icmp eq i64 %indvars.iv.next48.3, %wide.trip.count50
br i1 %exitcond51.3, label %for.end29, label %for.body19, !llvm.loop !41
for.end29: ; preds = %for.body19.prol.loopexit, %for.body19, %middle.block, %vec.epilog.middle.block, %for.cond16.preheader
%storemerge35.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ %5, %vec.epilog.middle.block ], [ %5, %middle.block ], [ %5, %for.body19 ], [ %5, %for.body19.prol.loopexit ]
store i32 %storemerge35.lcssa, ptr @i, align 4, !tbaa !9
%call30 = tail call i32 @check(), !range !42
%tobool.not = icmp eq i32 %call30, 0
%cond = select i1 %tobool.not, ptr @.str.10, ptr @.str.9
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %cond)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
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 = { "no-trapping-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 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 #3 = { 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 #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 = { nofree nounwind }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !22, !23}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !12, !23, !22}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12, !22, !23}
!28 = distinct !{!28, !12, !23, !22}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12}
!32 = distinct !{!32, !12}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12}
!36 = distinct !{!36, !12, !22, !23}
!37 = distinct !{!37, !12, !22, !23}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.unroll.disable"}
!40 = distinct !{!40, !12}
!41 = distinct !{!41, !12, !22}
!42 = !{i32 0, i32 2}
|
#include <stdio.h>
int main(){
int a[3];
for(int i = 0; i < 3; i++){
scanf("%1d", &a[i]);
if(a[i] == 1){
a[i] = 9;
}else{
a[i] = 1;
}
}
printf("%d%d%d", a[0], a[1], a[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%1d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp eq i32 %0, 1
%. = select i1 %cmp3, i32 9, i32 1
store i32 %., ptr %a, align 4, !tbaa !5
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp3.1 = icmp eq i32 %1, 1
%..1 = select i1 %cmp3.1, i32 9, i32 1
store i32 %..1, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp3.2 = icmp eq i32 %2, 1
%..2 = select i1 %cmp3.2, i32 9, i32 1
store i32 %..2, ptr %arrayidx.2, align 4, !tbaa !5
%3 = load i32, ptr %a, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %4, i32 noundef %..2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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"}
|
#include<stdio.h>
#include<string.h>
int main(void){
char n[3];
scanf("%s",&n);
if(n[0] == '1'){
n[0] = '9';
}else if(n[0] == '9'){
n[0] = '1';
}
if(n[1] == '1'){
n[1] = '9';
}else if(n[1] == '9'){
n[1] = '1';
}
if(n[2] == '1'){
n[2] = '9';
}else if(n[2] == '9'){
n[2] = '1';
}
printf("%s",n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154133/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154133/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i8, ptr %n, align 1, !tbaa !5
switch i8 %0, label %if.end9 [
i8 49, label %if.then
i8 57, label %if.then7
]
if.then: ; preds = %entry
store i8 57, ptr %n, align 1, !tbaa !5
br label %if.end9
if.then7: ; preds = %entry
store i8 49, ptr %n, align 1, !tbaa !5
br label %if.end9
if.end9: ; preds = %entry, %if.then7, %if.then
%arrayidx10 = getelementptr inbounds [3 x i8], ptr %n, i64 0, i64 1
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !5
switch i8 %1, label %if.end24 [
i8 49, label %if.end24.sink.split
i8 57, label %if.then21
]
if.then21: ; preds = %if.end9
br label %if.end24.sink.split
if.end24.sink.split: ; preds = %if.end9, %if.then21
%.sink = phi i8 [ 49, %if.then21 ], [ 57, %if.end9 ]
store i8 %.sink, ptr %arrayidx10, align 1, !tbaa !5
br label %if.end24
if.end24: ; preds = %if.end24.sink.split, %if.end9
%arrayidx25 = getelementptr inbounds [3 x i8], ptr %n, i64 0, i64 2
%2 = load i8, ptr %arrayidx25, align 1, !tbaa !5
switch i8 %2, label %if.end39 [
i8 49, label %if.end39.sink.split
i8 57, label %if.then36
]
if.then36: ; preds = %if.end24
br label %if.end39.sink.split
if.end39.sink.split: ; preds = %if.end24, %if.then36
%.sink41 = phi i8 [ 49, %if.then36 ], [ 57, %if.end24 ]
store i8 %.sink41, ptr %arrayidx25, align 1, !tbaa !5
br label %if.end39
if.end39: ; preds = %if.end39.sink.split, %if.end24
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.end.p0(i64 3, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
char s[3];
scanf("%s", s);
for (int i = 0; i < 3; i ++) {
if (s[i] == '1') {
s[i] = '9';
} else if (s[i] == '9') {
s[i] = '1';
}
}
printf("%s", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154191/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154191/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 49, label %if.then
i8 57, label %if.then10
]
if.then: ; preds = %entry
store i8 57, ptr %s, align 1, !tbaa !5
br label %for.inc
if.then10: ; preds = %entry
store i8 49, ptr %s, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then, %if.then10
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
switch i8 %1, label %for.inc.1 [
i8 49, label %if.then.1
i8 57, label %for.inc.1.sink.split
]
if.then.1: ; preds = %for.inc
br label %for.inc.1.sink.split
for.inc.1.sink.split: ; preds = %for.inc, %if.then.1
%.sink = phi i8 [ 57, %if.then.1 ], [ 49, %for.inc ]
store i8 %.sink, ptr %arrayidx.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %for.inc.1.sink.split, %for.inc
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
switch i8 %2, label %for.inc.2 [
i8 49, label %if.then.2
i8 57, label %for.inc.2.sink.split
]
if.then.2: ; preds = %for.inc.1
br label %for.inc.2.sink.split
for.inc.2.sink.split: ; preds = %for.inc.1, %if.then.2
%.sink23 = phi i8 [ 57, %if.then.2 ], [ 49, %for.inc.1 ]
store i8 %.sink23, ptr %arrayidx.2, align 1, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %for.inc.2.sink.split, %for.inc.1
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define pd(x) printf("%lf\n", x)
#define ps(x) printf("%s\n", x)
#define INF 1000000000000000000
#define MOD 1000000007
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
int compare_long(const void *a, const void *b) {
return *(long*)a - *(long*)b;
}
int main() {
long N;
long a;
long b[100001] = {0};
long cnt = 0;
long i, j;
long ans = 0;
sl(N);
for(i=1;i<=N;i++) {
sl(a);
b[a]++;
}
for(i=1;i<=100000;i++) {
if(b[i] > 0) {
cnt += b[i] - 1;
ans++;
}
}
pl(cnt % 2 ? ans - 1 : ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154234/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154234/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_long(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
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca [100001 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %b) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800008) %b, i8 0, i64 800008, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not23 = icmp slt i64 %0, 1
br i1 %cmp.not23, label %vector.body.preheader, label %for.body
vector.body.preheader: ; preds = %for.body, %entry
br label %vector.body
vector.body: ; preds = %vector.body.preheader, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ]
%vec.phi = phi <2 x i64> [ %13, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
%vec.phi28 = phi <2 x i64> [ %14, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
%vec.phi29 = phi <2 x i64> [ %9, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
%vec.phi30 = phi <2 x i64> [ %10, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100001 x i64], ptr %b, i64 0, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load31 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = icmp sgt <2 x i64> %wide.load, zeroinitializer
%4 = icmp sgt <2 x i64> %wide.load31, zeroinitializer
%5 = add nsw <2 x i64> %wide.load, <i64 -1, i64 -1>
%6 = add nsw <2 x i64> %wide.load31, <i64 -1, i64 -1>
%7 = select <2 x i1> %3, <2 x i64> %5, <2 x i64> zeroinitializer
%8 = select <2 x i1> %4, <2 x i64> %6, <2 x i64> zeroinitializer
%9 = add <2 x i64> %7, %vec.phi29
%10 = add <2 x i64> %8, %vec.phi30
%11 = zext <2 x i1> %3 to <2 x i64>
%12 = zext <2 x i1> %4 to <2 x i64>
%13 = add <2 x i64> %vec.phi, %11
%14 = add <2 x i64> %vec.phi28, %12
%index.next = add nuw i64 %index, 4
%15 = icmp eq i64 %index.next, 100000
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx32 = add <2 x i64> %10, %9
%16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx32)
%bin.rdx = add <2 x i64> %14, %13
%17 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%18 = and i64 %16, 1
%cond = sub nsw i64 %17, %18
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cond)
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #6
ret i32 0
for.body: ; preds = %entry, %for.body
%i.024 = phi i64 [ %inc2, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%19 = load i64, ptr %a, align 8, !tbaa !5
%arrayidx = getelementptr inbounds [100001 x i64], ptr %b, i64 0, i64 %19
%20 = load i64, ptr %arrayidx, align 8, !tbaa !5
%inc = add nsw i64 %20, 1
store i64 %inc, ptr %arrayidx, align 8, !tbaa !5
%inc2 = add nuw nsw i64 %i.024, 1
%21 = load i64, ptr %N, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.024, %21
br i1 %cmp.not.not, label %for.body, label %vector.body.preheader, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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}
|
#include <stdio.h>
int main(){
int num, eng[26] = {0}, i;
char ch;
while(scanf("%c", &ch) != EOF){
if(ch >= 'a' && ch <= 'z'){
eng[ch - 'a']++;
} else if(ch >= 'A' && ch <= 'Z'){
eng[ch - 'A']++;
}
}
for(i = 0; i < 26; i++){
printf("%c : %d\n", 'a' + i, eng[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%eng = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %eng) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %eng, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not32 = icmp eq i32 %call31, -1
br i1 %cmp.not32, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end20
%.pre = load i32, ptr %eng, align 16, !tbaa !5
%arrayidx24.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 1
%.pre36 = load i32, ptr %arrayidx24.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 2
%.pre37 = load i32, ptr %arrayidx24.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 3
%.pre38 = load i32, ptr %arrayidx24.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 4
%.pre39 = load i32, ptr %arrayidx24.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 5
%.pre40 = load i32, ptr %arrayidx24.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 6
%.pre41 = load i32, ptr %arrayidx24.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 7
%.pre42 = load i32, ptr %arrayidx24.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 8
%.pre43 = load i32, ptr %arrayidx24.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 9
%.pre44 = load i32, ptr %arrayidx24.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 10
%.pre45 = load i32, ptr %arrayidx24.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 11
%.pre46 = load i32, ptr %arrayidx24.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 12
%.pre47 = load i32, ptr %arrayidx24.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 13
%.pre48 = load i32, ptr %arrayidx24.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 14
%.pre49 = load i32, ptr %arrayidx24.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 15
%.pre50 = load i32, ptr %arrayidx24.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 16
%.pre51 = load i32, ptr %arrayidx24.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 17
%.pre52 = load i32, ptr %arrayidx24.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 18
%.pre53 = load i32, ptr %arrayidx24.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 19
%.pre54 = load i32, ptr %arrayidx24.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 20
%.pre55 = load i32, ptr %arrayidx24.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 21
%.pre56 = load i32, ptr %arrayidx24.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 22
%.pre57 = load i32, ptr %arrayidx24.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 23
%.pre58 = load i32, ptr %arrayidx24.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 24
%.pre59 = load i32, ptr %arrayidx24.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 25
%.pre60 = load i32, ptr %arrayidx24.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%0 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call25.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call25.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call25.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call25.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call25.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call25.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call25.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call25.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call25.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call25.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call25.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call25.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call25.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call25.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call25.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call25.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call25.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call25.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call25.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call25.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call25.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call25.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %eng) #4
ret i32 0
while.body: ; preds = %entry, %if.end20
%26 = load i8, ptr %ch, align 1
%conv = sext i8 %26 to i64
%27 = add i8 %26, -97
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.end20.sink.split, label %if.else
if.else: ; preds = %while.body
%28 = add i8 %26, -65
%or.cond27 = icmp ult i8 %28, 26
br i1 %or.cond27, label %if.end20.sink.split, label %if.end20
if.end20.sink.split: ; preds = %if.else, %while.body
%.sink = phi i64 [ 4294967199, %while.body ], [ 4294967231, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [26 x i32], ptr %eng, i64 0, i64 %idxprom
%29 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc19 = add nsw i32 %29, 1
store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5
br label %if.end20
if.end20: ; preds = %if.end20.sink.split, %if.else
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i,cc[26]={0};
char c,sl;
while(scanf("%c",&c)!=EOF){
if(c>='A'&&c<='Z')c+='a'-'A';
if(c>='a'&&c<='z')cc[c-'a']++;
}
for(i=0;i<26;i++){
printf("%c : %d\n",'a'+i,cc[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154379/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154379/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cc = alloca [26 x i32], align 16
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %cc) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %cc, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not30 = icmp eq i32 %call29, -1
br i1 %cmp.not30, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end17
%.pre = load i32, ptr %cc, align 16, !tbaa !5
%arrayidx22.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 1
%.pre34 = load i32, ptr %arrayidx22.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 2
%.pre35 = load i32, ptr %arrayidx22.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 3
%.pre36 = load i32, ptr %arrayidx22.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 4
%.pre37 = load i32, ptr %arrayidx22.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 5
%.pre38 = load i32, ptr %arrayidx22.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 6
%.pre39 = load i32, ptr %arrayidx22.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 7
%.pre40 = load i32, ptr %arrayidx22.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 8
%.pre41 = load i32, ptr %arrayidx22.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 9
%.pre42 = load i32, ptr %arrayidx22.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 10
%.pre43 = load i32, ptr %arrayidx22.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 11
%.pre44 = load i32, ptr %arrayidx22.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 12
%.pre45 = load i32, ptr %arrayidx22.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 13
%.pre46 = load i32, ptr %arrayidx22.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 14
%.pre47 = load i32, ptr %arrayidx22.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 15
%.pre48 = load i32, ptr %arrayidx22.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 16
%.pre49 = load i32, ptr %arrayidx22.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 17
%.pre50 = load i32, ptr %arrayidx22.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 18
%.pre51 = load i32, ptr %arrayidx22.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 19
%.pre52 = load i32, ptr %arrayidx22.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 20
%.pre53 = load i32, ptr %arrayidx22.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 21
%.pre54 = load i32, ptr %arrayidx22.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 22
%.pre55 = load i32, ptr %arrayidx22.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx22.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 23
%.pre56 = load i32, ptr %arrayidx22.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx22.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 24
%.pre57 = load i32, ptr %arrayidx22.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx22.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 25
%.pre58 = load i32, ptr %arrayidx22.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%0 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call23.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call23.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call23.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call23.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call23.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call23.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call23.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call23.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call23.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call23.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call23.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call23.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call23.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call23.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call23.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call23.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call23.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call23.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call23.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call23.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call23.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call23.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call23.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call23.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call23.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %cc) #4
ret i32 0
while.body: ; preds = %entry, %if.end17
%26 = load i8, ptr %c, align 1
%27 = add i8 %26, -65
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%add = add nuw nsw i8 %26, 32
store i8 %add, ptr %c, align 1, !tbaa !9
br label %if.end
if.end: ; preds = %if.then, %while.body
%28 = phi i8 [ %add, %if.then ], [ %26, %while.body ]
%29 = add i8 %28, -97
%or.cond25 = icmp ult i8 %29, 26
br i1 %or.cond25, label %if.then15, label %if.end17
if.then15: ; preds = %if.end
%conv8 = zext i8 %28 to i64
%sub = add nuw nsw i64 %conv8, 4294967199
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [26 x i32], ptr %cc, i64 0, i64 %idxprom
%30 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %30, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
br label %if.end17
if.end17: ; preds = %if.then15, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define N 26
#define OOMOJI 65 // to 90
#define KOMOJI 97 // to 122
int main(void){
int i;
int c;
int a[N] = {0};
while((c=getchar()) != EOF){
if((c>=65 && c<=90) == 1){
a[c-OOMOJI]++;
}else if((c>=97 && c<=122) == 1){
a[c-KOMOJI]++;
}
}
for(i=0;i<N;i++){
printf("%c : %d\n",i+KOMOJI, a[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154436/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154436/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i29 = tail call i32 @getc(ptr noundef %0)
%cmp.not30 = icmp eq i32 %call.i29, -1
br i1 %cmp.not30, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end15
%.pre = load i32, ptr %a, align 16, !tbaa !9
%arrayidx18.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 1
%.pre35 = load i32, ptr %arrayidx18.1.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 2
%.pre36 = load i32, ptr %arrayidx18.2.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 3
%.pre37 = load i32, ptr %arrayidx18.3.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 4
%.pre38 = load i32, ptr %arrayidx18.4.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 5
%.pre39 = load i32, ptr %arrayidx18.5.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 6
%.pre40 = load i32, ptr %arrayidx18.6.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 7
%.pre41 = load i32, ptr %arrayidx18.7.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8
%.pre42 = load i32, ptr %arrayidx18.8.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 9
%.pre43 = load i32, ptr %arrayidx18.9.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 10
%.pre44 = load i32, ptr %arrayidx18.10.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 11
%.pre45 = load i32, ptr %arrayidx18.11.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12
%.pre46 = load i32, ptr %arrayidx18.12.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13
%.pre47 = load i32, ptr %arrayidx18.13.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 14
%.pre48 = load i32, ptr %arrayidx18.14.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15
%.pre49 = load i32, ptr %arrayidx18.15.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16
%.pre50 = load i32, ptr %arrayidx18.16.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 17
%.pre51 = load i32, ptr %arrayidx18.17.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 18
%.pre52 = load i32, ptr %arrayidx18.18.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 19
%.pre53 = load i32, ptr %arrayidx18.19.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 20
%.pre54 = load i32, ptr %arrayidx18.20.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 21
%.pre55 = load i32, ptr %arrayidx18.21.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 22
%.pre56 = load i32, ptr %arrayidx18.22.phi.trans.insert, align 8, !tbaa !9
%arrayidx18.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 23
%.pre57 = load i32, ptr %arrayidx18.23.phi.trans.insert, align 4, !tbaa !9
%arrayidx18.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24
%.pre58 = load i32, ptr %arrayidx18.24.phi.trans.insert, align 16, !tbaa !9
%arrayidx18.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25
%.pre59 = load i32, ptr %arrayidx18.25.phi.trans.insert, align 4, !tbaa !9
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%1 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %26)
%call19.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %25)
%call19.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %24)
%call19.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %23)
%call19.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %22)
%call19.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %21)
%call19.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %20)
%call19.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %19)
%call19.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %18)
%call19.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %17)
%call19.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %16)
%call19.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %15)
%call19.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %14)
%call19.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %13)
%call19.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %12)
%call19.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %11)
%call19.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %10)
%call19.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %9)
%call19.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %8)
%call19.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %7)
%call19.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %6)
%call19.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %5)
%call19.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %4)
%call19.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %3)
%call19.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %2)
%call19.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %1)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #4
ret i32 0
while.body: ; preds = %entry, %if.end15
%call.i31 = phi i32 [ %call.i, %if.end15 ], [ %call.i29, %entry ]
%27 = add i32 %call.i31, -65
%28 = icmp ult i32 %27, 26
br i1 %28, label %if.end15.sink.split, label %if.else
if.else: ; preds = %while.body
%29 = add i32 %call.i31, -97
%30 = icmp ult i32 %29, 26
br i1 %30, label %if.end15.sink.split, label %if.end15
if.end15.sink.split: ; preds = %if.else, %while.body
%.sink = phi i32 [ %27, %while.body ], [ %29, %if.else ]
%idxprom = zext i32 %.sink to i64
%arrayidx = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %idxprom
%31 = load i32, ptr %arrayidx, align 4, !tbaa !9
%inc14 = add nsw i32 %31, 1
store i32 %inc14, ptr %arrayidx, align 4, !tbaa !9
br label %if.end15
if.end15: ; preds = %if.end15.sink.split, %if.else
%32 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %32)
%cmp.not = icmp eq i32 %call.i, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include<stdlib.h>
int field[5][5];
int in[3][3];
void fs()
{
short int i,j;
for(i=1; i<4; ++i)
for(j=1; j<4; ++j)
{
field[i][j]=1;
}
for(i=1; i<4; ++i)
for(j=1; j<4; ++j)
{
field[i][j-1]+=in[i-1][j-1];
field[i-1][j]+=in[i-1][j-1];
field[i][j]+=in[i-1][j-1];
field[i+1][j]+=in[i-1][j-1];
field[i][j+1]+=in[i-1][j-1];
}
for(i=1; i<4; ++i)
for(j=1; j<4; ++j)
{
field[i][j] = field[i][j]%2;
}
}
int main()
{
short i,j;
for(i=0; i<3; ++i)
for(j=0; j<3; ++j)
{
scanf("%d",&in[i][j]);
}
fs();
for(i=0; i<3; ++i)
{
for(j=0; j<3; ++j)
{
printf("%d",field[i+1][j+1]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15448/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15448/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@field = dso_local local_unnamed_addr global [5 x [5 x i32]] zeroinitializer, align 16
@in = dso_local global [3 x [3 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @fs() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 0), align 4, !tbaa !5
%1 = load <2 x i32>, ptr @in, align 16, !tbaa !5
%2 = extractelement <2 x i32> %1, i64 0
%add = add nsw i32 %0, %2
store i32 %add, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 0), align 4, !tbaa !5
%add62 = add nsw i32 %2, 1
%3 = extractelement <2 x i32> %1, i64 1
%add.1 = add nsw i32 %add62, %3
%4 = load <2 x i32>, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 0, i64 1), align 4, !tbaa !5
%5 = add nsw <2 x i32> %4, %1
store <2 x i32> %5, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 0, i64 1), align 4, !tbaa !5
%add77.1 = add nsw i32 %3, 1
%6 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 0, i64 3), align 4, !tbaa !5
%7 = load <2 x i32>, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 0, i64 2), align 8, !tbaa !5
%8 = extractelement <2 x i32> %7, i64 0
%add.2 = add nsw i32 %add.1, %8
%add49.2 = add nsw i32 %6, %8
store i32 %add49.2, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 0, i64 3), align 4, !tbaa !5
%add62.2 = add nsw i32 %add77.1, %8
%9 = load <2 x i32>, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 4), align 4, !tbaa !5
%10 = add nsw <2 x i32> %9, %7
store <2 x i32> %10, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 4), align 4, !tbaa !5
%11 = extractelement <2 x i32> %7, i64 1
%add49.1176 = add nsw i32 %add.1, %11
%add62.1178 = add nsw i32 %add62, %11
%add77.1180 = add nsw i32 %11, 1
%12 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 1, i64 1), align 16, !tbaa !5
%add.1.1 = add nsw i32 %add62.1178, %12
%add49.1.1 = add nsw i32 %add.2, %12
%add77.1.1 = add nsw i32 %12, 1
%13 = load <2 x i32>, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 1, i64 2), align 4, !tbaa !5
%14 = extractelement <2 x i32> %13, i64 0
%add49.2.1 = add nsw i32 %add62.2, %14
%add77.2.1 = add nsw i32 %14, 1
%15 = load <2 x i32>, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 4), align 8, !tbaa !5
%16 = add nsw <2 x i32> %15, %13
store <2 x i32> %16, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 4), align 8, !tbaa !5
%17 = extractelement <2 x i32> %13, i64 1
%add49.2187 = add nsw i32 %add.1.1, %17
%add62.2189 = add nsw i32 %add77.1180, %17
%18 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 4, i64 1), align 4, !tbaa !5
%add77.2191 = add nsw i32 %18, %17
store i32 %add77.2191, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 4, i64 1), align 4, !tbaa !5
%add92.2193 = add nsw i32 %add77.1.1, %17
%19 = load <2 x i32>, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 2, i64 1), align 4, !tbaa !5
%20 = extractelement <2 x i32> %19, i64 0
%add.1.2 = add nsw i32 %add62.2189, %20
%add62.1.2 = add nsw i32 %add92.2193, %20
%add92.1.2 = add nsw i32 %add77.2.1, %20
%21 = extractelement <2 x i32> %19, i64 1
%add.2.2 = add nsw i32 %add62.1.2, %21
%add62.2.2 = add nsw i32 %add92.1.2, %21
%22 = load <2 x i32>, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 4, i64 2), align 8, !tbaa !5
%23 = add nsw <2 x i32> %22, %19
store <2 x i32> %23, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 4, i64 2), align 8, !tbaa !5
%24 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 4), align 4, !tbaa !5
%add92.2.2 = add nsw i32 %24, %21
store i32 %add92.2.2, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 4), align 4, !tbaa !5
%rem = srem i32 %add49.1176, 2
store i32 %rem, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 1), align 8, !tbaa !5
%rem.1 = srem i32 %add49.1.1, 2
store i32 %rem.1, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 2), align 4, !tbaa !5
%rem.2 = srem i32 %add49.2.1, 2
store i32 %rem.2, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 3), align 16, !tbaa !5
%rem.1197 = srem i32 %add49.2187, 2
store i32 %rem.1197, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 1), align 4, !tbaa !5
%25 = insertelement <2 x i32> <i32 1, i32 poison>, i32 %add77.1, i64 1
%26 = add nsw <2 x i32> %25, %7
%27 = insertelement <2 x i32> poison, i32 %12, i64 0
%28 = add <2 x i32> %13, %27
%29 = shufflevector <2 x i32> %28, <2 x i32> poison, <2 x i32> zeroinitializer
%30 = add <2 x i32> %29, %26
%31 = shufflevector <2 x i32> %30, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%32 = add nsw <2 x i32> %31, %19
%33 = srem <2 x i32> %32, <i32 2, i32 2>
store <2 x i32> %33, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 2), align 16, !tbaa !5
%rem.2199 = srem i32 %add.1.2, 2
store i32 %rem.2199, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 1), align 16, !tbaa !5
%rem.1.2 = srem i32 %add.2.2, 2
store i32 %rem.1.2, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 2), align 4, !tbaa !5
%rem.2.2 = srem i32 %add62.2.2, 2
store i32 %rem.2.2, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 3), align 8, !tbaa !5
ret void
}
; 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 @in)
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 0, i64 1))
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 0, i64 2))
%call.155 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 1, i64 0))
%call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 1, i64 1))
%call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 1, i64 2))
%call.257 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 2, i64 0))
%call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 2, i64 1))
%call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @in, i64 0, i64 2, i64 2))
tail call void @fs()
%0 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 1), align 8, !tbaa !5
%call29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%1 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 2), align 4, !tbaa !5
%call29.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 1, i64 3), align 16, !tbaa !5
%call29.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%putchar = tail call i32 @putchar(i32 10)
%3 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 1), align 4, !tbaa !5
%call29.161 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%4 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 2), align 16, !tbaa !5
%call29.1.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
%5 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 2, i64 3), align 4, !tbaa !5
%call29.2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%putchar.1 = tail call i32 @putchar(i32 10)
%6 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 1), align 16, !tbaa !5
%call29.263 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%7 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 2), align 4, !tbaa !5
%call29.1.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%8 = load i32, ptr getelementptr inbounds ([5 x [5 x i32]], ptr @field, i64 0, i64 3, i64 3), align 8, !tbaa !5
%call29.2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%putchar.2 = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { 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 #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 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int x,alph[26]={0},i;
char ch;
for(i = 0; i < 1200; i++){
scanf("%c",&ch);
if (ch >= 'A' && ch <= 'Z'){
x=ch-'A';
alph[x]++;
} else if (ch >= 'a' && ch <= 'z'){
x=ch-'a';
alph[x]++;
}
}
for(i = 0; i < 26; i++){
printf("%c : %d\n",'a'+i,alph[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154522/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154522/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%alph = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alph) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alph, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
br label %for.body
for.body: ; preds = %entry, %for.inc
%i.039 = phi i32 [ 0, %entry ], [ %inc21, %for.inc ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 1
%conv = sext i8 %0 to i64
%1 = add i8 %0, -65
%or.cond = icmp ult i8 %1, 26
br i1 %or.cond, label %for.inc.sink.split, label %if.else
if.else: ; preds = %for.body
%2 = add i8 %0, -97
%or.cond32 = icmp ult i8 %2, 26
br i1 %or.cond32, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %if.else, %for.body
%.sink = phi i64 [ 4294967231, %for.body ], [ 4294967199, %if.else ]
%sub16 = add nsw i64 %.sink, %conv
%idxprom17 = and i64 %sub16, 4294967295
%arrayidx18 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 %idxprom17
%3 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx18, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.else
%inc21 = add nuw nsw i32 %i.039, 1
%exitcond.not = icmp eq i32 %inc21, 1200
br i1 %exitcond.not, label %for.body25.preheader, label %for.body, !llvm.loop !9
for.body25.preheader: ; preds = %for.inc
%4 = load i32, ptr %alph, align 16, !tbaa !5
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %4)
%arrayidx27.1 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 1
%5 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5
%call28.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %5)
%arrayidx27.2 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 2
%6 = load i32, ptr %arrayidx27.2, align 8, !tbaa !5
%call28.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %6)
%arrayidx27.3 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 3
%7 = load i32, ptr %arrayidx27.3, align 4, !tbaa !5
%call28.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %7)
%arrayidx27.4 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 4
%8 = load i32, ptr %arrayidx27.4, align 16, !tbaa !5
%call28.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %8)
%arrayidx27.5 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 5
%9 = load i32, ptr %arrayidx27.5, align 4, !tbaa !5
%call28.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %9)
%arrayidx27.6 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 6
%10 = load i32, ptr %arrayidx27.6, align 8, !tbaa !5
%call28.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %10)
%arrayidx27.7 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 7
%11 = load i32, ptr %arrayidx27.7, align 4, !tbaa !5
%call28.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %11)
%arrayidx27.8 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 8
%12 = load i32, ptr %arrayidx27.8, align 16, !tbaa !5
%call28.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %12)
%arrayidx27.9 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 9
%13 = load i32, ptr %arrayidx27.9, align 4, !tbaa !5
%call28.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %13)
%arrayidx27.10 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 10
%14 = load i32, ptr %arrayidx27.10, align 8, !tbaa !5
%call28.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %14)
%arrayidx27.11 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 11
%15 = load i32, ptr %arrayidx27.11, align 4, !tbaa !5
%call28.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %15)
%arrayidx27.12 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 12
%16 = load i32, ptr %arrayidx27.12, align 16, !tbaa !5
%call28.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %16)
%arrayidx27.13 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 13
%17 = load i32, ptr %arrayidx27.13, align 4, !tbaa !5
%call28.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %17)
%arrayidx27.14 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 14
%18 = load i32, ptr %arrayidx27.14, align 8, !tbaa !5
%call28.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %18)
%arrayidx27.15 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 15
%19 = load i32, ptr %arrayidx27.15, align 4, !tbaa !5
%call28.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %19)
%arrayidx27.16 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 16
%20 = load i32, ptr %arrayidx27.16, align 16, !tbaa !5
%call28.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %20)
%arrayidx27.17 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 17
%21 = load i32, ptr %arrayidx27.17, align 4, !tbaa !5
%call28.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %21)
%arrayidx27.18 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 18
%22 = load i32, ptr %arrayidx27.18, align 8, !tbaa !5
%call28.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %22)
%arrayidx27.19 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 19
%23 = load i32, ptr %arrayidx27.19, align 4, !tbaa !5
%call28.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %23)
%arrayidx27.20 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 20
%24 = load i32, ptr %arrayidx27.20, align 16, !tbaa !5
%call28.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %24)
%arrayidx27.21 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 21
%25 = load i32, ptr %arrayidx27.21, align 4, !tbaa !5
%call28.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %25)
%arrayidx27.22 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 22
%26 = load i32, ptr %arrayidx27.22, align 8, !tbaa !5
%call28.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %26)
%arrayidx27.23 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 23
%27 = load i32, ptr %arrayidx27.23, align 4, !tbaa !5
%call28.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %27)
%arrayidx27.24 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 24
%28 = load i32, ptr %arrayidx27.24, align 16, !tbaa !5
%call28.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %28)
%arrayidx27.25 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 25
%29 = load i32, ptr %arrayidx27.25, align 4, !tbaa !5
%call28.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %29)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alph) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <ctype.h>
int main(){
int counter[26]={0};
int i,num;
char ch;
while (scanf("%c",&ch)!=EOF)
{
if (isupper(ch))
{
ch=tolower(ch);
}
num=ch-'a';
counter[num]++;
}
for (i=0; i<26; i++)
{
printf("%c : %d\n",i+'a',counter[i]);//ch-'a'??§??°??????????????????i+'a'??§???????????´???
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%counter = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %counter) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %counter, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not21 = icmp eq i32 %call20, -1
br i1 %cmp.not21, label %for.cond.preheader, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%call1 = tail call ptr @__ctype_b_loc() #6
br label %while.body
for.cond.preheader.loopexit: ; preds = %if.end
%.pre = load i32, ptr %counter, align 16, !tbaa !5
%arrayidx14.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 1
%.pre25 = load i32, ptr %arrayidx14.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 2
%.pre26 = load i32, ptr %arrayidx14.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 3
%.pre27 = load i32, ptr %arrayidx14.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 4
%.pre28 = load i32, ptr %arrayidx14.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 5
%.pre29 = load i32, ptr %arrayidx14.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 6
%.pre30 = load i32, ptr %arrayidx14.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 7
%.pre31 = load i32, ptr %arrayidx14.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 8
%.pre32 = load i32, ptr %arrayidx14.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 9
%.pre33 = load i32, ptr %arrayidx14.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 10
%.pre34 = load i32, ptr %arrayidx14.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 11
%.pre35 = load i32, ptr %arrayidx14.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 12
%.pre36 = load i32, ptr %arrayidx14.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 13
%.pre37 = load i32, ptr %arrayidx14.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 14
%.pre38 = load i32, ptr %arrayidx14.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 15
%.pre39 = load i32, ptr %arrayidx14.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 16
%.pre40 = load i32, ptr %arrayidx14.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 17
%.pre41 = load i32, ptr %arrayidx14.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 18
%.pre42 = load i32, ptr %arrayidx14.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 19
%.pre43 = load i32, ptr %arrayidx14.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 20
%.pre44 = load i32, ptr %arrayidx14.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 21
%.pre45 = load i32, ptr %arrayidx14.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 22
%.pre46 = load i32, ptr %arrayidx14.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx14.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 23
%.pre47 = load i32, ptr %arrayidx14.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx14.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 24
%.pre48 = load i32, ptr %arrayidx14.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx14.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 25
%.pre49 = load i32, ptr %arrayidx14.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%0 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre31, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre30, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre29, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre28, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre27, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre26, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre25, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call15.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call15.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call15.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call15.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call15.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call15.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call15.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call15.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call15.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call15.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call15.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call15.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call15.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call15.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call15.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call15.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call15.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call15.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call15.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call15.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call15.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call15.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call15.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call15.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call15.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %counter) #5
ret i32 0
while.body: ; preds = %while.body.lr.ph, %if.end
%26 = load ptr, ptr %call1, align 8, !tbaa !9
%27 = load i8, ptr %ch, align 1, !tbaa !11
%idxprom = sext i8 %27 to i64
%arrayidx = getelementptr inbounds i16, ptr %26, i64 %idxprom
%28 = load i16, ptr %arrayidx, align 2, !tbaa !12
%29 = and i16 %28, 256
%tobool.not = icmp eq i16 %29, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%call3 = tail call ptr @__ctype_tolower_loc() #6
%30 = load ptr, ptr %call3, align 8, !tbaa !9
%arrayidx6 = getelementptr inbounds i32, ptr %30, i64 %idxprom
%31 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%conv7 = trunc i32 %31 to i8
store i8 %conv7, ptr %ch, align 1, !tbaa !11
%.pre50 = sext i8 %conv7 to i64
br label %if.end
if.end: ; preds = %if.then, %while.body
%conv8.pre-phi = phi i64 [ %.pre50, %if.then ], [ %idxprom, %while.body ]
%sub = add nsw i64 %conv8.pre-phi, -97
%arrayidx10 = getelementptr inbounds [26 x i32], ptr %counter, i64 0, i64 %sub
%32 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%inc = add nsw i32 %32, 1
store i32 %inc, ptr %arrayidx10, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #4
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_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
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <ctype.h>
int main(int argc, char *args[])
{
int alpha[26];
int i;
char ch;
for( i=0; i<26; i++ ) {
alpha[i] = 0;
}
while( scanf("%c", &ch) != EOF ) {
if( (0x41 <= ch && ch <= 0x5a) |
(0x61 <= ch && ch <= 0x7a) ) {
alpha[tolower(ch) - 'a']++;
}
}
for( i=0; i<26; i++ ) {
printf("%c : %d\n", i+'a', alpha[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %args) local_unnamed_addr #0 {
entry:
%alpha = alloca [26 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alpha) #5
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alpha, i8 0, i64 104, i1 false), !tbaa !5
%call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp1.not42 = icmp eq i32 %call41, -1
br i1 %cmp1.not42, label %for.cond23.preheader, label %while.body
for.cond23.preheader.loopexit: ; preds = %if.end
%.pre = load i32, ptr %alpha, align 16, !tbaa !5
%arrayidx28.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 1
%.pre47 = load i32, ptr %arrayidx28.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 2
%.pre48 = load i32, ptr %arrayidx28.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 3
%.pre49 = load i32, ptr %arrayidx28.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 4
%.pre50 = load i32, ptr %arrayidx28.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 5
%.pre51 = load i32, ptr %arrayidx28.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 6
%.pre52 = load i32, ptr %arrayidx28.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 7
%.pre53 = load i32, ptr %arrayidx28.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 8
%.pre54 = load i32, ptr %arrayidx28.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 9
%.pre55 = load i32, ptr %arrayidx28.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 10
%.pre56 = load i32, ptr %arrayidx28.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 11
%.pre57 = load i32, ptr %arrayidx28.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 12
%.pre58 = load i32, ptr %arrayidx28.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 13
%.pre59 = load i32, ptr %arrayidx28.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 14
%.pre60 = load i32, ptr %arrayidx28.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 15
%.pre61 = load i32, ptr %arrayidx28.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 16
%.pre62 = load i32, ptr %arrayidx28.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 17
%.pre63 = load i32, ptr %arrayidx28.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 18
%.pre64 = load i32, ptr %arrayidx28.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 19
%.pre65 = load i32, ptr %arrayidx28.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 20
%.pre66 = load i32, ptr %arrayidx28.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 21
%.pre67 = load i32, ptr %arrayidx28.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 22
%.pre68 = load i32, ptr %arrayidx28.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx28.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 23
%.pre69 = load i32, ptr %arrayidx28.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx28.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 24
%.pre70 = load i32, ptr %arrayidx28.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx28.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 25
%.pre71 = load i32, ptr %arrayidx28.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond23.preheader
for.cond23.preheader: ; preds = %for.cond23.preheader.loopexit, %entry
%0 = phi i32 [ %.pre71, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre70, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre69, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre68, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre67, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre66, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre65, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre64, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre63, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre62, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre61, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre60, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre59, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre58, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre57, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre56, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre55, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre54, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre53, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre52, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre51, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre50, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre49, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre48, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre47, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond23.preheader.loopexit ], [ 0, %entry ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call29.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call29.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call29.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call29.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call29.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call29.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call29.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call29.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call29.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call29.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call29.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call29.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call29.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call29.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call29.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call29.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call29.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call29.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call29.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call29.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call29.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call29.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call29.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call29.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call29.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alpha) #5
ret i32 0
while.body: ; preds = %entry, %if.end
%26 = load i8, ptr %ch, align 1
%27 = and i8 %26, -33
%28 = add i8 %27, -65
%or39 = icmp ult i8 %28, 26
br i1 %or39, label %if.then, label %if.end
if.then: ; preds = %while.body
%call16 = tail call ptr @__ctype_tolower_loc() #6
%29 = load ptr, ptr %call16, align 8, !tbaa !9
%idxprom18 = sext i8 %26 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %29, i64 %idxprom18
%30 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%sub = add nsw i32 %30, -97
%idxprom20 = sext i32 %sub to i64
%arrayidx21 = getelementptr inbounds [26 x i32], ptr %alpha, i64 0, i64 %idxprom20
%31 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%inc22 = add nsw i32 %31, 1
store i32 %inc22, ptr %arrayidx21, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp1.not = icmp eq i32 %call, -1
br i1 %cmp1.not, label %for.cond23.preheader.loopexit, label %while.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define N 1200
int main(void){
char ny,alp=0;
int i=0;
int su[26]={0};
while(scanf("%c",&ny)!=EOF){
for(i=0;i<26;i++){
if((ny==('a'+i))||(ny==('A'+i))){
su[i]=su[i]+1;
}
}
}
for(i=0;i<26;i++){
alp=0;
alp='a'+i;
printf("%c : %d\n",alp,su[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154667/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154667/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ny = alloca i8, align 1
%su = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ny) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %su) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %su, i8 0, i64 104, i1 false)
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ny)
%cmp.not35 = icmp eq i32 %call34, -1
br i1 %cmp.not35, label %for.cond11.preheader, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.inc.1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ny)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond11.preheader.loopexit, label %for.cond.preheader, !llvm.loop !5
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%0 = load i8, ptr %ny, align 1, !tbaa !7
%conv = sext i8 %0 to i64
%1 = and i64 %conv, 4294967295
br label %for.body
for.cond11.preheader.loopexit: ; preds = %while.cond.loopexit
%.pre = load i32, ptr %su, align 16, !tbaa !10
%arrayidx19.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 1
%.pre45 = load i32, ptr %arrayidx19.1.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 2
%.pre46 = load i32, ptr %arrayidx19.2.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 3
%.pre47 = load i32, ptr %arrayidx19.3.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 4
%.pre48 = load i32, ptr %arrayidx19.4.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 5
%.pre49 = load i32, ptr %arrayidx19.5.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 6
%.pre50 = load i32, ptr %arrayidx19.6.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 7
%.pre51 = load i32, ptr %arrayidx19.7.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 8
%.pre52 = load i32, ptr %arrayidx19.8.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 9
%.pre53 = load i32, ptr %arrayidx19.9.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 10
%.pre54 = load i32, ptr %arrayidx19.10.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 11
%.pre55 = load i32, ptr %arrayidx19.11.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 12
%.pre56 = load i32, ptr %arrayidx19.12.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 13
%.pre57 = load i32, ptr %arrayidx19.13.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 14
%.pre58 = load i32, ptr %arrayidx19.14.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 15
%.pre59 = load i32, ptr %arrayidx19.15.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 16
%.pre60 = load i32, ptr %arrayidx19.16.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 17
%.pre61 = load i32, ptr %arrayidx19.17.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 18
%.pre62 = load i32, ptr %arrayidx19.18.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 19
%.pre63 = load i32, ptr %arrayidx19.19.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 20
%.pre64 = load i32, ptr %arrayidx19.20.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 21
%.pre65 = load i32, ptr %arrayidx19.21.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 22
%.pre66 = load i32, ptr %arrayidx19.22.phi.trans.insert, align 8, !tbaa !10
%arrayidx19.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 23
%.pre67 = load i32, ptr %arrayidx19.23.phi.trans.insert, align 4, !tbaa !10
%arrayidx19.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 24
%.pre68 = load i32, ptr %arrayidx19.24.phi.trans.insert, align 16, !tbaa !10
%arrayidx19.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 25
%.pre69 = load i32, ptr %arrayidx19.25.phi.trans.insert, align 4, !tbaa !10
br label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.cond11.preheader.loopexit, %entry
%2 = phi i32 [ %.pre69, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre68, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre67, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre66, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre65, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre64, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre63, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre62, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre61, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre60, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre59, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre58, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre57, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre56, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre55, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre54, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre53, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre52, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre51, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre50, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre49, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre48, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre47, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre46, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre45, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%27 = phi i32 [ %.pre, %for.cond11.preheader.loopexit ], [ 0, %entry ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %27)
%call20.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %26)
%call20.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %25)
%call20.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %24)
%call20.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %23)
%call20.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %22)
%call20.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %21)
%call20.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %20)
%call20.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %19)
%call20.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %18)
%call20.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %17)
%call20.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %16)
%call20.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %15)
%call20.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %14)
%call20.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %13)
%call20.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %12)
%call20.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %11)
%call20.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %10)
%call20.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %9)
%call20.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %8)
%call20.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %7)
%call20.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %6)
%call20.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %5)
%call20.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %4)
%call20.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %3)
%call20.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %su) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ny) #4
ret i32 0
for.body: ; preds = %for.inc.1, %for.cond.preheader
%indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%28 = add nuw nsw i64 %indvars.iv, 97
%cmp2 = icmp eq i64 %28, %1
%29 = add nuw nsw i64 %indvars.iv, 65
%cmp6 = icmp eq i64 %29, %1
%or.cond = select i1 %cmp2, i1 true, i1 %cmp6
br i1 %or.cond, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 %indvars.iv
%30 = load i32, ptr %arrayidx, align 8, !tbaa !10
%add8 = add nsw i32 %30, 1
store i32 %add8, ptr %arrayidx, align 8, !tbaa !10
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%31 = add nuw nsw i64 %indvars.iv, 98
%cmp2.1 = icmp eq i64 %31, %1
%32 = add nuw nsw i64 %indvars.iv, 66
%cmp6.1 = icmp eq i64 %32, %1
%or.cond.1 = select i1 %cmp2.1, i1 true, i1 %cmp6.1
br i1 %or.cond.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [26 x i32], ptr %su, i64 0, i64 %indvars.iv.next
%33 = load i32, ptr %arrayidx.1, align 4, !tbaa !10
%add8.1 = add nsw i32 %33, 1
store i32 %add8.1, ptr %arrayidx.1, align 4, !tbaa !10
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 26
br i1 %exitcond.not.1, label %while.cond.loopexit, 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: 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = distinct !{!12, !6}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define ARRSIZE(arr) (sizeof(arr)/sizeof(*(arr)))
// int cmpfunc (const void * a, const void * b) {
// return ( *(int*)a - *(int*)b );
// }
int compare(const void *a, const void *b) {
int x1 = *(const int*)a;
int x2 = *(const int*)b;
if (x1 > x2) return 1;
if (x1 < x2) return -1;
// x1 and x2 are equal; compare y's
int y1 = *(((const int*)a)+1);
int y2 = *(((const int*)b)+1);
if (y1 > y2) return 1;
if (y1 < y2) return -1;
return 0;
}
int main(){
int n,m,p1,q1,p2,q2,k,max,i,x,y,check_max,j,temp,d;
scanf("%d",&x);
for(p1 = 0;p1 < x;p1++){
scanf("%d",&y);
int a[y][2];
int temp = 0;
for(i=0;i<y;i++){
scanf("%d %d",&a[i][0], &a[i][1]);
}
qsort(a, ARRSIZE(a), sizeof(*a), compare);
// printf("------------------\n");
// for(i=0;i<y;i++){
// printf("%d %d\n",a[i][0], a[i][1]);
// }
// printf("------------------\n");
int p = 0, q = 0;
for(i=1;i<y;i++){
if(a[i][0] < a[i-1][0] || a[i][1] < a[i-1][1]){
temp = 1;
break;
}
}
if(temp == 1){
printf("NO\n");
}
else{
printf("YES\n");
int p = 0, q = 0;
for(i=0;i<y;i++){
int m = a[i][0], n = a[i][1];
while(m > p){
printf("R");
m--;
}
while(n > q){
printf("U");
n--;
}
p = a[i][0];
q = a[i][1];
}
printf("\n");
}
// scanf("%d %d %d %d",&a[0], &a[1], &a[2], &d);
// qsort(a, 3, sizeof(int), cmpfunc);
}
// printf("%lld %lld %lld %lld", ini1,ini2,dest1,dest2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15471/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15471/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %cleanup12, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp slt i32 %0, %1
br i1 %cmp1, label %cleanup12, label %if.end3
if.end3: ; preds = %if.end
%add.ptr = getelementptr inbounds i32, ptr %a, i64 1
%2 = load i32, ptr %add.ptr, align 4, !tbaa !5
%add.ptr4 = getelementptr inbounds i32, ptr %b, i64 1
%3 = load i32, ptr %add.ptr4, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %2, %3
%cmp8 = icmp slt i32 %2, %3
%. = sext i1 %cmp8 to i32
%retval.0 = select i1 %cmp5, i32 1, i32 %.
br label %cleanup12
cleanup12: ; preds = %if.end, %entry, %if.end3
%retval.1 = phi i32 [ %retval.0, %if.end3 ], [ 1, %entry ], [ -1, %if.end ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp104 = icmp sgt i32 %0, 0
br i1 %cmp104, label %for.body, label %for.end70
for.body: ; preds = %entry, %if.end67
%p1.0105 = phi i32 [ %inc69, %if.end67 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%1 = load i32, ptr %y, align 4, !tbaa !5
%2 = zext i32 %1 to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca [2 x i32], i64 %2, align 16
%4 = load i32, ptr %y, align 4, !tbaa !5
%cmp492 = icmp sgt i32 %4, 0
br i1 %cmp492, label %for.body5, label %for.end
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv
%arrayidx9 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv, i64 1
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %y, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body
call void @qsort(ptr noundef nonnull %vla, i64 noundef %2, i64 noundef 8, ptr noundef nonnull @compare) #7
%7 = load i32, ptr %y, align 4, !tbaa !5
%cmp1294 = icmp sgt i32 %7, 1
br i1 %cmp1294, label %for.body13.preheader, label %if.else
for.body13.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %7 to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
br label %for.body13
for.cond11: ; preds = %lor.lhs.false
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count
br i1 %exitcond.not, label %if.else, label %for.body13, !llvm.loop !11
for.body13: ; preds = %for.body13.preheader, %for.cond11
%8 = phi i32 [ %.pre, %for.body13.preheader ], [ %9, %for.cond11 ]
%indvars.iv107 = phi i64 [ 1, %for.body13.preheader ], [ %indvars.iv.next108, %for.cond11 ]
%arrayidx15 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv107
%9 = load i32, ptr %arrayidx15, align 8, !tbaa !5
%cmp20 = icmp slt i32 %9, %8
br i1 %cmp20, label %if.then33, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body13
%10 = add nsw i64 %indvars.iv107, -1
%arrayidx23 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv107, i64 1
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [2 x i32], ptr %vla, i64 %10, i64 1
%12 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp slt i32 %11, %12
br i1 %cmp28, label %if.then33, label %for.cond11
if.then33: ; preds = %lor.lhs.false, %for.body13
%puts91 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %if.end67
if.else: ; preds = %for.cond11, %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%13 = load i32, ptr %y, align 4, !tbaa !5
%cmp39100 = icmp sgt i32 %13, 0
br i1 %cmp39100, label %for.body40, label %for.end65
for.body40: ; preds = %if.else, %while.end56
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %while.end56 ], [ 0, %if.else ]
%q37.0103 = phi i32 [ %17, %while.end56 ], [ 0, %if.else ]
%p36.0102 = phi i32 [ %16, %while.end56 ], [ 0, %if.else ]
%arrayidx43 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv111
%14 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%arrayidx48 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv111, i64 1
%15 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%cmp4996 = icmp sgt i32 %14, %p36.0102
br i1 %cmp4996, label %while.body, label %while.cond51.preheader
while.cond51.preheader: ; preds = %while.body, %for.body40
%cmp5298 = icmp sgt i32 %15, %q37.0103
br i1 %cmp5298, label %while.body53, label %while.end56
while.body: ; preds = %for.body40, %while.body
%m41.097 = phi i32 [ %dec, %while.body ], [ %14, %for.body40 ]
%putchar90 = call i32 @putchar(i32 82)
%dec = add nsw i32 %m41.097, -1
%cmp49 = icmp sgt i32 %dec, %p36.0102
br i1 %cmp49, label %while.body, label %while.cond51.preheader, !llvm.loop !12
while.body53: ; preds = %while.cond51.preheader, %while.body53
%n45.099 = phi i32 [ %dec55, %while.body53 ], [ %15, %while.cond51.preheader ]
%putchar89 = call i32 @putchar(i32 85)
%dec55 = add nsw i32 %n45.099, -1
%cmp52 = icmp sgt i32 %dec55, %q37.0103
br i1 %cmp52, label %while.body53, label %while.end56, !llvm.loop !13
while.end56: ; preds = %while.body53, %while.cond51.preheader
%16 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%17 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%18 = load i32, ptr %y, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp39 = icmp slt i64 %indvars.iv.next112, %19
br i1 %cmp39, label %for.body40, label %for.end65, !llvm.loop !14
for.end65: ; preds = %while.end56, %if.else
%putchar = call i32 @putchar(i32 10)
br label %if.end67
if.end67: ; preds = %for.end65, %if.then33
call void @llvm.stackrestore.p0(ptr %3)
%inc69 = add nuw nsw i32 %p1.0105, 1
%20 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp slt i32 %inc69, %20
br i1 %cmp, label %for.body, label %for.end70, !llvm.loop !15
for.end70: ; preds = %if.end67, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#pragma warning (disable:4996)
#include <stdio.h>
#include <ctype.h>
void inputstr(int *alpha){
int num;
char ch;
while (scanf("%c", &ch) != EOF){
ch = tolower(ch);
num = ch - 'a';
if (0<=num&&num<=26)++alpha[num];
}
}
void output(int *alpha){
unsigned short int i;
for (i = 0; i < 26; i++){
printf("%c : %d\n", 'a' + i, alpha[i]);
}
}
int main(void){
int alpha[26] = { 0 };
inputstr(alpha);
output(alpha);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @inputstr(ptr nocapture noundef %alpha) local_unnamed_addr #0 {
entry:
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%call1 = tail call ptr @__ctype_tolower_loc() #6
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%0 = load ptr, ptr %call1, align 8, !tbaa !5
%1 = load i8, ptr %ch, align 1, !tbaa !9
%idxprom = sext i8 %1 to i64
%arrayidx = getelementptr inbounds i32, ptr %0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !10
%conv2 = trunc i32 %2 to i8
store i8 %conv2, ptr %ch, align 1, !tbaa !9
%sext = shl i32 %2, 24
%3 = add i32 %sext, -1610612737
%or.cond = icmp ult i32 %3, 469762047
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%conv3 = and i32 %2, 255
%sub = add nsw i32 %conv3, -97
%idxprom8 = zext i32 %sub to i64
%arrayidx9 = getelementptr inbounds i32, ptr %alpha, i64 %idxprom8
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !10
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %arrayidx9, align 4, !tbaa !10
br label %if.end
if.end: ; preds = %if.then, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @output(ptr nocapture noundef readonly %alpha) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %alpha, align 4, !tbaa !10
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %0)
%arrayidx.1 = getelementptr inbounds i32, ptr %alpha, i64 1
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !10
%call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %1)
%arrayidx.2 = getelementptr inbounds i32, ptr %alpha, i64 2
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !10
%call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %2)
%arrayidx.3 = getelementptr inbounds i32, ptr %alpha, i64 3
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !10
%call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %3)
%arrayidx.4 = getelementptr inbounds i32, ptr %alpha, i64 4
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !10
%call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %4)
%arrayidx.5 = getelementptr inbounds i32, ptr %alpha, i64 5
%5 = load i32, ptr %arrayidx.5, align 4, !tbaa !10
%call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %5)
%arrayidx.6 = getelementptr inbounds i32, ptr %alpha, i64 6
%6 = load i32, ptr %arrayidx.6, align 4, !tbaa !10
%call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %6)
%arrayidx.7 = getelementptr inbounds i32, ptr %alpha, i64 7
%7 = load i32, ptr %arrayidx.7, align 4, !tbaa !10
%call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %7)
%arrayidx.8 = getelementptr inbounds i32, ptr %alpha, i64 8
%8 = load i32, ptr %arrayidx.8, align 4, !tbaa !10
%call.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %8)
%arrayidx.9 = getelementptr inbounds i32, ptr %alpha, i64 9
%9 = load i32, ptr %arrayidx.9, align 4, !tbaa !10
%call.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %9)
%arrayidx.10 = getelementptr inbounds i32, ptr %alpha, i64 10
%10 = load i32, ptr %arrayidx.10, align 4, !tbaa !10
%call.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %10)
%arrayidx.11 = getelementptr inbounds i32, ptr %alpha, i64 11
%11 = load i32, ptr %arrayidx.11, align 4, !tbaa !10
%call.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %11)
%arrayidx.12 = getelementptr inbounds i32, ptr %alpha, i64 12
%12 = load i32, ptr %arrayidx.12, align 4, !tbaa !10
%call.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %12)
%arrayidx.13 = getelementptr inbounds i32, ptr %alpha, i64 13
%13 = load i32, ptr %arrayidx.13, align 4, !tbaa !10
%call.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %13)
%arrayidx.14 = getelementptr inbounds i32, ptr %alpha, i64 14
%14 = load i32, ptr %arrayidx.14, align 4, !tbaa !10
%call.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %14)
%arrayidx.15 = getelementptr inbounds i32, ptr %alpha, i64 15
%15 = load i32, ptr %arrayidx.15, align 4, !tbaa !10
%call.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %15)
%arrayidx.16 = getelementptr inbounds i32, ptr %alpha, i64 16
%16 = load i32, ptr %arrayidx.16, align 4, !tbaa !10
%call.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %16)
%arrayidx.17 = getelementptr inbounds i32, ptr %alpha, i64 17
%17 = load i32, ptr %arrayidx.17, align 4, !tbaa !10
%call.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %17)
%arrayidx.18 = getelementptr inbounds i32, ptr %alpha, i64 18
%18 = load i32, ptr %arrayidx.18, align 4, !tbaa !10
%call.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %18)
%arrayidx.19 = getelementptr inbounds i32, ptr %alpha, i64 19
%19 = load i32, ptr %arrayidx.19, align 4, !tbaa !10
%call.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %19)
%arrayidx.20 = getelementptr inbounds i32, ptr %alpha, i64 20
%20 = load i32, ptr %arrayidx.20, align 4, !tbaa !10
%call.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %20)
%arrayidx.21 = getelementptr inbounds i32, ptr %alpha, i64 21
%21 = load i32, ptr %arrayidx.21, align 4, !tbaa !10
%call.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %21)
%arrayidx.22 = getelementptr inbounds i32, ptr %alpha, i64 22
%22 = load i32, ptr %arrayidx.22, align 4, !tbaa !10
%call.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %22)
%arrayidx.23 = getelementptr inbounds i32, ptr %alpha, i64 23
%23 = load i32, ptr %arrayidx.23, align 4, !tbaa !10
%call.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %23)
%arrayidx.24 = getelementptr inbounds i32, ptr %alpha, i64 24
%24 = load i32, ptr %arrayidx.24, align 4, !tbaa !10
%call.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %24)
%arrayidx.25 = getelementptr inbounds i32, ptr %alpha, i64 25
%25 = load i32, ptr %arrayidx.25, align 4, !tbaa !10
%call.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %25)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch.i = alloca i8, align 1
%alpha = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alpha) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alpha, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch.i) #5
%call12.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch.i)
%cmp.not13.i = icmp eq i32 %call12.i, -1
br i1 %cmp.not13.i, label %inputstr.exit, label %while.body.lr.ph.i
while.body.lr.ph.i: ; preds = %entry
%call1.i = tail call ptr @__ctype_tolower_loc() #6
br label %while.body.i
while.body.i: ; preds = %if.end.i, %while.body.lr.ph.i
%0 = load ptr, ptr %call1.i, align 8, !tbaa !5
%1 = load i8, ptr %ch.i, align 1, !tbaa !9
%idxprom.i = sext i8 %1 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %0, i64 %idxprom.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !10
%conv2.i = trunc i32 %2 to i8
store i8 %conv2.i, ptr %ch.i, align 1, !tbaa !9
%sext.i = shl i32 %2, 24
%3 = add i32 %sext.i, -1610612737
%or.cond.i = icmp ult i32 %3, 469762047
br i1 %or.cond.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %while.body.i
%conv3.i = and i32 %2, 255
%sub.i = add nsw i32 %conv3.i, -97
%idxprom8.i = zext i32 %sub.i to i64
%arrayidx9.i = getelementptr inbounds i32, ptr %alpha, i64 %idxprom8.i
%4 = load i32, ptr %arrayidx9.i, align 4, !tbaa !10
%inc.i = add nsw i32 %4, 1
store i32 %inc.i, ptr %arrayidx9.i, align 4, !tbaa !10
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch.i)
%cmp.not.i = icmp eq i32 %call.i, -1
br i1 %cmp.not.i, label %inputstr.exit, label %while.body.i, !llvm.loop !12
inputstr.exit: ; preds = %if.end.i, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch.i) #5
call void @output(ptr noundef nonnull %alpha)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alpha) #5
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) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
// 入力文字列に含まれているアルファベット数を表示一覧にして表示
int main()
{
// 'a': 0, 'b': 1,...に対応,大文字は小文字として扱って格納
int aiAlphaList[26];
char achInput[1200];
int iCnt;
int iIndex; // 格納先のインデックス
// 初期化
for (iCnt = 0; iCnt < 26; iCnt++)
{
aiAlphaList[iCnt] = 0;
}
// EOFまで読み込み
while(fgets(achInput, 1200, stdin) != NULL)
{
for (iCnt = 0; achInput[iCnt] != '\0' ; iCnt++)
{
if ('a' <= achInput[iCnt] && achInput[iCnt] <= 'z') // 小文字
{
iIndex = achInput[iCnt] - 'a';
aiAlphaList[iIndex]++;
}
else if ('A' <= achInput[iCnt] && achInput[iCnt] <= 'Z') // 大文字
{
iIndex = achInput[iCnt] - 'A';
aiAlphaList[iIndex]++;
}
else
{
// アルファベット以外は読み飛ばす
}
}
}
// カウント結果出力
for (iCnt = 0; iCnt < 26; iCnt++)
{
printf("%c : %d\n", (iCnt + 'a'), aiAlphaList[iCnt]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154803/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154803/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%aiAlphaList = alloca [26 x i32], align 16
%achInput = alloca [1200 x i8], align 16
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %aiAlphaList) #4
call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %achInput) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %aiAlphaList, i8 0, i64 104, i1 false), !tbaa !5
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call79 = call ptr @fgets(ptr noundef nonnull %achInput, i32 noundef 1200, ptr noundef %0)
%cmp1.not80 = icmp eq ptr %call79, null
br i1 %cmp1.not80, label %for.cond48.preheader, label %for.cond2.preheader
while.cond.loopexit: ; preds = %for.inc45, %for.cond2.preheader
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call = call ptr @fgets(ptr noundef nonnull %achInput, i32 noundef 1200, ptr noundef %1)
%cmp1.not = icmp eq ptr %call, null
br i1 %cmp1.not, label %for.cond48.preheader.loopexit, label %for.cond2.preheader, !llvm.loop !11
for.cond2.preheader: ; preds = %entry, %while.cond.loopexit
%2 = load i8, ptr %achInput, align 16, !tbaa !13
%cmp5.not76 = icmp eq i8 %2, 0
br i1 %cmp5.not76, label %while.cond.loopexit, label %for.body7
for.cond48.preheader.loopexit: ; preds = %while.cond.loopexit
%.pre = load i32, ptr %aiAlphaList, align 16, !tbaa !5
%arrayidx53.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 1
%.pre87 = load i32, ptr %arrayidx53.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 2
%.pre88 = load i32, ptr %arrayidx53.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 3
%.pre89 = load i32, ptr %arrayidx53.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 4
%.pre90 = load i32, ptr %arrayidx53.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 5
%.pre91 = load i32, ptr %arrayidx53.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 6
%.pre92 = load i32, ptr %arrayidx53.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 7
%.pre93 = load i32, ptr %arrayidx53.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 8
%.pre94 = load i32, ptr %arrayidx53.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 9
%.pre95 = load i32, ptr %arrayidx53.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 10
%.pre96 = load i32, ptr %arrayidx53.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 11
%.pre97 = load i32, ptr %arrayidx53.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 12
%.pre98 = load i32, ptr %arrayidx53.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 13
%.pre99 = load i32, ptr %arrayidx53.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 14
%.pre100 = load i32, ptr %arrayidx53.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 15
%.pre101 = load i32, ptr %arrayidx53.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 16
%.pre102 = load i32, ptr %arrayidx53.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 17
%.pre103 = load i32, ptr %arrayidx53.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 18
%.pre104 = load i32, ptr %arrayidx53.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 19
%.pre105 = load i32, ptr %arrayidx53.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 20
%.pre106 = load i32, ptr %arrayidx53.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 21
%.pre107 = load i32, ptr %arrayidx53.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 22
%.pre108 = load i32, ptr %arrayidx53.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx53.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 23
%.pre109 = load i32, ptr %arrayidx53.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx53.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 24
%.pre110 = load i32, ptr %arrayidx53.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx53.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 25
%.pre111 = load i32, ptr %arrayidx53.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond48.preheader
for.cond48.preheader: ; preds = %for.cond48.preheader.loopexit, %entry
%3 = phi i32 [ %.pre111, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre110, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre109, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre108, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre107, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre106, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre105, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre104, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre103, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre102, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre101, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre100, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre99, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre98, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre97, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre96, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre95, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre94, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre93, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre92, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre91, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre90, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre89, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre88, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%27 = phi i32 [ %.pre87, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%28 = phi i32 [ %.pre, %for.cond48.preheader.loopexit ], [ 0, %entry ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %28)
%call54.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %27)
%call54.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %26)
%call54.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %25)
%call54.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %24)
%call54.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %23)
%call54.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %22)
%call54.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %21)
%call54.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %20)
%call54.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %19)
%call54.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %18)
%call54.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %17)
%call54.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %16)
%call54.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %15)
%call54.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %14)
%call54.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %13)
%call54.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %12)
%call54.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %11)
%call54.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %10)
%call54.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %9)
%call54.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %8)
%call54.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %7)
%call54.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %6)
%call54.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %5)
%call54.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %4)
%call54.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %achInput) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %aiAlphaList) #4
ret i32 0
for.body7: ; preds = %for.cond2.preheader, %for.inc45
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc45 ], [ 0, %for.cond2.preheader ]
%29 = phi i8 [ %33, %for.inc45 ], [ %2, %for.cond2.preheader ]
%conv78 = sext i8 %29 to i64
%30 = add i8 %29, -97
%or.cond = icmp ult i8 %30, 26
br i1 %or.cond, label %for.inc45.sink.split, label %if.else
if.else: ; preds = %for.body7
%31 = add i8 %29, -65
%or.cond73 = icmp ult i8 %31, 26
br i1 %or.cond73, label %for.inc45.sink.split, label %for.inc45
for.inc45.sink.split: ; preds = %if.else, %for.body7
%.sink = phi i64 [ 4294967199, %for.body7 ], [ 4294967231, %if.else ]
%sub39 = add nsw i64 %.sink, %conv78
%idxprom40 = and i64 %sub39, 4294967295
%arrayidx41 = getelementptr inbounds [26 x i32], ptr %aiAlphaList, i64 0, i64 %idxprom40
%32 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%inc23 = add nsw i32 %32, 1
store i32 %inc23, ptr %arrayidx41, align 4, !tbaa !5
br label %for.inc45
for.inc45: ; preds = %for.inc45.sink.split, %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx4 = getelementptr inbounds [1200 x i8], ptr %achInput, i64 0, i64 %indvars.iv.next
%33 = load i8, ptr %arrayidx4, align 1, !tbaa !13
%cmp5.not = icmp eq i8 %33, 0
br i1 %cmp5.not, label %while.cond.loopexit, label %for.body7, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
|
#include<stdio.h>
int main(void){
int alp[26] = {0};
char c;
while((c=getchar()) != EOF){
if('a'<=c && c<='z') alp[c-'a']++;
if('A'<=c && c<='Z') alp[c-'A']++;
}
for(int i=0; i<26; i++) printf("%c : %d\n", i+'a', alp[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%alp = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alp) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alp, i8 0, i64 104, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i40 = tail call i32 @getc(ptr noundef %0)
%sext41 = shl i32 %call.i40, 24
%cmp.not43 = icmp eq i32 %sext41, -16777216
br i1 %cmp.not43, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end23
%.pre = load i32, ptr %alp, align 16, !tbaa !9
%arrayidx27.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 1
%.pre49 = load i32, ptr %arrayidx27.1.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 2
%.pre50 = load i32, ptr %arrayidx27.2.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 3
%.pre51 = load i32, ptr %arrayidx27.3.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 4
%.pre52 = load i32, ptr %arrayidx27.4.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 5
%.pre53 = load i32, ptr %arrayidx27.5.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 6
%.pre54 = load i32, ptr %arrayidx27.6.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 7
%.pre55 = load i32, ptr %arrayidx27.7.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 8
%.pre56 = load i32, ptr %arrayidx27.8.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 9
%.pre57 = load i32, ptr %arrayidx27.9.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 10
%.pre58 = load i32, ptr %arrayidx27.10.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 11
%.pre59 = load i32, ptr %arrayidx27.11.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 12
%.pre60 = load i32, ptr %arrayidx27.12.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 13
%.pre61 = load i32, ptr %arrayidx27.13.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 14
%.pre62 = load i32, ptr %arrayidx27.14.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 15
%.pre63 = load i32, ptr %arrayidx27.15.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 16
%.pre64 = load i32, ptr %arrayidx27.16.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 17
%.pre65 = load i32, ptr %arrayidx27.17.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 18
%.pre66 = load i32, ptr %arrayidx27.18.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 19
%.pre67 = load i32, ptr %arrayidx27.19.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 20
%.pre68 = load i32, ptr %arrayidx27.20.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 21
%.pre69 = load i32, ptr %arrayidx27.21.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 22
%.pre70 = load i32, ptr %arrayidx27.22.phi.trans.insert, align 8, !tbaa !9
%arrayidx27.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 23
%.pre71 = load i32, ptr %arrayidx27.23.phi.trans.insert, align 4, !tbaa !9
%arrayidx27.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 24
%.pre72 = load i32, ptr %arrayidx27.24.phi.trans.insert, align 16, !tbaa !9
%arrayidx27.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 25
%.pre73 = load i32, ptr %arrayidx27.25.phi.trans.insert, align 4, !tbaa !9
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%1 = phi i32 [ %.pre73, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre72, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre71, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre70, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre69, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre68, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre67, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre66, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre65, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre64, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre63, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %26)
%call28.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %25)
%call28.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %24)
%call28.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %23)
%call28.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %22)
%call28.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %21)
%call28.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %20)
%call28.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %19)
%call28.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %18)
%call28.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %17)
%call28.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %16)
%call28.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %15)
%call28.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %14)
%call28.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %13)
%call28.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %12)
%call28.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %11)
%call28.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %10)
%call28.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %9)
%call28.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %8)
%call28.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %7)
%call28.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %6)
%call28.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %5)
%call28.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %4)
%call28.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %3)
%call28.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %2)
%call28.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %1)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alp) #4
ret i32 0
while.body: ; preds = %entry, %if.end23
%sext44 = phi i32 [ %sext, %if.end23 ], [ %sext41, %entry ]
%conv145 = ashr exact i32 %sext44, 24
%27 = add i32 %sext44, -1610612737
%or.cond = icmp ult i32 %27, 452984831
br i1 %or.cond, label %if.end23.sink.split, label %if.end
if.end: ; preds = %while.body
%28 = add i32 %sext44, -1073741825
%or.cond30 = icmp ult i32 %28, 452984831
br i1 %or.cond30, label %if.end23.sink.split, label %if.end23
if.end23.sink.split: ; preds = %if.end, %while.body
%.sink = phi i32 [ -97, %while.body ], [ -65, %if.end ]
%sub19 = add nsw i32 %conv145, %.sink
%idxprom20 = zext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [26 x i32], ptr %alp, i64 0, i64 %idxprom20
%29 = load i32, ptr %arrayidx21, align 4, !tbaa !9
%inc = add nsw i32 %29, 1
store i32 %inc, ptr %arrayidx21, align 4, !tbaa !9
br label %if.end23
if.end23: ; preds = %if.end23.sink.split, %if.end
%30 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %30)
%sext = shl i32 %call.i, 24
%cmp.not = icmp eq i32 %sext, -16777216
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int al[30] = {0};
char b[2000]= {0};
int i,j,n;
i=0;
while( scanf("%c",&b[i]) != EOF) {
if (b[i] >= 'A' && 'Z' >= b[i] ) {
n = b[i] - 'A';
al[n] += 1;
} else if(b[i] >= 'a' && b[i] <= 'z' ) {
n = b[i] - 'a';
al[n] += 1;
}
i=i+1;
}
for(j=97; j<=122; j++) {
n = j - 'a';
printf("%c : %d\n",j,al[n]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154890/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%al = alloca [30 x i32], align 16
%b = alloca [2000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %al) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %al, i8 0, i64 120, i1 false)
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %b) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000) %b, i8 0, i64 2000, i1 false)
%call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%cmp.not56 = icmp eq i32 %call55, -1
br i1 %cmp.not56, label %for.cond.preheader, label %while.body
for.cond.preheader.loopexit: ; preds = %if.end34
%.pre = load i32, ptr %al, align 16, !tbaa !5
%arrayidx40.1.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 1
%.pre65 = load i32, ptr %arrayidx40.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.2.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 2
%.pre66 = load i32, ptr %arrayidx40.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.3.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 3
%.pre67 = load i32, ptr %arrayidx40.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.4.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 4
%.pre68 = load i32, ptr %arrayidx40.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.5.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 5
%.pre69 = load i32, ptr %arrayidx40.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.6.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 6
%.pre70 = load i32, ptr %arrayidx40.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.7.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 7
%.pre71 = load i32, ptr %arrayidx40.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.8.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 8
%.pre72 = load i32, ptr %arrayidx40.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.9.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 9
%.pre73 = load i32, ptr %arrayidx40.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.10.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 10
%.pre74 = load i32, ptr %arrayidx40.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.11.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 11
%.pre75 = load i32, ptr %arrayidx40.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.12.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 12
%.pre76 = load i32, ptr %arrayidx40.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.13.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 13
%.pre77 = load i32, ptr %arrayidx40.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.14.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 14
%.pre78 = load i32, ptr %arrayidx40.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.15.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 15
%.pre79 = load i32, ptr %arrayidx40.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.16.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 16
%.pre80 = load i32, ptr %arrayidx40.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.17.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 17
%.pre81 = load i32, ptr %arrayidx40.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.18.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 18
%.pre82 = load i32, ptr %arrayidx40.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.19.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 19
%.pre83 = load i32, ptr %arrayidx40.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.20.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 20
%.pre84 = load i32, ptr %arrayidx40.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.21.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 21
%.pre85 = load i32, ptr %arrayidx40.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.22.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 22
%.pre86 = load i32, ptr %arrayidx40.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx40.23.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 23
%.pre87 = load i32, ptr %arrayidx40.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx40.24.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 24
%.pre88 = load i32, ptr %arrayidx40.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx40.25.phi.trans.insert = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 25
%.pre89 = load i32, ptr %arrayidx40.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry
%0 = phi i32 [ %.pre89, %for.cond.preheader.loopexit ], [ 0, %entry ]
%1 = phi i32 [ %.pre88, %for.cond.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre87, %for.cond.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre86, %for.cond.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre85, %for.cond.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre84, %for.cond.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre83, %for.cond.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre82, %for.cond.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre81, %for.cond.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre80, %for.cond.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre79, %for.cond.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre78, %for.cond.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre77, %for.cond.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre76, %for.cond.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre75, %for.cond.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre74, %for.cond.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre73, %for.cond.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre72, %for.cond.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre71, %for.cond.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre70, %for.cond.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre69, %for.cond.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre68, %for.cond.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre67, %for.cond.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre66, %for.cond.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre65, %for.cond.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ]
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25)
%call41.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24)
%call41.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23)
%call41.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22)
%call41.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21)
%call41.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20)
%call41.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19)
%call41.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18)
%call41.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17)
%call41.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16)
%call41.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15)
%call41.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14)
%call41.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13)
%call41.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12)
%call41.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11)
%call41.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10)
%call41.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9)
%call41.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8)
%call41.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7)
%call41.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6)
%call41.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5)
%call41.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4)
%call41.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3)
%call41.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2)
%call41.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1)
%call41.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %al) #4
ret i32 0
while.body: ; preds = %entry, %if.end34
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end34 ], [ 0, %entry ]
%arrayidx58 = phi ptr [ %arrayidx, %if.end34 ], [ %b, %entry ]
%26 = load i8, ptr %arrayidx58, align 1, !tbaa !9
%conv = sext i8 %26 to i64
%27 = add i8 %26, -65
%or.cond = icmp ult i8 %27, 26
br i1 %or.cond, label %if.end34.sink.split, label %if.else
if.else: ; preds = %while.body
%28 = add i8 %26, -97
%or.cond54 = icmp ult i8 %28, 26
br i1 %or.cond54, label %if.end34.sink.split, label %if.end34
if.end34.sink.split: ; preds = %if.else, %while.body
%.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom13 = and i64 %sub, 4294967295
%arrayidx14 = getelementptr inbounds [30 x i32], ptr %al, i64 0, i64 %idxprom13
%29 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add33 = add nsw i32 %29, 1
store i32 %add33, ptr %arrayidx14, align 4, !tbaa !5
br label %if.end34
if.end34: ; preds = %if.end34.sink.split, %if.else
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [2000 x i8], ptr %b, i64 0, i64 %indvars.iv.next
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include "stdio.h"
int main() {
int i,sum[26];
char s, a[53] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (i = 0; i < 26; i++) {
sum[i] = 0;
}
while (scanf("%c", &s) != EOF) {
for (i = 0; i < 53; i++) {
if (a[i] == s) {
sum[i % 26]++;
}
}
}
for (i = 0; i < 26; i++) {
printf("%c : %d\n", a[i], sum[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.a = private unnamed_addr constant [53 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00", align 16
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%sum = alloca [26 x i32], align 16
%s = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %sum) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %sum, i8 0, i64 104, i1 false), !tbaa !5
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp1.not43 = icmp eq i32 %call42, -1
br i1 %cmp1.not43, label %for.cond16.preheader, label %for.cond2.preheader
while.cond.loopexit: ; preds = %for.inc13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%cmp1.not = icmp eq i32 %call, -1
br i1 %cmp1.not, label %for.cond16.preheader.loopexit, label %for.cond2.preheader, !llvm.loop !9
for.cond2.preheader: ; preds = %entry, %while.cond.loopexit
%0 = load i8, ptr %s, align 1, !tbaa !11
br label %for.body4
for.cond16.preheader.loopexit: ; preds = %while.cond.loopexit
%.pre = load i32, ptr %sum, align 16, !tbaa !5
%arrayidx24.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 1
%.pre51 = load i32, ptr %arrayidx24.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 2
%.pre52 = load i32, ptr %arrayidx24.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 3
%.pre53 = load i32, ptr %arrayidx24.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 4
%.pre54 = load i32, ptr %arrayidx24.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 5
%.pre55 = load i32, ptr %arrayidx24.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 6
%.pre56 = load i32, ptr %arrayidx24.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 7
%.pre57 = load i32, ptr %arrayidx24.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 8
%.pre58 = load i32, ptr %arrayidx24.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 9
%.pre59 = load i32, ptr %arrayidx24.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 10
%.pre60 = load i32, ptr %arrayidx24.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 11
%.pre61 = load i32, ptr %arrayidx24.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 12
%.pre62 = load i32, ptr %arrayidx24.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 13
%.pre63 = load i32, ptr %arrayidx24.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 14
%.pre64 = load i32, ptr %arrayidx24.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 15
%.pre65 = load i32, ptr %arrayidx24.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 16
%.pre66 = load i32, ptr %arrayidx24.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 17
%.pre67 = load i32, ptr %arrayidx24.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 18
%.pre68 = load i32, ptr %arrayidx24.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 19
%.pre69 = load i32, ptr %arrayidx24.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 20
%.pre70 = load i32, ptr %arrayidx24.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 21
%.pre71 = load i32, ptr %arrayidx24.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 22
%.pre72 = load i32, ptr %arrayidx24.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx24.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 23
%.pre73 = load i32, ptr %arrayidx24.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx24.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 24
%.pre74 = load i32, ptr %arrayidx24.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx24.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 25
%.pre75 = load i32, ptr %arrayidx24.25.phi.trans.insert, align 4, !tbaa !5
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit, %entry
%1 = phi i32 [ %.pre75, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre74, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre73, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre72, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre71, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre70, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre69, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre68, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre67, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre66, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre65, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre64, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre63, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre62, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre61, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre60, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre59, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre58, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre57, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre56, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre55, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre54, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre53, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre52, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre51, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre, %for.cond16.preheader.loopexit ], [ 0, %entry ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %26)
%call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %25)
%call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %24)
%call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %23)
%call25.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %22)
%call25.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %21)
%call25.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %20)
%call25.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %19)
%call25.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %18)
%call25.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %17)
%call25.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %16)
%call25.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %15)
%call25.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %14)
%call25.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %13)
%call25.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %12)
%call25.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %11)
%call25.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %10)
%call25.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %9)
%call25.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %8)
%call25.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %7)
%call25.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %6)
%call25.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %5)
%call25.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %4)
%call25.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %3)
%call25.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %2)
%call25.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %1)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %sum) #4
ret i32 0
for.body4: ; preds = %for.cond2.preheader, %for.inc13
%indvars.iv = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next, %for.inc13 ]
%arrayidx6 = getelementptr inbounds [53 x i8], ptr @__const.main.a, i64 0, i64 %indvars.iv
%27 = load i8, ptr %arrayidx6, align 1, !tbaa !11
%cmp8 = icmp eq i8 %27, %0
br i1 %cmp8, label %if.then, label %for.inc13
if.then: ; preds = %for.body4
%rem.lhs.trunc = trunc i64 %indvars.iv to i8
%rem39 = urem i8 %rem.lhs.trunc, 26
%idxprom10 = zext i8 %rem39 to i64
%arrayidx11 = getelementptr inbounds [26 x i32], ptr %sum, i64 0, i64 %idxprom10
%28 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%inc12 = add nsw i32 %28, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc13
for.inc13: ; preds = %for.body4, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 53
br i1 %exitcond.not, label %while.cond.loopexit, label %for.body4, !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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define MAX 1200
int main(void) {
char ch;
int alphabet = 97;
int num[MAX];
while(scanf("%c", &ch) != EOF) {
if('a' <= ch && ch <= 'z') {
num[ch-'a']++;
}
else if('A' <= ch && ch <= 'Z') {
num[ch-'A']++;
}
}
for(int i=0; i<26; ++i) {
printf("%c : %d\n", alphabet++, num[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154977/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154977/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca i8, align 1
%num = alloca [1200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4
call void @llvm.lifetime.start.p0(i64 4800, ptr nonnull %num) #4
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not32 = icmp ne i32 %call31, -1
call void @llvm.assume(i1 %cmp.not32)
br label %while.body
for.cond.preheader.loopexit: ; preds = %if.end20
%.pre = load i32, ptr %num, align 16, !tbaa !5
%arrayidx25.1.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 1
%.pre36 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.2.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 2
%.pre37 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.3.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 3
%.pre38 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.4.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 4
%.pre39 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.5.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 5
%.pre40 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.6.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 6
%.pre41 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.7.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 7
%.pre42 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.8.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 8
%.pre43 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.9.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 9
%.pre44 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.10.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 10
%.pre45 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.11.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 11
%.pre46 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.12.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 12
%.pre47 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.13.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 13
%.pre48 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.14.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 14
%.pre49 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.15.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 15
%.pre50 = load i32, ptr %arrayidx25.15.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.16.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 16
%.pre51 = load i32, ptr %arrayidx25.16.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.17.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 17
%.pre52 = load i32, ptr %arrayidx25.17.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.18.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 18
%.pre53 = load i32, ptr %arrayidx25.18.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.19.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 19
%.pre54 = load i32, ptr %arrayidx25.19.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.20.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 20
%.pre55 = load i32, ptr %arrayidx25.20.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.21.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 21
%.pre56 = load i32, ptr %arrayidx25.21.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.22.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 22
%.pre57 = load i32, ptr %arrayidx25.22.phi.trans.insert, align 8, !tbaa !5
%arrayidx25.23.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 23
%.pre58 = load i32, ptr %arrayidx25.23.phi.trans.insert, align 4, !tbaa !5
%arrayidx25.24.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 24
%.pre59 = load i32, ptr %arrayidx25.24.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.25.phi.trans.insert = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 25
%.pre60 = load i32, ptr %arrayidx25.25.phi.trans.insert, align 4, !tbaa !5
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %.pre)
%call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %.pre36)
%call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %.pre37)
%call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %.pre38)
%call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %.pre39)
%call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %.pre40)
%call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %.pre41)
%call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %.pre42)
%call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %.pre43)
%call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %.pre44)
%call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %.pre45)
%call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %.pre46)
%call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %.pre47)
%call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %.pre48)
%call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %.pre49)
%call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %.pre50)
%call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %.pre51)
%call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %.pre52)
%call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %.pre53)
%call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %.pre54)
%call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %.pre55)
%call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %.pre56)
%call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %.pre57)
%call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %.pre58)
%call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %.pre59)
%call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %.pre60)
call void @llvm.lifetime.end.p0(i64 4800, ptr nonnull %num) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
while.body: ; preds = %entry, %if.end20
%0 = load i8, ptr %ch, align 1
%conv = sext i8 %0 to i64
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
br i1 %or.cond, label %if.end20.sink.split, label %if.else
if.else: ; preds = %while.body
%2 = add i8 %0, -65
%or.cond28 = icmp ult i8 %2, 26
br i1 %or.cond28, label %if.end20.sink.split, label %if.end20
if.end20.sink.split: ; preds = %if.else, %while.body
%.sink = phi i64 [ 4294967199, %while.body ], [ 4294967231, %if.else ]
%sub = add nsw i64 %.sink, %conv
%idxprom = and i64 %sub, 4294967295
%arrayidx = getelementptr inbounds [1200 x i32], ptr %num, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc19 = add nsw i32 %3, 1
store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5
br label %if.end20
if.end20: ; preds = %if.end20.sink.split, %if.else
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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>
int main()
{
int n,sum,max;
sum=0;
max=0;
scanf("%d",&n);
int a[n],i;
for(i=0;i<n;++i)
{
scanf("%d",&a[i]);
sum=sum+a[i];
if(a[i]>max) max=a[i];
}
if(sum > 2*max) printf("Yes");
else printf("No");
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155026/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155026/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %3, 0
br i1 %cmp21, label %for.body, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.023 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%max.022 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %4, %sum.023
%spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %max.022)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%7 = shl nuw nsw i32 %spec.select, 1
%cmp9 = icmp sgt i32 %add, %7
br i1 %cmp9, label %if.end13, label %if.else
if.else: ; preds = %entry, %for.end
br label %if.end13
if.end13: ; preds = %for.end, %if.else
%.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.end ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int a, b, c, n, t;
scanf("%d", &t);
for(int i = 0; i < t; i++) {
scanf("%d %d %d %d", &a, &b, &c, &n);
int sum = a + b + c + n;
if(sum % 3 == 0) {
if(a > sum / 3 || b > sum / 3 || c > sum / 3)
printf("NO\n");
else
printf("YES\n");
}
else {
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.5 = 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
%c = alloca i32, align 4
%n = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end16, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
for.body: ; preds = %entry, %if.end16
%i.025 = phi i32 [ %inc, %if.end16 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %n)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%3 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add nsw i32 %add, %3
%4 = load i32, ptr %n, align 4, !tbaa !5
%add3 = add nsw i32 %add2, %4
%rem = srem i32 %add3, 3
%div = sdiv i32 %add3, 3
%cmp4 = icmp eq i32 %rem, 0
br i1 %cmp4, label %if.then, label %if.end16
if.then: ; preds = %for.body
%cmp5 = icmp sgt i32 %1, %div
%cmp7 = icmp sgt i32 %2, %div
%or.cond = or i1 %cmp5, %cmp7
%cmp10 = icmp sgt i32 %3, %div
%or.cond23 = or i1 %cmp10, %or.cond
%str.5.str.4 = select i1 %or.cond23, ptr @str.5, ptr @str.4
br label %if.end16
if.end16: ; preds = %for.body, %if.then
%str.5.sink = phi ptr [ %str.5.str.4, %if.then ], [ @str.5, %for.body ]
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
%inc = add nuw nsw i32 %i.025, 1
%5 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int n,i;
int l[11];
int mlen=0,slen=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&l[i]);
slen+=l[i];
if(l[i]>mlen)mlen=l[i];
}
slen-=mlen;
printf("%s\n",(mlen<slen)?"Yes":"No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155163/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155163/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%l = alloca [11 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%slen.023 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%mlen.022 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i32], ptr %l, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %slen.023
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %mlen.022)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%mlen.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%slen.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%sub = sub nsw i32 %slen.0.lcssa, %mlen.0.lcssa
%cmp9 = icmp slt i32 %mlen.0.lcssa, %sub
%cond = select i1 %cmp9, ptr @.str.2, ptr @.str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n,max,sum;
max=0;
sum=0;
scanf("%d",&n);
int l[n];
for(int i=0; i<n; i++){
scanf("%d",&l[i]);
if(l[i]>max)
max=l[i];
sum+=l[i];
}
if(max < sum-max)
printf("Yes");
else
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %3, 0
br i1 %cmp22, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
%sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa
%cmp9 = icmp slt i32 %max.0.lcssa, %sub
%.str.1..str.2 = select i1 %cmp9, ptr @.str.1, ptr @.str.2
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%max.024 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%sum.023 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %4, i32 %max.024)
%add = add nsw i32 %4, %sum.023
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.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
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int comp(const void *a, const void *b){
return *(int*)b-*(int*)a;
}
int main(void){
int n,i,s=0;
scanf("%d",&n);
int l[n];
for(i=0;i<n;scanf("%d",&l[i++]));
qsort(l,n,sizeof(int),comp);
for(i=1;i<n;s+=l[i++]);
if(s>l[0])printf("Yes");
else printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155257/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155257/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %3, 0
br i1 %cmp20, label %for.inc, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.end
for.inc: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.inc, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.inc ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @comp) #7
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp322 = icmp sgt i32 %6, 1
br i1 %cmp322, label %for.inc6.preheader, label %for.end10
for.inc6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %6, 9
br i1 %min.iters.check, label %for.inc6.preheader33, label %vector.ph
vector.ph: ; preds = %for.inc6.preheader
%n.vec = and i64 %7, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi31 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load32 = load <4 x i32>, ptr %9, align 4, !tbaa !5
%10 = add <4 x i32> %wide.load, %vec.phi
%11 = add <4 x i32> %wide.load32, %vec.phi31
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %7, %n.vec
br i1 %cmp.n, label %for.end10, label %for.inc6.preheader33
for.inc6.preheader33: ; preds = %for.inc6.preheader, %middle.block
%indvars.iv28.ph = phi i64 [ 1, %for.inc6.preheader ], [ %ind.end, %middle.block ]
%s.023.ph = phi i32 [ 0, %for.inc6.preheader ], [ %13, %middle.block ]
br label %for.inc6
for.inc6: ; preds = %for.inc6.preheader33, %for.inc6
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.inc6 ], [ %indvars.iv28.ph, %for.inc6.preheader33 ]
%s.023 = phi i32 [ %add, %for.inc6 ], [ %s.023.ph, %for.inc6.preheader33 ]
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv28
%14 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add = add nsw i32 %14, %s.023
%exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count
br i1 %exitcond.not, label %for.end10, label %for.inc6, !llvm.loop !14
for.end10: ; preds = %for.inc6, %middle.block, %for.end
%s.0.lcssa = phi i32 [ 0, %for.end ], [ %13, %middle.block ], [ %add, %for.inc6 ]
%15 = load i32, ptr %vla, align 16, !tbaa !5
%cmp12 = icmp sgt i32 %s.0.lcssa, %15
%.str.1..str.2 = select i1 %cmp12, ptr @.str.1, ptr @.str.2
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include<stdio.h>
int main(){
int n,i,max=0,sum=0;
int l[10];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&l[i]);
if(l[i]>=max) max=l[i];
}
for(i=0;i<n;i++){
sum=sum+l[i];
}
if((sum-max)>max){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%l = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end14
for.cond7.preheader: ; preds = %for.body
%cmp835 = icmp sgt i32 %8, 0
br i1 %cmp835, label %for.body9.preheader, label %for.end14
for.body9.preheader: ; preds = %for.cond7.preheader
%wide.trip.count = zext i32 %8 to i64
%min.iters.check = icmp ult i32 %8, 8
br i1 %min.iters.check, label %for.body9.preheader50, label %vector.ph
vector.ph: ; preds = %for.body9.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load49 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load49, %vec.phi48
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end14, label %for.body9.preheader50
for.body9.preheader50: ; preds = %for.body9.preheader, %middle.block
%indvars.iv41.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ]
%sum.037.ph = phi i32 [ 0, %for.body9.preheader ], [ %6, %middle.block ]
br label %for.body9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%max.033 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %7, i32 %max.033)
%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.cond7.preheader, !llvm.loop !13
for.body9: ; preds = %for.body9.preheader50, %for.body9
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body9 ], [ %indvars.iv41.ph, %for.body9.preheader50 ]
%sum.037 = phi i32 [ %add, %for.body9 ], [ %sum.037.ph, %for.body9.preheader50 ]
%arrayidx11 = getelementptr inbounds [10 x i32], ptr %l, i64 0, i64 %indvars.iv41
%10 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%add = add nsw i32 %10, %sum.037
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%exitcond.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count
br i1 %exitcond.not, label %for.end14, label %for.body9, !llvm.loop !14
for.end14: ; preds = %for.body9, %middle.block, %entry, %for.cond7.preheader
%max.0.lcssa47 = phi i32 [ %spec.select, %for.cond7.preheader ], [ 0, %entry ], [ %spec.select, %middle.block ], [ %spec.select, %for.body9 ]
%sum.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body9 ]
%sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa47
%cmp15 = icmp sgt i32 %sub, %max.0.lcssa47
%str.3.str = select i1 %cmp15, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include "stdio.h"
int main(int argc, char const *argv[]) {
int N;
scanf("%d", &N);
int L[N];
for (size_t i = 0; i < N; i++) {
scanf("%d", &L[i]);
}
int big=0;
int sum=0;
for (size_t i = 0; i < N; i++) {
if (big<L[i]) {
big=L[i];
}
sum=sum+L[i];
}
sum=sum-big;
if (sum>big) {
printf("Yes");
}else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp35.not = icmp eq i32 %3, 0
br i1 %cmp35.not, label %for.cond.cleanup8, label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp637.not = icmp eq i32 %13, 0
br i1 %cmp637.not, label %for.cond.cleanup8, label %for.body9.preheader
for.body9.preheader: ; preds = %for.cond4.preheader
%min.iters.check = icmp ult i32 %13, 8
br i1 %min.iters.check, label %for.body9.preheader51, label %vector.ph
vector.ph: ; preds = %for.body9.preheader
%n.vec = and i64 %conv, -8
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 ], [ %8, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi47 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load49 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi47, <4 x i32> %wide.load)
%7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi48, <4 x i32> %wide.load49)
%8 = add <4 x i32> %wide.load, %vec.phi
%9 = add <4 x i32> %wide.load49, %vec.phi46
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %6, <4 x i32> %7)
%11 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%bin.rdx = add <4 x i32> %9, %8
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %conv
br i1 %cmp.n, label %for.cond.cleanup8, label %for.body9.preheader51
for.body9.preheader51: ; preds = %for.body9.preheader, %middle.block
%i3.040.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ]
%sum.039.ph = phi i32 [ 0, %for.body9.preheader ], [ %12, %middle.block ]
%big.038.ph = phi i32 [ 0, %for.body9.preheader ], [ %11, %middle.block ]
br label %for.body9
for.body: ; preds = %entry, %for.body
%i.036 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %i.036
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw i64 %i.036, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%conv = sext i32 %13 to i64
%cmp = icmp ult i64 %inc, %conv
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.cond.cleanup8: ; preds = %for.body9, %middle.block, %entry, %for.cond4.preheader
%big.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %11, %middle.block ], [ %spec.select, %for.body9 ]
%sum.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %12, %middle.block ], [ %add, %for.body9 ]
%sub = sub nsw i32 %sum.0.lcssa, %big.0.lcssa
%cmp18 = icmp sgt i32 %sub, %big.0.lcssa
%.str.1..str.2 = select i1 %cmp18, ptr @.str.1, ptr @.str.2
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body9: ; preds = %for.body9.preheader51, %for.body9
%i3.040 = phi i64 [ %inc16, %for.body9 ], [ %i3.040.ph, %for.body9.preheader51 ]
%sum.039 = phi i32 [ %add, %for.body9 ], [ %sum.039.ph, %for.body9.preheader51 ]
%big.038 = phi i32 [ %spec.select, %for.body9 ], [ %big.038.ph, %for.body9.preheader51 ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %i3.040
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %big.038, i32 %14)
%add = add nsw i32 %14, %sum.039
%inc16 = add nuw i64 %i3.040, 1
%exitcond.not = icmp eq i64 %inc16, %conv
br i1 %exitcond.not, label %for.cond.cleanup8, label %for.body9, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
#include <math.h>
int main(){
int x;
int n=0;
scanf("%d",&x);
for(int i=0;i<x;i++){
int judge_num = x-i;
for(int j=2;j<10;j++){
if((int)pow(ceil(pow(judge_num,(double)1/j)),j)==judge_num){
printf("%d",judge_num);
return 0;
}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155394/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155394/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %cleanup17
for.body: ; preds = %entry, %for.cond1.7
%1 = phi i32 [ %10, %for.cond1.7 ], [ %0, %entry ]
%i.038 = phi i32 [ %inc16, %for.cond1.7 ], [ 0, %entry ]
%sub = sub nsw i32 %1, %i.038
%conv = sitofp i32 %sub to double
%sqrt = call double @sqrt(double %conv) #6
%abs = call double @llvm.fabs.f64(double %sqrt)
%2 = call double @llvm.ceil.f64(double %abs)
%square = fmul double %2, %2
%conv9 = fptosi double %square to i32
%cmp10 = icmp eq i32 %sub, %conv9
br i1 %cmp10, label %if.then, label %for.cond1
for.cond1: ; preds = %for.body
%call6.1 = call double @pow(double noundef %conv, double noundef 0x3FD5555555555555) #6
%3 = call double @llvm.ceil.f64(double %call6.1)
%call8.1 = call double @pow(double noundef %3, double noundef 3.000000e+00) #6
%conv9.1 = fptosi double %call8.1 to i32
%cmp10.1 = icmp eq i32 %sub, %conv9.1
br i1 %cmp10.1, label %if.then, label %for.cond1.1
for.cond1.1: ; preds = %for.cond1
%call6.2 = call double @pow(double noundef %conv, double noundef 2.500000e-01) #6
%4 = call double @llvm.ceil.f64(double %call6.2)
%call8.2 = call double @pow(double noundef %4, double noundef 4.000000e+00) #6
%conv9.2 = fptosi double %call8.2 to i32
%cmp10.2 = icmp eq i32 %sub, %conv9.2
br i1 %cmp10.2, label %if.then, label %for.cond1.2
for.cond1.2: ; preds = %for.cond1.1
%call6.3 = call double @pow(double noundef %conv, double noundef 2.000000e-01) #6
%5 = call double @llvm.ceil.f64(double %call6.3)
%call8.3 = call double @pow(double noundef %5, double noundef 5.000000e+00) #6
%conv9.3 = fptosi double %call8.3 to i32
%cmp10.3 = icmp eq i32 %sub, %conv9.3
br i1 %cmp10.3, label %if.then, label %for.cond1.3
for.cond1.3: ; preds = %for.cond1.2
%call6.4 = call double @pow(double noundef %conv, double noundef 0x3FC5555555555555) #6
%6 = call double @llvm.ceil.f64(double %call6.4)
%call8.4 = call double @pow(double noundef %6, double noundef 6.000000e+00) #6
%conv9.4 = fptosi double %call8.4 to i32
%cmp10.4 = icmp eq i32 %sub, %conv9.4
br i1 %cmp10.4, label %if.then, label %for.cond1.4
for.cond1.4: ; preds = %for.cond1.3
%call6.5 = call double @pow(double noundef %conv, double noundef 0x3FC2492492492492) #6
%7 = call double @llvm.ceil.f64(double %call6.5)
%call8.5 = call double @pow(double noundef %7, double noundef 7.000000e+00) #6
%conv9.5 = fptosi double %call8.5 to i32
%cmp10.5 = icmp eq i32 %sub, %conv9.5
br i1 %cmp10.5, label %if.then, label %for.cond1.5
for.cond1.5: ; preds = %for.cond1.4
%call6.6 = call double @pow(double noundef %conv, double noundef 1.250000e-01) #6
%8 = call double @llvm.ceil.f64(double %call6.6)
%call8.6 = call double @pow(double noundef %8, double noundef 8.000000e+00) #6
%conv9.6 = fptosi double %call8.6 to i32
%cmp10.6 = icmp eq i32 %sub, %conv9.6
br i1 %cmp10.6, label %if.then, label %for.cond1.6
for.cond1.6: ; preds = %for.cond1.5
%call6.7 = call double @pow(double noundef %conv, double noundef 0x3FBC71C71C71C71C) #6
%9 = call double @llvm.ceil.f64(double %call6.7)
%call8.7 = call double @pow(double noundef %9, double noundef 9.000000e+00) #6
%conv9.7 = fptosi double %call8.7 to i32
%cmp10.7 = icmp eq i32 %sub, %conv9.7
br i1 %cmp10.7, label %if.then, label %for.cond1.7
for.cond1.7: ; preds = %for.cond1.6
%inc16 = add nuw nsw i32 %i.038, 1
%10 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp slt i32 %inc16, %10
br i1 %cmp, label %for.body, label %cleanup17, !llvm.loop !9
if.then: ; preds = %for.cond1.6, %for.cond1.5, %for.cond1.4, %for.cond1.3, %for.cond1.2, %for.cond1.1, %for.cond1, %for.body
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
br label %cleanup17
cleanup17: ; preds = %for.cond1.7, %entry, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
declare double @sqrt(double) local_unnamed_addr
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main()
{
int x,i,j,ans=0;
scanf("%d",&x);
if(x==1){printf("1");
return 0;}
for(i=2;i<32;i++){
for(j=2;j<10;j++){
if(pow(i,j)<=x&&pow(i,j)>ans){
ans=pow(i,j);
if(pow(i,j)>1000)break;
}
}
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155480/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155480/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %for.cond3.preheader
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 49)
br label %cleanup
for.cond3.preheader: ; preds = %entry, %for.inc30
%ans.051 = phi i32 [ %ans.3, %for.inc30 ], [ 0, %entry ]
%i.050 = phi i32 [ %inc31, %for.inc30 ], [ 2, %entry ]
%conv = sitofp i32 %i.050 to double
%square = fmul double %conv, %conv
%1 = load i32, ptr %x, align 4, !tbaa !5
%conv8 = sitofp i32 %1 to double
%cmp9 = fcmp ugt double %square, %conv8
br i1 %cmp9, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.cond3.preheader
%square52 = fmul double %conv, %conv
%conv14 = sitofp i32 %ans.051 to double
%cmp15 = fcmp ogt double %square52, %conv14
br i1 %cmp15, label %if.then17, label %for.inc
if.then17: ; preds = %land.lhs.true
%square53 = fmul double %conv, %conv
%conv21 = fptosi double %square53 to i32
%square54 = fmul double %conv, %conv
%cmp25 = fcmp ogt double %square54, 1.000000e+03
br i1 %cmp25, label %for.inc30, label %for.inc
for.inc: ; preds = %for.cond3.preheader, %land.lhs.true, %if.then17
%ans.2 = phi i32 [ %conv21, %if.then17 ], [ %ans.051, %land.lhs.true ], [ %ans.051, %for.cond3.preheader ]
%call7.1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #5
%2 = load i32, ptr %x, align 4, !tbaa !5
%conv8.1 = sitofp i32 %2 to double
%cmp9.1 = fcmp ugt double %call7.1, %conv8.1
br i1 %cmp9.1, label %for.inc.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc
%call13.1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #5
%conv14.1 = sitofp i32 %ans.2 to double
%cmp15.1 = fcmp ogt double %call13.1, %conv14.1
br i1 %cmp15.1, label %if.then17.1, label %for.inc.1
if.then17.1: ; preds = %land.lhs.true.1
%call20.1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #5
%conv21.1 = fptosi double %call20.1 to i32
%call24.1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #5
%cmp25.1 = fcmp ogt double %call24.1, 1.000000e+03
br i1 %cmp25.1, label %for.inc30, label %for.inc.1
for.inc.1: ; preds = %if.then17.1, %land.lhs.true.1, %for.inc
%ans.2.1 = phi i32 [ %conv21.1, %if.then17.1 ], [ %ans.2, %land.lhs.true.1 ], [ %ans.2, %for.inc ]
%call7.2 = call double @pow(double noundef %conv, double noundef 4.000000e+00) #5
%3 = load i32, ptr %x, align 4, !tbaa !5
%conv8.2 = sitofp i32 %3 to double
%cmp9.2 = fcmp ugt double %call7.2, %conv8.2
br i1 %cmp9.2, label %for.inc.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc.1
%call13.2 = call double @pow(double noundef %conv, double noundef 4.000000e+00) #5
%conv14.2 = sitofp i32 %ans.2.1 to double
%cmp15.2 = fcmp ogt double %call13.2, %conv14.2
br i1 %cmp15.2, label %if.then17.2, label %for.inc.2
if.then17.2: ; preds = %land.lhs.true.2
%call20.2 = call double @pow(double noundef %conv, double noundef 4.000000e+00) #5
%conv21.2 = fptosi double %call20.2 to i32
%call24.2 = call double @pow(double noundef %conv, double noundef 4.000000e+00) #5
%cmp25.2 = fcmp ogt double %call24.2, 1.000000e+03
br i1 %cmp25.2, label %for.inc30, label %for.inc.2
for.inc.2: ; preds = %if.then17.2, %land.lhs.true.2, %for.inc.1
%ans.2.2 = phi i32 [ %conv21.2, %if.then17.2 ], [ %ans.2.1, %land.lhs.true.2 ], [ %ans.2.1, %for.inc.1 ]
%call7.3 = call double @pow(double noundef %conv, double noundef 5.000000e+00) #5
%4 = load i32, ptr %x, align 4, !tbaa !5
%conv8.3 = sitofp i32 %4 to double
%cmp9.3 = fcmp ugt double %call7.3, %conv8.3
br i1 %cmp9.3, label %for.inc.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc.2
%call13.3 = call double @pow(double noundef %conv, double noundef 5.000000e+00) #5
%conv14.3 = sitofp i32 %ans.2.2 to double
%cmp15.3 = fcmp ogt double %call13.3, %conv14.3
br i1 %cmp15.3, label %if.then17.3, label %for.inc.3
if.then17.3: ; preds = %land.lhs.true.3
%call20.3 = call double @pow(double noundef %conv, double noundef 5.000000e+00) #5
%conv21.3 = fptosi double %call20.3 to i32
%call24.3 = call double @pow(double noundef %conv, double noundef 5.000000e+00) #5
%cmp25.3 = fcmp ogt double %call24.3, 1.000000e+03
br i1 %cmp25.3, label %for.inc30, label %for.inc.3
for.inc.3: ; preds = %if.then17.3, %land.lhs.true.3, %for.inc.2
%ans.2.3 = phi i32 [ %conv21.3, %if.then17.3 ], [ %ans.2.2, %land.lhs.true.3 ], [ %ans.2.2, %for.inc.2 ]
%call7.4 = call double @pow(double noundef %conv, double noundef 6.000000e+00) #5
%5 = load i32, ptr %x, align 4, !tbaa !5
%conv8.4 = sitofp i32 %5 to double
%cmp9.4 = fcmp ugt double %call7.4, %conv8.4
br i1 %cmp9.4, label %for.inc.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc.3
%call13.4 = call double @pow(double noundef %conv, double noundef 6.000000e+00) #5
%conv14.4 = sitofp i32 %ans.2.3 to double
%cmp15.4 = fcmp ogt double %call13.4, %conv14.4
br i1 %cmp15.4, label %if.then17.4, label %for.inc.4
if.then17.4: ; preds = %land.lhs.true.4
%call20.4 = call double @pow(double noundef %conv, double noundef 6.000000e+00) #5
%conv21.4 = fptosi double %call20.4 to i32
%call24.4 = call double @pow(double noundef %conv, double noundef 6.000000e+00) #5
%cmp25.4 = fcmp ogt double %call24.4, 1.000000e+03
br i1 %cmp25.4, label %for.inc30, label %for.inc.4
for.inc.4: ; preds = %if.then17.4, %land.lhs.true.4, %for.inc.3
%ans.2.4 = phi i32 [ %conv21.4, %if.then17.4 ], [ %ans.2.3, %land.lhs.true.4 ], [ %ans.2.3, %for.inc.3 ]
%call7.5 = call double @pow(double noundef %conv, double noundef 7.000000e+00) #5
%6 = load i32, ptr %x, align 4, !tbaa !5
%conv8.5 = sitofp i32 %6 to double
%cmp9.5 = fcmp ugt double %call7.5, %conv8.5
br i1 %cmp9.5, label %for.inc.5, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc.4
%call13.5 = call double @pow(double noundef %conv, double noundef 7.000000e+00) #5
%conv14.5 = sitofp i32 %ans.2.4 to double
%cmp15.5 = fcmp ogt double %call13.5, %conv14.5
br i1 %cmp15.5, label %if.then17.5, label %for.inc.5
if.then17.5: ; preds = %land.lhs.true.5
%call20.5 = call double @pow(double noundef %conv, double noundef 7.000000e+00) #5
%conv21.5 = fptosi double %call20.5 to i32
%call24.5 = call double @pow(double noundef %conv, double noundef 7.000000e+00) #5
%cmp25.5 = fcmp ogt double %call24.5, 1.000000e+03
br i1 %cmp25.5, label %for.inc30, label %for.inc.5
for.inc.5: ; preds = %if.then17.5, %land.lhs.true.5, %for.inc.4
%ans.2.5 = phi i32 [ %conv21.5, %if.then17.5 ], [ %ans.2.4, %land.lhs.true.5 ], [ %ans.2.4, %for.inc.4 ]
%call7.6 = call double @pow(double noundef %conv, double noundef 8.000000e+00) #5
%7 = load i32, ptr %x, align 4, !tbaa !5
%conv8.6 = sitofp i32 %7 to double
%cmp9.6 = fcmp ugt double %call7.6, %conv8.6
br i1 %cmp9.6, label %for.inc.6, label %land.lhs.true.6
land.lhs.true.6: ; preds = %for.inc.5
%call13.6 = call double @pow(double noundef %conv, double noundef 8.000000e+00) #5
%conv14.6 = sitofp i32 %ans.2.5 to double
%cmp15.6 = fcmp ogt double %call13.6, %conv14.6
br i1 %cmp15.6, label %if.then17.6, label %for.inc.6
if.then17.6: ; preds = %land.lhs.true.6
%call20.6 = call double @pow(double noundef %conv, double noundef 8.000000e+00) #5
%conv21.6 = fptosi double %call20.6 to i32
%call24.6 = call double @pow(double noundef %conv, double noundef 8.000000e+00) #5
%cmp25.6 = fcmp ogt double %call24.6, 1.000000e+03
br i1 %cmp25.6, label %for.inc30, label %for.inc.6
for.inc.6: ; preds = %if.then17.6, %land.lhs.true.6, %for.inc.5
%ans.2.6 = phi i32 [ %conv21.6, %if.then17.6 ], [ %ans.2.5, %land.lhs.true.6 ], [ %ans.2.5, %for.inc.5 ]
%call7.7 = call double @pow(double noundef %conv, double noundef 9.000000e+00) #5
%8 = load i32, ptr %x, align 4, !tbaa !5
%conv8.7 = sitofp i32 %8 to double
%cmp9.7 = fcmp ugt double %call7.7, %conv8.7
br i1 %cmp9.7, label %for.inc30, label %land.lhs.true.7
land.lhs.true.7: ; preds = %for.inc.6
%call13.7 = call double @pow(double noundef %conv, double noundef 9.000000e+00) #5
%conv14.7 = sitofp i32 %ans.2.6 to double
%cmp15.7 = fcmp ogt double %call13.7, %conv14.7
br i1 %cmp15.7, label %if.then17.7, label %for.inc30
if.then17.7: ; preds = %land.lhs.true.7
%call20.7 = call double @pow(double noundef %conv, double noundef 9.000000e+00) #5
%conv21.7 = fptosi double %call20.7 to i32
%call24.7 = call double @pow(double noundef %conv, double noundef 9.000000e+00) #5
br label %for.inc30
for.inc30: ; preds = %if.then17.7, %for.inc.6, %land.lhs.true.7, %if.then17.6, %if.then17.5, %if.then17.4, %if.then17.3, %if.then17.2, %if.then17.1, %if.then17
%ans.3 = phi i32 [ %conv21, %if.then17 ], [ %conv21.1, %if.then17.1 ], [ %conv21.2, %if.then17.2 ], [ %conv21.3, %if.then17.3 ], [ %conv21.4, %if.then17.4 ], [ %conv21.5, %if.then17.5 ], [ %conv21.6, %if.then17.6 ], [ %conv21.7, %if.then17.7 ], [ %ans.2.6, %land.lhs.true.7 ], [ %ans.2.6, %for.inc.6 ]
%inc31 = add nuw nsw i32 %i.050, 1
%exitcond.not = icmp eq i32 %inc31, 32
br i1 %exitcond.not, label %for.end32, label %for.cond3.preheader, !llvm.loop !9
for.end32: ; preds = %for.inc30
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.3)
br label %cleanup
cleanup: ; preds = %for.end32, %if.then
call void @llvm.lifetime.end.p0(i64 4, 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: 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 nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double 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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int a,b,c,q,x;
a=0;
scanf("%d",&x);
for(b=1;b<33;b++){
for(q=2;q<11;q++){
c=pow(b,q);
if(c<=x){
a=fmax(a,c);
}
}
}
printf("%d",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155523/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155523/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.8
%a.025 = phi i32 [ 0, %entry ], [ %a.2.8, %for.inc.8 ]
%b.024 = phi i32 [ 1, %entry ], [ %inc13, %for.inc.8 ]
%conv = sitofp i32 %b.024 to double
%square = fmul double %conv, %conv
%conv6 = fptosi double %square to i32
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not = icmp slt i32 %0, %conv6
br i1 %cmp7.not, label %for.inc, label %if.then
if.then: ; preds = %for.cond1.preheader
%conv9 = sitofp i32 %a.025 to double
%conv10 = sitofp i32 %conv6 to double
%1 = call double @llvm.maxnum.f64(double %conv9, double %conv10)
%conv11 = fptosi double %1 to i32
br label %for.inc
for.inc: ; preds = %for.cond1.preheader, %if.then
%a.2 = phi i32 [ %conv11, %if.then ], [ %a.025, %for.cond1.preheader ]
%call5.1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #5
%conv6.1 = fptosi double %call5.1 to i32
%2 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.1 = icmp slt i32 %2, %conv6.1
br i1 %cmp7.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%conv9.1 = sitofp i32 %a.2 to double
%conv10.1 = sitofp i32 %conv6.1 to double
%3 = call double @llvm.maxnum.f64(double %conv9.1, double %conv10.1)
%conv11.1 = fptosi double %3 to i32
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%a.2.1 = phi i32 [ %conv11.1, %if.then.1 ], [ %a.2, %for.inc ]
%call5.2 = call double @pow(double noundef %conv, double noundef 4.000000e+00) #5
%conv6.2 = fptosi double %call5.2 to i32
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.2 = icmp slt i32 %4, %conv6.2
br i1 %cmp7.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%conv9.2 = sitofp i32 %a.2.1 to double
%conv10.2 = sitofp i32 %conv6.2 to double
%5 = call double @llvm.maxnum.f64(double %conv9.2, double %conv10.2)
%conv11.2 = fptosi double %5 to i32
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%a.2.2 = phi i32 [ %conv11.2, %if.then.2 ], [ %a.2.1, %for.inc.1 ]
%call5.3 = call double @pow(double noundef %conv, double noundef 5.000000e+00) #5
%conv6.3 = fptosi double %call5.3 to i32
%6 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.3 = icmp slt i32 %6, %conv6.3
br i1 %cmp7.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%conv9.3 = sitofp i32 %a.2.2 to double
%conv10.3 = sitofp i32 %conv6.3 to double
%7 = call double @llvm.maxnum.f64(double %conv9.3, double %conv10.3)
%conv11.3 = fptosi double %7 to i32
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%a.2.3 = phi i32 [ %conv11.3, %if.then.3 ], [ %a.2.2, %for.inc.2 ]
%call5.4 = call double @pow(double noundef %conv, double noundef 6.000000e+00) #5
%conv6.4 = fptosi double %call5.4 to i32
%8 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.4 = icmp slt i32 %8, %conv6.4
br i1 %cmp7.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%conv9.4 = sitofp i32 %a.2.3 to double
%conv10.4 = sitofp i32 %conv6.4 to double
%9 = call double @llvm.maxnum.f64(double %conv9.4, double %conv10.4)
%conv11.4 = fptosi double %9 to i32
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%a.2.4 = phi i32 [ %conv11.4, %if.then.4 ], [ %a.2.3, %for.inc.3 ]
%call5.5 = call double @pow(double noundef %conv, double noundef 7.000000e+00) #5
%conv6.5 = fptosi double %call5.5 to i32
%10 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.5 = icmp slt i32 %10, %conv6.5
br i1 %cmp7.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%conv9.5 = sitofp i32 %a.2.4 to double
%conv10.5 = sitofp i32 %conv6.5 to double
%11 = call double @llvm.maxnum.f64(double %conv9.5, double %conv10.5)
%conv11.5 = fptosi double %11 to i32
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%a.2.5 = phi i32 [ %conv11.5, %if.then.5 ], [ %a.2.4, %for.inc.4 ]
%call5.6 = call double @pow(double noundef %conv, double noundef 8.000000e+00) #5
%conv6.6 = fptosi double %call5.6 to i32
%12 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.6 = icmp slt i32 %12, %conv6.6
br i1 %cmp7.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%conv9.6 = sitofp i32 %a.2.5 to double
%conv10.6 = sitofp i32 %conv6.6 to double
%13 = call double @llvm.maxnum.f64(double %conv9.6, double %conv10.6)
%conv11.6 = fptosi double %13 to i32
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%a.2.6 = phi i32 [ %conv11.6, %if.then.6 ], [ %a.2.5, %for.inc.5 ]
%call5.7 = call double @pow(double noundef %conv, double noundef 9.000000e+00) #5
%conv6.7 = fptosi double %call5.7 to i32
%14 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.7 = icmp slt i32 %14, %conv6.7
br i1 %cmp7.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%conv9.7 = sitofp i32 %a.2.6 to double
%conv10.7 = sitofp i32 %conv6.7 to double
%15 = call double @llvm.maxnum.f64(double %conv9.7, double %conv10.7)
%conv11.7 = fptosi double %15 to i32
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%a.2.7 = phi i32 [ %conv11.7, %if.then.7 ], [ %a.2.6, %for.inc.6 ]
%call5.8 = call double @pow(double noundef %conv, double noundef 1.000000e+01) #5
%conv6.8 = fptosi double %call5.8 to i32
%16 = load i32, ptr %x, align 4, !tbaa !5
%cmp7.not.8 = icmp slt i32 %16, %conv6.8
br i1 %cmp7.not.8, label %for.inc.8, label %if.then.8
if.then.8: ; preds = %for.inc.7
%conv9.8 = sitofp i32 %a.2.7 to double
%conv10.8 = sitofp i32 %conv6.8 to double
%17 = call double @llvm.maxnum.f64(double %conv9.8, double %conv10.8)
%conv11.8 = fptosi double %17 to i32
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%a.2.8 = phi i32 [ %conv11.8, %if.then.8 ], [ %a.2.7, %for.inc.7 ]
%inc13 = add nuw nsw i32 %b.024, 1
%exitcond.not = icmp eq i32 %inc13, 33
br i1 %exitcond.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !9
for.end14: ; preds = %for.inc.8
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.2.8)
call void @llvm.lifetime.end.p0(i64 4, 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(void){
int a;
int i,j,k;
int max = 1;
scanf("%d",&a);
for(i = 2;i <= a;i++){
for(j = 2;j < a;j++){
k = pow(i,j);
if(k <= a &&max < k)max = k;
if(k > a)break;
}
}
printf("%d\n",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155567/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155567/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%or.cond37 = icmp slt i32 %0, 3
br i1 %or.cond37, label %for.end17, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc15
%1 = phi i32 [ %3, %for.inc15 ], [ %0, %entry ]
%max.033 = phi i32 [ %max.3, %for.inc15 ], [ 1, %entry ]
%i.032 = phi i32 [ %inc16, %for.inc15 ], [ 2, %entry ]
%conv = sitofp i32 %i.032 to double
%cmp227 = icmp sgt i32 %1, 2
br i1 %cmp227, label %for.body3, label %for.inc15
for.body3: ; preds = %for.cond1.preheader, %for.body3
%max.129 = phi i32 [ %max.2, %for.body3 ], [ %max.033, %for.cond1.preheader ]
%j.028 = phi i32 [ %inc, %for.body3 ], [ 2, %for.cond1.preheader ]
%conv4 = sitofp i32 %j.028 to double
%call5 = call double @pow(double noundef %conv, double noundef %conv4) #4
%conv6 = fptosi double %call5 to i32
%2 = load i32, ptr %a, align 4
%cmp7.not = icmp sge i32 %2, %conv6
%cmp9 = icmp slt i32 %max.129, %conv6
%or.cond = select i1 %cmp7.not, i1 %cmp9, i1 false
%max.2 = select i1 %or.cond, i32 %conv6, i32 %max.129
%inc = add nuw nsw i32 %j.028, 1
%cmp2 = icmp slt i32 %inc, %2
%or.cond35 = select i1 %cmp7.not, i1 %cmp2, i1 false
br i1 %or.cond35, label %for.body3, label %for.inc15, !llvm.loop !9
for.inc15: ; preds = %for.body3, %for.cond1.preheader
%3 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ]
%max.3 = phi i32 [ %max.033, %for.cond1.preheader ], [ %max.2, %for.body3 ]
%inc16 = add nuw nsw i32 %i.032, 1
%cmp.not.not = icmp slt i32 %i.032, %3
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end17, !llvm.loop !11
for.end17: ; preds = %for.inc15, %entry
%max.0.lcssa = phi i32 [ 1, %entry ], [ %max.3, %for.inc15 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa)
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 nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n,p,p1;
scanf("%d",&n);
if(n%3==0)
printf("%d 0 0\n",n/3);
else if(n%5==0)
printf("0 %d 0\n",n/5);
else if(n%7==0)
printf("0 0 %d\n",n/7);
else{
p=n%3;
p1=n%5;
if(p==1&&n>7)
printf("%d 0 1\n",n/3-2);
else if(p==2&&n>7)
printf("%d 1 0\n",n/3-1);
else
printf("-1\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%d 0 0\0A\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"0 %d 0\0A\00", align 1
@.str.3 = private unnamed_addr constant [8 x i8] c"0 0 %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [8 x i8] c"%d 0 1\0A\00", align 1
@.str.5 = private unnamed_addr constant [8 x i8] c"%d 1 0\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec38 = add nsw i32 %0, -1
store i32 %dec38, ptr %t, align 4, !tbaa !5
%tobool.not39 = icmp eq i32 %0, 0
br i1 %tobool.not39, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end35
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4
%rem = srem i32 %1, 3
%div = sdiv i32 %1, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end35
if.else: ; preds = %while.body
%rem3 = srem i32 %1, 5
%div6 = sdiv i32 %1, 5
%cmp4 = icmp eq i32 %rem3, 0
br i1 %cmp4, label %if.then5, label %if.else8
if.then5: ; preds = %if.else
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div6)
br label %if.end35
if.else8: ; preds = %if.else
%rem9 = srem i32 %1, 7
%div12 = sdiv i32 %1, 7
%cmp10 = icmp eq i32 %rem9, 0
br i1 %cmp10, label %if.then11, label %if.else14
if.then11: ; preds = %if.else8
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %div12)
br label %if.end35
if.else14: ; preds = %if.else8
%cmp17 = icmp eq i32 %rem, 1
%cmp18 = icmp sgt i32 %1, 7
%or.cond = and i1 %cmp18, %cmp17
br i1 %or.cond, label %if.then19, label %if.else22
if.then19: ; preds = %if.else14
%div20 = udiv i32 %1, 3
%sub = add nsw i32 %div20, -2
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %sub)
br label %if.end35
if.else22: ; preds = %if.else14
%cmp23 = icmp eq i32 %rem, 2
%or.cond36 = and i1 %cmp18, %cmp23
br i1 %or.cond36, label %if.then26, label %if.else30
if.then26: ; preds = %if.else22
%div27 = udiv i32 %1, 3
%sub28 = add nsw i32 %div27, -1
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %sub28)
br label %if.end35
if.else30: ; preds = %if.else22
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end35
if.end35: ; preds = %if.then5, %if.then19, %if.else30, %if.then26, %if.then11, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end35, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int sum[101][101];
int num(int y1,int x1,int y2,int x2){
int a,b,c,d;
a=sum[y1-1][x1-1];
b=sum[y1-1][x2];
c=sum[y2][x1-1];
d=sum[y2][x2];
return d-c-b+a;
}
int main(){
int n,w,h,s,t;
int i,j,tmp,ans;
while(scanf("%d",&n)==1&&n){
scanf("%d%d",&w,&h);
memset(sum,0,sizeof(sum));
for(i=0;i<n;i++){
int x,y;
scanf("%d%d",&x,&y);
sum[y][x]=1;
}
scanf("%d%d",&s,&t);
for(i=1;i<=h;i++){
for(j=1;j<=w;j++){
sum[i][j] = sum[i][j]+sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1];
}
}
ans=0;
for(i=1;i+t-1<=h;i++){
for(j=1;j+s-1<=w;j++){
tmp = num(i,j,i+t-1,j+s-1);
if(ans<tmp)ans=tmp;
}
}
printf("%d\n",ans);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155660/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155660/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@sum = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @num(i32 noundef %y1, i32 noundef %x1, i32 noundef %y2, i32 noundef %x2) local_unnamed_addr #0 {
entry:
%sub = add nsw i32 %y1, -1
%idxprom = sext i32 %sub to i64
%sub1 = add nsw i32 %x1, -1
%idxprom2 = sext i32 %sub1 to i64
%arrayidx3 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom, i64 %idxprom2
%0 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%idxprom7 = sext i32 %x2 to i64
%arrayidx8 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom, i64 %idxprom7
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%idxprom9 = sext i32 %y2 to i64
%arrayidx13 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9, i64 %idxprom2
%2 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9, i64 %idxprom7
%3 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%4 = add i32 %1, %2
%sub19 = sub i32 %0, %4
%add = add i32 %sub19, %3
ret i32 %add
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%w = alloca i32, align 4
%h = alloca i32, align 4
%s = alloca i32, align 4
%t = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp112 = icmp eq i32 %call111, 1
%0 = load i32, ptr %n, align 4
%tobool113 = icmp ne i32 %0, 0
%1 = select i1 %cmp112, i1 %tobool113, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %for.end65
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @sum, i8 0, i64 40804, i1 false)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp294 = icmp sgt i32 %2, 0
br i1 %cmp294, label %for.body, label %for.end
for.body: ; preds = %while.body, %for.body
%i.095 = phi i32 [ %inc, %for.body ], [ 0, %while.body ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%3 = load i32, ptr %y, align 4, !tbaa !5
%idxprom = sext i32 %3 to i64
%4 = load i32, ptr %x, align 4, !tbaa !5
%idxprom4 = sext i32 %4 to i64
%arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom, i64 %idxprom4
store i32 1, ptr %arrayidx5, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
%inc = add nuw nsw i32 %i.095, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %5
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %while.body
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp8.not98 = icmp slt i32 %6, 1
br i1 %cmp8.not98, label %for.cond44.preheader, label %for.cond10.preheader.lr.ph
for.cond10.preheader.lr.ph: ; preds = %for.end
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp11.not96 = icmp slt i32 %7, 1
br i1 %cmp11.not96, label %for.cond44.preheader, label %for.cond10.preheader.preheader
for.cond10.preheader.preheader: ; preds = %for.cond10.preheader.lr.ph
%8 = add nuw i32 %6, 1
%wide.trip.count122 = zext i32 %8 to i64
%.pre132.pre = load i32, ptr @sum, align 16, !tbaa !5
%9 = zext i32 %7 to i64
%xtraiter = and i64 %9, 1
%10 = icmp eq i32 %7, 1
%unroll_iter = and i64 %9, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond10.preheader
for.cond44.preheader: ; preds = %for.cond10.for.inc41_crit_edge, %for.cond10.preheader.lr.ph, %for.end
%11 = load i32, ptr %t, align 4, !tbaa !5
%cmp47.not105 = icmp sgt i32 %11, %6
br i1 %cmp47.not105, label %for.end65, label %for.cond49.preheader.lr.ph
for.cond49.preheader.lr.ph: ; preds = %for.cond44.preheader
%12 = load i32, ptr %s, align 4, !tbaa !5
%13 = load i32, ptr %w, align 4, !tbaa !5
%cmp52.not100 = icmp sgt i32 %12, %13
br i1 %cmp52.not100, label %for.end65, label %for.cond49.preheader.preheader
for.cond49.preheader.preheader: ; preds = %for.cond49.preheader.lr.ph
%14 = add i32 %12, 1
%15 = add i32 %13, 1
%smax = call i32 @llvm.smax.i32(i32 %14, i32 %15)
%16 = add i32 %smax, -1
%smax134 = call i32 @llvm.smax.i32(i32 %14, i32 %15)
%17 = xor i32 %12, -1
%18 = add i32 %smax134, %17
%19 = zext i32 %18 to i64
%20 = add nuw nsw i64 %19, 1
%min.iters.check = icmp ult i32 %18, 7
%21 = icmp slt i32 %16, %12
%or.cond = or i1 %min.iters.check, %21
%n.vec = and i64 %20, 8589934584
%ind.end = or i64 %n.vec, 1
%.cast = trunc i64 %n.vec to i32
%ind.end135 = add i32 %12, %.cast
%cmp.n = icmp eq i64 %20, %n.vec
br label %for.cond49.preheader
for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.cond10.for.inc41_crit_edge
%.pre132 = phi i32 [ %.pre132.pre, %for.cond10.preheader.preheader ], [ %.pre, %for.cond10.for.inc41_crit_edge ]
%indvars.iv118 = phi i64 [ 1, %for.cond10.preheader.preheader ], [ %indvars.iv.next119, %for.cond10.for.inc41_crit_edge ]
%22 = add nsw i64 %indvars.iv118, -1
%arrayidx25.phi.trans.insert = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %indvars.iv118, i64 0
%.pre = load i32, ptr %arrayidx25.phi.trans.insert, align 4, !tbaa !5
br i1 %10, label %for.cond10.for.inc41_crit_edge.unr-lcssa, label %for.body12
for.body12: ; preds = %for.cond10.preheader, %for.body12
%23 = phi i32 [ %28, %for.body12 ], [ %.pre132, %for.cond10.preheader ]
%24 = phi i32 [ %sub33.1, %for.body12 ], [ %.pre, %for.cond10.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body12 ], [ 1, %for.cond10.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body12 ], [ 0, %for.cond10.preheader ]
%arrayidx16 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %indvars.iv118, i64 %indvars.iv
%25 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %22, i64 %indvars.iv
%26 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add = add nsw i32 %26, %25
%add26 = add nsw i32 %add, %24
%sub33 = sub i32 %add26, %23
store i32 %sub33, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx16.1 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next
%27 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%arrayidx20.1 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %22, i64 %indvars.iv.next
%28 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5
%add.1 = add nsw i32 %28, %27
%add26.1 = add nsw i32 %add.1, %sub33
%sub33.1 = sub i32 %add26.1, %26
store i32 %sub33.1, ptr %arrayidx16.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond10.for.inc41_crit_edge.unr-lcssa, label %for.body12, !llvm.loop !11
for.cond10.for.inc41_crit_edge.unr-lcssa: ; preds = %for.body12, %for.cond10.preheader
%.unr = phi i32 [ %.pre132, %for.cond10.preheader ], [ %28, %for.body12 ]
%.unr149 = phi i32 [ %.pre, %for.cond10.preheader ], [ %sub33.1, %for.body12 ]
%indvars.iv.unr = phi i64 [ 1, %for.cond10.preheader ], [ %indvars.iv.next.1, %for.body12 ]
br i1 %lcmp.mod.not, label %for.cond10.for.inc41_crit_edge, label %for.body12.epil
for.body12.epil: ; preds = %for.cond10.for.inc41_crit_edge.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %indvars.iv118, i64 %indvars.iv.unr
%29 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%arrayidx20.epil = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %22, i64 %indvars.iv.unr
%30 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %30, %29
%add26.epil = add nsw i32 %add.epil, %.unr149
%sub33.epil = sub i32 %add26.epil, %.unr
store i32 %sub33.epil, ptr %arrayidx16.epil, align 4, !tbaa !5
br label %for.cond10.for.inc41_crit_edge
for.cond10.for.inc41_crit_edge: ; preds = %for.cond10.for.inc41_crit_edge.unr-lcssa, %for.body12.epil
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%exitcond123.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count122
br i1 %exitcond123.not, label %for.cond44.preheader, label %for.cond10.preheader, !llvm.loop !12
for.cond49.preheader: ; preds = %for.cond49.preheader.preheader, %for.cond49.for.inc63_crit_edge
%indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.cond49.for.inc63_crit_edge ], [ 1, %for.cond49.preheader.preheader ]
%sub46108 = phi i32 [ %sub46, %for.cond49.for.inc63_crit_edge ], [ %11, %for.cond49.preheader.preheader ]
%ans.0107 = phi i32 [ %spec.select.lcssa, %for.cond49.for.inc63_crit_edge ], [ 0, %for.cond49.preheader.preheader ]
%31 = add nsw i64 %indvars.iv128, -1
%idxprom9.i = sext i32 %sub46108 to i64
br i1 %or.cond, label %for.body53.preheader, label %vector.ph
vector.ph: ; preds = %for.cond49.preheader
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %ans.0107, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %47, %vector.body ]
%vec.phi137 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %48, %vector.body ]
%.cast138 = trunc i64 %index to i32
%offset.idx = add i32 %12, %.cast138
%32 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %31, i64 %index
%wide.load = load <4 x i32>, ptr %32, align 4, !tbaa !5
%33 = getelementptr inbounds i32, ptr %32, i64 4
%wide.load140 = load <4 x i32>, ptr %33, align 4, !tbaa !5
%34 = sext i32 %offset.idx to i64
%35 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %31, i64 %34
%wide.load141 = load <4 x i32>, ptr %35, align 4, !tbaa !5
%36 = getelementptr inbounds i32, ptr %35, i64 4
%wide.load142 = load <4 x i32>, ptr %36, align 4, !tbaa !5
%37 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9.i, i64 %index
%wide.load143 = load <4 x i32>, ptr %37, align 4, !tbaa !5
%38 = getelementptr inbounds i32, ptr %37, i64 4
%wide.load144 = load <4 x i32>, ptr %38, align 4, !tbaa !5
%39 = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9.i, i64 %34
%wide.load145 = load <4 x i32>, ptr %39, align 4, !tbaa !5
%40 = getelementptr inbounds i32, ptr %39, i64 4
%wide.load146 = load <4 x i32>, ptr %40, align 4, !tbaa !5
%41 = add <4 x i32> %wide.load141, %wide.load143
%42 = add <4 x i32> %wide.load142, %wide.load144
%43 = sub <4 x i32> %wide.load, %41
%44 = sub <4 x i32> %wide.load140, %42
%45 = add <4 x i32> %43, %wide.load145
%46 = add <4 x i32> %44, %wide.load146
%47 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %45)
%48 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi137, <4 x i32> %46)
%index.next = add nuw i64 %index, 8
%49 = icmp eq i64 %index.next, %n.vec
br i1 %49, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %47, <4 x i32> %48)
%50 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
br i1 %cmp.n, label %for.cond49.for.inc63_crit_edge, label %for.body53.preheader
for.body53.preheader: ; preds = %for.cond49.preheader, %middle.block
%indvars.iv124.ph = phi i64 [ 1, %for.cond49.preheader ], [ %ind.end, %middle.block ]
%sub51103.ph = phi i32 [ %12, %for.cond49.preheader ], [ %ind.end135, %middle.block ]
%ans.1102.ph = phi i32 [ %ans.0107, %for.cond49.preheader ], [ %50, %middle.block ]
br label %for.body53
for.body53: ; preds = %for.body53.preheader, %for.body53
%indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.body53 ], [ %indvars.iv124.ph, %for.body53.preheader ]
%sub51103 = phi i32 [ %sub51, %for.body53 ], [ %sub51103.ph, %for.body53.preheader ]
%ans.1102 = phi i32 [ %spec.select, %for.body53 ], [ %ans.1102.ph, %for.body53.preheader ]
%51 = add nsw i64 %indvars.iv124, -1
%arrayidx3.i = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %31, i64 %51
%52 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%idxprom7.i = sext i32 %sub51103 to i64
%arrayidx8.i = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %31, i64 %idxprom7.i
%53 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5
%arrayidx13.i = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9.i, i64 %51
%54 = load i32, ptr %arrayidx13.i, align 4, !tbaa !5
%arrayidx17.i = getelementptr inbounds [101 x [101 x i32]], ptr @sum, i64 0, i64 %idxprom9.i, i64 %idxprom7.i
%55 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5
%56 = add i32 %53, %54
%sub19.i = sub i32 %52, %56
%add.i = add i32 %sub19.i, %55
%spec.select = call i32 @llvm.smax.i32(i32 %ans.1102, i32 %add.i)
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%57 = trunc i64 %indvars.iv124 to i32
%sub51 = add i32 %12, %57
%cmp52.not = icmp sgt i32 %sub51, %13
br i1 %cmp52.not, label %for.cond49.for.inc63_crit_edge, label %for.body53, !llvm.loop !16
for.cond49.for.inc63_crit_edge: ; preds = %for.body53, %middle.block
%spec.select.lcssa = phi i32 [ %50, %middle.block ], [ %spec.select, %for.body53 ]
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%58 = trunc i64 %indvars.iv128 to i32
%sub46 = add i32 %11, %58
%cmp47.not = icmp sgt i32 %sub46, %6
br i1 %cmp47.not, label %for.end65, label %for.cond49.preheader, !llvm.loop !17
for.end65: ; preds = %for.cond49.for.inc63_crit_edge, %for.cond49.preheader.lr.ph, %for.cond44.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond44.preheader ], [ 0, %for.cond49.preheader.lr.ph ], [ %spec.select.lcssa, %for.cond49.for.inc63_crit_edge ]
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp = icmp eq i32 %call, 1
%59 = load i32, ptr %n, align 4
%tobool = icmp ne i32 %59, 0
%60 = select i1 %cmp, i1 %tobool, i1 false
br i1 %60, label %while.body, label %while.end, !llvm.loop !18
while.end: ; preds = %for.end65, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define abs(p) ((p)>=(0)?(p):(-(p)))
int cmp(const void *a, const void *b);
int main(void){
ll N, X[200005], Xcp[200005];
scanf("%lld", &N);
rep(i, 0, N){
scanf("%lld", X+i);
Xcp[i] = X[i];
}
qsort(X, N, sizeof(ll), cmp);
rep(i, 0, N){
if(Xcp[i]<X[N/2])printf("%lld\n", X[N/2]);
else printf("%lld\n", X[N/2 -1]);
}
return 0;
}
int cmp(const void *a, const void *b){
ll A=*(ll *)a, B=*(ll *)b;
if(A==B)return 0;
else return A>B ? 1:-1;//昇順ソート
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155710/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155710/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%X = alloca [200005 x i64], align 16
%Xcp = alloca [200005 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %X) #5
call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %Xcp) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp29 = icmp sgt i64 %0, 0
br i1 %cmp29, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %3, %for.body ]
call void @qsort(ptr noundef nonnull %X, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @cmp) #5
%1 = load i64, ptr %N, align 8, !tbaa !5
%cmp631 = icmp sgt i64 %1, 0
br i1 %cmp631, label %for.body8, label %for.cond.cleanup7
for.body: ; preds = %entry, %for.body
%i.030 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr %X, i64 %i.030
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%2 = load i64, ptr %add.ptr, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds [200005 x i64], ptr %Xcp, i64 0, i64 %i.030
store i64 %2, ptr %arrayidx2, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.030, 1
%3 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup7: ; preds = %for.inc18, %for.cond.cleanup
call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %Xcp) #5
call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %X) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
for.body8: ; preds = %for.cond.cleanup, %for.inc18
%4 = phi i64 [ %8, %for.inc18 ], [ %1, %for.cond.cleanup ]
%i4.032 = phi i64 [ %inc19, %for.inc18 ], [ 0, %for.cond.cleanup ]
%arrayidx9 = getelementptr inbounds [200005 x i64], ptr %Xcp, i64 0, i64 %i4.032
%5 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%div = sdiv i64 %4, 2
%arrayidx10 = getelementptr inbounds [200005 x i64], ptr %X, i64 0, i64 %div
%6 = load i64, ptr %arrayidx10, align 8, !tbaa !5
%cmp11 = icmp slt i64 %5, %6
br i1 %cmp11, label %for.inc18, label %if.else
if.else: ; preds = %for.body8
%sub = add nsw i64 %div, -1
%arrayidx16 = getelementptr inbounds [200005 x i64], ptr %X, i64 0, i64 %sub
%7 = load i64, ptr %arrayidx16, align 8, !tbaa !5
br label %for.inc18
for.inc18: ; preds = %for.body8, %if.else
%.sink = phi i64 [ %7, %if.else ], [ %6, %for.body8 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.sink)
%inc19 = add nuw nsw i64 %i4.032, 1
%8 = load i64, ptr %N, align 8, !tbaa !5
%cmp6 = icmp slt i64 %inc19, %8
br i1 %cmp6, label %for.body8, label %for.cond.cleanup7, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp eq i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = select i1 %cmp1, i32 1, i32 -1
%retval.0 = select i1 %cmp, i32 0, i32 %cond
ret i32 %retval.0
}
; Function Attrs: 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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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(){
int a[100][100],b[100][100],i,j,k,n,m,l,x;
long long int c[100][100]={0};
scanf("%d%d%d",&n,&m,&l);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d",&x);
a[i][j]=x;
}
}
for(j=0;j<m;j++){
for(k=0;k<l;k++){
scanf("%d",&x);
b[j][k]=x;
}
}
for(i=0;i<n;i++){
for(k=0;k<l;k++){
for(j=0;j<m;j++){
c[i][k]+=a[i][j]*b[j][k];
}
}
}
for(i=0;i<n;i++){
for(k=0;k<l;k++){
printf("%lld",c[i][k]);
if(k!=l-1)printf(" ");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155769/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155769/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x [100 x i32]], align 16
%b = alloca [100 x [100 x i32]], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
%x = alloca i32, align 4
%c = alloca [100 x [100 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #5
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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %c, i8 0, i64 80000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp111 = icmp sgt i32 %0, 0
%.pre167 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp111, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre167, 0
br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %11, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %12, %for.inc7 ], [ %.pre167, %for.cond1.preheader.lr.ph ]
%indvars.iv139 = phi i64 [ %indvars.iv.next140, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2109 = icmp sgt i32 %3, 0
br i1 %cmp2109, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %11, %for.inc7 ]
%5 = phi i32 [ %.pre167, %entry ], [ %12, %for.inc7 ]
%cmp11115 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond184 = select i1 %cmp11115, i1 %7, i1 false
br i1 %or.cond184, label %for.cond13.preheader, label %for.cond27.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%8 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv139, i64 %indvars.iv
store i32 %8, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %m, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%11 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%12 = phi i32 [ %9, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%13 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next140, %13
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24
%14 = phi i32 [ %30, %for.inc24 ], [ %5, %for.cond10.preheader ]
%15 = phi i32 [ %31, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14113 = icmp sgt i32 %15, 0
br i1 %cmp14113, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre169 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader
%16 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre169, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %30, %for.cond27.preheader.loopexit ]
%cmp28121 = icmp sgt i32 %16, 0
br i1 %cmp28121, label %for.cond30.preheader.lr.ph, label %for.end79
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa174 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre167, %for.cond1.preheader.lr.ph ]
%17 = phi i32 [ %16, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%18 = load i32, ptr %l, align 4, !tbaa !5
%cmp31119 = icmp sgt i32 %18, 0
%cmp34117 = icmp sgt i32 %.lcssa174, 0
%or.cond = select i1 %cmp31119, i1 %cmp34117, i1 false
br i1 %or.cond, label %for.cond30.preheader.us.us.preheader, label %for.cond61.preheader.preheader
for.cond61.preheader.preheader: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph
br label %for.cond61.preheader
for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph
%wide.trip.count159 = zext i32 %17 to i64
%wide.trip.count154 = zext i32 %18 to i64
%wide.trip.count = zext i32 %.lcssa174 to i64
%xtraiter = and i64 %wide.trip.count, 1
%19 = icmp eq i32 %.lcssa174, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond30.preheader.us.us
for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us
%indvars.iv156 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next157, %for.cond30.for.inc54_crit_edge.split.us.us.us ]
br label %for.cond33.preheader.us.us.us
for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us
%indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ]
%arrayidx47.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv156, i64 %indvars.iv151
%arrayidx47.promoted.us.us.us = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13
br i1 %19, label %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us
for.body35.us.us.us: ; preds = %for.cond33.preheader.us.us.us, %for.body35.us.us.us
%indvars.iv148 = phi i64 [ %indvars.iv.next149.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%20 = phi i64 [ %add.us.us.us.1, %for.body35.us.us.us ], [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ]
%niter = phi i64 [ %niter.next.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%arrayidx39.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv148
%21 = load i32, ptr %arrayidx39.us.us.us, align 8, !tbaa !5
%arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv148, i64 %indvars.iv151
%22 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5
%mul.us.us.us = mul nsw i32 %22, %21
%conv.us.us.us = sext i32 %mul.us.us.us to i64
%add.us.us.us = add nsw i64 %20, %conv.us.us.us
%indvars.iv.next149 = or i64 %indvars.iv148, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv.next149
%23 = load i32, ptr %arrayidx39.us.us.us.1, align 4, !tbaa !5
%arrayidx43.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next149, i64 %indvars.iv151
%24 = load i32, ptr %arrayidx43.us.us.us.1, align 4, !tbaa !5
%mul.us.us.us.1 = mul nsw i32 %24, %23
%conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1
%indvars.iv.next149.1 = add nuw nsw i64 %indvars.iv148, 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.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us, !llvm.loop !15
for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body35.us.us.us, %for.cond33.preheader.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ]
%indvars.iv148.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next149.1, %for.body35.us.us.us ]
%.unr = phi i64 [ %arrayidx47.promoted.us.us.us, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ]
br i1 %lcmp.mod.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.epil
for.body35.us.us.us.epil: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa
%arrayidx39.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv148.unr
%25 = load i32, ptr %arrayidx39.us.us.us.epil, align 4, !tbaa !5
%arrayidx43.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv148.unr, i64 %indvars.iv151
%26 = load i32, ptr %arrayidx43.us.us.us.epil, align 4, !tbaa !5
%mul.us.us.us.epil = mul nsw i32 %26, %25
%conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64
%add.us.us.us.epil = add nsw i64 %.unr, %conv.us.us.us.epil
br label %for.cond33.for.inc51_crit_edge.us.us.us
for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa, %for.body35.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond33.for.inc51_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body35.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx47.us.us.us, align 8, !tbaa !13
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%exitcond155.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count154
br i1 %exitcond155.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !16
for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us
%indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
%exitcond160.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count159
br i1 %exitcond160.not, label %for.cond61.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !17
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.body15 ], [ 0, %for.cond13.preheader ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%27 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv145, i64 %indvars.iv142
store i32 %27, ptr %arrayidx20, align 4, !tbaa !5
%indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
%28 = load i32, ptr %l, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp14 = icmp slt i64 %indvars.iv.next143, %29
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18
for.inc24.loopexit: ; preds = %for.body15
%.pre168 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%30 = phi i32 [ %.pre168, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%31 = phi i32 [ %28, %for.inc24.loopexit ], [ %15, %for.cond13.preheader ]
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%32 = sext i32 %30 to i64
%cmp11 = icmp slt i64 %indvars.iv.next146, %32
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !19
for.cond61.preheader: ; preds = %for.cond61.preheader.preheader, %for.end75
%indvars.iv164 = phi i64 [ %indvars.iv.next165, %for.end75 ], [ 0, %for.cond61.preheader.preheader ]
%33 = load i32, ptr %l, align 4, !tbaa !5
%cmp62129 = icmp sgt i32 %33, 0
br i1 %cmp62129, label %for.body64, label %for.end75
for.body64: ; preds = %for.cond61.preheader, %for.inc73
%indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.inc73 ], [ 0, %for.cond61.preheader ]
%arrayidx68 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv164, i64 %indvars.iv161
%34 = load i64, ptr %arrayidx68, align 8, !tbaa !13
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %34)
%35 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %35, -1
%36 = zext i32 %sub to i64
%cmp70.not = icmp eq i64 %indvars.iv161, %36
br i1 %cmp70.not, label %for.inc73, label %if.then
if.then: ; preds = %for.body64
%putchar108 = call i32 @putchar(i32 32)
%.pre170 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc73
for.inc73: ; preds = %for.body64, %if.then
%37 = phi i32 [ %35, %for.body64 ], [ %.pre170, %if.then ]
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%38 = sext i32 %37 to i64
%cmp62 = icmp slt i64 %indvars.iv.next162, %38
br i1 %cmp62, label %for.body64, label %for.end75, !llvm.loop !20
for.end75: ; preds = %for.inc73, %for.cond61.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
%39 = load i32, ptr %n, align 4, !tbaa !5
%40 = sext i32 %39 to i64
%cmp58 = icmp slt i64 %indvars.iv.next165, %40
br i1 %cmp58, label %for.cond61.preheader, label %for.end79, !llvm.loop !21
for.end79: ; preds = %for.end75, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
|
#include<stdio.h>
int main(){
int n,m,l; //最初に入力される変数
scanf("%d %d %d",&n,&m,&l); //最初の入力
int A[n][m]; //行列Aの定義
int B[m][l]; //行列Bの定義
long int C[n][l]; //行列Cの定義
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
scanf("%d",&A[i][j]);//行列Aに要素を格納
}
}
for(int i = 0;i < m;i++){
for(int j = 0;j < l;j++){
scanf("%d",&B[i][j]);//行列Bに要素を格納
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < l;j++){
C[i][j] = 0;//行列cの初期化
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
for(int k = 0;k < l;k++){
C[i][k] += (long)A[i][j] * (long)B[j][k];
}
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < l;j++){
printf("%ld",C[i][j]);//出力
if(j != l - 1){
printf(" ");
}
}
printf("\n");//行毎に改行
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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 i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %m, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i32, i64 %5, align 16
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%8 = load i32, ptr %l, align 4, !tbaa !5
%9 = zext i32 %8 to i64
%10 = mul nuw i64 %9, %7
%vla1 = alloca i32, i64 %10, align 16
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = zext i32 %11 to i64
%13 = mul nuw i64 %12, %9
%vla2 = alloca i64, i64 %13, align 16
%cmp147 = icmp sgt i32 %11, 0
br i1 %cmp147, label %for.cond3.preheader.lr.ph, label %for.cond14.preheader
for.cond3.preheader.lr.ph: ; preds = %entry
%14 = icmp sgt i32 %6, 0
br i1 %14, label %for.cond3.preheader, label %for.cond40.preheader.lr.ph
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.cond.cleanup5
%15 = phi i32 [ %22, %for.cond.cleanup5 ], [ %11, %for.cond3.preheader.lr.ph ]
%16 = phi i32 [ %23, %for.cond.cleanup5 ], [ %6, %for.cond3.preheader.lr.ph ]
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.cond.cleanup5 ], [ 0, %for.cond3.preheader.lr.ph ]
%cmp4145 = icmp sgt i32 %16, 0
br i1 %cmp4145, label %for.body6.lr.ph, label %for.cond.cleanup5
for.body6.lr.ph: ; preds = %for.cond3.preheader
%17 = mul nuw nsw i64 %indvars.iv181, %3
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %17
br label %for.body6
for.cond14.preheader: ; preds = %for.cond.cleanup5, %entry
%18 = phi i32 [ %11, %entry ], [ %22, %for.cond.cleanup5 ]
%19 = phi i32 [ %6, %entry ], [ %23, %for.cond.cleanup5 ]
%cmp15151 = icmp sgt i32 %19, 0
%20 = load i32, ptr %l, align 4
%21 = icmp sgt i32 %20, 0
%or.cond237 = select i1 %cmp15151, i1 %21, i1 false
br i1 %or.cond237, label %for.cond19.preheader, label %for.cond35.preheader
for.cond.cleanup5.loopexit: ; preds = %for.body6
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit, %for.cond3.preheader
%22 = phi i32 [ %.pre, %for.cond.cleanup5.loopexit ], [ %15, %for.cond3.preheader ]
%23 = phi i32 [ %25, %for.cond.cleanup5.loopexit ], [ %16, %for.cond3.preheader ]
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%24 = sext i32 %22 to i64
%cmp = icmp slt i64 %indvars.iv.next182, %24
br i1 %cmp, label %for.cond3.preheader, label %for.cond14.preheader, !llvm.loop !9
for.body6: ; preds = %for.body6.lr.ph, %for.body6
%indvars.iv = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next, %for.body6 ]
%arrayidx8 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%25 = load i32, ptr %m, align 4, !tbaa !5
%26 = sext i32 %25 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %26
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5.loopexit, !llvm.loop !12
for.cond19.preheader: ; preds = %for.cond14.preheader, %for.cond.cleanup21
%27 = phi i32 [ %45, %for.cond.cleanup21 ], [ %19, %for.cond14.preheader ]
%28 = phi i32 [ %46, %for.cond.cleanup21 ], [ %20, %for.cond14.preheader ]
%indvars.iv187 = phi i64 [ %indvars.iv.next188, %for.cond.cleanup21 ], [ 0, %for.cond14.preheader ]
%cmp20149 = icmp sgt i32 %28, 0
br i1 %cmp20149, label %for.body22.lr.ph, label %for.cond.cleanup21
for.body22.lr.ph: ; preds = %for.cond19.preheader
%29 = mul nuw nsw i64 %indvars.iv187, %9
%arrayidx24 = getelementptr inbounds i32, ptr %vla1, i64 %29
br label %for.body22
for.cond35.preheader.loopexit: ; preds = %for.cond.cleanup21
%.pre216 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond35.preheader
for.cond35.preheader: ; preds = %for.cond35.preheader.loopexit, %for.cond14.preheader
%30 = phi i32 [ %18, %for.cond14.preheader ], [ %.pre216, %for.cond35.preheader.loopexit ]
%.lcssa144 = phi i32 [ %19, %for.cond14.preheader ], [ %45, %for.cond35.preheader.loopexit ]
%cmp36155 = icmp sgt i32 %30, 0
br i1 %cmp36155, label %for.cond40.preheader.lr.ph, label %for.cond.cleanup94
for.cond40.preheader.lr.ph: ; preds = %for.cond3.preheader.lr.ph, %for.cond35.preheader
%.lcssa144222 = phi i32 [ %.lcssa144, %for.cond35.preheader ], [ %6, %for.cond3.preheader.lr.ph ]
%31 = phi i32 [ %30, %for.cond35.preheader ], [ %11, %for.cond3.preheader.lr.ph ]
%32 = load i32, ptr %l, align 4, !tbaa !5
%cmp41153 = icmp sgt i32 %32, 0
br i1 %cmp41153, label %for.cond40.preheader.us.preheader, label %for.cond60.preheader.lr.ph
for.cond40.preheader.us.preheader: ; preds = %for.cond40.preheader.lr.ph
%33 = shl nuw nsw i64 %9, 3
%34 = zext i32 %32 to i64
%35 = shl nuw nsw i64 %34, 3
%wide.trip.count = zext i32 %31 to i64
%xtraiter = and i64 %wide.trip.count, 7
%36 = icmp ult i32 %31, 8
br i1 %36, label %for.cond60.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond40.preheader.us.preheader.new
for.cond40.preheader.us.preheader.new: ; preds = %for.cond40.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
br label %for.cond40.preheader.us
for.cond40.preheader.us: ; preds = %for.cond40.preheader.us, %for.cond40.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond40.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond40.preheader.us ]
%niter = phi i64 [ 0, %for.cond40.preheader.us.preheader.new ], [ %niter.next.7, %for.cond40.preheader.us ]
%37 = mul nuw nsw i64 %33, %indvar
%scevgep = getelementptr i8, ptr %vla2, i64 %37
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next = or i64 %indvar, 1
%38 = mul nuw nsw i64 %33, %indvar.next
%scevgep.1 = getelementptr i8, ptr %vla2, i64 %38
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.1, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.1 = or i64 %indvar, 2
%39 = mul nuw nsw i64 %33, %indvar.next.1
%scevgep.2 = getelementptr i8, ptr %vla2, i64 %39
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.2 = or i64 %indvar, 3
%40 = mul nuw nsw i64 %33, %indvar.next.2
%scevgep.3 = getelementptr i8, ptr %vla2, i64 %40
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.3, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.3 = or i64 %indvar, 4
%41 = mul nuw nsw i64 %33, %indvar.next.3
%scevgep.4 = getelementptr i8, ptr %vla2, i64 %41
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.4 = or i64 %indvar, 5
%42 = mul nuw nsw i64 %33, %indvar.next.4
%scevgep.5 = getelementptr i8, ptr %vla2, i64 %42
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.5, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.5 = or i64 %indvar, 6
%43 = mul nuw nsw i64 %33, %indvar.next.5
%scevgep.6 = getelementptr i8, ptr %vla2, i64 %43
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.6, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.6 = or i64 %indvar, 7
%44 = mul nuw nsw i64 %33, %indvar.next.6
%scevgep.7 = getelementptr i8, ptr %vla2, i64 %44
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.7, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond60.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond40.preheader.us, !llvm.loop !15
for.cond.cleanup21.loopexit: ; preds = %for.body22
%.pre215 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup21
for.cond.cleanup21: ; preds = %for.cond.cleanup21.loopexit, %for.cond19.preheader
%45 = phi i32 [ %.pre215, %for.cond.cleanup21.loopexit ], [ %27, %for.cond19.preheader ]
%46 = phi i32 [ %48, %for.cond.cleanup21.loopexit ], [ %28, %for.cond19.preheader ]
%indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
%47 = sext i32 %45 to i64
%cmp15 = icmp slt i64 %indvars.iv.next188, %47
br i1 %cmp15, label %for.cond19.preheader, label %for.cond35.preheader.loopexit, !llvm.loop !16
for.body22: ; preds = %for.body22.lr.ph, %for.body22
%indvars.iv184 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next185, %for.body22 ]
%arrayidx26 = getelementptr inbounds i32, ptr %arrayidx24, i64 %indvars.iv184
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx26)
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%48 = load i32, ptr %l, align 4, !tbaa !5
%49 = sext i32 %48 to i64
%cmp20 = icmp slt i64 %indvars.iv.next185, %49
br i1 %cmp20, label %for.body22, label %for.cond.cleanup21.loopexit, !llvm.loop !17
for.cond60.preheader.lr.ph.loopexit.unr-lcssa: ; preds = %for.cond40.preheader.us, %for.cond40.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond40.preheader.us.preheader ], [ %indvar.next.7, %for.cond40.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond60.preheader.lr.ph, label %for.cond40.preheader.us.epil
for.cond40.preheader.us.epil: ; preds = %for.cond60.preheader.lr.ph.loopexit.unr-lcssa, %for.cond40.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond40.preheader.us.epil ], [ %indvar.unr, %for.cond60.preheader.lr.ph.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond40.preheader.us.epil ], [ 0, %for.cond60.preheader.lr.ph.loopexit.unr-lcssa ]
%50 = mul nuw nsw i64 %33, %indvar.epil
%scevgep.epil = getelementptr i8, ptr %vla2, i64 %50
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond60.preheader.lr.ph, label %for.cond40.preheader.us.epil, !llvm.loop !18
for.cond60.preheader.lr.ph: ; preds = %for.cond60.preheader.lr.ph.loopexit.unr-lcssa, %for.cond40.preheader.us.epil, %for.cond40.preheader.lr.ph
%cmp61161 = icmp sgt i32 %.lcssa144222, 0
%51 = load i32, ptr %l, align 4
%cmp65159 = icmp sgt i32 %51, 0
%or.cond = select i1 %cmp61161, i1 %cmp65159, i1 false
br i1 %or.cond, label %for.cond60.preheader.us.us.preheader, label %for.cond97.preheader.preheader
for.cond60.preheader.us.us.preheader: ; preds = %for.cond60.preheader.lr.ph
%wide.trip.count207 = zext i32 %31 to i64
%wide.trip.count202 = zext i32 %.lcssa144222 to i64
%wide.trip.count197 = zext i32 %51 to i64
%min.iters.check = icmp ult i32 %51, 4
%n.vec = and i64 %wide.trip.count197, 4294967292
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count197
br label %for.cond60.preheader.us.us
for.cond60.preheader.us.us: ; preds = %for.cond60.preheader.us.us.preheader, %for.cond60.for.cond.cleanup62_crit_edge.split.us.us.us
%indvars.iv204 = phi i64 [ 0, %for.cond60.preheader.us.us.preheader ], [ %indvars.iv.next205, %for.cond60.for.cond.cleanup62_crit_edge.split.us.us.us ]
%52 = mul nuw nsw i64 %indvars.iv204, %3
%arrayidx69.us.us = getelementptr inbounds i32, ptr %vla, i64 %52
%53 = mul nuw nsw i64 %indvars.iv204, %9
%arrayidx78.us.us = getelementptr inbounds i64, ptr %vla2, i64 %53
br label %for.cond64.preheader.us.us.us
for.cond64.preheader.us.us.us: ; preds = %for.cond64.for.cond.cleanup66_crit_edge.us.us.us, %for.cond60.preheader.us.us
%indvars.iv199 = phi i64 [ %indvars.iv.next200, %for.cond64.for.cond.cleanup66_crit_edge.us.us.us ], [ 0, %for.cond60.preheader.us.us ]
%arrayidx71.us.us.us = getelementptr inbounds i32, ptr %arrayidx69.us.us, i64 %indvars.iv199
%54 = load i32, ptr %arrayidx71.us.us.us, align 4, !tbaa !5
%conv.us.us.us = sext i32 %54 to i64
%55 = mul nuw nsw i64 %indvars.iv199, %9
%arrayidx73.us.us.us = getelementptr inbounds i32, ptr %vla1, i64 %55
br i1 %min.iters.check, label %for.body67.us.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond64.preheader.us.us.us
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %conv.us.us.us, 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 ]
%56 = getelementptr inbounds i32, ptr %arrayidx73.us.us.us, i64 %index
%wide.load = load <2 x i32>, ptr %56, align 4, !tbaa !5
%57 = getelementptr inbounds i32, ptr %56, i64 2
%wide.load242 = load <2 x i32>, ptr %57, align 4, !tbaa !5
%58 = sext <2 x i32> %wide.load to <2 x i64>
%59 = sext <2 x i32> %wide.load242 to <2 x i64>
%60 = mul nsw <2 x i64> %broadcast.splat, %58
%61 = mul nsw <2 x i64> %broadcast.splat, %59
%62 = getelementptr inbounds i64, ptr %arrayidx78.us.us, i64 %index
%wide.load243 = load <2 x i64>, ptr %62, align 8, !tbaa !13
%63 = getelementptr inbounds i64, ptr %62, i64 2
%wide.load244 = load <2 x i64>, ptr %63, align 8, !tbaa !13
%64 = add nsw <2 x i64> %60, %wide.load243
%65 = add nsw <2 x i64> %61, %wide.load244
store <2 x i64> %64, ptr %62, align 8, !tbaa !13
store <2 x i64> %65, ptr %63, align 8, !tbaa !13
%index.next = add nuw i64 %index, 4
%66 = icmp eq i64 %index.next, %n.vec
br i1 %66, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond64.for.cond.cleanup66_crit_edge.us.us.us, label %for.body67.us.us.us.preheader
for.body67.us.us.us.preheader: ; preds = %for.cond64.preheader.us.us.us, %middle.block
%indvars.iv194.ph = phi i64 [ 0, %for.cond64.preheader.us.us.us ], [ %n.vec, %middle.block ]
br label %for.body67.us.us.us
for.body67.us.us.us: ; preds = %for.body67.us.us.us.preheader, %for.body67.us.us.us
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.body67.us.us.us ], [ %indvars.iv194.ph, %for.body67.us.us.us.preheader ]
%arrayidx75.us.us.us = getelementptr inbounds i32, ptr %arrayidx73.us.us.us, i64 %indvars.iv194
%67 = load i32, ptr %arrayidx75.us.us.us, align 4, !tbaa !5
%conv76.us.us.us = sext i32 %67 to i64
%mul.us.us.us = mul nsw i64 %conv76.us.us.us, %conv.us.us.us
%arrayidx80.us.us.us = getelementptr inbounds i64, ptr %arrayidx78.us.us, i64 %indvars.iv194
%68 = load i64, ptr %arrayidx80.us.us.us, align 8, !tbaa !13
%add.us.us.us = add nsw i64 %mul.us.us.us, %68
store i64 %add.us.us.us, ptr %arrayidx80.us.us.us, align 8, !tbaa !13
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count197
br i1 %exitcond198.not, label %for.cond64.for.cond.cleanup66_crit_edge.us.us.us, label %for.body67.us.us.us, !llvm.loop !23
for.cond64.for.cond.cleanup66_crit_edge.us.us.us: ; preds = %for.body67.us.us.us, %middle.block
%indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
%exitcond203.not = icmp eq i64 %indvars.iv.next200, %wide.trip.count202
br i1 %exitcond203.not, label %for.cond60.for.cond.cleanup62_crit_edge.split.us.us.us, label %for.cond64.preheader.us.us.us, !llvm.loop !24
for.cond60.for.cond.cleanup62_crit_edge.split.us.us.us: ; preds = %for.cond64.for.cond.cleanup66_crit_edge.us.us.us
%indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
%exitcond208.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count207
br i1 %exitcond208.not, label %for.cond97.preheader.preheader, label %for.cond60.preheader.us.us, !llvm.loop !25
for.cond97.preheader.preheader: ; preds = %for.cond60.for.cond.cleanup62_crit_edge.split.us.us.us, %for.cond60.preheader.lr.ph
br label %for.cond97.preheader
for.cond97.preheader: ; preds = %for.cond97.preheader.preheader, %for.cond.cleanup100
%indvars.iv212 = phi i64 [ %indvars.iv.next213, %for.cond.cleanup100 ], [ 0, %for.cond97.preheader.preheader ]
%69 = load i32, ptr %l, align 4, !tbaa !5
%cmp98171 = icmp sgt i32 %69, 0
br i1 %cmp98171, label %for.body101.lr.ph, label %for.cond.cleanup100
for.body101.lr.ph: ; preds = %for.cond97.preheader
%70 = mul nuw nsw i64 %indvars.iv212, %9
%arrayidx103 = getelementptr inbounds i64, ptr %vla2, i64 %70
br label %for.body101
for.cond.cleanup94: ; preds = %for.cond.cleanup100, %for.cond35.preheader
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.cond.cleanup100: ; preds = %for.inc110, %for.cond97.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
%71 = load i32, ptr %n, align 4, !tbaa !5
%72 = sext i32 %71 to i64
%cmp92 = icmp slt i64 %indvars.iv.next213, %72
br i1 %cmp92, label %for.cond97.preheader, label %for.cond.cleanup94, !llvm.loop !26
for.body101: ; preds = %for.body101.lr.ph, %for.inc110
%indvars.iv209 = phi i64 [ 0, %for.body101.lr.ph ], [ %indvars.iv.next210, %for.inc110 ]
%arrayidx105 = getelementptr inbounds i64, ptr %arrayidx103, i64 %indvars.iv209
%73 = load i64, ptr %arrayidx105, align 8, !tbaa !13
%call106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %73)
%74 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %74, -1
%75 = zext i32 %sub to i64
%cmp107.not = icmp eq i64 %indvars.iv209, %75
br i1 %cmp107.not, label %for.inc110, label %if.then
if.then: ; preds = %for.body101
%putchar143 = call i32 @putchar(i32 32)
%.pre217 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc110
for.inc110: ; preds = %for.body101, %if.then
%76 = phi i32 [ %74, %for.body101 ], [ %.pre217, %if.then ]
%indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1
%77 = sext i32 %76 to i64
%cmp98 = icmp slt i64 %indvars.iv.next210, %77
br i1 %cmp98, label %for.body101, label %for.cond.cleanup100, !llvm.loop !27
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !10, !22, !21}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include <stdio.h>
int main(){
int n,m,l;
int a[100][100],b[100][100],i,j,k;
unsigned long int c[100][100];
scanf("%d %d %d",&n,&m,&l);
for(i=0; i<n; i++){
for(j=0; j<m; j++){
scanf("%d",&a[i][j]);
}
}
for(i=0; i<m; i++){
for(j=0; j<l; j++){
scanf("%d",&b[i][j]);
}
}
for(i=0; i<n; i++){
for(j=0; j<l; j++){
c[i][j]=0;
}
}//----
for(i=0; i<n; i++){//
for(j=0; j<l; j++){
for(k=0; k<m; k++){
c[i][j]+=(a[i][k]*b[k][j]);
}
}
}
for(i=0; i<n; i++){
for(j=0; j<l; j++){
if(j==l-1)printf("%ld\n",c[i][j]);
else printf("%ld ",c[i][j]);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%ld \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
%l = alloca i32, align 4
%a = alloca [100 x [100 x i32]], align 16
%b = alloca [100 x [100 x i32]], align 16
%c = alloca [100 x [100 x i64]], 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 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp138 = icmp sgt i32 %0, 0
%.pre207 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp138, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre207, 0
br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.inc7 ], [ %.pre207, %for.cond1.preheader.lr.ph ]
%indvars.iv173 = phi i64 [ %indvars.iv.next174, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2136 = icmp sgt i32 %3, 0
br i1 %cmp2136, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre207, %entry ], [ %11, %for.inc7 ]
%cmp11142 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond232 = select i1 %cmp11142, i1 %7, i1 false
br i1 %or.cond232, label %for.cond13.preheader, label %for.cond27.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv173, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next174, %12
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24
%13 = phi i32 [ %31, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %32, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14140 = icmp sgt i32 %14, 0
br i1 %cmp14140, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre209 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader
%15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre209, %for.cond27.preheader.loopexit ]
%.lcssa135 = phi i32 [ %5, %for.cond10.preheader ], [ %31, %for.cond27.preheader.loopexit ]
%cmp28146 = icmp sgt i32 %15, 0
br i1 %cmp28146, label %for.cond30.preheader.lr.ph, label %for.end98
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa135215 = phi i32 [ %.lcssa135, %for.cond27.preheader ], [ %.pre207, %for.cond1.preheader.lr.ph ]
%16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%cmp31144 = icmp sgt i32 %17, 0
br i1 %cmp31144, label %for.cond30.preheader.us.preheader, label %for.cond46.preheader.lr.ph
for.cond30.preheader.us.preheader: ; preds = %for.cond30.preheader.lr.ph
%18 = zext i32 %17 to i64
%19 = shl nuw nsw i64 %18, 3
%wide.trip.count = zext i32 %16 to i64
%xtraiter = and i64 %wide.trip.count, 7
%20 = icmp ult i32 %16, 8
br i1 %20, label %for.cond46.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond30.preheader.us.preheader.new
for.cond30.preheader.us.preheader.new: ; preds = %for.cond30.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
%invariant.gep = getelementptr i8, ptr %c, i64 800
%invariant.gep254 = getelementptr i8, ptr %c, i64 1600
%invariant.gep256 = getelementptr i8, ptr %c, i64 2400
%invariant.gep258 = getelementptr i8, ptr %c, i64 3200
%invariant.gep260 = getelementptr i8, ptr %c, i64 4000
%invariant.gep262 = getelementptr i8, ptr %c, i64 4800
%invariant.gep264 = getelementptr i8, ptr %c, i64 5600
br label %for.cond30.preheader.us
for.cond30.preheader.us: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond30.preheader.us ]
%niter = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %niter.next.7, %for.cond30.preheader.us ]
%21 = mul nuw nsw i64 %indvar, 800
%scevgep = getelementptr i8, ptr %c, i64 %21
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %19, i1 false), !tbaa !13
%22 = mul nuw i64 %indvar, 800
%gep = getelementptr i8, ptr %invariant.gep, i64 %22
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %19, i1 false), !tbaa !13
%23 = mul nuw i64 %indvar, 800
%gep255 = getelementptr i8, ptr %invariant.gep254, i64 %23
call void @llvm.memset.p0.i64(ptr align 16 %gep255, i8 0, i64 %19, i1 false), !tbaa !13
%24 = mul nuw i64 %indvar, 800
%gep257 = getelementptr i8, ptr %invariant.gep256, i64 %24
call void @llvm.memset.p0.i64(ptr align 16 %gep257, i8 0, i64 %19, i1 false), !tbaa !13
%25 = mul nuw i64 %indvar, 800
%gep259 = getelementptr i8, ptr %invariant.gep258, i64 %25
call void @llvm.memset.p0.i64(ptr align 16 %gep259, i8 0, i64 %19, i1 false), !tbaa !13
%26 = mul nuw i64 %indvar, 800
%gep261 = getelementptr i8, ptr %invariant.gep260, i64 %26
call void @llvm.memset.p0.i64(ptr align 16 %gep261, i8 0, i64 %19, i1 false), !tbaa !13
%27 = mul nuw i64 %indvar, 800
%gep263 = getelementptr i8, ptr %invariant.gep262, i64 %27
call void @llvm.memset.p0.i64(ptr align 16 %gep263, i8 0, i64 %19, i1 false), !tbaa !13
%28 = mul nuw i64 %indvar, 800
%gep265 = getelementptr i8, ptr %invariant.gep264, i64 %28
call void @llvm.memset.p0.i64(ptr align 16 %gep265, i8 0, i64 %19, i1 false), !tbaa !13
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond46.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond30.preheader.us, !llvm.loop !15
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv179, i64 %indvars.iv176
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%29 = load i32, ptr %l, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp14 = icmp slt i64 %indvars.iv.next177, %30
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !16
for.inc24.loopexit: ; preds = %for.body15
%.pre208 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%31 = phi i32 [ %.pre208, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%32 = phi i32 [ %29, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%33 = sext i32 %31 to i64
%cmp11 = icmp slt i64 %indvars.iv.next180, %33
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !17
for.cond46.preheader.lr.ph.loopexit.unr-lcssa: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvar.next.7, %for.cond30.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond46.preheader.lr.ph, label %for.cond30.preheader.us.epil
for.cond30.preheader.us.epil: ; preds = %for.cond46.preheader.lr.ph.loopexit.unr-lcssa, %for.cond30.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond30.preheader.us.epil ], [ %indvar.unr, %for.cond46.preheader.lr.ph.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond30.preheader.us.epil ], [ 0, %for.cond46.preheader.lr.ph.loopexit.unr-lcssa ]
%34 = mul nuw nsw i64 %indvar.epil, 800
%scevgep.epil = getelementptr i8, ptr %c, i64 %34
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %19, i1 false), !tbaa !13
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond46.preheader.lr.ph, label %for.cond30.preheader.us.epil, !llvm.loop !18
for.cond46.preheader.lr.ph: ; preds = %for.cond46.preheader.lr.ph.loopexit.unr-lcssa, %for.cond30.preheader.us.epil, %for.cond30.preheader.lr.ph
%35 = load i32, ptr %l, align 4, !tbaa !5
%cmp47152 = icmp sgt i32 %35, 0
br i1 %cmp47152, label %for.cond46.preheader.lr.ph.split.us, label %for.end98
for.cond46.preheader.lr.ph.split.us: ; preds = %for.cond46.preheader.lr.ph
%cmp50150 = icmp sgt i32 %.lcssa135215, 0
br i1 %cmp50150, label %for.cond46.preheader.us.us.preheader, label %for.cond77.preheader.preheader
for.cond46.preheader.us.us.preheader: ; preds = %for.cond46.preheader.lr.ph.split.us
%wide.trip.count199 = zext i32 %16 to i64
%wide.trip.count194 = zext i32 %35 to i64
%wide.trip.count189 = zext i32 %.lcssa135215 to i64
%xtraiter243 = and i64 %wide.trip.count189, 1
%36 = icmp eq i32 %.lcssa135215, 1
%unroll_iter247 = and i64 %wide.trip.count189, 4294967294
%lcmp.mod245.not = icmp eq i64 %xtraiter243, 0
br label %for.cond46.preheader.us.us
for.cond46.preheader.us.us: ; preds = %for.cond46.preheader.us.us.preheader, %for.cond46.for.inc70_crit_edge.split.us.us.us
%indvars.iv196 = phi i64 [ 0, %for.cond46.preheader.us.us.preheader ], [ %indvars.iv.next197, %for.cond46.for.inc70_crit_edge.split.us.us.us ]
br label %for.cond49.preheader.us.us.us
for.cond49.preheader.us.us.us: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us, %for.cond46.preheader.us.us
%indvars.iv191 = phi i64 [ %indvars.iv.next192, %for.cond49.for.inc67_crit_edge.us.us.us ], [ 0, %for.cond46.preheader.us.us ]
%arrayidx63.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv196, i64 %indvars.iv191
%arrayidx63.promoted.us.us.us = load i64, ptr %arrayidx63.us.us.us, align 8, !tbaa !13
br i1 %36, label %for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa, label %for.body51.us.us.us
for.body51.us.us.us: ; preds = %for.cond49.preheader.us.us.us, %for.body51.us.us.us
%indvars.iv186 = phi i64 [ %indvars.iv.next187.1, %for.body51.us.us.us ], [ 0, %for.cond49.preheader.us.us.us ]
%37 = phi i64 [ %add.us.us.us.1, %for.body51.us.us.us ], [ %arrayidx63.promoted.us.us.us, %for.cond49.preheader.us.us.us ]
%niter248 = phi i64 [ %niter248.next.1, %for.body51.us.us.us ], [ 0, %for.cond49.preheader.us.us.us ]
%arrayidx55.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv196, i64 %indvars.iv186
%38 = load i32, ptr %arrayidx55.us.us.us, align 8, !tbaa !5
%arrayidx59.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv186, i64 %indvars.iv191
%39 = load i32, ptr %arrayidx59.us.us.us, align 4, !tbaa !5
%mul.us.us.us = mul nsw i32 %39, %38
%conv.us.us.us = sext i32 %mul.us.us.us to i64
%add.us.us.us = add i64 %37, %conv.us.us.us
%indvars.iv.next187 = or i64 %indvars.iv186, 1
%arrayidx55.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv196, i64 %indvars.iv.next187
%40 = load i32, ptr %arrayidx55.us.us.us.1, align 4, !tbaa !5
%arrayidx59.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next187, i64 %indvars.iv191
%41 = load i32, ptr %arrayidx59.us.us.us.1, align 4, !tbaa !5
%mul.us.us.us.1 = mul nsw i32 %41, %40
%conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64
%add.us.us.us.1 = add i64 %add.us.us.us, %conv.us.us.us.1
%indvars.iv.next187.1 = add nuw nsw i64 %indvars.iv186, 2
%niter248.next.1 = add i64 %niter248, 2
%niter248.ncmp.1 = icmp eq i64 %niter248.next.1, %unroll_iter247
br i1 %niter248.ncmp.1, label %for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa, label %for.body51.us.us.us, !llvm.loop !20
for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body51.us.us.us, %for.cond49.preheader.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond49.preheader.us.us.us ], [ %add.us.us.us.1, %for.body51.us.us.us ]
%indvars.iv186.unr = phi i64 [ 0, %for.cond49.preheader.us.us.us ], [ %indvars.iv.next187.1, %for.body51.us.us.us ]
%.unr = phi i64 [ %arrayidx63.promoted.us.us.us, %for.cond49.preheader.us.us.us ], [ %add.us.us.us.1, %for.body51.us.us.us ]
br i1 %lcmp.mod245.not, label %for.cond49.for.inc67_crit_edge.us.us.us, label %for.body51.us.us.us.epil
for.body51.us.us.us.epil: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa
%arrayidx55.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv196, i64 %indvars.iv186.unr
%42 = load i32, ptr %arrayidx55.us.us.us.epil, align 4, !tbaa !5
%arrayidx59.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv186.unr, i64 %indvars.iv191
%43 = load i32, ptr %arrayidx59.us.us.us.epil, align 4, !tbaa !5
%mul.us.us.us.epil = mul nsw i32 %43, %42
%conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64
%add.us.us.us.epil = add i64 %.unr, %conv.us.us.us.epil
br label %for.cond49.for.inc67_crit_edge.us.us.us
for.cond49.for.inc67_crit_edge.us.us.us: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa, %for.body51.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond49.for.inc67_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body51.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx63.us.us.us, align 8, !tbaa !13
%indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
%exitcond195.not = icmp eq i64 %indvars.iv.next192, %wide.trip.count194
br i1 %exitcond195.not, label %for.cond46.for.inc70_crit_edge.split.us.us.us, label %for.cond49.preheader.us.us.us, !llvm.loop !21
for.cond46.for.inc70_crit_edge.split.us.us.us: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us
%indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
%exitcond200.not = icmp eq i64 %indvars.iv.next197, %wide.trip.count199
br i1 %exitcond200.not, label %for.cond73.preheader, label %for.cond46.preheader.us.us, !llvm.loop !22
for.cond73.preheader: ; preds = %for.cond46.for.inc70_crit_edge.split.us.us.us
%.pr = load i32, ptr %l, align 4
%44 = icmp sgt i32 %.pr, 0
br i1 %44, label %for.cond77.preheader.preheader, label %for.end98
for.cond77.preheader.preheader: ; preds = %for.cond73.preheader, %for.cond46.preheader.lr.ph.split.us
%.ph = phi i32 [ %35, %for.cond46.preheader.lr.ph.split.us ], [ %.pr, %for.cond73.preheader ]
br label %for.cond77.preheader
for.cond77.preheader: ; preds = %for.cond77.preheader.preheader, %for.inc96
%45 = phi i32 [ %52, %for.inc96 ], [ %16, %for.cond77.preheader.preheader ]
%46 = phi i32 [ %53, %for.inc96 ], [ %.ph, %for.cond77.preheader.preheader ]
%indvars.iv204 = phi i64 [ %indvars.iv.next205, %for.inc96 ], [ 0, %for.cond77.preheader.preheader ]
%cmp78162 = icmp sgt i32 %46, 0
br i1 %cmp78162, label %for.body80, label %for.inc96
for.body80: ; preds = %for.cond77.preheader, %for.body80
%indvars.iv201 = phi i64 [ %indvars.iv.next202, %for.body80 ], [ 0, %for.cond77.preheader ]
%47 = phi i32 [ %50, %for.body80 ], [ %46, %for.cond77.preheader ]
%sub = add nsw i32 %47, -1
%48 = zext i32 %sub to i64
%cmp81 = icmp eq i64 %indvars.iv201, %48
%arrayidx86 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv204, i64 %indvars.iv201
%49 = load i64, ptr %arrayidx86, align 8, !tbaa !13
%.str.2..str.3 = select i1 %cmp81, ptr @.str.2, ptr @.str.3
%call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %49)
%indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
%50 = load i32, ptr %l, align 4, !tbaa !5
%51 = sext i32 %50 to i64
%cmp78 = icmp slt i64 %indvars.iv.next202, %51
br i1 %cmp78, label %for.body80, label %for.inc96.loopexit, !llvm.loop !23
for.inc96.loopexit: ; preds = %for.body80
%.pre210 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc96
for.inc96: ; preds = %for.inc96.loopexit, %for.cond77.preheader
%52 = phi i32 [ %.pre210, %for.inc96.loopexit ], [ %45, %for.cond77.preheader ]
%53 = phi i32 [ %50, %for.inc96.loopexit ], [ %46, %for.cond77.preheader ]
%indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
%54 = sext i32 %52 to i64
%cmp74 = icmp slt i64 %indvars.iv.next205, %54
br i1 %cmp74, label %for.cond77.preheader, label %for.end98, !llvm.loop !24
for.end98: ; preds = %for.inc96, %for.cond46.preheader.lr.ph, %for.cond27.preheader, %for.cond73.preheader
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !12}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10, !12}
|
#include<stdio.h>
int main() {
int n,m,l,i,j,k;
scanf("%d %d %d", &n, &m, &l);
long A[n][m],B[m][l],C[n][l];
for(i = 0; i < n; i++) {
for(j = 0; j < m; j++) {
scanf("%ld", &A[i][j]);
}
}
for(i = 0; i < m; i++) {
for(j = 0; j < l; j++) {
scanf("%ld", &B[i][j]);
}
}
for(i = 0; i < n; i++) {
for(j = 0; j < l; j++) {
C[i][j] = 0;
for(k = 0; k < m; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}
for(i = 0; i < n; i++) {
for(j = 0; j < l; j++) {
printf("%ld",C[i][j]);
if(j != l-1) {
printf(" ");
}
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\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
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %m, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i64, i64 %5, align 16
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%8 = load i32, ptr %l, align 4, !tbaa !5
%9 = zext i32 %8 to i64
%10 = mul nuw i64 %9, %7
%vla1 = alloca i64, i64 %10, align 16
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = zext i32 %11 to i64
%13 = mul nuw i64 %12, %9
%vla2 = alloca i64, i64 %13, align 16
%cmp116 = icmp sgt i32 %11, 0
br i1 %cmp116, label %for.cond3.preheader.lr.ph, label %for.cond12.preheader
for.cond3.preheader.lr.ph: ; preds = %entry
%14 = icmp sgt i32 %6, 0
br i1 %14, label %for.cond3.preheader, label %for.cond32.preheader.lr.ph
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc9
%15 = phi i32 [ %24, %for.inc9 ], [ %11, %for.cond3.preheader.lr.ph ]
%16 = phi i32 [ %25, %for.inc9 ], [ %6, %for.cond3.preheader.lr.ph ]
%indvars.iv146 = phi i64 [ %indvars.iv.next147, %for.inc9 ], [ 0, %for.cond3.preheader.lr.ph ]
%cmp4114 = icmp sgt i32 %16, 0
br i1 %cmp4114, label %for.body5.lr.ph, label %for.inc9
for.body5.lr.ph: ; preds = %for.cond3.preheader
%17 = mul nuw nsw i64 %indvars.iv146, %3
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %17
br label %for.body5
for.cond12.preheader: ; preds = %for.inc9, %entry
%18 = phi i32 [ %11, %entry ], [ %24, %for.inc9 ]
%19 = phi i32 [ %6, %entry ], [ %25, %for.inc9 ]
%cmp13120 = icmp sgt i32 %19, 0
%20 = load i32, ptr %l, align 4
%21 = icmp sgt i32 %20, 0
%or.cond = select i1 %cmp13120, i1 %21, i1 false
br i1 %or.cond, label %for.cond15.preheader, label %for.cond29.preheader
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.body5 ]
%arrayidx7 = getelementptr inbounds i64, ptr %arrayidx, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%22 = load i32, ptr %m, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !9
for.inc9.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader
%24 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %15, %for.cond3.preheader ]
%25 = phi i32 [ %22, %for.inc9.loopexit ], [ %16, %for.cond3.preheader ]
%indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
%26 = sext i32 %24 to i64
%cmp = icmp slt i64 %indvars.iv.next147, %26
br i1 %cmp, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !11
for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc26
%27 = phi i32 [ %80, %for.inc26 ], [ %19, %for.cond12.preheader ]
%28 = phi i32 [ %81, %for.inc26 ], [ %20, %for.cond12.preheader ]
%indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.inc26 ], [ 0, %for.cond12.preheader ]
%cmp16118 = icmp sgt i32 %28, 0
br i1 %cmp16118, label %for.body17.lr.ph, label %for.inc26
for.body17.lr.ph: ; preds = %for.cond15.preheader
%29 = mul nuw nsw i64 %indvars.iv152, %9
%arrayidx19 = getelementptr inbounds i64, ptr %vla1, i64 %29
br label %for.body17
for.cond29.preheader.loopexit: ; preds = %for.inc26
%.pre184 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond29.preheader
for.cond29.preheader: ; preds = %for.cond29.preheader.loopexit, %for.cond12.preheader
%30 = phi i32 [ %18, %for.cond12.preheader ], [ %.pre184, %for.cond29.preheader.loopexit ]
%.lcssa = phi i32 [ %19, %for.cond12.preheader ], [ %80, %for.cond29.preheader.loopexit ]
%cmp30126 = icmp sgt i32 %30, 0
br i1 %cmp30126, label %for.cond32.preheader.lr.ph, label %for.end82
for.cond32.preheader.lr.ph: ; preds = %for.cond3.preheader.lr.ph, %for.cond29.preheader
%.lcssa189 = phi i32 [ %.lcssa, %for.cond29.preheader ], [ %6, %for.cond3.preheader.lr.ph ]
%31 = phi i32 [ %30, %for.cond29.preheader ], [ %11, %for.cond3.preheader.lr.ph ]
%32 = load i32, ptr %l, align 4, !tbaa !5
%cmp33124 = icmp sgt i32 %32, 0
br i1 %cmp33124, label %for.cond32.preheader.lr.ph.split.us, label %for.cond66.preheader.preheader
for.cond66.preheader.preheader.loopexit214.unr-lcssa: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond32.preheader.us.preheader ], [ %indvar.next.7, %for.cond32.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond66.preheader.preheader, label %for.cond32.preheader.us.epil
for.cond32.preheader.us.epil: ; preds = %for.cond66.preheader.preheader.loopexit214.unr-lcssa, %for.cond32.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond32.preheader.us.epil ], [ %indvar.unr, %for.cond66.preheader.preheader.loopexit214.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond32.preheader.us.epil ], [ 0, %for.cond66.preheader.preheader.loopexit214.unr-lcssa ]
%33 = mul nuw nsw i64 %34, %indvar.epil
%scevgep.epil = getelementptr i8, ptr %vla2, i64 %33
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond66.preheader.preheader, label %for.cond32.preheader.us.epil, !llvm.loop !15
for.cond66.preheader.preheader: ; preds = %for.cond66.preheader.preheader.loopexit214.unr-lcssa, %for.cond32.preheader.us.epil, %for.cond32.for.inc60_crit_edge.split.us.us.us, %for.cond32.preheader.lr.ph
br label %for.cond66.preheader
for.cond32.preheader.lr.ph.split.us: ; preds = %for.cond32.preheader.lr.ph
%cmp40122 = icmp sgt i32 %.lcssa189, 0
%wide.trip.count170 = zext i32 %32 to i64
br i1 %cmp40122, label %for.cond32.preheader.us.us.preheader, label %for.cond32.preheader.us.preheader
for.cond32.preheader.us.preheader: ; preds = %for.cond32.preheader.lr.ph.split.us
%34 = shl nuw nsw i64 %9, 3
%35 = shl nuw nsw i64 %wide.trip.count170, 3
%wide.trip.count = zext i32 %31 to i64
%xtraiter = and i64 %wide.trip.count, 7
%36 = icmp ult i32 %31, 8
br i1 %36, label %for.cond66.preheader.preheader.loopexit214.unr-lcssa, label %for.cond32.preheader.us.preheader.new
for.cond32.preheader.us.preheader.new: ; preds = %for.cond32.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
br label %for.cond32.preheader.us
for.cond32.preheader.us.us.preheader: ; preds = %for.cond32.preheader.lr.ph.split.us
%wide.trip.count175 = zext i32 %31 to i64
%wide.trip.count162 = zext i32 %.lcssa189 to i64
%min.iters.check = icmp ugt i32 %.lcssa189, 3
%ident.check.not = icmp eq i32 %8, 1
%or.cond210 = select i1 %min.iters.check, i1 %ident.check.not, i1 false
%n.vec = and i64 %wide.trip.count162, 4294967292
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count162
%xtraiter220 = and i64 %wide.trip.count162, 3
%lcmp.mod221.not = icmp eq i64 %xtraiter220, 0
br label %for.cond32.preheader.us.us
for.cond32.preheader.us.us: ; preds = %for.cond32.preheader.us.us.preheader, %for.cond32.for.inc60_crit_edge.split.us.us.us
%indvars.iv172 = phi i64 [ 0, %for.cond32.preheader.us.us.preheader ], [ %indvars.iv.next173, %for.cond32.for.inc60_crit_edge.split.us.us.us ]
%37 = mul nuw nsw i64 %indvars.iv172, %9
%arrayidx36.us.us = getelementptr inbounds i64, ptr %vla2, i64 %37
%38 = mul nuw nsw i64 %indvars.iv172, %3
%arrayidx43.us.us = getelementptr inbounds i64, ptr %vla, i64 %38
br label %for.body34.us.us.us
for.body34.us.us.us: ; preds = %for.cond39.for.inc57_crit_edge.us.us.us, %for.cond32.preheader.us.us
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.cond39.for.inc57_crit_edge.us.us.us ], [ 0, %for.cond32.preheader.us.us ]
%arrayidx38.us.us.us = getelementptr inbounds i64, ptr %arrayidx36.us.us, i64 %indvars.iv167
%invariant.gep.us.us.us = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv167
br i1 %or.cond210, label %vector.body, label %for.body41.us.us.us.preheader
vector.body: ; preds = %for.body34.us.us.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body34.us.us.us ]
%vec.phi = phi <2 x i64> [ %46, %vector.body ], [ zeroinitializer, %for.body34.us.us.us ]
%vec.phi206 = phi <2 x i64> [ %47, %vector.body ], [ zeroinitializer, %for.body34.us.us.us ]
%39 = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %index
%wide.load = load <2 x i64>, ptr %39, align 8, !tbaa !13
%40 = getelementptr inbounds i64, ptr %39, i64 2
%wide.load207 = load <2 x i64>, ptr %40, align 8, !tbaa !13
%41 = mul nuw nsw i64 %index, %9
%42 = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %41
%wide.load208 = load <2 x i64>, ptr %42, align 8, !tbaa !13
%43 = getelementptr inbounds i64, ptr %42, i64 2
%wide.load209 = load <2 x i64>, ptr %43, align 8, !tbaa !13
%44 = mul nsw <2 x i64> %wide.load208, %wide.load
%45 = mul nsw <2 x i64> %wide.load209, %wide.load207
%46 = add <2 x i64> %vec.phi, %44
%47 = add <2 x i64> %vec.phi206, %45
%index.next = add nuw i64 %index, 4
%48 = icmp eq i64 %index.next, %n.vec
br i1 %48, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %47, %46
%49 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
br i1 %cmp.n, label %for.cond39.for.inc57_crit_edge.us.us.us, label %for.body41.us.us.us.preheader
for.body41.us.us.us.preheader: ; preds = %for.body34.us.us.us, %middle.block
%indvars.iv159.ph = phi i64 [ 0, %for.body34.us.us.us ], [ %n.vec, %middle.block ]
%.ph = phi i64 [ 0, %for.body34.us.us.us ], [ %49, %middle.block ]
%50 = xor i64 %indvars.iv159.ph, -1
%51 = add nsw i64 %50, %wide.trip.count162
br i1 %lcmp.mod221.not, label %for.body41.us.us.us.prol.loopexit, label %for.body41.us.us.us.prol
for.body41.us.us.us.prol: ; preds = %for.body41.us.us.us.preheader, %for.body41.us.us.us.prol
%indvars.iv159.prol = phi i64 [ %indvars.iv.next160.prol, %for.body41.us.us.us.prol ], [ %indvars.iv159.ph, %for.body41.us.us.us.preheader ]
%52 = phi i64 [ %add.us.us.us.prol, %for.body41.us.us.us.prol ], [ %.ph, %for.body41.us.us.us.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body41.us.us.us.prol ], [ 0, %for.body41.us.us.us.preheader ]
%arrayidx45.us.us.us.prol = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %indvars.iv159.prol
%53 = load i64, ptr %arrayidx45.us.us.us.prol, align 8, !tbaa !13
%54 = mul nuw nsw i64 %indvars.iv159.prol, %9
%gep.us.us.us.prol = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %54
%55 = load i64, ptr %gep.us.us.us.prol, align 8, !tbaa !13
%mul.us.us.us.prol = mul nsw i64 %55, %53
%add.us.us.us.prol = add nsw i64 %52, %mul.us.us.us.prol
%indvars.iv.next160.prol = add nuw nsw i64 %indvars.iv159.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter220
br i1 %prol.iter.cmp.not, label %for.body41.us.us.us.prol.loopexit, label %for.body41.us.us.us.prol, !llvm.loop !20
for.body41.us.us.us.prol.loopexit: ; preds = %for.body41.us.us.us.prol, %for.body41.us.us.us.preheader
%add.us.us.us.lcssa213.unr = phi i64 [ undef, %for.body41.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body41.us.us.us.prol ]
%indvars.iv159.unr = phi i64 [ %indvars.iv159.ph, %for.body41.us.us.us.preheader ], [ %indvars.iv.next160.prol, %for.body41.us.us.us.prol ]
%.unr = phi i64 [ %.ph, %for.body41.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body41.us.us.us.prol ]
%56 = icmp ult i64 %51, 3
br i1 %56, label %for.cond39.for.inc57_crit_edge.us.us.us, label %for.body41.us.us.us
for.body41.us.us.us: ; preds = %for.body41.us.us.us.prol.loopexit, %for.body41.us.us.us
%indvars.iv159 = phi i64 [ %indvars.iv.next160.3, %for.body41.us.us.us ], [ %indvars.iv159.unr, %for.body41.us.us.us.prol.loopexit ]
%57 = phi i64 [ %add.us.us.us.3, %for.body41.us.us.us ], [ %.unr, %for.body41.us.us.us.prol.loopexit ]
%arrayidx45.us.us.us = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %indvars.iv159
%58 = load i64, ptr %arrayidx45.us.us.us, align 8, !tbaa !13
%59 = mul nuw nsw i64 %indvars.iv159, %9
%gep.us.us.us = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %59
%60 = load i64, ptr %gep.us.us.us, align 8, !tbaa !13
%mul.us.us.us = mul nsw i64 %60, %58
%add.us.us.us = add nsw i64 %57, %mul.us.us.us
%indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
%arrayidx45.us.us.us.1 = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %indvars.iv.next160
%61 = load i64, ptr %arrayidx45.us.us.us.1, align 8, !tbaa !13
%62 = mul nuw nsw i64 %indvars.iv.next160, %9
%gep.us.us.us.1 = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %62
%63 = load i64, ptr %gep.us.us.us.1, align 8, !tbaa !13
%mul.us.us.us.1 = mul nsw i64 %63, %61
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %mul.us.us.us.1
%indvars.iv.next160.1 = add nuw nsw i64 %indvars.iv159, 2
%arrayidx45.us.us.us.2 = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %indvars.iv.next160.1
%64 = load i64, ptr %arrayidx45.us.us.us.2, align 8, !tbaa !13
%65 = mul nuw nsw i64 %indvars.iv.next160.1, %9
%gep.us.us.us.2 = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %65
%66 = load i64, ptr %gep.us.us.us.2, align 8, !tbaa !13
%mul.us.us.us.2 = mul nsw i64 %66, %64
%add.us.us.us.2 = add nsw i64 %add.us.us.us.1, %mul.us.us.us.2
%indvars.iv.next160.2 = add nuw nsw i64 %indvars.iv159, 3
%arrayidx45.us.us.us.3 = getelementptr inbounds i64, ptr %arrayidx43.us.us, i64 %indvars.iv.next160.2
%67 = load i64, ptr %arrayidx45.us.us.us.3, align 8, !tbaa !13
%68 = mul nuw nsw i64 %indvars.iv.next160.2, %9
%gep.us.us.us.3 = getelementptr inbounds i64, ptr %invariant.gep.us.us.us, i64 %68
%69 = load i64, ptr %gep.us.us.us.3, align 8, !tbaa !13
%mul.us.us.us.3 = mul nsw i64 %69, %67
%add.us.us.us.3 = add nsw i64 %add.us.us.us.2, %mul.us.us.us.3
%indvars.iv.next160.3 = add nuw nsw i64 %indvars.iv159, 4
%exitcond163.not.3 = icmp eq i64 %indvars.iv.next160.3, %wide.trip.count162
br i1 %exitcond163.not.3, label %for.cond39.for.inc57_crit_edge.us.us.us, label %for.body41.us.us.us, !llvm.loop !21
for.cond39.for.inc57_crit_edge.us.us.us: ; preds = %for.body41.us.us.us.prol.loopexit, %for.body41.us.us.us, %middle.block
%add.us.us.us.lcssa = phi i64 [ %49, %middle.block ], [ %add.us.us.us.lcssa213.unr, %for.body41.us.us.us.prol.loopexit ], [ %add.us.us.us.3, %for.body41.us.us.us ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx38.us.us.us, align 8, !tbaa !13
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%exitcond171.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count170
br i1 %exitcond171.not, label %for.cond32.for.inc60_crit_edge.split.us.us.us, label %for.body34.us.us.us, !llvm.loop !22
for.cond32.for.inc60_crit_edge.split.us.us.us: ; preds = %for.cond39.for.inc57_crit_edge.us.us.us
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%exitcond176.not = icmp eq i64 %indvars.iv.next173, %wide.trip.count175
br i1 %exitcond176.not, label %for.cond66.preheader.preheader, label %for.cond32.preheader.us.us, !llvm.loop !23
for.cond32.preheader.us: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond32.preheader.us ]
%niter = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %niter.next.7, %for.cond32.preheader.us ]
%70 = mul nuw nsw i64 %34, %indvar
%scevgep = getelementptr i8, ptr %vla2, i64 %70
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next = or i64 %indvar, 1
%71 = mul nuw nsw i64 %34, %indvar.next
%scevgep.1 = getelementptr i8, ptr %vla2, i64 %71
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.1, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.1 = or i64 %indvar, 2
%72 = mul nuw nsw i64 %34, %indvar.next.1
%scevgep.2 = getelementptr i8, ptr %vla2, i64 %72
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.2 = or i64 %indvar, 3
%73 = mul nuw nsw i64 %34, %indvar.next.2
%scevgep.3 = getelementptr i8, ptr %vla2, i64 %73
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.3, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.3 = or i64 %indvar, 4
%74 = mul nuw nsw i64 %34, %indvar.next.3
%scevgep.4 = getelementptr i8, ptr %vla2, i64 %74
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.4 = or i64 %indvar, 5
%75 = mul nuw nsw i64 %34, %indvar.next.4
%scevgep.5 = getelementptr i8, ptr %vla2, i64 %75
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.5, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.5 = or i64 %indvar, 6
%76 = mul nuw nsw i64 %34, %indvar.next.5
%scevgep.6 = getelementptr i8, ptr %vla2, i64 %76
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.6, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.6 = or i64 %indvar, 7
%77 = mul nuw nsw i64 %34, %indvar.next.6
%scevgep.7 = getelementptr i8, ptr %vla2, i64 %77
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.7, i8 0, i64 %35, i1 false), !tbaa !13
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond66.preheader.preheader.loopexit214.unr-lcssa, label %for.cond32.preheader.us, !llvm.loop !23
for.body17: ; preds = %for.body17.lr.ph, %for.body17
%indvars.iv149 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next150, %for.body17 ]
%arrayidx21 = getelementptr inbounds i64, ptr %arrayidx19, i64 %indvars.iv149
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx21)
%indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
%78 = load i32, ptr %l, align 4, !tbaa !5
%79 = sext i32 %78 to i64
%cmp16 = icmp slt i64 %indvars.iv.next150, %79
br i1 %cmp16, label %for.body17, label %for.inc26.loopexit, !llvm.loop !24
for.inc26.loopexit: ; preds = %for.body17
%.pre183 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc26
for.inc26: ; preds = %for.inc26.loopexit, %for.cond15.preheader
%80 = phi i32 [ %.pre183, %for.inc26.loopexit ], [ %27, %for.cond15.preheader ]
%81 = phi i32 [ %78, %for.inc26.loopexit ], [ %28, %for.cond15.preheader ]
%indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
%82 = sext i32 %80 to i64
%cmp13 = icmp slt i64 %indvars.iv.next153, %82
br i1 %cmp13, label %for.cond15.preheader, label %for.cond29.preheader.loopexit, !llvm.loop !25
for.cond66.preheader: ; preds = %for.cond66.preheader.preheader, %for.end78
%indvars.iv180 = phi i64 [ %indvars.iv.next181, %for.end78 ], [ 0, %for.cond66.preheader.preheader ]
%83 = load i32, ptr %l, align 4, !tbaa !5
%cmp67136 = icmp sgt i32 %83, 0
br i1 %cmp67136, label %for.body68.lr.ph, label %for.end78
for.body68.lr.ph: ; preds = %for.cond66.preheader
%84 = mul nuw nsw i64 %indvars.iv180, %9
%arrayidx70 = getelementptr inbounds i64, ptr %vla2, i64 %84
br label %for.body68
for.body68: ; preds = %for.body68.lr.ph, %for.inc76
%indvars.iv177 = phi i64 [ 0, %for.body68.lr.ph ], [ %indvars.iv.next178, %for.inc76 ]
%arrayidx72 = getelementptr inbounds i64, ptr %arrayidx70, i64 %indvars.iv177
%85 = load i64, ptr %arrayidx72, align 8, !tbaa !13
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %85)
%86 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %86, -1
%87 = zext i32 %sub to i64
%cmp74.not = icmp eq i64 %indvars.iv177, %87
br i1 %cmp74.not, label %for.inc76, label %if.then
if.then: ; preds = %for.body68
%putchar113 = call i32 @putchar(i32 32)
%.pre185 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc76
for.inc76: ; preds = %for.body68, %if.then
%88 = phi i32 [ %86, %for.body68 ], [ %.pre185, %if.then ]
%indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
%89 = sext i32 %88 to i64
%cmp67 = icmp slt i64 %indvars.iv.next178, %89
br i1 %cmp67, label %for.body68, label %for.end78, !llvm.loop !26
for.end78: ; preds = %for.inc76, %for.cond66.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
%90 = load i32, ptr %n, align 4, !tbaa !5
%91 = sext i32 %90 to i64
%cmp64 = icmp slt i64 %indvars.iv.next181, %91
br i1 %cmp64, label %for.cond66.preheader, label %for.end82, !llvm.loop !27
for.end82: ; preds = %for.end78, %for.cond29.preheader
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !10, !18}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !12}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include <stdio.h>
int main (void)
{
int gr1[100][100],gr2[100][100],a1,a2,a3;
int a,b,c,o,gou;
long long int an[100][100];
for(a=0;a<100;a++)
{
for(b=0;b<100;b++)
{
gr1[a][b]=0;
gr2[a][b]=0;
an[a][b]=0;
}
}
scanf("%d%d%d",&a1,&a2,&a3);
for(a=0;a<a1;a++)
{
for(b=0;b<a2;b++)
{
scanf("%d",&gr1[a][b]);
}
}
for(a=0;a<a2;a++)
{
for(b=0;b<a3;b++)
{
scanf("%d",&gr2[a][b]);
}
}
for(a=0;a<a1;a++)
{
for(b=0;b<a3;b++)
{
for(c=0;c<a2;c++)
{
an[a][b]+=(gr1[a][c]*gr2[c][b]);
}
}
}
for(a=0;a<a1;a++)
{
for(b=0;b<a3-1;b++)
{
printf("%lld ",an[a][b]);
}
printf("%lld\n",an[a][a3-1]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155949/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
@.str.3 = 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:
%gr1 = alloca [100 x [100 x i32]], align 16
%gr2 = alloca [100 x [100 x i32]], align 16
%a1 = alloca i32, align 4
%a2 = alloca i32, align 4
%a3 = alloca i32, align 4
%an = alloca [100 x [100 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %gr1) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %gr2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a3) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %an) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %gr1, i8 0, i64 40000, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %gr2, i8 0, i64 40000, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %an, i8 0, i64 80000, i1 false), !tbaa !9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a1, ptr noundef nonnull %a2, ptr noundef nonnull %a3)
%0 = load i32, ptr %a1, align 4, !tbaa !5
%cmp18148 = icmp sgt i32 %0, 0
%.pre211 = load i32, ptr %a2, align 4, !tbaa !5
br i1 %cmp18148, label %for.cond20.preheader.lr.ph, label %for.cond34.preheader
for.cond20.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre211, 0
br i1 %1, label %for.cond20.preheader, label %for.cond54.preheader.lr.ph
for.cond20.preheader: ; preds = %for.cond20.preheader.lr.ph, %for.inc31
%2 = phi i32 [ %10, %for.inc31 ], [ %0, %for.cond20.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.inc31 ], [ %.pre211, %for.cond20.preheader.lr.ph ]
%indvars.iv183 = phi i64 [ %indvars.iv.next184, %for.inc31 ], [ 0, %for.cond20.preheader.lr.ph ]
%cmp21146 = icmp sgt i32 %3, 0
br i1 %cmp21146, label %for.body22, label %for.inc31
for.cond34.preheader: ; preds = %for.inc31, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc31 ]
%5 = phi i32 [ %.pre211, %entry ], [ %11, %for.inc31 ]
%cmp35152 = icmp sgt i32 %5, 0
%6 = load i32, ptr %a3, align 4
%7 = icmp sgt i32 %6, 0
%or.cond229 = select i1 %cmp35152, i1 %7, i1 false
br i1 %or.cond229, label %for.cond37.preheader, label %for.cond51.preheader
for.body22: ; preds = %for.cond20.preheader, %for.body22
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ 0, %for.cond20.preheader ]
%arrayidx26 = getelementptr inbounds [100 x [100 x i32]], ptr %gr1, i64 0, i64 %indvars.iv183, i64 %indvars.iv
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx26)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %a2, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp21 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp21, label %for.body22, label %for.inc31.loopexit, !llvm.loop !11
for.inc31.loopexit: ; preds = %for.body22
%.pre = load i32, ptr %a1, align 4, !tbaa !5
br label %for.inc31
for.inc31: ; preds = %for.inc31.loopexit, %for.cond20.preheader
%10 = phi i32 [ %.pre, %for.inc31.loopexit ], [ %2, %for.cond20.preheader ]
%11 = phi i32 [ %8, %for.inc31.loopexit ], [ %3, %for.cond20.preheader ]
%indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
%12 = sext i32 %10 to i64
%cmp18 = icmp slt i64 %indvars.iv.next184, %12
br i1 %cmp18, label %for.cond20.preheader, label %for.cond34.preheader, !llvm.loop !13
for.cond37.preheader: ; preds = %for.cond34.preheader, %for.inc48
%13 = phi i32 [ %28, %for.inc48 ], [ %5, %for.cond34.preheader ]
%14 = phi i32 [ %29, %for.inc48 ], [ %6, %for.cond34.preheader ]
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.inc48 ], [ 0, %for.cond34.preheader ]
%cmp38150 = icmp sgt i32 %14, 0
br i1 %cmp38150, label %for.body39, label %for.inc48
for.cond51.preheader.loopexit: ; preds = %for.inc48
%.pre213 = load i32, ptr %a1, align 4, !tbaa !5
br label %for.cond51.preheader
for.cond51.preheader: ; preds = %for.cond51.preheader.loopexit, %for.cond34.preheader
%15 = phi i32 [ %4, %for.cond34.preheader ], [ %.pre213, %for.cond51.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond34.preheader ], [ %28, %for.cond51.preheader.loopexit ]
%cmp52158 = icmp sgt i32 %15, 0
br i1 %cmp52158, label %for.cond54.preheader.lr.ph, label %for.end105
for.cond54.preheader.lr.ph: ; preds = %for.cond20.preheader.lr.ph, %for.cond51.preheader
%.lcssa218 = phi i32 [ %.lcssa, %for.cond51.preheader ], [ %.pre211, %for.cond20.preheader.lr.ph ]
%16 = phi i32 [ %15, %for.cond51.preheader ], [ %0, %for.cond20.preheader.lr.ph ]
%17 = load i32, ptr %a3, align 4, !tbaa !5
%cmp55156 = icmp sgt i32 %17, 0
%cmp58154 = icmp sgt i32 %.lcssa218, 0
%or.cond = select i1 %cmp55156, i1 %cmp58154, i1 false
br i1 %or.cond, label %for.cond54.preheader.us.us.preheader, label %for.cond85.preheader.preheader
for.cond85.preheader.preheader: ; preds = %for.cond54.for.inc78_crit_edge.split.us.us.us, %for.cond54.preheader.lr.ph
br label %for.cond85.preheader
for.cond54.preheader.us.us.preheader: ; preds = %for.cond54.preheader.lr.ph
%wide.trip.count203 = zext i32 %16 to i64
%wide.trip.count198 = zext i32 %17 to i64
%wide.trip.count = zext i32 %.lcssa218 to i64
%xtraiter = and i64 %wide.trip.count, 1
%18 = icmp eq i32 %.lcssa218, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond54.preheader.us.us
for.cond54.preheader.us.us: ; preds = %for.cond54.preheader.us.us.preheader, %for.cond54.for.inc78_crit_edge.split.us.us.us
%indvars.iv200 = phi i64 [ 0, %for.cond54.preheader.us.us.preheader ], [ %indvars.iv.next201, %for.cond54.for.inc78_crit_edge.split.us.us.us ]
br label %for.cond57.preheader.us.us.us
for.cond57.preheader.us.us.us: ; preds = %for.cond57.for.inc75_crit_edge.us.us.us, %for.cond54.preheader.us.us
%indvars.iv195 = phi i64 [ %indvars.iv.next196, %for.cond57.for.inc75_crit_edge.us.us.us ], [ 0, %for.cond54.preheader.us.us ]
%arrayidx71.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %an, i64 0, i64 %indvars.iv200, i64 %indvars.iv195
%arrayidx71.promoted.us.us.us = load i64, ptr %arrayidx71.us.us.us, align 8, !tbaa !9
br i1 %18, label %for.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa, label %for.body59.us.us.us
for.body59.us.us.us: ; preds = %for.cond57.preheader.us.us.us, %for.body59.us.us.us
%indvars.iv192 = phi i64 [ %indvars.iv.next193.1, %for.body59.us.us.us ], [ 0, %for.cond57.preheader.us.us.us ]
%19 = phi i64 [ %add.us.us.us.1, %for.body59.us.us.us ], [ %arrayidx71.promoted.us.us.us, %for.cond57.preheader.us.us.us ]
%niter = phi i64 [ %niter.next.1, %for.body59.us.us.us ], [ 0, %for.cond57.preheader.us.us.us ]
%arrayidx63.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %gr1, i64 0, i64 %indvars.iv200, i64 %indvars.iv192
%20 = load i32, ptr %arrayidx63.us.us.us, align 8, !tbaa !5
%arrayidx67.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %gr2, i64 0, i64 %indvars.iv192, i64 %indvars.iv195
%21 = load i32, ptr %arrayidx67.us.us.us, align 4, !tbaa !5
%mul.us.us.us = mul nsw i32 %21, %20
%conv.us.us.us = sext i32 %mul.us.us.us to i64
%add.us.us.us = add nsw i64 %19, %conv.us.us.us
%indvars.iv.next193 = or i64 %indvars.iv192, 1
%arrayidx63.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %gr1, i64 0, i64 %indvars.iv200, i64 %indvars.iv.next193
%22 = load i32, ptr %arrayidx63.us.us.us.1, align 4, !tbaa !5
%arrayidx67.us.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %gr2, i64 0, i64 %indvars.iv.next193, i64 %indvars.iv195
%23 = load i32, ptr %arrayidx67.us.us.us.1, align 4, !tbaa !5
%mul.us.us.us.1 = mul nsw i32 %23, %22
%conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1
%indvars.iv.next193.1 = add nuw nsw i64 %indvars.iv192, 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.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa, label %for.body59.us.us.us, !llvm.loop !15
for.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body59.us.us.us, %for.cond57.preheader.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond57.preheader.us.us.us ], [ %add.us.us.us.1, %for.body59.us.us.us ]
%indvars.iv192.unr = phi i64 [ 0, %for.cond57.preheader.us.us.us ], [ %indvars.iv.next193.1, %for.body59.us.us.us ]
%.unr = phi i64 [ %arrayidx71.promoted.us.us.us, %for.cond57.preheader.us.us.us ], [ %add.us.us.us.1, %for.body59.us.us.us ]
br i1 %lcmp.mod.not, label %for.cond57.for.inc75_crit_edge.us.us.us, label %for.body59.us.us.us.epil
for.body59.us.us.us.epil: ; preds = %for.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa
%arrayidx63.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %gr1, i64 0, i64 %indvars.iv200, i64 %indvars.iv192.unr
%24 = load i32, ptr %arrayidx63.us.us.us.epil, align 4, !tbaa !5
%arrayidx67.us.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %gr2, i64 0, i64 %indvars.iv192.unr, i64 %indvars.iv195
%25 = load i32, ptr %arrayidx67.us.us.us.epil, align 4, !tbaa !5
%mul.us.us.us.epil = mul nsw i32 %25, %24
%conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64
%add.us.us.us.epil = add nsw i64 %.unr, %conv.us.us.us.epil
br label %for.cond57.for.inc75_crit_edge.us.us.us
for.cond57.for.inc75_crit_edge.us.us.us: ; preds = %for.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa, %for.body59.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond57.for.inc75_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body59.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx71.us.us.us, align 8, !tbaa !9
%indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
%exitcond199.not = icmp eq i64 %indvars.iv.next196, %wide.trip.count198
br i1 %exitcond199.not, label %for.cond54.for.inc78_crit_edge.split.us.us.us, label %for.cond57.preheader.us.us.us, !llvm.loop !16
for.cond54.for.inc78_crit_edge.split.us.us.us: ; preds = %for.cond57.for.inc75_crit_edge.us.us.us
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%exitcond204.not = icmp eq i64 %indvars.iv.next201, %wide.trip.count203
br i1 %exitcond204.not, label %for.cond85.preheader.preheader, label %for.cond54.preheader.us.us, !llvm.loop !17
for.body39: ; preds = %for.cond37.preheader, %for.body39
%indvars.iv186 = phi i64 [ %indvars.iv.next187, %for.body39 ], [ 0, %for.cond37.preheader ]
%arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %gr2, i64 0, i64 %indvars.iv189, i64 %indvars.iv186
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx43)
%indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
%26 = load i32, ptr %a3, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp38 = icmp slt i64 %indvars.iv.next187, %27
br i1 %cmp38, label %for.body39, label %for.inc48.loopexit, !llvm.loop !18
for.inc48.loopexit: ; preds = %for.body39
%.pre212 = load i32, ptr %a2, align 4, !tbaa !5
br label %for.inc48
for.inc48: ; preds = %for.inc48.loopexit, %for.cond37.preheader
%28 = phi i32 [ %.pre212, %for.inc48.loopexit ], [ %13, %for.cond37.preheader ]
%29 = phi i32 [ %26, %for.inc48.loopexit ], [ %14, %for.cond37.preheader ]
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%30 = sext i32 %28 to i64
%cmp35 = icmp slt i64 %indvars.iv.next190, %30
br i1 %cmp35, label %for.cond37.preheader, label %for.cond51.preheader.loopexit, !llvm.loop !19
for.cond85.preheader: ; preds = %for.cond85.preheader.preheader, %for.end96
%indvars.iv208 = phi i64 [ %indvars.iv.next209, %for.end96 ], [ 0, %for.cond85.preheader.preheader ]
%31 = load i32, ptr %a3, align 4, !tbaa !5
%cmp86167 = icmp sgt i32 %31, 1
br i1 %cmp86167, label %for.body88, label %for.cond85.preheader.for.end96_crit_edge
for.cond85.preheader.for.end96_crit_edge: ; preds = %for.cond85.preheader
%sub166 = add nsw i32 %31, -1
%.pre214 = sext i32 %sub166 to i64
br label %for.end96
for.body88: ; preds = %for.cond85.preheader, %for.body88
%indvars.iv205 = phi i64 [ %indvars.iv.next206, %for.body88 ], [ 0, %for.cond85.preheader ]
%arrayidx92 = getelementptr inbounds [100 x [100 x i64]], ptr %an, i64 0, i64 %indvars.iv208, i64 %indvars.iv205
%32 = load i64, ptr %arrayidx92, align 8, !tbaa !9
%call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %32)
%indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
%33 = load i32, ptr %a3, align 4, !tbaa !5
%sub = add nsw i32 %33, -1
%34 = sext i32 %sub to i64
%cmp86 = icmp slt i64 %indvars.iv.next206, %34
br i1 %cmp86, label %for.body88, label %for.end96, !llvm.loop !20
for.end96: ; preds = %for.body88, %for.cond85.preheader.for.end96_crit_edge
%idxprom100.pre-phi = phi i64 [ %.pre214, %for.cond85.preheader.for.end96_crit_edge ], [ %34, %for.body88 ]
%arrayidx101 = getelementptr inbounds [100 x [100 x i64]], ptr %an, i64 0, i64 %indvars.iv208, i64 %idxprom100.pre-phi
%35 = load i64, ptr %arrayidx101, align 8, !tbaa !9
%call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %35)
%indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1
%36 = load i32, ptr %a1, align 4, !tbaa !5
%37 = sext i32 %36 to i64
%cmp82 = icmp slt i64 %indvars.iv.next209, %37
br i1 %cmp82, label %for.cond85.preheader, label %for.end105, !llvm.loop !21
for.end105: ; preds = %for.end96, %for.cond51.preheader
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %an) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %gr2) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %gr1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !14}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int cmp(const void *a,const void *b){
return *(char *)a-*(char *)b;
}
long long max(long long a,long long b){
return a>b?a:b;
}
int main()
{
int n;
long long ans[200005];
long long b;
scanf("%d%lld",&n,&b);
ans[1]=0;ans[n]=b;
for(int i=2;i<=n/2;i++){
scanf("%lld",&b);
long long now=max(ans[i-1],b-ans[n-i+2]);
ans[i]=now;
ans[n-i+1]=b-now;
//printf("%d %d\n",ans[i-1],b-ans[n-i+2]);
}
for(int i=1;i<=n;i++)
printf("%lld ",ans[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !5
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%ans = alloca [200005 x i64], align 16
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %ans) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %b)
%arrayidx = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 1
store i64 0, ptr %arrayidx, align 8, !tbaa !8
%0 = load i64, ptr %b, align 8, !tbaa !8
%1 = load i32, ptr %n, align 4, !tbaa !10
%idxprom = sext i32 %1 to i64
%arrayidx1 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %idxprom
store i64 %0, ptr %arrayidx1, align 8, !tbaa !8
%cmp.not37 = icmp slt i32 %1, 4
br i1 %cmp.not37, label %for.cond18.preheader, label %for.body
for.cond18.preheader: ; preds = %for.body, %entry
%2 = phi i32 [ %1, %entry ], [ %6, %for.body ]
%cmp19.not39 = icmp slt i32 %2, 1
br i1 %cmp19.not39, label %for.cond.cleanup20, label %for.body21
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 2, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b)
%3 = add nsw i64 %indvars.iv, -1
%arrayidx4 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %3
%4 = load i64, ptr %arrayidx4, align 8, !tbaa !8
%5 = load i64, ptr %b, align 8, !tbaa !8
%6 = load i32, ptr %n, align 4, !tbaa !10
%7 = trunc i64 %indvars.iv to i32
%sub5 = sub nsw i32 %6, %7
%add = add nsw i32 %sub5, 2
%idxprom6 = sext i32 %add to i64
%arrayidx7 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %idxprom6
%8 = load i64, ptr %arrayidx7, align 8, !tbaa !8
%sub8 = sub nsw i64 %5, %8
%cond.i = call i64 @llvm.smax.i64(i64 %4, i64 %sub8)
%arrayidx11 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %indvars.iv
store i64 %cond.i, ptr %arrayidx11, align 8, !tbaa !8
%sub12 = sub nsw i64 %5, %cond.i
%add14 = add nsw i32 %sub5, 1
%idxprom15 = sext i32 %add14 to i64
%arrayidx16 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %idxprom15
store i64 %sub12, ptr %arrayidx16, align 8, !tbaa !8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%div = sdiv i32 %6, 2
%9 = sext i32 %div to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %9
br i1 %cmp.not.not, label %for.body, label %for.cond18.preheader, !llvm.loop !12
for.cond.cleanup20: ; preds = %for.body21, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %ans) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body21: ; preds = %for.cond18.preheader, %for.body21
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body21 ], [ 1, %for.cond18.preheader ]
%arrayidx23 = getelementptr inbounds [200005 x i64], ptr %ans, i64 0, i64 %indvars.iv43
%10 = load i64, ptr %arrayidx23, align 8, !tbaa !8
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %10)
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%11 = load i32, ptr %n, align 4, !tbaa !10
%12 = sext i32 %11 to i64
%cmp19.not.not = icmp slt i64 %indvars.iv43, %12
br i1 %cmp19.not.not, label %for.body21, label %for.cond.cleanup20, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include<stdio.h>
int main(){
int a[100][100];
int b[100][100];
long int c[100][100]={0};
int n,m,l;
int i,j,k;
scanf("%d %d %d",&n,&m,&l);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d",&a[i][j]);
}
}
for(j=0;j<m;j++){
for(k=0;k<l;k++){
scanf("%d",&b[j][k]);
}
}
for(i=0;i<n;i++){
for(k=0;k<l;k++){
for(j=1;j<=m;j++){
c[i][k]+=(a[i][j-1]*b[j-1][k]);
}
}
}
for(i=0;i<n;i++){
for(k=0;k<l;k++){
printf("%ld",c[i][k]);
if(k!=l-1) printf(" ");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156049/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156049/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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 [100 x [100 x i32]], align 16
%b = alloca [100 x [100 x i32]], align 16
%c = alloca [100 x [100 x i64]], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %c, i8 0, i64 80000, i1 false)
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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp113 = icmp sgt i32 %0, 0
%.pre170 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp113, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre170, 0
br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.inc7 ], [ %.pre170, %for.cond1.preheader.lr.ph ]
%indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2111 = icmp sgt i32 %3, 0
br i1 %cmp2111, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre170, %entry ], [ %11, %for.inc7 ]
%cmp11117 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond187 = select i1 %cmp11117, i1 %7, i1 false
br i1 %or.cond187, label %for.cond13.preheader, label %for.cond27.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv141, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next142, %12
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24
%13 = phi i32 [ %31, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %32, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14115 = icmp sgt i32 %14, 0
br i1 %cmp14115, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre172 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader
%15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre172, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %31, %for.cond27.preheader.loopexit ]
%cmp28123 = icmp sgt i32 %15, 0
br i1 %cmp28123, label %for.cond30.preheader.lr.ph, label %for.end81
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa177 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre170, %for.cond1.preheader.lr.ph ]
%16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%cmp31121 = icmp slt i32 %17, 1
%cmp34.not119 = icmp slt i32 %.lcssa177, 1
%or.cond = select i1 %cmp31121, i1 true, i1 %cmp34.not119
br i1 %or.cond, label %for.cond62.preheader.preheader, label %for.cond30.preheader.us.preheader
for.cond62.preheader.preheader: ; preds = %for.cond30.for.inc55_crit_edge.split.us129, %for.cond30.preheader.lr.ph
br label %for.cond62.preheader
for.cond30.preheader.us.preheader: ; preds = %for.cond30.preheader.lr.ph
%wide.trip.count162 = zext i32 %16 to i64
%wide.trip.count157 = zext i32 %17 to i64
%18 = zext i32 %.lcssa177 to i64
%xtraiter = and i64 %18, 1
%19 = icmp eq i32 %.lcssa177, 1
%unroll_iter = and i64 %18, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond30.preheader.us
for.cond30.preheader.us: ; preds = %for.cond30.preheader.us.preheader, %for.cond30.for.inc55_crit_edge.split.us129
%indvars.iv159 = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvars.iv.next160, %for.cond30.for.inc55_crit_edge.split.us129 ]
br label %for.cond33.preheader.us125
for.body35.us: ; preds = %for.cond33.preheader.us125, %for.body35.us
%indvars.iv150 = phi i64 [ %indvars.iv.next151.1, %for.body35.us ], [ 1, %for.cond33.preheader.us125 ]
%20 = phi i64 [ %add.us.1, %for.body35.us ], [ %arrayidx48.promoted.us, %for.cond33.preheader.us125 ]
%niter = phi i64 [ %niter.next.1, %for.body35.us ], [ 0, %for.cond33.preheader.us125 ]
%21 = add nsw i64 %indvars.iv150, -1
%arrayidx39.us = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv159, i64 %21
%22 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
%arrayidx44.us = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %21, i64 %indvars.iv154
%23 = load i32, ptr %arrayidx44.us, align 4, !tbaa !5
%mul.us = mul nsw i32 %23, %22
%conv.us = sext i32 %mul.us to i64
%add.us = add nsw i64 %20, %conv.us
%arrayidx39.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv159, i64 %indvars.iv150
%24 = load i32, ptr %arrayidx39.us.1, align 4, !tbaa !5
%arrayidx44.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv150, i64 %indvars.iv154
%25 = load i32, ptr %arrayidx44.us.1, align 4, !tbaa !5
%mul.us.1 = mul nsw i32 %25, %24
%conv.us.1 = sext i32 %mul.us.1 to i64
%add.us.1 = add nsw i64 %add.us, %conv.us.1
%indvars.iv.next151.1 = add nuw nsw i64 %indvars.iv150, 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.cond33.for.inc52_crit_edge.us.unr-lcssa, label %for.body35.us, !llvm.loop !13
for.cond33.preheader.us125: ; preds = %for.cond30.preheader.us, %for.cond33.for.inc52_crit_edge.us
%indvars.iv154 = phi i64 [ 0, %for.cond30.preheader.us ], [ %indvars.iv.next155, %for.cond33.for.inc52_crit_edge.us ]
%arrayidx48.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv159, i64 %indvars.iv154
%arrayidx48.promoted.us = load i64, ptr %arrayidx48.us, align 8, !tbaa !14
br i1 %19, label %for.cond33.for.inc52_crit_edge.us.unr-lcssa, label %for.body35.us
for.cond33.for.inc52_crit_edge.us.unr-lcssa: ; preds = %for.body35.us, %for.cond33.preheader.us125
%add.us.lcssa.ph = phi i64 [ undef, %for.cond33.preheader.us125 ], [ %add.us.1, %for.body35.us ]
%indvars.iv150.unr = phi i64 [ 1, %for.cond33.preheader.us125 ], [ %indvars.iv.next151.1, %for.body35.us ]
%.unr = phi i64 [ %arrayidx48.promoted.us, %for.cond33.preheader.us125 ], [ %add.us.1, %for.body35.us ]
br i1 %lcmp.mod.not, label %for.cond33.for.inc52_crit_edge.us, label %for.body35.us.epil
for.body35.us.epil: ; preds = %for.cond33.for.inc52_crit_edge.us.unr-lcssa
%26 = add nsw i64 %indvars.iv150.unr, -1
%arrayidx39.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv159, i64 %26
%27 = load i32, ptr %arrayidx39.us.epil, align 4, !tbaa !5
%arrayidx44.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %26, i64 %indvars.iv154
%28 = load i32, ptr %arrayidx44.us.epil, align 4, !tbaa !5
%mul.us.epil = mul nsw i32 %28, %27
%conv.us.epil = sext i32 %mul.us.epil to i64
%add.us.epil = add nsw i64 %.unr, %conv.us.epil
br label %for.cond33.for.inc52_crit_edge.us
for.cond33.for.inc52_crit_edge.us: ; preds = %for.cond33.for.inc52_crit_edge.us.unr-lcssa, %for.body35.us.epil
%add.us.lcssa = phi i64 [ %add.us.lcssa.ph, %for.cond33.for.inc52_crit_edge.us.unr-lcssa ], [ %add.us.epil, %for.body35.us.epil ]
store i64 %add.us.lcssa, ptr %arrayidx48.us, align 8, !tbaa !14
%indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
%exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157
br i1 %exitcond158.not, label %for.cond30.for.inc55_crit_edge.split.us129, label %for.cond33.preheader.us125, !llvm.loop !16
for.cond30.for.inc55_crit_edge.split.us129: ; preds = %for.cond33.for.inc52_crit_edge.us
%indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
%exitcond163.not = icmp eq i64 %indvars.iv.next160, %wide.trip.count162
br i1 %exitcond163.not, label %for.cond62.preheader.preheader, label %for.cond30.preheader.us, !llvm.loop !17
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv147, i64 %indvars.iv144
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
%29 = load i32, ptr %l, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp14 = icmp slt i64 %indvars.iv.next145, %30
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !18
for.inc24.loopexit: ; preds = %for.body15
%.pre171 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%31 = phi i32 [ %.pre171, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%32 = phi i32 [ %29, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%33 = sext i32 %31 to i64
%cmp11 = icmp slt i64 %indvars.iv.next148, %33
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !19
for.cond62.preheader: ; preds = %for.cond62.preheader.preheader, %for.end77
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.end77 ], [ 0, %for.cond62.preheader.preheader ]
%34 = load i32, ptr %l, align 4, !tbaa !5
%cmp63131 = icmp sgt i32 %34, 0
br i1 %cmp63131, label %for.body65, label %for.end77
for.body65: ; preds = %for.cond62.preheader, %for.inc75
%indvars.iv164 = phi i64 [ %indvars.iv.next165, %for.inc75 ], [ 0, %for.cond62.preheader ]
%arrayidx69 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv167, i64 %indvars.iv164
%35 = load i64, ptr %arrayidx69, align 8, !tbaa !14
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %35)
%36 = load i32, ptr %l, align 4, !tbaa !5
%sub71 = add nsw i32 %36, -1
%37 = zext i32 %sub71 to i64
%cmp72.not = icmp eq i64 %indvars.iv164, %37
br i1 %cmp72.not, label %for.inc75, label %if.then
if.then: ; preds = %for.body65
%putchar110 = call i32 @putchar(i32 32)
%.pre173 = load i32, ptr %l, align 4, !tbaa !5
br label %for.inc75
for.inc75: ; preds = %for.body65, %if.then
%38 = phi i32 [ %36, %for.body65 ], [ %.pre173, %if.then ]
%indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
%39 = sext i32 %38 to i64
%cmp63 = icmp slt i64 %indvars.iv.next165, %39
br i1 %cmp63, label %for.body65, label %for.end77, !llvm.loop !20
for.end77: ; preds = %for.inc75, %for.cond62.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%40 = load i32, ptr %n, align 4, !tbaa !5
%41 = sext i32 %40 to i64
%cmp59 = icmp slt i64 %indvars.iv.next168, %41
br i1 %cmp59, label %for.cond62.preheader, label %for.end81, !llvm.loop !21
for.end81: ; preds = %for.end77, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
|
#include<stdio.h>
int main()
{
int p,i;
scanf("%d",&p);
long long int a[p][3],b[p];
for(i=0;i<p;i++)
{
scanf("%I64d %I64d %I64d",&a[i][0],&a[i][1],&a[i][2]);
b[i]=(a[i][0]+a[i][1]+a[i][2])/2;}
for(i=0;i<p;i++)
printf("%I64d\n",b[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [18 x i8] c"%I64d %I64d %I64d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [3 x i64], i64 %1, align 16
%3 = load i32, ptr %p, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i64, i64 %4, align 16
%cmp42 = icmp sgt i32 %3, 0
br i1 %cmp42, label %for.body, label %for.end30
for.cond22.preheader: ; preds = %for.body
%5 = icmp sgt i32 %9, 0
br i1 %5, label %for.body24, label %for.end30
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv, i64 1
%arrayidx8 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv, i64 2
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx8)
%6 = load i64, ptr %arrayidx, align 8, !tbaa !9
%7 = load i64, ptr %arrayidx5, align 8, !tbaa !9
%add = add nsw i64 %7, %6
%8 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%add19 = add nsw i64 %add, %8
%div = sdiv i64 %add19, 2
%arrayidx21 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv
store i64 %div, ptr %arrayidx21, align 8, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %p, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond22.preheader, !llvm.loop !11
for.body24: ; preds = %for.cond22.preheader, %for.body24
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body24 ], [ 0, %for.cond22.preheader ]
%arrayidx26 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv47
%11 = load i64, ptr %arrayidx26, align 8, !tbaa !9
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %11)
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%12 = load i32, ptr %p, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp23 = icmp slt i64 %indvars.iv.next48, %13
br i1 %cmp23, label %for.body24, label %for.end30, !llvm.loop !13
for.end30: ; preds = %for.body24, %entry, %for.cond22.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int main()
{
long i,j,k,n,m,l;
long A[101][101],B[101][101],C[101][101]={0};
scanf("%d %d %d",&n,&m,&l);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d ",&A[i][j]);
}
}
for(i=0;i<m;i++){
for(j=0;j<l;j++){
scanf("%d ",&B[i][j]);
}
}
for(i=0;i<n;i++){
for(j=0;j<l;j++){
for(k=0;k<m;k++){
C[i][j] += A[i][k]*B[k][j];
}
printf("%ld",C[i][j]);
if(j<l-1)
printf(" ");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = 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
%m = alloca i64, align 8
%l = alloca i64, align 8
%A = alloca [101 x [101 x i64]], align 16
%B = alloca [101 x [101 x i64]], align 16
%C = alloca [101 x [101 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %C) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %C, i8 0, i64 81608, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp81 = icmp sgt i64 %0, 0
%.pre95 = load i64, ptr %m, align 8, !tbaa !5
br i1 %cmp81, label %for.cond1.preheader.lr.ph, label %for.cond9.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i64 %.pre95, 0
br i1 %1, label %for.cond1.preheader, label %for.cond27.preheader.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc6
%2 = phi i64 [ %9, %for.inc6 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i64 [ %10, %for.inc6 ], [ %.pre95, %for.cond1.preheader.lr.ph ]
%i.082 = phi i64 [ %inc7, %for.inc6 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp279 = icmp sgt i64 %3, 0
br i1 %cmp279, label %for.body3, label %for.inc6
for.cond9.preheader: ; preds = %for.inc6, %entry
%4 = phi i64 [ %0, %entry ], [ %9, %for.inc6 ]
%5 = phi i64 [ %.pre95, %entry ], [ %10, %for.inc6 ]
%cmp1085 = icmp sgt i64 %5, 0
%6 = load i64, ptr %l, align 8
%7 = icmp sgt i64 %6, 0
%or.cond = select i1 %cmp1085, i1 %7, i1 false
br i1 %or.cond, label %for.cond12.preheader, label %for.cond24.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%j.080 = phi i64 [ %inc, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx4 = getelementptr inbounds [101 x [101 x i64]], ptr %A, i64 0, i64 %i.082, i64 %j.080
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx4)
%inc = add nuw nsw i64 %j.080, 1
%8 = load i64, ptr %m, align 8, !tbaa !5
%cmp2 = icmp slt i64 %inc, %8
br i1 %cmp2, label %for.body3, label %for.inc6.loopexit, !llvm.loop !9
for.inc6.loopexit: ; preds = %for.body3
%.pre = load i64, ptr %n, align 8, !tbaa !5
br label %for.inc6
for.inc6: ; preds = %for.inc6.loopexit, %for.cond1.preheader
%9 = phi i64 [ %.pre, %for.inc6.loopexit ], [ %2, %for.cond1.preheader ]
%10 = phi i64 [ %8, %for.inc6.loopexit ], [ %3, %for.cond1.preheader ]
%inc7 = add nuw nsw i64 %i.082, 1
%cmp = icmp slt i64 %inc7, %9
br i1 %cmp, label %for.cond1.preheader, label %for.cond9.preheader, !llvm.loop !11
for.cond12.preheader: ; preds = %for.cond9.preheader, %for.inc21
%11 = phi i64 [ %15, %for.inc21 ], [ %5, %for.cond9.preheader ]
%12 = phi i64 [ %16, %for.inc21 ], [ %6, %for.cond9.preheader ]
%i.186 = phi i64 [ %inc22, %for.inc21 ], [ 0, %for.cond9.preheader ]
%cmp1383 = icmp sgt i64 %12, 0
br i1 %cmp1383, label %for.body14, label %for.inc21
for.cond24.preheader.loopexit: ; preds = %for.inc21
%.pre97 = load i64, ptr %n, align 8, !tbaa !5
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %for.cond9.preheader
%13 = phi i64 [ %.pre97, %for.cond24.preheader.loopexit ], [ %4, %for.cond9.preheader ]
%cmp2591 = icmp sgt i64 %13, 0
br i1 %cmp2591, label %for.cond27.preheader.preheader, label %for.end53
for.cond27.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond24.preheader
br label %for.cond27.preheader
for.body14: ; preds = %for.cond12.preheader, %for.body14
%j.184 = phi i64 [ %inc19, %for.body14 ], [ 0, %for.cond12.preheader ]
%arrayidx16 = getelementptr inbounds [101 x [101 x i64]], ptr %B, i64 0, i64 %i.186, i64 %j.184
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx16)
%inc19 = add nuw nsw i64 %j.184, 1
%14 = load i64, ptr %l, align 8, !tbaa !5
%cmp13 = icmp slt i64 %inc19, %14
br i1 %cmp13, label %for.body14, label %for.inc21.loopexit, !llvm.loop !13
for.inc21.loopexit: ; preds = %for.body14
%.pre96 = load i64, ptr %m, align 8, !tbaa !5
br label %for.inc21
for.inc21: ; preds = %for.inc21.loopexit, %for.cond12.preheader
%15 = phi i64 [ %.pre96, %for.inc21.loopexit ], [ %11, %for.cond12.preheader ]
%16 = phi i64 [ %14, %for.inc21.loopexit ], [ %12, %for.cond12.preheader ]
%inc22 = add nuw nsw i64 %i.186, 1
%cmp10 = icmp slt i64 %inc22, %15
br i1 %cmp10, label %for.cond12.preheader, label %for.cond24.preheader.loopexit, !llvm.loop !14
for.cond27.preheader: ; preds = %for.cond27.preheader.preheader, %for.end49
%i.292 = phi i64 [ %inc52, %for.end49 ], [ 0, %for.cond27.preheader.preheader ]
%17 = load i64, ptr %l, align 8, !tbaa !5
%cmp2889 = icmp sgt i64 %17, 0
br i1 %cmp2889, label %for.cond30.preheader, label %for.end49
for.cond30.preheader: ; preds = %for.cond27.preheader, %for.inc47
%j.290 = phi i64 [ %inc48, %for.inc47 ], [ 0, %for.cond27.preheader ]
%18 = load i64, ptr %m, align 8, !tbaa !5
%cmp3187 = icmp sgt i64 %18, 0
%arrayidx38 = getelementptr inbounds [101 x [101 x i64]], ptr %C, i64 0, i64 %i.292, i64 %j.290
%arrayidx38.promoted = load i64, ptr %arrayidx38, align 8, !tbaa !5
br i1 %cmp3187, label %for.body32.preheader, label %for.end41
for.body32.preheader: ; preds = %for.cond30.preheader
%xtraiter = and i64 %18, 1
%19 = icmp eq i64 %18, 1
br i1 %19, label %for.cond30.for.end41_crit_edge.unr-lcssa, label %for.body32.preheader.new
for.body32.preheader.new: ; preds = %for.body32.preheader
%unroll_iter = and i64 %18, -2
br label %for.body32
for.body32: ; preds = %for.body32, %for.body32.preheader.new
%20 = phi i64 [ %arrayidx38.promoted, %for.body32.preheader.new ], [ %add.1, %for.body32 ]
%k.088 = phi i64 [ 0, %for.body32.preheader.new ], [ %inc40.1, %for.body32 ]
%niter = phi i64 [ 0, %for.body32.preheader.new ], [ %niter.next.1, %for.body32 ]
%arrayidx34 = getelementptr inbounds [101 x [101 x i64]], ptr %A, i64 0, i64 %i.292, i64 %k.088
%21 = load i64, ptr %arrayidx34, align 8, !tbaa !5
%arrayidx36 = getelementptr inbounds [101 x [101 x i64]], ptr %B, i64 0, i64 %k.088, i64 %j.290
%22 = load i64, ptr %arrayidx36, align 8, !tbaa !5
%mul = mul nsw i64 %22, %21
%add = add nsw i64 %20, %mul
%inc40 = or i64 %k.088, 1
%arrayidx34.1 = getelementptr inbounds [101 x [101 x i64]], ptr %A, i64 0, i64 %i.292, i64 %inc40
%23 = load i64, ptr %arrayidx34.1, align 8, !tbaa !5
%arrayidx36.1 = getelementptr inbounds [101 x [101 x i64]], ptr %B, i64 0, i64 %inc40, i64 %j.290
%24 = load i64, ptr %arrayidx36.1, align 8, !tbaa !5
%mul.1 = mul nsw i64 %24, %23
%add.1 = add nsw i64 %add, %mul.1
%inc40.1 = add nuw nsw i64 %k.088, 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.cond30.for.end41_crit_edge.unr-lcssa, label %for.body32, !llvm.loop !15
for.cond30.for.end41_crit_edge.unr-lcssa: ; preds = %for.body32, %for.body32.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body32.preheader ], [ %add.1, %for.body32 ]
%.unr = phi i64 [ %arrayidx38.promoted, %for.body32.preheader ], [ %add.1, %for.body32 ]
%k.088.unr = phi i64 [ 0, %for.body32.preheader ], [ %inc40.1, %for.body32 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond30.for.end41_crit_edge, label %for.body32.epil
for.body32.epil: ; preds = %for.cond30.for.end41_crit_edge.unr-lcssa
%arrayidx34.epil = getelementptr inbounds [101 x [101 x i64]], ptr %A, i64 0, i64 %i.292, i64 %k.088.unr
%25 = load i64, ptr %arrayidx34.epil, align 8, !tbaa !5
%arrayidx36.epil = getelementptr inbounds [101 x [101 x i64]], ptr %B, i64 0, i64 %k.088.unr, i64 %j.290
%26 = load i64, ptr %arrayidx36.epil, align 8, !tbaa !5
%mul.epil = mul nsw i64 %26, %25
%add.epil = add nsw i64 %.unr, %mul.epil
br label %for.cond30.for.end41_crit_edge
for.cond30.for.end41_crit_edge: ; preds = %for.cond30.for.end41_crit_edge.unr-lcssa, %for.body32.epil
%add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond30.for.end41_crit_edge.unr-lcssa ], [ %add.epil, %for.body32.epil ]
store i64 %add.lcssa, ptr %arrayidx38, align 8, !tbaa !5
br label %for.end41
for.end41: ; preds = %for.cond30.preheader, %for.cond30.for.end41_crit_edge
%27 = phi i64 [ %add.lcssa, %for.cond30.for.end41_crit_edge ], [ %arrayidx38.promoted, %for.cond30.preheader ]
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %27)
%28 = load i64, ptr %l, align 8, !tbaa !5
%sub = add nsw i64 %28, -1
%cmp45 = icmp slt i64 %j.290, %sub
br i1 %cmp45, label %if.then, label %for.inc47
if.then: ; preds = %for.end41
%putchar78 = call i32 @putchar(i32 32)
%.pre99 = load i64, ptr %l, align 8, !tbaa !5
br label %for.inc47
for.inc47: ; preds = %for.end41, %if.then
%29 = phi i64 [ %28, %for.end41 ], [ %.pre99, %if.then ]
%inc48 = add nuw nsw i64 %j.290, 1
%cmp28 = icmp slt i64 %inc48, %29
br i1 %cmp28, label %for.cond30.preheader, label %for.end49, !llvm.loop !16
for.end49: ; preds = %for.inc47, %for.cond27.preheader
%putchar = call i32 @putchar(i32 10)
%inc52 = add nuw nsw i64 %i.292, 1
%30 = load i64, ptr %n, align 8, !tbaa !5
%cmp25 = icmp slt i64 %inc52, %30
br i1 %cmp25, label %for.cond27.preheader, label %for.end53, !llvm.loop !17
for.end53: ; preds = %for.end49, %for.cond24.preheader
call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
int main(void){
// Your code here!
int n,m,l;
int i,j,k;
int a[110][110];
int b[110][110];
long long c[110][110]={0};
scanf("%d %d %d", &n, &m, &l);
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%d", &a[i][j]);
}
}
for(i=0;i<m;i++){
for(j=0;j<l;j++){
scanf("%d", &b[i][j]);
}
}
for(i=0;i<n;i++){
for(j=0;j<l;j++){
for(k=0;k<m;k++){
c[i][j]+=a[i][k]*b[k][j];
}
if(j!=0) printf(" ");
printf("%ld", c[i][j]);
}
puts("");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156186/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156186/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = 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 i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
%a = alloca [110 x [110 x i32]], align 16
%b = alloca [110 x [110 x i32]], align 16
%c = alloca [110 x [110 x i64]], 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 96800, ptr nonnull %c) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(96800) %c, i8 0, i64 96800, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp93 = icmp sgt i32 %0, 0
%.pre126 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp93, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre126, 0
br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.inc7 ], [ %.pre126, %for.cond1.preheader.lr.ph ]
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp291 = icmp sgt i32 %3, 0
br i1 %cmp291, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre126, %entry ], [ %11, %for.inc7 ]
%cmp1197 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp1197, i1 %7, i1 false
br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv108, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next109, %12
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24
%13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp1495 = icmp sgt i32 %14, 0
br i1 %cmp1495, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre128 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader
%15 = phi i32 [ %.pre128, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ]
%cmp28103 = icmp sgt i32 %15, 0
br i1 %cmp28103, label %for.cond30.preheader.preheader, label %for.end65
for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
br label %for.cond30.preheader
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv114, i64 %indvars.iv111
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%16 = load i32, ptr %l, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp14 = icmp slt i64 %indvars.iv.next112, %17
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13
for.inc24.loopexit: ; preds = %for.body15
%.pre127 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%18 = phi i32 [ %.pre127, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%20 = sext i32 %18 to i64
%cmp11 = icmp slt i64 %indvars.iv.next115, %20
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14
for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end61
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.end61 ], [ 0, %for.cond30.preheader.preheader ]
%21 = load i32, ptr %l, align 4, !tbaa !5
%cmp31101 = icmp sgt i32 %21, 0
br i1 %cmp31101, label %for.cond33.preheader, label %for.end61
for.cond33.preheader: ; preds = %for.cond30.preheader, %if.end
%indvars.iv120 = phi i64 [ %indvars.iv.next121, %if.end ], [ 0, %for.cond30.preheader ]
%22 = load i32, ptr %m, align 4, !tbaa !5
%cmp3499 = icmp sgt i32 %22, 0
br i1 %cmp3499, label %for.body35.lr.ph, label %for.end50
for.body35.lr.ph: ; preds = %for.cond33.preheader
%arrayidx47 = getelementptr inbounds [110 x [110 x i64]], ptr %c, i64 0, i64 %indvars.iv123, i64 %indvars.iv120
%arrayidx47.promoted = load i64, ptr %arrayidx47, align 8, !tbaa !15
%wide.trip.count = zext i32 %22 to i64
%xtraiter = and i64 %wide.trip.count, 1
%23 = icmp eq i32 %22, 1
br i1 %23, label %for.cond33.for.end50_crit_edge.unr-lcssa, label %for.body35.lr.ph.new
for.body35.lr.ph.new: ; preds = %for.body35.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body35
for.body35: ; preds = %for.body35, %for.body35.lr.ph.new
%indvars.iv117 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next118.1, %for.body35 ]
%24 = phi i64 [ %arrayidx47.promoted, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ]
%niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ]
%arrayidx39 = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv117
%25 = load i32, ptr %arrayidx39, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv117, i64 %indvars.iv120
%26 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%mul = mul nsw i32 %26, %25
%conv = sext i32 %mul to i64
%add = add nsw i64 %24, %conv
%indvars.iv.next118 = or i64 %indvars.iv117, 1
%arrayidx39.1 = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv.next118
%27 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%arrayidx43.1 = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv.next118, i64 %indvars.iv120
%28 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %28, %27
%conv.1 = sext i32 %mul.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 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.cond33.for.end50_crit_edge.unr-lcssa, label %for.body35, !llvm.loop !17
for.cond33.for.end50_crit_edge.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph
%add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%indvars.iv117.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next118.1, %for.body35 ]
%.unr = phi i64 [ %arrayidx47.promoted, %for.body35.lr.ph ], [ %add.1, %for.body35 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond33.for.end50_crit_edge, label %for.body35.epil
for.body35.epil: ; preds = %for.cond33.for.end50_crit_edge.unr-lcssa
%arrayidx39.epil = getelementptr inbounds [110 x [110 x i32]], ptr %a, i64 0, i64 %indvars.iv123, i64 %indvars.iv117.unr
%29 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5
%arrayidx43.epil = getelementptr inbounds [110 x [110 x i32]], ptr %b, i64 0, i64 %indvars.iv117.unr, i64 %indvars.iv120
%30 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5
%mul.epil = mul nsw i32 %30, %29
%conv.epil = sext i32 %mul.epil to i64
%add.epil = add nsw i64 %.unr, %conv.epil
br label %for.cond33.for.end50_crit_edge
for.cond33.for.end50_crit_edge: ; preds = %for.cond33.for.end50_crit_edge.unr-lcssa, %for.body35.epil
%add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond33.for.end50_crit_edge.unr-lcssa ], [ %add.epil, %for.body35.epil ]
store i64 %add.lcssa, ptr %arrayidx47, align 8, !tbaa !15
br label %for.end50
for.end50: ; preds = %for.cond33.for.end50_crit_edge, %for.cond33.preheader
%cmp51.not = icmp eq i64 %indvars.iv120, 0
br i1 %cmp51.not, label %if.end, label %if.then
if.then: ; preds = %for.end50
%putchar90 = call i32 @putchar(i32 32)
br label %if.end
if.end: ; preds = %if.then, %for.end50
%arrayidx57 = getelementptr inbounds [110 x [110 x i64]], ptr %c, i64 0, i64 %indvars.iv123, i64 %indvars.iv120
%31 = load i64, ptr %arrayidx57, align 8, !tbaa !15
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %31)
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%32 = load i32, ptr %l, align 4, !tbaa !5
%33 = sext i32 %32 to i64
%cmp31 = icmp slt i64 %indvars.iv.next121, %33
br i1 %cmp31, label %for.cond33.preheader, label %for.end61, !llvm.loop !18
for.end61: ; preds = %if.end, %for.cond30.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%34 = load i32, ptr %n, align 4, !tbaa !5
%35 = sext i32 %34 to i64
%cmp28 = icmp slt i64 %indvars.iv.next124, %35
br i1 %cmp28, label %for.cond30.preheader, label %for.end65, !llvm.loop !19
for.end65: ; preds = %for.end61, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 96800, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main()
{
int a[101][101], b[101][101];
long long c[101][101], s;
int i, j, k;
int n, m, l;
scanf("%d %d %d", &n, &m, &l);
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
scanf("%d", &a[i][j]);
}
}
for (i = 0; i < m; i++) {
for (j = 0; j < l; j++) {
scanf("%d", &b[i][j]);
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < l; j++) {
s = 0;
for (k = 0; k < m; k++) {
s += a[i][k] * b[k][j];
}
c[i][j] = s;
}
}
for (i = 0; i < n; i++) {
printf("%lld", c[i][0]);
for (j = 1; j < l; j++) {
printf(" %lld", c[i][j]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156229/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156229/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c" %lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [101 x [101 x i32]], align 16
%b = alloca [101 x [101 x i32]], align 16
%c = alloca [101 x [101 x i64]], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %c) #5
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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp112 = icmp sgt i32 %0, 0
%.pre178 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp112, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre178, 0
br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7
%2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.inc7 ], [ %.pre178, %for.cond1.preheader.lr.ph ]
%indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2110 = icmp sgt i32 %3, 0
br i1 %cmp2110, label %for.body3, label %for.inc7
for.cond10.preheader: ; preds = %for.inc7, %entry
%4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ]
%5 = phi i32 [ %.pre178, %entry ], [ %11, %for.inc7 ]
%cmp11116 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp11116, i1 %7, i1 false
br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv144, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9
for.inc7.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc7
for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ]
%11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next145, %12
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24
%13 = phi i32 [ %39, %for.inc24 ], [ %5, %for.cond10.preheader ]
%14 = phi i32 [ %40, %for.inc24 ], [ %6, %for.cond10.preheader ]
%indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc24 ], [ 0, %for.cond10.preheader ]
%cmp14114 = icmp sgt i32 %14, 0
br i1 %cmp14114, label %for.body15, label %for.inc24
for.cond27.preheader.loopexit: ; preds = %for.inc24
%.pre180 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond27.preheader
for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader
%15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre180, %for.cond27.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %39, %for.cond27.preheader.loopexit ]
%cmp28124 = icmp sgt i32 %15, 0
br i1 %cmp28124, label %for.cond30.preheader.lr.ph, label %for.end80
for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader
%.lcssa184 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre178, %for.cond1.preheader.lr.ph ]
%16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%cmp31122 = icmp sgt i32 %17, 0
br i1 %cmp31122, label %for.cond30.preheader.lr.ph.split.us, label %for.body60.preheader
for.body60.preheader.loopexit201.unr-lcssa: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvar.next.7, %for.cond30.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body60.preheader, label %for.cond30.preheader.us.epil
for.cond30.preheader.us.epil: ; preds = %for.body60.preheader.loopexit201.unr-lcssa, %for.cond30.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond30.preheader.us.epil ], [ %indvar.unr, %for.body60.preheader.loopexit201.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond30.preheader.us.epil ], [ 0, %for.body60.preheader.loopexit201.unr-lcssa ]
%18 = mul nuw nsw i64 %indvar.epil, 808
%scevgep.epil = getelementptr i8, ptr %c, i64 %18
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %20, i1 false), !tbaa !13
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.body60.preheader, label %for.cond30.preheader.us.epil, !llvm.loop !15
for.body60.preheader: ; preds = %for.body60.preheader.loopexit201.unr-lcssa, %for.cond30.preheader.us.epil, %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph
br label %for.body60
for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph
%cmp34118 = icmp sgt i32 %.lcssa184, 0
br i1 %cmp34118, label %for.cond30.preheader.us.us.preheader, label %for.cond30.preheader.us.preheader
for.cond30.preheader.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us
%19 = zext i32 %17 to i64
%20 = shl nuw nsw i64 %19, 3
%wide.trip.count = zext i32 %16 to i64
%xtraiter = and i64 %wide.trip.count, 7
%21 = icmp ult i32 %16, 8
br i1 %21, label %for.body60.preheader.loopexit201.unr-lcssa, label %for.cond30.preheader.us.preheader.new
for.cond30.preheader.us.preheader.new: ; preds = %for.cond30.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
%invariant.gep = getelementptr i8, ptr %c, i64 808
%invariant.gep218 = getelementptr i8, ptr %c, i64 1616
%invariant.gep220 = getelementptr i8, ptr %c, i64 2424
%invariant.gep222 = getelementptr i8, ptr %c, i64 3232
%invariant.gep224 = getelementptr i8, ptr %c, i64 4040
%invariant.gep226 = getelementptr i8, ptr %c, i64 4848
%invariant.gep228 = getelementptr i8, ptr %c, i64 5656
br label %for.cond30.preheader.us
for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us
%wide.trip.count170 = zext i32 %16 to i64
%wide.trip.count165 = zext i32 %17 to i64
%wide.trip.count160 = zext i32 %.lcssa184 to i64
%xtraiter207 = and i64 %wide.trip.count160, 1
%22 = icmp eq i32 %.lcssa184, 1
%unroll_iter211 = and i64 %wide.trip.count160, 4294967294
%lcmp.mod209.not = icmp eq i64 %xtraiter207, 0
br label %for.cond30.preheader.us.us
for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us
%indvars.iv167 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next168, %for.cond30.for.inc54_crit_edge.split.us.us.us ]
br label %for.cond33.preheader.us.us.us
for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.end46_crit_edge.us.us.us, %for.cond30.preheader.us.us
%indvars.iv162 = phi i64 [ %indvars.iv.next163, %for.cond33.for.end46_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ]
br i1 %22, label %for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us
for.body35.us.us.us: ; preds = %for.cond33.preheader.us.us.us, %for.body35.us.us.us
%indvars.iv157 = phi i64 [ %indvars.iv.next158.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%s.0119.us.us.us = phi i64 [ %add.us.us.us.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%niter212 = phi i64 [ %niter212.next.1, %for.body35.us.us.us ], [ 0, %for.cond33.preheader.us.us.us ]
%arrayidx39.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv157
%23 = load i32, ptr %arrayidx39.us.us.us, align 4, !tbaa !5
%arrayidx43.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv157, i64 %indvars.iv162
%24 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5
%mul.us.us.us = mul nsw i32 %24, %23
%conv.us.us.us = sext i32 %mul.us.us.us to i64
%add.us.us.us = add nsw i64 %s.0119.us.us.us, %conv.us.us.us
%indvars.iv.next158 = or i64 %indvars.iv157, 1
%arrayidx39.us.us.us.1 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv.next158
%25 = load i32, ptr %arrayidx39.us.us.us.1, align 4, !tbaa !5
%arrayidx43.us.us.us.1 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv.next158, i64 %indvars.iv162
%26 = load i32, ptr %arrayidx43.us.us.us.1, align 4, !tbaa !5
%mul.us.us.us.1 = mul nsw i32 %26, %25
%conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64
%add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1
%indvars.iv.next158.1 = add nuw nsw i64 %indvars.iv157, 2
%niter212.next.1 = add i64 %niter212, 2
%niter212.ncmp.1 = icmp eq i64 %niter212.next.1, %unroll_iter211
br i1 %niter212.ncmp.1, label %for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa, label %for.body35.us.us.us, !llvm.loop !17
for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body35.us.us.us, %for.cond33.preheader.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ]
%indvars.iv157.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %indvars.iv.next158.1, %for.body35.us.us.us ]
%s.0119.us.us.us.unr = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %add.us.us.us.1, %for.body35.us.us.us ]
br i1 %lcmp.mod209.not, label %for.cond33.for.end46_crit_edge.us.us.us, label %for.body35.us.us.us.epil
for.body35.us.us.us.epil: ; preds = %for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa
%arrayidx39.us.us.us.epil = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv157.unr
%27 = load i32, ptr %arrayidx39.us.us.us.epil, align 4, !tbaa !5
%arrayidx43.us.us.us.epil = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv157.unr, i64 %indvars.iv162
%28 = load i32, ptr %arrayidx43.us.us.us.epil, align 4, !tbaa !5
%mul.us.us.us.epil = mul nsw i32 %28, %27
%conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64
%add.us.us.us.epil = add nsw i64 %s.0119.us.us.us.unr, %conv.us.us.us.epil
br label %for.cond33.for.end46_crit_edge.us.us.us
for.cond33.for.end46_crit_edge.us.us.us: ; preds = %for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa, %for.body35.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond33.for.end46_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body35.us.us.us.epil ]
%arrayidx50.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv167, i64 %indvars.iv162
store i64 %add.us.us.us.lcssa, ptr %arrayidx50.us.us.us, align 8, !tbaa !13
%indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
%exitcond166.not = icmp eq i64 %indvars.iv.next163, %wide.trip.count165
br i1 %exitcond166.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !18
for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.end46_crit_edge.us.us.us
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%exitcond171.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count170
br i1 %exitcond171.not, label %for.body60.preheader, label %for.cond30.preheader.us.us, !llvm.loop !19
for.cond30.preheader.us: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond30.preheader.us ]
%niter = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %niter.next.7, %for.cond30.preheader.us ]
%29 = mul nuw nsw i64 %indvar, 808
%scevgep = getelementptr i8, ptr %c, i64 %29
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %20, i1 false), !tbaa !13
%30 = mul nuw i64 %indvar, 808
%gep = getelementptr i8, ptr %invariant.gep, i64 %30
call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %20, i1 false), !tbaa !13
%31 = mul nuw i64 %indvar, 808
%gep219 = getelementptr i8, ptr %invariant.gep218, i64 %31
call void @llvm.memset.p0.i64(ptr align 16 %gep219, i8 0, i64 %20, i1 false), !tbaa !13
%32 = mul nuw i64 %indvar, 808
%gep221 = getelementptr i8, ptr %invariant.gep220, i64 %32
call void @llvm.memset.p0.i64(ptr align 8 %gep221, i8 0, i64 %20, i1 false), !tbaa !13
%33 = mul nuw i64 %indvar, 808
%gep223 = getelementptr i8, ptr %invariant.gep222, i64 %33
call void @llvm.memset.p0.i64(ptr align 16 %gep223, i8 0, i64 %20, i1 false), !tbaa !13
%34 = mul nuw i64 %indvar, 808
%gep225 = getelementptr i8, ptr %invariant.gep224, i64 %34
call void @llvm.memset.p0.i64(ptr align 8 %gep225, i8 0, i64 %20, i1 false), !tbaa !13
%35 = mul nuw i64 %indvar, 808
%gep227 = getelementptr i8, ptr %invariant.gep226, i64 %35
call void @llvm.memset.p0.i64(ptr align 16 %gep227, i8 0, i64 %20, i1 false), !tbaa !13
%36 = mul nuw i64 %indvar, 808
%gep229 = getelementptr i8, ptr %invariant.gep228, i64 %36
call void @llvm.memset.p0.i64(ptr align 8 %gep229, i8 0, i64 %20, i1 false), !tbaa !13
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.body60.preheader.loopexit201.unr-lcssa, label %for.cond30.preheader.us, !llvm.loop !19
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx19 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv150, i64 %indvars.iv147
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19)
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%37 = load i32, ptr %l, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp14 = icmp slt i64 %indvars.iv.next148, %38
br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !20
for.inc24.loopexit: ; preds = %for.body15
%.pre179 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader
%39 = phi i32 [ %.pre179, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ]
%40 = phi i32 [ %37, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ]
%indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
%41 = sext i32 %39 to i64
%cmp11 = icmp slt i64 %indvars.iv.next151, %41
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !21
for.body60: ; preds = %for.body60.preheader, %for.end76
%indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.end76 ], [ 0, %for.body60.preheader ]
%arrayidx62 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv175
%42 = load i64, ptr %arrayidx62, align 8, !tbaa !13
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %42)
%43 = load i32, ptr %l, align 4, !tbaa !5
%cmp66134 = icmp sgt i32 %43, 1
br i1 %cmp66134, label %for.body68, label %for.end76
for.body68: ; preds = %for.body60, %for.body68
%indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.body68 ], [ 1, %for.body60 ]
%arrayidx72 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv175, i64 %indvars.iv172
%44 = load i64, ptr %arrayidx72, align 8, !tbaa !13
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %44)
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%45 = load i32, ptr %l, align 4, !tbaa !5
%46 = sext i32 %45 to i64
%cmp66 = icmp slt i64 %indvars.iv.next173, %46
br i1 %cmp66, label %for.body68, label %for.end76, !llvm.loop !22
for.end76: ; preds = %for.body68, %for.body60
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
%47 = load i32, ptr %n, align 4, !tbaa !5
%48 = sext i32 %47 to i64
%cmp58 = icmp slt i64 %indvars.iv.next176, %48
br i1 %cmp58, label %for.body60, label %for.end80, !llvm.loop !23
for.end80: ; preds = %for.end76, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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
call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 40804, 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !12}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
|
#include <stdio.h>
int main() {
int n, m, l;
long long A[100][100], B[100][100], C[100][100] = {0};
scanf("%d %d %d", &n, &m, &l);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%lld", &A[i][j]);
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < l; j++) {
scanf("%d", &B[i][j]);
}
}
// Calculation
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
C[i][j] = 0;
for (int k = 0; k < m; k++) {
C[i][j] = C[i][j] + A[i][k]*B[k][j];
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < l; j++) {
if (j == 0)
printf("%lld", C[i][j]);
else
printf(" %lld", C[i][j]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156272/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156272/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c" %lld\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
%l = alloca i32, align 4
%A = alloca [100 x [100 x i64]], align 16
%B = alloca [100 x [100 x i64]], align 16
%C = alloca [100 x [100 x i64]], 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %C) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %C, i8 0, i64 80000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp133 = icmp sgt i32 %0, 0
%.pre201 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp133, label %for.cond1.preheader.lr.ph, label %for.cond12.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre201, 0
br i1 %1, label %for.cond1.preheader, label %for.cond38.preheader.lr.ph
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond.cleanup3
%2 = phi i32 [ %8, %for.cond.cleanup3 ], [ %0, %for.cond1.preheader.lr.ph ]
%3 = phi i32 [ %9, %for.cond.cleanup3 ], [ %.pre201, %for.cond1.preheader.lr.ph ]
%indvars.iv163 = phi i64 [ %indvars.iv.next164, %for.cond.cleanup3 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2131 = icmp sgt i32 %3, 0
br i1 %cmp2131, label %for.body4, label %for.cond.cleanup3
for.cond12.preheader: ; preds = %for.cond.cleanup3, %entry
%4 = phi i32 [ %0, %entry ], [ %8, %for.cond.cleanup3 ]
%5 = phi i32 [ %.pre201, %entry ], [ %9, %for.cond.cleanup3 ]
%cmp13137 = icmp sgt i32 %5, 0
%6 = load i32, ptr %l, align 4
%7 = icmp sgt i32 %6, 0
%or.cond = select i1 %cmp13137, i1 %7, i1 false
br i1 %or.cond, label %for.cond17.preheader, label %for.cond33.preheader
for.cond.cleanup3.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond.cleanup3
for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit, %for.cond1.preheader
%8 = phi i32 [ %.pre, %for.cond.cleanup3.loopexit ], [ %2, %for.cond1.preheader ]
%9 = phi i32 [ %11, %for.cond.cleanup3.loopexit ], [ %3, %for.cond1.preheader ]
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
%10 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next164, %10
br i1 %cmp, label %for.cond1.preheader, label %for.cond12.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond1.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond1.preheader ]
%arrayidx6 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv163, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %m, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !12
for.cond17.preheader: ; preds = %for.cond12.preheader, %for.cond.cleanup19
%13 = phi i32 [ %38, %for.cond.cleanup19 ], [ %5, %for.cond12.preheader ]
%14 = phi i32 [ %39, %for.cond.cleanup19 ], [ %6, %for.cond12.preheader ]
%indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.cond.cleanup19 ], [ 0, %for.cond12.preheader ]
%cmp18135 = icmp sgt i32 %14, 0
br i1 %cmp18135, label %for.body20, label %for.cond.cleanup19
for.cond33.preheader.loopexit: ; preds = %for.cond.cleanup19
%.pre203 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond33.preheader
for.cond33.preheader: ; preds = %for.cond33.preheader.loopexit, %for.cond12.preheader
%15 = phi i32 [ %4, %for.cond12.preheader ], [ %.pre203, %for.cond33.preheader.loopexit ]
%.lcssa = phi i32 [ %5, %for.cond12.preheader ], [ %38, %for.cond33.preheader.loopexit ]
%cmp34143 = icmp sgt i32 %15, 0
br i1 %cmp34143, label %for.cond38.preheader.lr.ph, label %for.cond.cleanup78
for.cond38.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond33.preheader
%.lcssa209 = phi i32 [ %.lcssa, %for.cond33.preheader ], [ %.pre201, %for.cond1.preheader.lr.ph ]
%16 = phi i32 [ %15, %for.cond33.preheader ], [ %0, %for.cond1.preheader.lr.ph ]
%17 = load i32, ptr %l, align 4, !tbaa !5
%cmp39141 = icmp sgt i32 %17, 0
br i1 %cmp39141, label %for.cond38.preheader.lr.ph.split.us, label %for.cond81.preheader.preheader
for.cond81.preheader.preheader.loopexit226.unr-lcssa: ; preds = %for.cond38.preheader.us, %for.cond38.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond38.preheader.us.preheader ], [ %indvar.next.7, %for.cond38.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond81.preheader.preheader, label %for.cond38.preheader.us.epil
for.cond38.preheader.us.epil: ; preds = %for.cond81.preheader.preheader.loopexit226.unr-lcssa, %for.cond38.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond38.preheader.us.epil ], [ %indvar.unr, %for.cond81.preheader.preheader.loopexit226.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond38.preheader.us.epil ], [ 0, %for.cond81.preheader.preheader.loopexit226.unr-lcssa ]
%18 = mul nuw nsw i64 %indvar.epil, 800
%scevgep.epil = getelementptr i8, ptr %C, i64 %18
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %20, i1 false), !tbaa !13
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond81.preheader.preheader, label %for.cond38.preheader.us.epil, !llvm.loop !15
for.cond81.preheader.preheader: ; preds = %for.cond81.preheader.preheader.loopexit226.unr-lcssa, %for.cond38.preheader.us.epil, %for.cond38.for.cond.cleanup40_crit_edge.split.us.us.us, %for.cond38.preheader.lr.ph
br label %for.cond81.preheader
for.cond38.preheader.lr.ph.split.us: ; preds = %for.cond38.preheader.lr.ph
%cmp47139 = icmp sgt i32 %.lcssa209, 0
br i1 %cmp47139, label %for.cond38.preheader.us.us.preheader, label %for.cond38.preheader.us.preheader
for.cond38.preheader.us.preheader: ; preds = %for.cond38.preheader.lr.ph.split.us
%19 = zext i32 %17 to i64
%20 = shl nuw nsw i64 %19, 3
%wide.trip.count = zext i32 %16 to i64
%xtraiter = and i64 %wide.trip.count, 7
%21 = icmp ult i32 %16, 8
br i1 %21, label %for.cond81.preheader.preheader.loopexit226.unr-lcssa, label %for.cond38.preheader.us.preheader.new
for.cond38.preheader.us.preheader.new: ; preds = %for.cond38.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
%invariant.gep = getelementptr i8, ptr %C, i64 800
%invariant.gep243 = getelementptr i8, ptr %C, i64 1600
%invariant.gep245 = getelementptr i8, ptr %C, i64 2400
%invariant.gep247 = getelementptr i8, ptr %C, i64 3200
%invariant.gep249 = getelementptr i8, ptr %C, i64 4000
%invariant.gep251 = getelementptr i8, ptr %C, i64 4800
%invariant.gep253 = getelementptr i8, ptr %C, i64 5600
br label %for.cond38.preheader.us
for.cond38.preheader.us.us.preheader: ; preds = %for.cond38.preheader.lr.ph.split.us
%wide.trip.count192 = zext i32 %16 to i64
%wide.trip.count187 = zext i32 %17 to i64
%wide.trip.count179 = zext i32 %.lcssa209 to i64
%xtraiter232 = and i64 %wide.trip.count179, 1
%22 = icmp eq i32 %.lcssa209, 1
%unroll_iter236 = and i64 %wide.trip.count179, 4294967294
%lcmp.mod234.not = icmp eq i64 %xtraiter232, 0
br label %for.cond38.preheader.us.us
for.cond38.preheader.us.us: ; preds = %for.cond38.preheader.us.us.preheader, %for.cond38.for.cond.cleanup40_crit_edge.split.us.us.us
%indvars.iv189 = phi i64 [ 0, %for.cond38.preheader.us.us.preheader ], [ %indvars.iv.next190, %for.cond38.for.cond.cleanup40_crit_edge.split.us.us.us ]
br label %for.body41.us.us.us
for.body41.us.us.us: ; preds = %for.cond46.for.cond.cleanup48_crit_edge.us.us.us, %for.cond38.preheader.us.us
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.cond46.for.cond.cleanup48_crit_edge.us.us.us ], [ 0, %for.cond38.preheader.us.us ]
%arrayidx45.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv189, i64 %indvars.iv184
br i1 %22, label %for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa, label %for.body49.us.us.us
for.body49.us.us.us: ; preds = %for.body41.us.us.us, %for.body49.us.us.us
%indvars.iv176 = phi i64 [ %indvars.iv.next177.1, %for.body49.us.us.us ], [ 0, %for.body41.us.us.us ]
%23 = phi i64 [ %add.us.us.us.1, %for.body49.us.us.us ], [ 0, %for.body41.us.us.us ]
%niter237 = phi i64 [ %niter237.next.1, %for.body49.us.us.us ], [ 0, %for.body41.us.us.us ]
%arrayidx57.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv189, i64 %indvars.iv176
%24 = load i64, ptr %arrayidx57.us.us.us, align 16, !tbaa !13
%arrayidx61.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv176, i64 %indvars.iv184
%25 = load i64, ptr %arrayidx61.us.us.us, align 8, !tbaa !13
%mul.us.us.us = mul nsw i64 %25, %24
%add.us.us.us = add nsw i64 %mul.us.us.us, %23
%indvars.iv.next177 = or i64 %indvars.iv176, 1
%arrayidx57.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv189, i64 %indvars.iv.next177
%26 = load i64, ptr %arrayidx57.us.us.us.1, align 8, !tbaa !13
%arrayidx61.us.us.us.1 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv.next177, i64 %indvars.iv184
%27 = load i64, ptr %arrayidx61.us.us.us.1, align 8, !tbaa !13
%mul.us.us.us.1 = mul nsw i64 %27, %26
%add.us.us.us.1 = add nsw i64 %mul.us.us.us.1, %add.us.us.us
%indvars.iv.next177.1 = add nuw nsw i64 %indvars.iv176, 2
%niter237.next.1 = add i64 %niter237, 2
%niter237.ncmp.1 = icmp eq i64 %niter237.next.1, %unroll_iter236
br i1 %niter237.ncmp.1, label %for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa, label %for.body49.us.us.us, !llvm.loop !17
for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body49.us.us.us, %for.body41.us.us.us
%add.us.us.us.lcssa.ph = phi i64 [ undef, %for.body41.us.us.us ], [ %add.us.us.us.1, %for.body49.us.us.us ]
%indvars.iv176.unr = phi i64 [ 0, %for.body41.us.us.us ], [ %indvars.iv.next177.1, %for.body49.us.us.us ]
%.unr = phi i64 [ 0, %for.body41.us.us.us ], [ %add.us.us.us.1, %for.body49.us.us.us ]
br i1 %lcmp.mod234.not, label %for.cond46.for.cond.cleanup48_crit_edge.us.us.us, label %for.body49.us.us.us.epil
for.body49.us.us.us.epil: ; preds = %for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa
%arrayidx57.us.us.us.epil = getelementptr inbounds [100 x [100 x i64]], ptr %A, i64 0, i64 %indvars.iv189, i64 %indvars.iv176.unr
%28 = load i64, ptr %arrayidx57.us.us.us.epil, align 8, !tbaa !13
%arrayidx61.us.us.us.epil = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv176.unr, i64 %indvars.iv184
%29 = load i64, ptr %arrayidx61.us.us.us.epil, align 8, !tbaa !13
%mul.us.us.us.epil = mul nsw i64 %29, %28
%add.us.us.us.epil = add nsw i64 %mul.us.us.us.epil, %.unr
br label %for.cond46.for.cond.cleanup48_crit_edge.us.us.us
for.cond46.for.cond.cleanup48_crit_edge.us.us.us: ; preds = %for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa, %for.body49.us.us.us.epil
%add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond46.for.cond.cleanup48_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body49.us.us.us.epil ]
store i64 %add.us.us.us.lcssa, ptr %arrayidx45.us.us.us, align 8, !tbaa !13
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%exitcond188.not = icmp eq i64 %indvars.iv.next185, %wide.trip.count187
br i1 %exitcond188.not, label %for.cond38.for.cond.cleanup40_crit_edge.split.us.us.us, label %for.body41.us.us.us, !llvm.loop !18
for.cond38.for.cond.cleanup40_crit_edge.split.us.us.us: ; preds = %for.cond46.for.cond.cleanup48_crit_edge.us.us.us
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%exitcond193.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count192
br i1 %exitcond193.not, label %for.cond81.preheader.preheader, label %for.cond38.preheader.us.us, !llvm.loop !19
for.cond38.preheader.us: ; preds = %for.cond38.preheader.us, %for.cond38.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond38.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond38.preheader.us ]
%niter = phi i64 [ 0, %for.cond38.preheader.us.preheader.new ], [ %niter.next.7, %for.cond38.preheader.us ]
%30 = mul nuw nsw i64 %indvar, 800
%scevgep = getelementptr i8, ptr %C, i64 %30
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %20, i1 false), !tbaa !13
%31 = mul nuw i64 %indvar, 800
%gep = getelementptr i8, ptr %invariant.gep, i64 %31
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %20, i1 false), !tbaa !13
%32 = mul nuw i64 %indvar, 800
%gep244 = getelementptr i8, ptr %invariant.gep243, i64 %32
call void @llvm.memset.p0.i64(ptr align 16 %gep244, i8 0, i64 %20, i1 false), !tbaa !13
%33 = mul nuw i64 %indvar, 800
%gep246 = getelementptr i8, ptr %invariant.gep245, i64 %33
call void @llvm.memset.p0.i64(ptr align 16 %gep246, i8 0, i64 %20, i1 false), !tbaa !13
%34 = mul nuw i64 %indvar, 800
%gep248 = getelementptr i8, ptr %invariant.gep247, i64 %34
call void @llvm.memset.p0.i64(ptr align 16 %gep248, i8 0, i64 %20, i1 false), !tbaa !13
%35 = mul nuw i64 %indvar, 800
%gep250 = getelementptr i8, ptr %invariant.gep249, i64 %35
call void @llvm.memset.p0.i64(ptr align 16 %gep250, i8 0, i64 %20, i1 false), !tbaa !13
%36 = mul nuw i64 %indvar, 800
%gep252 = getelementptr i8, ptr %invariant.gep251, i64 %36
call void @llvm.memset.p0.i64(ptr align 16 %gep252, i8 0, i64 %20, i1 false), !tbaa !13
%37 = mul nuw i64 %indvar, 800
%gep254 = getelementptr i8, ptr %invariant.gep253, i64 %37
call void @llvm.memset.p0.i64(ptr align 16 %gep254, i8 0, i64 %20, i1 false), !tbaa !13
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond81.preheader.preheader.loopexit226.unr-lcssa, label %for.cond38.preheader.us, !llvm.loop !19
for.cond.cleanup19.loopexit: ; preds = %for.body20
%.pre202 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup19
for.cond.cleanup19: ; preds = %for.cond.cleanup19.loopexit, %for.cond17.preheader
%38 = phi i32 [ %.pre202, %for.cond.cleanup19.loopexit ], [ %13, %for.cond17.preheader ]
%39 = phi i32 [ %41, %for.cond.cleanup19.loopexit ], [ %14, %for.cond17.preheader ]
%indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
%40 = sext i32 %38 to i64
%cmp13 = icmp slt i64 %indvars.iv.next170, %40
br i1 %cmp13, label %for.cond17.preheader, label %for.cond33.preheader.loopexit, !llvm.loop !20
for.body20: ; preds = %for.cond17.preheader, %for.body20
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.body20 ], [ 0, %for.cond17.preheader ]
%arrayidx24 = getelementptr inbounds [100 x [100 x i64]], ptr %B, i64 0, i64 %indvars.iv169, i64 %indvars.iv166
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx24)
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%41 = load i32, ptr %l, align 4, !tbaa !5
%42 = sext i32 %41 to i64
%cmp18 = icmp slt i64 %indvars.iv.next167, %42
br i1 %cmp18, label %for.body20, label %for.cond.cleanup19.loopexit, !llvm.loop !21
for.cond81.preheader: ; preds = %for.cond81.preheader.preheader, %for.cond.cleanup83
%indvars.iv198 = phi i64 [ %indvars.iv.next199, %for.cond.cleanup83 ], [ 0, %for.cond81.preheader.preheader ]
%43 = load i32, ptr %l, align 4, !tbaa !5
%cmp82153 = icmp sgt i32 %43, 0
br i1 %cmp82153, label %for.inc96.peel, label %for.cond.cleanup83
for.inc96.peel: ; preds = %for.cond81.preheader
%arrayidx87 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv198
%44 = load i64, ptr %arrayidx87, align 16, !tbaa !13
%call90.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %44)
%.pre204 = load i32, ptr %l, align 4, !tbaa !5
%cmp82.peel = icmp sgt i32 %.pre204, 1
br i1 %cmp82.peel, label %for.inc96, label %for.cond.cleanup83
for.cond.cleanup78: ; preds = %for.cond.cleanup83, %for.cond33.preheader
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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
for.cond.cleanup83: ; preds = %for.inc96, %for.inc96.peel, %for.cond81.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
%45 = load i32, ptr %n, align 4, !tbaa !5
%46 = sext i32 %45 to i64
%cmp77 = icmp slt i64 %indvars.iv.next199, %46
br i1 %cmp77, label %for.cond81.preheader, label %for.cond.cleanup78, !llvm.loop !22
for.inc96: ; preds = %for.inc96.peel, %for.inc96
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.inc96 ], [ 1, %for.inc96.peel ]
%arrayidx94 = getelementptr inbounds [100 x [100 x i64]], ptr %C, i64 0, i64 %indvars.iv198, i64 %indvars.iv194
%47 = load i64, ptr %arrayidx94, align 8, !tbaa !13
%call95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %47)
%.pre205 = load i32, ptr %l, align 4, !tbaa !5
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%48 = sext i32 %.pre205 to i64
%cmp82 = icmp slt i64 %indvars.iv.next195, %48
br i1 %cmp82, label %for.inc96, label %for.cond.cleanup83, !llvm.loop !23
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !24}
!24 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#define N 100
int main(){
long a[N][N], b[N][N], c[N][N];
int n, m ,l, sum, i, j, k;
scanf("%d%d%d",&n,&m,&l);
for(i=0;i<n;i++){
for(j=0;j<l;j++){
c[i][j]=0;
}
}
for(i=0;i<n;i++){
for(j=0;j<m;j++){
scanf("%ld",&a[i][j]);
}
}
for(i=0;i<m;i++){
for(j=0;j<l;j++){
scanf("%ld",&b[i][j]);
}
}
for(i=0;i<n;i++){
for(j=0;j<m;j++){
for(k=0;k<l;k++){
c[i][k]+=a[i][j]*b[j][k];
}
}
}
for(i=0;i<n;i++){
for(j=0;j<l;j++){
if(j==l-1) {
printf("%ld\n",c[i][j]);
break;
}
printf("%ld ",c[i][j]);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156315/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156315/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%ld \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x [100 x i64]], align 16
%b = alloca [100 x [100 x i64]], align 16
%c = alloca [100 x [100 x i64]], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp135 = icmp sgt i32 %0, 0
br i1 %cmp135, label %for.cond1.preheader.lr.ph, label %for.cond9.preheader.thread208
for.cond9.preheader.thread208: ; preds = %entry
%.pre203209 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond26.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr %l, align 4, !tbaa !5
%cmp2133 = icmp sgt i32 %1, 0
br i1 %cmp2133, label %for.cond1.preheader.us.preheader, label %for.cond9.preheader.thread
for.cond9.preheader.thread: ; preds = %for.cond1.preheader.lr.ph
%.pre203206 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond12.preheader.lr.ph
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 3
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 7
%4 = icmp ult i32 %0, 8
br i1 %4, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new
for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
%invariant.gep = getelementptr i8, ptr %c, i64 800
%invariant.gep252 = getelementptr i8, ptr %c, i64 1600
%invariant.gep254 = getelementptr i8, ptr %c, i64 2400
%invariant.gep256 = getelementptr i8, ptr %c, i64 3200
%invariant.gep258 = getelementptr i8, ptr %c, i64 4000
%invariant.gep260 = getelementptr i8, ptr %c, i64 4800
%invariant.gep262 = getelementptr i8, ptr %c, i64 5600
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ]
%niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ]
%5 = mul nuw nsw i64 %indvar, 800
%scevgep = getelementptr i8, ptr %c, i64 %5
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %3, i1 false), !tbaa !9
%6 = mul nuw i64 %indvar, 800
%gep = getelementptr i8, ptr %invariant.gep, i64 %6
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %3, i1 false), !tbaa !9
%7 = mul nuw i64 %indvar, 800
%gep253 = getelementptr i8, ptr %invariant.gep252, i64 %7
call void @llvm.memset.p0.i64(ptr align 16 %gep253, i8 0, i64 %3, i1 false), !tbaa !9
%8 = mul nuw i64 %indvar, 800
%gep255 = getelementptr i8, ptr %invariant.gep254, i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %gep255, i8 0, i64 %3, i1 false), !tbaa !9
%9 = mul nuw i64 %indvar, 800
%gep257 = getelementptr i8, ptr %invariant.gep256, i64 %9
call void @llvm.memset.p0.i64(ptr align 16 %gep257, i8 0, i64 %3, i1 false), !tbaa !9
%10 = mul nuw i64 %indvar, 800
%gep259 = getelementptr i8, ptr %invariant.gep258, i64 %10
call void @llvm.memset.p0.i64(ptr align 16 %gep259, i8 0, i64 %3, i1 false), !tbaa !9
%11 = mul nuw i64 %indvar, 800
%gep261 = getelementptr i8, ptr %invariant.gep260, i64 %11
call void @llvm.memset.p0.i64(ptr align 16 %gep261, i8 0, i64 %3, i1 false), !tbaa !9
%12 = mul nuw i64 %indvar, 800
%gep263 = getelementptr i8, ptr %invariant.gep262, i64 %12
call void @llvm.memset.p0.i64(ptr align 16 %gep263, i8 0, i64 %3, i1 false), !tbaa !9
%indvar.next.7 = add nuw nsw i64 %indvar, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !11
for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil
for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ]
%13 = mul nuw nsw i64 %indvar.epil, 800
%scevgep.epil = getelementptr i8, ptr %c, i64 %13
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %3, i1 false), !tbaa !9
%indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !13
for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa
%.pre203 = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp135, label %for.cond12.preheader.lr.ph, label %for.cond26.preheader
for.cond12.preheader.lr.ph: ; preds = %for.cond9.preheader.thread, %for.cond9.preheader
%.pre203207 = phi i32 [ %.pre203206, %for.cond9.preheader.thread ], [ %.pre203, %for.cond9.preheader ]
%14 = icmp sgt i32 %.pre203207, 0
br i1 %14, label %for.cond12.preheader, label %for.cond76.preheader.lr.phthread-pre-split
for.cond12.preheader: ; preds = %for.cond12.preheader.lr.ph, %for.inc23
%15 = phi i32 [ %23, %for.inc23 ], [ %0, %for.cond12.preheader.lr.ph ]
%16 = phi i32 [ %24, %for.inc23 ], [ %.pre203207, %for.cond12.preheader.lr.ph ]
%indvars.iv173 = phi i64 [ %indvars.iv.next174, %for.inc23 ], [ 0, %for.cond12.preheader.lr.ph ]
%cmp13137 = icmp sgt i32 %16, 0
br i1 %cmp13137, label %for.body14, label %for.inc23
for.cond26.preheader: ; preds = %for.inc23, %for.cond9.preheader.thread208, %for.cond9.preheader
%17 = phi i32 [ %0, %for.cond9.preheader ], [ %0, %for.cond9.preheader.thread208 ], [ %23, %for.inc23 ]
%18 = phi i32 [ %.pre203, %for.cond9.preheader ], [ %.pre203209, %for.cond9.preheader.thread208 ], [ %24, %for.inc23 ]
%cmp27143 = icmp sgt i32 %18, 0
%19 = load i32, ptr %l, align 4
%20 = icmp sgt i32 %19, 0
%or.cond = select i1 %cmp27143, i1 %20, i1 false
br i1 %or.cond, label %for.cond29.preheader, label %for.cond43.preheader
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ 0, %for.cond12.preheader ]
%arrayidx18 = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv173, i64 %indvars.iv
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx18)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%21 = load i32, ptr %m, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp13 = icmp slt i64 %indvars.iv.next, %22
br i1 %cmp13, label %for.body14, label %for.inc23.loopexit, !llvm.loop !15
for.inc23.loopexit: ; preds = %for.body14
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.inc23.loopexit, %for.cond12.preheader
%23 = phi i32 [ %.pre, %for.inc23.loopexit ], [ %15, %for.cond12.preheader ]
%24 = phi i32 [ %21, %for.inc23.loopexit ], [ %16, %for.cond12.preheader ]
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
%25 = sext i32 %23 to i64
%cmp10 = icmp slt i64 %indvars.iv.next174, %25
br i1 %cmp10, label %for.cond12.preheader, label %for.cond26.preheader, !llvm.loop !16
for.cond29.preheader: ; preds = %for.cond26.preheader, %for.inc40
%26 = phi i32 [ %44, %for.inc40 ], [ %18, %for.cond26.preheader ]
%27 = phi i32 [ %45, %for.inc40 ], [ %19, %for.cond26.preheader ]
%indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.inc40 ], [ 0, %for.cond26.preheader ]
%cmp30141 = icmp sgt i32 %27, 0
br i1 %cmp30141, label %for.body31, label %for.inc40
for.cond43.preheader.loopexit: ; preds = %for.inc40
%.pre205 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond43.preheader
for.cond43.preheader: ; preds = %for.cond43.preheader.loopexit, %for.cond26.preheader
%28 = phi i32 [ %17, %for.cond26.preheader ], [ %.pre205, %for.cond43.preheader.loopexit ]
%.lcssa = phi i32 [ %18, %for.cond26.preheader ], [ %44, %for.cond43.preheader.loopexit ]
%cmp44149 = icmp sgt i32 %28, 0
br i1 %cmp44149, label %for.cond46.preheader.lr.ph, label %for.end95
for.cond46.preheader.lr.ph: ; preds = %for.cond43.preheader
%cmp47147 = icmp sgt i32 %.lcssa, 0
%29 = load i32, ptr %l, align 4
br i1 %cmp47147, label %for.cond46.preheader.lr.ph.split.us, label %for.cond76.preheader.lr.ph
for.cond46.preheader.lr.ph.split.us: ; preds = %for.cond46.preheader.lr.ph
%cmp50145 = icmp sgt i32 %29, 0
br i1 %cmp50145, label %for.cond46.preheader.us.us.preheader, label %for.end95
for.cond46.preheader.us.us.preheader: ; preds = %for.cond46.preheader.lr.ph.split.us
%wide.trip.count195 = zext i32 %28 to i64
%wide.trip.count190 = zext i32 %.lcssa to i64
%wide.trip.count185 = zext i32 %29 to i64
%min.iters.check = icmp ult i32 %29, 4
%n.vec = and i64 %wide.trip.count185, 4294967292
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count185
br label %for.cond46.preheader.us.us
for.cond46.preheader.us.us: ; preds = %for.cond46.preheader.us.us.preheader, %for.cond46.for.inc70_crit_edge.split.us.us.us
%indvars.iv192 = phi i64 [ 0, %for.cond46.preheader.us.us.preheader ], [ %indvars.iv.next193, %for.cond46.for.inc70_crit_edge.split.us.us.us ]
br label %for.cond49.preheader.us.us.us
for.cond49.preheader.us.us.us: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us, %for.cond46.preheader.us.us
%indvars.iv187 = phi i64 [ %indvars.iv.next188, %for.cond49.for.inc67_crit_edge.us.us.us ], [ 0, %for.cond46.preheader.us.us ]
%arrayidx55.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %a, i64 0, i64 %indvars.iv192, i64 %indvars.iv187
%30 = load i64, ptr %arrayidx55.us.us.us, align 8, !tbaa !9
br i1 %min.iters.check, label %for.body51.us.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond49.preheader.us.us.us
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %30, 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 ]
%31 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv187, i64 %index
%wide.load = load <2 x i64>, ptr %31, align 16, !tbaa !9
%32 = getelementptr inbounds i64, ptr %31, i64 2
%wide.load237 = load <2 x i64>, ptr %32, align 16, !tbaa !9
%33 = mul nsw <2 x i64> %wide.load, %broadcast.splat
%34 = mul nsw <2 x i64> %wide.load237, %broadcast.splat
%35 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv192, i64 %index
%wide.load238 = load <2 x i64>, ptr %35, align 16, !tbaa !9
%36 = getelementptr inbounds i64, ptr %35, i64 2
%wide.load239 = load <2 x i64>, ptr %36, align 16, !tbaa !9
%37 = add nsw <2 x i64> %wide.load238, %33
%38 = add nsw <2 x i64> %wide.load239, %34
store <2 x i64> %37, ptr %35, align 16, !tbaa !9
store <2 x i64> %38, ptr %36, align 16, !tbaa !9
%index.next = add nuw i64 %index, 4
%39 = icmp eq i64 %index.next, %n.vec
br i1 %39, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond49.for.inc67_crit_edge.us.us.us, label %for.body51.us.us.us.preheader
for.body51.us.us.us.preheader: ; preds = %for.cond49.preheader.us.us.us, %middle.block
%indvars.iv182.ph = phi i64 [ 0, %for.cond49.preheader.us.us.us ], [ %n.vec, %middle.block ]
br label %for.body51.us.us.us
for.body51.us.us.us: ; preds = %for.body51.us.us.us.preheader, %for.body51.us.us.us
%indvars.iv182 = phi i64 [ %indvars.iv.next183, %for.body51.us.us.us ], [ %indvars.iv182.ph, %for.body51.us.us.us.preheader ]
%arrayidx59.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv187, i64 %indvars.iv182
%40 = load i64, ptr %arrayidx59.us.us.us, align 8, !tbaa !9
%mul.us.us.us = mul nsw i64 %40, %30
%arrayidx63.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv192, i64 %indvars.iv182
%41 = load i64, ptr %arrayidx63.us.us.us, align 8, !tbaa !9
%add.us.us.us = add nsw i64 %41, %mul.us.us.us
store i64 %add.us.us.us, ptr %arrayidx63.us.us.us, align 8, !tbaa !9
%indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
%exitcond186.not = icmp eq i64 %indvars.iv.next183, %wide.trip.count185
br i1 %exitcond186.not, label %for.cond49.for.inc67_crit_edge.us.us.us, label %for.body51.us.us.us, !llvm.loop !21
for.cond49.for.inc67_crit_edge.us.us.us: ; preds = %for.body51.us.us.us, %middle.block
%indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
%exitcond191.not = icmp eq i64 %indvars.iv.next188, %wide.trip.count190
br i1 %exitcond191.not, label %for.cond46.for.inc70_crit_edge.split.us.us.us, label %for.cond49.preheader.us.us.us, !llvm.loop !22
for.cond46.for.inc70_crit_edge.split.us.us.us: ; preds = %for.cond49.for.inc67_crit_edge.us.us.us
%indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
%exitcond196.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count195
br i1 %exitcond196.not, label %for.cond76.preheader.lr.phthread-pre-split, label %for.cond46.preheader.us.us, !llvm.loop !23
for.body31: ; preds = %for.cond29.preheader, %for.body31
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body31 ], [ 0, %for.cond29.preheader ]
%arrayidx35 = getelementptr inbounds [100 x [100 x i64]], ptr %b, i64 0, i64 %indvars.iv179, i64 %indvars.iv176
%call36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx35)
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%42 = load i32, ptr %l, align 4, !tbaa !5
%43 = sext i32 %42 to i64
%cmp30 = icmp slt i64 %indvars.iv.next177, %43
br i1 %cmp30, label %for.body31, label %for.inc40.loopexit, !llvm.loop !24
for.inc40.loopexit: ; preds = %for.body31
%.pre204 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc40
for.inc40: ; preds = %for.inc40.loopexit, %for.cond29.preheader
%44 = phi i32 [ %.pre204, %for.inc40.loopexit ], [ %26, %for.cond29.preheader ]
%45 = phi i32 [ %42, %for.inc40.loopexit ], [ %27, %for.cond29.preheader ]
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%46 = sext i32 %44 to i64
%cmp27 = icmp slt i64 %indvars.iv.next180, %46
br i1 %cmp27, label %for.cond29.preheader, label %for.cond43.preheader.loopexit, !llvm.loop !25
for.cond76.preheader.lr.phthread-pre-split: ; preds = %for.cond46.for.inc70_crit_edge.split.us.us.us, %for.cond12.preheader.lr.ph
%.pr223 = load i32, ptr %l, align 4, !tbaa !5
br label %for.cond76.preheader.lr.ph
for.cond76.preheader.lr.ph: ; preds = %for.cond76.preheader.lr.phthread-pre-split, %for.cond46.preheader.lr.ph
%47 = phi i32 [ %.pr223, %for.cond76.preheader.lr.phthread-pre-split ], [ %29, %for.cond46.preheader.lr.ph ]
%48 = icmp sgt i32 %47, 0
br i1 %48, label %for.cond76.preheader, label %for.end95
for.cond76.preheaderthread-pre-split: ; preds = %for.inc93
%.pr = load i32, ptr %l, align 4, !tbaa !5
br label %for.cond76.preheader
for.cond76.preheader: ; preds = %for.cond76.preheader.lr.ph, %for.cond76.preheaderthread-pre-split
%49 = phi i32 [ %.pr, %for.cond76.preheaderthread-pre-split ], [ %47, %for.cond76.preheader.lr.ph ]
%indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.cond76.preheaderthread-pre-split ], [ 0, %for.cond76.preheader.lr.ph ]
%cmp77157 = icmp sgt i32 %49, 0
br i1 %cmp77157, label %for.body78, label %for.inc93
for.body78: ; preds = %for.cond76.preheader, %if.end
%indvars.iv197 = phi i64 [ %indvars.iv.next198, %if.end ], [ 0, %for.cond76.preheader ]
%50 = phi i32 [ %54, %if.end ], [ %49, %for.cond76.preheader ]
%sub = add nsw i32 %50, -1
%51 = zext i32 %sub to i64
%cmp79 = icmp eq i64 %indvars.iv197, %51
br i1 %cmp79, label %if.then, label %if.end
if.then: ; preds = %for.body78
%idxprom82 = and i64 %indvars.iv197, 4294967295
%arrayidx83 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv200, i64 %idxprom82
%52 = load i64, ptr %arrayidx83, align 8, !tbaa !9
%call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %52)
br label %for.inc93
if.end: ; preds = %for.body78
%arrayidx88 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv200, i64 %indvars.iv197
%53 = load i64, ptr %arrayidx88, align 8, !tbaa !9
%call89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %53)
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%54 = load i32, ptr %l, align 4, !tbaa !5
%55 = sext i32 %54 to i64
%cmp77 = icmp slt i64 %indvars.iv.next198, %55
br i1 %cmp77, label %for.body78, label %for.inc93, !llvm.loop !26
for.inc93: ; preds = %if.end, %for.cond76.preheader, %if.then
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%56 = load i32, ptr %n, align 4, !tbaa !5
%57 = sext i32 %56 to i64
%cmp74 = icmp slt i64 %indvars.iv.next201, %57
br i1 %cmp74, label %for.cond76.preheaderthread-pre-split, label %for.end95, !llvm.loop !27
for.end95: ; preds = %for.inc93, %for.cond46.preheader.lr.ph.split.us, %for.cond43.preheader, %for.cond76.preheader.lr.ph
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !12, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !12, !20, !19}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !17}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12, !17}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.